summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro16
-rw-r--r--src/3rdparty/iaccessible2/generated/amd64/ia2_api_all.h5
-rw-r--r--src/3rdparty/iaccessible2/generated/amd64/ia2_api_all_i.c7
-rw-r--r--src/3rdparty/iaccessible2/generated/x86/ia2_api_all.h4
-rw-r--r--src/3rdparty/iaccessible2/generated/x86/ia2_api_all_i.c6
-rw-r--r--src/3rdparty/icc/LICENSE.txt10
-rw-r--r--src/3rdparty/icc/qt_attribution.json15
-rw-r--r--src/3rdparty/icc/sRGB2014.iccbin0 -> 3024 bytes
-rw-r--r--src/3rdparty/pcre2/AUTHORS6
-rw-r--r--src/3rdparty/pcre2/LICENCE27
-rw-r--r--src/3rdparty/pcre2/qt_attribution.json6
-rw-r--r--src/3rdparty/pcre2/src/config.h3
-rw-r--r--src/3rdparty/pcre2/src/pcre2.h374
-rw-r--r--src/3rdparty/pcre2/src/pcre2_auto_possess.c26
-rw-r--r--src/3rdparty/pcre2/src/pcre2_compile.c11755
-rw-r--r--src/3rdparty/pcre2/src/pcre2_config.c24
-rw-r--r--src/3rdparty/pcre2/src/pcre2_context.c119
-rw-r--r--src/3rdparty/pcre2/src/pcre2_dfa_match.c441
-rw-r--r--src/3rdparty/pcre2/src/pcre2_error.c41
-rw-r--r--src/3rdparty/pcre2/src/pcre2_find_bracket.c2
-rw-r--r--src/3rdparty/pcre2/src/pcre2_internal.h158
-rw-r--r--src/3rdparty/pcre2/src/pcre2_intmodedep.h180
-rw-r--r--src/3rdparty/pcre2/src/pcre2_jit_compile.c3276
-rw-r--r--src/3rdparty/pcre2/src/pcre2_jit_match.c8
-rw-r--r--src/3rdparty/pcre2/src/pcre2_match.c8429
-rw-r--r--src/3rdparty/pcre2/src/pcre2_match_data.c6
-rw-r--r--src/3rdparty/pcre2/src/pcre2_ord2utf.c2
-rw-r--r--src/3rdparty/pcre2/src/pcre2_pattern_info.c32
-rw-r--r--src/3rdparty/pcre2/src/pcre2_serialize.c5
-rw-r--r--src/3rdparty/pcre2/src/pcre2_study.c192
-rw-r--r--src/3rdparty/pcre2/src/pcre2_substitute.c14
-rw-r--r--src/3rdparty/pcre2/src/pcre2_tables.c448
-rw-r--r--src/3rdparty/pcre2/src/pcre2_ucd.c5447
-rw-r--r--src/3rdparty/pcre2/src/pcre2_ucp.h44
-rw-r--r--src/3rdparty/pcre2/src/pcre2_valid_utf.c14
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitConfig.h14
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h77
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c12
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitLir.c559
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitLir.h639
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeARM_32.c1210
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c224
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c845
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_32.c267
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_64.c270
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_common.c555
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativePPC_32.c115
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativePPC_64.c162
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativePPC_common.c462
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_32.c27
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_common.c152
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX-encoder.c2
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX_64.c38
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeX86_32.c154
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeX86_64.c147
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitNativeX86_common.c774
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitUtils.c69
-rw-r--r--src/3rdparty/sqlite.pri2
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java33
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java44
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java1
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java8
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java72
-rw-r--r--src/android/templates/AndroidManifest.xml2
-rw-r--r--src/corelib/codecs/qtextcodec.cpp49
-rw-r--r--src/corelib/codecs/qtextcodec.h13
-rw-r--r--src/corelib/configure.json87
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/debug_script.py98
-rw-r--r--src/corelib/doc/snippets/code/doc_src_qpair.cpp7
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp17
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp5
-rw-r--r--src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp16
-rw-r--r--src/corelib/doc/snippets/qstring/main.cpp17
-rw-r--r--src/corelib/doc/snippets/qversionnumber/main.cpp8
-rw-r--r--src/corelib/doc/snippets/signalmapper/filereader.cpp117
-rw-r--r--src/corelib/doc/src/objectmodel/signalsandslots.qdoc22
-rw-r--r--src/corelib/global/global.pri20
-rw-r--r--src/corelib/global/minimum-linux.S106
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h7
-rw-r--r--src/corelib/global/qendian.h235
-rw-r--r--src/corelib/global/qendian.qdoc369
-rw-r--r--src/corelib/global/qendian_p.h142
-rw-r--r--src/corelib/global/qfloat16.cpp24
-rw-r--r--src/corelib/global/qglobal.cpp307
-rw-r--r--src/corelib/global/qglobal.h48
-rw-r--r--src/corelib/global/qlogging.cpp28
-rw-r--r--src/corelib/global/qnamespace.h10
-rw-r--r--src/corelib/global/qnamespace.qdoc25
-rw-r--r--src/corelib/global/qnumeric.h18
-rw-r--r--src/corelib/global/qnumeric_p.h54
-rw-r--r--src/corelib/global/qrandom.cpp1050
-rw-r--r--src/corelib/global/qrandom.h154
-rw-r--r--src/corelib/global/qrandom_p.h (renamed from src/corelib/tools/qpodlist_p.h)71
-rw-r--r--src/corelib/global/qtypeinfo.h10
-rw-r--r--src/corelib/io/io.pri8
-rw-r--r--src/corelib/io/qabstractfileengine.cpp47
-rw-r--r--src/corelib/io/qabstractfileengine_p.h9
-rw-r--r--src/corelib/io/qdatastream.cpp32
-rw-r--r--src/corelib/io/qdatastream.h5
-rw-r--r--src/corelib/io/qdebug.cpp15
-rw-r--r--src/corelib/io/qdebug.h3
-rw-r--r--src/corelib/io/qfile.cpp122
-rw-r--r--src/corelib/io/qfile.h1
-rw-r--r--src/corelib/io/qfiledevice.cpp70
-rw-r--r--src/corelib/io/qfiledevice.h11
-rw-r--r--src/corelib/io/qfileinfo.cpp341
-rw-r--r--src/corelib/io/qfileinfo.h11
-rw-r--r--src/corelib/io/qfileinfo_p.h48
-rw-r--r--src/corelib/io/qfilesystemengine.cpp226
-rw-r--r--src/corelib/io/qfilesystemengine_p.h10
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp893
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp317
-rw-r--r--src/corelib/io/qfilesystementry.cpp5
-rw-r--r--src/corelib/io/qfilesystementry_p.h5
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h60
-rw-r--r--src/corelib/io/qfsfileengine.cpp35
-rw-r--r--src/corelib/io/qfsfileengine_p.h2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp148
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp58
-rw-r--r--src/corelib/io/qiodevice.cpp122
-rw-r--r--src/corelib/io/qiodevice.h1
-rw-r--r--src/corelib/io/qiodevice_p.h3
-rw-r--r--src/corelib/io/qlockfile_unix.cpp12
-rw-r--r--src/corelib/io/qprocess.cpp99
-rw-r--r--src/corelib/io/qprocess.h1
-rw-r--r--src/corelib/io/qprocess_p.h6
-rw-r--r--src/corelib/io/qprocess_unix.cpp129
-rw-r--r--src/corelib/io/qprocess_win.cpp127
-rw-r--r--src/corelib/io/qresource.cpp50
-rw-r--r--src/corelib/io/qsavefile.cpp39
-rw-r--r--src/corelib/io/qsettings.cpp80
-rw-r--r--src/corelib/io/qsettings.h2
-rw-r--r--src/corelib/io/qsettings_p.h3
-rw-r--r--src/corelib/io/qstandardpaths.cpp6
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp8
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp10
-rw-r--r--src/corelib/io/qstorageinfo.cpp35
-rw-r--r--src/corelib/io/qstorageinfo.h7
-rw-r--r--src/corelib/io/qtemporarydir.cpp83
-rw-r--r--src/corelib/io/qtemporaryfile.cpp502
-rw-r--r--src/corelib/io/qtemporaryfile.h4
-rw-r--r--src/corelib/io/qtemporaryfile_p.h52
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/io/qtldurl.cpp42
-rw-r--r--src/corelib/io/qwindowspipereader.cpp13
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp8
-rw-r--r--src/corelib/io/qwindowspipewriter_p.h1
-rw-r--r--src/corelib/io/qwinoverlappedionotifier.cpp428
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp385
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h4
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp2
-rw-r--r--src/corelib/json/qjson.cpp13
-rw-r--r--src/corelib/json/qjson_p.h129
-rw-r--r--src/corelib/json/qjsonarray.cpp21
-rw-r--r--src/corelib/json/qjsonarray.h22
-rw-r--r--src/corelib/json/qjsondocument.cpp74
-rw-r--r--src/corelib/json/qjsondocument.h23
-rw-r--r--src/corelib/json/qjsonobject.cpp22
-rw-r--r--src/corelib/json/qjsonobject.h21
-rw-r--r--src/corelib/json/qjsonvalue.cpp78
-rw-r--r--src/corelib/json/qjsonvalue.h29
-rw-r--r--src/corelib/kernel/kernel.pri3
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp3
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.h2
-rw-r--r--src/corelib/kernel/qcore_mac.cpp10
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm79
-rw-r--r--src/corelib/kernel/qcore_mac_p.h56
-rw-r--r--src/corelib/kernel/qcore_unix.cpp33
-rw-r--r--src/corelib/kernel/qcore_unix_p.h24
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp123
-rw-r--r--src/corelib/kernel/qcoreapplication.h1
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h10
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp60
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h1
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp67
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h2
-rw-r--r--src/corelib/kernel/qfunctions_fake_env_p.h2
-rw-r--r--src/corelib/kernel/qjnihelpers.cpp40
-rw-r--r--src/corelib/kernel/qjnihelpers_p.h16
-rw-r--r--src/corelib/kernel/qmath.h24
-rw-r--r--src/corelib/kernel/qmath.qdoc19
-rw-r--r--src/corelib/kernel/qmetaobject.cpp99
-rw-r--r--src/corelib/kernel/qmetaobject_p.h3
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp36
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder_p.h3
-rw-r--r--src/corelib/kernel/qmetatype.cpp1
-rw-r--r--src/corelib/kernel/qmetatype.h47
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qobject_impl.h78
-rw-r--r--src/corelib/kernel/qobject_p.h3
-rw-r--r--src/corelib/kernel/qobjectdefs.h89
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h94
-rw-r--r--src/corelib/kernel/qsignalmapper.cpp8
-rw-r--r--src/corelib/kernel/qsignalmapper.h6
-rw-r--r--src/corelib/kernel/qtimer.h8
-rw-r--r--src/corelib/kernel/qvariant.cpp162
-rw-r--r--src/corelib/kernel/qvariant_p.h10
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp60
-rw-r--r--src/corelib/kernel/qwineventnotifier_p.h (renamed from src/corelib/io/qwinoverlappedionotifier_p.h)47
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp8
-rw-r--r--src/corelib/mimetypes/qmimeprovider_p.h2
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp90
-rw-r--r--src/corelib/mimetypes/qmimetype.h18
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp1
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp8
-rw-r--r--src/corelib/plugin/quuid.cpp313
-rw-r--r--src/corelib/plugin/quuid.h3
-rw-r--r--src/corelib/thread/qmutex.cpp2
-rw-r--r--src/corelib/thread/qresultstore.h2
-rw-r--r--src/corelib/thread/qsemaphore.cpp153
-rw-r--r--src/corelib/thread/qsemaphore.h39
-rw-r--r--src/corelib/thread/qthread.cpp47
-rw-r--r--src/corelib/thread/qthread.h124
-rw-r--r--src/corelib/thread/qthread_p.h4
-rw-r--r--src/corelib/thread/qthread_unix.cpp151
-rw-r--r--src/corelib/thread/qthread_win.cpp4
-rw-r--r--src/corelib/thread/qthreadpool.cpp35
-rw-r--r--src/corelib/thread/qthreadpool.h4
-rw-r--r--src/corelib/thread/qthreadpool_p.h12
-rw-r--r--src/corelib/tools/qbytearray.cpp100
-rw-r--r--src/corelib/tools/qbytearray.h85
-rw-r--r--src/corelib/tools/qchar.cpp23
-rw-r--r--src/corelib/tools/qchar.h7
-rw-r--r--src/corelib/tools/qcryptographichash.cpp59
-rw-r--r--src/corelib/tools/qcryptographichash.h7
-rw-r--r--src/corelib/tools/qdatetime.cpp214
-rw-r--r--src/corelib/tools/qdatetime.h29
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp1005
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h40
-rw-r--r--src/corelib/tools/qhash.cpp178
-rw-r--r--src/corelib/tools/qhash.h11
-rw-r--r--src/corelib/tools/qhashfunctions.h8
-rw-r--r--src/corelib/tools/qiterator.h151
-rw-r--r--src/corelib/tools/qlinkedlist.h4
-rw-r--r--src/corelib/tools/qlist.h6
-rw-r--r--src/corelib/tools/qlocale.cpp441
-rw-r--r--src/corelib/tools/qlocale.h36
-rw-r--r--src/corelib/tools/qlocale.qdoc2
-rw-r--r--src/corelib/tools/qlocale_data_p.h9174
-rw-r--r--src/corelib/tools/qlocale_mac.mm4
-rw-r--r--src/corelib/tools/qlocale_p.h62
-rw-r--r--src/corelib/tools/qlocale_win.cpp6
-rw-r--r--src/corelib/tools/qmap.cpp67
-rw-r--r--src/corelib/tools/qmap.h10
-rw-r--r--src/corelib/tools/qmessageauthenticationcode.cpp4
-rw-r--r--src/corelib/tools/qrect.h2
-rw-r--r--src/corelib/tools/qregularexpression.cpp172
-rw-r--r--src/corelib/tools/qregularexpression.h15
-rw-r--r--src/corelib/tools/qringbuffer_p.h2
-rw-r--r--src/corelib/tools/qscopedpointer.cpp6
-rw-r--r--src/corelib/tools/qscopedpointer.h13
-rw-r--r--src/corelib/tools/qsimd_p.h10
-rw-r--r--src/corelib/tools/qstring.cpp1410
-rw-r--r--src/corelib/tools/qstring.h243
-rw-r--r--src/corelib/tools/qstringalgorithms.h82
-rw-r--r--src/corelib/tools/qstringalgorithms_p.h8
-rw-r--r--src/corelib/tools/qstringbuilder.h7
-rw-r--r--src/corelib/tools/qstringiterator.qdoc8
-rw-r--r--src/corelib/tools/qstringiterator_p.h10
-rw-r--r--src/corelib/tools/qstringlist.cpp34
-rw-r--r--src/corelib/tools/qstringlist.h7
-rw-r--r--src/corelib/tools/qstringliteral.h128
-rw-r--r--src/corelib/tools/qstringview.cpp777
-rw-r--r--src/corelib/tools/qstringview.h305
-rw-r--r--src/corelib/tools/qtimezone.cpp7
-rw-r--r--src/corelib/tools/qtimezone.h8
-rw-r--r--src/corelib/tools/qtimezoneprivate.cpp2
-rw-r--r--src/corelib/tools/qtimezoneprivate_data_p.h5
-rw-r--r--src/corelib/tools/qtimezoneprivate_icu.cpp5
-rw-r--r--src/corelib/tools/qtimezoneprivate_mac.mm88
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp40
-rw-r--r--src/corelib/tools/qtimezoneprivate_win.cpp2
-rw-r--r--src/corelib/tools/qvarlengtharray.h5
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc6
-rw-r--r--src/corelib/tools/qvector.h9
-rw-r--r--src/corelib/tools/qvector.qdoc7
-rw-r--r--src/corelib/tools/qversionnumber.cpp53
-rw-r--r--src/corelib/tools/qversionnumber.h4
-rw-r--r--src/corelib/tools/tools.pri5
-rw-r--r--src/corelib/xml/qxmlstream.cpp70
-rw-r--r--src/corelib/xml/qxmlstream.g105
-rw-r--r--src/corelib/xml/qxmlstream_p.h73
-rw-r--r--src/corelib/xml/qxmlutils.cpp37
-rw-r--r--src/corelib/xml/qxmlutils_p.h7
-rw-r--r--src/dbus/qdbusserver.cpp8
-rw-r--r--src/gui/configure.json54
-rw-r--r--src/gui/doc/qtgui.qdocconf1
-rw-r--r--src/gui/doc/src/external-resources.qdoc10
-rw-r--r--src/gui/doc/src/qtgui.qdoc35
-rw-r--r--src/gui/gui.pro1
-rw-r--r--src/gui/image/qbmphandler.cpp4
-rw-r--r--src/gui/image/qicon.cpp7
-rw-r--r--src/gui/image/qiconloader.cpp14
-rw-r--r--src/gui/image/qiconloader_p.h3
-rw-r--r--src/gui/image/qimage.cpp43
-rw-r--r--src/gui/image/qimage.h7
-rw-r--r--src/gui/image/qimage_conversions.cpp64
-rw-r--r--src/gui/image/qimage_darwin.mm2
-rw-r--r--src/gui/image/qimage_p.h4
-rw-r--r--src/gui/image/qimagereader.cpp11
-rw-r--r--src/gui/image/qimagewriter.cpp10
-rw-r--r--src/gui/image/qimagewriter.h3
-rw-r--r--src/gui/image/qmovie.cpp48
-rw-r--r--src/gui/image/qmovie.h2
-rw-r--r--src/gui/image/qpicture.cpp2
-rw-r--r--src/gui/image/qpicture.h12
-rw-r--r--src/gui/image/qpixmap.cpp71
-rw-r--r--src/gui/image/qpixmap_blitter.cpp4
-rw-r--r--src/gui/image/qplatformpixmap.cpp76
-rw-r--r--src/gui/image/qplatformpixmap.h8
-rw-r--r--src/gui/image/qxpmhandler.cpp5
-rw-r--r--src/gui/kernel/qclipboard.cpp2
-rw-r--r--src/gui/kernel/qcursor.cpp48
-rw-r--r--src/gui/kernel/qcursor.h4
-rw-r--r--src/gui/kernel/qdnd.cpp5
-rw-r--r--src/gui/kernel/qdnd_p.h1
-rw-r--r--src/gui/kernel/qevent.cpp6
-rw-r--r--src/gui/kernel/qguiapplication.cpp109
-rw-r--r--src/gui/kernel/qguiapplication_p.h1
-rw-r--r--src/gui/kernel/qkeysequence.cpp18
-rw-r--r--src/gui/kernel/qkeysequence_p.h2
-rw-r--r--src/gui/kernel/qoffscreensurface.cpp20
-rw-r--r--src/gui/kernel/qoffscreensurface.h3
-rw-r--r--src/gui/kernel/qopenglcontext.cpp55
-rw-r--r--src/gui/kernel/qopenglcontext.h7
-rw-r--r--src/gui/kernel/qpalette.cpp8
-rw-r--r--src/gui/kernel/qplatformcursor.cpp41
-rw-r--r--src/gui/kernel/qplatformcursor.h17
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp26
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h5
-rw-r--r--src/gui/kernel/qplatformdrag.h1
-rw-r--r--src/gui/kernel/qplatformintegration.cpp31
-rw-r--r--src/gui/kernel/qplatformintegration.h10
-rw-r--r--src/gui/kernel/qplatformmenu.cpp31
-rw-r--r--src/gui/kernel/qplatformmenu.h18
-rw-r--r--src/gui/kernel/qplatformoffscreensurface.h4
-rw-r--r--src/gui/kernel/qplatformsystemtrayicon.cpp11
-rw-r--r--src/gui/kernel/qplatformsystemtrayicon.h2
-rw-r--r--src/gui/kernel/qplatformtheme.cpp4
-rw-r--r--src/gui/kernel/qplatformtheme.h3
-rw-r--r--src/gui/kernel/qplatformwindow.cpp29
-rw-r--r--src/gui/kernel/qplatformwindow.h8
-rw-r--r--src/gui/kernel/qscreen.cpp4
-rw-r--r--src/gui/kernel/qsimpledrag.cpp7
-rw-r--r--src/gui/kernel/qsimpledrag_p.h1
-rw-r--r--src/gui/kernel/qstylehints.cpp11
-rw-r--r--src/gui/kernel/qstylehints.h2
-rw-r--r--src/gui/kernel/qsurface.cpp2
-rw-r--r--src/gui/kernel/qsurface.h1
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp69
-rw-r--r--src/gui/kernel/qsurfaceformat.h9
-rw-r--r--src/gui/kernel/qwindow.cpp302
-rw-r--r--src/gui/kernel/qwindow.h10
-rw-r--r--src/gui/kernel/qwindow_p.h12
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp57
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h29
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h12
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp6
-rw-r--r--src/gui/math3d/qquaternion.cpp4
-rw-r--r--src/gui/opengl/qopengl.h4
-rw-r--r--src/gui/opengl/qopenglextrafunctions.h496
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp582
-rw-r--r--src/gui/opengl/qopengltexture.cpp50
-rw-r--r--src/gui/opengl/qopengltexture.h9
-rw-r--r--src/gui/painting/painting.pri3
-rw-r--r--src/gui/painting/qbackingstore.cpp129
-rw-r--r--src/gui/painting/qbackingstore.h4
-rw-r--r--src/gui/painting/qbrush.cpp2
-rw-r--r--src/gui/painting/qcolor.cpp33
-rw-r--r--src/gui/painting/qcolor.h16
-rw-r--r--src/gui/painting/qcompositionfunctions.cpp792
-rw-r--r--src/gui/painting/qcoregraphics.mm2
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp2
-rw-r--r--src/gui/painting/qdrawhelper.cpp707
-rw-r--r--src/gui/painting/qdrawhelper_avx2.cpp19
-rw-r--r--src/gui/painting/qdrawhelper_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp4
-rw-r--r--src/gui/painting/qemulationpaintengine.cpp84
-rw-r--r--src/gui/painting/qgrayraster.c809
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp12
-rw-r--r--src/gui/painting/qpagedpaintdevice.h2
-rw-r--r--src/gui/painting/qpaintengine.cpp8
-rw-r--r--src/gui/painting/qpaintengine_p.h25
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp10
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h2
-rw-r--r--src/gui/painting/qpainter.cpp8
-rw-r--r--src/gui/painting/qpdf.cpp305
-rw-r--r--src/gui/painting/qpdf.qrc7
-rw-r--r--src/gui/painting/qpdf_p.h11
-rw-r--r--src/gui/painting/qpdfa_metadata.xml16
-rw-r--r--src/gui/painting/qpdfwriter.cpp31
-rw-r--r--src/gui/painting/qpdfwriter.h3
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp45
-rw-r--r--src/gui/painting/qplatformbackingstore.h5
-rw-r--r--src/gui/painting/qpolygon.cpp43
-rw-r--r--src/gui/painting/qpolygon.h4
-rw-r--r--src/gui/text/qdistancefield.cpp12
-rw-r--r--src/gui/text/qfont.cpp5
-rw-r--r--src/gui/text/qfont.h8
-rw-r--r--src/gui/text/qfontengine.cpp4
-rw-r--r--src/gui/text/qfontengine_p.h6
-rw-r--r--src/gui/text/qfontmetrics.cpp2
-rw-r--r--src/gui/text/qfontsubset.cpp8
-rw-r--r--src/gui/text/qstatictext.h2
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocument_p.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp87
-rw-r--r--src/gui/text/qtextengine_p.h17
-rw-r--r--src/gui/text/qtextformat.cpp34
-rw-r--r--src/gui/text/qtexthtmlparser.cpp14
-rw-r--r--src/gui/text/qtexthtmlparser_p.h1
-rw-r--r--src/gui/text/qtextlayout.cpp58
-rw-r--r--src/gui/text/qtextoption.cpp33
-rw-r--r--src/gui/text/qtextoption.h14
-rw-r--r--src/gui/util/qshaderformat.cpp130
-rw-r--r--src/gui/util/qshaderformat_p.h109
-rw-r--r--src/gui/util/qshadergenerator.cpp351
-rw-r--r--src/gui/util/qshadergenerator_p.h75
-rw-r--r--src/gui/util/qshadergraph.cpp262
-rw-r--r--src/gui/util/qshadergraph_p.h123
-rw-r--r--src/gui/util/qshadergraphloader.cpp251
-rw-r--r--src/gui/util/qshadergraphloader_p.h99
-rw-r--r--src/gui/util/qshaderlanguage.cpp56
-rw-r--r--src/gui/util/qshaderlanguage_p.h163
-rw-r--r--src/gui/util/qshadernode.cpp172
-rw-r--r--src/gui/util/qshadernode_p.h128
-rw-r--r--src/gui/util/qshadernodeport.cpp55
-rw-r--r--src/gui/util/qshadernodeport_p.h88
-rw-r--r--src/gui/util/qshadernodesloader.cpp274
-rw-r--r--src/gui/util/qshadernodesloader_p.h95
-rw-r--r--src/gui/util/qvalidator.cpp12
-rw-r--r--src/gui/util/util.pri20
-rw-r--r--src/gui/vulkan/KHRONOS_LICENSE.txt20
-rw-r--r--src/gui/vulkan/qplatformvulkaninstance.cpp88
-rw-r--r--src/gui/vulkan/qplatformvulkaninstance.h91
-rw-r--r--src/gui/vulkan/qt_attribution.json17
-rw-r--r--src/gui/vulkan/qvulkanfunctions.cpp177
-rw-r--r--src/gui/vulkan/qvulkaninstance.cpp894
-rw-r--r--src/gui/vulkan/qvulkaninstance.h198
-rw-r--r--src/gui/vulkan/qvulkanwindow.cpp2720
-rw-r--r--src/gui/vulkan/qvulkanwindow.h161
-rw-r--r--src/gui/vulkan/qvulkanwindow_p.h188
-rw-r--r--src/gui/vulkan/vk.xml5269
-rw-r--r--src/gui/vulkan/vulkan.pri55
-rw-r--r--src/network/access/access.pri6
-rw-r--r--src/network/access/http2/http2frames.cpp6
-rw-r--r--src/network/access/http2/http2frames_p.h2
-rw-r--r--src/network/access/http2/http2protocol.cpp75
-rw-r--r--src/network/access/http2/http2protocol_p.h6
-rw-r--r--src/network/access/qhsts.cpp61
-rw-r--r--src/network/access/qhsts_p.h7
-rw-r--r--src/network/access/qhstsstore.cpp202
-rw-r--r--src/network/access/qhstsstore_p.h93
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp38
-rw-r--r--src/network/access/qhttp2protocolhandler_p.h4
-rw-r--r--src/network/access/qhttpmultipart.cpp21
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp43
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h2
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp100
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h5
-rw-r--r--src/network/access/qhttpnetworkheader_p.h2
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp16
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h4
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp22
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp46
-rw-r--r--src/network/access/qnetworkaccessmanager.h3
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h2
-rw-r--r--src/network/access/qnetworkreply.cpp6
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp17
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h5
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp2
-rw-r--r--src/network/configure.json14
-rw-r--r--src/network/kernel/kernel.pri2
-rw-r--r--src/network/kernel/qhostaddress.cpp35
-rw-r--r--src/network/kernel/qhostinfo.cpp21
-rw-r--r--src/network/kernel/qhostinfo.h9
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp58
-rw-r--r--src/network/kernel/qnetworkproxy.cpp48
-rw-r--r--src/network/kernel/qnetworkproxy.h9
-rw-r--r--src/network/socket/qabstractsocket.cpp13
-rw-r--r--src/network/socket/qlocalserver.cpp40
-rw-r--r--src/network/socket/qlocalserver.h2
-rw-r--r--src/network/socket/qlocalsocket.cpp14
-rw-r--r--src/network/socket/qlocalsocket_win.cpp4
-rw-r--r--src/network/socket/qnativesocketengine.cpp3
-rw-r--r--src/network/socket/qnativesocketengine_p.h2
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp20
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp4
-rw-r--r--src/network/socket/qtcpserver_p.h3
-rw-r--r--src/network/ssl/qsslcertificate_openssl.cpp57
-rw-r--r--src/network/ssl/qsslcertificate_qt.cpp17
-rw-r--r--src/network/ssl/qsslcontext_openssl.cpp309
-rw-r--r--src/network/ssl/qsslcontext_openssl11.cpp277
-rw-r--r--src/network/ssl/qsslcontext_opensslpre11.cpp354
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters_openssl.cpp38
-rw-r--r--src/network/ssl/qsslellipticcurve.h1
-rw-r--r--src/network/ssl/qsslellipticcurve_openssl.cpp8
-rw-r--r--src/network/ssl/qsslkey_openssl.cpp79
-rw-r--r--src/network/ssl/qsslsocket.cpp13
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp24
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp387
-rw-r--r--src/network/ssl/qsslsocket_openssl11.cpp285
-rw-r--r--src/network/ssl/qsslsocket_openssl11_symbols_p.h132
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h8
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp499
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h122
-rw-r--r--src/network/ssl/qsslsocket_opensslpre11.cpp424
-rw-r--r--src/network/ssl/qsslsocket_opensslpre11_symbols_p.h230
-rw-r--r--src/network/ssl/qsslsocket_p.h1
-rw-r--r--src/network/ssl/ssl.pri18
-rw-r--r--src/platformheaders/cocoafunctions/qcocoawindowfunctions.h6
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.mm131
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.pro17
-rw-r--r--src/platformsupport/clipboard/clipboard.pro1
-rw-r--r--src/platformsupport/clipboard/qmacmime.mm85
-rw-r--r--src/platformsupport/edid/edid.pro13
-rw-r--r--src/platformsupport/edid/qedidparser.cpp177
-rw-r--r--src/platformsupport/edid/qedidparser_p.h (renamed from src/platformsupport/cglconvenience/cglconvenience_p.h)39
-rw-r--r--src/platformsupport/edid/qedidvendortable_p.h2296
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp56
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h3
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow.cpp2
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow_p.h4
-rw-r--r--src/platformsupport/fontdatabases/mac/coretext.pri16
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h8
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp16
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h2
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience.cpp48
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience_p.h15
-rw-r--r--src/platformsupport/graphics/qrasterbackingstore.cpp28
-rw-r--r--src/platformsupport/graphics/qrasterbackingstore_p.h1
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp2
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h2
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp6
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h2
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp18
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h8
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp34
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h7
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp6
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h3
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp7
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h2
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp4
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h2
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp7
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h2
-rw-r--r--src/platformsupport/input/libinput/qlibinputhandler.cpp22
-rw-r--r--src/platformsupport/input/libinput/qlibinputhandler_p.h8
-rw-r--r--src/platformsupport/input/libinput/qlibinputkeyboard_p.h3
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer.cpp23
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice.cpp24
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice_p.h3
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp130
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp4
-rw-r--r--src/platformsupport/platformsupport.pro6
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp20
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h16
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustraytypes.cpp2
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp8
-rw-r--r--src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp357
-rw-r--r--src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h106
-rw-r--r--src/platformsupport/vkconvenience/vkconvenience.pro16
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux.cpp2
-rw-r--r--src/plugins/generic/tuiotouch/qoscbundle.cpp6
-rw-r--r--src/plugins/generic/tuiotouch/qoscmessage.cpp2
-rw-r--r--src/plugins/generic/tuiotouch/qtuiohandler.cpp41
-rw-r--r--src/plugins/imageformats/gif/main.h4
-rw-r--r--src/plugins/imageformats/gif/qgifhandler.cpp4
-rw-r--r--src/plugins/imageformats/gif/qgifhandler_p.h22
-rw-r--r--src/plugins/imageformats/ico/ico.pro1
-rw-r--r--src/plugins/imageformats/ico/main.h4
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp128
-rw-r--r--src/plugins/imageformats/ico/qicohandler.h18
-rw-r--r--src/plugins/imageformats/jpeg/main.h4
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler_p.h14
-rw-r--r--src/plugins/platforms/android/android.pro9
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp4
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp17
-rw-r--r--src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp6
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.cpp37
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.h7
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenu.cpp11
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenu.h3
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenuitem.cpp11
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenuitem.h3
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.cpp22
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.h4
-rw-r--r--src/plugins/platforms/android/qandroidplatformvulkaninstance.cpp66
-rw-r--r--src/plugins/platforms/android/qandroidplatformvulkaninstance.h63
-rw-r--r--src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp210
-rw-r--r--src/plugins/platforms/android/qandroidplatformvulkanwindow.h91
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.cpp5
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.h4
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm239
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm18
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm63
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.h129
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm12
-rw-r--r--src/plugins/platforms/cocoa/qcocoakeymapper.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamimetypes.mm92
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm104
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h135
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm1510
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h18
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm335
-rw-r--r--src/plugins/platforms/cocoa/qnswindow.h74
-rw-r--r--src/plugins/platforms/cocoa/qnswindow.mm299
-rw-r--r--src/plugins/platforms/direct2d/direct2d.pro2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp17
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.h2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp5
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.h1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp82
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.h5
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp57
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h11
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp71
-rw-r--r--src/plugins/platforms/haiku/qhaikuwindow.cpp23
-rw-r--r--src/plugins/platforms/haiku/qhaikuwindow.h4
-rw-r--r--src/plugins/platforms/ios/qiosclipboard.mm14
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.mm2
-rw-r--r--src/plugins/platforms/ios/qiosmenu.h8
-rw-r--r--src/plugins/platforms/ios/qiosmenu.mm22
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm7
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm4
-rw-r--r--src/plugins/platforms/ios/qioswindow.h2
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm28
-rw-r--r--src/plugins/platforms/ios/quiview.mm31
-rw-r--r--src/plugins/platforms/ios/quiview_accessibility.mm2
-rw-r--r--src/plugins/platforms/mirclient/qmirclientwindow.cpp12
-rw-r--r--src/plugins/platforms/mirclient/qmirclientwindow.h2
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.h1
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp12
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.h4
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenwindow.cpp23
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenwindow.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp27
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h4
-rw-r--r--src/plugins/platforms/vnc/qvncintegration.cpp3
-rw-r--r--src/plugins/platforms/windows/accessible/accessible.pri15
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp190
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.h47
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp10
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp138
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h36
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h8
-rw-r--r--src/plugins/platforms/windows/qwindowscombase.h112
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp101
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h8
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp30
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h7
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp36
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp73
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.h11
-rw-r--r--src/plugins/platforms/windows/qwindowsdropdataobject.cpp98
-rw-r--r--src/plugins/platforms/windows/qwindowsdropdataobject.h63
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp72
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.h7
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp30
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h8
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsmenu.cpp962
-rw-r--r--src/plugins/platforms/windows/qwindowsmenu.h243
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowsole.cpp62
-rw-r--r--src/plugins/platforms/windows/qwindowsole.h17
-rw-r--r--src/plugins/platforms/windows/qwindowssystemtrayicon.cpp443
-rw-r--r--src/plugins/platforms/windows/qwindowssystemtrayicon.h103
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp70
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.h10
-rw-r--r--src/plugins/platforms/windows/qwindowsvulkaninstance.cpp136
-rw-r--r--src/plugins/platforms/windows/qwindowsvulkaninstance.h76
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp322
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h38
-rw-r--r--src/plugins/platforms/windows/windows.pri15
-rw-r--r--src/plugins/platforms/windows/windows.pro2
-rw-r--r--src/plugins/platforms/winrt/qwinrtdrag.cpp6
-rw-r--r--src/plugins/platforms/winrt/qwinrtdrag.h1
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.cpp3
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp21
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.h2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h17
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp1
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp30
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h1
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp13
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp18
-rw-r--r--src/plugins/platforms/xcb/nativepainting/nativepainting.pri22
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp203
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h70
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp644
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h75
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp2837
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h118
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp2108
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h160
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qt_x11_p.h193
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qtessellator.cpp1494
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qtessellator_p.h83
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp315
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h96
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp102
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.cpp86
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp662
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h177
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp1012
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp131
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbimage.cpp32
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp63
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h7
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp98
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp81
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h15
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp603
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h71
-rw-r--r--src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp38
-rw-r--r--src/plugins/platforms/xcb/qxcbvulkaninstance.cpp156
-rw-r--r--src/plugins/platforms/xcb/qxcbvulkaninstance.h79
-rw-r--r--src/plugins/platforms/xcb/qxcbvulkanwindow.cpp88
-rw-r--r--src/plugins/platforms/xcb/qxcbvulkanwindow.h65
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp665
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h10
-rw-r--r--src/plugins/platforms/xcb/qxcbwmsupport.cpp21
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.cpp43
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro16
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3menu.cpp22
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3menu.h8
-rw-r--r--src/plugins/plugins.pro1
-rw-r--r--src/plugins/sqldrivers/db2/qsql_db2.cpp14
-rw-r--r--src/plugins/sqldrivers/ibase/qsql_ibase.cpp9
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp3
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc.cpp7
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp12
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp110
-rw-r--r--src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp2
-rw-r--r--src/plugins/sqldrivers/tds/qsql_tds.cpp4
-rw-r--r--src/plugins/styles/android/android.pro16
-rw-r--r--src/plugins/styles/android/androidstyle.json3
-rw-r--r--src/plugins/styles/android/main.cpp64
-rw-r--r--src/plugins/styles/android/qandroidstyle.cpp (renamed from src/widgets/styles/qandroidstyle.cpp)4
-rw-r--r--src/plugins/styles/android/qandroidstyle_p.h (renamed from src/widgets/styles/qandroidstyle_p.h)6
-rw-r--r--src/plugins/styles/mac/mac.pro19
-rw-r--r--src/plugins/styles/mac/macstyle.json3
-rw-r--r--src/plugins/styles/mac/main.mm65
-rw-r--r--src/plugins/styles/mac/qmacstyle.qdoc (renamed from src/widgets/styles/qmacstyle.qdoc)2
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm (renamed from src/widgets/styles/qmacstyle_mac.mm)2689
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p.h (renamed from src/widgets/styles/qmacstyle_mac_p.h)11
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h (renamed from src/widgets/styles/qmacstyle_mac_p_p.h)62
-rw-r--r--src/plugins/styles/styles.pro8
-rw-r--r--src/plugins/styles/windowsvista/main.cpp64
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp (renamed from src/widgets/styles/qwindowsvistastyle.cpp)4
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle_p.h (renamed from src/widgets/styles/qwindowsvistastyle_p.h)6
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h (renamed from src/widgets/styles/qwindowsvistastyle_p_p.h)6
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp (renamed from src/widgets/styles/qwindowsxpstyle.cpp)12
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle_p.h (renamed from src/widgets/styles/qwindowsxpstyle_p.h)7
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h (renamed from src/widgets/styles/qwindowsxpstyle_p_p.h)6
-rw-r--r--src/plugins/styles/windowsvista/windowsvista.pro22
-rw-r--r--src/plugins/styles/windowsvista/windowsvistastyle.json3
-rw-r--r--src/printsupport/kernel/qcups.cpp2
-rw-r--r--src/printsupport/kernel/qprintengine_pdf.cpp4
-rw-r--r--src/printsupport/kernel/qprintengine_pdf_p.h2
-rw-r--r--src/printsupport/kernel/qprinter.cpp33
-rw-r--r--src/printsupport/kernel/qprinter.h3
-rw-r--r--src/printsupport/kernel/qprinter_p.h4
-rw-r--r--src/sql/doc/snippets/code/doc_src_sql-driver.cpp5
-rw-r--r--src/sql/doc/src/sql-driver.qdoc16
-rw-r--r--src/sql/kernel/qsqldatabase.cpp1
-rw-r--r--src/sql/kernel/qsqlerror.cpp34
-rw-r--r--src/sql/kernel/qsqlerror.h7
-rw-r--r--src/sql/kernel/qsqlfield.cpp42
-rw-r--r--src/sql/kernel/qsqlfield.h5
-rw-r--r--src/sql/kernel/qsqlrecord.cpp17
-rw-r--r--src/sql/models/qsqlquerymodel.cpp24
-rw-r--r--src/sql/models/qsqlquerymodel.h24
-rw-r--r--src/sql/models/qsqltablemodel.cpp14
-rw-r--r--src/sql/models/qsqltablemodel_p.h2
-rw-r--r--src/src.pro8
-rw-r--r--src/testlib/qbenchmarkmetric.cpp190
-rw-r--r--src/testlib/qtest.h29
-rw-r--r--src/testlib/qtest_gui.h29
-rw-r--r--src/testlib/qtestblacklist.cpp14
-rw-r--r--src/testlib/qtestcase.cpp106
-rw-r--r--src/testlib/qtestcase.h22
-rw-r--r--src/testlib/qtestcase.qdoc34
-rw-r--r--src/testlib/qtestkeyboard.h20
-rw-r--r--src/testlib/qtestutil_macos.mm27
-rw-r--r--src/testlib/qtestutil_macos_p.h11
-rw-r--r--src/tools/bootstrap/bootstrap.pro6
-rw-r--r--src/tools/moc/generator.cpp33
-rw-r--r--src/tools/moc/generator.h1
-rw-r--r--src/tools/moc/main.cpp4
-rw-r--r--src/tools/moc/moc.cpp10
-rw-r--r--src/tools/moc/moc.h3
-rw-r--r--src/tools/moc/moc.pro1
-rw-r--r--src/tools/qdbuscpp2xml/qdbuscpp2xml.pro1
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.pro1
-rw-r--r--src/tools/qlalr/qlalr.pro1
-rw-r--r--src/tools/qvkgen/qvkgen.cpp530
-rw-r--r--src/tools/qvkgen/qvkgen.pro6
-rw-r--r--src/tools/rcc/rcc.pro1
-rw-r--r--src/tools/uic/cpp/cpp.pri12
-rw-r--r--src/tools/uic/cpp/cppextractimages.cpp140
-rw-r--r--src/tools/uic/cpp/cppextractimages.h64
-rw-r--r--src/tools/uic/cpp/cppwritedeclaration.cpp63
-rw-r--r--src/tools/uic/cpp/cppwritedeclaration.h3
-rw-r--r--src/tools/uic/cpp/cppwriteicondata.cpp172
-rw-r--r--src/tools/uic/cpp/cppwriteicondata.h68
-rw-r--r--src/tools/uic/cpp/cppwriteicondeclaration.cpp67
-rw-r--r--src/tools/uic/cpp/cppwriteicondeclaration.h63
-rw-r--r--src/tools/uic/cpp/cppwriteiconinitialization.cpp102
-rw-r--r--src/tools/uic/cpp/cppwriteiconinitialization.h68
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp22
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h5
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp237
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.h16
-rw-r--r--src/tools/uic/customwidgetsinfo.cpp12
-rw-r--r--src/tools/uic/customwidgetsinfo.h2
-rw-r--r--src/tools/uic/databaseinfo.cpp4
-rw-r--r--src/tools/uic/main.cpp5
-rw-r--r--src/tools/uic/option.h4
-rw-r--r--src/tools/uic/treewalker.cpp29
-rw-r--r--src/tools/uic/treewalker.h7
-rw-r--r--src/tools/uic/ui4.cpp5165
-rw-r--r--src/tools/uic/ui4.h2292
-rw-r--r--src/tools/uic/uic.cpp7
-rw-r--r--src/tools/uic/uic.h7
-rw-r--r--src/tools/uic/uic.pro1
-rw-r--r--src/tools/uic/utils.h13
-rw-r--r--src/widgets/configure.json10
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp5
-rw-r--r--src/widgets/dialogs/qdialog.cpp11
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp16
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp61
-rw-r--r--src/widgets/dialogs/qinputdialog.h8
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp3
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp2
-rw-r--r--src/widgets/dialogs/qwizard.cpp32
-rw-r--r--src/widgets/doc/images/stylesheet-coffee-xp.pngbin14200 -> 0 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-tabwidget.pngbin5220 -> 0 bytes
-rw-r--r--src/widgets/doc/images/windowsxp-treeview.pngbin5795 -> 0 bytes
-rw-r--r--src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc4
-rw-r--r--src/widgets/doc/snippets/macmainwindow.mm2
-rw-r--r--src/widgets/doc/src/qtwidgets-index.qdoc4
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/gallery.qdoc4
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc39
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/widgets.qdoc2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp3
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.cpp3
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp22
-rw-r--r--src/widgets/itemviews/qabstractitemview.h1
-rw-r--r--src/widgets/itemviews/qcolumnview.cpp6
-rw-r--r--src/widgets/itemviews/qdirmodel.cpp17
-rw-r--r--src/widgets/itemviews/qheaderview.cpp16
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp2
-rw-r--r--src/widgets/itemviews/qlistview.cpp3
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp18
-rw-r--r--src/widgets/itemviews/qlistwidget.h11
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp18
-rw-r--r--src/widgets/itemviews/qtablewidget.h10
-rw-r--r--src/widgets/itemviews/qtreeview.cpp2
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp19
-rw-r--r--src/widgets/itemviews/qtreewidget.h10
-rw-r--r--src/widgets/kernel/qaction.cpp45
-rw-r--r--src/widgets/kernel/qaction.h3
-rw-r--r--src/widgets/kernel/qaction_p.h3
-rw-r--r--src/widgets/kernel/qapplication.cpp12
-rw-r--r--src/widgets/kernel/qapplication_p.h2
-rw-r--r--src/widgets/kernel/qboxlayout.cpp28
-rw-r--r--src/widgets/kernel/qdesktopwidget.cpp65
-rw-r--r--src/widgets/kernel/qdesktopwidget.qdoc2
-rw-r--r--src/widgets/kernel/qdesktopwidget_p.h23
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp10
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp134
-rw-r--r--src/widgets/kernel/qopenglwidget.h3
-rw-r--r--src/widgets/kernel/qtooltip.cpp13
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp9
-rw-r--r--src/widgets/kernel/qwidget.cpp115
-rw-r--r--src/widgets/kernel/qwidget_p.h21
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp26
-rw-r--r--src/widgets/kernel/qwidgetbackingstore_p.h6
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp113
-rw-r--r--src/widgets/kernel/qwidgetwindow_p.h3
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp13
-rw-r--r--src/widgets/styles/images/fusion_arrow.pngbin295 -> 0 bytes
-rw-r--r--src/widgets/styles/qcommonstyle.cpp8
-rw-r--r--src/widgets/styles/qcommonstyle_p.h2
-rw-r--r--src/widgets/styles/qfusionstyle.cpp262
-rw-r--r--src/widgets/styles/qfusionstyle_p.h2
-rw-r--r--src/widgets/styles/qstyle.cpp18
-rw-r--r--src/widgets/styles/qstyle.h2
-rw-r--r--src/widgets/styles/qstyle.qrc1
-rw-r--r--src/widgets/styles/qstyleanimation_p.h13
-rw-r--r--src/widgets/styles/qstylefactory.cpp61
-rw-r--r--src/widgets/styles/qstylehelper.cpp29
-rw-r--r--src/widgets/styles/qstylehelper_p.h23
-rw-r--r--src/widgets/styles/qstyleoption.cpp12
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp6
-rw-r--r--src/widgets/styles/qstylesheetstyle_default.cpp4
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h2
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h2
-rw-r--r--src/widgets/styles/styles.pri23
-rw-r--r--src/widgets/util/qcompleter.cpp50
-rw-r--r--src/widgets/util/qcompleter_p.h4
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp29
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp591
-rw-r--r--src/widgets/util/util.pri4
-rw-r--r--src/widgets/widgets/qcombobox.cpp41
-rw-r--r--src/widgets/widgets/qcombobox_p.h3
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp8
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp2
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.h6
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp137
-rw-r--r--src/widgets/widgets/qdockarealayout_p.h5
-rw-r--r--src/widgets/widgets/qdockwidget.cpp14
-rw-r--r--src/widgets/widgets/qeffects.cpp4
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp3
-rw-r--r--src/widgets/widgets/qlineedit.cpp50
-rw-r--r--src/widgets/widgets/qlineedit.h2
-rw-r--r--src/widgets/widgets/qmainwindow.cpp257
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp701
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h313
-rw-r--r--src/widgets/widgets/qmdiarea.cpp6
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp58
-rw-r--r--src/widgets/widgets/qmenu.cpp35
-rw-r--r--src/widgets/widgets/qmenu.h8
-rw-r--r--src/widgets/widgets/qmenu_p.h2
-rw-r--r--src/widgets/widgets/qmenubar.cpp7
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp30
-rw-r--r--src/widgets/widgets/qplaintextedit.h12
-rw-r--r--src/widgets/widgets/qprogressbar.cpp2
-rw-r--r--src/widgets/widgets/qpushbutton.cpp7
-rw-r--r--src/widgets/widgets/qsizegrip.cpp3
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp5
-rw-r--r--src/widgets/widgets/qtabbar_p.h4
-rw-r--r--src/widgets/widgets/qtabwidget.cpp5
-rw-r--r--src/widgets/widgets/qtextedit.cpp29
-rw-r--r--src/widgets/widgets/qtextedit.h12
-rw-r--r--src/widgets/widgets/qtoolbar.cpp1
-rw-r--r--src/widgets/widgets/qtoolbar.h4
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp3
-rw-r--r--src/widgets/widgets/qwidgetanimator.cpp4
-rw-r--r--src/widgets/widgets/qwidgetresizehandler.cpp11
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp5
972 files changed, 83942 insertions, 45183 deletions
diff --git a/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro b/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
index 3b7b11c8ee..e5746bf3eb 100644
--- a/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
+++ b/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
@@ -168,21 +168,7 @@ contains(SHAPERS, coretext) {
# even in 10.8 where they were also made available stand-alone.
LIBS_PRIVATE += -framework ApplicationServices
- # CoreText is documented to be available on watchOS, but the headers aren't present
- # in the watchOS Simulator SDK like they are supposed to be. Work around the problem
- # by adding the device SDK's headers to the search path as a fallback.
- # rdar://25314492, rdar://27844864
- watchos:simulator {
- simulator_system_frameworks = $$xcodeSDKInfo(Path, $${simulator.sdk})/System/Library/Frameworks
- device_system_frameworks = $$xcodeSDKInfo(Path, $${device.sdk})/System/Library/Frameworks
- for (arch, QMAKE_APPLE_SIMULATOR_ARCHS) {
- QMAKE_CXXFLAGS += \
- -Xarch_$${arch} \
- -F$$simulator_system_frameworks \
- -Xarch_$${arch} \
- -F$$device_system_frameworks
- }
- }
+ CONFIG += watchos_coretext
}
contains(SHAPERS, fallback)|isEmpty(SHAPERS) {
diff --git a/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all.h b/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all.h
index 4f7b7d07d7..1008728034 100644
--- a/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all.h
+++ b/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all.h
@@ -16,8 +16,9 @@
*/
/* @@MIDL_FILE_HEADING( ) */
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
+#ifdef _MSC_VER
+# pragma warning( disable: 4049 ) /* more than 64k source lines */
+#endif
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
diff --git a/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all_i.c b/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all_i.c
index e04a5dcb69..4687e9942d 100644
--- a/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all_i.c
+++ b/src/3rdparty/iaccessible2/generated/amd64/ia2_api_all_i.c
@@ -18,8 +18,9 @@
*/
/* @@MIDL_FILE_HEADING( ) */
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
+#ifdef _MSC_VER
+# pragma warning( disable: 4049 ) /* more than 64k source lines */
+#endif
#ifdef __cplusplus
extern "C"{
@@ -65,7 +66,7 @@ typedef IID CLSID;
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif !_MIDL_USE_GUIDDEF_
+#endif // !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, IID_IAccessibleRelation,0x7CDF86EE,0xC3DA,0x496a,0xBD,0xA4,0x28,0x1B,0x33,0x6E,0x1F,0xDC);
diff --git a/src/3rdparty/iaccessible2/generated/x86/ia2_api_all.h b/src/3rdparty/iaccessible2/generated/x86/ia2_api_all.h
index eb3b57b8bd..9e4be75bb9 100644
--- a/src/3rdparty/iaccessible2/generated/x86/ia2_api_all.h
+++ b/src/3rdparty/iaccessible2/generated/x86/ia2_api_all.h
@@ -16,7 +16,9 @@
*/
/* @@MIDL_FILE_HEADING( ) */
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
+#ifdef _MSC_VER
+# pragma warning( disable: 4049 ) /* more than 64k source lines */
+#endif
/* verify that the <rpcndr.h> version is high enough to compile this file*/
diff --git a/src/3rdparty/iaccessible2/generated/x86/ia2_api_all_i.c b/src/3rdparty/iaccessible2/generated/x86/ia2_api_all_i.c
index c50b3e9a4f..61bb5ee5f7 100644
--- a/src/3rdparty/iaccessible2/generated/x86/ia2_api_all_i.c
+++ b/src/3rdparty/iaccessible2/generated/x86/ia2_api_all_i.c
@@ -18,7 +18,9 @@
*/
/* @@MIDL_FILE_HEADING( ) */
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
+#ifdef _MSC_VER
+# pragma warning( disable: 4049 ) /* more than 64k source lines */
+#endif
#ifdef __cplusplus
@@ -65,7 +67,7 @@ typedef IID CLSID;
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif !_MIDL_USE_GUIDDEF_
+#endif // !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, IID_IAccessibleRelation,0x7CDF86EE,0xC3DA,0x496a,0xBD,0xA4,0x28,0x1B,0x33,0x6E,0x1F,0xDC);
diff --git a/src/3rdparty/icc/LICENSE.txt b/src/3rdparty/icc/LICENSE.txt
new file mode 100644
index 0000000000..e25b1d39f1
--- /dev/null
+++ b/src/3rdparty/icc/LICENSE.txt
@@ -0,0 +1,10 @@
+For the file sRGB2014.icc:
+
+Copyright International Color Consortium, 2015
+
+This profile is made available by the International Color Consortium, and may be copied,
+distributed, embedded, made, used, and sold without restriction. Altered versions of this
+profile shall have the original identification and copyright information removed and
+shall not be misrepresented as the original profile.
+
+(original source location: http://www.color.org/srgbprofiles.xalter)
diff --git a/src/3rdparty/icc/qt_attribution.json b/src/3rdparty/icc/qt_attribution.json
new file mode 100644
index 0000000000..7a1c813522
--- /dev/null
+++ b/src/3rdparty/icc/qt_attribution.json
@@ -0,0 +1,15 @@
+[
+ {
+ "Id": "icc-sRGB-color-profile",
+ "Name": "sRGB color profile icc file",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in Qt Gui (Embedded into PDF/A-1b files generated by QPrinter/QPdfWriter).",
+ "Files": "sRGB2014.icc",
+
+ "Description": "An ICC color profile for PDF/A-1b compatible PDF files.",
+ "LicenseId": "ICC License",
+ "License": "International Color Consortium License",
+ "LicenseFile": "LICENSE.txt",
+ "Copyright": "Copyright International Color Consortium, 2015"
+ }
+]
diff --git a/src/3rdparty/icc/sRGB2014.icc b/src/3rdparty/icc/sRGB2014.icc
new file mode 100644
index 0000000000..49afbfef10
--- /dev/null
+++ b/src/3rdparty/icc/sRGB2014.icc
Binary files differ
diff --git a/src/3rdparty/pcre2/AUTHORS b/src/3rdparty/pcre2/AUTHORS
index d9a0e15690..e056ad6868 100644
--- a/src/3rdparty/pcre2/AUTHORS
+++ b/src/3rdparty/pcre2/AUTHORS
@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2016 University of Cambridge
+Copyright (c) 1997-2017 University of Cambridge
All rights reserved
@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2010-2016 Zoltan Herczeg
+Copyright(c) 2010-2017 Zoltan Herczeg
All rights reserved.
@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2009-2016 Zoltan Herczeg
+Copyright(c) 2009-2017 Zoltan Herczeg
All rights reserved.
####
diff --git a/src/3rdparty/pcre2/LICENCE b/src/3rdparty/pcre2/LICENCE
index 6600a65907..2b34d3f62b 100644
--- a/src/3rdparty/pcre2/LICENCE
+++ b/src/3rdparty/pcre2/LICENCE
@@ -5,9 +5,10 @@ PCRE2 is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
Release 10 of PCRE2 is distributed under the terms of the "BSD" licence, as
-specified below. The documentation for PCRE2, supplied in the "doc"
-directory, is distributed under the same terms as the software itself. The data
-in the testdata directory is not copyrighted and is in the public domain.
+specified below, with one exemption for certain binary redistributions. The
+documentation for PCRE2, supplied in the "doc" directory, is distributed under
+the same terms as the software itself. The data in the testdata directory is
+not copyrighted and is in the public domain.
The basic library functions are written in C and are freestanding. Also
included in the distribution is a just-in-time compiler that can be used to
@@ -25,7 +26,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2016 University of Cambridge
+Copyright (c) 1997-2017 University of Cambridge
All rights reserved.
@@ -36,7 +37,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2010-2016 Zoltan Herczeg
+Copyright(c) 2010-2017 Zoltan Herczeg
All rights reserved.
@@ -47,7 +48,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2009-2016 Zoltan Herczeg
+Copyright(c) 2009-2017 Zoltan Herczeg
All rights reserved.
@@ -57,11 +58,11 @@ THE "BSD" LICENCE
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,
+ * Redistributions of source code must retain the above copyright notices,
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
+ notices, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the names of any
@@ -80,4 +81,14 @@ 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.
+
+EXEMPTION FOR BINARY LIBRARY-LIKE PACKAGES
+------------------------------------------
+
+The second condition in the BSD licence (covering binary redistributions) does
+not apply all the way down a chain of software. If binary package A includes
+PCRE2, it must respect the condition, but if package B is software that
+includes package A, the condition is not imposed on package B unless it uses
+PCRE2 independently.
+
End
diff --git a/src/3rdparty/pcre2/qt_attribution.json b/src/3rdparty/pcre2/qt_attribution.json
index bcf7650993..33c1a58878 100644
--- a/src/3rdparty/pcre2/qt_attribution.json
+++ b/src/3rdparty/pcre2/qt_attribution.json
@@ -6,12 +6,12 @@
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
"Homepage": "http://www.pcre.org/",
- "Version": "10.22",
+ "Version": "10.30",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause",
"LicenseFile": "LICENCE",
- "Copyright": "Copyright (c) 1997-2016 University of Cambridge
-Copyright (c) 2009-2016 Zoltan Herczeg
+ "Copyright": "Copyright (c) 1997-2017 University of Cambridge
+Copyright (c) 2009-2017 Zoltan Herczeg
Copyright (c) 2007-2012 Google Inc.
Copyright (c) 2013-2013 Tilera Corporation (jiwang@tilera.com)"
}
diff --git a/src/3rdparty/pcre2/src/config.h b/src/3rdparty/pcre2/src/config.h
index fbebfe6be0..eeade9d9ce 100644
--- a/src/3rdparty/pcre2/src/config.h
+++ b/src/3rdparty/pcre2/src/config.h
@@ -7,8 +7,9 @@
#define HAVE_STRING_H 1
#define LINK_SIZE 2
+#define HEAP_LIMIT 20000000
#define MATCH_LIMIT 10000000
-#define MATCH_LIMIT_RECURSION MATCH_LIMIT
+#define MATCH_LIMIT_DEPTH MATCH_LIMIT
#define MAX_NAME_COUNT 10000
#define MAX_NAME_SIZE 32
#define NEWLINE_DEFAULT 2
diff --git a/src/3rdparty/pcre2/src/pcre2.h b/src/3rdparty/pcre2/src/pcre2.h
index 20d221b803..5a4533909d 100644
--- a/src/3rdparty/pcre2/src/pcre2.h
+++ b/src/3rdparty/pcre2/src/pcre2.h
@@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, second API, to be
#included by applications that call PCRE2 functions.
- Copyright (c) 2016 University of Cambridge
+ Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -36,15 +36,15 @@ POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/
-#ifndef _PCRE2_H
-#define _PCRE2_H
+#ifndef PCRE2_H_IDEMPOTENT_GUARD
+#define PCRE2_H_IDEMPOTENT_GUARD
/* The current PCRE version information. */
#define PCRE2_MAJOR 10
-#define PCRE2_MINOR 22
+#define PCRE2_MINOR 30
#define PCRE2_PRERELEASE
-#define PCRE2_DATE 2016-07-29
+#define PCRE2_DATE 2017-08-14
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate
@@ -67,6 +67,20 @@ don't change existing definitions of PCRE2_EXP_DECL. */
# endif
#endif
+/* When compiling with the MSVC compiler, it is sometimes necessary to include
+a "calling convention" before exported function names. (This is secondhand
+information; I know nothing about MSVC myself). For example, something like
+
+ void __cdecl function(....)
+
+might be needed. In order so make this easy, all the exported functions have
+PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
+set, we ensure here that it has no effect. */
+
+#ifndef PCRE2_CALL_CONVENTION
+#define PCRE2_CALL_CONVENTION
+#endif
+
/* Have to include limits.h, stdlib.h and stdint.h to ensure that size_t and
uint8_t, UCHAR_MAX, etc are defined. */
@@ -87,6 +101,7 @@ others can be added next to them */
#define PCRE2_ANCHORED 0x80000000u
#define PCRE2_NO_UTF_CHECK 0x40000000u
+#define PCRE2_ENDANCHORED 0x20000000u
/* The following option bits can be passed only to pcre2_compile(). However,
they may affect compilation, JIT compilation, and/or interpretive execution.
@@ -122,6 +137,15 @@ D is inspected during pcre2_dfa_match() execution
#define PCRE2_ALT_CIRCUMFLEX 0x00200000u /* J M D */
#define PCRE2_ALT_VERBNAMES 0x00400000u /* C */
#define PCRE2_USE_OFFSET_LIMIT 0x00800000u /* J M D */
+#define PCRE2_EXTENDED_MORE 0x01000000u /* C */
+#define PCRE2_LITERAL 0x02000000u /* C */
+
+/* An additional compile options word is available in the compile context. */
+
+#define PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES 0x00000001u /* C */
+#define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL 0x00000002u /* C */
+#define PCRE2_EXTRA_MATCH_WORD 0x00000004u /* C */
+#define PCRE2_EXTRA_MATCH_LINE 0x00000008u /* C */
/* These are for pcre2_jit_compile(). */
@@ -160,6 +184,16 @@ ignored for pcre2_jit_match(). */
#define PCRE2_NO_JIT 0x00002000u
+/* Options for pcre2_pattern_convert(). */
+
+#define PCRE2_CONVERT_UTF 0x00000001u
+#define PCRE2_CONVERT_NO_UTF_CHECK 0x00000002u
+#define PCRE2_CONVERT_POSIX_BASIC 0x00000004u
+#define PCRE2_CONVERT_POSIX_EXTENDED 0x00000008u
+#define PCRE2_CONVERT_GLOB 0x00000010u
+#define PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR 0x00000030u
+#define PCRE2_CONVERT_GLOB_NO_STARSTAR 0x00000050u
+
/* Newline and \R settings, for use in compile contexts. The newline values
must be kept in step with values set in config.h and both sets must all be
greater than zero. */
@@ -169,6 +203,7 @@ greater than zero. */
#define PCRE2_NEWLINE_CRLF 3
#define PCRE2_NEWLINE_ANY 4
#define PCRE2_NEWLINE_ANYCRLF 5
+#define PCRE2_NEWLINE_NUL 6
#define PCRE2_BSR_UNICODE 1
#define PCRE2_BSR_ANYCRLF 2
@@ -242,7 +277,8 @@ numbers must not be changed. */
#define PCRE2_ERROR_NOUNIQUESUBSTRING (-50)
#define PCRE2_ERROR_NULL (-51)
#define PCRE2_ERROR_RECURSELOOP (-52)
-#define PCRE2_ERROR_RECURSIONLIMIT (-53)
+#define PCRE2_ERROR_DEPTHLIMIT (-53)
+#define PCRE2_ERROR_RECURSIONLIMIT (-53) /* Obsolete synonym */
#define PCRE2_ERROR_UNAVAILABLE (-54)
#define PCRE2_ERROR_UNSET (-55)
#define PCRE2_ERROR_BADOFFSETLIMIT (-56)
@@ -252,6 +288,9 @@ numbers must not be changed. */
#define PCRE2_ERROR_BADSUBSPATTERN (-60)
#define PCRE2_ERROR_TOOMANYREPLACE (-61)
#define PCRE2_ERROR_BADSERIALIZEDDATA (-62)
+#define PCRE2_ERROR_HEAPLIMIT (-63)
+#define PCRE2_ERROR_CONVERT_SYNTAX (-64)
+
/* Request types for pcre2_pattern_info() */
@@ -276,9 +315,12 @@ numbers must not be changed. */
#define PCRE2_INFO_NAMEENTRYSIZE 18
#define PCRE2_INFO_NAMETABLE 19
#define PCRE2_INFO_NEWLINE 20
-#define PCRE2_INFO_RECURSIONLIMIT 21
+#define PCRE2_INFO_DEPTHLIMIT 21
+#define PCRE2_INFO_RECURSIONLIMIT 21 /* Obsolete synonym */
#define PCRE2_INFO_SIZE 22
#define PCRE2_INFO_HASBACKSLASHC 23
+#define PCRE2_INFO_FRAMESIZE 24
+#define PCRE2_INFO_HEAPLIMIT 25
/* Request types for pcre2_config(). */
@@ -289,11 +331,13 @@ numbers must not be changed. */
#define PCRE2_CONFIG_MATCHLIMIT 4
#define PCRE2_CONFIG_NEWLINE 5
#define PCRE2_CONFIG_PARENSLIMIT 6
-#define PCRE2_CONFIG_RECURSIONLIMIT 7
-#define PCRE2_CONFIG_STACKRECURSE 8
+#define PCRE2_CONFIG_DEPTHLIMIT 7
+#define PCRE2_CONFIG_RECURSIONLIMIT 7 /* Obsolete synonym */
+#define PCRE2_CONFIG_STACKRECURSE 8 /* Obsolete */
#define PCRE2_CONFIG_UNICODE 9
#define PCRE2_CONFIG_UNICODE_VERSION 10
#define PCRE2_CONFIG_VERSION 11
+#define PCRE2_CONFIG_HEAPLIMIT 12
/* Types for code units in patterns and subject strings. */
@@ -328,6 +372,9 @@ typedef struct pcre2_real_compile_context pcre2_compile_context; \
struct pcre2_real_match_context; \
typedef struct pcre2_real_match_context pcre2_match_context; \
\
+struct pcre2_real_convert_context; \
+typedef struct pcre2_real_convert_context pcre2_convert_context; \
+\
struct pcre2_real_code; \
typedef struct pcre2_real_code pcre2_code; \
\
@@ -386,170 +433,220 @@ expanded for each width below. Start with functions that give general
information. */
#define PCRE2_GENERAL_INFO_FUNCTIONS \
-PCRE2_EXP_DECL int pcre2_config(uint32_t, void *);
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *);
/* Functions for manipulating contexts. */
#define PCRE2_GENERAL_CONTEXT_FUNCTIONS \
-PCRE2_EXP_DECL \
- pcre2_general_context *pcre2_general_context_copy(pcre2_general_context *); \
-PCRE2_EXP_DECL \
- pcre2_general_context *pcre2_general_context_create( \
- void *(*)(PCRE2_SIZE, void *), \
- void (*)(void *, void *), void *); \
-PCRE2_EXP_DECL void pcre2_general_context_free(pcre2_general_context *);
+PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \
+ *pcre2_general_context_copy(pcre2_general_context *); \
+PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \
+ *pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \
+ void (*)(void *, void *), void *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_general_context_free(pcre2_general_context *);
#define PCRE2_COMPILE_CONTEXT_FUNCTIONS \
-PCRE2_EXP_DECL \
- pcre2_compile_context *pcre2_compile_context_copy(pcre2_compile_context *); \
-PCRE2_EXP_DECL \
- pcre2_compile_context *pcre2_compile_context_create(pcre2_general_context *);\
-PCRE2_EXP_DECL void pcre2_compile_context_free(pcre2_compile_context *); \
-PCRE2_EXP_DECL int pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
-PCRE2_EXP_DECL int pcre2_set_character_tables(pcre2_compile_context *, \
- const unsigned char *); \
-PCRE2_EXP_DECL int pcre2_set_max_pattern_length(pcre2_compile_context *, \
- PCRE2_SIZE); \
-PCRE2_EXP_DECL int pcre2_set_newline(pcre2_compile_context *, uint32_t); \
-PCRE2_EXP_DECL int pcre2_set_parens_nest_limit(pcre2_compile_context *, \
- uint32_t); \
-PCRE2_EXP_DECL int pcre2_set_compile_recursion_guard(\
- pcre2_compile_context *, int (*)(uint32_t, void *), \
- void *);
+PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \
+ *pcre2_compile_context_copy(pcre2_compile_context *); \
+PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \
+ *pcre2_compile_context_create(pcre2_general_context *);\
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_compile_context_free(pcre2_compile_context *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_character_tables(pcre2_compile_context *, const unsigned char *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_newline(pcre2_compile_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_compile_recursion_guard(pcre2_compile_context *, \
+ int (*)(uint32_t, void *), void *);
#define PCRE2_MATCH_CONTEXT_FUNCTIONS \
-PCRE2_EXP_DECL \
- pcre2_match_context *pcre2_match_context_copy(pcre2_match_context *); \
-PCRE2_EXP_DECL \
- pcre2_match_context *pcre2_match_context_create(pcre2_general_context *); \
-PCRE2_EXP_DECL void pcre2_match_context_free(pcre2_match_context *); \
-PCRE2_EXP_DECL int pcre2_set_callout(pcre2_match_context *, \
- int (*)(pcre2_callout_block *, void *), void *); \
-PCRE2_EXP_DECL int pcre2_set_match_limit(pcre2_match_context *, \
- uint32_t); \
-PCRE2_EXP_DECL int pcre2_set_offset_limit(pcre2_match_context *, \
- PCRE2_SIZE); \
-PCRE2_EXP_DECL int pcre2_set_recursion_limit(pcre2_match_context *, \
- uint32_t); \
-PCRE2_EXP_DECL int pcre2_set_recursion_memory_management( \
- pcre2_match_context *, void *(*)(PCRE2_SIZE, void *), \
- void (*)(void *, void *), void *);
+PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \
+ *pcre2_match_context_copy(pcre2_match_context *); \
+PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \
+ *pcre2_match_context_create(pcre2_general_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_match_context_free(pcre2_match_context *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_callout(pcre2_match_context *, \
+ int (*)(pcre2_callout_block *, void *), void *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_heap_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_match_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_recursion_memory_management(pcre2_match_context *, \
+ void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *);
+
+#define PCRE2_CONVERT_CONTEXT_FUNCTIONS \
+PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \
+ *pcre2_convert_context_copy(pcre2_convert_context *); \
+PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \
+ *pcre2_convert_context_create(pcre2_general_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_convert_context_free(pcre2_convert_context *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_glob_escape(pcre2_convert_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_set_glob_separator(pcre2_convert_context *, uint32_t);
/* Functions concerned with compiling a pattern to PCRE internal code. */
#define PCRE2_COMPILE_FUNCTIONS \
-PCRE2_EXP_DECL \
- pcre2_code *pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, \
- int *, PCRE2_SIZE *, pcre2_compile_context *); \
-PCRE2_EXP_DECL void pcre2_code_free(pcre2_code *); \
-PCRE2_EXP_DECL \
- pcre2_code *pcre2_code_copy(const pcre2_code *);
+PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
+ *pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \
+ pcre2_compile_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_code_free(pcre2_code *); \
+PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
+ *pcre2_code_copy(const pcre2_code *); \
+PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
+ *pcre2_code_copy_with_tables(const pcre2_code *);
/* Functions that give information about a compiled pattern. */
#define PCRE2_PATTERN_INFO_FUNCTIONS \
-PCRE2_EXP_DECL int pcre2_pattern_info(const pcre2_code *, uint32_t, \
- void *); \
-PCRE2_EXP_DECL int pcre2_callout_enumerate(const pcre2_code *, \
- int (*)(pcre2_callout_enumerate_block *, void *), \
- void *);
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_pattern_info(const pcre2_code *, uint32_t, void *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_callout_enumerate(const pcre2_code *, \
+ int (*)(pcre2_callout_enumerate_block *, void *), void *);
/* Functions for running a match and inspecting the result. */
#define PCRE2_MATCH_FUNCTIONS \
-PCRE2_EXP_DECL \
- pcre2_match_data *pcre2_match_data_create(uint32_t, \
- pcre2_general_context *); \
-PCRE2_EXP_DECL \
- pcre2_match_data *pcre2_match_data_create_from_pattern(\
- const pcre2_code *, \
- pcre2_general_context *); \
-PCRE2_EXP_DECL int pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, \
- PCRE2_SIZE, PCRE2_SIZE, uint32_t, \
- pcre2_match_data *, pcre2_match_context *, int *, \
- PCRE2_SIZE); \
-PCRE2_EXP_DECL int pcre2_match(const pcre2_code *, \
- PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, uint32_t, \
- pcre2_match_data *, pcre2_match_context *); \
-PCRE2_EXP_DECL void pcre2_match_data_free(pcre2_match_data *); \
-PCRE2_EXP_DECL PCRE2_SPTR pcre2_get_mark(pcre2_match_data *); \
-PCRE2_EXP_DECL uint32_t pcre2_get_ovector_count(pcre2_match_data *); \
-PCRE2_EXP_DECL PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *); \
-PCRE2_EXP_DECL PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *);
+PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \
+ *pcre2_match_data_create(uint32_t, pcre2_general_context *); \
+PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \
+ *pcre2_match_data_create_from_pattern(const pcre2_code *, \
+ pcre2_general_context *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
+ uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
+ uint32_t, pcre2_match_data *, pcre2_match_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_match_data_free(pcre2_match_data *); \
+PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
+ pcre2_get_mark(pcre2_match_data *); \
+PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
+ pcre2_get_ovector_count(pcre2_match_data *); \
+PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
+ *pcre2_get_ovector_pointer(pcre2_match_data *); \
+PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
+ pcre2_get_startchar(pcre2_match_data *);
/* Convenience functions for handling matched substrings. */
#define PCRE2_SUBSTRING_FUNCTIONS \
-PCRE2_EXP_DECL int pcre2_substring_copy_byname(pcre2_match_data *, \
- PCRE2_SPTR, PCRE2_UCHAR *, PCRE2_SIZE *); \
-PCRE2_EXP_DECL int pcre2_substring_copy_bynumber(pcre2_match_data *, \
- uint32_t, PCRE2_UCHAR *, PCRE2_SIZE *); \
-PCRE2_EXP_DECL void pcre2_substring_free(PCRE2_UCHAR *); \
-PCRE2_EXP_DECL int pcre2_substring_get_byname(pcre2_match_data *, \
- PCRE2_SPTR, PCRE2_UCHAR **, PCRE2_SIZE *); \
-PCRE2_EXP_DECL int pcre2_substring_get_bynumber(pcre2_match_data *, \
- uint32_t, PCRE2_UCHAR **, PCRE2_SIZE *); \
-PCRE2_EXP_DECL int pcre2_substring_length_byname(pcre2_match_data *, \
- PCRE2_SPTR, PCRE2_SIZE *); \
-PCRE2_EXP_DECL int pcre2_substring_length_bynumber(pcre2_match_data *, \
- uint32_t, PCRE2_SIZE *); \
-PCRE2_EXP_DECL int pcre2_substring_nametable_scan(const pcre2_code *, \
- PCRE2_SPTR, PCRE2_SPTR *, PCRE2_SPTR *); \
-PCRE2_EXP_DECL int pcre2_substring_number_from_name(\
- const pcre2_code *, PCRE2_SPTR); \
-PCRE2_EXP_DECL void pcre2_substring_list_free(PCRE2_SPTR *); \
-PCRE2_EXP_DECL int pcre2_substring_list_get(pcre2_match_data *, \
- PCRE2_UCHAR ***, PCRE2_SIZE **);
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_copy_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR *, \
+ PCRE2_SIZE *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_copy_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR *, \
+ PCRE2_SIZE *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_substring_free(PCRE2_UCHAR *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_get_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR **, \
+ PCRE2_SIZE *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_get_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR **, \
+ PCRE2_SIZE *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_length_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_SIZE *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_length_bynumber(pcre2_match_data *, uint32_t, PCRE2_SIZE *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_nametable_scan(const pcre2_code *, PCRE2_SPTR, PCRE2_SPTR *, \
+ PCRE2_SPTR *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_substring_list_free(PCRE2_SPTR *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
/* Functions for serializing / deserializing compiled patterns. */
#define PCRE2_SERIALIZE_FUNCTIONS \
-PCRE2_EXP_DECL int32_t pcre2_serialize_encode(const pcre2_code **, \
- int32_t, uint8_t **, PCRE2_SIZE *, \
- pcre2_general_context *); \
-PCRE2_EXP_DECL int32_t pcre2_serialize_decode(pcre2_code **, int32_t, \
- const uint8_t *, pcre2_general_context *); \
-PCRE2_EXP_DECL int32_t pcre2_serialize_get_number_of_codes(const uint8_t *); \
-PCRE2_EXP_DECL void pcre2_serialize_free(uint8_t *);
+PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
+ pcre2_serialize_encode(const pcre2_code **, int32_t, uint8_t **, \
+ PCRE2_SIZE *, pcre2_general_context *); \
+PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
+ pcre2_serialize_decode(pcre2_code **, int32_t, const uint8_t *, \
+ pcre2_general_context *); \
+PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
+ pcre2_serialize_get_number_of_codes(const uint8_t *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_serialize_free(uint8_t *);
/* Convenience function for match + substitute. */
#define PCRE2_SUBSTITUTE_FUNCTION \
-PCRE2_EXP_DECL int pcre2_substitute(const pcre2_code *, \
- PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, uint32_t, \
- pcre2_match_data *, pcre2_match_context *, \
- PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, \
- PCRE2_SIZE *);
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_substitute(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
+ uint32_t, pcre2_match_data *, pcre2_match_context *, PCRE2_SPTR, \
+ PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE *);
+
+
+/* Functions for converting pattern source strings. */
+
+#define PCRE2_CONVERT_FUNCTIONS \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_pattern_convert(PCRE2_SPTR, PCRE2_SIZE, uint32_t, PCRE2_UCHAR **, \
+ PCRE2_SIZE *, pcre2_convert_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_converted_pattern_free(PCRE2_UCHAR *);
/* Functions for JIT processing */
#define PCRE2_JIT_FUNCTIONS \
-PCRE2_EXP_DECL int pcre2_jit_compile(pcre2_code *, uint32_t); \
-PCRE2_EXP_DECL int pcre2_jit_match(const pcre2_code *, \
- PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, uint32_t, \
- pcre2_match_data *, pcre2_match_context *); \
-PCRE2_EXP_DECL void pcre2_jit_free_unused_memory(pcre2_general_context *); \
-PCRE2_EXP_DECL \
- pcre2_jit_stack *pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, \
- pcre2_general_context *); \
-PCRE2_EXP_DECL void pcre2_jit_stack_assign(pcre2_match_context *, \
- pcre2_jit_callback, void *); \
-PCRE2_EXP_DECL void pcre2_jit_stack_free(pcre2_jit_stack *);
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_jit_compile(pcre2_code *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_jit_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
+ uint32_t, pcre2_match_data *, pcre2_match_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_jit_free_unused_memory(pcre2_general_context *); \
+PCRE2_EXP_DECL pcre2_jit_stack PCRE2_CALL_CONVENTION \
+ *pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+ pcre2_jit_stack_free(pcre2_jit_stack *);
/* Other miscellaneous functions. */
#define PCRE2_OTHER_FUNCTIONS \
-PCRE2_EXP_DECL int pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
-PCRE2_EXP_DECL \
- const uint8_t *pcre2_maketables(pcre2_general_context *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+ pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
+PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \
+ *pcre2_maketables(pcre2_general_context *); \
/* Define macros that generate width-specific names from generic versions. The
@@ -576,6 +673,7 @@ pcre2_compile are called by application code. */
#define pcre2_real_code PCRE2_SUFFIX(pcre2_real_code_)
#define pcre2_real_general_context PCRE2_SUFFIX(pcre2_real_general_context_)
#define pcre2_real_compile_context PCRE2_SUFFIX(pcre2_real_compile_context_)
+#define pcre2_real_convert_context PCRE2_SUFFIX(pcre2_real_convert_context_)
#define pcre2_real_match_context PCRE2_SUFFIX(pcre2_real_match_context_)
#define pcre2_real_jit_stack PCRE2_SUFFIX(pcre2_real_jit_stack_)
#define pcre2_real_match_data PCRE2_SUFFIX(pcre2_real_match_data_)
@@ -587,6 +685,7 @@ pcre2_compile are called by application code. */
#define pcre2_callout_enumerate_block PCRE2_SUFFIX(pcre2_callout_enumerate_block_)
#define pcre2_general_context PCRE2_SUFFIX(pcre2_general_context_)
#define pcre2_compile_context PCRE2_SUFFIX(pcre2_compile_context_)
+#define pcre2_convert_context PCRE2_SUFFIX(pcre2_convert_context_)
#define pcre2_match_context PCRE2_SUFFIX(pcre2_match_context_)
#define pcre2_match_data PCRE2_SUFFIX(pcre2_match_data_)
@@ -595,12 +694,17 @@ pcre2_compile are called by application code. */
#define pcre2_callout_enumerate PCRE2_SUFFIX(pcre2_callout_enumerate_)
#define pcre2_code_copy PCRE2_SUFFIX(pcre2_code_copy_)
+#define pcre2_code_copy_with_tables PCRE2_SUFFIX(pcre2_code_copy_with_tables_)
#define pcre2_code_free PCRE2_SUFFIX(pcre2_code_free_)
#define pcre2_compile PCRE2_SUFFIX(pcre2_compile_)
#define pcre2_compile_context_copy PCRE2_SUFFIX(pcre2_compile_context_copy_)
#define pcre2_compile_context_create PCRE2_SUFFIX(pcre2_compile_context_create_)
#define pcre2_compile_context_free PCRE2_SUFFIX(pcre2_compile_context_free_)
#define pcre2_config PCRE2_SUFFIX(pcre2_config_)
+#define pcre2_convert_context_copy PCRE2_SUFFIX(pcre2_convert_context_copy_)
+#define pcre2_convert_context_create PCRE2_SUFFIX(pcre2_convert_context_create_)
+#define pcre2_convert_context_free PCRE2_SUFFIX(pcre2_convert_context_free_)
+#define pcre2_converted_pattern_free PCRE2_SUFFIX(pcre2_converted_pattern_free_)
#define pcre2_dfa_match PCRE2_SUFFIX(pcre2_dfa_match_)
#define pcre2_general_context_copy PCRE2_SUFFIX(pcre2_general_context_copy_)
#define pcre2_general_context_create PCRE2_SUFFIX(pcre2_general_context_create_)
@@ -624,6 +728,7 @@ pcre2_compile are called by application code. */
#define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_)
#define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_)
#define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_)
+#define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_)
#define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_)
#define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_)
#define pcre2_serialize_encode PCRE2_SUFFIX(pcre2_serialize_encode_)
@@ -632,14 +737,17 @@ pcre2_compile are called by application code. */
#define pcre2_set_bsr PCRE2_SUFFIX(pcre2_set_bsr_)
#define pcre2_set_callout PCRE2_SUFFIX(pcre2_set_callout_)
#define pcre2_set_character_tables PCRE2_SUFFIX(pcre2_set_character_tables_)
+#define pcre2_set_compile_extra_options PCRE2_SUFFIX(pcre2_set_compile_extra_options_)
#define pcre2_set_compile_recursion_guard PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_)
+#define pcre2_set_depth_limit PCRE2_SUFFIX(pcre2_set_depth_limit_)
+#define pcre2_set_glob_escape PCRE2_SUFFIX(pcre2_set_glob_escape_)
+#define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_)
+#define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_)
#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_)
#define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
#define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_)
-#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)
-#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
#define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_)
#define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_)
#define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
@@ -653,6 +761,11 @@ pcre2_compile are called by application code. */
#define pcre2_substring_nametable_scan PCRE2_SUFFIX(pcre2_substring_nametable_scan_)
#define pcre2_substring_number_from_name PCRE2_SUFFIX(pcre2_substring_number_from_name_)
+/* Keep this old function name for backwards compatibility */
+#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)
+
+/* Keep this obsolete function for backwards compatibility: it is now a noop. */
+#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
/* Now generate all three sets of width-specific structures and function
prototypes. */
@@ -663,6 +776,8 @@ PCRE2_STRUCTURE_LIST \
PCRE2_GENERAL_INFO_FUNCTIONS \
PCRE2_GENERAL_CONTEXT_FUNCTIONS \
PCRE2_COMPILE_CONTEXT_FUNCTIONS \
+PCRE2_CONVERT_CONTEXT_FUNCTIONS \
+PCRE2_CONVERT_FUNCTIONS \
PCRE2_MATCH_CONTEXT_FUNCTIONS \
PCRE2_COMPILE_FUNCTIONS \
PCRE2_PATTERN_INFO_FUNCTIONS \
@@ -692,6 +807,7 @@ PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
#undef PCRE2_GENERAL_INFO_FUNCTIONS
#undef PCRE2_GENERAL_CONTEXT_FUNCTIONS
#undef PCRE2_COMPILE_CONTEXT_FUNCTIONS
+#undef PCRE2_CONVERT_CONTEXT_FUNCTIONS
#undef PCRE2_MATCH_CONTEXT_FUNCTIONS
#undef PCRE2_COMPILE_FUNCTIONS
#undef PCRE2_PATTERN_INFO_FUNCTIONS
@@ -729,4 +845,6 @@ PCRE2_SUFFIX a no-op. Otherwise, generate an error. */
} /* extern "C" */
#endif
-#endif /* End of pcre2.h */
+#endif /* PCRE2_H_IDEMPOTENT_GUARD */
+
+/* End of pcre2.h */
diff --git a/src/3rdparty/pcre2/src/pcre2_auto_possess.c b/src/3rdparty/pcre2/src/pcre2_auto_possess.c
index 8d0fa896ec..ad3543f627 100644
--- a/src/3rdparty/pcre2/src/pcre2_auto_possess.c
+++ b/src/3rdparty/pcre2/src/pcre2_auto_possess.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -588,7 +588,7 @@ for(;;)
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ONCE:
- case OP_ONCE_NC:
+
/* Atomic sub-patterns and assertions can always auto-possessify their
last iterator. However, if the group was entered as a result of checking
a previous iterator, this is not possible. */
@@ -600,12 +600,14 @@ for(;;)
continue;
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRA:
case OP_CBRA:
next_code = code + GET(code, 1);
code += PRIV(OP_lengths)[c];
+ /* Check each branch. We have to recurse a level for all but the last
+ branch. */
+
while (*next_code == OP_ALT)
{
if (!compare_opcodes(code, utf, cb, base_list, base_end, rec_limit))
@@ -621,8 +623,8 @@ for(;;)
case OP_BRAMINZERO:
next_code = code + 1;
- if (*next_code != OP_BRA && *next_code != OP_CBRA
- && *next_code != OP_ONCE && *next_code != OP_ONCE_NC) return FALSE;
+ if (*next_code != OP_BRA && *next_code != OP_CBRA &&
+ *next_code != OP_ONCE) return FALSE;
do next_code += GET(next_code, 1); while (*next_code == OP_ALT);
@@ -1046,8 +1048,10 @@ but some compilers complain about an unreachable statement. */
/* Replaces single character iterations with their possessive alternatives
if appropriate. This function modifies the compiled opcode! Hitting a
-non-existant opcode may indicate a bug in PCRE2, but it can also be caused if a
-bad UTF string was compiled with PCRE2_NO_UTF_CHECK.
+non-existent opcode may indicate a bug in PCRE2, but it can also be caused if a
+bad UTF string was compiled with PCRE2_NO_UTF_CHECK. The rec_limit catches
+overly complicated or large patterns. In these cases, the check just stops,
+leaving the remainder of the pattern unpossessified.
Arguments:
code points to start of the byte code
@@ -1061,17 +1065,17 @@ Returns: 0 for success
int
PRIV(auto_possessify)(PCRE2_UCHAR *code, BOOL utf, const compile_block *cb)
{
-register PCRE2_UCHAR c;
+PCRE2_UCHAR c;
PCRE2_SPTR end;
PCRE2_UCHAR *repeat_opcode;
uint32_t list[8];
-int rec_limit;
+int rec_limit = 1000; /* Was 10,000 but clang+ASAN uses a lot of stack. */
for (;;)
{
c = *code;
- if (c > OP_TABLE_LENGTH) return -1; /* Something gone wrong */
+ if (c >= OP_TABLE_LENGTH) return -1; /* Something gone wrong */
if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
{
@@ -1080,7 +1084,6 @@ for (;;)
get_chr_property_list(code, utf, cb->fcc, list) : NULL;
list[1] = c == OP_STAR || c == OP_PLUS || c == OP_QUERY || c == OP_UPTO;
- rec_limit = 1000;
if (end != NULL && compare_opcodes(end, utf, cb, list, end, &rec_limit))
{
switch(c)
@@ -1137,7 +1140,6 @@ for (;;)
list[1] = (c & 1) == 0;
- rec_limit = 1000;
if (compare_opcodes(end, utf, cb, list, end, &rec_limit))
{
switch (c)
diff --git a/src/3rdparty/pcre2/src/pcre2_compile.c b/src/3rdparty/pcre2/src/pcre2_compile.c
index bb9736cd51..44ee2502c8 100644
--- a/src/3rdparty/pcre2/src/pcre2_compile.c
+++ b/src/3rdparty/pcre2/src/pcre2_compile.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -58,9 +58,14 @@ POSSIBILITY OF SUCH DAMAGE.
#define PRINTABLE(c) ((c) >= 32 && (c) < 127)
#endif
#include "pcre2_printint.c"
-#define CALL_PRINTINT
+#define DEBUG_CALL_PRINTINT
#endif
+/* Other debugging code can be enabled by these defines. */
+
+// #define DEBUG_SHOW_CAPTURES
+// #define DEBUG_SHOW_PARSED
+
/* There are a few things that vary with different code unit sizes. Handle them
by defining macros in order to minimize #if usage. */
@@ -79,16 +84,56 @@ by defining macros in order to minimize #if usage. */
#endif
#endif
+/* Macros to store and retrieve a PCRE2_SIZE value in the parsed pattern, which
+consists of uint32_t elements. Assume that if uint32_t can't hold it, two of
+them will be able to (i.e. assume a 64-bit world). */
+
+#if PCRE2_SIZE_MAX <= UINT32_MAX
+#define PUTOFFSET(s,p) *p++ = s
+#define GETOFFSET(s,p) s = *p++
+#define GETPLUSOFFSET(s,p) s = *(++p)
+#define READPLUSOFFSET(s,p) s = p[1]
+#define SKIPOFFSET(p) p++
+#define SIZEOFFSET 1
+#else
+#define PUTOFFSET(s,p) \
+ { *p++ = (uint32_t)(s >> 32); *p++ = (uint32_t)(s & 0xffffffff); }
+#define GETOFFSET(s,p) \
+ { s = ((PCRE2_SIZE)p[0] << 32) | (PCRE2_SIZE)p[1]; p += 2; }
+#define GETPLUSOFFSET(s,p) \
+ { s = ((PCRE2_SIZE)p[1] << 32) | (PCRE2_SIZE)p[2]; p += 2; }
+#define READPLUSOFFSET(s,p) \
+ { s = ((PCRE2_SIZE)p[1] << 32) | (PCRE2_SIZE)p[2]; }
+#define SKIPOFFSET(p) p += 2
+#define SIZEOFFSET 2
+#endif
+
+/* Macros for manipulating elements of the parsed pattern vector. */
+
+#define META_CODE(x) (x & 0xffff0000u)
+#define META_DATA(x) (x & 0x0000ffffu)
+#define META_DIFF(x,y) ((x-y)>>16)
+
/* Function definitions to allow mutual recursion */
+#ifdef SUPPORT_UNICODE
static unsigned int
- add_list_to_class(uint8_t *, PCRE2_UCHAR **, uint32_t, compile_block *,
- const uint32_t *, unsigned int);
+ add_list_to_class_internal(uint8_t *, PCRE2_UCHAR **, uint32_t,
+ compile_block *, const uint32_t *, unsigned int);
+#endif
+
+static int
+ compile_regex(uint32_t, PCRE2_UCHAR **, uint32_t **, int *, uint32_t,
+ uint32_t *, int32_t *, uint32_t *, int32_t *, branch_chain *,
+ compile_block *, PCRE2_SIZE *);
+
+static int
+ get_branchlength(uint32_t **, int *, int *, parsed_recurse_check *,
+ compile_block *);
static BOOL
- compile_regex(uint32_t, PCRE2_UCHAR **, PCRE2_SPTR *, int *, BOOL, BOOL,
- uint32_t, int, uint32_t *, int32_t *, uint32_t *, int32_t *,
- branch_chain *, compile_block *, size_t *);
+ set_lookbehind_lengths(uint32_t **, int *, int *, parsed_recurse_check *,
+ compile_block *);
@@ -96,9 +141,15 @@ static BOOL
* Code parameters and static tables *
*************************************************/
-/* This value specifies the size of stack workspace, which is used in different
-ways in the different pattern scans. The group-identifying pre-scan uses it to
-handle nesting, and needs it to be 16-bit aligned.
+#define MAX_GROUP_NUMBER 65535u
+#define MAX_REPEAT_COUNT 65535u
+#define REPEAT_UNLIMITED (MAX_REPEAT_COUNT+1)
+
+/* COMPILE_WORK_SIZE specifies the size of stack workspace, which is used in
+different ways in the different pattern scans. The parsing and group-
+identifying pre-scan uses it to handle nesting, and needs it to be 16-bit
+aligned for this. Having defined the size in code units, we set up
+C16_WORK_SIZE as the number of elements in the 16-bit vector.
During the first compiling phase, when determining how much memory is required,
the regex is partly compiled into this space, but the compiled parts are
@@ -107,16 +158,18 @@ overrun. The code does, however, check for an overrun, which can occur for
pathological patterns. The size of the workspace depends on LINK_SIZE because
the length of compiled items varies with this.
-In the real compile phase, the workspace is used for remembering data about
-numbered groups, provided there are not too many of them (if there are, extra
-memory is acquired). For this phase the memory must be 32-bit aligned. Having
-defined the size in code units, we set up C32_WORK_SIZE as the number of
-elements in the 32-bit vector. */
+In the real compile phase, this workspace is not currently used. */
-#define COMPILE_WORK_SIZE (2048*LINK_SIZE) /* Size in code units */
+#define COMPILE_WORK_SIZE (3000*LINK_SIZE) /* Size in code units */
-#define C32_WORK_SIZE \
- ((COMPILE_WORK_SIZE * sizeof(PCRE2_UCHAR))/sizeof(uint32_t))
+#define C16_WORK_SIZE \
+ ((COMPILE_WORK_SIZE * sizeof(PCRE2_UCHAR))/sizeof(uint16_t))
+
+/* A uint32_t vector is used for caching information about the size of
+capturing groups, to improve performance. A default is created on the stack of
+this size. */
+
+#define GROUPINFO_DEFAULT_SIZE 256
/* The overrun tests check for a slightly smaller size so that they detect the
overrun before it actually does run off the end of the data block. */
@@ -130,25 +183,176 @@ value is the number of slots in the list. */
#define NAMED_GROUP_LIST_SIZE 20
-/* The original PCRE required patterns to be zero-terminated, and it simplifies
-the compiling code if it is guaranteed that there is a zero code unit at the
-end of the pattern, because this means that tests for coding sequences such as
-(*SKIP) or even just (?<= can check a sequence of code units without having to
-keep checking for the end of the pattern. The new PCRE2 API allows zero code
-units within patterns if a positive length is given, but in order to keep most
-of the compiling code as it was, we copy such patterns and add a zero on the
-end. This value determines the size of space on the stack that is used if the
-pattern fits; if not, heap memory is used. */
+/* The pre-compiling pass over the pattern creates a parsed pattern in a vector
+of uint32_t. For short patterns this lives on the stack, with this size. Heap
+memory is used for longer patterns. */
-#define COPIED_PATTERN_SIZE 1024
+#define PARSED_PATTERN_DEFAULT_SIZE 1024
/* Maximum length value to check against when making sure that the variable
that holds the compiled pattern length does not overflow. We make it a bit less
-than INT_MAX to allow for adding in group terminating bytes, so that we don't
-have to check them every time. */
+than INT_MAX to allow for adding in group terminating code units, so that we
+don't have to check them every time. */
#define OFLOW_MAX (INT_MAX - 20)
+/* Code values for parsed patterns, which are stored in a vector of 32-bit
+unsigned ints. Values less than META_END are literal data values. The coding
+for identifying the item is in the top 16-bits, leaving 16 bits for the
+additional data that some of them need. The META_CODE, META_DATA, and META_DIFF
+macros are used to manipulate parsed pattern elements.
+
+NOTE: When these definitions are changed, the table of extra lengths for each
+code (meta_extra_lengths, just below) must be updated to remain in step. */
+
+#define META_END 0x80000000u /* End of pattern */
+
+#define META_ALT 0x80010000u /* alternation */
+#define META_ATOMIC 0x80020000u /* atomic group */
+#define META_BACKREF 0x80030000u /* Back ref */
+#define META_BACKREF_BYNAME 0x80040000u /* \k'name' */
+#define META_BIGVALUE 0x80050000u /* Next is a literal > META_END */
+#define META_CALLOUT_NUMBER 0x80060000u /* (?C with numerical argument */
+#define META_CALLOUT_STRING 0x80070000u /* (?C with string argument */
+#define META_CAPTURE 0x80080000u /* Capturing parenthesis */
+#define META_CIRCUMFLEX 0x80090000u /* ^ metacharacter */
+#define META_CLASS 0x800a0000u /* start non-empty class */
+#define META_CLASS_EMPTY 0x800b0000u /* empty class */
+#define META_CLASS_EMPTY_NOT 0x800c0000u /* negative empty class */
+#define META_CLASS_END 0x800d0000u /* end of non-empty class */
+#define META_CLASS_NOT 0x800e0000u /* start non-empty negative class */
+#define META_COND_ASSERT 0x800f0000u /* (?(?assertion)... */
+#define META_COND_DEFINE 0x80100000u /* (?(DEFINE)... */
+#define META_COND_NAME 0x80110000u /* (?(<name>)... */
+#define META_COND_NUMBER 0x80120000u /* (?(digits)... */
+#define META_COND_RNAME 0x80130000u /* (?(R&name)... */
+#define META_COND_RNUMBER 0x80140000u /* (?(Rdigits)... */
+#define META_COND_VERSION 0x80150000u /* (?(VERSION<op>x.y)... */
+#define META_DOLLAR 0x80160000u /* $ metacharacter */
+#define META_DOT 0x80170000u /* . metacharacter */
+#define META_ESCAPE 0x80180000u /* \d and friends */
+#define META_KET 0x80190000u /* closing parenthesis */
+#define META_NOCAPTURE 0x801a0000u /* no capture parens */
+#define META_OPTIONS 0x801b0000u /* (?i) and friends */
+#define META_POSIX 0x801c0000u /* POSIX class item */
+#define META_POSIX_NEG 0x801d0000u /* negative POSIX class item */
+#define META_RANGE_ESCAPED 0x801e0000u /* range with at least one escape */
+#define META_RANGE_LITERAL 0x801f0000u /* range defined literally */
+#define META_RECURSE 0x80200000u /* Recursion */
+#define META_RECURSE_BYNAME 0x80210000u /* (?&name) */
+
+/* These must be kept together to make it easy to check that an assertion
+is present where expected in a conditional group. */
+
+#define META_LOOKAHEAD 0x80220000u /* (?= */
+#define META_LOOKAHEADNOT 0x80230000u /* (?! */
+#define META_LOOKBEHIND 0x80240000u /* (?<= */
+#define META_LOOKBEHINDNOT 0x80250000u /* (?<! */
+
+/* These must be kept in this order, with consecutive values, and the _ARG
+versions of PRUNE, SKIP, and THEN immediately after their non-argument
+versions. */
+
+#define META_MARK 0x80260000u /* (*MARK) */
+#define META_ACCEPT 0x80270000u /* (*ACCEPT) */
+#define META_COMMIT 0x80280000u /* (*COMMIT) */
+#define META_FAIL 0x80290000u /* (*FAIL) */
+#define META_PRUNE 0x802a0000u /* These pairs must */
+#define META_PRUNE_ARG 0x802b0000u /* be */
+#define META_SKIP 0x802c0000u /* kept */
+#define META_SKIP_ARG 0x802d0000u /* in */
+#define META_THEN 0x802e0000u /* this */
+#define META_THEN_ARG 0x802f0000u /* order */
+
+/* These must be kept in groups of adjacent 3 values, and all together. */
+
+#define META_ASTERISK 0x80300000u /* * */
+#define META_ASTERISK_PLUS 0x80310000u /* *+ */
+#define META_ASTERISK_QUERY 0x80320000u /* *? */
+#define META_PLUS 0x80330000u /* + */
+#define META_PLUS_PLUS 0x80340000u /* ++ */
+#define META_PLUS_QUERY 0x80350000u /* +? */
+#define META_QUERY 0x80360000u /* ? */
+#define META_QUERY_PLUS 0x80370000u /* ?+ */
+#define META_QUERY_QUERY 0x80380000u /* ?? */
+#define META_MINMAX 0x80390000u /* {n,m} repeat */
+#define META_MINMAX_PLUS 0x803a0000u /* {n,m}+ repeat */
+#define META_MINMAX_QUERY 0x803b0000u /* {n,m}? repeat */
+
+#define META_FIRST_QUANTIFIER META_ASTERISK
+#define META_LAST_QUANTIFIER META_MINMAX_QUERY
+
+/* Table of extra lengths for each of the meta codes. Must be kept in step with
+the definitions above. For some items these values are a basic length to which
+a variable amount has to be added. */
+
+static unsigned char meta_extra_lengths[] = {
+ 0, /* META_END */
+ 0, /* META_ALT */
+ 0, /* META_ATOMIC */
+ 0, /* META_BACKREF - more if group is >= 10 */
+ 1+SIZEOFFSET, /* META_BACKREF_BYNAME */
+ 1, /* META_BIGVALUE */
+ 3, /* META_CALLOUT_NUMBER */
+ 3+SIZEOFFSET, /* META_CALLOUT_STRING */
+ 0, /* META_CAPTURE */
+ 0, /* META_CIRCUMFLEX */
+ 0, /* META_CLASS */
+ 0, /* META_CLASS_EMPTY */
+ 0, /* META_CLASS_EMPTY_NOT */
+ 0, /* META_CLASS_END */
+ 0, /* META_CLASS_NOT */
+ 0, /* META_COND_ASSERT */
+ SIZEOFFSET, /* META_COND_DEFINE */
+ 1+SIZEOFFSET, /* META_COND_NAME */
+ 1+SIZEOFFSET, /* META_COND_NUMBER */
+ 1+SIZEOFFSET, /* META_COND_RNAME */
+ 1+SIZEOFFSET, /* META_COND_RNUMBER */
+ 3, /* META_COND_VERSION */
+ 0, /* META_DOLLAR */
+ 0, /* META_DOT */
+ 0, /* META_ESCAPE - more for ESC_P, ESC_p, ESC_g, ESC_k */
+ 0, /* META_KET */
+ 0, /* META_NOCAPTURE */
+ 1, /* META_OPTIONS */
+ 1, /* META_POSIX */
+ 1, /* META_POSIX_NEG */
+ 0, /* META_RANGE_ESCAPED */
+ 0, /* META_RANGE_LITERAL */
+ SIZEOFFSET, /* META_RECURSE */
+ 1+SIZEOFFSET, /* META_RECURSE_BYNAME */
+ 0, /* META_LOOKAHEAD */
+ 0, /* META_LOOKAHEADNOT */
+ SIZEOFFSET, /* META_LOOKBEHIND */
+ SIZEOFFSET, /* META_LOOKBEHINDNOT */
+ 1, /* META_MARK - plus the string length */
+ 0, /* META_ACCEPT */
+ 0, /* META_COMMIT */
+ 0, /* META_FAIL */
+ 0, /* META_PRUNE */
+ 1, /* META_PRUNE_ARG - plus the string length */
+ 0, /* META_SKIP */
+ 1, /* META_SKIP_ARG - plus the string length */
+ 0, /* META_THEN */
+ 1, /* META_THEN_ARG - plus the string length */
+ 0, /* META_ASTERISK */
+ 0, /* META_ASTERISK_PLUS */
+ 0, /* META_ASTERISK_QUERY */
+ 0, /* META_PLUS */
+ 0, /* META_PLUS_PLUS */
+ 0, /* META_PLUS_QUERY */
+ 0, /* META_QUERY */
+ 0, /* META_QUERY_PLUS */
+ 0, /* META_QUERY_QUERY */
+ 2, /* META_MINMAX */
+ 2, /* META_MINMAX_PLUS */
+ 2 /* META_MINMAX_QUERY */
+};
+
+/* Types for skipping parts of a parsed pattern. */
+
+enum { PSKIP_ALT, PSKIP_CLASS, PSKIP_KET };
+
/* Macro for setting individual bits in class bitmaps. It took some
experimenting to figure out how to stop gcc 5.3.0 from warning with
-Wconversion. This version gets a warning:
@@ -170,17 +374,10 @@ compiler is clever with identical subexpressions. */
/* These flags are used in the groupinfo vector. */
-#define GI_SET_COULD_BE_EMPTY 0x80000000u
-#define GI_COULD_BE_EMPTY 0x40000000u
-#define GI_NOT_FIXED_LENGTH 0x20000000u
-#define GI_SET_FIXED_LENGTH 0x10000000u
+#define GI_SET_FIXED_LENGTH 0x80000000u
+#define GI_NOT_FIXED_LENGTH 0x40000000u
#define GI_FIXED_LENGTH_MASK 0x0000ffffu
-/* This bit (which is greater than any UTF value) is used to indicate that a
-variable contains a number of code units instead of an actual code point. */
-
-#define UTF_LENGTH 0x10000000l
-
/* This simple test for a decimal digit works for both ASCII/Unicode and EBCDIC
and is fast (a good compiler can turn it into a subtraction and unsigned
comparison). */
@@ -191,8 +388,8 @@ comparison). */
locale, and may mark arbitrary characters as digits. We want to recognize only
0-9, a-z, and A-Z as hex digits, which is why we have a private table here. It
costs 256 bytes, but it is a lot faster than doing character value tests (at
-least in some simple cases I timed), and in some applications one wants PCRE to
-compile efficiently as well as match efficiently. The value in the table is
+least in some simple cases I timed), and in some applications one wants PCRE2
+to compile efficiently as well as match efficiently. The value in the table is
the binary hex digit value, or 0xff for non-hex digits. */
/* This is the "normal" case, for ASCII systems, and EBCDIC systems running in
@@ -380,9 +577,9 @@ string is built from string macros so that it works in UTF-8 mode on EBCDIC
platforms. */
typedef struct verbitem {
- int len; /* Length of verb name */
- int op; /* Op when no arg, or -1 if arg mandatory */
- int op_arg; /* Op when arg present, or -1 if not allowed */
+ unsigned int len; /* Length of verb name */
+ uint32_t meta; /* Base META_ code */
+ int has_arg; /* Argument requirement */
} verbitem;
static const char verbnames[] =
@@ -397,32 +594,30 @@ static const char verbnames[] =
STRING_THEN;
static const verbitem verbs[] = {
- { 0, -1, OP_MARK },
- { 4, -1, OP_MARK },
- { 6, OP_ACCEPT, -1 },
- { 6, OP_COMMIT, -1 },
- { 1, OP_FAIL, -1 },
- { 4, OP_FAIL, -1 },
- { 5, OP_PRUNE, OP_PRUNE_ARG },
- { 4, OP_SKIP, OP_SKIP_ARG },
- { 4, OP_THEN, OP_THEN_ARG }
+ { 0, META_MARK, +1 }, /* > 0 => must have an argument */
+ { 4, META_MARK, +1 },
+ { 6, META_ACCEPT, -1 }, /* < 0 => must not have an argument */
+ { 6, META_COMMIT, -1 },
+ { 1, META_FAIL, -1 },
+ { 4, META_FAIL, -1 },
+ { 5, META_PRUNE, 0 }, /* Argument is optional; bump META code if found */
+ { 4, META_SKIP, 0 },
+ { 4, META_THEN, 0 }
};
static const int verbcount = sizeof(verbs)/sizeof(verbitem);
+/* Verb opcodes, indexed by their META code offset from META_MARK. */
-/* Substitutes for [[:<:]] and [[:>:]], which mean start and end of word in
-another regex library. */
-
-static const PCRE2_UCHAR sub_start_of_word[] = {
- CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
- CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w, CHAR_RIGHT_PARENTHESIS, '\0' };
+static const uint32_t verbops[] = {
+ OP_MARK, OP_ACCEPT, OP_COMMIT, OP_FAIL, OP_PRUNE, OP_PRUNE_ARG, OP_SKIP,
+ OP_SKIP_ARG, OP_THEN, OP_THEN_ARG };
-static const PCRE2_UCHAR sub_end_of_word[] = {
- CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
- CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w,
- CHAR_RIGHT_PARENTHESIS, '\0' };
+/* Offsets from OP_STAR for case-independent and negative repeat opcodes. */
+static uint32_t chartypeoffset[] = {
+ OP_STAR - OP_STAR, OP_STARI - OP_STAR,
+ OP_NOTSTAR - OP_STAR, OP_NOTSTARI - OP_STAR };
/* Tables of names of POSIX character classes and their lengths. The names are
now all in a single string, to reduce the number of relocations when a shared
@@ -444,7 +639,6 @@ static const uint8_t posix_name_lengths[] = {
#define PC_PRINT 9
#define PC_PUNCT 10
-
/* Table of class bit maps for each POSIX class. Each class is formed from a
base map, with an optional addition or removal of another map. Then, for some
classes, there is some additional tweaking: for [:blank:] the vertical space
@@ -472,130 +666,53 @@ static const int posix_class_maps[] = {
cbit_xdigit,-1, 0 /* xdigit */
};
-/* Table of substitutes for \d etc when PCRE2_UCP is set. They are replaced by
-Unicode property escapes. */
-
#ifdef SUPPORT_UNICODE
-static const PCRE2_UCHAR string_PNd[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pNd[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PXsp[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pXsp[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PXwd[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pXwd[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-
-static PCRE2_SPTR substitutes[] = {
- string_PNd, /* \D */
- string_pNd, /* \d */
- string_PXsp, /* \S */ /* Xsp is Perl space, but from 8.34, Perl */
- string_pXsp, /* \s */ /* space and POSIX space are the same. */
- string_PXwd, /* \W */
- string_pXwd /* \w */
-};
-/* The POSIX class substitutes must be in the order of the POSIX class names,
-defined above, and there are both positive and negative cases. NULL means no
-general substitute of a Unicode property escape (\p or \P). However, for some
-POSIX classes (e.g. graph, print, punct) a special property code is compiled
-directly. */
-
-static const PCRE2_UCHAR string_pCc[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_C, CHAR_c, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pL[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pLl[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pLu[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_pXan[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_h[] = {
- CHAR_BACKSLASH, CHAR_h, '\0' };
-static const PCRE2_UCHAR string_pXps[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PCc[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_C, CHAR_c, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PL[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PLl[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PLu[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_PXan[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const PCRE2_UCHAR string_H[] = {
- CHAR_BACKSLASH, CHAR_H, '\0' };
-static const PCRE2_UCHAR string_PXps[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-
-static PCRE2_SPTR posix_substitutes[] = {
- string_pL, /* alpha */
- string_pLl, /* lower */
- string_pLu, /* upper */
- string_pXan, /* alnum */
- NULL, /* ascii */
- string_h, /* blank */
- string_pCc, /* cntrl */
- string_pNd, /* digit */
- NULL, /* graph */
- NULL, /* print */
- NULL, /* punct */
- string_pXps, /* space */ /* Xps is POSIX space, but from 8.34 */
- string_pXwd, /* word */ /* Perl and POSIX space are the same */
- NULL, /* xdigit */
- /* Negated cases */
- string_PL, /* ^alpha */
- string_PLl, /* ^lower */
- string_PLu, /* ^upper */
- string_PXan, /* ^alnum */
- NULL, /* ^ascii */
- string_H, /* ^blank */
- string_PCc, /* ^cntrl */
- string_PNd, /* ^digit */
- NULL, /* ^graph */
- NULL, /* ^print */
- NULL, /* ^punct */
- string_PXps, /* ^space */ /* Xps is POSIX space, but from 8.34 */
- string_PXwd, /* ^word */ /* Perl and POSIX space are the same */
- NULL /* ^xdigit */
+/* The POSIX class Unicode property substitutes that are used in UCP mode must
+be in the order of the POSIX class names, defined above. */
+
+static int posix_substitutes[] = {
+ PT_GC, ucp_L, /* alpha */
+ PT_PC, ucp_Ll, /* lower */
+ PT_PC, ucp_Lu, /* upper */
+ PT_ALNUM, 0, /* alnum */
+ -1, 0, /* ascii, treat as non-UCP */
+ -1, 1, /* blank, treat as \h */
+ PT_PC, ucp_Cc, /* cntrl */
+ PT_PC, ucp_Nd, /* digit */
+ PT_PXGRAPH, 0, /* graph */
+ PT_PXPRINT, 0, /* print */
+ PT_PXPUNCT, 0, /* punct */
+ PT_PXSPACE, 0, /* space */ /* Xps is POSIX space, but from 8.34 */
+ PT_WORD, 0, /* word */ /* Perl and POSIX space are the same */
+ -1, 0 /* xdigit, treat as non-UCP */
};
-#define POSIX_SUBSIZE (sizeof(posix_substitutes) / sizeof(PCRE2_UCHAR *))
+#define POSIX_SUBSIZE (sizeof(posix_substitutes) / (2*sizeof(uint32_t)))
#endif /* SUPPORT_UNICODE */
-/* Masks for checking option settings. */
+/* Masks for checking option settings. When PCRE2_LITERAL is set, only a subset
+are allowed. */
+
+#define PUBLIC_LITERAL_COMPILE_OPTIONS \
+ (PCRE2_ANCHORED|PCRE2_AUTO_CALLOUT|PCRE2_CASELESS|PCRE2_ENDANCHORED| \
+ PCRE2_FIRSTLINE|PCRE2_LITERAL|PCRE2_NO_START_OPTIMIZE| \
+ PCRE2_NO_UTF_CHECK|PCRE2_USE_OFFSET_LIMIT|PCRE2_UTF)
#define PUBLIC_COMPILE_OPTIONS \
- (PCRE2_ANCHORED|PCRE2_ALLOW_EMPTY_CLASS|PCRE2_ALT_BSUX|PCRE2_ALT_CIRCUMFLEX| \
- PCRE2_ALT_VERBNAMES|PCRE2_AUTO_CALLOUT|PCRE2_CASELESS|PCRE2_DOLLAR_ENDONLY| \
- PCRE2_DOTALL|PCRE2_DUPNAMES|PCRE2_EXTENDED|PCRE2_FIRSTLINE| \
- PCRE2_MATCH_UNSET_BACKREF|PCRE2_MULTILINE|PCRE2_NEVER_BACKSLASH_C| \
- PCRE2_NEVER_UCP|PCRE2_NEVER_UTF|PCRE2_NO_AUTO_CAPTURE| \
- PCRE2_NO_AUTO_POSSESS|PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_NO_START_OPTIMIZE| \
- PCRE2_NO_UTF_CHECK|PCRE2_UCP|PCRE2_UNGREEDY|PCRE2_USE_OFFSET_LIMIT| \
- PCRE2_UTF)
+ (PUBLIC_LITERAL_COMPILE_OPTIONS| \
+ PCRE2_ALLOW_EMPTY_CLASS|PCRE2_ALT_BSUX|PCRE2_ALT_CIRCUMFLEX| \
+ PCRE2_ALT_VERBNAMES|PCRE2_DOLLAR_ENDONLY|PCRE2_DOTALL|PCRE2_DUPNAMES| \
+ PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MATCH_UNSET_BACKREF| \
+ PCRE2_MULTILINE|PCRE2_NEVER_BACKSLASH_C|PCRE2_NEVER_UCP| \
+ PCRE2_NEVER_UTF|PCRE2_NO_AUTO_CAPTURE|PCRE2_NO_AUTO_POSSESS| \
+ PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_UCP|PCRE2_UNGREEDY)
+
+#define PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS \
+ (PCRE2_EXTRA_MATCH_LINE|PCRE2_EXTRA_MATCH_WORD)
+
+#define PUBLIC_COMPILE_EXTRA_OPTIONS \
+ (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \
+ PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL)
/* Compile time error code numbers. They are given names so that they can more
easily be tracked. When a new number is added, the tables called eint1 and
@@ -611,21 +728,8 @@ enum { ERR0 = COMPILE_ERROR_BASE,
ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, ERR60,
ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70,
ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80,
- ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88 };
-
-/* Error codes that correspond to negative error codes returned by
-find_fixedlength(). */
-
-static int fixed_length_errors[] =
- {
- ERR0, /* Not an error */
- ERR0, /* Not an error; -1 is used for "process later" */
- ERR25, /* Lookbehind is not fixed length */
- ERR36, /* \C in lookbehind is not allowed */
- ERR87, /* Lookbehind is too long */
- ERR86, /* Pattern too complicated */
- ERR70 /* Internal error: unknown opcode encountered */
- };
+ ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90,
+ ERR91, ERR92};
/* This is a table of start-of-pattern options such as (*UTF) and settings such
as (*LIMIT_MATCH=nnnn) and (*CRLF). For completeness and backward
@@ -636,8 +740,9 @@ enum { PSO_OPT, /* Value is an option bit */
PSO_FLG, /* Value is a flag bit */
PSO_NL, /* Value is a newline type */
PSO_BSR, /* Value is a \R type */
+ PSO_LIMH, /* Read integer value for heap limit */
PSO_LIMM, /* Read integer value for match limit */
- PSO_LIMR }; /* Read integer value for recursion limit */
+ PSO_LIMD }; /* Read integer value for depth limit */
typedef struct pso {
const uint8_t *name;
@@ -658,12 +763,15 @@ static pso pso_list[] = {
{ (uint8_t *)STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR, 18, PSO_OPT, PCRE2_NO_DOTSTAR_ANCHOR },
{ (uint8_t *)STRING_NO_JIT_RIGHTPAR, 7, PSO_FLG, PCRE2_NOJIT },
{ (uint8_t *)STRING_NO_START_OPT_RIGHTPAR, 13, PSO_OPT, PCRE2_NO_START_OPTIMIZE },
+ { (uint8_t *)STRING_LIMIT_HEAP_EQ, 11, PSO_LIMH, 0 },
{ (uint8_t *)STRING_LIMIT_MATCH_EQ, 12, PSO_LIMM, 0 },
- { (uint8_t *)STRING_LIMIT_RECURSION_EQ, 16, PSO_LIMR, 0 },
+ { (uint8_t *)STRING_LIMIT_DEPTH_EQ, 12, PSO_LIMD, 0 },
+ { (uint8_t *)STRING_LIMIT_RECURSION_EQ, 16, PSO_LIMD, 0 },
{ (uint8_t *)STRING_CR_RIGHTPAR, 3, PSO_NL, PCRE2_NEWLINE_CR },
{ (uint8_t *)STRING_LF_RIGHTPAR, 3, PSO_NL, PCRE2_NEWLINE_LF },
{ (uint8_t *)STRING_CRLF_RIGHTPAR, 5, PSO_NL, PCRE2_NEWLINE_CRLF },
{ (uint8_t *)STRING_ANY_RIGHTPAR, 4, PSO_NL, PCRE2_NEWLINE_ANY },
+ { (uint8_t *)STRING_NUL_RIGHTPAR, 4, PSO_NL, PCRE2_NEWLINE_NUL },
{ (uint8_t *)STRING_ANYCRLF_RIGHTPAR, 8, PSO_NL, PCRE2_NEWLINE_ANYCRLF },
{ (uint8_t *)STRING_BSR_ANYCRLF_RIGHTPAR, 12, PSO_BSR, PCRE2_BSR_ANYCRLF },
{ (uint8_t *)STRING_BSR_UNICODE_RIGHTPAR, 12, PSO_BSR, PCRE2_BSR_UNICODE }
@@ -728,1056 +836,535 @@ static const uint8_t opcode_possessify[] = {
};
-
+#ifdef DEBUG_SHOW_PARSED
/*************************************************
-* Copy compiled code *
+* Show the parsed pattern for debugging *
*************************************************/
-/* Compiled JIT code cannot be copied, so the new compiled block has no
-associated JIT data. */
+/* For debugging the pre-scan, this code, which outputs the parsed data vector,
+can be enabled. */
-PCRE2_EXP_DEFN pcre2_code * PCRE2_CALL_CONVENTION
-pcre2_code_copy(const pcre2_code *code)
+static void show_parsed(compile_block *cb)
{
-PCRE2_SIZE* ref_count;
-pcre2_code *newcode;
+uint32_t *pptr = cb->parsed_pattern;
-if (code == NULL) return NULL;
-newcode = code->memctl.malloc(code->blocksize, code->memctl.memory_data);
-if (newcode == NULL) return NULL;
-memcpy(newcode, code, code->blocksize);
-newcode->executable_jit = NULL;
-
-/* If the code is one that has been deserialized, increment the reference count
-in the decoded tables. */
-
-if ((code->flags & PCRE2_DEREF_TABLES) != 0)
+for (;;)
{
- ref_count = (PCRE2_SIZE *)(code->tables + tables_length);
- (*ref_count)++;
- }
-
-return newcode;
-}
+ int max, min;
+ PCRE2_SIZE offset;
+ uint32_t i;
+ uint32_t length;
+ uint32_t meta_arg = META_DATA(*pptr);
+ fprintf(stderr, "+++ %02d %.8x ", (int)(pptr - cb->parsed_pattern), *pptr);
-
-/*************************************************
-* Free compiled code *
-*************************************************/
-
-PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
-pcre2_code_free(pcre2_code *code)
-{
-PCRE2_SIZE* ref_count;
-
-if (code != NULL)
- {
- if (code->executable_jit != NULL)
- PRIV(jit_free)(code->executable_jit, &code->memctl);
-
- if ((code->flags & PCRE2_DEREF_TABLES) != 0)
+ if (*pptr < META_END)
{
- /* Decoded tables belong to the codes after deserialization, and they must
- be freed when there are no more reference to them. The *ref_count should
- always be > 0. */
-
- ref_count = (PCRE2_SIZE *)(code->tables + tables_length);
- if (*ref_count > 0)
- {
- (*ref_count)--;
- if (*ref_count == 0)
- code->memctl.free((void *)code->tables, code->memctl.memory_data);
- }
+ if (*pptr > 32 && *pptr < 128) fprintf(stderr, "%c", *pptr);
+ pptr++;
}
- code->memctl.free(code, code->memctl.memory_data);
- }
-}
-
-
-
-/*************************************************
-* Insert an automatic callout point *
-*************************************************/
-
-/* This function is called when the PCRE2_AUTO_CALLOUT option is set, to insert
-callout points before each pattern item.
-
-Arguments:
- code current code pointer
- ptr current pattern pointer
- cb general compile-time data
-
-Returns: new code pointer
-*/
-
-static PCRE2_UCHAR *
-auto_callout(PCRE2_UCHAR *code, PCRE2_SPTR ptr, compile_block *cb)
-{
-code[0] = OP_CALLOUT;
-PUT(code, 1, ptr - cb->start_pattern); /* Pattern offset */
-PUT(code, 1 + LINK_SIZE, 0); /* Default length */
-code[1 + 2*LINK_SIZE] = 255;
-return code + PRIV(OP_lengths)[OP_CALLOUT];
-}
-
-
-
-/*************************************************
-* Complete a callout item *
-*************************************************/
-
-/* A callout item contains the length of the next item in the pattern, which
-we can't fill in till after we have reached the relevant point. This is used
-for both automatic and manual callouts.
-
-Arguments:
- previous_callout points to previous callout item
- ptr current pattern pointer
- cb general compile-time data
-
-Returns: nothing
-*/
-
-static void
-complete_callout(PCRE2_UCHAR *previous_callout, PCRE2_SPTR ptr,
- compile_block *cb)
-{
-size_t length = (size_t)(ptr - cb->start_pattern - GET(previous_callout, 1));
-PUT(previous_callout, 1 + LINK_SIZE, length);
-}
-
-
-
-/*************************************************
-* Find the fixed length of a branch *
-*************************************************/
-
-/* Scan a branch and compute the fixed length of subject that will match it, if
-the length is fixed. This is needed for dealing with lookbehind assertions. In
-UTF mode, the result is in code units rather than bytes. The branch is
-temporarily terminated with OP_END when this function is called.
-
-This function is called when a lookbehind assertion is encountered, so that if
-it fails, the error message can point to the correct place in the pattern.
-However, we cannot do this when the assertion contains subroutine calls,
-because they can be forward references. We solve this by remembering this case
-and doing the check at the end; a flag specifies which mode we are running in.
-
-Lookbehind lengths are held in 16-bit fields and the maximum value is defined
-as LOOKBEHIND_MAX.
-
-Arguments:
- code points to the start of the pattern (the bracket)
- utf TRUE in UTF mode
- atend TRUE if called when the pattern is complete
- cb the "compile data" structure
- recurses chain of recurse_check to catch mutual recursion
- countptr pointer to counter, to catch over-complexity
-
-Returns: if non-negative, the fixed length,
- or -1 if an OP_RECURSE item was encountered and atend is FALSE
- or -2 if there is no fixed length,
- or -3 if \C was encountered (in UTF mode only)
- or -4 if length is too long
- or -5 if regex is too complicated
- or -6 if an unknown opcode was encountered (internal error)
-*/
-
-#define FFL_LATER (-1)
-#define FFL_NOTFIXED (-2)
-#define FFL_BACKSLASHC (-3)
-#define FFL_TOOLONG (-4)
-#define FFL_TOOCOMPLICATED (-5)
-#define FFL_UNKNOWNOP (-6)
-
-static int
-find_fixedlength(PCRE2_UCHAR *code, BOOL utf, BOOL atend, compile_block *cb,
- recurse_check *recurses, int *countptr)
-{
-uint32_t length = 0xffffffffu; /* Unset */
-uint32_t group = 0;
-uint32_t groupinfo = 0;
-recurse_check this_recurse;
-register uint32_t branchlength = 0;
-register PCRE2_UCHAR *cc = code + 1 + LINK_SIZE;
-
-/* If this is a capturing group, we may have the answer cached, but we can only
-use this information if there are no (?| groups in the pattern, because
-otherwise group numbers are not unique. */
-
-if (*code == OP_CBRA || *code == OP_CBRAPOS || *code == OP_SCBRA ||
- *code == OP_SCBRAPOS)
- {
- group = GET2(cc, 0);
- cc += IMM2_SIZE;
- groupinfo = cb->groupinfo[group];
- if ((cb->external_flags & PCRE2_DUPCAPUSED) == 0)
+ else switch (META_CODE(*pptr++))
{
- if ((groupinfo & GI_NOT_FIXED_LENGTH) != 0) return FFL_NOTFIXED;
- if ((groupinfo & GI_SET_FIXED_LENGTH) != 0)
- return groupinfo & GI_FIXED_LENGTH_MASK;
- }
- }
-
-/* A large and/or complex regex can take too long to process. This can happen
-more often when (?| groups are present in the pattern. */
-
-if ((*countptr)++ > 2000) return FFL_TOOCOMPLICATED;
+ default:
+ fprintf(stderr, "**** OOPS - unknown META value - giving up ****\n");
+ return;
-/* Scan along the opcodes for this branch. If we get to the end of the
-branch, check the length against that of the other branches. */
+ case META_END:
+ fprintf(stderr, "META_END\n");
+ return;
-for (;;)
- {
- int d;
- PCRE2_UCHAR *ce, *cs;
- register PCRE2_UCHAR op = *cc;
+ case META_CAPTURE:
+ fprintf(stderr, "META_CAPTURE %d", meta_arg);
+ break;
- if (branchlength > LOOKBEHIND_MAX) return FFL_TOOLONG;
+ case META_RECURSE:
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "META_RECURSE %d %zd", meta_arg, offset);
+ break;
- switch (op)
- {
- /* We only need to continue for OP_CBRA (normal capturing bracket) and
- OP_BRA (normal non-capturing bracket) because the other variants of these
- opcodes are all concerned with unlimited repeated groups, which of course
- are not of fixed length. */
-
- case OP_CBRA:
- case OP_BRA:
- case OP_ONCE:
- case OP_ONCE_NC:
- case OP_COND:
- d = find_fixedlength(cc, utf, atend, cb, recurses, countptr);
- if (d < 0) return d;
- branchlength += (uint32_t)d;
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += 1 + LINK_SIZE;
+ case META_BACKREF:
+ if (meta_arg < 10)
+ offset = cb->small_ref_offset[meta_arg];
+ else
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "META_BACKREF %d %zd", meta_arg, offset);
break;
- /* Reached end of a branch; if it's a ket it is the end of a nested call.
- If it's ALT it is an alternation in a nested call. An ACCEPT is effectively
- an ALT. If it is END it's the end of the outer call. All can be handled by
- the same code. Note that we must not include the OP_KETRxxx opcodes here,
- because they all imply an unlimited repeat. */
-
- case OP_ALT:
- case OP_KET:
- case OP_END:
- case OP_ACCEPT:
- case OP_ASSERT_ACCEPT:
- if (length == 0xffffffffu) length = branchlength;
- else if (length != branchlength) goto ISNOTFIXED;
- if (*cc != OP_ALT)
+ case META_ESCAPE:
+ if (meta_arg == ESC_P || meta_arg == ESC_p)
+ {
+ uint32_t ptype = *pptr >> 16;
+ uint32_t pvalue = *pptr++ & 0xffff;
+ fprintf(stderr, "META \\%c %d %d", (meta_arg == ESC_P)? 'P':'p',
+ ptype, pvalue);
+ }
+ else
{
- if (group > 0)
+ uint32_t cc;
+ /* There's just one escape we might have here that isn't negated in the
+ escapes table. */
+ if (meta_arg == ESC_g) cc = CHAR_g;
+ else for (cc = ESCAPES_FIRST; cc <= ESCAPES_LAST; cc++)
{
- groupinfo |= (uint32_t)(GI_SET_FIXED_LENGTH | length);
- cb->groupinfo[group] = groupinfo;
+ if (meta_arg == (uint32_t)(-escapes[cc - ESCAPES_FIRST])) break;
}
- return (int)length;
+ if (cc > ESCAPES_LAST) cc = CHAR_QUESTION_MARK;
+ fprintf(stderr, "META \\%c", cc);
}
- cc += 1 + LINK_SIZE;
- branchlength = 0;
break;
- /* A true recursion implies not fixed length, but a subroutine call may
- be OK. If the subroutine is a forward reference, we can't deal with
- it until the end of the pattern, so return FFL_LATER. */
-
- case OP_RECURSE:
- if (!atend) return FFL_LATER;
- cs = ce = (PCRE2_UCHAR *)cb->start_code + GET(cc, 1); /* Start subpattern */
- do ce += GET(ce, 1); while (*ce == OP_ALT); /* End subpattern */
- if (cc > cs && cc < ce) goto ISNOTFIXED; /* Recursion */
- else /* Check for mutual recursion */
- {
- recurse_check *r = recurses;
- for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
- if (r != NULL) goto ISNOTFIXED; /* Mutual recursion */
- }
- this_recurse.prev = recurses;
- this_recurse.group = cs;
- d = find_fixedlength(cs, utf, atend, cb, &this_recurse, countptr);
- if (d < 0) return d;
- branchlength += (uint32_t)d;
- cc += 1 + LINK_SIZE;
+ case META_MINMAX:
+ min = *pptr++;
+ max = *pptr++;
+ if (max != REPEAT_UNLIMITED)
+ fprintf(stderr, "META {%d,%d}", min, max);
+ else
+ fprintf(stderr, "META {%d,}", min);
break;
- /* Skip over assertive subpatterns. Note that we must increment cc by
- 1 + LINK_SIZE at the end, not by OP_length[*cc] because in a recursive
- situation this assertion may be the one that is ultimately being checked
- for having a fixed length, in which case its terminating OP_KET will have
- been temporarily replaced by OP_END. */
-
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += 1 + LINK_SIZE;
+ case META_MINMAX_QUERY:
+ min = *pptr++;
+ max = *pptr++;
+ if (max != REPEAT_UNLIMITED)
+ fprintf(stderr, "META {%d,%d}?", min, max);
+ else
+ fprintf(stderr, "META {%d,}?", min);
break;
- /* Skip over things that don't match chars */
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- cc += cc[1] + PRIV(OP_lengths)[*cc];
+ case META_MINMAX_PLUS:
+ min = *pptr++;
+ max = *pptr++;
+ if (max != REPEAT_UNLIMITED)
+ fprintf(stderr, "META {%d,%d}+", min, max);
+ else
+ fprintf(stderr, "META {%d,}+", min);
break;
- case OP_CALLOUT:
- case OP_CIRC:
- case OP_CIRCM:
- case OP_CLOSE:
- case OP_COMMIT:
- case OP_CREF:
- case OP_FALSE:
- case OP_TRUE:
- case OP_DNCREF:
- case OP_DNRREF:
- case OP_DOLL:
- case OP_DOLLM:
- case OP_EOD:
- case OP_EODN:
- case OP_FAIL:
- case OP_NOT_WORD_BOUNDARY:
- case OP_PRUNE:
- case OP_REVERSE:
- case OP_RREF:
- case OP_SET_SOM:
- case OP_SKIP:
- case OP_SOD:
- case OP_SOM:
- case OP_THEN:
- case OP_WORD_BOUNDARY:
- cc += PRIV(OP_lengths)[*cc];
+ case META_BIGVALUE: fprintf(stderr, "META_BIGVALUE %.8x", *pptr++); break;
+ case META_CIRCUMFLEX: fprintf(stderr, "META_CIRCUMFLEX"); break;
+ case META_COND_ASSERT: fprintf(stderr, "META_COND_ASSERT"); break;
+ case META_DOLLAR: fprintf(stderr, "META_DOLLAR"); break;
+ case META_DOT: fprintf(stderr, "META_DOT"); break;
+ case META_ASTERISK: fprintf(stderr, "META *"); break;
+ case META_ASTERISK_QUERY: fprintf(stderr, "META *?"); break;
+ case META_ASTERISK_PLUS: fprintf(stderr, "META *+"); break;
+ case META_PLUS: fprintf(stderr, "META +"); break;
+ case META_PLUS_QUERY: fprintf(stderr, "META +?"); break;
+ case META_PLUS_PLUS: fprintf(stderr, "META ++"); break;
+ case META_QUERY: fprintf(stderr, "META ?"); break;
+ case META_QUERY_QUERY: fprintf(stderr, "META ??"); break;
+ case META_QUERY_PLUS: fprintf(stderr, "META ?+"); break;
+
+ case META_ATOMIC: fprintf(stderr, "META (?>"); break;
+ case META_NOCAPTURE: fprintf(stderr, "META (?:"); break;
+ case META_LOOKAHEAD: fprintf(stderr, "META (?="); break;
+ case META_LOOKAHEADNOT: fprintf(stderr, "META (?!"); break;
+ case META_KET: fprintf(stderr, "META )"); break;
+ case META_ALT: fprintf(stderr, "META | %d", meta_arg); break;
+
+ case META_CLASS: fprintf(stderr, "META ["); break;
+ case META_CLASS_NOT: fprintf(stderr, "META [^"); break;
+ case META_CLASS_END: fprintf(stderr, "META ]"); break;
+ case META_CLASS_EMPTY: fprintf(stderr, "META []"); break;
+ case META_CLASS_EMPTY_NOT: fprintf(stderr, "META [^]"); break;
+
+ case META_RANGE_LITERAL: fprintf(stderr, "META - (literal)"); break;
+ case META_RANGE_ESCAPED: fprintf(stderr, "META - (escaped)"); break;
+
+ case META_POSIX: fprintf(stderr, "META_POSIX %d", *pptr++); break;
+ case META_POSIX_NEG: fprintf(stderr, "META_POSIX_NEG %d", *pptr++); break;
+
+ case META_ACCEPT: fprintf(stderr, "META (*ACCEPT)"); break;
+ case META_COMMIT: fprintf(stderr, "META (*COMMIT)"); break;
+ case META_FAIL: fprintf(stderr, "META (*FAIL)"); break;
+ case META_PRUNE: fprintf(stderr, "META (*PRUNE)"); break;
+ case META_SKIP: fprintf(stderr, "META (*SKIP)"); break;
+ case META_THEN: fprintf(stderr, "META (*THEN)"); break;
+
+ case META_OPTIONS: fprintf(stderr, "META_OPTIONS 0x%02x", *pptr++); break;
+
+ case META_LOOKBEHIND:
+ fprintf(stderr, "META (?<= %d offset=", meta_arg);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
break;
- case OP_CALLOUT_STR:
- cc += GET(cc, 1 + 2*LINK_SIZE);
+ case META_LOOKBEHINDNOT:
+ fprintf(stderr, "META (?<! %d offset=", meta_arg);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
break;
- /* Handle literal characters */
+ case META_CALLOUT_NUMBER:
+ fprintf(stderr, "META (?C%d) next=%d/%d", pptr[2], pptr[0],
+ pptr[1]);
+ pptr += 3;
+ break;
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- branchlength++;
- cc += 2;
-#ifdef SUPPORT_UNICODE
- if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
-#endif
+ case META_CALLOUT_STRING:
+ {
+ uint32_t patoffset = *pptr++; /* Offset of next pattern item */
+ uint32_t patlength = *pptr++; /* Length of next pattern item */
+ fprintf(stderr, "META (?Cstring) length=%d offset=", *pptr++);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd next=%d/%d", offset, patoffset, patlength);
+ }
break;
- /* Handle exact repetitions. The count is already in characters, but we
- need to skip over a multibyte character in UTF8 mode. */
+ case META_RECURSE_BYNAME:
+ fprintf(stderr, "META (?(&name) length=%d offset=", *pptr++);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
+ break;
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- branchlength += GET2(cc,1);
- cc += 2 + IMM2_SIZE;
-#ifdef SUPPORT_UNICODE
- if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
-#endif
+ case META_BACKREF_BYNAME:
+ fprintf(stderr, "META_BACKREF_BYNAME length=%d offset=", *pptr++);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
break;
- case OP_TYPEEXACT:
- branchlength += GET2(cc,1);
- if (cc[1 + IMM2_SIZE] == OP_PROP || cc[1 + IMM2_SIZE] == OP_NOTPROP)
- cc += 2;
- cc += 1 + IMM2_SIZE + 1;
+ case META_COND_NUMBER:
+ fprintf(stderr, "META_COND_NUMBER %d offset=", pptr[SIZEOFFSET]);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
+ pptr++;
break;
- /* Handle single-char matchers */
+ case META_COND_DEFINE:
+ fprintf(stderr, "META (?(DEFINE) offset=");
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
+ break;
- case OP_PROP:
- case OP_NOTPROP:
- cc += 2;
- /* Fall through */
+ case META_COND_VERSION:
+ fprintf(stderr, "META (?(VERSION%s", (*pptr++ == 0)? "=" : ">=");
+ fprintf(stderr, "%d.", *pptr++);
+ fprintf(stderr, "%d)", *pptr++);
+ break;
- case OP_HSPACE:
- case OP_VSPACE:
- case OP_NOT_HSPACE:
- case OP_NOT_VSPACE:
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- branchlength++;
- cc++;
+ case META_COND_NAME:
+ fprintf(stderr, "META (?(<name>) length=%d offset=", *pptr++);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
break;
- /* The single-byte matcher isn't allowed. This only happens in UTF-8 or
- UTF-16 mode; otherwise \C is coded as OP_ALLANY. */
+ case META_COND_RNAME:
+ fprintf(stderr, "META (?(R&name) length=%d offset=", *pptr++);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
+ break;
- case OP_ANYBYTE:
- return FFL_BACKSLASHC;
+ /* This is kept as a name, because it might be. */
- /* Check a class for variable quantification */
+ case META_COND_RNUMBER:
+ fprintf(stderr, "META (?(Rnumber) length=%d offset=", *pptr++);
+ GETOFFSET(offset, pptr);
+ fprintf(stderr, "%zd", offset);
+ break;
- case OP_CLASS:
- case OP_NCLASS:
-#ifdef SUPPORT_WIDE_CHARS
- case OP_XCLASS:
- /* The original code caused an unsigned overflow in 64 bit systems,
- so now we use a conditional statement. */
- if (op == OP_XCLASS)
- cc += GET(cc, 1);
- else
- cc += PRIV(OP_lengths)[OP_CLASS];
-#else
- cc += PRIV(OP_lengths)[OP_CLASS];
-#endif
+ case META_MARK:
+ fprintf(stderr, "META (*MARK:");
+ goto SHOWARG;
- switch (*cc)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSPLUS:
- case OP_CRPOSQUERY:
- goto ISNOTFIXED;
+ case META_PRUNE_ARG:
+ fprintf(stderr, "META (*PRUNE:");
+ goto SHOWARG;
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) goto ISNOTFIXED;
- branchlength += GET2(cc,1);
- cc += 1 + 2 * IMM2_SIZE;
- break;
+ case META_SKIP_ARG:
+ fprintf(stderr, "META (*SKIP:");
+ goto SHOWARG;
- default:
- branchlength++;
+ case META_THEN_ARG:
+ fprintf(stderr, "META (*THEN:");
+ SHOWARG:
+ length = *pptr++;
+ for (i = 0; i < length; i++)
+ {
+ uint32_t cc = *pptr++;
+ if (cc > 32 && cc < 128) fprintf(stderr, "%c", cc);
+ else fprintf(stderr, "\\x{%x}", cc);
}
+ fprintf(stderr, ") length=%u", length);
break;
-
- /* Anything else is variable length */
-
- case OP_ANYNL:
- case OP_BRAMINZERO:
- case OP_BRAPOS:
- case OP_BRAPOSZERO:
- case OP_BRAZERO:
- case OP_CBRAPOS:
- case OP_EXTUNI:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_KETRPOS:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_REF:
- case OP_REFI:
- case OP_DNREF:
- case OP_DNREFI:
- case OP_SBRA:
- case OP_SBRAPOS:
- case OP_SCBRA:
- case OP_SCBRAPOS:
- case OP_SCOND:
- case OP_SKIPZERO:
- case OP_STAR:
- case OP_STARI:
- case OP_TYPEMINPLUS:
- case OP_TYPEMINQUERY:
- case OP_TYPEMINSTAR:
- case OP_TYPEMINUPTO:
- case OP_TYPEPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSUPTO:
- case OP_TYPEQUERY:
- case OP_TYPESTAR:
- case OP_TYPEUPTO:
- case OP_UPTO:
- case OP_UPTOI:
- goto ISNOTFIXED;
-
- /* Catch unrecognized opcodes so that when new ones are added they
- are not forgotten, as has happened in the past. */
-
- default:
- return FFL_UNKNOWNOP;
}
+ fprintf(stderr, "\n");
}
-/* Control never gets here except by goto. */
-
-ISNOTFIXED:
-if (group > 0)
- {
- groupinfo |= GI_NOT_FIXED_LENGTH;
- cb->groupinfo[group] = groupinfo;
- }
-return FFL_NOTFIXED;
+return;
}
+#endif /* DEBUG_SHOW_PARSED */
/*************************************************
-* Find first significant op code *
+* Copy compiled code *
*************************************************/
-/* This is called by several functions that scan a compiled expression looking
-for a fixed first character, or an anchoring op code etc. It skips over things
-that do not influence this. For some calls, it makes sense to skip negative
-forward and all backward assertions, and also the \b assertion; for others it
-does not.
-
-Arguments:
- code pointer to the start of the group
- skipassert TRUE if certain assertions are to be skipped
-
-Returns: pointer to the first significant opcode
-*/
+/* Compiled JIT code cannot be copied, so the new compiled block has no
+associated JIT data. */
-static const PCRE2_UCHAR*
-first_significant_code(PCRE2_SPTR code, BOOL skipassert)
+PCRE2_EXP_DEFN pcre2_code * PCRE2_CALL_CONVENTION
+pcre2_code_copy(const pcre2_code *code)
{
-for (;;)
- {
- switch ((int)*code)
- {
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- if (!skipassert) return code;
- do code += GET(code, 1); while (*code == OP_ALT);
- code += PRIV(OP_lengths)[*code];
- break;
-
- case OP_WORD_BOUNDARY:
- case OP_NOT_WORD_BOUNDARY:
- if (!skipassert) return code;
- /* Fall through */
+PCRE2_SIZE* ref_count;
+pcre2_code *newcode;
- case OP_CALLOUT:
- case OP_CREF:
- case OP_DNCREF:
- case OP_RREF:
- case OP_DNRREF:
- case OP_FALSE:
- case OP_TRUE:
- code += PRIV(OP_lengths)[*code];
- break;
+if (code == NULL) return NULL;
+newcode = code->memctl.malloc(code->blocksize, code->memctl.memory_data);
+if (newcode == NULL) return NULL;
+memcpy(newcode, code, code->blocksize);
+newcode->executable_jit = NULL;
- case OP_CALLOUT_STR:
- code += GET(code, 1 + 2*LINK_SIZE);
- break;
+/* If the code is one that has been deserialized, increment the reference count
+in the decoded tables. */
- default:
- return code;
- }
+if ((code->flags & PCRE2_DEREF_TABLES) != 0)
+ {
+ ref_count = (PCRE2_SIZE *)(code->tables + tables_length);
+ (*ref_count)++;
}
-/* Control never reaches here */
+
+return newcode;
}
/*************************************************
-* Scan compiled branch for non-emptiness *
+* Copy compiled code and character tables *
*************************************************/
-/* This function scans through a branch of a compiled pattern to see whether it
-can match the empty string. It is called at the end of compiling to check the
-entire pattern, and from compile_branch() when checking for an unlimited repeat
-of a group that can match nothing. In the latter case it is called only when
-doing the real compile, not during the pre-compile that measures the size of
-the compiled pattern.
-
-Note that first_significant_code() skips over backward and negative forward
-assertions when its final argument is TRUE. If we hit an unclosed bracket, we
-return "empty" - this means we've struck an inner bracket whose current branch
-will already have been scanned.
-
-Arguments:
- code points to start of search
- endcode points to where to stop
- utf TRUE if in UTF mode
- cb compile data
- atend TRUE if being called to check an entire pattern
- recurses chain of recurse_check to catch mutual recursion
- countptr pointer to count to catch over-complicated pattern
-
-Returns: 0 if what is matched cannot be empty
- 1 if what is matched could be empty
- -1 if the pattern is too complicated
-*/
-
-#define CBE_NOTEMPTY 0
-#define CBE_EMPTY 1
-#define CBE_TOOCOMPLICATED (-1)
-
+/* Compiled JIT code cannot be copied, so the new compiled block has no
+associated JIT data. This version of code_copy also makes a separate copy of
+the character tables. */
-static int
-could_be_empty_branch(PCRE2_SPTR code, PCRE2_SPTR endcode, BOOL utf,
- compile_block *cb, BOOL atend, recurse_check *recurses, int *countptr)
+PCRE2_EXP_DEFN pcre2_code * PCRE2_CALL_CONVENTION
+pcre2_code_copy_with_tables(const pcre2_code *code)
{
-uint32_t group = 0;
-uint32_t groupinfo = 0;
-register PCRE2_UCHAR c;
-recurse_check this_recurse;
-
-/* If what we are checking has already been set as "could be empty", we know
-the answer. */
-
-if (*code >= OP_SBRA && *code <= OP_SCOND) return CBE_EMPTY;
+PCRE2_SIZE* ref_count;
+pcre2_code *newcode;
+uint8_t *newtables;
-/* If this is a capturing group, we may have the answer cached, but we can only
-use this information if there are no (?| groups in the pattern, because
-otherwise group numbers are not unique. */
+if (code == NULL) return NULL;
+newcode = code->memctl.malloc(code->blocksize, code->memctl.memory_data);
+if (newcode == NULL) return NULL;
+memcpy(newcode, code, code->blocksize);
+newcode->executable_jit = NULL;
-if ((cb->external_flags & PCRE2_DUPCAPUSED) == 0 &&
- (*code == OP_CBRA || *code == OP_CBRAPOS))
+newtables = code->memctl.malloc(tables_length + sizeof(PCRE2_SIZE),
+ code->memctl.memory_data);
+if (newtables == NULL)
{
- group = GET2(code, 1 + LINK_SIZE);
- groupinfo = cb->groupinfo[group];
- if ((groupinfo & GI_SET_COULD_BE_EMPTY) != 0)
- return ((groupinfo & GI_COULD_BE_EMPTY) != 0)? CBE_EMPTY : CBE_NOTEMPTY;
+ code->memctl.free((void *)newcode, code->memctl.memory_data);
+ return NULL;
}
+memcpy(newtables, code->tables, tables_length);
+ref_count = (PCRE2_SIZE *)(newtables + tables_length);
+*ref_count = 1;
-/* A large and/or complex regex can take too long to process. We have to assume
-it can match an empty string. This can happen more often when (?| groups are
-present in the pattern and the caching is disabled. Setting the cap at 1100
-allows the test for more than 1023 capturing patterns to work. */
+newcode->tables = newtables;
+newcode->flags |= PCRE2_DEREF_TABLES;
+return newcode;
+}
-if ((*countptr)++ > 1100) return CBE_TOOCOMPLICATED;
-/* Scan the opcodes for this branch. */
-for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
- code < endcode;
- code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE))
- {
- PCRE2_SPTR ccode;
+/*************************************************
+* Free compiled code *
+*************************************************/
- c = *code;
+PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
+pcre2_code_free(pcre2_code *code)
+{
+PCRE2_SIZE* ref_count;
- /* Skip over forward assertions; the other assertions are skipped by
- first_significant_code() with a TRUE final argument. */
+if (code != NULL)
+ {
+ if (code->executable_jit != NULL)
+ PRIV(jit_free)(code->executable_jit, &code->memctl);
- if (c == OP_ASSERT)
+ if ((code->flags & PCRE2_DEREF_TABLES) != 0)
{
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
+ /* Decoded tables belong to the codes after deserialization, and they must
+ be freed when there are no more reference to them. The *ref_count should
+ always be > 0. */
+
+ ref_count = (PCRE2_SIZE *)(code->tables + tables_length);
+ if (*ref_count > 0)
+ {
+ (*ref_count)--;
+ if (*ref_count == 0)
+ code->memctl.free((void *)code->tables, code->memctl.memory_data);
+ }
}
- /* For a recursion/subroutine call we can scan the recursion when this
- function is called at the end, to check a complete pattern. Before then,
- recursions just have the group number as their argument and in any case may
- be forward references. In that situation, we return CBE_EMPTY, just in case.
- It means that unlimited repeats of groups that contain recursions are always
- treated as "could be empty" - which just adds a bit more processing time
- because of the runtime check. */
+ code->memctl.free(code, code->memctl.memory_data);
+ }
+}
- if (c == OP_RECURSE)
- {
- PCRE2_SPTR scode, endgroup;
- BOOL empty_branch;
- if (!atend) goto ISTRUE;
- scode = cb->start_code + GET(code, 1);
- endgroup = scode;
- /* We need to detect whether this is a recursive call, as otherwise there
- will be an infinite loop. If it is a recursion, just skip over it. Simple
- recursions are easily detected. For mutual recursions we keep a chain on
- the stack. */
+/*************************************************
+* Read a number, possibly signed *
+*************************************************/
- do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT);
- if (code >= scode && code <= endgroup) continue; /* Simple recursion */
- else
- {
- recurse_check *r = recurses;
- for (r = recurses; r != NULL; r = r->prev)
- if (r->group == scode) break;
- if (r != NULL) continue; /* Mutual recursion */
- }
+/* This function is used to read numbers in the pattern. The initial pointer
+must be the sign or first digit of the number. When relative values (introduced
+by + or -) are allowed, they are relative group numbers, and the result must be
+greater than zero.
- /* Scan the referenced group, remembering it on the stack chain to detect
- mutual recursions. */
+Arguments:
+ ptrptr points to the character pointer variable
+ ptrend points to the end of the input string
+ allow_sign if < 0, sign not allowed; if >= 0, sign is relative to this
+ max_value the largest number allowed
+ max_error the error to give for an over-large number
+ intptr where to put the result
+ errcodeptr where to put an error code
+
+Returns: TRUE - a number was read
+ FALSE - errorcode == 0 => no number was found
+ errorcode != 0 => an error occurred
+*/
- empty_branch = FALSE;
- this_recurse.prev = recurses;
- this_recurse.group = scode;
+static BOOL
+read_number(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, int32_t allow_sign,
+ uint32_t max_value, uint32_t max_error, int *intptr, int *errorcodeptr)
+{
+int sign = 0;
+uint32_t n = 0;
+PCRE2_SPTR ptr = *ptrptr;
+BOOL yield = FALSE;
- do
- {
- int rc = could_be_empty_branch(scode, endcode, utf, cb, atend,
- &this_recurse, countptr);
- if (rc < 0) return rc;
- if (rc > 0)
- {
- empty_branch = TRUE;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
+*errorcodeptr = 0;
- if (!empty_branch) goto ISFALSE; /* All branches are non-empty */
- continue;
+if (allow_sign >= 0 && ptr < ptrend)
+ {
+ if (*ptr == CHAR_PLUS)
+ {
+ sign = +1;
+ max_value -= allow_sign;
+ ptr++;
}
-
- /* Groups with zero repeats can of course be empty; skip them. */
-
- if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO ||
- c == OP_BRAPOSZERO)
+ else if (*ptr == CHAR_MINUS)
{
- code += PRIV(OP_lengths)[c];
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
+ sign = -1;
+ ptr++;
}
+ }
- /* A nested group that is already marked as "could be empty" can just be
- skipped. */
-
- if (c == OP_SBRA || c == OP_SBRAPOS ||
- c == OP_SCBRA || c == OP_SCBRAPOS)
+if (ptr >= ptrend || !IS_DIGIT(*ptr)) return FALSE;
+while (ptr < ptrend && IS_DIGIT(*ptr))
+ {
+ n = n * 10 + *ptr++ - CHAR_0;
+ if (n > max_value)
{
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
+ *errorcodeptr = max_error;
+ goto EXIT;
}
+ }
- /* For other groups, scan the branches. */
-
- if (c == OP_BRA || c == OP_BRAPOS ||
- c == OP_CBRA || c == OP_CBRAPOS ||
- c == OP_ONCE || c == OP_ONCE_NC ||
- c == OP_COND || c == OP_SCOND)
+if (allow_sign >= 0 && sign != 0)
+ {
+ if (n == 0)
{
- BOOL empty_branch;
- if (GET(code, 1) == 0) goto ISTRUE; /* Hit unclosed bracket */
-
- /* If a conditional group has only one branch, there is a second, implied,
- empty branch, so just skip over the conditional, because it could be empty.
- Otherwise, scan the individual branches of the group. */
-
- if (c == OP_COND && code[GET(code, 1)] != OP_ALT)
- code += GET(code, 1);
- else
- {
- empty_branch = FALSE;
- do
- {
- if (!empty_branch)
- {
- int rc = could_be_empty_branch(code, endcode, utf, cb, atend,
- recurses, countptr);
- if (rc < 0) return rc;
- if (rc > 0) empty_branch = TRUE;
- }
- code += GET(code, 1);
- }
- while (*code == OP_ALT);
- if (!empty_branch) goto ISFALSE; /* All branches are non-empty */
- }
-
- c = *code;
- continue;
+ *errorcodeptr = ERR26; /* +0 and -0 are not allowed */
+ goto EXIT;
}
- /* Handle the other opcodes */
-
- switch (c)
+ if (sign > 0) n += allow_sign;
+ else if ((int)n > allow_sign)
{
- /* Check for quantifiers after a class. XCLASS is used for classes that
- cannot be represented just by a bit map. This includes negated single
- high-valued characters. The length in PRIV(OP_lengths)[] is zero; the
- actual length is stored in the compiled code, so we must update "code"
- here. */
-
-#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
- case OP_XCLASS:
- ccode = code += GET(code, 1);
- goto CHECK_CLASS_REPEAT;
-#endif
-
- case OP_CLASS:
- case OP_NCLASS:
- ccode = code + PRIV(OP_lengths)[OP_CLASS];
-
-#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
- CHECK_CLASS_REPEAT:
-#endif
-
- switch (*ccode)
- {
- case OP_CRSTAR: /* These could be empty; continue */
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSQUERY:
- break;
+ *errorcodeptr = ERR15; /* Non-existent subpattern */
+ goto EXIT;
+ }
+ else n = allow_sign + 1 - n;
+ }
- default: /* Non-repeat => class must match */
- case OP_CRPLUS: /* These repeats aren't empty */
- case OP_CRMINPLUS:
- case OP_CRPOSPLUS:
- goto ISFALSE;
+yield = TRUE;
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- if (GET2(ccode, 1) > 0) goto ISFALSE; /* Minimum > 0 */
- break;
- }
- break;
+EXIT:
+*intptr = n;
+*ptrptr = ptr;
+return yield;
+}
- /* Opcodes that must match a character */
-
- case OP_ANY:
- case OP_ALLANY:
- case OP_ANYBYTE:
-
- case OP_PROP:
- case OP_NOTPROP:
- case OP_ANYNL:
-
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- case OP_EXTUNI:
-
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
-
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
-
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
-
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
-
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
-
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEEXACT:
- goto ISFALSE;
-
- /* These are going to continue, as they may be empty, but we have to
- fudge the length for the \p and \P cases. */
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPOSSTAR:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
- /* Same for these */
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
+/*************************************************
+* Read repeat counts *
+*************************************************/
- /* End of branch */
+/* Read an item of the form {n,m} and return the values if non-NULL pointers
+are supplied. Repeat counts must be less than 65536 (MAX_REPEAT_COUNT); a
+larger value is used for "unlimited". We have to use signed arguments for
+read_number() because it is capable of returning a signed value.
- case OP_KET:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_KETRPOS:
- case OP_ALT:
- goto ISTRUE;
+Arguments:
+ ptrptr points to pointer to character after'{'
+ ptrend pointer to end of input
+ minp if not NULL, pointer to int for min
+ maxp if not NULL, pointer to int for max (-1 if no max)
+ returned as -1 if no max
+ errorcodeptr points to error code variable
- /* In UTF-8 or UTF-16 mode, STAR, MINSTAR, POSSTAR, QUERY, MINQUERY,
- POSQUERY, UPTO, MINUPTO, and POSUPTO and their caseless and negative
- versions may be followed by a multibyte character. */
+Returns: FALSE if not a repeat quantifier, errorcode set zero
+ FALSE on error, with errorcode set non-zero
+ TRUE on success, with pointer updated to point after '}'
+*/
-#ifdef MAYBE_UTF_MULTI
- case OP_STAR:
- case OP_STARI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
-
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
-
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
-
- case OP_QUERY:
- case OP_QUERYI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
-
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
-
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- if (utf && HAS_EXTRALEN(code[1])) code += GET_EXTRALEN(code[1]);
- break;
+static BOOL
+read_repeat_counts(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *minp,
+ uint32_t *maxp, int *errorcodeptr)
+{
+PCRE2_SPTR p = *ptrptr;
+BOOL yield = FALSE;
+int32_t min = 0;
+int32_t max = REPEAT_UNLIMITED; /* This value is larger than MAX_REPEAT_COUNT */
- case OP_UPTO:
- case OP_UPTOI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
-
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
-
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- if (utf && HAS_EXTRALEN(code[1 + IMM2_SIZE])) code += GET_EXTRALEN(code[1 + IMM2_SIZE]);
- break;
-#endif /* MAYBE_UTF_MULTI */
+/* NB read_number() initializes the error code to zero. The only error is for a
+number that is too big. */
- /* MARK, and PRUNE/SKIP/THEN with an argument must skip over the argument
- string. */
+if (!read_number(&p, ptrend, -1, MAX_REPEAT_COUNT, ERR5, &min, errorcodeptr))
+ goto EXIT;
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
+if (p >= ptrend) goto EXIT;
- /* None of the remaining opcodes are required to match a character. */
+if (*p == CHAR_RIGHT_CURLY_BRACKET)
+ {
+ p++;
+ max = min;
+ }
- default:
- break;
+else
+ {
+ if (*p++ != CHAR_COMMA || p >= ptrend) goto EXIT;
+ if (*p != CHAR_RIGHT_CURLY_BRACKET)
+ {
+ if (!read_number(&p, ptrend, -1, MAX_REPEAT_COUNT, ERR5, &max,
+ errorcodeptr) || p >= ptrend || *p != CHAR_RIGHT_CURLY_BRACKET)
+ goto EXIT;
+ if (max < min)
+ {
+ *errorcodeptr = ERR4;
+ goto EXIT;
+ }
}
+ p++;
}
-ISTRUE:
-groupinfo |= GI_COULD_BE_EMPTY;
-
-ISFALSE:
-if (group > 0) cb->groupinfo[group] = groupinfo | GI_SET_COULD_BE_EMPTY;
-
-return ((groupinfo & GI_COULD_BE_EMPTY) != 0)? CBE_EMPTY : CBE_NOTEMPTY;
-}
-
-
-
-/*************************************************
-* Check for counted repeat *
-*************************************************/
+yield = TRUE;
+if (minp != NULL) *minp = (uint32_t)min;
+if (maxp != NULL) *maxp = (uint32_t)max;
-/* This function is called when a '{' is encountered in a place where it might
-start a quantifier. It looks ahead to see if it really is a quantifier, that
-is, one of the forms {ddd} {ddd,} or {ddd,ddd} where the ddds are digits.
+/* Update the pattern pointer on success, or after an error, but not when
+the result is "not a repeat quantifier". */
-Argument: pointer to the first char after '{'
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_counted_repeat(PCRE2_SPTR p)
-{
-if (!IS_DIGIT(*p)) return FALSE;
-p++;
-while (IS_DIGIT(*p)) p++;
-if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE;
+EXIT:
+if (yield || *errorcodeptr != 0) *ptrptr = p;
+return yield;
-if (*p++ != CHAR_COMMA) return FALSE;
-if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE;
-if (!IS_DIGIT(*p)) return FALSE;
-p++;
-while (IS_DIGIT(*p)) p++;
-return (*p == CHAR_RIGHT_CURLY_BRACKET);
}
@@ -1789,21 +1376,14 @@ return (*p == CHAR_RIGHT_CURLY_BRACKET);
/* This function is called when a \ has been encountered. It either returns a
positive value for a simple escape such as \d, or 0 for a data character, which
is placed in chptr. A backreference to group n is returned as negative n. On
-entry, ptr is pointing at the \. On exit, it points the final code unit of the
-escape sequence.
+entry, ptr is pointing at the character after \. On exit, it points after the
+final code unit of the escape sequence.
This function is also called from pcre2_substitute() to handle escape sequences
-in replacement strings. In this case, the cb argument is NULL, and only
-sequences that define a data character are recognised. The isclass argument is
-not relevant, but the options argument is the final value of the compiled
-pattern's options.
-
-There is one "trick" case: when a sequence such as [[:>:]] or \s in UCP mode is
-processed, it is replaced by a nested alternative sequence. If this contains a
-backslash (which is usually does), ptrend does not point to its end - it still
-points to the end of the whole pattern. However, we can detect this case
-because cb->nestptr[0] will be non-NULL. The nested sequences are all zero-
-terminated and there are only ever two levels of nesting.
+in replacement strings. In this case, the cb argument is NULL, and in the case
+of escapes that have further processing, only sequences that define a data
+character are recognised. The isclass argument is not relevant; the options
+argument is the final value of the compiled pattern's options.
Arguments:
ptrptr points to the input position pointer
@@ -1816,7 +1396,7 @@ Arguments:
Returns: zero => a data character
positive => a special escape sequence
- negative => a back reference
+ negative => a numerical back reference
on error, errorcodeptr is set non-zero
*/
@@ -1825,16 +1405,11 @@ PRIV(check_escape)(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *chptr,
int *errorcodeptr, uint32_t options, BOOL isclass, compile_block *cb)
{
BOOL utf = (options & PCRE2_UTF) != 0;
-PCRE2_SPTR ptr = *ptrptr + 1;
-register uint32_t c, cc;
+PCRE2_SPTR ptr = *ptrptr;
+uint32_t c, cc;
int escape = 0;
int i;
-/* Find the end of a nested insert. */
-
-if (cb != NULL && cb->nestptr[0] != NULL)
- ptrend = ptr + PRIV(strlen)(ptr);
-
/* If backslash is at the end of the string, it's an error. */
if (ptr >= ptrend)
@@ -1844,7 +1419,7 @@ if (ptr >= ptrend)
}
GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */
-ptr--; /* Set pointer back to the last code unit */
+*errorcodeptr = 0; /* Be optimistic */
/* Non-alphanumerics are literals, so we just leave the value in c. An initial
value test saves a memory lookup for code points outside the alphanumeric
@@ -1858,7 +1433,7 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0)
if (i > 0) c = (uint32_t)i; else /* Positive is a data character */
{
escape = -i; /* Else return a special escape */
- if (escape == ESC_P || escape == ESC_p || escape == ESC_X)
+ if (cb != NULL && (escape == ESC_P || escape == ESC_p || escape == ESC_X))
cb->external_flags |= PCRE2_HASBKPORX; /* Note \P, \p, or \X */
}
}
@@ -1870,8 +1445,8 @@ when BSUX is set). */
else
{
PCRE2_SPTR oldptr;
- BOOL braced, negated, overflow;
- unsigned int s;
+ BOOL overflow;
+ int s;
/* Filter calls from pcre2_substitute(). */
@@ -1900,26 +1475,31 @@ else
if ((options & PCRE2_ALT_BSUX) == 0) *errorcodeptr = ERR37; else
{
uint32_t xc;
- if ((cc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */
+ if (ptrend - ptr < 4) break; /* Less than 4 chars */
+ if ((cc = XDIGIT(ptr[0])) == 0xff) break; /* Not a hex digit */
+ if ((xc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */
+ cc = (cc << 4) | xc;
if ((xc = XDIGIT(ptr[2])) == 0xff) break; /* Not a hex digit */
cc = (cc << 4) | xc;
if ((xc = XDIGIT(ptr[3])) == 0xff) break; /* Not a hex digit */
- cc = (cc << 4) | xc;
- if ((xc = XDIGIT(ptr[4])) == 0xff) break; /* Not a hex digit */
c = (cc << 4) | xc;
ptr += 4;
if (utf)
{
if (c > 0x10ffffU) *errorcodeptr = ERR77;
- else if (c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
+ else
+ if (c >= 0xd800 && c <= 0xdfff &&
+ (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
+ *errorcodeptr = ERR73;
}
else if (c > MAX_NON_UTF_CHAR) *errorcodeptr = ERR77;
}
break;
- case CHAR_U:
/* \U is unrecognized unless PCRE2_ALT_BSUX is set, in which case it is an
upper case letter. */
+
+ case CHAR_U:
if ((options & PCRE2_ALT_BSUX) == 0) *errorcodeptr = ERR37;
break;
@@ -1933,87 +1513,71 @@ else
(2) Perl 5.10 also supports \g{name} as a reference to a named group. This
is part of Perl's movement towards a unified syntax for back references. As
this is synonymous with \k{name}, we fudge it up by pretending it really
- was \k.
+ was \k{name}.
(3) For Oniguruma compatibility we also support \g followed by a name or a
number either in angle brackets or in single quotes. However, these are
- (possibly recursive) subroutine calls, _not_ backreferences. Just return
- the ESC_g code (cf \k). */
+ (possibly recursive) subroutine calls, _not_ backreferences. We return
+ the ESC_g code.
+
+ Summary: Return a negative number for a numerical back reference, ESC_k for
+ a named back reference, and ESC_g for a named or numbered subroutine call.
+ */
case CHAR_g:
if (isclass) break;
- if (ptr[1] == CHAR_LESS_THAN_SIGN || ptr[1] == CHAR_APOSTROPHE)
+
+ if (ptr >= ptrend)
+ {
+ *errorcodeptr = ERR57;
+ break;
+ }
+
+ if (*ptr == CHAR_LESS_THAN_SIGN || *ptr == CHAR_APOSTROPHE)
{
escape = ESC_g;
break;
}
- /* Handle the Perl-compatible cases */
+ /* If there is a brace delimiter, try to read a numerical reference. If
+ there isn't one, assume we have a name and treat it as \k. */
- if (ptr[1] == CHAR_LEFT_CURLY_BRACKET)
+ if (*ptr == CHAR_LEFT_CURLY_BRACKET)
{
- PCRE2_SPTR p;
- for (p = ptr+2; *p != CHAR_NULL && *p != CHAR_RIGHT_CURLY_BRACKET; p++)
- if (*p != CHAR_MINUS && !IS_DIGIT(*p)) break;
- if (*p != CHAR_NULL && *p != CHAR_RIGHT_CURLY_BRACKET)
+ PCRE2_SPTR p = ptr + 1;
+ if (!read_number(&p, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &s,
+ errorcodeptr))
{
- escape = ESC_k;
+ if (*errorcodeptr == 0) escape = ESC_k; /* No number found */
break;
}
- braced = TRUE;
- ptr++;
+ if (p >= ptrend || *p != CHAR_RIGHT_CURLY_BRACKET)
+ {
+ *errorcodeptr = ERR57;
+ break;
+ }
+ ptr = p + 1;
}
- else braced = FALSE;
- if (ptr[1] == CHAR_MINUS)
- {
- negated = TRUE;
- ptr++;
- }
- else negated = FALSE;
+ /* Read an undelimited number */
- /* The integer range is limited by the machine's int representation. */
- s = 0;
- overflow = FALSE;
- while (IS_DIGIT(ptr[1]))
+ else
{
- if (s > INT_MAX / 10 - 1) /* Integer overflow */
+ if (!read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &s,
+ errorcodeptr))
{
- overflow = TRUE;
+ if (*errorcodeptr == 0) *errorcodeptr = ERR57; /* No number found */
break;
}
- s = s * 10 + (unsigned int)(*(++ptr) - CHAR_0);
- }
- if (overflow) /* Integer overflow */
- {
- while (IS_DIGIT(ptr[1])) ptr++;
- *errorcodeptr = ERR61;
- break;
}
- if (braced && *(++ptr) != CHAR_RIGHT_CURLY_BRACKET)
+ if (s <= 0)
{
- *errorcodeptr = ERR57;
+ *errorcodeptr = ERR15;
break;
}
- if (s == 0)
- {
- *errorcodeptr = ERR58;
- break;
- }
-
- if (negated)
- {
- if (s > cb->bracount)
- {
- *errorcodeptr = ERR15;
- break;
- }
- s = cb->bracount - (s - 1);
- }
-
- escape = -(int)s;
+ escape = -s;
break;
/* The handling of escape sequences consisting of a string of digits
@@ -2036,31 +1600,18 @@ else
if (!isclass)
{
oldptr = ptr;
- /* The integer range is limited by the machine's int representation. */
- s = c - CHAR_0;
- overflow = FALSE;
- while (IS_DIGIT(ptr[1]))
- {
- if (s > INT_MAX / 10 - 1) /* Integer overflow */
- {
- overflow = TRUE;
- break;
- }
- s = s * 10 + (unsigned int)(*(++ptr) - CHAR_0);
- }
- if (overflow) /* Integer overflow */
- {
- while (IS_DIGIT(ptr[1])) ptr++;
- *errorcodeptr = ERR61;
+ ptr--; /* Back to the digit */
+ if (!read_number(&ptr, ptrend, -1, INT_MAX/10 - 1, ERR61, &s,
+ errorcodeptr))
break;
- }
/* \1 to \9 are always back references. \8x and \9x are too; \1x to \7x
are octal escapes if there are not that many previous captures. */
- if (s < 10 || *oldptr >= CHAR_8 || s <= cb->bracount)
+ if (s < 10 || oldptr[-1] >= CHAR_8 || s <= (int)cb->bracount)
{
- escape = -(int)s; /* Indicates a back reference */
+ if (s > (int)MAX_GROUP_NUMBER) *errorcodeptr = ERR61;
+ else escape = -s; /* Indicates a back reference */
break;
}
ptr = oldptr; /* Put the pointer back and fall through */
@@ -2068,13 +1619,12 @@ else
/* Handle a digit following \ when the number is not a back reference, or
we are within a character class. If the first digit is 8 or 9, Perl used to
- generate a binary zero byte and then treat the digit as a following
- literal. At least by Perl 5.18 this changed so as not to insert the binary
- zero. */
+ generate a binary zero and then treat the digit as a following literal. At
+ least by Perl 5.18 this changed so as not to insert the binary zero. */
- if ((c = *ptr) >= CHAR_8) break;
+ if (c >= CHAR_8) break;
- /* Fall through with a digit less than 8 */
+ /* Fall through */
/* \0 always starts an octal number, but we may drop through to here with a
larger first octal digit. The original code used just to take the least
@@ -2084,8 +1634,8 @@ else
case CHAR_0:
c -= CHAR_0;
- while(i++ < 2 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7)
- c = c * 8 + *(++ptr) - CHAR_0;
+ while(i++ < 2 && ptr < ptrend && *ptr >= CHAR_0 && *ptr <= CHAR_7)
+ c = c * 8 + *ptr++ - CHAR_0;
#if PCRE2_CODE_UNIT_WIDTH == 8
if (!utf && c > 0xff) *errorcodeptr = ERR51;
#endif
@@ -2095,13 +1645,18 @@ else
specifying character codes in octal. The only supported form is \o{ddd}. */
case CHAR_o:
- if (ptr[1] != CHAR_LEFT_CURLY_BRACKET) *errorcodeptr = ERR55; else
- if (ptr[2] == CHAR_RIGHT_CURLY_BRACKET) *errorcodeptr = ERR78; else
+ if (ptr >= ptrend || *ptr++ != CHAR_LEFT_CURLY_BRACKET)
+ {
+ ptr--;
+ *errorcodeptr = ERR55;
+ }
+ else if (ptr >= ptrend || *ptr == CHAR_RIGHT_CURLY_BRACKET)
+ *errorcodeptr = ERR78;
+ else
{
- ptr += 2;
c = 0;
overflow = FALSE;
- while (*ptr >= CHAR_0 && *ptr <= CHAR_7)
+ while (ptr < ptrend && *ptr >= CHAR_0 && *ptr <= CHAR_7)
{
cc = *ptr++;
if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */
@@ -2119,14 +1674,23 @@ else
}
if (overflow)
{
- while (*ptr >= CHAR_0 && *ptr <= CHAR_7) ptr++;
+ while (ptr < ptrend && *ptr >= CHAR_0 && *ptr <= CHAR_7) ptr++;
*errorcodeptr = ERR34;
}
- else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
+ else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
+ {
+ if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL ||
+ (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0))
+ {
+ ptr--;
+ *errorcodeptr = ERR73;
+ }
+ }
+ else
{
- if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
+ ptr--;
+ *errorcodeptr = ERR64;
}
- else *errorcodeptr = ERR64;
}
break;
@@ -2137,8 +1701,9 @@ else
if ((options & PCRE2_ALT_BSUX) != 0)
{
uint32_t xc;
- if ((cc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */
- if ((xc = XDIGIT(ptr[2])) == 0xff) break; /* Not a hex digit */
+ if (ptrend - ptr < 2) break; /* Less than 2 characters */
+ if ((cc = XDIGIT(ptr[0])) == 0xff) break; /* Not a hex digit */
+ if ((xc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */
c = (cc << 4) | xc;
ptr += 2;
} /* End PCRE2_ALT_BSUX handling */
@@ -2152,10 +1717,9 @@ else
else
{
- if (ptr[1] == CHAR_LEFT_CURLY_BRACKET)
+ if (ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET)
{
- ptr += 2;
- if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
+ if (++ptr >= ptrend || *ptr == CHAR_RIGHT_CURLY_BRACKET)
{
*errorcodeptr = ERR78;
break;
@@ -2163,7 +1727,7 @@ else
c = 0;
overflow = FALSE;
- while ((cc = XDIGIT(*ptr)) != 0xff)
+ while (ptr < ptrend && (cc = XDIGIT(*ptr)) != 0xff)
{
ptr++;
if (c == 0 && cc == 0) continue; /* Leading zeroes */
@@ -2180,12 +1744,17 @@ else
if (overflow)
{
- while (XDIGIT(*ptr) != 0xff) ptr++;
+ while (ptr < ptrend && XDIGIT(*ptr) != 0xff) ptr++;
*errorcodeptr = ERR34;
}
- else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
+ else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
{
- if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
+ if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL ||
+ (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0))
+ {
+ ptr--;
+ *errorcodeptr = ERR73;
+ }
}
/* If the sequence of hex digits does not end with '}', give an error.
@@ -2193,18 +1762,22 @@ else
\x handling, but nowadays Perl gives an error, which seems much more
sensible, so we do too. */
- else *errorcodeptr = ERR67;
+ else
+ {
+ ptr--;
+ *errorcodeptr = ERR67;
+ }
} /* End of \x{} processing */
- /* Read a single-byte hex-defined char (up to two hex digits after \x) */
+ /* Read a up to two hex digits after \x */
else
{
c = 0;
- if ((cc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */
+ if (ptr >= ptrend || (cc = XDIGIT(*ptr)) == 0xff) break; /* Not a hex digit */
ptr++;
c = cc;
- if ((cc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */
+ if (ptr >= ptrend || (cc = XDIGIT(*ptr)) == 0xff) break; /* Not a hex digit */
ptr++;
c = (c << 4) | cc;
} /* End of \xdd handling */
@@ -2230,14 +1803,13 @@ else
#else
case CHAR_c:
#endif
-
- c = *(++ptr);
- if (c >= CHAR_a && c <= CHAR_z) c = UPPER_CASE(c);
- if (c == CHAR_NULL && ptr >= ptrend)
+ if (ptr >= ptrend)
{
*errorcodeptr = ERR2;
break;
}
+ c = *ptr;
+ if (c >= CHAR_a && c <= CHAR_z) c = UPPER_CASE(c);
/* Handle \c in an ASCII/Unicode environment. */
@@ -2267,6 +1839,7 @@ else
}
#endif /* EBCDIC */
+ ptr++;
break;
/* Any other alphanumeric following \ is an error. Perl gives an error only
@@ -2274,7 +1847,8 @@ else
default:
*errorcodeptr = ERR3;
- break;
+ *ptrptr = ptr - 1; /* Point to the character at fault */
+ return 0;
}
}
@@ -2282,16 +1856,16 @@ else
newline". PCRE does not support \N{name}. However, it does support
quantification such as \N{2,3}. */
-if (escape == ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET &&
- !is_counted_repeat(ptr+2))
- *errorcodeptr = ERR37;
-
-/* If PCRE2_UCP is set, we change the values for \d etc. */
-
-if ((options & PCRE2_UCP) != 0 && escape >= ESC_D && escape <= ESC_w)
- escape += (ESC_DU - ESC_D);
+if (escape == ESC_N && ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET &&
+ ptrend - ptr > 2)
+ {
+ PCRE2_SPTR p = ptr + 1;
+ if (!read_repeat_counts(&p, ptrend, NULL, NULL, errorcodeptr) &&
+ *errorcodeptr == 0)
+ *errorcodeptr = ERR37;
+ }
-/* Set the pointer to the final character before returning. */
+/* Set the pointer to the next character before returning. */
*ptrptr = ptr;
*chptr = c;
@@ -2307,8 +1881,8 @@ return escape;
/* This function is called after \P or \p has been encountered, provided that
PCRE2 is compiled with support for UTF and Unicode properties. On entry, the
-contents of ptrptr are pointing at the P or p. On exit, it is left pointing at
-the final code unit of the escape sequence.
+contents of ptrptr are pointing after the P or p. On exit, it is left pointing
+after the final code unit of the escape sequence.
Arguments:
ptrptr the pattern position pointer
@@ -2322,31 +1896,34 @@ Returns: TRUE if the type value was found, or FALSE for an invalid type
*/
static BOOL
-get_ucp(PCRE2_SPTR *ptrptr, BOOL *negptr, unsigned int *ptypeptr,
- unsigned int *pdataptr, int *errorcodeptr, compile_block *cb)
+get_ucp(PCRE2_SPTR *ptrptr, BOOL *negptr, uint16_t *ptypeptr,
+ uint16_t *pdataptr, int *errorcodeptr, compile_block *cb)
{
-register PCRE2_UCHAR c;
-size_t i, bot, top;
+PCRE2_UCHAR c;
+PCRE2_SIZE i, bot, top;
PCRE2_SPTR ptr = *ptrptr;
PCRE2_UCHAR name[32];
+if (ptr >= cb->end_pattern) goto ERROR_RETURN;
+c = *ptr++;
*negptr = FALSE;
-c = *(++ptr);
/* \P or \p can be followed by a name in {}, optionally preceded by ^ for
negation. */
if (c == CHAR_LEFT_CURLY_BRACKET)
{
- if (ptr[1] == CHAR_CIRCUMFLEX_ACCENT)
+ if (ptr >= cb->end_pattern) goto ERROR_RETURN;
+ if (*ptr == CHAR_CIRCUMFLEX_ACCENT)
{
*negptr = TRUE;
ptr++;
}
for (i = 0; i < (int)(sizeof(name) / sizeof(PCRE2_UCHAR)) - 1; i++)
{
- c = *(++ptr);
- if (c == CHAR_NULL) goto ERROR_RETURN;
+ if (ptr >= cb->end_pattern) goto ERROR_RETURN;
+ c = *ptr++;
+ if (c == CHAR_NUL) goto ERROR_RETURN;
if (c == CHAR_RIGHT_CURLY_BRACKET) break;
name[i] = c;
}
@@ -2397,217 +1974,6 @@ return FALSE;
/*************************************************
-* Read repeat counts *
-*************************************************/
-
-/* Read an item of the form {n,m} and return the values. This is called only
-after is_counted_repeat() has confirmed that a repeat-count quantifier exists,
-so the syntax is guaranteed to be correct, but we need to check the values.
-
-Arguments:
- p pointer to first char after '{'
- minp pointer to int for min
- maxp pointer to int for max
- returned as -1 if no max
- errorcodeptr points to error code variable
-
-Returns: pointer to '}' on success;
- current ptr on error, with errorcodeptr set non-zero
-*/
-
-static PCRE2_SPTR
-read_repeat_counts(PCRE2_SPTR p, int *minp, int *maxp, int *errorcodeptr)
-{
-int min = 0;
-int max = -1;
-
-while (IS_DIGIT(*p))
- {
- min = min * 10 + (int)(*p++ - CHAR_0);
- if (min > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
- }
-
-if (*p == CHAR_RIGHT_CURLY_BRACKET) max = min; else
- {
- if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
- {
- max = 0;
- while(IS_DIGIT(*p))
- {
- max = max * 10 + (int)(*p++ - CHAR_0);
- if (max > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
- }
- if (max < min)
- {
- *errorcodeptr = ERR4;
- return p;
- }
- }
- }
-
-*minp = min;
-*maxp = max;
-return p;
-}
-
-
-
-/*************************************************
-* Scan compiled regex for recursion reference *
-*************************************************/
-
-/* This function scans through a compiled pattern until it finds an instance of
-OP_RECURSE.
-
-Arguments:
- code points to start of expression
- utf TRUE in UTF mode
-
-Returns: pointer to the opcode for OP_RECURSE, or NULL if not found
-*/
-
-static PCRE2_SPTR
-find_recurse(PCRE2_SPTR code, BOOL utf)
-{
-for (;;)
- {
- register PCRE2_UCHAR c = *code;
- if (c == OP_END) return NULL;
- if (c == OP_RECURSE) return code;
-
- /* XCLASS is used for classes that cannot be represented just by a bit map.
- This includes negated single high-valued characters. CALLOUT_STR is used for
- callouts with string arguments. In both cases the length in the table is
- zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
- else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE);
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
- must add in its length. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEPOSUPTO:
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 and UTF-16 modes, opcodes that are followed by a character may
- be followed by a multi-unit character. The length in the table is a
- minimum, so we have to arrange to skip the extra units. */
-
-#ifdef MAYBE_UTF_MULTI
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- case OP_UPTO:
- case OP_UPTOI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- case OP_STAR:
- case OP_STARI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif /* MAYBE_UTF_MULTI */
- }
- }
-}
-
-
-
-/*************************************************
* Check for POSIX class syntax *
*************************************************/
@@ -2645,25 +2011,28 @@ seem right at all. PCRE does not allow closing square brackets in POSIX class
names.
Arguments:
- ptr pointer to the initial [
+ ptr pointer to the character after the initial [ (colon, dot, equals)
+ ptrend pointer to the end of the pattern
endptr where to return a pointer to the terminating ':', '.', or '='
Returns: TRUE or FALSE
*/
static BOOL
-check_posix_syntax(PCRE2_SPTR ptr, PCRE2_SPTR *endptr)
+check_posix_syntax(PCRE2_SPTR ptr, PCRE2_SPTR ptrend, PCRE2_SPTR *endptr)
{
PCRE2_UCHAR terminator; /* Don't combine these lines; the Solaris cc */
-terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */
+terminator = *ptr++; /* compiler warns about "non-constant" initializer. */
-for (++ptr; *ptr != CHAR_NULL; ptr++)
+for (; ptrend - ptr >= 2; ptr++)
{
if (*ptr == CHAR_BACKSLASH &&
(ptr[1] == CHAR_RIGHT_SQUARE_BRACKET || ptr[1] == CHAR_BACKSLASH))
ptr++;
+
else if ((*ptr == CHAR_LEFT_SQUARE_BRACKET && ptr[1] == terminator) ||
*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE;
+
else if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
{
*endptr = ptr;
@@ -2694,7 +2063,7 @@ static int
check_posix_name(PCRE2_SPTR ptr, int len)
{
const char *pn = posix_names;
-register int yield = 0;
+int yield = 0;
while (posix_name_lengths[yield] != 0)
{
if (len == posix_name_lengths[yield] &&
@@ -2707,765 +2076,1424 @@ return -1;
-#ifdef SUPPORT_UNICODE
/*************************************************
-* Get othercase range *
+* Read a subpattern or VERB name *
*************************************************/
-/* This function is passed the start and end of a class range in UCT mode. It
-searches up the characters, looking for ranges of characters in the "other"
-case. Each call returns the next one, updating the start address. A character
-with multiple other cases is returned on its own with a special return value.
+/* This function is called from parse_regex() below whenever it needs to read
+the name of a subpattern or a (*VERB). The initial pointer must be to the
+character before the name. If that character is '*' we are reading a verb name.
+The pointer is updated to point after the name, for a VERB, or after tha name's
+terminator for a subpattern name. Returning both the offset and the name
+pointer is redundant information, but some callers use one and some the other,
+so it is simplest just to return both.
Arguments:
- cptr points to starting character value; updated
- d end value
- ocptr where to put start of othercase range
- odptr where to put end of othercase range
-
-Yield: -1 when no more
- 0 when a range is returned
- >0 the CASESET offset for char with multiple other cases
- in this case, ocptr contains the original
+ ptrptr points to the character pointer variable
+ ptrend points to the end of the input string
+ terminator the terminator of a subpattern name must be this
+ offsetptr where to put the offset from the start of the pattern
+ nameptr where to put a pointer to the name in the input
+ namelenptr where to put the length of the name
+ errcodeptr where to put an error code
+ cb pointer to the compile data block
+
+Returns: TRUE if a name was read
+ FALSE otherwise, with error code set
*/
-static int
-get_othercase_range(uint32_t *cptr, uint32_t d, uint32_t *ocptr,
- uint32_t *odptr)
+static BOOL
+read_name(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t terminator,
+ PCRE2_SIZE *offsetptr, PCRE2_SPTR *nameptr, uint32_t *namelenptr,
+ int *errorcodeptr, compile_block *cb)
{
-uint32_t c, othercase, next;
-unsigned int co;
+PCRE2_SPTR ptr = *ptrptr;
+BOOL is_verb = (*ptr == CHAR_ASTERISK);
+uint32_t namelen = 0;
+uint32_t ctype = is_verb? ctype_letter : ctype_word;
-/* Find the first character that has an other case. If it has multiple other
-cases, return its case offset value. */
+if (++ptr >= ptrend)
+ {
+ *errorcodeptr = is_verb? ERR60: /* Verb not recognized or malformed */
+ ERR62; /* Subpattern name expected */
+ goto FAILED;
+ }
-for (c = *cptr; c <= d; c++)
+*nameptr = ptr;
+*offsetptr = (PCRE2_SIZE)(ptr - cb->start_pattern);
+
+if (IS_DIGIT(*ptr))
{
- if ((co = UCD_CASESET(c)) != 0)
+ *errorcodeptr = ERR44; /* Group name must not start with digit */
+ goto FAILED;
+ }
+
+while (ptr < ptrend && MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype) != 0)
+ {
+ ptr++;
+ namelen++;
+ if (namelen > MAX_NAME_SIZE)
{
- *ocptr = c++; /* Character that has the set */
- *cptr = c; /* Rest of input range */
- return (int)co;
+ *errorcodeptr = ERR48;
+ goto FAILED;
}
- if ((othercase = UCD_OTHERCASE(c)) != c) break;
}
-if (c > d) return -1; /* Reached end of range */
-
-/* Found a character that has a single other case. Search for the end of the
-range, which is either the end of the input range, or a character that has zero
-or more than one other cases. */
+/* Subpattern names must not be empty, and their terminator is checked here.
+(What follows a verb name is checked separately.) */
-*ocptr = othercase;
-next = othercase + 1;
-
-for (++c; c <= d; c++)
+if (!is_verb)
{
- if ((co = UCD_CASESET(c)) != 0 || UCD_OTHERCASE(c) != next) break;
- next++;
+ if (namelen == 0)
+ {
+ *errorcodeptr = ERR62; /* Subpattern name expected */
+ goto FAILED;
+ }
+ if (ptr >= ptrend || *ptr != (PCRE2_UCHAR)terminator)
+ {
+ *errorcodeptr = ERR42;
+ goto FAILED;
+ }
+ ptr++;
}
-*odptr = next - 1; /* End of othercase range */
-*cptr = c; /* Rest of input range */
-return 0;
+*namelenptr = namelen;
+*ptrptr = ptr;
+return TRUE;
+
+FAILED:
+*ptrptr = ptr;
+return FALSE;
}
-#endif /* SUPPORT_UNICODE */
/*************************************************
-* Add a character or range to a class *
+* Manage callouts at start of cycle *
*************************************************/
-/* This function packages up the logic of adding a character or range of
-characters to a class. The character values in the arguments will be within the
-valid values for the current mode (8-bit, 16-bit, UTF, etc). This function is
-mutually recursive with the function immediately below.
+/* At the start of a new item in parse_regex() we are able to record the
+details of the previous item in a prior callout, and also to set up an
+automatic callout if enabled. Avoid having two adjacent automatic callouts,
+which would otherwise happen for items such as \Q that contribute nothing to
+the parsed pattern.
Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cb compile data
- start start of range character
- end end of range character
+ ptr current pattern pointer
+ pcalloutptr points to a pointer to previous callout, or NULL
+ auto_callout TRUE if auto_callouts are enabled
+ parsed_pattern the parsed pattern pointer
+ cb compile block
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
+Returns: possibly updated parsed_pattern pointer.
*/
-static unsigned int
-add_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options,
- compile_block *cb, uint32_t start, uint32_t end)
+static uint32_t *
+manage_callouts(PCRE2_SPTR ptr, uint32_t **pcalloutptr, BOOL auto_callout,
+ uint32_t *parsed_pattern, compile_block *cb)
{
-uint32_t c;
-uint32_t classbits_end = (end <= 0xff ? end : 0xff);
-unsigned int n8 = 0;
+uint32_t *previous_callout = *pcalloutptr;
-/* If caseless matching is required, scan the range and process alternate
-cases. In Unicode, there are 8-bit characters that have alternate cases that
-are greater than 255 and vice-versa. Sometimes we can just extend the original
-range. */
+if (previous_callout != NULL) previous_callout[2] = ptr - cb->start_pattern -
+ (PCRE2_SIZE)previous_callout[1];
-if ((options & PCRE2_CASELESS) != 0)
+if (!auto_callout) previous_callout = NULL; else
{
-#ifdef SUPPORT_UNICODE
- if ((options & PCRE2_UTF) != 0)
+ if (previous_callout == NULL ||
+ previous_callout != parsed_pattern - 4 ||
+ previous_callout[3] != 255)
{
- int rc;
- uint32_t oc, od;
-
- options &= ~PCRE2_CASELESS; /* Remove for recursive calls */
- c = start;
+ previous_callout = parsed_pattern; /* Set up new automatic callout */
+ parsed_pattern += 4;
+ previous_callout[0] = META_CALLOUT_NUMBER;
+ previous_callout[2] = 0;
+ previous_callout[3] = 255;
+ }
+ previous_callout[1] = (uint32_t)(ptr - cb->start_pattern);
+ }
- while ((rc = get_othercase_range(&c, end, &oc, &od)) >= 0)
- {
- /* Handle a single character that has more than one other case. */
+*pcalloutptr = previous_callout;
+return parsed_pattern;
+}
- if (rc > 0) n8 += add_list_to_class(classbits, uchardptr, options, cb,
- PRIV(ucd_caseless_sets) + rc, oc);
- /* Do nothing if the other case range is within the original range. */
- else if (oc >= start && od <= end) continue;
+/*************************************************
+* Parse regex and identify named groups *
+*************************************************/
- /* Extend the original range if there is overlap, noting that if oc < c, we
- can't have od > end because a subrange is always shorter than the basic
- range. Otherwise, use a recursive call to add the additional range. */
+/* This function is called first of all. It scans the pattern and does two
+things: (1) It identifies capturing groups and makes a table of named capturing
+groups so that information about them is fully available to both the compiling
+scans. (2) It writes a parsed version of the pattern with comments omitted and
+escapes processed into the parsed_pattern vector.
- else if (oc < start && od >= start - 1) start = oc; /* Extend downwards */
- else if (od > end && oc <= end + 1)
- {
- end = od; /* Extend upwards */
- if (end > classbits_end) classbits_end = (end <= 0xff ? end : 0xff);
- }
- else n8 += add_to_class(classbits, uchardptr, options, cb, oc, od);
- }
- }
- else
-#endif /* SUPPORT_UNICODE */
-
- /* Not UTF mode */
+Arguments:
+ ptr points to the start of the pattern
+ options compiling dynamic options (may change during the scan)
+ has_lookbehind points to a boolean, set TRUE if a lookbehind is found
+ cb pointer to the compile data block
- for (c = start; c <= classbits_end; c++)
- {
- SETBIT(classbits, cb->fcc[c]);
- n8++;
- }
- }
+Returns: zero on success or a non-zero error code, with the
+ error offset placed in the cb field
+*/
-/* Now handle the original range. Adjust the final value according to the bit
-length - this means that the same lists of (e.g.) horizontal spaces can be used
-in all cases. */
+/* A structure and some flags for dealing with nested groups. */
-if ((options & PCRE2_UTF) == 0 && end > MAX_NON_UTF_CHAR)
- end = MAX_NON_UTF_CHAR;
+typedef struct nest_save {
+ uint16_t nest_depth;
+ uint16_t reset_group;
+ uint16_t max_group;
+ uint16_t flags;
+ uint32_t options;
+} nest_save;
-/* Use the bitmap for characters < 256. Otherwise use extra data.*/
+#define NSF_RESET 0x0001u
+#define NSF_CONDASSERT 0x0002u
-for (c = start; c <= classbits_end; c++)
- {
- /* Regardless of start, c will always be <= 255. */
- SETBIT(classbits, c);
- n8++;
- }
+/* Of the options that are changeable within the pattern, these are tracked
+during parsing. The rest are used from META_OPTIONS items when compiling. */
-#ifdef SUPPORT_WIDE_CHARS
-if (start <= 0xff) start = 0xff + 1;
+#define PARSE_TRACKED_OPTIONS \
+ (PCRE2_DUPNAMES|PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_NO_AUTO_CAPTURE)
-if (end >= start)
- {
- PCRE2_UCHAR *uchardata = *uchardptr;
+/* States used for analyzing ranges in character classes. The two OK values
+must be last. */
-#ifdef SUPPORT_UNICODE
- if ((options & PCRE2_UTF) != 0)
- {
- if (start < end)
- {
- *uchardata++ = XCL_RANGE;
- uchardata += PRIV(ord2utf)(start, uchardata);
- uchardata += PRIV(ord2utf)(end, uchardata);
- }
- else if (start == end)
- {
- *uchardata++ = XCL_SINGLE;
- uchardata += PRIV(ord2utf)(start, uchardata);
- }
- }
- else
-#endif /* SUPPORT_UNICODE */
+enum { RANGE_NO, RANGE_STARTED, RANGE_OK_ESCAPED, RANGE_OK_LITERAL };
- /* Without UTF support, character values are constrained by the bit length,
- and can only be > 256 for 16-bit and 32-bit libraries. */
+/* Only in 32-bit mode can there be literals > META_END. A macros encapsulates
+the storing of literal values in the parsed pattern. */
-#if PCRE2_CODE_UNIT_WIDTH == 8
- {}
-#else
- if (start < end)
- {
- *uchardata++ = XCL_RANGE;
- *uchardata++ = start;
- *uchardata++ = end;
- }
- else if (start == end)
- {
- *uchardata++ = XCL_SINGLE;
- *uchardata++ = start;
- }
-#endif
- *uchardptr = uchardata; /* Updata extra data pointer */
+#if PCRE2_CODE_UNIT_WIDTH == 32
+#define PARSED_LITERAL(c, p) \
+ { \
+ if (c >= META_END) *p++ = META_BIGVALUE; \
+ *p++ = c; \
+ okquantifier = TRUE; \
}
#else
- (void)uchardptr; /* Avoid compiler warning */
-#endif /* SUPPORT_WIDE_CHARS */
-
-return n8; /* Number of 8-bit characters */
-}
-
+#define PARSED_LITERAL(c, p) *p++ = c; okquantifier = TRUE;
+#endif
+/* Here's the actual function. */
-/*************************************************
-* Add a list of characters to a class *
-*************************************************/
+static int parse_regex(PCRE2_SPTR ptr, uint32_t options, BOOL *has_lookbehind,
+ compile_block *cb)
+{
+uint32_t c;
+uint32_t delimiter;
+uint32_t namelen;
+uint32_t class_range_state;
+uint32_t *verblengthptr = NULL; /* Value avoids compiler warning */
+uint32_t *previous_callout = NULL;
+uint32_t *parsed_pattern = cb->parsed_pattern;
+uint32_t *parsed_pattern_end = cb->parsed_pattern_end;
+uint32_t meta_quantifier = 0;
+uint16_t nest_depth = 0;
+int after_manual_callout = 0;
+int expect_cond_assert = 0;
+int errorcode = 0;
+int escape;
+int i;
+BOOL inescq = FALSE;
+BOOL inverbname = FALSE;
+BOOL utf = (options & PCRE2_UTF) != 0;
+BOOL auto_callout = (options & PCRE2_AUTO_CALLOUT) != 0;
+BOOL isdupname;
+BOOL negate_class;
+BOOL okquantifier = FALSE;
+PCRE2_SPTR thisptr;
+PCRE2_SPTR name;
+PCRE2_SPTR ptrend = cb->end_pattern;
+PCRE2_SPTR verbnamestart = NULL; /* Value avoids compiler warning */
+named_group *ng;
+nest_save *top_nest, *end_nests;
-/* This function is used for adding a list of case-equivalent characters to a
-class, and also for adding a list of horizontal or vertical whitespace. If the
-list is in order (which it should be), ranges of characters are detected and
-handled appropriately. This function is mutually recursive with the function
-above.
+/* Insert leading items for word and line matching (features provided for the
+benefit of pcre2grep). */
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cb contains pointers to tables etc.
- p points to row of 32-bit values, terminated by NOTACHAR
- except character to omit; this is used when adding lists of
- case-equivalent characters to avoid including the one we
- already know about
+if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_LINE) != 0)
+ {
+ *parsed_pattern++ = META_CIRCUMFLEX;
+ *parsed_pattern++ = META_NOCAPTURE;
+ }
+else if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_WORD) != 0)
+ {
+ *parsed_pattern++ = META_ESCAPE + ESC_b;
+ *parsed_pattern++ = META_NOCAPTURE;
+ }
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
+/* If the pattern is actually a literal string, process it separately to avoid
+cluttering up the main loop. */
-static unsigned int
-add_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options,
- compile_block *cb, const uint32_t *p, unsigned int except)
-{
-unsigned int n8 = 0;
-while (p[0] < NOTACHAR)
+if ((options & PCRE2_LITERAL) != 0)
{
- unsigned int n = 0;
- if (p[0] != except)
+ while (ptr < ptrend)
{
- while(p[n+1] == p[0] + n + 1) n++;
- n8 += add_to_class(classbits, uchardptr, options, cb, p[0], p[n]);
+ if (parsed_pattern >= parsed_pattern_end)
+ {
+ errorcode = ERR63; /* Internal error (parsed pattern overflow) */
+ goto FAILED;
+ }
+ thisptr = ptr;
+ GETCHARINCTEST(c, ptr);
+ if (auto_callout)
+ parsed_pattern = manage_callouts(thisptr, &previous_callout,
+ auto_callout, parsed_pattern, cb);
+ PARSED_LITERAL(c, parsed_pattern);
}
- p += n + 1;
+ goto PARSED_END;
}
-return n8;
-}
+/* Process a real regex which may contain meta-characters. */
+top_nest = NULL;
+end_nests = (nest_save *)(cb->start_workspace + cb->workspace_size);
-/*************************************************
-* Add characters not in a list to a class *
-*************************************************/
-
-/* This function is used for adding the complement of a list of horizontal or
-vertical whitespace to a class. The list must be in order.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cb contains pointers to tables etc.
- p points to row of 32-bit values, terminated by NOTACHAR
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
+/* The size of the nest_save structure might not be a factor of the size of the
+workspace. Therefore we must round down end_nests so as to correctly avoid
+creating a nest_save that spans the end of the workspace. */
-static unsigned int
-add_not_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr,
- uint32_t options, compile_block *cb, const uint32_t *p)
-{
-BOOL utf = (options & PCRE2_UTF) != 0;
-unsigned int n8 = 0;
-if (p[0] > 0)
- n8 += add_to_class(classbits, uchardptr, options, cb, 0, p[0] - 1);
-while (p[0] < NOTACHAR)
- {
- while (p[1] == p[0] + 1) p++;
- n8 += add_to_class(classbits, uchardptr, options, cb, p[0] + 1,
- (p[1] == NOTACHAR) ? (utf ? 0x10ffffu : 0xffffffffu) : p[1] - 1);
- p++;
- }
-return n8;
-}
+end_nests = (nest_save *)((char *)end_nests -
+ ((cb->workspace_size * sizeof(PCRE2_UCHAR)) % sizeof(nest_save)));
+/* PCRE2_EXTENDED_MORE implies PCRE2_EXTENDED */
+if ((options & PCRE2_EXTENDED_MORE) != 0) options |= PCRE2_EXTENDED;
-/*************************************************
-* Process (*VERB) name for escapes *
-*************************************************/
+/* Now scan the pattern */
-/* This function is called when the PCRE2_ALT_VERBNAMES option is set, to
-process the characters in a verb's name argument. It is called twice, once with
-codeptr == NULL, to find out the length of the processed name, and again to put
-the name into memory.
+while (ptr < ptrend)
+ {
+ int prev_expect_cond_assert;
+ uint32_t min_repeat, max_repeat;
+ uint32_t set, unset, *optset;
+ uint32_t terminator;
+ uint32_t prev_meta_quantifier;
+ BOOL prev_okquantifier;
+ PCRE2_SPTR tempptr;
+ PCRE2_SIZE offset;
+
+ if (parsed_pattern >= parsed_pattern_end)
+ {
+ errorcode = ERR63; /* Internal error (parsed pattern overflow) */
+ goto FAILED;
+ }
-Arguments:
- ptrptr pointer to the input pointer
- codeptr pointer to the compiled code pointer
- errorcodeptr pointer to the error code
- options the options bits
- utf TRUE if processing UTF
- cb compile data block
-
-Returns: length of the processed name, or < 0 on error
-*/
+ if (nest_depth > cb->cx->parens_nest_limit)
+ {
+ errorcode = ERR19;
+ goto FAILED; /* Parentheses too deeply nested */
+ }
-static int
-process_verb_name(PCRE2_SPTR *ptrptr, PCRE2_UCHAR **codeptr, int *errorcodeptr,
- uint32_t options, BOOL utf, compile_block *cb)
-{
-int32_t arglen = 0;
-BOOL inescq = FALSE;
-PCRE2_SPTR ptr = *ptrptr;
-PCRE2_UCHAR *code = (codeptr == NULL)? NULL : *codeptr;
+ /* Get next input character, save its position for callout handling. */
-for (; ptr < cb->end_pattern; ptr++)
- {
- uint32_t x = *ptr;
+ thisptr = ptr;
+ GETCHARINCTEST(c, ptr);
- /* Skip over literals */
+ /* Copy quoted literals until \E, allowing for the possibility of automatic
+ callouts, except when processing a (*VERB) "name". */
if (inescq)
{
- if (x == CHAR_BACKSLASH && ptr[1] == CHAR_E)
+ if (c == CHAR_BACKSLASH && ptr < ptrend && *ptr == CHAR_E)
{
inescq = FALSE;
- ptr++;;
- continue;
+ ptr++; /* Skip E */
}
+ else
+ {
+ if (expect_cond_assert > 0) /* A literal is not allowed if we are */
+ { /* expecting a conditional assertion, */
+ ptr--; /* but an empty \Q\E sequence is OK. */
+ errorcode = ERR28;
+ goto FAILED;
+ }
+ if (!inverbname && after_manual_callout-- <= 0)
+ parsed_pattern = manage_callouts(thisptr, &previous_callout,
+ auto_callout, parsed_pattern, cb);
+ PARSED_LITERAL(c, parsed_pattern);
+ meta_quantifier = 0;
+ }
+ continue; /* Next character */
}
- else /* Not a literal character */
+ /* If we are processing the "name" part of a (*VERB:NAME) item, all
+ characters up to the closing parenthesis are literals except when
+ PCRE2_ALT_VERBNAMES is set. That causes backslash interpretation, but only \Q
+ and \E and escaped characters are allowed (no character types such as \d). If
+ PCRE2_EXTENDED is also set, we must ignore white space and # comments. Do
+ this by not entering the special (*VERB:NAME) processing - they are then
+ picked up below. Note that c is a character, not a code unit, so we must not
+ use MAX_255 to test its size because MAX_255 tests code units and is assumed
+ TRUE in 8-bit mode. */
+
+ if (inverbname &&
+ (
+ /* EITHER: not both options set */
+ ((options & (PCRE2_EXTENDED | PCRE2_ALT_VERBNAMES)) !=
+ (PCRE2_EXTENDED | PCRE2_ALT_VERBNAMES)) ||
+ /* OR: character > 255 */
+ c > 255 ||
+ /* OR: not a # comment or white space */
+ (c != CHAR_NUMBER_SIGN && (cb->ctypes[c] & ctype_space) == 0)
+ ))
{
- if (x == CHAR_RIGHT_PARENTHESIS) break;
+ PCRE2_SIZE verbnamelength;
- /* Skip over comments and whitespace in extended mode. */
-
- if ((options & PCRE2_EXTENDED) != 0)
+ switch(c)
{
- PCRE2_SPTR wscptr = ptr;
- while (MAX_255(x) && (cb->ctypes[x] & ctype_space) != 0) x = *(++ptr);
- if (x == CHAR_NUMBER_SIGN)
+ default:
+ PARSED_LITERAL(c, parsed_pattern);
+ break;
+
+ case CHAR_RIGHT_PARENTHESIS:
+ inverbname = FALSE;
+ okquantifier = FALSE; /* Was probably set by literals */
+ /* This is the length in characters */
+ verbnamelength = (PCRE2_SIZE)(parsed_pattern - verblengthptr - 1);
+ /* But the limit on the length is in code units */
+ if (ptr - verbnamestart - 1 > (int)MAX_MARK)
{
- ptr++;
- while (*ptr != CHAR_NULL || ptr < cb->end_pattern)
- {
- if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cb->nllen. */
- ptr += cb->nllen;
- break;
- }
- ptr++;
-#ifdef SUPPORT_UNICODE
- if (utf) FORWARDCHAR(ptr);
-#endif
- }
+ ptr--;
+ errorcode = ERR76;
+ goto FAILED;
}
+ *verblengthptr = (uint32_t)verbnamelength;
+ break;
- /* If we have skipped any characters, restart the loop. */
+ case CHAR_BACKSLASH:
+ if ((options & PCRE2_ALT_VERBNAMES) != 0)
+ {
+ escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
+ FALSE, cb);
+ if (errorcode != 0) goto FAILED;
+ }
+ else escape = 0; /* Treat all as literal */
- if (ptr > wscptr)
+ switch(escape)
{
- ptr--;
- continue;
+ case 0:
+ PARSED_LITERAL(c, parsed_pattern);
+ break;
+
+ case ESC_Q:
+ inescq = TRUE;
+ break;
+
+ case ESC_E: /* Ignore */
+ break;
+
+ default:
+ errorcode = ERR40; /* Invalid in verb name */
+ goto FAILED;
}
}
+ continue; /* Next character in pattern */
+ }
- /* Process escapes */
+ /* Not a verb name character. At this point we must process everything that
+ must not change the quantification state. This is mainly comments, but we
+ handle \Q and \E here as well, so that an item such as A\Q\E+ is treated as
+ A+, as in Perl. An isolated \E is ignored. */
- if (x == '\\')
+ if (c == CHAR_BACKSLASH && ptr < ptrend)
+ {
+ if (*ptr == CHAR_Q || *ptr == CHAR_E)
{
- int rc;
- *errorcodeptr = 0;
- rc = PRIV(check_escape)(&ptr, cb->end_pattern, &x, errorcodeptr, options,
- FALSE, cb);
- *ptrptr = ptr; /* For possible error */
- if (*errorcodeptr != 0) return -1;
- if (rc != 0)
- {
- if (rc == ESC_Q)
- {
- inescq = TRUE;
- continue;
- }
- if (rc == ESC_E) continue;
- *errorcodeptr = ERR40;
- return -1;
- }
+ inescq = *ptr == CHAR_Q;
+ ptr++;
+ continue;
}
}
- /* We have the next character in the name. */
+ /* Skip over whitespace and # comments in extended mode. Note that c is a
+ character, not a code unit, so we must not use MAX_255 to test its size
+ because MAX_255 tests code units and is assumed TRUE in 8-bit mode. */
-#ifdef SUPPORT_UNICODE
- if (utf)
+ if ((options & PCRE2_EXTENDED) != 0)
{
- if (code == NULL) /* Just want the length */
+ if (c < 256 && (cb->ctypes[c] & ctype_space) != 0) continue;
+ if (c == CHAR_NUMBER_SIGN)
{
-#if PCRE2_CODE_UNIT_WIDTH == 8
- int i;
- for (i = 0; i < PRIV(utf8_table1_size); i++)
- if ((int)x <= PRIV(utf8_table1)[i]) break;
- arglen += i;
-#elif PCRE2_CODE_UNIT_WIDTH == 16
- if (x > 0xffff) arglen++;
+ while (ptr < ptrend)
+ {
+ if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
+ { /* IS_NEWLINE sets cb->nllen. */
+ ptr += cb->nllen;
+ break;
+ }
+ ptr++;
+#ifdef SUPPORT_UNICODE
+ if (utf) FORWARDCHARTEST(ptr, ptrend);
#endif
- }
- else
- {
- PCRE2_UCHAR cbuff[8];
- x = PRIV(ord2utf)(x, cbuff);
- memcpy(code, cbuff, CU2BYTES(x));
- code += x;
+ }
+ continue; /* Next character in pattern */
}
}
- else
-#endif /* SUPPORT_UNICODE */
- /* Not UTF */
+ /* Skip over bracketed comments */
+
+ if (c == CHAR_LEFT_PARENTHESIS && ptrend - ptr >= 2 &&
+ ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)
{
- if (code != NULL) *code++ = (PCRE2_UCHAR)x;
+ while (++ptr < ptrend && *ptr != CHAR_RIGHT_PARENTHESIS);
+ if (ptr >= ptrend)
+ {
+ errorcode = ERR18; /* A special error for missing ) in a comment */
+ goto FAILED; /* to make it easier to debug. */
+ }
+ ptr++;
+ continue; /* Next character in pattern */
}
- arglen++;
+ /* If the next item is not a quantifier, fill in length of any previous
+ callout and create an auto callout if required. */
- if ((unsigned int)arglen > MAX_MARK)
+ if (c != CHAR_ASTERISK && c != CHAR_PLUS && c != CHAR_QUESTION_MARK &&
+ (c != CHAR_LEFT_CURLY_BRACKET ||
+ (tempptr = ptr,
+ !read_repeat_counts(&tempptr, ptrend, NULL, NULL, &errorcode))))
{
- *errorcodeptr = ERR76;
- *ptrptr = ptr;
- return -1;
+ if (after_manual_callout-- <= 0)
+ parsed_pattern = manage_callouts(thisptr, &previous_callout, auto_callout,
+ parsed_pattern, cb);
}
- }
-/* Update the pointers before returning. */
+ /* If expect_cond_assert is 2, we have just passed (?( and are expecting an
+ assertion, possibly preceded by a callout. If the value is 1, we have just
+ had the callout and expect an assertion. There must be at least 3 more
+ characters in all cases. When expect_cond_assert is 2, we know that the
+ current character is an opening parenthesis, as otherwise we wouldn't be
+ here. However, when it is 1, we need to check, and it's easiest just to check
+ always. Note that expect_cond_assert may be negative, since all callouts just
+ decrement it. */
-*ptrptr = ptr;
-if (codeptr != NULL) *codeptr = code;
-return arglen;
-}
+ if (expect_cond_assert > 0)
+ {
+ BOOL ok = c == CHAR_LEFT_PARENTHESIS && ptrend - ptr >= 3 &&
+ ptr[0] == CHAR_QUESTION_MARK;
+ if (ok) switch(ptr[1])
+ {
+ case CHAR_C:
+ ok = expect_cond_assert == 2;
+ break;
+ case CHAR_EQUALS_SIGN:
+ case CHAR_EXCLAMATION_MARK:
+ break;
+ case CHAR_LESS_THAN_SIGN:
+ ok = ptr[2] == CHAR_EQUALS_SIGN || ptr[2] == CHAR_EXCLAMATION_MARK;
+ break;
-/*************************************************
-* Macro for the next two functions *
-*************************************************/
+ default:
+ ok = FALSE;
+ }
-/* Both scan_for_captures() and compile_branch() use this macro to generate a
-fragment of code that reads the characters of a name and sets its length
-(checking for not being too long). Count the characters dynamically, to avoid
-the possibility of integer overflow. The same macro is used for reading *VERB
-names. */
-
-#define READ_NAME(ctype, errno, errset) \
- namelen = 0; \
- while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype) != 0) \
- { \
- ptr++; \
- namelen++; \
- if (namelen > MAX_NAME_SIZE) \
- { \
- errset = errno; \
- goto FAILED; \
- } \
+ if (!ok)
+ {
+ ptr--; /* Adjust error offset */
+ errorcode = ERR28;
+ goto FAILED;
+ }
}
+ /* Remember whether we are expecting a conditional assertion, and set the
+ default for this item. */
+ prev_expect_cond_assert = expect_cond_assert;
+ expect_cond_assert = 0;
-/*************************************************
-* Scan regex to identify named groups *
-*************************************************/
+ /* Remember quantification status for the previous significant item, then set
+ default for this item. */
-/* This function is called first of all, to scan for named capturing groups so
-that information about them is fully available to both the compiling scans.
-It skips over everything except parenthesized items.
+ prev_okquantifier = okquantifier;
+ prev_meta_quantifier = meta_quantifier;
+ okquantifier = FALSE;
+ meta_quantifier = 0;
-Arguments:
- ptrptr points to pointer to the start of the pattern
- options compiling dynamic options
- cb pointer to the compile data block
+ /* If the previous significant item was a quantifier, adjust the parsed code
+ if there is a following modifier. The base meta value is always followed by
+ the PLUS and QUERY values, in that order. We do this here rather than after
+ reading a quantifier so that intervening comments and /x whitespace can be
+ ignored without having to replicate code. */
-Returns: zero on success or a non-zero error code, with pointer updated
-*/
-
-typedef struct nest_save {
- uint16_t nest_depth;
- uint16_t reset_group;
- uint16_t max_group;
- uint16_t flags;
-} nest_save;
+ if (prev_meta_quantifier != 0 && (c == CHAR_QUESTION_MARK || c == CHAR_PLUS))
+ {
+ parsed_pattern[(prev_meta_quantifier == META_MINMAX)? -3 : -1] =
+ prev_meta_quantifier + ((c == CHAR_QUESTION_MARK)?
+ 0x00020000u : 0x00010000u);
+ continue; /* Next character in pattern */
+ }
-#define NSF_RESET 0x0001u
-#define NSF_EXTENDED 0x0002u
-#define NSF_DUPNAMES 0x0004u
-static int scan_for_captures(PCRE2_SPTR *ptrptr, uint32_t options,
- compile_block *cb)
-{
-uint32_t c;
-uint32_t delimiter;
-uint32_t set, unset, *optset;
-uint32_t skiptoket = 0;
-uint16_t nest_depth = 0;
-int errorcode = 0;
-int escape;
-int namelen;
-int i;
-BOOL inescq = FALSE;
-BOOL isdupname;
-BOOL utf = (options & PCRE2_UTF) != 0;
-BOOL negate_class;
-PCRE2_SPTR name;
-PCRE2_SPTR start;
-PCRE2_SPTR ptr = *ptrptr;
-named_group *ng;
-nest_save *top_nest = NULL;
-nest_save *end_nests = (nest_save *)(cb->start_workspace + cb->workspace_size);
+ /* Process the next item in the main part of a pattern. */
-/* The size of the nest_save structure might not be a factor of the size of the
-workspace. Therefore we must round down end_nests so as to correctly avoid
-creating a nest_save that spans the end of the workspace. */
+ switch(c)
+ {
+ default: /* Non-special character */
+ PARSED_LITERAL(c, parsed_pattern);
+ break;
-end_nests = (nest_save *)((char *)end_nests -
- ((cb->workspace_size * sizeof(PCRE2_UCHAR)) % sizeof(nest_save)));
-/* Now scan the pattern */
+ /* ---- Escape sequence ---- */
-for (; ptr < cb->end_pattern; ptr++)
- {
- c = *ptr;
+ case CHAR_BACKSLASH:
+ tempptr = ptr;
+ escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
+ FALSE, cb);
+ if (errorcode != 0)
+ {
+ ESCAPE_FAILED:
+ if ((cb->cx->extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0)
+ goto FAILED;
+ ptr = tempptr;
+ if (ptr >= ptrend) c = CHAR_BACKSLASH; else
+ {
+ GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */
+ }
+ escape = 0; /* Treat as literal character */
+ }
- /* Parenthesized groups set skiptoket when all following characters up to the
- next closing parenthesis must be ignored. The parenthesis itself must be
- processed (to end the nested parenthesized item). */
+ /* The escape was a data escape or literal character. */
- if (skiptoket != 0)
- {
- if (c != CHAR_RIGHT_PARENTHESIS) continue;
- skiptoket = 0;
- }
+ if (escape == 0)
+ {
+ PARSED_LITERAL(c, parsed_pattern);
+ }
- /* Skip over literals */
+ /* The escape was a back (or forward) reference. We keep the offset in
+ order to give a more useful diagnostic for a bad forward reference. For
+ references to groups numbered less than 10 we can't use more than two items
+ in parsed_pattern because they may be just two characters in the input (and
+ in a 64-bit world an offset may need two elements). So for them, the offset
+ of the first occurrent is held in a special vector. */
- if (inescq)
- {
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
+ else if (escape < 0)
{
- inescq = FALSE;
- ptr++;
+ offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 1);
+ escape = -escape;
+ *parsed_pattern++ = META_BACKREF | (uint32_t)escape;
+ if (escape < 10)
+ {
+ if (cb->small_ref_offset[escape] == PCRE2_UNSET)
+ cb->small_ref_offset[escape] = offset;
+ }
+ else
+ {
+ PUTOFFSET(offset, parsed_pattern);
+ }
+ okquantifier = TRUE;
}
- continue;
- }
-
- /* Skip over # comments and whitespace in extended mode. */
- if ((options & PCRE2_EXTENDED) != 0)
- {
- PCRE2_SPTR wscptr = ptr;
- while (MAX_255(c) && (cb->ctypes[c] & ctype_space) != 0) c = *(++ptr);
- if (c == CHAR_NUMBER_SIGN)
+ /* The escape was a character class such as \d etc. or other special
+ escape indicator such as \A or \X. Most of them generate just a single
+ parsed item, but \P and \p are followed by a 16-bit type and a 16-bit
+ value. They are supported only when Unicode is available. The type and
+ value are packed into a single 32-bit value so that the whole sequences
+ uses only two elements in the parsed_vector. This is because the same
+ coding is used if \d (for example) is turned into \p{Nd} when PCRE2_UCP is
+ set.
+
+ There are also some cases where the escape sequence is followed by a name:
+ \k{name}, \k<name>, and \k'name' are backreferences by name, and \g<name>
+ and \g'name' are subroutine calls by name; \g{name} is a synonym for
+ \k{name}. Note that \g<number> and \g'number' are handled by check_escape()
+ and returned as a negative value (handled above). A name is coded as an
+ offset into the pattern and a length. */
+
+ else switch (escape)
{
- ptr++;
- while (ptr < cb->end_pattern)
+ case ESC_C:
+#ifdef NEVER_BACKSLASH_C
+ errorcode = ERR85;
+ goto ESCAPE_FAILED;
+#else
+ if ((options & PCRE2_NEVER_BACKSLASH_C) != 0)
{
- if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cb->nllen. */
- ptr += cb->nllen;
+ errorcode = ERR83;
+ goto ESCAPE_FAILED;
+ }
+#endif
+ okquantifier = TRUE;
+ *parsed_pattern++ = META_ESCAPE + escape;
+ break;
+
+ case ESC_X:
+#ifndef SUPPORT_UNICODE
+ errorcode = ERR45; /* Supported only with Unicode support */
+ goto ESCAPE_FAILED;
+#endif
+ case ESC_H:
+ case ESC_h:
+ case ESC_N:
+ case ESC_R:
+ case ESC_V:
+ case ESC_v:
+ okquantifier = TRUE;
+ *parsed_pattern++ = META_ESCAPE + escape;
+ break;
+
+ default: /* \A, \B, \b, \G, \K, \Z, \z cannot be quantified. */
+ *parsed_pattern++ = META_ESCAPE + escape;
+ break;
+
+ /* Escapes that change in UCP mode. Note that PCRE2_UCP will never be set
+ without Unicode support because it is checked when pcre2_compile() is
+ called. */
+
+ case ESC_d:
+ case ESC_D:
+ case ESC_s:
+ case ESC_S:
+ case ESC_w:
+ case ESC_W:
+ okquantifier = TRUE;
+ if ((options & PCRE2_UCP) == 0)
+ {
+ *parsed_pattern++ = META_ESCAPE + escape;
+ }
+ else
+ {
+ *parsed_pattern++ = META_ESCAPE +
+ ((escape == ESC_d || escape == ESC_s || escape == ESC_w)?
+ ESC_p : ESC_P);
+ switch(escape)
+ {
+ case ESC_d:
+ case ESC_D:
+ *parsed_pattern++ = (PT_PC << 16) | ucp_Nd;
+ break;
+
+ case ESC_s:
+ case ESC_S:
+ *parsed_pattern++ = PT_SPACE << 16;
+ break;
+
+ case ESC_w:
+ case ESC_W:
+ *parsed_pattern++ = PT_WORD << 16;
break;
}
- ptr++;
+ }
+ break;
+
+ /* Unicode property matching */
+
+ case ESC_P:
+ case ESC_p:
#ifdef SUPPORT_UNICODE
- if (utf) FORWARDCHAR(ptr);
+ {
+ BOOL negated;
+ uint16_t ptype = 0, pdata = 0;
+ if (!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb))
+ goto ESCAPE_FAILED;
+ if (negated) escape = (escape == ESC_P)? ESC_p : ESC_P;
+ *parsed_pattern++ = META_ESCAPE + escape;
+ *parsed_pattern++ = (ptype << 16) | pdata;
+ okquantifier = TRUE;
+ }
+#else
+ errorcode = ERR45;
+ goto ESCAPE_FAILED;
#endif
+ break; /* End \P and \p */
+
+ /* When \g is used with quotes or angle brackets as delimiters, it is a
+ numerical or named subroutine call, and control comes here. When used
+ with brace delimiters it is a numberical back reference and does not come
+ here because check_escape() returns it directly as a reference. \k is
+ always a named back reference. */
+
+ case ESC_g:
+ case ESC_k:
+ if (ptr >= ptrend || (*ptr != CHAR_LEFT_CURLY_BRACKET &&
+ *ptr != CHAR_LESS_THAN_SIGN && *ptr != CHAR_APOSTROPHE))
+ {
+ errorcode = (escape == ESC_g)? ERR57 : ERR69;
+ goto ESCAPE_FAILED;
}
+ terminator = (*ptr == CHAR_LESS_THAN_SIGN)?
+ CHAR_GREATER_THAN_SIGN : (*ptr == CHAR_APOSTROPHE)?
+ CHAR_APOSTROPHE : CHAR_RIGHT_CURLY_BRACKET;
+
+ /* For a non-braced \g, check for a numerical recursion. */
+
+ if (escape == ESC_g && terminator != CHAR_RIGHT_CURLY_BRACKET)
+ {
+ PCRE2_SPTR p = ptr + 1;
+
+ if (read_number(&p, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &i,
+ &errorcode))
+ {
+ if (p >= ptrend || *p != terminator)
+ {
+ errorcode = ERR57;
+ goto ESCAPE_FAILED;
+ }
+ ptr = p;
+ goto SET_RECURSION;
+ }
+ if (errorcode != 0) goto ESCAPE_FAILED;
+ }
+
+ /* Not a numerical recursion */
+
+ if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen,
+ &errorcode, cb)) goto ESCAPE_FAILED;
+
+ /* \k and \g when used with braces are back references, whereas \g used
+ with quotes or angle brackets is a recursion */
+
+ *parsed_pattern++ =
+ (escape == ESC_k || terminator == CHAR_RIGHT_CURLY_BRACKET)?
+ META_BACKREF_BYNAME : META_RECURSE_BYNAME;
+ *parsed_pattern++ = namelen;
+
+ PUTOFFSET(offset, parsed_pattern);
+ okquantifier = TRUE;
+ break; /* End special escape processing */
}
+ break; /* End escape sequence processing */
+
+
+ /* ---- Single-character special items ---- */
+
+ case CHAR_CIRCUMFLEX_ACCENT:
+ *parsed_pattern++ = META_CIRCUMFLEX;
+ break;
+
+ case CHAR_DOLLAR_SIGN:
+ *parsed_pattern++ = META_DOLLAR;
+ break;
+
+ case CHAR_DOT:
+ *parsed_pattern++ = META_DOT;
+ okquantifier = TRUE;
+ break;
+
- /* If we skipped any characters, restart the loop. Otherwise, we didn't see
- a comment. */
+ /* ---- Single-character quantifiers ---- */
- if (ptr > wscptr)
+ case CHAR_ASTERISK:
+ meta_quantifier = META_ASTERISK;
+ goto CHECK_QUANTIFIER;
+
+ case CHAR_PLUS:
+ meta_quantifier = META_PLUS;
+ goto CHECK_QUANTIFIER;
+
+ case CHAR_QUESTION_MARK:
+ meta_quantifier = META_QUERY;
+ goto CHECK_QUANTIFIER;
+
+
+ /* ---- Potential {n,m} quantifier ---- */
+
+ case CHAR_LEFT_CURLY_BRACKET:
+ if (!read_repeat_counts(&ptr, ptrend, &min_repeat, &max_repeat,
+ &errorcode))
{
- ptr--;
- continue;
+ if (errorcode != 0) goto FAILED; /* Error in quantifier. */
+ PARSED_LITERAL(c, parsed_pattern); /* Not a quantifier */
+ break; /* No more quantifier processing */
}
- }
+ meta_quantifier = META_MINMAX;
+ /* Fall through */
- /* Process the next pattern item. */
- switch(c)
- {
- default: /* Most characters are just skipped */
- break;
+ /* ---- Quantifier post-processing ---- */
- /* Skip escapes except for \Q */
+ /* Check that a quantifier is allowed after the previous item. */
- case CHAR_BACKSLASH:
- errorcode = 0;
- escape = PRIV(check_escape)(&ptr, cb->end_pattern, &c, &errorcode, options,
- FALSE, cb);
- if (errorcode != 0) goto FAILED;
- if (escape == ESC_Q) inescq = TRUE;
+ CHECK_QUANTIFIER:
+ if (!prev_okquantifier)
+ {
+ errorcode = ERR9;
+ goto FAILED_BACK;
+ }
+
+ /* Now we can put the quantifier into the parsed pattern vector. At this
+ stage, we have only the basic quantifier. The check for a following + or ?
+ modifier happens at the top of the loop, after any intervening comments
+ have been removed. */
+
+ *parsed_pattern++ = meta_quantifier;
+ if (c == CHAR_LEFT_CURLY_BRACKET)
+ {
+ *parsed_pattern++ = min_repeat;
+ *parsed_pattern++ = max_repeat;
+ }
break;
- /* Skip a character class. The syntax is complicated so we have to
- replicate some of what happens when a class is processed for real. */
+
+ /* ---- Character class ---- */
case CHAR_LEFT_SQUARE_BRACKET:
- if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0 ||
- PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
+ okquantifier = TRUE;
+
+ /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
+ used for "start of word" and "end of word". As these are otherwise illegal
+ sequences, we don't break anything by recognizing them. They are replaced
+ by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
+ erroneous and are handled by the normal code below. */
+
+ if (ptrend - ptr >= 6 &&
+ (PRIV(strncmp_c8)(ptr, STRING_WEIRD_STARTWORD, 6) == 0 ||
+ PRIV(strncmp_c8)(ptr, STRING_WEIRD_ENDWORD, 6) == 0))
{
+ *parsed_pattern++ = META_ESCAPE + ESC_b;
+
+ if (ptr[2] == CHAR_LESS_THAN_SIGN)
+ {
+ *parsed_pattern++ = META_LOOKAHEAD;
+ }
+ else
+ {
+ *parsed_pattern++ = META_LOOKBEHIND;
+ *has_lookbehind = TRUE;
+
+ /* The offset is used only for the "non-fixed length" error; this won't
+ occur here, so just store zero. */
+
+ PUTOFFSET((PCRE2_SIZE)0, parsed_pattern);
+ }
+
+ if ((options & PCRE2_UCP) == 0)
+ *parsed_pattern++ = META_ESCAPE + ESC_w;
+ else
+ {
+ *parsed_pattern++ = META_ESCAPE + ESC_p;
+ *parsed_pattern++ = PT_WORD << 16;
+ }
+ *parsed_pattern++ = META_KET;
ptr += 6;
break;
}
- /* If the first character is '^', set the negation flag (not actually used
- here, except to recognize only one ^) and skip it. If the first few
- characters (either before or after ^) are \Q\E or \E we skip them too. This
- makes for compatibility with Perl. */
+ /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
+ they are encountered at the top level, so we'll do that too. */
+
+ if (ptr < ptrend && (*ptr == CHAR_COLON || *ptr == CHAR_DOT ||
+ *ptr == CHAR_EQUALS_SIGN) &&
+ check_posix_syntax(ptr, ptrend, &tempptr))
+ {
+ errorcode = (*ptr-- == CHAR_COLON)? ERR12 : ERR13;
+ goto FAILED;
+ }
+
+ /* Process a regular character class. If the first character is '^', set
+ the negation flag. If the first few characters (either before or after ^)
+ are \Q\E or \E or space or tab in extended-more mode, we skip them too.
+ This makes for compatibility with Perl. */
negate_class = FALSE;
- for (;;)
+ while (ptr < ptrend)
{
- c = *(++ptr); /* First character in class */
+ GETCHARINCTEST(c, ptr);
if (c == CHAR_BACKSLASH)
{
- if (ptr[1] == CHAR_E)
- ptr++;
- else if (PRIV(strncmp_c8)(ptr + 1, STR_Q STR_BACKSLASH STR_E, 3) == 0)
+ if (ptr < ptrend && *ptr == CHAR_E) ptr++;
+ else if (ptrend - ptr >= 3 &&
+ PRIV(strncmp_c8)(ptr, STR_Q STR_BACKSLASH STR_E, 3) == 0)
ptr += 3;
else
break;
}
+ else if ((options & PCRE2_EXTENDED_MORE) != 0 &&
+ (c == CHAR_SPACE || c == CHAR_HT)) /* Note: just these two */
+ continue;
else if (!negate_class && c == CHAR_CIRCUMFLEX_ACCENT)
negate_class = TRUE;
else break;
}
+ /* Now the real contents of the class; c has the first "real" character.
+ Empty classes are permitted only if the option is set. */
+
if (c == CHAR_RIGHT_SQUARE_BRACKET &&
(cb->external_options & PCRE2_ALLOW_EMPTY_CLASS) != 0)
- break;
+ {
+ *parsed_pattern++ = negate_class? META_CLASS_EMPTY_NOT : META_CLASS_EMPTY;
+ break; /* End of class processing */
+ }
+
+ /* Process a non-empty class. */
+
+ *parsed_pattern++ = negate_class? META_CLASS_NOT : META_CLASS;
+ class_range_state = RANGE_NO;
+
+ /* In an EBCDIC environment, Perl treats alphabetic ranges specially
+ because there are holes in the encoding, and simply using the range A-Z
+ (for example) would include the characters in the holes. This applies only
+ to ranges where both values are literal; [\xC1-\xE9] is different to [A-Z]
+ in this respect. In order to accommodate this, we keep track of whether
+ character values are literal or not, and a state variable for handling
+ ranges. */
/* Loop for the contents of the class */
for (;;)
{
- PCRE2_SPTR tempptr;
-
- if (c == CHAR_NULL && ptr >= cb->end_pattern)
- {
- errorcode = ERR6; /* Missing terminating ']' */
- goto FAILED;
- }
-
-#ifdef SUPPORT_UNICODE
- if (utf && HAS_EXTRALEN(c))
- { /* Braces are required because the */
- GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
- }
-#endif
+ BOOL char_is_literal = TRUE;
/* Inside \Q...\E everything is literal except \E */
if (inescq)
{
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E) /* If we are at \E */
+ if (c == CHAR_BACKSLASH && ptr < ptrend && *ptr == CHAR_E)
{
inescq = FALSE; /* Reset literal state */
ptr++; /* Skip the 'E' */
+ goto CLASS_CONTINUE;
}
- goto CONTINUE_CLASS;
+ goto CLASS_LITERAL;
}
- /* Skip POSIX class names. */
+ /* Skip over space and tab (only) in extended-more mode. */
+
+ if ((options & PCRE2_EXTENDED_MORE) != 0 &&
+ (c == CHAR_SPACE || c == CHAR_HT))
+ goto CLASS_CONTINUE;
+
+ /* Handle POSIX class names. Perl allows a negation extension of the
+ form [:^name:]. A square bracket that doesn't match the syntax is
+ treated as a literal. We also recognize the POSIX constructions
+ [.ch.] and [=ch=] ("collating elements") and fault them, as Perl
+ 5.6 and 5.8 do. */
+
if (c == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) && check_posix_syntax(ptr, &tempptr))
+ ptrend - ptr >= 3 &&
+ (*ptr == CHAR_COLON || *ptr == CHAR_DOT ||
+ *ptr == CHAR_EQUALS_SIGN) &&
+ check_posix_syntax(ptr, ptrend, &tempptr))
{
- ptr = tempptr + 1;
+ BOOL posix_negate = FALSE;
+ int posix_class;
+
+ /* Perl treats a hyphen before a POSIX class as a literal, not the
+ start of a range. However, it gives a warning in its warning mode. PCRE
+ does not have a warning mode, so we give an error, because this is
+ likely an error on the user's part. */
+
+ if (class_range_state == RANGE_STARTED)
+ {
+ errorcode = ERR50;
+ goto FAILED;
+ }
+
+ if (*ptr != CHAR_COLON)
+ {
+ errorcode = ERR13;
+ goto FAILED_BACK;
+ }
+
+ if (*(++ptr) == CHAR_CIRCUMFLEX_ACCENT)
+ {
+ posix_negate = TRUE;
+ ptr++;
+ }
+
+ posix_class = check_posix_name(ptr, (int)(tempptr - ptr));
+ if (posix_class < 0)
+ {
+ errorcode = ERR30;
+ goto FAILED;
+ }
+ ptr = tempptr + 2;
+
+ /* Perl treats a hyphen after a POSIX class as a literal, not the
+ start of a range. However, it gives a warning in its warning mode
+ unless the hyphen is the last character in the class. PCRE does not
+ have a warning mode, so we give an error, because this is likely an
+ error on the user's part. */
+
+ if (ptr < ptrend - 1 && *ptr == CHAR_MINUS &&
+ ptr[1] != CHAR_RIGHT_SQUARE_BRACKET)
+ {
+ errorcode = ERR50;
+ goto FAILED;
+ }
+
+ /* Set "a hyphen is not the start of a range" for the -] case, and also
+ in case the POSIX class is followed by \E or \Q\E (possibly repeated -
+ fuzzers do that kind of thing) and *then* a hyphen. This causes that
+ hyphen to be treated as a literal. I don't think it's worth setting up
+ special apparatus to do otherwise. */
+
+ class_range_state = RANGE_NO;
+
+ /* When PCRE2_UCP is set, some of the POSIX classes are converted to
+ use Unicode properties \p or \P or, in one case, \h or \H. The
+ substitutes table has two values per class, containing the type and
+ value of a \p or \P item. The special cases are specified with a
+ negative type: a non-zero value causes \h or \H to be used, and a zero
+ value falls through to behave like a non-UCP POSIX class. */
+
+#ifdef SUPPORT_UNICODE
+ if ((options & PCRE2_UCP) != 0)
+ {
+ int ptype = posix_substitutes[2*posix_class];
+ int pvalue = posix_substitutes[2*posix_class + 1];
+ if (ptype >= 0)
+ {
+ *parsed_pattern++ = META_ESCAPE + (posix_negate? ESC_P : ESC_p);
+ *parsed_pattern++ = (ptype << 16) | pvalue;
+ goto CLASS_CONTINUE;
+ }
+
+ if (pvalue != 0)
+ {
+ *parsed_pattern++ = META_ESCAPE + (posix_negate? ESC_H : ESC_h);
+ goto CLASS_CONTINUE;
+ }
+
+ /* Fall through */
+ }
+#endif /* SUPPORT_UNICODE */
+
+ /* Non-UCP POSIX class */
+
+ *parsed_pattern++ = posix_negate? META_POSIX_NEG : META_POSIX;
+ *parsed_pattern++ = posix_class;
+ }
+
+ /* Handle potential start of range */
+
+ else if (c == CHAR_MINUS && class_range_state >= RANGE_OK_ESCAPED)
+ {
+ *parsed_pattern++ = (class_range_state == RANGE_OK_LITERAL)?
+ META_RANGE_LITERAL : META_RANGE_ESCAPED;
+ class_range_state = RANGE_STARTED;
+ }
+
+ /* Handle a literal character */
+
+ else if (c != CHAR_BACKSLASH)
+ {
+ CLASS_LITERAL:
+ if (class_range_state == RANGE_STARTED)
+ {
+ if (c == parsed_pattern[-2]) /* Optimize one-char range */
+ parsed_pattern--;
+ else if (parsed_pattern[-2] > c) /* Check range is in order */
+ {
+ errorcode = ERR8;
+ goto FAILED_BACK;
+ }
+ else
+ {
+ if (!char_is_literal && parsed_pattern[-1] == META_RANGE_LITERAL)
+ parsed_pattern[-1] = META_RANGE_ESCAPED;
+ PARSED_LITERAL(c, parsed_pattern);
+ }
+ class_range_state = RANGE_NO;
+ }
+ else /* Potential start of range */
+ {
+ class_range_state = char_is_literal?
+ RANGE_OK_LITERAL : RANGE_OK_ESCAPED;
+ PARSED_LITERAL(c, parsed_pattern);
+ }
}
- else if (c == CHAR_BACKSLASH)
+
+ /* Handle escapes in a class */
+
+ else
{
- errorcode = 0;
- escape = PRIV(check_escape)(&ptr, cb->end_pattern, &c, &errorcode,
+ tempptr = ptr;
+ escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode,
options, TRUE, cb);
- if (errorcode != 0) goto FAILED;
- if (escape == ESC_Q) inescq = TRUE;
+
+ if (errorcode != 0)
+ {
+ CLASS_ESCAPE_FAILED:
+ if ((cb->cx->extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0)
+ goto FAILED;
+ ptr = tempptr;
+ if (ptr >= ptrend) c = CHAR_BACKSLASH; else
+ {
+ GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */
+ }
+ escape = 0; /* Treat as literal character */
+ }
+
+ if (escape == 0) /* Escaped character code point is in c */
+ {
+ char_is_literal = FALSE;
+ goto CLASS_LITERAL;
+ }
+
+ /* These three escapes do not alter the class range state. */
+
+ if (escape == ESC_b)
+ {
+ c = CHAR_BS; /* \b is backspace in a class */
+ char_is_literal = FALSE;
+ goto CLASS_LITERAL;
+ }
+
+ else if (escape == ESC_Q)
+ {
+ inescq = TRUE; /* Enter literal mode */
+ goto CLASS_CONTINUE;
+ }
+
+ else if (escape == ESC_E) /* Ignore orphan \E */
+ goto CLASS_CONTINUE;
+
+ /* The second part of a range can be a single-character escape
+ sequence (detected above), but not any of the other escapes. Perl
+ treats a hyphen as a literal in such circumstances. However, in Perl's
+ warning mode, a warning is given, so PCRE now faults it, as it is
+ almost certainly a mistake on the user's part. */
+
+ if (class_range_state == RANGE_STARTED)
+ {
+ errorcode = ERR50;
+ goto CLASS_ESCAPE_FAILED;
+ }
+
+ /* Of the remaining escapes, only those that define characters are
+ allowed in a class. None may start a range. */
+
+ class_range_state = RANGE_NO;
+ switch(escape)
+ {
+ case ESC_N:
+ errorcode = ERR71; /* Not supported in a class */
+ goto CLASS_ESCAPE_FAILED;
+
+ case ESC_H:
+ case ESC_h:
+ case ESC_V:
+ case ESC_v:
+ *parsed_pattern++ = META_ESCAPE + escape;
+ break;
+
+ /* These escapes are converted to Unicode property tests when
+ PCRE2_UCP is set. */
+
+ case ESC_d:
+ case ESC_D:
+ case ESC_s:
+ case ESC_S:
+ case ESC_w:
+ case ESC_W:
+ if ((options & PCRE2_UCP) == 0)
+ {
+ *parsed_pattern++ = META_ESCAPE + escape;
+ }
+ else
+ {
+ *parsed_pattern++ = META_ESCAPE +
+ ((escape == ESC_d || escape == ESC_s || escape == ESC_w)?
+ ESC_p : ESC_P);
+ switch(escape)
+ {
+ case ESC_d:
+ case ESC_D:
+ *parsed_pattern++ = (PT_PC << 16) | ucp_Nd;
+ break;
+
+ case ESC_s:
+ case ESC_S:
+ *parsed_pattern++ = PT_SPACE << 16;
+ break;
+
+ case ESC_w:
+ case ESC_W:
+ *parsed_pattern++ = PT_WORD << 16;
+ break;
+ }
+ }
+ break;
+
+ /* Explicit Unicode property matching */
+
+ case ESC_P:
+ case ESC_p:
+#ifdef SUPPORT_UNICODE
+ {
+ BOOL negated;
+ uint16_t ptype = 0, pdata = 0;
+ if (!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb))
+ goto FAILED;
+ if (negated) escape = (escape == ESC_P)? ESC_p : ESC_P;
+ *parsed_pattern++ = META_ESCAPE + escape;
+ *parsed_pattern++ = (ptype << 16) | pdata;
+ }
+#else
+ errorcode = ERR45;
+ goto CLASS_ESCAPE_FAILED;
+#endif
+ break; /* End \P and \p */
+
+ default: /* All others are not allowed in a class */
+ errorcode = ERR7;
+ ptr--;
+ goto CLASS_ESCAPE_FAILED;
+ }
+
+ /* Perl gives a warning unless a following hyphen is the last character
+ in the class. PCRE throws an error. */
+
+ if (ptr < ptrend - 1 && *ptr == CHAR_MINUS &&
+ ptr[1] != CHAR_RIGHT_SQUARE_BRACKET)
+ {
+ errorcode = ERR50;
+ goto FAILED;
+ }
}
- CONTINUE_CLASS:
- c = *(++ptr);
+ /* Proceed to next thing in the class. */
+
+ CLASS_CONTINUE:
+ if (ptr >= ptrend)
+ {
+ errorcode = ERR6; /* Missing terminating ']' */
+ goto FAILED;
+ }
+ GETCHARINCTEST(c, ptr);
if (c == CHAR_RIGHT_SQUARE_BRACKET && !inescq) break;
} /* End of class-processing loop */
- break;
- /* This is the real work of this function - handling parentheses. */
+ if (class_range_state == RANGE_STARTED)
+ {
+ parsed_pattern[-1] = CHAR_MINUS;
+ class_range_state = RANGE_NO;
+ }
+
+ *parsed_pattern++ = META_CLASS_END;
+ break; /* End of character class */
+
+
+ /* ---- Opening parenthesis ---- */
case CHAR_LEFT_PARENTHESIS:
- nest_depth++;
+ if (ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
- if (ptr[1] != CHAR_QUESTION_MARK)
+ /* If ( is not followed by ? it is either a capture or a special verb. */
+
+ if (*ptr != CHAR_QUESTION_MARK)
{
- if (ptr[1] != CHAR_ASTERISK)
+ const char *vn;
+
+ /* Handle capturing brackets (or non-capturing if auto-capture is turned
+ off). */
+
+ if (*ptr != CHAR_ASTERISK)
{
- if ((options & PCRE2_NO_AUTO_CAPTURE) == 0) cb->bracount++;
+ nest_depth++;
+ if ((options & PCRE2_NO_AUTO_CAPTURE) == 0)
+ {
+ cb->bracount++;
+ *parsed_pattern++ = META_CAPTURE | cb->bracount;
+ }
+ else *parsed_pattern++ = META_NOCAPTURE;
}
- /* (*something) - skip over a name, and then just skip to closing ket
- unless PCRE2_ALT_VERBNAMES is set, in which case we have to process
- escapes in the string after a verb name terminated by a colon. */
- else
+ /* ---- Handle (*VERB) and (*VERB:NAME) ---- */
+
+ /* Do nothing for (*) so it gives a "bad quantifier" error rather than
+ "(*MARK) must have an argument". */
+
+ else if (ptrend - ptr > 1 && ptr[1] != CHAR_RIGHT_PARENTHESIS)
{
- ptr += 2;
- while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0) ptr++;
- if (*ptr == CHAR_COLON && (options & PCRE2_ALT_VERBNAMES) != 0)
+ vn = verbnames;
+ if (!read_name(&ptr, ptrend, 0, &offset, &name, &namelen, &errorcode,
+ cb)) goto FAILED;
+ if (ptr >= ptrend || (*ptr != CHAR_COLON &&
+ *ptr != CHAR_RIGHT_PARENTHESIS))
{
- ptr++;
- if (process_verb_name(&ptr, NULL, &errorcode, options, utf, cb) < 0)
+ errorcode = ERR60; /* Malformed */
+ goto FAILED;
+ }
+
+ /* Scan the table of verb names */
+
+ for (i = 0; i < verbcount; i++)
+ {
+ if (namelen == verbs[i].len &&
+ PRIV(strncmp_c8)(name, vn, namelen) == 0)
+ break;
+ vn += verbs[i].len + 1;
+ }
+
+ if (i >= verbcount)
+ {
+ errorcode = ERR60; /* Verb not recognized */
+ goto FAILED;
+ }
+
+ /* An empty argument is treated as no argument. */
+
+ if (*ptr == CHAR_COLON && ptr + 1 < ptrend &&
+ ptr[1] == CHAR_RIGHT_PARENTHESIS)
+ ptr++; /* Advance to the closing parens */
+
+ /* Check for mandatory non-empty argument; this is (*MARK) */
+
+ if (verbs[i].has_arg > 0 && *ptr != CHAR_COLON)
+ {
+ errorcode = ERR66;
+ goto FAILED;
+ }
+
+ /* It appears that Perl allows any characters whatsoever, other than a
+ closing parenthesis, to appear in arguments ("names"), so we no longer
+ insist on letters, digits, and underscores. Perl does not, however, do
+ any interpretation within arguments, and has no means of including a
+ closing parenthesis. PCRE supports escape processing but only when it
+ is requested by an option. We set inverbname TRUE here, and let the
+ main loop take care of this so that escape and \x processing is done by
+ the main code above. */
+
+ if (*ptr++ == CHAR_COLON) /* Skip past : or ) */
+ {
+ if (verbs[i].has_arg < 0) /* Argument is forbidden */
+ {
+ errorcode = ERR59;
goto FAILED;
+ }
+ *parsed_pattern++ = verbs[i].meta +
+ ((verbs[i].meta != META_MARK)? 0x00010000u:0);
+ verblengthptr = parsed_pattern++;
+ verbnamestart = ptr;
+ inverbname = TRUE;
}
- else
+ else /* No verb "name" argument */
{
- while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS)
- ptr++;
+ *parsed_pattern++ = verbs[i].meta;
}
- nest_depth--;
- }
- }
+ } /* End of (*VERB) handling */
+ break; /* Done with this parenthesis */
+ } /* End of groups that don't start with (? */
+
+
+ /* ---- Items starting (? ---- */
+
+ /* The type of item is determined by what follows (?. Handle (?| and option
+ changes under "default" because both need a new block on the nest stack.
+ Comments starting with (?# are handled above. Note that there is some
+ ambiguity about the sequence (?- because if a digit follows it's a relative
+ recursion or subroutine call whereas otherwise it's an option unsetting. */
- /* Handle (?...) groups */
+ if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
- else switch(ptr[2])
+ switch(*ptr)
{
default:
- ptr += 2;
- if (ptr[0] == CHAR_R || /* (?R) */
- ptr[0] == CHAR_NUMBER_SIGN || /* (?#) */
- IS_DIGIT(ptr[0]) || /* (?n) */
- (ptr[0] == CHAR_MINUS && IS_DIGIT(ptr[1]))) /* (?-n) */
- {
- skiptoket = ptr[0];
- break;
- }
+ if (*ptr == CHAR_MINUS && ptrend - ptr > 1 && IS_DIGIT(ptr[1]))
+ goto RECURSION_BYNUMBER; /* The + case is handled by CHAR_PLUS */
- /* Handle (?| and (?imsxJU: which are the only other valid forms. Both
- need a new block on the nest stack. */
+ /* We now have either (?| or a (possibly empty) option setting,
+ optionally followed by a non-capturing group. */
+ nest_depth++;
if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace);
else if (++top_nest >= end_nests)
{
@@ -3474,8 +3502,10 @@ for (; ptr < cb->end_pattern; ptr++)
}
top_nest->nest_depth = nest_depth;
top_nest->flags = 0;
- if ((options & PCRE2_EXTENDED) != 0) top_nest->flags |= NSF_EXTENDED;
- if ((options & PCRE2_DUPNAMES) != 0) top_nest->flags |= NSF_DUPNAMES;
+ top_nest->options = options & PARSE_TRACKED_OPTIONS;
+
+ /* Start of non-capturing group that resets the capture count for each
+ branch. */
if (*ptr == CHAR_VERTICAL_LINE)
{
@@ -3483,76 +3513,226 @@ for (; ptr < cb->end_pattern; ptr++)
top_nest->max_group = (uint16_t)cb->bracount;
top_nest->flags |= NSF_RESET;
cb->external_flags |= PCRE2_DUPCAPUSED;
- break;
+ *parsed_pattern++ = META_NOCAPTURE;
+ ptr++;
}
- /* Scan options */
+ /* Scan for options imnsxJU to be set or unset. */
- top_nest->reset_group = 0;
- top_nest->max_group = 0;
+ else
+ {
+ top_nest->reset_group = 0;
+ top_nest->max_group = 0;
+ set = unset = 0;
+ optset = &set;
- set = unset = 0;
- optset = &set;
+ while (ptr < ptrend && *ptr != CHAR_RIGHT_PARENTHESIS &&
+ *ptr != CHAR_COLON)
+ {
+ switch (*ptr++)
+ {
+ case CHAR_MINUS: optset = &unset; break;
- /* Need only track (?x: and (?J: at this stage */
+ case CHAR_J: /* Record that it changed in the external options */
+ *optset |= PCRE2_DUPNAMES;
+ cb->external_flags |= PCRE2_JCHANGED;
+ break;
- while (*ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_COLON)
- {
- switch (*ptr++)
- {
- case CHAR_MINUS: optset = &unset; break;
+ case CHAR_i: *optset |= PCRE2_CASELESS; break;
+ case CHAR_m: *optset |= PCRE2_MULTILINE; break;
+ case CHAR_n: *optset |= PCRE2_NO_AUTO_CAPTURE; break;
+ case CHAR_s: *optset |= PCRE2_DOTALL; break;
+ case CHAR_U: *optset |= PCRE2_UNGREEDY; break;
- case CHAR_x: *optset |= PCRE2_EXTENDED; break;
+ /* If x appears twice it sets the extended extended option. */
- case CHAR_J:
- *optset |= PCRE2_DUPNAMES;
- cb->external_flags |= PCRE2_JCHANGED;
- break;
+ case CHAR_x:
+ *optset |= PCRE2_EXTENDED;
+ if (ptr < ptrend && *ptr == CHAR_x)
+ {
+ *optset |= PCRE2_EXTENDED_MORE;
+ ptr++;
+ }
+ break;
- case CHAR_i:
- case CHAR_m:
- case CHAR_s:
- case CHAR_U:
- break;
+ default:
+ errorcode = ERR11;
+ ptr--; /* Correct the offset */
+ goto FAILED;
+ }
+ }
- default:
- errorcode = ERR11;
- ptr--; /* Correct the offset */
- goto FAILED;
+ /* If we are setting extended without extended-more, ensure that any
+ existing extended-more gets unset. Also, unsetting extended must also
+ unset extended-more. */
+
+ if ((set & (PCRE2_EXTENDED|PCRE2_EXTENDED_MORE)) == PCRE2_EXTENDED ||
+ (unset & PCRE2_EXTENDED) != 0)
+ unset |= PCRE2_EXTENDED_MORE;
+
+ options = (options | set) & (~unset);
+
+ /* If the options ended with ')' this is not the start of a nested
+ group with option changes, so the options change at this level.
+ In this case, if the previous level set up a nest block, discard the
+ one we have just created. Otherwise adjust it for the previous level.
+ If the options ended with ':' we are starting a non-capturing group,
+ possibly with an options setting. */
+
+ if (ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
+ if (*ptr++ == CHAR_RIGHT_PARENTHESIS)
+ {
+ nest_depth--; /* This is not a nested group after all. */
+ if (top_nest > (nest_save *)(cb->start_workspace) &&
+ (top_nest-1)->nest_depth == nest_depth) top_nest--;
+ else top_nest->nest_depth = nest_depth;
+ }
+ else *parsed_pattern++ = META_NOCAPTURE;
+
+ /* If nothing changed, no need to record. */
+
+ if (set != 0 || unset != 0)
+ {
+ *parsed_pattern++ = META_OPTIONS;
+ *parsed_pattern++ = options;
}
+ } /* End options processing */
+ break; /* End default case after (? */
+
+
+ /* ---- Python syntax support ---- */
+
+ case CHAR_P:
+ if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
+
+ /* (?P<name> is the same as (?<name>, which defines a named group. */
+
+ if (*ptr == CHAR_LESS_THAN_SIGN)
+ {
+ terminator = CHAR_GREATER_THAN_SIGN;
+ goto DEFINE_NAME;
}
- options = (options | set) & (~unset);
+ /* (?P>name) is the same as (?&name), which is a recursion or subroutine
+ call. */
+
+ if (*ptr == CHAR_GREATER_THAN_SIGN) goto RECURSE_BY_NAME;
- /* If the options ended with ')' this is not the start of a nested
- group with option changes, so the options change at this level. If the
- previous level set up a nest block, discard the one we have just created.
- Otherwise adjust it for the previous level. */
+ /* (?P=name) is the same as \k<name>, a back reference by name. Anything
+ else after (?P is an error. */
- if (*ptr == CHAR_RIGHT_PARENTHESIS)
+ if (*ptr != CHAR_EQUALS_SIGN)
{
- nest_depth--;
- if (top_nest > (nest_save *)(cb->start_workspace) &&
- (top_nest-1)->nest_depth == nest_depth) top_nest --;
- else top_nest->nest_depth = nest_depth;
+ errorcode = ERR41;
+ goto FAILED;
}
- break;
+ if (!read_name(&ptr, ptrend, CHAR_RIGHT_PARENTHESIS, &offset, &name,
+ &namelen, &errorcode, cb)) goto FAILED;
+ *parsed_pattern++ = META_BACKREF_BYNAME;
+ *parsed_pattern++ = namelen;
+ PUTOFFSET(offset, parsed_pattern);
+ okquantifier = TRUE;
+ break; /* End of (?P processing */
- /* Skip over a numerical or string argument for a callout. */
- case CHAR_C:
- ptr += 2;
- if (ptr[1] == CHAR_RIGHT_PARENTHESIS) break;
- if (IS_DIGIT(ptr[1]))
+ /* ---- Recursion/subroutine calls by number ---- */
+
+ case CHAR_R:
+ i = 0; /* (?R) == (?R0) */
+ ptr++;
+ if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS)
{
- while (IS_DIGIT(ptr[1])) ptr++;
+ errorcode = ERR58;
+ goto FAILED;
}
+ goto SET_RECURSION;
- /* Handle a string argument */
+ /* An item starting (?- followed by a digit comes here via the "default"
+ case because (?- followed by a non-digit is an options setting. */
- else
+ case CHAR_PLUS:
+ if (ptrend - ptr < 2 || !IS_DIGIT(ptr[1]))
{
- ptr++;
+ errorcode = ERR29; /* Missing number */
+ goto FAILED;
+ }
+ /* Fall through */
+
+ case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4:
+ case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
+ RECURSION_BYNUMBER:
+ if (!read_number(&ptr, ptrend,
+ (IS_DIGIT(*ptr))? -1:(int)(cb->bracount), /* + and - are relative */
+ MAX_GROUP_NUMBER, ERR61,
+ &i, &errorcode)) goto FAILED;
+ if (i < 0) /* NB (?0) is permitted */
+ {
+ errorcode = ERR15; /* Unknown group */
+ goto FAILED_BACK;
+ }
+ if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS)
+ goto UNCLOSED_PARENTHESIS;
+
+ SET_RECURSION:
+ *parsed_pattern++ = META_RECURSE | (uint32_t)i;
+ offset = (PCRE2_SIZE)(ptr - cb->start_pattern);
+ ptr++;
+ PUTOFFSET(offset, parsed_pattern);
+ okquantifier = TRUE;
+ break; /* End of recursive call by number handling */
+
+
+ /* ---- Recursion/subroutine calls by name ---- */
+
+ case CHAR_AMPERSAND:
+ RECURSE_BY_NAME:
+ if (!read_name(&ptr, ptrend, CHAR_RIGHT_PARENTHESIS, &offset, &name,
+ &namelen, &errorcode, cb)) goto FAILED;
+ *parsed_pattern++ = META_RECURSE_BYNAME;
+ *parsed_pattern++ = namelen;
+ PUTOFFSET(offset, parsed_pattern);
+ okquantifier = TRUE;
+ break;
+
+ /* ---- Callout with numerical or string argument ---- */
+
+ case CHAR_C:
+ if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
+
+ /* If the previous item was a condition starting (?(? an assertion,
+ optionally preceded by a callout, is expected. This is checked later on,
+ during actual compilation. However we need to identify this kind of
+ assertion in this pass because it must not be qualified. The value of
+ expect_cond_assert is set to 2 after (?(? is processed. We decrement it
+ for a callout - still leaving a positive value that identifies the
+ assertion. Multiple callouts or any other items will make it zero or
+ less, which doesn't matter because they will cause an error later. */
+
+ expect_cond_assert = prev_expect_cond_assert - 1;
+
+ /* If previous_callout is not NULL, it means this follows a previous
+ callout. If it was a manual callout, do nothing; this means its "length
+ of next pattern item" field will remain zero. If it was an automatic
+ callout, abolish it. */
+
+ if (previous_callout != NULL && (options & PCRE2_AUTO_CALLOUT) != 0 &&
+ previous_callout == parsed_pattern - 4 &&
+ parsed_pattern[-1] == 255)
+ parsed_pattern = previous_callout;
+
+ /* Save for updating next pattern item length, and skip one item before
+ completing. */
+
+ previous_callout = parsed_pattern;
+ after_manual_callout = 1;
+
+ /* Handle a string argument; specific delimiter is required. */
+
+ if (*ptr != CHAR_RIGHT_PARENTHESIS && !IS_DIGIT(*ptr))
+ {
+ PCRE2_SIZE calloutlength;
+ PCRE2_SPTR startptr = ptr;
+
delimiter = 0;
for (i = 0; PRIV(callout_start_delims)[i] != 0; i++)
{
@@ -3562,130 +3742,338 @@ for (; ptr < cb->end_pattern; ptr++)
break;
}
}
-
if (delimiter == 0)
{
errorcode = ERR82;
goto FAILED;
}
- start = ptr;
- do
+ *parsed_pattern = META_CALLOUT_STRING;
+ parsed_pattern += 3; /* Skip pattern info */
+
+ for (;;)
{
- if (++ptr >= cb->end_pattern)
+ if (++ptr >= ptrend)
{
errorcode = ERR81;
- ptr = start; /* To give a more useful message */
+ ptr = startptr; /* To give a more useful message */
+ goto FAILED;
+ }
+ if (*ptr == delimiter && (++ptr >= ptrend || *ptr != delimiter))
+ break;
+ }
+
+ calloutlength = (PCRE2_SIZE)(ptr - startptr);
+ if (calloutlength > UINT32_MAX)
+ {
+ errorcode = ERR72;
+ goto FAILED;
+ }
+ *parsed_pattern++ = (uint32_t)calloutlength;
+ offset = (PCRE2_SIZE)(startptr - cb->start_pattern);
+ PUTOFFSET(offset, parsed_pattern);
+ }
+
+ /* Handle a callout with an optional numerical argument, which must be
+ less than or equal to 255. A missing argument gives 0. */
+
+ else
+ {
+ int n = 0;
+ *parsed_pattern = META_CALLOUT_NUMBER; /* Numerical callout */
+ parsed_pattern += 3; /* Skip pattern info */
+ while (ptr < ptrend && IS_DIGIT(*ptr))
+ {
+ n = n * 10 + *ptr++ - CHAR_0;
+ if (n > 255)
+ {
+ errorcode = ERR38;
goto FAILED;
}
- if (ptr[0] == delimiter && ptr[1] == delimiter) ptr += 2;
}
- while (ptr[0] != delimiter);
+ *parsed_pattern++ = n;
}
- /* Check terminating ) */
+ /* Both formats must have a closing parenthesis */
- if (ptr[1] != CHAR_RIGHT_PARENTHESIS)
+ if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS)
{
errorcode = ERR39;
- ptr++;
goto FAILED;
}
- break;
+ ptr++;
- /* Conditional group */
+ /* Remember the offset to the next item in the pattern, and set a default
+ length. This should get updated after the next item is read. */
- case CHAR_LEFT_PARENTHESIS:
- if (ptr[3] != CHAR_QUESTION_MARK) /* Not assertion or callout */
- {
- nest_depth++;
- ptr += 2;
- break;
- }
+ previous_callout[1] = ptr - cb->start_pattern;
+ previous_callout[2] = 0;
+ break; /* End callout */
- /* Must be an assertion or a callout */
- switch(ptr[4])
- {
- case CHAR_LESS_THAN_SIGN:
- if (ptr[5] != CHAR_EXCLAMATION_MARK && ptr[5] != CHAR_EQUALS_SIGN)
- goto MISSING_ASSERTION;
- /* Fall through */
-
- case CHAR_C:
- case CHAR_EXCLAMATION_MARK:
- case CHAR_EQUALS_SIGN:
- ptr++;
- break;
+ /* ---- Conditional group ---- */
- default:
- MISSING_ASSERTION:
- ptr += 3; /* To improve error message */
- errorcode = ERR28;
- goto FAILED;
- }
- break;
+ /* A condition can be an assertion, a number (referring to a numbered
+ group's having been set), a name (referring to a named group), or 'R',
+ referring to overall recursion. R<digits> and R&name are also permitted
+ for recursion state tests. Numbers may be preceded by + or - to specify a
+ relative group number.
- case CHAR_COLON:
- case CHAR_GREATER_THAN_SIGN:
- case CHAR_EQUALS_SIGN:
- case CHAR_EXCLAMATION_MARK:
- case CHAR_AMPERSAND:
- case CHAR_PLUS:
- ptr += 2;
- break;
+ There are several syntaxes for testing a named group: (?(name)) is used
+ by Python; Perl 5.10 onwards uses (?(<name>) or (?('name')).
- case CHAR_P:
- if (ptr[3] != CHAR_LESS_THAN_SIGN)
+ There are two unfortunate ambiguities. 'R' can be the recursive thing or
+ the name 'R' (and similarly for 'R' followed by digits). 'DEFINE' can be
+ the Perl DEFINE feature or the Python named test. We look for a name
+ first; if not found, we try the other case.
+
+ For compatibility with auto-callouts, we allow a callout to be specified
+ before a condition that is an assertion. */
+
+ case CHAR_LEFT_PARENTHESIS:
+ if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
+ nest_depth++;
+
+ /* If the next character is ? there must be an assertion next (optionally
+ preceded by a callout). We do not check this here, but instead we set
+ expect_cond_assert to 2. If this is still greater than zero (callouts
+ decrement it) when the next assertion is read, it will be marked as a
+ condition that must not be repeated. A value greater than zero also
+ causes checking that an assertion (possibly with callout) follows. */
+
+ if (*ptr == CHAR_QUESTION_MARK)
{
- ptr += 3;
- break;
+ *parsed_pattern++ = META_COND_ASSERT;
+ ptr--; /* Pull pointer back to the opening parenthesis. */
+ expect_cond_assert = 2;
+ break; /* End of conditional */
}
- ptr++;
- c = CHAR_GREATER_THAN_SIGN; /* Terminator */
- goto DEFINE_NAME;
- case CHAR_LESS_THAN_SIGN:
- if (ptr[3] == CHAR_EQUALS_SIGN || ptr[3] == CHAR_EXCLAMATION_MARK)
+ /* Handle (?([+-]number)... */
+
+ if (read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &i,
+ &errorcode))
{
- ptr += 3;
- break;
+ if (i <= 0)
+ {
+ errorcode = ERR15;
+ goto FAILED;
+ }
+ *parsed_pattern++ = META_COND_NUMBER;
+ offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 2);
+ PUTOFFSET(offset, parsed_pattern);
+ *parsed_pattern++ = i;
}
- c = CHAR_GREATER_THAN_SIGN; /* Terminator */
- goto DEFINE_NAME;
-
- case CHAR_APOSTROPHE:
- c = CHAR_APOSTROPHE; /* Terminator */
+ else if (errorcode != 0) goto FAILED; /* Number too big */
- DEFINE_NAME:
- name = ptr = ptr + 3;
+ /* No number found. Handle the special case (?(VERSION[>]=n.m)... */
- if (*ptr == c) /* Empty name */
+ else if (ptrend - ptr >= 10 &&
+ PRIV(strncmp_c8)(ptr, STRING_VERSION, 7) == 0 &&
+ ptr[7] != CHAR_RIGHT_PARENTHESIS)
{
- errorcode = ERR62;
- goto FAILED;
+ uint32_t ge = 0;
+ int major = 0;
+ int minor = 0;
+
+ ptr += 7;
+ if (*ptr == CHAR_GREATER_THAN_SIGN)
+ {
+ ge = 1;
+ ptr++;
+ }
+
+ /* NOTE: cannot write IS_DIGIT(*(++ptr)) here because IS_DIGIT
+ references its argument twice. */
+
+ if (*ptr != CHAR_EQUALS_SIGN || (ptr++, !IS_DIGIT(*ptr)))
+ goto BAD_VERSION_CONDITION;
+
+ if (!read_number(&ptr, ptrend, -1, 1000, ERR79, &major, &errorcode))
+ goto FAILED;
+
+ if (ptr >= ptrend) goto BAD_VERSION_CONDITION;
+ if (*ptr == CHAR_DOT)
+ {
+ if (++ptr >= ptrend || !IS_DIGIT(*ptr)) goto BAD_VERSION_CONDITION;
+ if (!read_number(&ptr, ptrend, -1, 99 , ERR79, &minor, &errorcode))
+ goto FAILED;
+ if (minor < 10) minor *= 10;
+ if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS)
+ goto BAD_VERSION_CONDITION;
+ }
+
+ *parsed_pattern++ = META_COND_VERSION;
+ *parsed_pattern++ = ge;
+ *parsed_pattern++ = major;
+ *parsed_pattern++ = minor;
}
- if (IS_DIGIT(*ptr))
+ /* All the remaining cases now require us to read a name. We cannot at
+ this stage distinguish ambiguous cases such as (?(R12) which might be a
+ recursion test by number or a name, because the named groups have not yet
+ all been identified. Those cases are treated as names, but given a
+ different META code. */
+
+ else
{
- errorcode = ERR44; /* Group name must start with non-digit */
- goto FAILED;
- }
+ BOOL was_r_ampersand = FALSE;
+
+ if (*ptr == CHAR_R && ptrend - ptr > 1 && ptr[1] == CHAR_AMPERSAND)
+ {
+ terminator = CHAR_RIGHT_PARENTHESIS;
+ was_r_ampersand = TRUE;
+ ptr++;
+ }
+ else if (*ptr == CHAR_LESS_THAN_SIGN)
+ terminator = CHAR_GREATER_THAN_SIGN;
+ else if (*ptr == CHAR_APOSTROPHE)
+ terminator = CHAR_APOSTROPHE;
+ else
+ {
+ terminator = CHAR_RIGHT_PARENTHESIS;
+ ptr--; /* Point to char before name */
+ }
+ if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen,
+ &errorcode, cb)) goto FAILED;
+
+ /* Handle (?(R&name) */
- if (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) == 0)
+ if (was_r_ampersand)
+ {
+ *parsed_pattern = META_COND_RNAME;
+ ptr--; /* Back to closing parens */
+ }
+
+ /* Handle (?(name). If the name is "DEFINE" we identify it with a
+ special code. Likewise if the name consists of R followed only by
+ digits. Otherwise, handle it like a quoted name. */
+
+ else if (terminator == CHAR_RIGHT_PARENTHESIS)
+ {
+ if (namelen == 6 && PRIV(strncmp_c8)(name, STRING_DEFINE, 6) == 0)
+ *parsed_pattern = META_COND_DEFINE;
+ else
+ {
+ for (i = 1; i < (int)namelen; i++)
+ if (!IS_DIGIT(name[i])) break;
+ *parsed_pattern = (*name == CHAR_R && i >= (int)namelen)?
+ META_COND_RNUMBER : META_COND_NAME;
+ }
+ ptr--; /* Back to closing parens */
+ }
+
+ /* Handle (?('name') or (?(<name>) */
+
+ else *parsed_pattern = META_COND_NAME;
+
+ /* All these cases except DEFINE end with the name length and offset;
+ DEFINE just has an offset (for the "too many branches" error). */
+
+ if (*parsed_pattern++ != META_COND_DEFINE) *parsed_pattern++ = namelen;
+ PUTOFFSET(offset, parsed_pattern);
+ } /* End cases that read a name */
+
+ /* Check the closing parenthesis of the condition */
+
+ if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS)
{
errorcode = ERR24;
goto FAILED;
}
+ ptr++;
+ break; /* End of condition processing */
+
+
+ /* ---- Atomic group ---- */
+
+ case CHAR_GREATER_THAN_SIGN:
+ *parsed_pattern++ = META_ATOMIC;
+ nest_depth++;
+ ptr++;
+ break;
+
- /* Advance ptr, set namelen and check its length. */
- READ_NAME(ctype_word, ERR48, errorcode);
+ /* ---- Lookahead assertions ---- */
- if (*ptr != c)
+ case CHAR_EQUALS_SIGN:
+ *parsed_pattern++ = META_LOOKAHEAD;
+ ptr++;
+ goto POST_ASSERTION;
+
+ case CHAR_EXCLAMATION_MARK:
+ *parsed_pattern++ = META_LOOKAHEADNOT;
+ ptr++;
+ goto POST_ASSERTION;
+
+
+ /* ---- Lookbehind assertions ---- */
+
+ /* (?< followed by = or ! is a lookbehind assertion. Otherwise (?< is the
+ start of the name of a capturing group. */
+
+ case CHAR_LESS_THAN_SIGN:
+ if (ptrend - ptr <= 1 ||
+ (ptr[1] != CHAR_EQUALS_SIGN && ptr[1] != CHAR_EXCLAMATION_MARK))
{
- errorcode = ERR42;
- goto FAILED;
+ terminator = CHAR_GREATER_THAN_SIGN;
+ goto DEFINE_NAME;
+ }
+ *parsed_pattern++ = (ptr[1] == CHAR_EQUALS_SIGN)?
+ META_LOOKBEHIND : META_LOOKBEHINDNOT;
+ *has_lookbehind = TRUE;
+ offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 2);
+ PUTOFFSET(offset, parsed_pattern);
+ ptr += 2;
+ /* Fall through */
+
+ /* If the previous item was a condition starting (?(? an assertion,
+ optionally preceded by a callout, is expected. This is checked later on,
+ during actual compilation. However we need to identify this kind of
+ assertion in this pass because it must not be qualified. The value of
+ expect_cond_assert is set to 2 after (?(? is processed. We decrement it
+ for a callout - still leaving a positive value that identifies the
+ assertion. Multiple callouts or any other items will make it zero or
+ less, which doesn't matter because they will cause an error later. */
+
+ POST_ASSERTION:
+ nest_depth++;
+ if (prev_expect_cond_assert > 0)
+ {
+ if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace);
+ else if (++top_nest >= end_nests)
+ {
+ errorcode = ERR84;
+ goto FAILED;
+ }
+ top_nest->nest_depth = nest_depth;
+ top_nest->flags = NSF_CONDASSERT;
+ top_nest->options = options & PARSE_TRACKED_OPTIONS;
}
+ break;
+
+
+ /* ---- Define a named group ---- */
+
+ /* A named group may be defined as (?'name') or (?<name>). In the latter
+ case we jump to DEFINE_NAME from the disambiguation of (?< above with the
+ terminator set to '>'. */
+
+ case CHAR_APOSTROPHE:
+ terminator = CHAR_APOSTROPHE; /* Terminator */
+
+ DEFINE_NAME:
+ if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen,
+ &errorcode, cb)) goto FAILED;
+
+ /* We have a name for this capturing group. It is also assigned a number,
+ which is its primary means of identification. */
+
+ cb->bracount++;
+ *parsed_pattern++ = META_CAPTURE | cb->bracount;
+ nest_depth++;
+
+ /* Check not too many names */
if (cb->names_found >= MAX_NAME_COUNT)
{
@@ -3693,13 +4081,11 @@ for (; ptr < cb->end_pattern; ptr++)
goto FAILED;
}
+ /* Adjust the entry size to accommodate the longest name found. */
+
if (namelen + IMM2_SIZE + 1 > cb->name_entry_size)
cb->name_entry_size = (uint16_t)(namelen + IMM2_SIZE + 1);
- /* We have a valid name for this capturing group. */
-
- cb->bracount++;
-
/* Scan the list to check for duplicates. For duplicate names, if the
number is the same, break the loop, which causes the name to be
discarded; otherwise, if DUPNAMES is not set, give an error.
@@ -3712,7 +4098,7 @@ for (; ptr < cb->end_pattern; ptr++)
for (i = 0; i < cb->names_found; i++, ng++)
{
if (namelen == ng->length &&
- PRIV(strncmp)(name, ng->name, (size_t)namelen) == 0)
+ PRIV(strncmp)(name, ng->name, (PCRE2_SIZE)namelen) == 0)
{
if (ng->number == cb->bracount) break;
if ((options & PCRE2_DUPNAMES) == 0)
@@ -3766,7 +4152,10 @@ for (; ptr < cb->end_pattern; ptr++)
} /* End of (? switch */
break; /* End of ( handling */
- /* At an alternation, reset the capture count if we are in a (?| group. */
+
+ /* ---- Branch terminators ---- */
+
+ /* Alternation: reset the capture count if we are in a (?| group. */
case CHAR_VERTICAL_LINE:
if (top_nest != NULL && top_nest->nest_depth == nest_depth &&
@@ -3776,48 +4165,617 @@ for (; ptr < cb->end_pattern; ptr++)
top_nest->max_group = (uint16_t)cb->bracount;
cb->bracount = top_nest->reset_group;
}
+ *parsed_pattern++ = META_ALT;
break;
- /* At a right parenthesis, reset the capture count to the maximum if we
- are in a (?| group and/or reset the extended option. */
+ /* End of group; reset the capture count to the maximum if we are in a (?|
+ group and/or reset the options that are tracked during parsing. Disallow
+ quantifier for a condition that is an assertion. */
case CHAR_RIGHT_PARENTHESIS:
+ okquantifier = TRUE;
if (top_nest != NULL && top_nest->nest_depth == nest_depth)
{
+ options = (options & ~PARSE_TRACKED_OPTIONS) | top_nest->options;
if ((top_nest->flags & NSF_RESET) != 0 &&
top_nest->max_group > cb->bracount)
cb->bracount = top_nest->max_group;
- if ((top_nest->flags & NSF_EXTENDED) != 0) options |= PCRE2_EXTENDED;
- else options &= ~PCRE2_EXTENDED;
- if ((top_nest->flags & NSF_DUPNAMES) != 0) options |= PCRE2_DUPNAMES;
- else options &= ~PCRE2_DUPNAMES;
+ if ((top_nest->flags & NSF_CONDASSERT) != 0)
+ okquantifier = FALSE;
if (top_nest == (nest_save *)(cb->start_workspace)) top_nest = NULL;
else top_nest--;
}
if (nest_depth == 0) /* Unmatched closing parenthesis */
{
errorcode = ERR22;
- goto FAILED;
+ goto FAILED_BACK;
}
nest_depth--;
+ *parsed_pattern++ = META_KET;
break;
- }
+ } /* End of switch on pattern character */
+ } /* End of main character scan loop */
+
+/* End of pattern reached. Check for missing ) at the end of a verb name. */
+
+if (inverbname && ptr >= ptrend)
+ {
+ errorcode = ERR60;
+ goto FAILED;
+ }
+
+/* Manage callout for the final item */
+
+PARSED_END:
+parsed_pattern = manage_callouts(ptr, &previous_callout, auto_callout,
+ parsed_pattern, cb);
+
+/* Insert trailing items for word and line matching (features provided for the
+benefit of pcre2grep). */
+
+if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_LINE) != 0)
+ {
+ *parsed_pattern++ = META_KET;
+ *parsed_pattern++ = META_DOLLAR;
+ }
+else if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_WORD) != 0)
+ {
+ *parsed_pattern++ = META_KET;
+ *parsed_pattern++ = META_ESCAPE + ESC_b;
}
-if (nest_depth == 0)
+/* Terminate the parsed pattern, then return success if all groups are closed.
+Otherwise we have unclosed parentheses. */
+
+if (parsed_pattern >= parsed_pattern_end)
{
- cb->final_bracount = cb->bracount;
- return 0;
+ errorcode = ERR63; /* Internal error (parsed pattern overflow) */
+ goto FAILED;
}
-/* We give a special error for a missing closing parentheses after (?# because
-it might otherwise be hard to see where the missing character is. */
+*parsed_pattern = META_END;
+if (nest_depth == 0) return 0;
-errorcode = (skiptoket == CHAR_NUMBER_SIGN)? ERR18 : ERR14;
+UNCLOSED_PARENTHESIS:
+errorcode = ERR14;
+
+/* Come here for all failures. */
FAILED:
-*ptrptr = ptr;
+cb->erroroffset = (PCRE2_SIZE)(ptr - cb->start_pattern);
return errorcode;
+
+/* Some errors need to indicate the previous character. */
+
+FAILED_BACK:
+ptr--;
+goto FAILED;
+
+/* This failure happens several times. */
+
+BAD_VERSION_CONDITION:
+errorcode = ERR79;
+goto FAILED;
+}
+
+
+
+/*************************************************
+* Find first significant op code *
+*************************************************/
+
+/* This is called by several functions that scan a compiled expression looking
+for a fixed first character, or an anchoring op code etc. It skips over things
+that do not influence this. For some calls, it makes sense to skip negative
+forward and all backward assertions, and also the \b assertion; for others it
+does not.
+
+Arguments:
+ code pointer to the start of the group
+ skipassert TRUE if certain assertions are to be skipped
+
+Returns: pointer to the first significant opcode
+*/
+
+static const PCRE2_UCHAR*
+first_significant_code(PCRE2_SPTR code, BOOL skipassert)
+{
+for (;;)
+ {
+ switch ((int)*code)
+ {
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ if (!skipassert) return code;
+ do code += GET(code, 1); while (*code == OP_ALT);
+ code += PRIV(OP_lengths)[*code];
+ break;
+
+ case OP_WORD_BOUNDARY:
+ case OP_NOT_WORD_BOUNDARY:
+ if (!skipassert) return code;
+ /* Fall through */
+
+ case OP_CALLOUT:
+ case OP_CREF:
+ case OP_DNCREF:
+ case OP_RREF:
+ case OP_DNRREF:
+ case OP_FALSE:
+ case OP_TRUE:
+ code += PRIV(OP_lengths)[*code];
+ break;
+
+ case OP_CALLOUT_STR:
+ code += GET(code, 1 + 2*LINK_SIZE);
+ break;
+
+ case OP_SKIPZERO:
+ code += 2 + GET(code, 2) + LINK_SIZE;
+ break;
+
+ case OP_COND:
+ case OP_SCOND:
+ if (code[1+LINK_SIZE] != OP_FALSE || /* Not DEFINE */
+ code[GET(code, 1)] != OP_KET) /* More than one branch */
+ return code;
+ code += GET(code, 1) + 1 + LINK_SIZE;
+ break;
+
+ default:
+ return code;
+ }
+ }
+/* Control never reaches here */
+}
+
+
+
+#ifdef SUPPORT_UNICODE
+/*************************************************
+* Get othercase range *
+*************************************************/
+
+/* This function is passed the start and end of a class range in UCP mode. It
+searches up the characters, looking for ranges of characters in the "other"
+case. Each call returns the next one, updating the start address. A character
+with multiple other cases is returned on its own with a special return value.
+
+Arguments:
+ cptr points to starting character value; updated
+ d end value
+ ocptr where to put start of othercase range
+ odptr where to put end of othercase range
+
+Yield: -1 when no more
+ 0 when a range is returned
+ >0 the CASESET offset for char with multiple other cases
+ in this case, ocptr contains the original
+*/
+
+static int
+get_othercase_range(uint32_t *cptr, uint32_t d, uint32_t *ocptr,
+ uint32_t *odptr)
+{
+uint32_t c, othercase, next;
+unsigned int co;
+
+/* Find the first character that has an other case. If it has multiple other
+cases, return its case offset value. */
+
+for (c = *cptr; c <= d; c++)
+ {
+ if ((co = UCD_CASESET(c)) != 0)
+ {
+ *ocptr = c++; /* Character that has the set */
+ *cptr = c; /* Rest of input range */
+ return (int)co;
+ }
+ if ((othercase = UCD_OTHERCASE(c)) != c) break;
+ }
+
+if (c > d) return -1; /* Reached end of range */
+
+/* Found a character that has a single other case. Search for the end of the
+range, which is either the end of the input range, or a character that has zero
+or more than one other cases. */
+
+*ocptr = othercase;
+next = othercase + 1;
+
+for (++c; c <= d; c++)
+ {
+ if ((co = UCD_CASESET(c)) != 0 || UCD_OTHERCASE(c) != next) break;
+ next++;
+ }
+
+*odptr = next - 1; /* End of othercase range */
+*cptr = c; /* Rest of input range */
+return 0;
+}
+#endif /* SUPPORT_UNICODE */
+
+
+
+/*************************************************
+* Add a character or range to a class (internal) *
+*************************************************/
+
+/* This function packages up the logic of adding a character or range of
+characters to a class. The character values in the arguments will be within the
+valid values for the current mode (8-bit, 16-bit, UTF, etc). This function is
+called only from within the "add to class" group of functions, some of which
+are recursive and mutually recursive. The external entry point is
+add_to_class().
+
+Arguments:
+ classbits the bit map for characters < 256
+ uchardptr points to the pointer for extra data
+ options the options word
+ cb compile data
+ start start of range character
+ end end of range character
+
+Returns: the number of < 256 characters added
+ the pointer to extra data is updated
+*/
+
+static unsigned int
+add_to_class_internal(uint8_t *classbits, PCRE2_UCHAR **uchardptr,
+ uint32_t options, compile_block *cb, uint32_t start, uint32_t end)
+{
+uint32_t c;
+uint32_t classbits_end = (end <= 0xff ? end : 0xff);
+unsigned int n8 = 0;
+
+/* If caseless matching is required, scan the range and process alternate
+cases. In Unicode, there are 8-bit characters that have alternate cases that
+are greater than 255 and vice-versa. Sometimes we can just extend the original
+range. */
+
+if ((options & PCRE2_CASELESS) != 0)
+ {
+#ifdef SUPPORT_UNICODE
+ if ((options & PCRE2_UTF) != 0)
+ {
+ int rc;
+ uint32_t oc, od;
+
+ options &= ~PCRE2_CASELESS; /* Remove for recursive calls */
+ c = start;
+
+ while ((rc = get_othercase_range(&c, end, &oc, &od)) >= 0)
+ {
+ /* Handle a single character that has more than one other case. */
+
+ if (rc > 0) n8 += add_list_to_class_internal(classbits, uchardptr, options, cb,
+ PRIV(ucd_caseless_sets) + rc, oc);
+
+ /* Do nothing if the other case range is within the original range. */
+
+ else if (oc >= cb->class_range_start && od <= cb->class_range_end) continue;
+
+ /* Extend the original range if there is overlap, noting that if oc < c, we
+ can't have od > end because a subrange is always shorter than the basic
+ range. Otherwise, use a recursive call to add the additional range. */
+
+ else if (oc < start && od >= start - 1) start = oc; /* Extend downwards */
+ else if (od > end && oc <= end + 1)
+ {
+ end = od; /* Extend upwards */
+ if (end > classbits_end) classbits_end = (end <= 0xff ? end : 0xff);
+ }
+ else n8 += add_to_class_internal(classbits, uchardptr, options, cb, oc, od);
+ }
+ }
+ else
+#endif /* SUPPORT_UNICODE */
+
+ /* Not UTF mode */
+
+ for (c = start; c <= classbits_end; c++)
+ {
+ SETBIT(classbits, cb->fcc[c]);
+ n8++;
+ }
+ }
+
+/* Now handle the originally supplied range. Adjust the final value according
+to the bit length - this means that the same lists of (e.g.) horizontal spaces
+can be used in all cases. */
+
+if ((options & PCRE2_UTF) == 0 && end > MAX_NON_UTF_CHAR)
+ end = MAX_NON_UTF_CHAR;
+
+if (start > cb->class_range_start && end < cb->class_range_end) return n8;
+
+/* Use the bitmap for characters < 256. Otherwise use extra data.*/
+
+for (c = start; c <= classbits_end; c++)
+ {
+ /* Regardless of start, c will always be <= 255. */
+ SETBIT(classbits, c);
+ n8++;
+ }
+
+#ifdef SUPPORT_WIDE_CHARS
+if (start <= 0xff) start = 0xff + 1;
+
+if (end >= start)
+ {
+ PCRE2_UCHAR *uchardata = *uchardptr;
+
+#ifdef SUPPORT_UNICODE
+ if ((options & PCRE2_UTF) != 0)
+ {
+ if (start < end)
+ {
+ *uchardata++ = XCL_RANGE;
+ uchardata += PRIV(ord2utf)(start, uchardata);
+ uchardata += PRIV(ord2utf)(end, uchardata);
+ }
+ else if (start == end)
+ {
+ *uchardata++ = XCL_SINGLE;
+ uchardata += PRIV(ord2utf)(start, uchardata);
+ }
+ }
+ else
+#endif /* SUPPORT_UNICODE */
+
+ /* Without UTF support, character values are constrained by the bit length,
+ and can only be > 256 for 16-bit and 32-bit libraries. */
+
+#if PCRE2_CODE_UNIT_WIDTH == 8
+ {}
+#else
+ if (start < end)
+ {
+ *uchardata++ = XCL_RANGE;
+ *uchardata++ = start;
+ *uchardata++ = end;
+ }
+ else if (start == end)
+ {
+ *uchardata++ = XCL_SINGLE;
+ *uchardata++ = start;
+ }
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
+ *uchardptr = uchardata; /* Updata extra data pointer */
+ }
+#else /* SUPPORT_WIDE_CHARS */
+ (void)uchardptr; /* Avoid compiler warning */
+#endif /* SUPPORT_WIDE_CHARS */
+
+return n8; /* Number of 8-bit characters */
+}
+
+
+
+#ifdef SUPPORT_UNICODE
+/*************************************************
+* Add a list of characters to a class (internal) *
+*************************************************/
+
+/* This function is used for adding a list of case-equivalent characters to a
+class when in UTF mode. This function is called only from within
+add_to_class_internal(), with which it is mutually recursive.
+
+Arguments:
+ classbits the bit map for characters < 256
+ uchardptr points to the pointer for extra data
+ options the options word
+ cb contains pointers to tables etc.
+ p points to row of 32-bit values, terminated by NOTACHAR
+ except character to omit; this is used when adding lists of
+ case-equivalent characters to avoid including the one we
+ already know about
+
+Returns: the number of < 256 characters added
+ the pointer to extra data is updated
+*/
+
+static unsigned int
+add_list_to_class_internal(uint8_t *classbits, PCRE2_UCHAR **uchardptr,
+ uint32_t options, compile_block *cb, const uint32_t *p, unsigned int except)
+{
+unsigned int n8 = 0;
+while (p[0] < NOTACHAR)
+ {
+ unsigned int n = 0;
+ if (p[0] != except)
+ {
+ while(p[n+1] == p[0] + n + 1) n++;
+ n8 += add_to_class_internal(classbits, uchardptr, options, cb, p[0], p[n]);
+ }
+ p += n + 1;
+ }
+return n8;
+}
+#endif
+
+
+
+/*************************************************
+* External entry point for add range to class *
+*************************************************/
+
+/* This function sets the overall range so that the internal functions can try
+to avoid duplication when handling case-independence.
+
+Arguments:
+ classbits the bit map for characters < 256
+ uchardptr points to the pointer for extra data
+ options the options word
+ cb compile data
+ start start of range character
+ end end of range character
+
+Returns: the number of < 256 characters added
+ the pointer to extra data is updated
+*/
+
+static unsigned int
+add_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options,
+ compile_block *cb, uint32_t start, uint32_t end)
+{
+cb->class_range_start = start;
+cb->class_range_end = end;
+return add_to_class_internal(classbits, uchardptr, options, cb, start, end);
+}
+
+
+/*************************************************
+* External entry point for add list to class *
+*************************************************/
+
+/* This function is used for adding a list of horizontal or vertical whitespace
+characters to a class. The list must be in order so that ranges of characters
+can be detected and handled appropriately. This function sets the overall range
+so that the internal functions can try to avoid duplication when handling
+case-independence.
+
+Arguments:
+ classbits the bit map for characters < 256
+ uchardptr points to the pointer for extra data
+ options the options word
+ cb contains pointers to tables etc.
+ p points to row of 32-bit values, terminated by NOTACHAR
+ except character to omit; this is used when adding lists of
+ case-equivalent characters to avoid including the one we
+ already know about
+
+Returns: the number of < 256 characters added
+ the pointer to extra data is updated
+*/
+
+static unsigned int
+add_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options,
+ compile_block *cb, const uint32_t *p, unsigned int except)
+{
+unsigned int n8 = 0;
+while (p[0] < NOTACHAR)
+ {
+ unsigned int n = 0;
+ if (p[0] != except)
+ {
+ while(p[n+1] == p[0] + n + 1) n++;
+ cb->class_range_start = p[0];
+ cb->class_range_end = p[n];
+ n8 += add_to_class_internal(classbits, uchardptr, options, cb, p[0], p[n]);
+ }
+ p += n + 1;
+ }
+return n8;
+}
+
+
+
+/*************************************************
+* Add characters not in a list to a class *
+*************************************************/
+
+/* This function is used for adding the complement of a list of horizontal or
+vertical whitespace to a class. The list must be in order.
+
+Arguments:
+ classbits the bit map for characters < 256
+ uchardptr points to the pointer for extra data
+ options the options word
+ cb contains pointers to tables etc.
+ p points to row of 32-bit values, terminated by NOTACHAR
+
+Returns: the number of < 256 characters added
+ the pointer to extra data is updated
+*/
+
+static unsigned int
+add_not_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr,
+ uint32_t options, compile_block *cb, const uint32_t *p)
+{
+BOOL utf = (options & PCRE2_UTF) != 0;
+unsigned int n8 = 0;
+if (p[0] > 0)
+ n8 += add_to_class(classbits, uchardptr, options, cb, 0, p[0] - 1);
+while (p[0] < NOTACHAR)
+ {
+ while (p[1] == p[0] + 1) p++;
+ n8 += add_to_class(classbits, uchardptr, options, cb, p[0] + 1,
+ (p[1] == NOTACHAR) ? (utf ? 0x10ffffu : 0xffffffffu) : p[1] - 1);
+ p++;
+ }
+return n8;
+}
+
+
+
+/*************************************************
+* Find details of duplicate group names *
+*************************************************/
+
+/* This is called from compile_branch() when it needs to know the index and
+count of duplicates in the names table when processing named backreferences,
+either directly, or as conditions.
+
+Arguments:
+ name points to the name
+ length the length of the name
+ indexptr where to put the index
+ countptr where to put the count of duplicates
+ errorcodeptr where to put an error code
+ cb the compile block
+
+Returns: TRUE if OK, FALSE if not, error code set
+*/
+
+static BOOL
+find_dupname_details(PCRE2_SPTR name, uint32_t length, int *indexptr,
+ int *countptr, int *errorcodeptr, compile_block *cb)
+{
+uint32_t i, groupnumber;
+int count;
+PCRE2_UCHAR *slot = cb->name_table;
+
+/* Find the first entry in the table */
+
+for (i = 0; i < cb->names_found; i++)
+ {
+ if (PRIV(strncmp)(name, slot+IMM2_SIZE, length) == 0 &&
+ slot[IMM2_SIZE+length] == 0) break;
+ slot += cb->name_entry_size;
+ }
+
+/* This should not occur, because this function is called only when we know we
+have duplicate names. Give an internal error. */
+
+if (i >= cb->names_found)
+ {
+ *errorcodeptr = ERR53;
+ cb->erroroffset = name - cb->start_pattern;
+ return FALSE;
+ }
+
+/* Record the index and then see how many duplicates there are, updating the
+backref map and maximum back reference as we do. */
+
+*indexptr = i;
+count = 0;
+
+for (;;)
+ {
+ count++;
+ groupnumber = GET2(slot,0);
+ cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1;
+ if (groupnumber > cb->top_backref) cb->top_backref = groupnumber;
+ if (++i >= cb->names_found) break;
+ slot += cb->name_entry_size;
+ if (PRIV(strncmp)(name, slot+IMM2_SIZE, length) != 0 ||
+ (slot+IMM2_SIZE)[length] != 0) break;
+ }
+
+*countptr = count;
+return TRUE;
}
@@ -3826,63 +4784,64 @@ return errorcode;
* Compile one branch *
*************************************************/
-/* Scan the pattern, compiling it into the a vector. If the options are
-changed during the branch, the pointer is used to change the external options
-bits. This function is used during the pre-compile phase when we are trying
-to find out the amount of memory needed, as well as during the real compile
-phase. The value of lengthptr distinguishes the two phases.
+/* Scan the parsed pattern, compiling it into the a vector of PCRE2_UCHAR. If
+the options are changed during the branch, the pointer is used to change the
+external options bits. This function is used during the pre-compile phase when
+we are trying to find out the amount of memory needed, as well as during the
+real compile phase. The value of lengthptr distinguishes the two phases.
Arguments:
optionsptr pointer to the option bits
codeptr points to the pointer to the current code point
- ptrptr points to the current pattern pointer
+ pptrptr points to the current parsed pattern pointer
errorcodeptr points to error code variable
firstcuptr place to put the first required code unit
firstcuflagsptr place to put the first code unit flags, or a negative number
reqcuptr place to put the last required code unit
reqcuflagsptr place to put the last required code unit flags, or a negative number
bcptr points to current branch chain
- cond_depth conditional nesting depth
cb contains pointers to tables etc.
lengthptr NULL during the real compile phase
points to length accumulator during pre-compile phase
-Returns: TRUE on success
- FALSE, with *errorcodeptr set non-zero on error
+Returns: 0 There's been an error, *errorcodeptr is non-zero
+ +1 Success, this branch must match at least one character
+ -1 Success, this branch may match an empty string
*/
-static BOOL
-compile_branch(uint32_t *optionsptr, PCRE2_UCHAR **codeptr,
- PCRE2_SPTR *ptrptr, int *errorcodeptr,
- uint32_t *firstcuptr, int32_t *firstcuflagsptr,
- uint32_t *reqcuptr, int32_t *reqcuflagsptr,
- branch_chain *bcptr, int cond_depth,
- compile_block *cb, size_t *lengthptr)
+static int
+compile_branch(uint32_t *optionsptr, PCRE2_UCHAR **codeptr, uint32_t **pptrptr,
+ int *errorcodeptr, uint32_t *firstcuptr, int32_t *firstcuflagsptr,
+ uint32_t *reqcuptr, int32_t *reqcuflagsptr, branch_chain *bcptr,
+ compile_block *cb, PCRE2_SIZE *lengthptr)
{
-int repeat_min = 0, repeat_max = 0; /* To please picky compilers */
int bravalue = 0;
+int okreturn = -1;
+int group_return = 0;
+uint32_t repeat_min = 0, repeat_max = 0; /* To please picky compilers */
uint32_t greedy_default, greedy_non_default;
uint32_t repeat_type, op_type;
uint32_t options = *optionsptr; /* May change dynamically */
uint32_t firstcu, reqcu;
-int32_t firstcuflags, reqcuflags;
uint32_t zeroreqcu, zerofirstcu;
+uint32_t escape;
+uint32_t *pptr = *pptrptr;
+uint32_t meta, meta_arg;
+int32_t firstcuflags, reqcuflags;
int32_t zeroreqcuflags, zerofirstcuflags;
int32_t req_caseopt, reqvary, tempreqvary;
-int after_manual_callout = 0;
-int escape;
-size_t length_prevgroup = 0;
-register uint32_t c;
-register PCRE2_UCHAR *code = *codeptr;
+PCRE2_SIZE offset = 0;
+PCRE2_SIZE length_prevgroup = 0;
+PCRE2_UCHAR *code = *codeptr;
PCRE2_UCHAR *last_code = code;
PCRE2_UCHAR *orig_code = code;
PCRE2_UCHAR *tempcode;
-BOOL inescq = FALSE;
-BOOL groupsetfirstcu = FALSE;
-PCRE2_SPTR ptr = *ptrptr;
-PCRE2_SPTR tempptr;
PCRE2_UCHAR *previous = NULL;
-PCRE2_UCHAR *previous_callout = NULL;
+PCRE2_UCHAR op_previous;
+BOOL groupsetfirstcu = FALSE;
+BOOL matched_char = FALSE;
+BOOL previous_matched_char = FALSE;
+const uint8_t *cbits = cb->cbits;
uint8_t classbits[32];
/* We can fish out the UTF setting once and for all into a BOOL, but we must
@@ -3891,10 +4850,6 @@ dynamically as we process the pattern. */
#ifdef SUPPORT_UNICODE
BOOL utf = (options & PCRE2_UTF) != 0;
-#if PCRE2_CODE_UNIT_WIDTH != 32
-PCRE2_UCHAR utf_units[6]; /* For setting up multi-cu chars */
-#endif
-
#else /* No UTF support */
BOOL utf = FALSE;
#endif
@@ -3935,57 +4890,36 @@ to record the case status of the value. This is used only for ASCII characters.
req_caseopt = ((options & PCRE2_CASELESS) != 0)? REQ_CASELESS:0;
-/* Switch on next character until the end of the branch */
+/* Switch on next META item until the end of the branch */
-for (;; ptr++)
+for (;; pptr++)
{
+#ifdef SUPPORT_WIDE_CHARS
+ BOOL xclass_has_prop;
+#endif
BOOL negate_class;
BOOL should_flip_negation;
BOOL match_all_or_no_wide_chars;
BOOL possessive_quantifier;
- BOOL is_quantifier;
- BOOL is_recurse;
- BOOL is_dupname;
- BOOL reset_bracount;
+ BOOL note_group_empty;
int class_has_8bitchar;
- int class_one_char;
-#ifdef SUPPORT_WIDE_CHARS
- BOOL xclass_has_prop;
-#endif
- int recno; /* Must be signed */
- int refsign; /* Must be signed */
- int terminator; /* Must be signed */
- unsigned int mclength;
- unsigned int tempbracount;
- uint32_t ec;
- uint32_t newoptions;
+ int i;
+ uint32_t mclength;
uint32_t skipunits;
uint32_t subreqcu, subfirstcu;
+ uint32_t groupnumber;
+ uint32_t verbarglen, verbculen;
int32_t subreqcuflags, subfirstcuflags; /* Must be signed */
+ open_capitem *oc;
PCRE2_UCHAR mcbuffer[8];
- /* Come here to restart the loop. */
-
- REDO_LOOP:
-
- /* Get next character in the pattern */
+ /* Get next META item in the pattern and its potential argument. */
- c = *ptr;
-
- /* If we are at the end of a nested substitution, revert to the outer level
- string. Nesting only happens one or two levels deep, and the inserted string
- is always zero terminated. */
-
- if (c == CHAR_NULL && cb->nestptr[0] != NULL)
- {
- ptr = cb->nestptr[0];
- cb->nestptr[0] = cb->nestptr[1];
- cb->nestptr[1] = NULL;
- c = *ptr;
- }
+ meta = META_CODE(*pptr);
+ meta_arg = META_DATA(*pptr);
/* If we are in the pre-compile phase, accumulate the length used for the
- previous cycle of this loop. */
+ previous cycle of this loop, unless the next item is a quantifier. */
if (lengthptr != NULL)
{
@@ -3994,202 +4928,81 @@ for (;; ptr++)
{
*errorcodeptr = (code >= cb->start_workspace + cb->workspace_size)?
ERR52 : ERR86;
- goto FAILED;
+ return 0;
}
/* There is at least one situation where code goes backwards: this is the
- case of a zero quantifier after a class (e.g. [ab]{0}). At compile time,
- the class is simply eliminated. However, it is created first, so we have to
- allow memory for it. Therefore, don't ever reduce the length at this point.
- */
+ case of a zero quantifier after a class (e.g. [ab]{0}). When the quantifier
+ is processed, the whole class is eliminated. However, it is created first,
+ so we have to allow memory for it. Therefore, don't ever reduce the length
+ at this point. */
if (code < last_code) code = last_code;
- /* Paranoid check for integer overflow */
-
- if (OFLOW_MAX - *lengthptr < (size_t)(code - last_code))
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += (size_t)(code - last_code);
-
- /* If "previous" is set and it is not at the start of the work space, move
- it back to there, in order to avoid filling up the work space. Otherwise,
- if "previous" is NULL, reset the current code pointer to the start. */
+ /* If the next thing is not a quantifier, we add the length of the previous
+ item into the total, and reset the code pointer to the start of the
+ workspace. Otherwise leave the previous item available to be quantified. */
- if (previous != NULL)
- {
- if (previous > orig_code)
- {
- memmove(orig_code, previous, (size_t)CU2BYTES(code - previous));
- code -= previous - orig_code;
- previous = orig_code;
- }
- }
- else code = orig_code;
-
- /* Remember where this code item starts so we can pick up the length
- next time round. */
-
- last_code = code;
- }
-
- /* Before doing anything else we must handle all the special items that do
- nothing, and which may come between an item and its quantifier. Otherwise,
- when auto-callouts are enabled, a callout gets incorrectly inserted before
- the quantifier is recognized. After recognizing a "do nothing" item, restart
- the loop in case another one follows. */
-
- /* If c is not NULL we are not at the end of the pattern. If it is NULL, we
- may still be in the pattern with a NULL data item. In these cases, if we are
- in \Q...\E, check for the \E that ends the literal string; if not, we have a
- literal character. If not in \Q...\E, an isolated \E is ignored. */
-
- if (c != CHAR_NULL || ptr < cb->end_pattern)
- {
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
- {
- inescq = FALSE;
- ptr++;
- continue;
- }
- else if (inescq) /* Literal character */
+ if (meta < META_ASTERISK || meta > META_MINMAX_QUERY)
{
- if (previous_callout != NULL)
+ if (OFLOW_MAX - *lengthptr < (PCRE2_SIZE)(code - orig_code))
{
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cb);
- previous_callout = NULL;
+ *errorcodeptr = ERR20; /* Integer overflow */
+ return 0;
}
- if ((options & PCRE2_AUTO_CALLOUT) != 0)
+ *lengthptr += (PCRE2_SIZE)(code - orig_code);
+ if (*lengthptr > MAX_PATTERN_SIZE)
{
- previous_callout = code;
- code = auto_callout(code, ptr, cb);
+ *errorcodeptr = ERR20; /* Pattern is too large */
+ return 0;
}
- goto NORMAL_CHAR;
+ code = orig_code;
}
- /* Check for the start of a \Q...\E sequence. We must do this here rather
- than later in case it is immediately followed by \E, which turns it into a
- "do nothing" sequence. */
+ /* Remember where this code item starts so we can catch the "backwards"
+ case above next time round. */
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
- {
- inescq = TRUE;
- ptr++;
- continue;
- }
- }
-
- /* In extended mode, skip white space and #-comments that end at newline. */
-
- if ((options & PCRE2_EXTENDED) != 0)
- {
- PCRE2_SPTR wscptr = ptr;
- while (MAX_255(c) && (cb->ctypes[c] & ctype_space) != 0) c = *(++ptr);
- if (c == CHAR_NUMBER_SIGN)
- {
- ptr++;
- while (ptr < cb->end_pattern)
- {
- if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cb->nllen. */
- ptr += cb->nllen;
- break;
- }
- ptr++;
-#ifdef SUPPORT_UNICODE
- if (utf) FORWARDCHAR(ptr);
-#endif
- }
- }
-
- /* If we skipped any characters, restart the loop. Otherwise, we didn't see
- a comment. */
-
- if (ptr > wscptr) goto REDO_LOOP;
- }
-
- /* Skip over (?# comments. */
-
- if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK &&
- ptr[2] == CHAR_NUMBER_SIGN)
- {
- ptr += 3;
- while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR18;
- goto FAILED;
- }
- continue;
+ last_code = code;
}
- /* End of processing "do nothing" items. See if the next thing is a
- quantifier. */
-
- is_quantifier =
- c == CHAR_ASTERISK || c == CHAR_PLUS || c == CHAR_QUESTION_MARK ||
- (c == CHAR_LEFT_CURLY_BRACKET && is_counted_repeat(ptr+1));
+ /* Process the next parsed pattern item. If it is not a quantifier, remember
+ where it starts so that it can be quantified when a quantifier follows.
+ Checking for the legality of quantifiers happens in parse_regex(), except for
+ a quantifier after an assertion that is a condition. */
- /* Fill in length of a previous callout and create an auto callout if
- required, except when the next thing is a quantifier or when processing a
- property substitution string for \w etc in UCP mode. */
-
- if (!is_quantifier && cb->nestptr[0] == NULL)
+ if (meta < META_ASTERISK || meta > META_MINMAX_QUERY)
{
- if (previous_callout != NULL && after_manual_callout-- <= 0)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cb);
- previous_callout = NULL;
- }
-
- if ((options & PCRE2_AUTO_CALLOUT) != 0)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cb);
- }
+ previous = code;
+ if (matched_char) okreturn = 1;
}
- /* Process the next pattern item. */
+ previous_matched_char = matched_char;
+ matched_char = FALSE;
+ note_group_empty = FALSE;
+ skipunits = 0; /* Default value for most subgroups */
- switch(c)
+ switch(meta)
{
/* ===================================================================*/
- /* The branch terminates at string end or | or ) */
-
- case CHAR_NULL:
- if (ptr < cb->end_pattern) goto NORMAL_CHAR; /* Zero data character */
- /* Fall through */
+ /* The branch terminates at pattern end or | or ) */
- case CHAR_VERTICAL_LINE:
- case CHAR_RIGHT_PARENTHESIS:
+ case META_END:
+ case META_ALT:
+ case META_KET:
*firstcuptr = firstcu;
*firstcuflagsptr = firstcuflags;
*reqcuptr = reqcu;
*reqcuflagsptr = reqcuflags;
*codeptr = code;
- *ptrptr = ptr;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < (size_t)(code - last_code))
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += (size_t)(code - last_code); /* To include callout length */
- }
- return TRUE;
+ *pptrptr = pptr;
+ return okreturn;
/* ===================================================================*/
/* Handle single-character metacharacters. In multiline mode, ^ disables
the setting of any following char as a first character. */
- case CHAR_CIRCUMFLEX_ACCENT:
- previous = NULL;
+ case META_CIRCUMFLEX:
if ((options & PCRE2_MULTILINE) != 0)
{
if (firstcuflags == REQ_UNSET)
@@ -4199,117 +5012,112 @@ for (;; ptr++)
else *code++ = OP_CIRC;
break;
- case CHAR_DOLLAR_SIGN:
- previous = NULL;
+ case META_DOLLAR:
*code++ = ((options & PCRE2_MULTILINE) != 0)? OP_DOLLM : OP_DOLL;
break;
/* There can never be a first char if '.' is first, whatever happens about
repeats. The value of reqcu doesn't change either. */
- case CHAR_DOT:
+ case META_DOT:
+ matched_char = TRUE;
if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
zerofirstcu = firstcu;
zerofirstcuflags = firstcuflags;
zeroreqcu = reqcu;
zeroreqcuflags = reqcuflags;
- previous = code;
*code++ = ((options & PCRE2_DOTALL) != 0)? OP_ALLANY: OP_ANY;
break;
/* ===================================================================*/
- /* Character classes. If the included characters are all < 256, we build a
- 32-byte bitmap of the permitted characters, except in the special case
- where there is only one such character. For negated classes, we build the
- map as usual, then invert it at the end. However, we use a different opcode
- so that data characters > 255 can be handled correctly.
+ /* Empty character classes are allowed if PCRE2_ALLOW_EMPTY_CLASS is set.
+ Otherwise, an initial ']' is taken as a data character. When empty classes
+ are allowed, [] must always fail, so generate OP_FAIL, whereas [^] must
+ match any character, so generate OP_ALLANY. */
+
+ case META_CLASS_EMPTY:
+ case META_CLASS_EMPTY_NOT:
+ matched_char = TRUE;
+ *code++ = (meta == META_CLASS_EMPTY_NOT)? OP_ALLANY : OP_FAIL;
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ zerofirstcu = firstcu;
+ zerofirstcuflags = firstcuflags;
+ break;
+
+
+ /* ===================================================================*/
+ /* Non-empty character class. If the included characters are all < 256, we
+ build a 32-byte bitmap of the permitted characters, except in the special
+ case where there is only one such character. For negated classes, we build
+ the map as usual, then invert it at the end. However, we use a different
+ opcode so that data characters > 255 can be handled correctly.
If the class contains characters outside the 0-255 range, a different
opcode is compiled. It may optionally have a bit map for characters < 256,
- but those above are are explicitly listed afterwards. A flag byte tells
- whether the bitmap is present, and whether this is a negated class or not.
+ but those above are are explicitly listed afterwards. A flag code unit
+ tells whether the bitmap is present, and whether this is a negated class or
+ not. */
- An isolated ']' character is not treated specially, so is just another data
- character. In earlier versions of PCRE that used the original API there was
- a "JavaScript compatibility mode" in which it gave an error. However,
- JavaScript itself has changed in this respect so there is no longer any
- need for this special handling.
+ case META_CLASS_NOT:
+ case META_CLASS:
+ matched_char = TRUE;
+ negate_class = meta == META_CLASS_NOT;
- In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
- used for "start of word" and "end of word". As these are otherwise illegal
- sequences, we don't break anything by recognizing them. They are replaced
- by \b(?=\w) and \b(?<=\w) respectively. This can only happen at the top
- nesting level, as no other inserted sequences will contains these oddities.
- Sequences like [a[:<:]] are erroneous and are handled by the normal code
- below. */
+ /* We can optimize the case of a single character in a class by generating
+ OP_CHAR or OP_CHARI if it's positive, or OP_NOT or OP_NOTI if it's
+ negative. In the negative case there can be no first char if this item is
+ first, whatever repeat count may follow. In the case of reqcu, save the
+ previous value for reinstating. */
- case CHAR_LEFT_SQUARE_BRACKET:
- if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
- {
- cb->nestptr[0] = ptr + 7;
- ptr = sub_start_of_word;
- goto REDO_LOOP;
- }
+ /* NOTE: at present this optimization is not effective if the only
+ character in a class in 32-bit, non-UCP mode has its top bit set. */
- if (PRIV(strncmp_c8)(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
+ if (pptr[1] < META_END && pptr[2] == META_CLASS_END)
{
- cb->nestptr[0] = ptr + 7;
- ptr = sub_end_of_word;
- goto REDO_LOOP;
- }
+#ifdef SUPPORT_UNICODE
+ uint32_t d;
+#endif
+ uint32_t c = pptr[1];
- /* Handle a real character class. */
+ pptr += 2; /* Move on to class end */
+ if (meta == META_CLASS) /* A positive one-char class can be */
+ { /* handled as a normal literal character. */
+ meta = c; /* Set up the character */
+ goto NORMAL_CHAR_SET;
+ }
- previous = code;
+ /* Handle a negative one-character class */
- /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
- they are encountered at the top level, so we'll do that too. */
-
- if ((ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = (ptr[1] == CHAR_COLON)? ERR12 : ERR13;
- goto FAILED;
- }
+ zeroreqcu = reqcu;
+ zeroreqcuflags = reqcuflags;
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ zerofirstcu = firstcu;
+ zerofirstcuflags = firstcuflags;
- /* If the first character is '^', set the negation flag and skip it. Also,
- if the first few characters (either before or after ^) are \Q\E or \E we
- skip them too. This makes for compatibility with Perl. */
+ /* For caseless UTF mode, check whether this character has more than
+ one other case. If so, generate a special OP_NOTPROP item instead of
+ OP_NOTI. */
- negate_class = FALSE;
- for (;;)
- {
- c = *(++ptr);
- if (c == CHAR_BACKSLASH)
+#ifdef SUPPORT_UNICODE
+ if (utf && (options & PCRE2_CASELESS) != 0 &&
+ (d = UCD_CASESET(c)) != 0)
{
- if (ptr[1] == CHAR_E)
- ptr++;
- else if (PRIV(strncmp_c8)(ptr + 1, STR_Q STR_BACKSLASH STR_E, 3) == 0)
- ptr += 3;
- else
- break;
+ *code++ = OP_NOTPROP;
+ *code++ = PT_CLIST;
+ *code++ = d;
+ break; /* We are finished with this class */
}
- else if (!negate_class && c == CHAR_CIRCUMFLEX_ACCENT)
- negate_class = TRUE;
- else break;
- }
+#endif
+ /* Char has only one other case, or UCP not available */
- /* Empty classes are allowed if PCRE2_ALLOW_EMPTY_CLASS is set. Otherwise,
- an initial ']' is taken as a data character -- the code below handles
- that. When empty classes are allowed, [] must always fail, so generate
- OP_FAIL, whereas [^] must match any character, so generate OP_ALLANY. */
+ *code++ = ((options & PCRE2_CASELESS) != 0)? OP_NOTI: OP_NOT;
+ code += PUTCHAR(c, code);
+ break; /* We are finished with this class */
+ } /* End of 1-char optimization */
- if (c == CHAR_RIGHT_SQUARE_BRACKET &&
- (cb->external_options & PCRE2_ALLOW_EMPTY_CLASS) != 0)
- {
- *code++ = negate_class? OP_ALLANY : OP_FAIL;
- if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
- zerofirstcu = firstcu;
- zerofirstcuflags = firstcuflags;
- break;
- }
+ /* Handle character classes that contain more than just one literal
+ character. */
/* If a non-extended class contains a negative special such as \S, we need
to flip the negation flag at the end, so that support for characters > 255
@@ -4329,13 +5137,11 @@ for (;; ptr++)
#endif
/* For optimization purposes, we track some properties of the class:
- class_has_8bitchar will be non-zero if the class contains at least one 256
- character with a code point less than 256; class_one_char will be 1 if the
- class contains just one character; xclass_has_prop will be TRUE if Unicode
- property checks are present in the class. */
+ class_has_8bitchar will be non-zero if the class contains at least one
+ character with a code point less than 256; xclass_has_prop will be TRUE if
+ Unicode property checks are present in the class. */
class_has_8bitchar = 0;
- class_one_char = 0;
#ifdef SUPPORT_WIDE_CHARS
xclass_has_prop = FALSE;
#endif
@@ -4347,156 +5153,77 @@ for (;; ptr++)
memset(classbits, 0, 32 * sizeof(uint8_t));
- /* Process characters until ] is reached. As the test is at the end of the
- loop, an initial ] is taken as a data character. At the start of the loop,
- c contains the first code unit of the character. If it is zero, check for
- the end of the pattern, to allow binary zero as data. */
+ /* Process items until META_CLASS_END is reached. */
- for(;;)
+ while ((meta = *(++pptr)) != META_CLASS_END)
{
- PCRE2_SPTR oldptr;
-#ifdef EBCDIC
- BOOL range_is_literal = TRUE;
-#endif
-
- if (c == CHAR_NULL && ptr >= cb->end_pattern)
- {
- *errorcodeptr = ERR6; /* Missing terminating ']' */
- goto FAILED;
- }
-
-#ifdef SUPPORT_UNICODE
- if (utf && HAS_EXTRALEN(c))
- { /* Braces are required because the */
- GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
- }
-#endif
+ /* Handle POSIX classes such as [:alpha:] etc. */
- /* Inside \Q...\E everything is literal except \E */
-
- if (inescq)
+ if (meta == META_POSIX || meta == META_POSIX_NEG)
{
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E) /* If we are at \E */
- {
- inescq = FALSE; /* Reset literal state */
- ptr++; /* Skip the 'E' */
- goto CONTINUE_CLASS; /* Carry on with next char */
- }
- goto CHECK_RANGE; /* Could be range if \E follows */
- }
-
- /* Handle POSIX class names. Perl allows a negation extension of the
- form [:^name:]. A square bracket that doesn't match the syntax is
- treated as a literal. We also recognize the POSIX constructions
- [.ch.] and [=ch=] ("collating elements") and fault them, as Perl
- 5.6 and 5.8 do. */
-
- if (c == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) && check_posix_syntax(ptr, &tempptr))
- {
- BOOL local_negate = FALSE;
- int posix_class, taboffset, tabopt;
- register const uint8_t *cbits = cb->cbits;
+ BOOL local_negate = (meta == META_POSIX_NEG);
+ int posix_class = *(++pptr);
+ int taboffset, tabopt;
uint8_t pbits[32];
- if (ptr[1] != CHAR_COLON)
- {
- *errorcodeptr = ERR13;
- goto FAILED;
- }
+ should_flip_negation = local_negate; /* Note negative special */
- ptr += 2;
- if (*ptr == CHAR_CIRCUMFLEX_ACCENT)
- {
- local_negate = TRUE;
- should_flip_negation = TRUE; /* Note negative special */
- ptr++;
- }
-
- posix_class = check_posix_name(ptr, (int)(tempptr - ptr));
- if (posix_class < 0)
- {
- *errorcodeptr = ERR30;
- goto FAILED;
- }
-
- /* If matching is caseless, upper and lower are converted to
- alpha. This relies on the fact that the class table starts with
- alpha, lower, upper as the first 3 entries. */
+ /* If matching is caseless, upper and lower are converted to alpha.
+ This relies on the fact that the class table starts with alpha,
+ lower, upper as the first 3 entries. */
if ((options & PCRE2_CASELESS) != 0 && posix_class <= 2)
posix_class = 0;
/* When PCRE2_UCP is set, some of the POSIX classes are converted to
- different escape sequences that use Unicode properties \p or \P. Others
- that are not available via \p or \P generate XCL_PROP/XCL_NOTPROP
- directly. UCP support is not available unless UTF support is.*/
+ different escape sequences that use Unicode properties \p or \P.
+ Others that are not available via \p or \P have to generate
+ XCL_PROP/XCL_NOTPROP directly, which is done here. */
#ifdef SUPPORT_UNICODE
- if ((options & PCRE2_UCP) != 0)
+ if ((options & PCRE2_UCP) != 0) switch(posix_class)
{
- unsigned int ptype = 0;
- int pc = posix_class + ((local_negate)? POSIX_SUBSIZE/2 : 0);
-
- /* The posix_substitutes table specifies which POSIX classes can be
- converted to \p or \P items. This can only happen at top nestling
- level, as there will never be a POSIX class in a string that is
- substituted for something else. */
-
- if (posix_substitutes[pc] != NULL)
- {
- cb->nestptr[0] = tempptr + 1;
- ptr = posix_substitutes[pc] - 1;
- goto CONTINUE_CLASS;
- }
-
- /* There are three other classes that generate special property calls
- that are recognized only in an XCLASS. */
+ case PC_GRAPH:
+ case PC_PRINT:
+ case PC_PUNCT:
+ *class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP;
+ *class_uchardata++ = (PCRE2_UCHAR)
+ ((posix_class == PC_GRAPH)? PT_PXGRAPH :
+ (posix_class == PC_PRINT)? PT_PXPRINT : PT_PXPUNCT);
+ *class_uchardata++ = 0;
+ xclass_has_prop = TRUE;
+ goto CONTINUE_CLASS;
- else switch(posix_class)
- {
- case PC_GRAPH:
- ptype = PT_PXGRAPH;
- /* Fall through */
- case PC_PRINT:
- if (ptype == 0) ptype = PT_PXPRINT;
- /* Fall through */
- case PC_PUNCT:
- if (ptype == 0) ptype = PT_PXPUNCT;
- *class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP;
- *class_uchardata++ = (PCRE2_UCHAR)ptype;
- *class_uchardata++ = 0;
- xclass_has_prop = TRUE;
- ptr = tempptr + 1;
- goto CONTINUE_CLASS;
-
- /* For the other POSIX classes (ascii, xdigit) we are going to fall
- through to the non-UCP case and build a bit map for characters with
- code points less than 256. However, if we are in a negated POSIX
- class, characters with code points greater than 255 must either all
- match or all not match, depending on whether the whole class is not
- or is negated. For example, for [[:^ascii:]... they must all match,
- whereas for [^[:^xdigit:]... they must not.
-
- In the special case where there are no xclass items, this is
- automatically handled by the use of OP_CLASS or OP_NCLASS, but an
- explicit range is needed for OP_XCLASS. Setting a flag here causes
- the range to be generated later when it is known that OP_XCLASS is
- required. */
+ /* For the other POSIX classes (ascii, xdigit) we are going to
+ fall through to the non-UCP case and build a bit map for
+ characters with code points less than 256. However, if we are in
+ a negated POSIX class, characters with code points greater than
+ 255 must either all match or all not match, depending on whether
+ the whole class is not or is negated. For example, for
+ [[:^ascii:]... they must all match, whereas for [^[:^xdigit:]...
+ they must not.
+
+ In the special case where there are no xclass items, this is
+ automatically handled by the use of OP_CLASS or OP_NCLASS, but an
+ explicit range is needed for OP_XCLASS. Setting a flag here
+ causes the range to be generated later when it is known that
+ OP_XCLASS is required. In the 8-bit library this is relevant only in
+ utf mode, since no wide characters can exist otherwise. */
- default:
- match_all_or_no_wide_chars |= local_negate;
- break;
- }
+ default:
+#if PCRE2_CODE_UNIT_WIDTH == 8
+ if (utf)
+#endif
+ match_all_or_no_wide_chars |= local_negate;
+ break;
}
#endif /* SUPPORT_UNICODE */
/* In the non-UCP case, or when UCP makes no difference, we build the
- bit map for the POSIX class in a chunk of local store because we may be
- adding and subtracting from it, and we don't want to subtract bits that
- may be in the main map already. At the end we or the result into the
- bit map that is being built. */
+ bit map for the POSIX class in a chunk of local store because we may
+ be adding and subtracting from it, and we don't want to subtract bits
+ that may be in the main map already. At the end we or the result into
+ the bit map that is being built. */
posix_class *= 3;
@@ -4513,9 +5240,9 @@ for (;; ptr++)
if (taboffset >= 0)
{
if (tabopt >= 0)
- for (c = 0; c < 32; c++) pbits[c] |= cbits[(int)c + taboffset];
+ for (i = 0; i < 32; i++) pbits[i] |= cbits[(int)i + taboffset];
else
- for (c = 0; c < 32; c++) pbits[c] &= ~cbits[(int)c + taboffset];
+ for (i = 0; i < 32; i++) pbits[i] &= ~cbits[(int)i + taboffset];
}
/* Now see if we need to remove any special characters. An option
@@ -4529,432 +5256,223 @@ for (;; ptr++)
being built and we are done. */
if (local_negate)
- for (c = 0; c < 32; c++) classbits[c] |= ~pbits[c];
+ for (i = 0; i < 32; i++) classbits[i] |= ~pbits[i];
else
- for (c = 0; c < 32; c++) classbits[c] |= pbits[c];
+ for (i = 0; i < 32; i++) classbits[i] |= pbits[i];
- ptr = tempptr + 1;
/* Every class contains at least one < 256 character. */
+
class_has_8bitchar = 1;
- /* Every class contains at least two characters. */
- class_one_char = 2;
- goto CONTINUE_CLASS; /* End of POSIX syntax handling */
+ goto CONTINUE_CLASS; /* End of POSIX handling */
}
- /* Backslash may introduce a single character, or it may introduce one
- of the specials, which just set a flag. The sequence \b is a special
- case. Inside a class (and only there) it is treated as backspace. We
- assume that other escapes have more than one character in them, so
- speculatively set both class_has_8bitchar and class_one_char bigger
- than one. Unrecognized escapes fall through and are faulted. */
+ /* Other than POSIX classes, the only items we should encounter are
+ \d-type escapes and literal characters (possibly as ranges). */
- if (c == CHAR_BACKSLASH)
+ if (meta == META_BIGVALUE)
{
- escape = PRIV(check_escape)(&ptr, cb->end_pattern, &ec, errorcodeptr,
- options, TRUE, cb);
- if (*errorcodeptr != 0) goto FAILED;
- if (escape == 0) /* Escaped single char */
+ meta = *(++pptr);
+ goto CLASS_LITERAL;
+ }
+
+ /* Any other non-literal must be an escape */
+
+ if (meta >= META_END)
+ {
+ if (META_CODE(meta) != META_ESCAPE)
{
- c = ec;
-#ifdef EBCDIC
- range_is_literal = FALSE;
+#ifdef DEBUG_SHOW_PARSED
+ fprintf(stderr, "** Unrecognized parsed pattern item 0x%.8x "
+ "in character class\n", meta);
#endif
+ *errorcodeptr = ERR89; /* Internal error - unrecognized. */
+ return 0;
}
- else if (escape == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
- else if (escape == ESC_N) /* \N is not supported in a class */
- {
- *errorcodeptr = ERR71;
- goto FAILED;
- }
- else if (escape == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- {
- ptr += 2; /* avoid empty string */
- }
- else inescq = TRUE;
- goto CONTINUE_CLASS;
- }
- else if (escape == ESC_E) goto CONTINUE_CLASS; /* Ignore orphan \E */
+ escape = META_DATA(meta);
+
+ /* Every class contains at least one < 256 character. */
- else /* Handle \d-type escapes */
+ class_has_8bitchar++;
+
+ switch(escape)
{
- register const uint8_t *cbits = cb->cbits;
- /* Every class contains at least two < 256 characters. */
- class_has_8bitchar++;
- /* Every class contains at least two characters. */
- class_one_char += 2;
+ case ESC_d:
+ for (i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_digit];
+ break;
- switch (escape)
- {
-#ifdef SUPPORT_UNICODE
- case ESC_du: /* These are the values given for \d etc */
- case ESC_DU: /* when PCRE2_UCP is set. We replace the */
- case ESC_wu: /* escape sequence with an appropriate \p */
- case ESC_WU: /* or \P to test Unicode properties instead */
- case ESC_su: /* of the default ASCII testing. This might be */
- case ESC_SU: /* a 2nd-level nesting for [[:<:]] or [[:>:]]. */
- cb->nestptr[1] = cb->nestptr[0];
- cb->nestptr[0] = ptr;
- ptr = substitutes[escape - ESC_DU] - 1; /* Just before substitute */
- class_has_8bitchar--; /* Undo! */
- break;
-#endif
- case ESC_d:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit];
- break;
+ case ESC_D:
+ should_flip_negation = TRUE;
+ for (i = 0; i < 32; i++) classbits[i] |= ~cbits[i+cbit_digit];
+ break;
- case ESC_D:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit];
- break;
+ case ESC_w:
+ for (i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_word];
+ break;
- case ESC_w:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word];
- break;
+ case ESC_W:
+ should_flip_negation = TRUE;
+ for (i = 0; i < 32; i++) classbits[i] |= ~cbits[i+cbit_word];
+ break;
- case ESC_W:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];
- break;
+ /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl
+ 5.18. Before PCRE 8.34, we had to preserve the VT bit if it was
+ previously set by something earlier in the character class.
+ Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so
+ we could just adjust the appropriate bit. From PCRE 8.34 we no
+ longer treat \s and \S specially. */
- /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl
- 5.18. Before PCRE 8.34, we had to preserve the VT bit if it was
- previously set by something earlier in the character class.
- Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so
- we could just adjust the appropriate bit. From PCRE 8.34 we no
- longer treat \s and \S specially. */
+ case ESC_s:
+ for (i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_space];
+ break;
- case ESC_s:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space];
- break;
+ case ESC_S:
+ should_flip_negation = TRUE;
+ for (i = 0; i < 32; i++) classbits[i] |= ~cbits[i+cbit_space];
+ break;
- case ESC_S:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];
- break;
+ /* When adding the horizontal or vertical space lists to a class, or
+ their complements, disable PCRE2_CASELESS, because it justs wastes
+ time, and in the "not-x" UTF cases can create unwanted duplicates in
+ the XCLASS list (provoked by characters that have more than one other
+ case and by both cases being in the same "not-x" sublist). */
- /* The rest apply in both UCP and non-UCP cases. */
+ case ESC_h:
+ (void)add_list_to_class(classbits, &class_uchardata,
+ options & ~PCRE2_CASELESS, cb, PRIV(hspace_list), NOTACHAR);
+ break;
- case ESC_h:
- (void)add_list_to_class(classbits, &class_uchardata, options, cb,
- PRIV(hspace_list), NOTACHAR);
- break;
+ case ESC_H:
+ (void)add_not_list_to_class(classbits, &class_uchardata,
+ options & ~PCRE2_CASELESS, cb, PRIV(hspace_list));
+ break;
- case ESC_H:
- (void)add_not_list_to_class(classbits, &class_uchardata, options,
- cb, PRIV(hspace_list));
- break;
+ case ESC_v:
+ (void)add_list_to_class(classbits, &class_uchardata,
+ options & ~PCRE2_CASELESS, cb, PRIV(vspace_list), NOTACHAR);
+ break;
- case ESC_v:
- (void)add_list_to_class(classbits, &class_uchardata, options, cb,
- PRIV(vspace_list), NOTACHAR);
- break;
+ case ESC_V:
+ (void)add_not_list_to_class(classbits, &class_uchardata,
+ options & ~PCRE2_CASELESS, cb, PRIV(vspace_list));
+ break;
- case ESC_V:
- (void)add_not_list_to_class(classbits, &class_uchardata, options,
- cb, PRIV(vspace_list));
- break;
+ /* If Unicode is not supported, \P and \p are not allowed and are
+ faulted at parse time, so will never appear here. */
- case ESC_p:
- case ESC_P:
#ifdef SUPPORT_UNICODE
- {
- BOOL negated;
- unsigned int ptype = 0, pdata = 0;
- if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr, cb))
- goto FAILED;
- *class_uchardata++ = ((escape == ESC_p) != negated)?
- XCL_PROP : XCL_NOTPROP;
- *class_uchardata++ = ptype;
- *class_uchardata++ = pdata;
- xclass_has_prop = TRUE;
- class_has_8bitchar--; /* Undo! */
- }
- break;
-#else
- *errorcodeptr = ERR45;
- goto FAILED;
-#endif
- /* Unrecognized escapes are faulted. */
-
- default:
- *errorcodeptr = ERR7;
- goto FAILED;
+ case ESC_p:
+ case ESC_P:
+ {
+ uint32_t ptype = *(++pptr) >> 16;
+ uint32_t pdata = *pptr & 0xffff;
+ *class_uchardata++ = (escape == ESC_p)? XCL_PROP : XCL_NOTPROP;
+ *class_uchardata++ = ptype;
+ *class_uchardata++ = pdata;
+ xclass_has_prop = TRUE;
+ class_has_8bitchar--; /* Undo! */
}
-
- /* Handled \d-type escape */
-
- goto CONTINUE_CLASS;
+ break;
+#endif
}
- /* Control gets here if the escape just defined a single character.
- This is in c and may be greater than 256. */
-
- escape = 0;
- } /* End of backslash handling */
-
- /* A character may be followed by '-' to form a range. However, Perl does
- not permit ']' to be the end of the range. A '-' character at the end is
- treated as a literal. Perl ignores orphaned \E sequences entirely. The
- code for handling \Q and \E is messy. */
-
- CHECK_RANGE:
- while (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- {
- inescq = FALSE;
- ptr += 2;
- }
- oldptr = ptr;
-
- /* Remember if \r or \n were explicitly used */
-
- if (c == CHAR_CR || c == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF;
+ goto CONTINUE_CLASS;
+ } /* End handling \d-type escapes */
- /* Check for range */
+ /* A literal character may be followed by a range meta. At parse time
+ there are checks for out-of-order characters, for ranges where the two
+ characters are equal, and for hyphens that cannot indicate a range. At
+ this point, therefore, no checking is needed. */
- if (!inescq && ptr[1] == CHAR_MINUS)
+ else
{
- uint32_t d;
- ptr += 2;
- while (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_E) ptr += 2;
-
- /* If we hit \Q (not followed by \E) at this point, go into escaped
- mode. */
-
- while (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
- {
- ptr += 2;
- if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_E)
- { ptr += 2; continue; }
- inescq = TRUE;
- break;
- }
+ uint32_t c, d;
- /* Minus (hyphen) at the end of a class is treated as a literal, so put
- back the pointer and jump to handle the character that preceded it. */
-
- if (*ptr == CHAR_NULL || (!inescq && *ptr == CHAR_RIGHT_SQUARE_BRACKET))
- {
- ptr = oldptr;
- goto CLASS_SINGLE_CHARACTER;
- }
+ CLASS_LITERAL:
+ c = d = meta;
- /* Otherwise, we have a potential range; pick up the next character */
+ /* Remember if \r or \n were explicitly used */
-#ifdef SUPPORT_UNICODE
- if (utf)
- { /* Braces are required because the */
- GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */
- }
- else
-#endif
- d = *ptr; /* Not UTF mode */
+ if (c == CHAR_CR || c == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF;
- /* The second part of a range can be a single-character escape
- sequence, but not any of the other escapes. Perl treats a hyphen as a
- literal in such circumstances. However, in Perl's warning mode, a
- warning is given, so PCRE now faults it as it is almost certainly a
- mistake on the user's part. */
+ /* Process a character range */
- if (!inescq)
+ if (pptr[1] == META_RANGE_LITERAL || pptr[1] == META_RANGE_ESCAPED)
{
- if (d == CHAR_BACKSLASH)
- {
- int descape;
- descape = PRIV(check_escape)(&ptr, cb->end_pattern, &d,
- errorcodeptr, options, TRUE, cb);
- if (*errorcodeptr != 0) goto FAILED;
#ifdef EBCDIC
- range_is_literal = FALSE;
+ BOOL range_is_literal = (pptr[1] == META_RANGE_LITERAL);
#endif
- /* 0 means a character was put into d; \b is backspace; any other
- special causes an error. */
-
- if (descape != 0)
- {
- if (descape == ESC_b) d = CHAR_BS; else
- {
- *errorcodeptr = ERR50;
- goto FAILED;
- }
- }
- }
+ pptr += 2;
+ d = *pptr;
+ if (d == META_BIGVALUE) d = *(++pptr);
- /* A hyphen followed by a POSIX class is treated in the same way. */
+ /* Remember an explicit \r or \n, and add the range to the class. */
- else if (d == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = ERR50;
- goto FAILED;
- }
- }
+ if (d == CHAR_CR || d == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF;
- /* Check that the two values are in the correct order. Optimize
- one-character ranges. */
-
- if (d < c)
- {
- *errorcodeptr = ERR8;
- goto FAILED;
- }
- if (d == c) goto CLASS_SINGLE_CHARACTER; /* A few lines below */
-
- /* We have found a character range, so single character optimizations
- cannot be done anymore. Any value greater than 1 indicates that there
- is more than one character. */
-
- class_one_char = 2;
-
- /* Remember an explicit \r or \n, and add the range to the class. */
-
- if (d == CHAR_CR || d == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF;
-
- /* In an EBCDIC environment, Perl treats alphabetic ranges specially
- because there are holes in the encoding, and simply using the range A-Z
- (for example) would include the characters in the holes. This applies
- only to literal ranges; [\xC1-\xE9] is different to [A-Z]. */
+ /* In an EBCDIC environment, Perl treats alphabetic ranges specially
+ because there are holes in the encoding, and simply using the range
+ A-Z (for example) would include the characters in the holes. This
+ applies only to literal ranges; [\xC1-\xE9] is different to [A-Z]. */
#ifdef EBCDIC
- if (range_is_literal &&
- (cb->ctypes[c] & ctype_letter) != 0 &&
- (cb->ctypes[d] & ctype_letter) != 0 &&
- (c <= CHAR_z) == (d <= CHAR_z))
- {
- uint32_t uc = (c <= CHAR_z)? 0 : 64;
- uint32_t C = c - uc;
- uint32_t D = d - uc;
-
- if (C <= CHAR_i)
- {
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cb, C + uc,
- ((D < CHAR_i)? D : CHAR_i) + uc);
- C = CHAR_j;
- }
-
- if (C <= D && C <= CHAR_r)
+ if (range_is_literal &&
+ (cb->ctypes[c] & ctype_letter) != 0 &&
+ (cb->ctypes[d] & ctype_letter) != 0 &&
+ (d <= CHAR_z) == (d <= CHAR_z))
{
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cb, C + uc,
- ((D < CHAR_r)? D : CHAR_r) + uc);
- C = CHAR_s;
- }
+ uint32_t uc = (d <= CHAR_z)? 0 : 64;
+ uint32_t C = d - uc;
+ uint32_t D = d - uc;
- if (C <= D)
- {
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cb, C + uc,
- D + uc);
- }
- }
- else
-#endif
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cb, c, d);
- goto CONTINUE_CLASS; /* Go get the next char in the class */
- }
-
- /* Handle a single character - we can get here for a normal non-escape
- char, or after \ that introduces a single character or for an apparent
- range that isn't. Only the value 1 matters for class_one_char, so don't
- increase it if it is already 2 or more ... just in case there's a class
- with a zillion characters in it. */
-
- CLASS_SINGLE_CHARACTER:
- if (class_one_char < 2) class_one_char++;
-
- /* If class_one_char is 1 and xclass_has_prop is false, we have the first
- single character in the class, and there have been no prior ranges, or
- XCLASS items generated by escapes. If this is the final character in the
- class, we can optimize by turning the item into a 1-character OP_CHAR[I]
- if it's positive, or OP_NOT[I] if it's negative. In the positive case, it
- can cause firstcu to be set. Otherwise, there can be no first char if
- this item is first, whatever repeat count may follow. In the case of
- reqcu, save the previous value for reinstating. */
-
- if (!inescq &&
-#ifdef SUPPORT_UNICODE
- !xclass_has_prop &&
-#endif
- class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- {
- ptr++;
- zeroreqcu = reqcu;
- zeroreqcuflags = reqcuflags;
-
- if (negate_class)
- {
-#ifdef SUPPORT_UNICODE
- int d;
-#endif
- if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
- zerofirstcu = firstcu;
- zerofirstcuflags = firstcuflags;
+ if (C <= CHAR_i)
+ {
+ class_has_8bitchar +=
+ add_to_class(classbits, &class_uchardata, options, cb, C + uc,
+ ((D < CHAR_i)? D : CHAR_i) + uc);
+ C = CHAR_j;
+ }
- /* For caseless UTF mode, check whether this character has more than
- one other case. If so, generate a special OP_NOTPROP item instead of
- OP_NOTI. */
+ if (C <= D && C <= CHAR_r)
+ {
+ class_has_8bitchar +=
+ add_to_class(classbits, &class_uchardata, options, cb, C + uc,
+ ((D < CHAR_r)? D : CHAR_r) + uc);
+ C = CHAR_s;
+ }
-#ifdef SUPPORT_UNICODE
- if (utf && (options & PCRE2_CASELESS) != 0 &&
- (d = UCD_CASESET(c)) != 0)
- {
- *code++ = OP_NOTPROP;
- *code++ = PT_CLIST;
- *code++ = d;
+ if (C <= D)
+ {
+ class_has_8bitchar +=
+ add_to_class(classbits, &class_uchardata, options, cb, C + uc,
+ D + uc);
+ }
}
else
#endif
- /* Char has only one other case, or UCP not available */
+ /* Not an EBCDIC special range */
- {
- *code++ = ((options & PCRE2_CASELESS) != 0)? OP_NOTI: OP_NOT;
- code += PUTCHAR(c, code);
- }
-
- /* We are finished with this character class */
-
- goto END_CLASS;
- }
+ class_has_8bitchar +=
+ add_to_class(classbits, &class_uchardata, options, cb, c, d);
+ goto CONTINUE_CLASS; /* Go get the next char in the class */
+ } /* End of range handling */
- /* For a single, positive character, get the value into mcbuffer, and
- then we can handle this with the normal one-character code. */
- mclength = PUTCHAR(c, mcbuffer);
- goto ONE_CHAR;
- } /* End of 1-char optimization */
+ /* Handle a single character. */
- /* There is more than one character in the class, or an XCLASS item
- has been generated. Add this character to the class. */
-
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cb, c, c);
+ class_has_8bitchar +=
+ add_to_class(classbits, &class_uchardata, options, cb, meta, meta);
+ }
- /* Continue to the next character in the class. Closing square bracket
- not within \Q..\E ends the class. A NULL character terminates a
- nested substitution string, but may be a data character in the main
- pattern (tested at the start of this loop). */
+ /* Continue to the next item in the class. */
CONTINUE_CLASS:
- c = *(++ptr);
- if (c == CHAR_NULL && cb->nestptr[0] != NULL)
- {
- ptr = cb->nestptr[0];
- cb->nestptr[0] = cb->nestptr[1];
- cb->nestptr[1] = NULL;
- c = *(++ptr);
- }
#ifdef SUPPORT_WIDE_CHARS
- /* If any wide characters have been encountered, set xclass = TRUE. Then,
- in the pre-compile phase, accumulate the length of the wide characters
- and reset the pointer. This is so that very large classes that contain a
- zillion wide characters do not overwrite the work space (which is on the
- stack). */
+ /* If any wide characters or Unicode properties have been encountered,
+ set xclass = TRUE. Then, in the pre-compile phase, accumulate the length
+ of the extra data and reset the pointer. This is so that very large
+ classes that contain a zillion wide characters or Unicode property tests
+ do not overwrite the work space (which is on the stack). */
if (class_uchardata > class_uchardata_base)
{
@@ -4966,13 +5484,12 @@ for (;; ptr++)
}
}
#endif
- /* An unescaped ] ends the class */
- if (c == CHAR_RIGHT_SQUARE_BRACKET && !inescq) break;
+ continue; /* Needed to avoid error when not supporting wide chars */
} /* End of main class-processing loop */
- /* If this is the first thing in the branch, there can be no first char
- setting, whatever the repeat count. Any reqcu setting must remain
+ /* If this class is the first thing in the branch, there can be no first
+ char setting, whatever the repeat count. Any reqcu setting must remain
unchanged after any kind of repeat. */
if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
@@ -4993,23 +5510,46 @@ for (;; ptr++)
all wide characters (depending on whether the whole class is or is not
negated). This requirement is indicated by match_all_or_no_wide_chars being
true. We do this by including an explicit range, which works in both cases.
+ This applies only in UTF and 16-bit and 32-bit non-UTF modes, since there
+ cannot be any wide characters in 8-bit non-UTF mode.
+
+ When there *are* properties in a positive UTF-8 or any 16-bit or 32_bit
+ class where \S etc is present without PCRE2_UCP, causing an extended class
+ to be compiled, we make sure that all characters > 255 are included by
+ forcing match_all_or_no_wide_chars to be true.
If, when generating an xclass, there are no characters < 256, we can omit
the bitmap in the actual compiled code. */
-#ifdef SUPPORT_WIDE_CHARS
+#ifdef SUPPORT_WIDE_CHARS /* Defined for 16/32 bits, or 8-bit with Unicode */
+ if (xclass && (
#ifdef SUPPORT_UNICODE
- if (xclass && (xclass_has_prop || !should_flip_negation ||
- (options & PCRE2_UCP) != 0))
-#elif PCRE2_CODE_UNIT_WIDTH != 8
- if (xclass && (xclass_has_prop || !should_flip_negation))
+ (options & PCRE2_UCP) != 0 ||
#endif
+ xclass_has_prop || !should_flip_negation))
{
- if (match_all_or_no_wide_chars)
+ if (match_all_or_no_wide_chars || (
+#if PCRE2_CODE_UNIT_WIDTH == 8
+ utf &&
+#endif
+ should_flip_negation && !negate_class && (options & PCRE2_UCP) == 0))
{
*class_uchardata++ = XCL_RANGE;
- class_uchardata += PRIV(ord2utf)(0x100, class_uchardata);
- class_uchardata += PRIV(ord2utf)(MAX_UTF_CODE_POINT, class_uchardata);
+ if (utf) /* Will always be utf in the 8-bit library */
+ {
+ class_uchardata += PRIV(ord2utf)(0x100, class_uchardata);
+ class_uchardata += PRIV(ord2utf)(MAX_UTF_CODE_POINT, class_uchardata);
+ }
+ else /* Can only happen for the 16-bit & 32-bit libraries */
+ {
+#if PCRE2_CODE_UNIT_WIDTH == 16
+ *class_uchardata++ = 0x100;
+ *class_uchardata++ = 0xffffu;
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+ *class_uchardata++ = 0x100;
+ *class_uchardata++ = 0xffffffffu;
+#endif
+ }
}
*class_uchardata++ = XCL_END; /* Marks the end of extra data */
*code++ = OP_XCLASS;
@@ -5026,7 +5566,7 @@ for (;; ptr++)
memmove(code + (32 / sizeof(PCRE2_UCHAR)), code,
CU2BYTES(class_uchardata - code));
if (negate_class && !xclass_has_prop)
- for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
+ for (i = 0; i < 32; i++) classbits[i] = ~classbits[i];
memcpy(code, classbits, 32);
code = class_uchardata + (32 / sizeof(PCRE2_UCHAR));
}
@@ -5037,7 +5577,7 @@ for (;; ptr++)
PUT(previous, 1, (int)(code - previous));
break; /* End of class handling */
}
-#endif
+#endif /* SUPPORT_WIDE_CHARS */
/* If there are no characters > 255, or they are all to be included or
excluded, set the opcode to OP_CLASS or OP_NCLASS, depending on whether the
@@ -5049,2421 +5589,1705 @@ for (;; ptr++)
if (lengthptr == NULL) /* Save time in the pre-compile phase */
{
if (negate_class)
- for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
+ for (i = 0; i < 32; i++) classbits[i] = ~classbits[i];
memcpy(code, classbits, 32);
}
code += 32 / sizeof(PCRE2_UCHAR);
-
- END_CLASS:
- break;
+ break; /* End of class processing */
/* ===================================================================*/
- /* Various kinds of repeat; '{' is not necessarily a quantifier, but this
- has been tested above. */
+ /* Deal with (*VERB)s. */
- case CHAR_LEFT_CURLY_BRACKET:
- if (!is_quantifier) goto NORMAL_CHAR;
- ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr);
- if (*errorcodeptr != 0) goto FAILED;
- goto REPEAT;
-
- case CHAR_ASTERISK:
- repeat_min = 0;
- repeat_max = -1;
- goto REPEAT;
+ /* Check for open captures before ACCEPT and convert it to ASSERT_ACCEPT if
+ in an assertion. In the first pass, just accumulate the length required;
+ otherwise hitting (*ACCEPT) inside many nested parentheses can cause
+ workspace overflow. Do not set firstcu after *ACCEPT. */
- case CHAR_PLUS:
- repeat_min = 1;
- repeat_max = -1;
- goto REPEAT;
-
- case CHAR_QUESTION_MARK:
- repeat_min = 0;
- repeat_max = 1;
-
- REPEAT:
- if (previous == NULL)
+ case META_ACCEPT:
+ cb->had_accept = TRUE;
+ for (oc = cb->open_caps; oc != NULL; oc = oc->next)
{
- *errorcodeptr = ERR9;
- goto FAILED;
- }
-
- if (repeat_min == 0)
- {
- firstcu = zerofirstcu; /* Adjust for zero repeat */
- firstcuflags = zerofirstcuflags;
- reqcu = zeroreqcu; /* Ditto */
- reqcuflags = zeroreqcuflags;
+ if (lengthptr != NULL)
+ {
+ *lengthptr += CU2BYTES(1) + IMM2_SIZE;
+ }
+ else
+ {
+ *code++ = OP_CLOSE;
+ PUT2INC(code, 0, oc->number);
+ }
}
+ *code++ = (cb->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT;
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ break;
- /* Remember whether this is a variable length repeat */
-
- reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;
-
- op_type = 0; /* Default single-char op codes */
- possessive_quantifier = FALSE; /* Default not possessive quantifier */
+ case META_PRUNE:
+ case META_SKIP:
+ cb->had_pruneorskip = TRUE;
+ /* Fall through */
+ case META_COMMIT:
+ case META_FAIL:
+ *code++ = verbops[(meta - META_MARK) >> 16];
+ break;
- /* Save start of previous item, in case we have to move it up in order to
- insert something before it. */
+ case META_THEN:
+ cb->external_flags |= PCRE2_HASTHEN;
+ *code++ = OP_THEN;
+ break;
- tempcode = previous;
+ /* Handle verbs with arguments. Arguments can be very long, especially in
+ 16- and 32-bit modes, and can overflow the workspace in the first pass.
+ However, the argument length is constrained to be small enough to fit in
+ one code unit. This check happens in parse_regex(). In the first pass,
+ instead of putting the argument into memory, we just update the length
+ counter and set up an empty argument. */
- /* Before checking for a possessive quantifier, we must skip over
- whitespace and comments in extended mode because Perl allows white space at
- this point. */
+ case META_THEN_ARG:
+ cb->external_flags |= PCRE2_HASTHEN;
+ goto VERB_ARG;
- if ((options & PCRE2_EXTENDED) != 0)
+ case META_PRUNE_ARG:
+ case META_SKIP_ARG:
+ cb->had_pruneorskip = TRUE;
+ /* Fall through */
+ case META_MARK:
+ VERB_ARG:
+ *code++ = verbops[(meta - META_MARK) >> 16];
+ /* The length is in characters. */
+ verbarglen = *(++pptr);
+ verbculen = 0;
+ tempcode = code++;
+ for (i = 0; i < (int)verbarglen; i++)
{
- ptr++;
- for (;;)
- {
- while (MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_space) != 0) ptr++;
- if (*ptr != CHAR_NUMBER_SIGN) break;
- ptr++;
- while (ptr < cb->end_pattern)
- {
- if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cb->nllen. */
- ptr += cb->nllen;
- break;
- }
- ptr++;
+ meta = *(++pptr);
#ifdef SUPPORT_UNICODE
- if (utf) FORWARDCHAR(ptr);
+ if (utf) mclength = PRIV(ord2utf)(meta, mcbuffer); else
#endif
- } /* Loop for comment characters */
- } /* Loop for multiple comments */
- ptr--; /* Last code unit of previous character. */
+ {
+ mclength = 1;
+ mcbuffer[0] = meta;
+ }
+ if (lengthptr != NULL) *lengthptr += mclength; else
+ {
+ memcpy(code, mcbuffer, CU2BYTES(mclength));
+ code += mclength;
+ verbculen += mclength;
+ }
}
- /* If the next character is '+', we have a possessive quantifier. This
- implies greediness, whatever the setting of the PCRE2_UNGREEDY option.
- If the next character is '?' this is a minimizing repeat, by default,
- but if PCRE2_UNGREEDY is set, it works the other way round. We change the
- repeat type to the non-default. */
-
- if (ptr[1] == CHAR_PLUS)
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- ptr++;
- }
- else if (ptr[1] == CHAR_QUESTION_MARK)
- {
- repeat_type = greedy_non_default;
- ptr++;
- }
- else repeat_type = greedy_default;
+ *tempcode = verbculen; /* Fill in the code unit length */
+ *code++ = 0; /* Terminating zero */
+ break;
- /* If the repeat is {1} we can ignore it. */
- if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
+ /* ===================================================================*/
+ /* Handle options change. The new setting must be passed back for use in
+ subsequent branches. Reset the greedy defaults and the case value for
+ firstcu and reqcu. */
+
+ case META_OPTIONS:
+ *optionsptr = options = *(++pptr);
+ greedy_default = ((options & PCRE2_UNGREEDY) != 0);
+ greedy_non_default = greedy_default ^ 1;
+ req_caseopt = ((options & PCRE2_CASELESS) != 0)? REQ_CASELESS : 0;
+ break;
- /* If previous was a recursion call, wrap it in atomic brackets so that
- previous becomes the atomic group. All recursions were so wrapped in the
- past, but it no longer happens for non-repeated recursions. In fact, the
- repeated ones could be re-implemented independently so as not to need this,
- but for the moment we rely on the code for repeating groups. */
- if (*previous == OP_RECURSE)
+ /* ===================================================================*/
+ /* Handle conditional subpatterns. The case of (?(Rdigits) is ambiguous
+ because it could be a numerical check on recursion, or a name check on a
+ group's being set. The pre-pass sets up META_COND_RNUMBER as a name so that
+ we can handle it either way. We first try for a name; if not found, process
+ the number. */
+
+ case META_COND_RNUMBER: /* (?(Rdigits) */
+ case META_COND_NAME: /* (?(name) or (?'name') or ?(<name>) */
+ case META_COND_RNAME: /* (?(R&name) - test for recursion */
+ bravalue = OP_COND;
{
- memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE));
- *previous = OP_ONCE;
- PUT(previous, 1, 2 + 2*LINK_SIZE);
- previous[2 + 2*LINK_SIZE] = OP_KET;
- PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE);
- code += 2 + 2 * LINK_SIZE;
- length_prevgroup = 3 + 3*LINK_SIZE;
- }
+ int count, index;
+ PCRE2_SPTR name;
+ named_group *ng = cb->named_groups;
+ uint32_t length = *(++pptr);
- /* Now handle repetition for the different types of item. */
+ GETPLUSOFFSET(offset, pptr);
+ name = cb->start_pattern + offset;
- /* If previous was a character or negated character match, abolish the item
- and generate a repeat item instead. If a char item has a minimum of more
- than one, ensure that it is set in reqcu - it might not be if a sequence
- such as x{3} is the first thing in a branch because the x will have gone
- into firstcu instead. */
+ /* In the first pass, the names generated in the pre-pass are available,
+ but the main name table has not yet been created. Scan the list of names
+ generated in the pre-pass in order to get a number and whether or not
+ this name is duplicated. If it is not duplicated, we can handle it as a
+ numerical group. */
- if (*previous == OP_CHAR || *previous == OP_CHARI
- || *previous == OP_NOT || *previous == OP_NOTI)
- {
- switch (*previous)
+ for (i = 0; i < cb->names_found; i++, ng++)
{
- default: /* Make compiler happy. */
- case OP_CHAR: op_type = OP_STAR - OP_STAR; break;
- case OP_CHARI: op_type = OP_STARI - OP_STAR; break;
- case OP_NOT: op_type = OP_NOTSTAR - OP_STAR; break;
- case OP_NOTI: op_type = OP_NOTSTARI - OP_STAR; break;
+ if (length == ng->length &&
+ PRIV(strncmp)(name, ng->name, length) == 0)
+ {
+ if (!ng->isdup)
+ {
+ code[1+LINK_SIZE] = (meta == META_COND_RNAME)? OP_RREF : OP_CREF;
+ PUT2(code, 2+LINK_SIZE, ng->number);
+ if (ng->number > cb->top_backref) cb->top_backref = ng->number;
+ skipunits = 1+IMM2_SIZE;
+ goto GROUP_PROCESS_NOTE_EMPTY;
+ }
+ break; /* Found a duplicated name */
+ }
}
- /* Deal with UTF characters that take up more than one code unit. It's
- easier to write this out separately than try to macrify it. Use c to
- hold the length of the character in code units, plus UTF_LENGTH to flag
- that it's a length rather than a small character. */
+ /* If the name was not found we have a bad reference, unless we are
+ dealing with R<digits>, which is treated as a recursion test by number.
+ */
-#ifdef MAYBE_UTF_MULTI
- if (utf && NOT_FIRSTCU(code[-1]))
+ if (i >= cb->names_found)
{
- PCRE2_UCHAR *lastchar = code - 1;
- BACKCHAR(lastchar);
- c = (int)(code - lastchar); /* Length of UTF character */
- memcpy(utf_units, lastchar, CU2BYTES(c)); /* Save the char */
- c |= UTF_LENGTH; /* Flag c as a length */
- }
- else
-#endif /* MAYBE_UTF_MULTI */
-
- /* Handle the case of a single charater - either with no UTF support, or
- with UTF disabled, or for a single-code-unit UTF character. */
- {
- c = code[-1];
- if (*previous <= OP_CHARI && repeat_min > 1)
+ groupnumber = 0;
+ if (meta == META_COND_RNUMBER)
{
- reqcu = c;
- reqcuflags = req_caseopt | cb->req_varyopt;
+ for (i = 1; i < (int)length; i++)
+ {
+ groupnumber = groupnumber * 10 + name[i] - CHAR_0;
+ if (groupnumber > MAX_GROUP_NUMBER)
+ {
+ *errorcodeptr = ERR61;
+ cb->erroroffset = offset + i;
+ return 0;
+ }
+ }
}
- }
- goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */
- }
+ if (meta != META_COND_RNUMBER || groupnumber > cb->bracount)
+ {
+ *errorcodeptr = ERR15;
+ cb->erroroffset = offset;
+ return 0;
+ }
- /* If previous was a character type match (\d or similar), abolish it and
- create a suitable repeat item. The code is shared with single-character
- repeats by setting op_type to add a suitable offset into repeat_type. Note
- the the Unicode property types will be present only when SUPPORT_UNICODE is
- defined, but we don't wrap the little bits of code here because it just
- makes it horribly messy. */
+ /* (?Rdigits) treated as a recursion reference by number. A value of
+ zero (which is the result of both (?R) and (?R0)) means "any", and is
+ translated into RREF_ANY (which is 0xffff). */
- else if (*previous < OP_EODN)
- {
- PCRE2_UCHAR *oldcode;
- int prop_type, prop_value;
- op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */
- c = *previous; /* Save previous opcode */
- if (c == OP_PROP || c == OP_NOTPROP)
- {
- prop_type = previous[1];
- prop_value = previous[2];
- }
- else
- {
- /* Come here from just above with a character in c */
- OUTPUT_SINGLE_REPEAT:
- prop_type = prop_value = -1;
+ if (groupnumber == 0) groupnumber = RREF_ANY;
+ code[1+LINK_SIZE] = OP_RREF;
+ PUT2(code, 2+LINK_SIZE, groupnumber);
+ skipunits = 1+IMM2_SIZE;
+ goto GROUP_PROCESS_NOTE_EMPTY;
}
- /* At this point we either have prop_type == prop_value == -1 and either
- a code point or a character type that is not OP_[NOT]PROP in c, or we
- have OP_[NOT]PROP in c and prop_type/prop_value not negative. */
+ /* A duplicated name was found. Note that if an R<digits> name is found
+ (META_COND_RNUMBER), it is a reference test, not a recursion test. */
- oldcode = code; /* Save where we were */
- code = previous; /* Usually overwrite previous item */
+ code[1+LINK_SIZE] = (meta == META_COND_RNAME)? OP_RREF : OP_CREF;
- /* If the maximum is zero then the minimum must also be zero; Perl allows
- this case, so we do too - by simply omitting the item altogether. */
+ /* We have a duplicated name. In the compile pass we have to search the
+ main table in order to get the index and count values. */
- if (repeat_max == 0) goto END_REPEAT;
+ count = 0; /* Values for first pass (avoids compiler warning) */
+ index = 0;
+ if (lengthptr == NULL && !find_dupname_details(name, length, &index,
+ &count, errorcodeptr, cb)) return 0;
- /* Combine the op_type with the repeat_type */
+ /* Add one to the opcode to change CREF/RREF into DNCREF/DNRREF and
+ insert appropriate data values. */
- repeat_type += op_type;
+ code[1+LINK_SIZE]++;
+ skipunits = 1+2*IMM2_SIZE;
+ PUT2(code, 2+LINK_SIZE, index);
+ PUT2(code, 2+LINK_SIZE+IMM2_SIZE, count);
+ }
+ goto GROUP_PROCESS_NOTE_EMPTY;
+
+ /* The DEFINE condition is always false. It's internal groups may never
+ be called, so matched_char must remain false, hence the jump to
+ GROUP_PROCESS rather than GROUP_PROCESS_NOTE_EMPTY. */
+
+ case META_COND_DEFINE:
+ bravalue = OP_COND;
+ GETPLUSOFFSET(offset, pptr);
+ code[1+LINK_SIZE] = OP_DEFINE;
+ skipunits = 1;
+ goto GROUP_PROCESS;
+
+ /* Conditional test of a group's being set. */
+
+ case META_COND_NUMBER:
+ bravalue = OP_COND;
+ GETPLUSOFFSET(offset, pptr);
+ groupnumber = *(++pptr);
+ if (groupnumber > cb->bracount)
+ {
+ *errorcodeptr = ERR15;
+ cb->erroroffset = offset;
+ return 0;
+ }
+ if (groupnumber > cb->top_backref) cb->top_backref = groupnumber;
+ offset -= 2; /* Point at initial ( for too many branches error */
+ code[1+LINK_SIZE] = OP_CREF;
+ skipunits = 1+IMM2_SIZE;
+ PUT2(code, 2+LINK_SIZE, groupnumber);
+ goto GROUP_PROCESS_NOTE_EMPTY;
+
+ /* Test for the PCRE2 version. */
+
+ case META_COND_VERSION:
+ bravalue = OP_COND;
+ if (pptr[1] > 0)
+ code[1+LINK_SIZE] = ((PCRE2_MAJOR > pptr[2]) ||
+ (PCRE2_MAJOR == pptr[2] && PCRE2_MINOR >= pptr[3]))?
+ OP_TRUE : OP_FALSE;
+ else
+ code[1+LINK_SIZE] = (PCRE2_MAJOR == pptr[2] && PCRE2_MINOR == pptr[3])?
+ OP_TRUE : OP_FALSE;
+ skipunits = 1;
+ pptr += 3;
+ goto GROUP_PROCESS_NOTE_EMPTY;
- /* A minimum of zero is handled either as the special case * or ?, or as
- an UPTO, with the maximum given. */
+ /* The condition is an assertion, possibly preceded by a callout. */
- if (repeat_min == 0)
- {
- if (repeat_max == -1) *code++ = OP_STAR + repeat_type;
- else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
+ case META_COND_ASSERT:
+ bravalue = OP_COND;
+ goto GROUP_PROCESS_NOTE_EMPTY;
- /* A repeat minimum of 1 is optimized into some special cases. If the
- maximum is unlimited, we use OP_PLUS. Otherwise, the original item is
- left in place and, if the maximum is greater than 1, we use OP_UPTO with
- one less than the maximum. */
- else if (repeat_min == 1)
- {
- if (repeat_max == -1)
- *code++ = OP_PLUS + repeat_type;
- else
- {
- code = oldcode; /* Leave previous item in place */
- if (repeat_max == 1) goto END_REPEAT;
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max - 1);
- }
- }
+ /* ===================================================================*/
+ /* Handle all kinds of nested bracketed groups. The non-capturing,
+ non-conditional cases are here; others come to GROUP_PROCESS via goto. */
+
+ case META_LOOKAHEAD:
+ bravalue = OP_ASSERT;
+ cb->assert_depth += 1;
+ goto GROUP_PROCESS;
+
+ /* Optimize (?!) to (*FAIL) unless it is quantified - which is a weird
+ thing to do, but Perl allows all assertions to be quantified, and when
+ they contain capturing parentheses there may be a potential use for
+ this feature. Not that that applies to a quantified (?!) but we allow
+ it for uniformity. */
+
+ case META_LOOKAHEADNOT:
+ if (pptr[1] == META_KET &&
+ (pptr[2] < META_ASTERISK || pptr[2] > META_MINMAX_QUERY))
+ {
+ *code++ = OP_FAIL;
+ pptr++;
+ }
+ else
+ {
+ bravalue = OP_ASSERT_NOT;
+ cb->assert_depth += 1;
+ goto GROUP_PROCESS;
+ }
+ break;
- /* The case {n,n} is just an EXACT, while the general case {n,m} is
- handled as an EXACT followed by an UPTO or STAR or QUERY. */
+ case META_LOOKBEHIND:
+ bravalue = OP_ASSERTBACK;
+ cb->assert_depth += 1;
+ goto GROUP_PROCESS;
- else
- {
- *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */
- PUT2INC(code, 0, repeat_min);
+ case META_LOOKBEHINDNOT:
+ bravalue = OP_ASSERTBACK_NOT;
+ cb->assert_depth += 1;
+ goto GROUP_PROCESS;
- /* Unless repeat_max equals repeat_min, fill in the data for EXACT, and
- then generate the second opcode. In UTF mode, multi-code-unit
- characters have their length in c, with the UTF_LENGTH bit as a flag,
- and the code units in utf_units. For a repeated Unicode property match,
- there are two extra values that define the required property, and c
- never has the UTF_LENGTH bit set. */
+ case META_ATOMIC:
+ bravalue = OP_ONCE;
+ goto GROUP_PROCESS_NOTE_EMPTY;
- if (repeat_max != repeat_min)
- {
-#ifdef MAYBE_UTF_MULTI
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_units, CU2BYTES(c & 7));
- code += c & 7;
- }
- else
-#endif /* MAYBE_UTF_MULTI */
- {
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- }
+ case META_NOCAPTURE:
+ bravalue = OP_BRA;
+ /* Fall through */
- /* Now set up the following opcode */
+ /* Process nested bracketed regex. The nesting depth is maintained for the
+ benefit of the stackguard function. The test for too deep nesting is now
+ done in parse_regex(). Assertion and DEFINE groups come to GROUP_PROCESS;
+ others come to GROUP_PROCESS_NOTE_EMPTY, to indicate that we need to take
+ note of whether or not they may match an empty string. */
- if (repeat_max < 0) *code++ = OP_STAR + repeat_type; else
- {
- repeat_max -= repeat_min;
- if (repeat_max == 1)
- {
- *code++ = OP_QUERY + repeat_type;
- }
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
- }
- }
+ GROUP_PROCESS_NOTE_EMPTY:
+ note_group_empty = TRUE;
- /* Fill in the character or character type for the final opcode. */
+ GROUP_PROCESS:
+ cb->parens_depth += 1;
+ *code = bravalue;
+ pptr++;
+ tempcode = code;
+ tempreqvary = cb->req_varyopt; /* Save value before group */
+ length_prevgroup = 0; /* Initialize for pre-compile phase */
-#ifdef MAYBE_UTF_MULTI
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_units, CU2BYTES(c & 7));
- code += c & 7;
- }
- else
-#endif /* MAYBEW_UTF_MULTI */
- {
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- }
- }
+ if ((group_return =
+ compile_regex(
+ options, /* The option state */
+ &tempcode, /* Where to put code (updated) */
+ &pptr, /* Input pointer (updated) */
+ errorcodeptr, /* Where to put an error message */
+ skipunits, /* Skip over bracket number */
+ &subfirstcu, /* For possible first char */
+ &subfirstcuflags,
+ &subreqcu, /* For possible last char */
+ &subreqcuflags,
+ bcptr, /* Current branch chain */
+ cb, /* Compile data block */
+ (lengthptr == NULL)? NULL : /* Actual compile phase */
+ &length_prevgroup /* Pre-compile phase */
+ )) == 0)
+ return 0; /* Error */
- /* If previous was a character class or a back reference, we put the repeat
- stuff after it, but just skip the item if the repeat was {0,0}. */
+ cb->parens_depth -= 1;
- else if (*previous == OP_CLASS || *previous == OP_NCLASS ||
-#ifdef SUPPORT_WIDE_CHARS
- *previous == OP_XCLASS ||
-#endif
- *previous == OP_REF || *previous == OP_REFI ||
- *previous == OP_DNREF || *previous == OP_DNREFI)
- {
- if (repeat_max == 0)
- {
- code = previous;
- goto END_REPEAT;
- }
+ /* If that was a non-conditional significant group (not an assertion, not a
+ DEFINE) that matches at least one character, then the current item matches
+ a character. Conditionals are handled below. */
- if (repeat_min == 0 && repeat_max == -1)
- *code++ = OP_CRSTAR + repeat_type;
- else if (repeat_min == 1 && repeat_max == -1)
- *code++ = OP_CRPLUS + repeat_type;
- else if (repeat_min == 0 && repeat_max == 1)
- *code++ = OP_CRQUERY + repeat_type;
- else
- {
- *code++ = OP_CRRANGE + repeat_type;
- PUT2INC(code, 0, repeat_min);
- if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */
- PUT2INC(code, 0, repeat_max);
- }
- }
+ if (note_group_empty && bravalue != OP_COND && group_return > 0)
+ matched_char = TRUE;
- /* If previous was a bracket group, we may have to replicate it in certain
- cases. Note that at this point we can encounter only the "basic" bracket
- opcodes such as BRA and CBRA, as this is the place where they get converted
- into the more special varieties such as BRAPOS and SBRA. A test for >=
- OP_ASSERT and <= OP_COND includes ASSERT, ASSERT_NOT, ASSERTBACK,
- ASSERTBACK_NOT, ONCE, ONCE_NC, BRA, BRAPOS, CBRA, CBRAPOS, and COND.
- Originally, PCRE did not allow repetition of assertions, but now it does,
- for Perl compatibility. */
+ /* If we've just compiled an assertion, pop the assert depth. */
- else if (*previous >= OP_ASSERT && *previous <= OP_COND)
- {
- register int i;
- int len = (int)(code - previous);
- PCRE2_UCHAR *bralink = NULL;
- PCRE2_UCHAR *brazeroptr = NULL;
+ if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT)
+ cb->assert_depth -= 1;
- /* Repeating a DEFINE group (or any group where the condition is always
- FALSE and there is only one branch) is pointless, but Perl allows the
- syntax, so we just ignore the repeat. */
+ /* At the end of compiling, code is still pointing to the start of the
+ group, while tempcode has been updated to point past the end of the group.
+ The parsed pattern pointer (pptr) is on the closing META_KET.
- if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_FALSE &&
- previous[GET(previous, 1)] != OP_ALT)
- goto END_REPEAT;
+ If this is a conditional bracket, check that there are no more than
+ two branches in the group, or just one if it's a DEFINE group. We do this
+ in the real compile phase, not in the pre-pass, where the whole group may
+ not be available. */
- /* There is no sense in actually repeating assertions. The only potential
- use of repetition is in cases when the assertion is optional. Therefore,
- if the minimum is greater than zero, just ignore the repeat. If the
- maximum is not zero or one, set it to 1. */
+ if (bravalue == OP_COND && lengthptr == NULL)
+ {
+ PCRE2_UCHAR *tc = code;
+ int condcount = 0;
- if (*previous < OP_ONCE) /* Assertion */
- {
- if (repeat_min > 0) goto END_REPEAT;
- if (repeat_max < 0 || repeat_max > 1) repeat_max = 1;
- }
+ do {
+ condcount++;
+ tc += GET(tc,1);
+ }
+ while (*tc != OP_KET);
- /* The case of a zero minimum is special because of the need to stick
- OP_BRAZERO in front of it, and because the group appears once in the
- data, whereas in other cases it appears the minimum number of times. For
- this reason, it is simplest to treat this case separately, as otherwise
- the code gets far too messy. There are several special subcases when the
- minimum is zero. */
+ /* A DEFINE group is never obeyed inline (the "condition" is always
+ false). It must have only one branch. Having checked this, change the
+ opcode to OP_FALSE. */
- if (repeat_min == 0)
+ if (code[LINK_SIZE+1] == OP_DEFINE)
{
- /* If the maximum is also zero, we used to just omit the group from the
- output altogether, like this:
-
- ** if (repeat_max == 0)
- ** {
- ** code = previous;
- ** goto END_REPEAT;
- ** }
-
- However, that fails when a group or a subgroup within it is referenced
- as a subroutine from elsewhere in the pattern, so now we stick in
- OP_SKIPZERO in front of it so that it is skipped on execution. As we
- don't have a list of which groups are referenced, we cannot do this
- selectively.
-
- If the maximum is 1 or unlimited, we just have to stick in the BRAZERO
- and do no more at this point. */
-
- if (repeat_max <= 1) /* Covers 0, 1, and unlimited */
- {
- memmove(previous + 1, previous, CU2BYTES(len));
- code++;
- if (repeat_max == 0)
- {
- *previous++ = OP_SKIPZERO;
- goto END_REPEAT;
- }
- brazeroptr = previous; /* Save for possessive optimizing */
- *previous++ = OP_BRAZERO + repeat_type;
- }
-
- /* If the maximum is greater than 1 and limited, we have to replicate
- in a nested fashion, sticking OP_BRAZERO before each set of brackets.
- The first one has to be handled carefully because it's the original
- copy, which has to be moved up. The remainder can be handled by code
- that is common with the non-zero minimum case below. We have to
- adjust the value or repeat_max, since one less copy is required. */
-
- else
+ if (condcount > 1)
{
- int offset;
- memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len));
- code += 2 + LINK_SIZE;
- *previous++ = OP_BRAZERO + repeat_type;
- *previous++ = OP_BRA;
-
- /* We chain together the bracket offset fields that have to be
- filled in later when the ends of the brackets are reached. */
-
- offset = (bralink == NULL)? 0 : (int)(previous - bralink);
- bralink = previous;
- PUTINC(previous, 0, offset);
+ cb->erroroffset = offset;
+ *errorcodeptr = ERR54;
+ return 0;
}
-
- repeat_max--;
+ code[LINK_SIZE+1] = OP_FALSE;
+ bravalue = OP_DEFINE; /* A flag to suppress char handling below */
}
- /* If the minimum is greater than zero, replicate the group as many
- times as necessary, and adjust the maximum to the number of subsequent
- copies that we need. */
+ /* A "normal" conditional group. If there is just one branch, we must not
+ make use of its firstcu or reqcu, because this is equivalent to an
+ empty second branch. Also, it may match an empty string. If there are two
+ branches, this item must match a character if the group must. */
else
{
- if (repeat_min > 1)
+ if (condcount > 2)
{
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. Do some paranoid checks for
- potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit
- integer type when available, otherwise double. */
-
- if (lengthptr != NULL)
- {
- size_t delta = (repeat_min - 1)*length_prevgroup;
- if ((INT64_OR_DOUBLE)(repeat_min - 1)*
- (INT64_OR_DOUBLE)length_prevgroup >
- (INT64_OR_DOUBLE)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real. If there is a set first byte for
- the group, and we have not yet set a "required byte", set it. */
-
- else
- {
- if (groupsetfirstcu && reqcuflags < 0)
- {
- reqcu = firstcu;
- reqcuflags = firstcuflags;
- }
- for (i = 1; i < repeat_min; i++)
- {
- memcpy(code, previous, CU2BYTES(len));
- code += len;
- }
- }
+ cb->erroroffset = offset;
+ *errorcodeptr = ERR27;
+ return 0;
}
-
- if (repeat_max > 0) repeat_max -= repeat_min;
+ if (condcount == 1) subfirstcuflags = subreqcuflags = REQ_NONE;
+ else if (group_return > 0) matched_char = TRUE;
}
+ }
- /* This code is common to both the zero and non-zero minimum cases. If
- the maximum is limited, it replicates the group in a nested fashion,
- remembering the bracket starts on a stack. In the case of a zero minimum,
- the first one was set up above. In all cases the repeat_max now specifies
- the number of additional copies needed. Again, we must remember to
- replicate entries on the forward reference list. */
+ /* In the pre-compile phase, update the length by the length of the group,
+ less the brackets at either end. Then reduce the compiled code to just a
+ set of non-capturing brackets so that it doesn't use much memory if it is
+ duplicated by a quantifier.*/
- if (repeat_max >= 0)
+ if (lengthptr != NULL)
+ {
+ if (OFLOW_MAX - *lengthptr < length_prevgroup - 2 - 2*LINK_SIZE)
{
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. For each repetition we must add 1
- to the length for BRAZERO and for all but the last repetition we must
- add 2 + 2*LINKSIZE to allow for the nesting that occurs. Do some
- paranoid checks to avoid integer overflow. The INT64_OR_DOUBLE type is
- a 64-bit integer type when available, otherwise double. */
+ *errorcodeptr = ERR20;
+ return 0;
+ }
+ *lengthptr += length_prevgroup - 2 - 2*LINK_SIZE;
+ code++; /* This already contains bravalue */
+ PUTINC(code, 0, 1 + LINK_SIZE);
+ *code++ = OP_KET;
+ PUTINC(code, 0, 1 + LINK_SIZE);
+ break; /* No need to waste time with special character handling */
+ }
- if (lengthptr != NULL && repeat_max > 0)
- {
- size_t delta = repeat_max*(length_prevgroup + 1 + 2 + 2*LINK_SIZE) -
- 2 - 2*LINK_SIZE; /* Last one doesn't nest */
- if ((INT64_OR_DOUBLE)repeat_max *
- (INT64_OR_DOUBLE)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
- > (INT64_OR_DOUBLE)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
+ /* Otherwise update the main code pointer to the end of the group. */
- /* This is compiling for real */
+ code = tempcode;
- else for (i = repeat_max - 1; i >= 0; i--)
- {
- *code++ = OP_BRAZERO + repeat_type;
+ /* For a DEFINE group, required and first character settings are not
+ relevant. */
- /* All but the final copy start a new nesting, maintaining the
- chain of brackets outstanding. */
+ if (bravalue == OP_DEFINE) break;
- if (i != 0)
- {
- int offset;
- *code++ = OP_BRA;
- offset = (bralink == NULL)? 0 : (int)(code - bralink);
- bralink = code;
- PUTINC(code, 0, offset);
- }
+ /* Handle updating of the required and first code units for other types of
+ group. Update for normal brackets of all kinds, and conditions with two
+ branches (see code above). If the bracket is followed by a quantifier with
+ zero repeat, we have to back off. Hence the definition of zeroreqcu and
+ zerofirstcu outside the main loop so that they can be accessed for the back
+ off. */
- memcpy(code, previous, CU2BYTES(len));
- code += len;
- }
+ zeroreqcu = reqcu;
+ zeroreqcuflags = reqcuflags;
+ zerofirstcu = firstcu;
+ zerofirstcuflags = firstcuflags;
+ groupsetfirstcu = FALSE;
- /* Now chain through the pending brackets, and fill in their length
- fields (which are holding the chain links pro tem). */
+ if (bravalue >= OP_ONCE) /* Not an assertion */
+ {
+ /* If we have not yet set a firstcu in this branch, take it from the
+ subpattern, remembering that it was set here so that a repeat of more
+ than one can replicate it as reqcu if necessary. If the subpattern has
+ no firstcu, set "none" for the whole branch. In both cases, a zero
+ repeat forces firstcu to "none". */
- while (bralink != NULL)
+ if (firstcuflags == REQ_UNSET && subfirstcuflags != REQ_UNSET)
+ {
+ if (subfirstcuflags >= 0)
{
- int oldlinkoffset;
- int offset = (int)(code - bralink + 1);
- PCRE2_UCHAR *bra = code - offset;
- oldlinkoffset = GET(bra, 1);
- bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;
- *code++ = OP_KET;
- PUTINC(code, 0, offset);
- PUT(bra, 1, offset);
+ firstcu = subfirstcu;
+ firstcuflags = subfirstcuflags;
+ groupsetfirstcu = TRUE;
}
+ else firstcuflags = REQ_NONE;
+ zerofirstcuflags = REQ_NONE;
}
- /* If the maximum is unlimited, set a repeater in the final copy. For
- ONCE brackets, that's all we need to do. However, possessively repeated
- ONCE brackets can be converted into non-capturing brackets, as the
- behaviour of (?:xx)++ is the same as (?>xx)++ and this saves having to
- deal with possessive ONCEs specially.
-
- Otherwise, when we are doing the actual compile phase, check to see
- whether this group is one that could match an empty string. If so,
- convert the initial operator to the S form (e.g. OP_BRA -> OP_SBRA) so
- that runtime checking can be done. [This check is also applied to ONCE
- groups at runtime, but in a different way.]
-
- Then, if the quantifier was possessive and the bracket is not a
- conditional, we convert the BRA code to the POS form, and the KET code to
- KETRPOS. (It turns out to be convenient at runtime to detect this kind of
- subpattern at both the start and at the end.) The use of special opcodes
- makes it possible to reduce greatly the stack usage in pcre2_match(). If
- the group is preceded by OP_BRAZERO, convert this to OP_BRAPOSZERO.
-
- Then, if the minimum number of matches is 1 or 0, cancel the possessive
- flag so that the default action below, of wrapping everything inside
- atomic brackets, does not happen. When the minimum is greater than 1,
- there will be earlier copies of the group, and so we still have to wrap
- the whole thing. */
+ /* If firstcu was previously set, convert the subpattern's firstcu
+ into reqcu if there wasn't one, using the vary flag that was in
+ existence beforehand. */
- else
+ else if (subfirstcuflags >= 0 && subreqcuflags < 0)
{
- PCRE2_UCHAR *ketcode = code - 1 - LINK_SIZE;
- PCRE2_UCHAR *bracode = ketcode - GET(ketcode, 1);
+ subreqcu = subfirstcu;
+ subreqcuflags = subfirstcuflags | tempreqvary;
+ }
- /* Convert possessive ONCE brackets to non-capturing */
+ /* If the subpattern set a required code unit (or set a first code unit
+ that isn't really the first code unit - see above), set it. */
- if ((*bracode == OP_ONCE || *bracode == OP_ONCE_NC) &&
- possessive_quantifier) *bracode = OP_BRA;
+ if (subreqcuflags >= 0)
+ {
+ reqcu = subreqcu;
+ reqcuflags = subreqcuflags;
+ }
+ }
+
+ /* For a forward assertion, we take the reqcu, if set, provided that the
+ group has also set a firstcu. This can be helpful if the pattern that
+ follows the assertion doesn't set a different char. For example, it's
+ useful for /(?=abcde).+/. We can't set firstcu for an assertion, however
+ because it leads to incorrect effect for patterns such as /(?=a)a.+/ when
+ the "real" "a" would then become a reqcu instead of a firstcu. This is
+ overcome by a scan at the end if there's no firstcu, looking for an
+ asserted first char. A similar effect for patterns like /(?=.*X)X$/ means
+ we must only take the reqcu when the group also set a firstcu. Otherwise,
+ in that example, 'X' ends up set for both. */
+
+ else if (bravalue == OP_ASSERT && subreqcuflags >= 0 &&
+ subfirstcuflags >= 0)
+ {
+ reqcu = subreqcu;
+ reqcuflags = subreqcuflags;
+ }
- /* For non-possessive ONCE brackets, all we need to do is to
- set the KET. */
+ break; /* End of nested group handling */
- if (*bracode == OP_ONCE || *bracode == OP_ONCE_NC)
- *ketcode = OP_KETRMAX + repeat_type;
- /* Handle non-ONCE brackets and possessive ONCEs (which have been
- converted to non-capturing above). */
+ /* ===================================================================*/
+ /* Handle named backreferences and recursions. */
- else
- {
- /* In the compile phase, check whether the group could match an empty
- string. */
+ case META_BACKREF_BYNAME:
+ case META_RECURSE_BYNAME:
+ {
+ int count, index;
+ PCRE2_SPTR name;
+ BOOL is_dupname = FALSE;
+ named_group *ng = cb->named_groups;
+ uint32_t length = *(++pptr);
- if (lengthptr == NULL)
- {
- PCRE2_UCHAR *scode = bracode;
- do
- {
- int count = 0;
- int rc = could_be_empty_branch(scode, ketcode, utf, cb, FALSE,
- NULL, &count);
- if (rc < 0)
- {
- *errorcodeptr = ERR86;
- goto FAILED;
- }
- if (rc > 0)
- {
- *bracode += OP_SBRA - OP_BRA;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
+ GETPLUSOFFSET(offset, pptr);
+ name = cb->start_pattern + offset;
- /* A conditional group with only one branch has an implicit empty
- alternative branch. */
+ /* In the first pass, the names generated in the pre-pass are available,
+ but the main name table has not yet been created. Scan the list of names
+ generated in the pre-pass in order to get a number and whether or not
+ this name is duplicated. */
- if (*bracode == OP_COND && bracode[GET(bracode,1)] != OP_ALT)
- *bracode = OP_SCOND;
- }
+ groupnumber = 0;
+ for (i = 0; i < cb->names_found; i++, ng++)
+ {
+ if (length == ng->length &&
+ PRIV(strncmp)(name, ng->name, length) == 0)
+ {
+ is_dupname = ng->isdup;
+ groupnumber = ng->number;
- /* Handle possessive quantifiers. */
+ /* For a recursion, that's all that is needed. We can now go to
+ the code above that handles numerical recursion, applying it to
+ the first group with the given name. */
- if (possessive_quantifier)
+ if (meta == META_RECURSE_BYNAME)
{
- /* For COND brackets, we wrap the whole thing in a possessively
- repeated non-capturing bracket, because we have not invented POS
- versions of the COND opcodes. */
+ meta_arg = groupnumber;
+ goto HANDLE_NUMERICAL_RECURSION;
+ }
- if (*bracode == OP_COND || *bracode == OP_SCOND)
- {
- int nlen = (int)(code - bracode);
- memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen));
- code += 1 + LINK_SIZE;
- nlen += 1 + LINK_SIZE;
- *bracode = (*bracode == OP_COND)? OP_BRAPOS : OP_SBRAPOS;
- *code++ = OP_KETRPOS;
- PUTINC(code, 0, nlen);
- PUT(bracode, 1, nlen);
- }
+ /* For a back reference, update the back reference map and the
+ maximum back reference. Then, for each group, we must check to
+ see if it is recursive, that is, it is inside the group that it
+ references. A flag is set so that the group can be made atomic.
+ */
- /* For non-COND brackets, we modify the BRA code and use KETRPOS. */
+ cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1;
+ if (groupnumber > cb->top_backref)
+ cb->top_backref = groupnumber;
- else
+ for (oc = cb->open_caps; oc != NULL; oc = oc->next)
+ {
+ if (oc->number == groupnumber)
{
- *bracode += 1; /* Switch to xxxPOS opcodes */
- *ketcode = OP_KETRPOS;
+ oc->flag = TRUE;
+ break;
}
-
- /* If the minimum is zero, mark it as possessive, then unset the
- possessive flag when the minimum is 0 or 1. */
-
- if (brazeroptr != NULL) *brazeroptr = OP_BRAPOSZERO;
- if (repeat_min < 2) possessive_quantifier = FALSE;
}
-
- /* Non-possessive quantifier */
-
- else *ketcode = OP_KETRMAX + repeat_type;
}
}
- }
-
- /* If previous is OP_FAIL, it was generated by an empty class []
- (PCRE2_ALLOW_EMPTY_CLASS is set). The other ways in which OP_FAIL can be
- generated, that is by (*FAIL) or (?!), set previous to NULL, which gives a
- "nothing to repeat" error above. We can just ignore the repeat in empty
- class case. */
- else if (*previous == OP_FAIL) goto END_REPEAT;
+ /* If the name was not found we have a bad reference. */
- /* Else there's some kind of shambles */
-
- else
- {
- *errorcodeptr = ERR10;
- goto FAILED;
- }
-
- /* If the character following a repeat is '+', possessive_quantifier is
- TRUE. For some opcodes, there are special alternative opcodes for this
- case. For anything else, we wrap the entire repeated item inside OP_ONCE
- brackets. Logically, the '+' notation is just syntactic sugar, taken from
- Sun's Java package, but the special opcodes can optimize it.
-
- Some (but not all) possessively repeated subpatterns have already been
- completely handled in the code just above. For them, possessive_quantifier
- is always FALSE at this stage. Note that the repeated item starts at
- tempcode, not at previous, which might be the first part of a string whose
- (former) last char we repeated. */
-
- if (possessive_quantifier)
- {
- int len;
-
- /* Possessifying an EXACT quantifier has no effect, so we can ignore it.
- However, QUERY, STAR, or UPTO may follow (for quantifiers such as {5,6},
- {5,}, or {5,10}). We skip over an EXACT item; if the length of what
- remains is greater than zero, there's a further opcode that can be
- handled. If not, do nothing, leaving the EXACT alone. */
-
- switch(*tempcode)
+ if (groupnumber == 0)
{
- case OP_TYPEEXACT:
- tempcode += PRIV(OP_lengths)[*tempcode] +
- ((tempcode[1 + IMM2_SIZE] == OP_PROP
- || tempcode[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0);
- break;
-
- /* CHAR opcodes are used for exacts whose count is 1. */
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- tempcode += PRIV(OP_lengths)[*tempcode];
-#ifdef SUPPORT_UNICODE
- if (utf && HAS_EXTRALEN(tempcode[-1]))
- tempcode += GET_EXTRALEN(tempcode[-1]);
-#endif
- break;
-
- /* For the class opcodes, the repeat operator appears at the end;
- adjust tempcode to point to it. */
-
- case OP_CLASS:
- case OP_NCLASS:
- tempcode += 1 + 32/sizeof(PCRE2_UCHAR);
- break;
-
-#ifdef SUPPORT_WIDE_CHARS
- case OP_XCLASS:
- tempcode += GET(tempcode, 1);
- break;
-#endif
+ *errorcodeptr = ERR15;
+ cb->erroroffset = offset;
+ return 0;
}
- /* If tempcode is equal to code (which points to the end of the repeated
- item), it means we have skipped an EXACT item but there is no following
- QUERY, STAR, or UPTO; the value of len will be 0, and we do nothing. In
- all other cases, tempcode will be pointing to the repeat opcode, and will
- be less than code, so the value of len will be greater than 0. */
+ /* If a back reference name is not duplicated, we can handle it as
+ a numerical reference. */
- len = (int)(code - tempcode);
- if (len > 0)
+ if (!is_dupname)
{
- unsigned int repcode = *tempcode;
+ meta_arg = groupnumber;
+ goto HANDLE_SINGLE_REFERENCE;
+ }
- /* There is a table for possessifying opcodes, all of which are less
- than OP_CALLOUT. A zero entry means there is no possessified version.
- */
+ /* If a back reference name is duplicated, we generate a different
+ opcode to a numerical back reference. In the second pass we must
+ search for the index and count in the final name table. */
- if (repcode < OP_CALLOUT && opcode_possessify[repcode] > 0)
- *tempcode = opcode_possessify[repcode];
+ count = 0; /* Values for first pass (avoids compiler warning) */
+ index = 0;
+ if (lengthptr == NULL && !find_dupname_details(name, length, &index,
+ &count, errorcodeptr, cb)) return 0;
- /* For opcode without a special possessified version, wrap the item in
- ONCE brackets. */
-
- else
- {
- memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len));
- code += 1 + LINK_SIZE;
- len += 1 + LINK_SIZE;
- tempcode[0] = OP_ONCE;
- *code++ = OP_KET;
- PUTINC(code, 0, len);
- PUT(tempcode, 1, len);
- }
- }
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ *code++ = ((options & PCRE2_CASELESS) != 0)? OP_DNREFI : OP_DNREF;
+ PUT2INC(code, 0, index);
+ PUT2INC(code, 0, count);
}
-
- /* In all case we no longer have a previous item. We also set the
- "follows varying string" flag for subsequently encountered reqcus if
- it isn't already set and we have just passed a varying length item. */
-
- END_REPEAT:
- previous = NULL;
- cb->req_varyopt |= reqvary;
break;
/* ===================================================================*/
- /* Start of nested parenthesized sub-expression, or lookahead or lookbehind
- or option setting or condition or all the other extended parenthesis forms.
- We must save the current high-water-mark for the forward reference list so
- that we know where they start for this group. However, because the list may
- be extended when there are very many forward references (usually the result
- of a replicated inner group), we must use an offset rather than an absolute
- address. Note that (?# comments are dealt with at the top of the loop;
- they do not get this far. */
+ /* Handle a numerical callout. */
+
+ case META_CALLOUT_NUMBER:
+ code[0] = OP_CALLOUT;
+ PUT(code, 1, pptr[1]); /* Offset to next pattern item */
+ PUT(code, 1 + LINK_SIZE, pptr[2]); /* Length of next pattern item */
+ code[1 + 2*LINK_SIZE] = pptr[3];
+ pptr += 3;
+ code += PRIV(OP_lengths)[OP_CALLOUT];
+ break;
- case CHAR_LEFT_PARENTHESIS:
- ptr++;
- /* Deal with various "verbs" that can be introduced by '*'. */
+ /* ===================================================================*/
+ /* Handle a callout with a string argument. In the pre-pass we just compute
+ the length without generating anything. The length in pptr[3] includes both
+ delimiters; in the actual compile only the first one is copied, but a
+ terminating zero is added. Any doubled delimiters within the string make
+ this an overestimate, but it is not worth bothering about. */
- if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
- || (MAX_255(ptr[1]) && ((cb->ctypes[ptr[1]] & ctype_letter) != 0))))
+ case META_CALLOUT_STRING:
+ if (lengthptr != NULL)
{
- int i, namelen;
- int arglen = 0;
- const char *vn = verbnames;
- PCRE2_SPTR name = ptr + 1;
- PCRE2_SPTR arg = NULL;
- previous = NULL;
- ptr++;
-
- /* Increment ptr, set namelen, check length */
-
- READ_NAME(ctype_letter, ERR60, *errorcodeptr);
+ *lengthptr += pptr[3] + (1 + 4*LINK_SIZE);
+ pptr += 3;
+ SKIPOFFSET(pptr);
+ }
- /* It appears that Perl allows any characters whatsoever, other than
- a closing parenthesis, to appear in arguments, so we no longer insist on
- letters, digits, and underscores. Perl does not, however, do any
- interpretation within arguments, and has no means of including a closing
- parenthesis. PCRE supports escape processing but only when it is
- requested by an option. Note that check_escape() will not return values
- greater than the code unit maximum when not in UTF mode. */
+ /* In the real compile we can copy the string. The starting delimiter is
+ included so that the client can discover it if they want. We also pass the
+ start offset to help a script language give better error messages. */
- if (*ptr == CHAR_COLON)
+ else
+ {
+ PCRE2_SPTR pp;
+ uint32_t delimiter;
+ uint32_t length = pptr[3];
+ PCRE2_UCHAR *callout_string = code + (1 + 4*LINK_SIZE);
+
+ code[0] = OP_CALLOUT_STR;
+ PUT(code, 1, pptr[1]); /* Offset to next pattern item */
+ PUT(code, 1 + LINK_SIZE, pptr[2]); /* Length of next pattern item */
+
+ pptr += 3;
+ GETPLUSOFFSET(offset, pptr); /* Offset to string in pattern */
+ pp = cb->start_pattern + offset;
+ delimiter = *callout_string++ = *pp++;
+ if (delimiter == CHAR_LEFT_CURLY_BRACKET)
+ delimiter = CHAR_RIGHT_CURLY_BRACKET;
+ PUT(code, 1 + 3*LINK_SIZE, (int)(offset + 1)); /* One after delimiter */
+
+ /* The syntax of the pattern was checked in the parsing scan. The length
+ includes both delimiters, but we have passed the opening one just above,
+ so we reduce length before testing it. The test is for > 1 because we do
+ not want to copy the final delimiter. This also ensures that pp[1] is
+ accessible. */
+
+ while (--length > 1)
{
- arg = ++ptr;
-
- if ((options & PCRE2_ALT_VERBNAMES) == 0)
- {
- arglen = 0;
- while (ptr < cb->end_pattern && *ptr != CHAR_RIGHT_PARENTHESIS)
- {
- ptr++; /* Check length as we go */
- arglen++; /* along, to avoid the */
- if ((unsigned int)arglen > MAX_MARK) /* possibility of overflow. */
- {
- *errorcodeptr = ERR76;
- goto FAILED;
- }
- }
- }
- else
+ if (*pp == delimiter && pp[1] == delimiter)
{
- /* The length check is in process_verb_names() */
- arglen = process_verb_name(&ptr, NULL, errorcodeptr, options,
- utf, cb);
- if (arglen < 0) goto FAILED;
+ *callout_string++ = delimiter;
+ pp += 2;
+ length--;
}
+ else *callout_string++ = *pp++;
}
+ *callout_string++ = CHAR_NUL;
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR60;
- goto FAILED;
- }
-
- /* Scan the table of verb names */
+ /* Set the length of the entire item, the advance to its end. */
- for (i = 0; i < verbcount; i++)
- {
- if (namelen == verbs[i].len &&
- PRIV(strncmp_c8)(name, vn, namelen) == 0)
- {
- int setverb;
+ PUT(code, 1 + 2*LINK_SIZE, (int)(callout_string - code));
+ code = callout_string;
+ }
+ break;
- /* Check for open captures before ACCEPT and convert it to
- ASSERT_ACCEPT if in an assertion. */
- if (verbs[i].op == OP_ACCEPT)
- {
- open_capitem *oc;
- if (arglen != 0)
- {
- *errorcodeptr = ERR59;
- goto FAILED;
- }
- cb->had_accept = TRUE;
+ /* ===================================================================*/
+ /* Handle repetition. The different types are all sorted out in the parsing
+ pass. */
+
+ case META_MINMAX_PLUS:
+ case META_MINMAX_QUERY:
+ case META_MINMAX:
+ repeat_min = *(++pptr);
+ repeat_max = *(++pptr);
+ goto REPEAT;
- /* In the first pass, just accumulate the length required;
- otherwise hitting (*ACCEPT) inside many nested parentheses can
- cause workspace overflow. */
+ case META_ASTERISK:
+ case META_ASTERISK_PLUS:
+ case META_ASTERISK_QUERY:
+ repeat_min = 0;
+ repeat_max = REPEAT_UNLIMITED;
+ goto REPEAT;
- for (oc = cb->open_caps; oc != NULL; oc = oc->next)
- {
- if (lengthptr != NULL)
- {
- *lengthptr += CU2BYTES(1) + IMM2_SIZE;
- }
- else
- {
- *code++ = OP_CLOSE;
- PUT2INC(code, 0, oc->number);
- }
- }
- setverb = *code++ =
- (cb->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT;
+ case META_PLUS:
+ case META_PLUS_PLUS:
+ case META_PLUS_QUERY:
+ repeat_min = 1;
+ repeat_max = REPEAT_UNLIMITED;
+ goto REPEAT;
- /* Do not set firstcu after *ACCEPT */
- if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
- }
+ case META_QUERY:
+ case META_QUERY_PLUS:
+ case META_QUERY_QUERY:
+ repeat_min = 0;
+ repeat_max = 1;
- /* Handle other cases with/without an argument */
+ REPEAT:
+ if (previous_matched_char && repeat_min > 0) matched_char = TRUE;
- else if (arglen == 0) /* There is no argument */
- {
- if (verbs[i].op < 0) /* Argument is mandatory */
- {
- *errorcodeptr = ERR66;
- goto FAILED;
- }
- setverb = *code++ = verbs[i].op;
- }
+ /* Remember whether this is a variable length repeat, and default to
+ single-char opcodes. */
- else /* An argument is present */
- {
- if (verbs[i].op_arg < 0) /* Argument is forbidden */
- {
- *errorcodeptr = ERR59;
- goto FAILED;
- }
- setverb = *code++ = verbs[i].op_arg;
+ reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;
+ op_type = 0;
- /* Arguments can be very long, especially in 16- and 32-bit modes,
- and can overflow the workspace in the first pass. Instead of
- putting the argument into memory, we just update the length counter
- and set up an empty argument. */
+ /* If the repeat is {1} we can ignore it. */
- if (lengthptr != NULL)
- {
- *lengthptr += arglen;
- *code++ = 0;
- }
- else
- {
- *code++ = arglen;
- if ((options & PCRE2_ALT_VERBNAMES) != 0)
- {
- PCRE2_UCHAR *memcode = code; /* code is "register" */
- (void)process_verb_name(&arg, &memcode, errorcodeptr, options,
- utf, cb);
- code = memcode;
- }
- else /* No argument processing */
- {
- memcpy(code, arg, CU2BYTES(arglen));
- code += arglen;
- }
- }
+ if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
- *code++ = 0;
- }
+ /* Adjust first and required code units for a zero repeat. */
- switch (setverb)
- {
- case OP_THEN:
- case OP_THEN_ARG:
- cb->external_flags |= PCRE2_HASTHEN;
- break;
+ if (repeat_min == 0)
+ {
+ firstcu = zerofirstcu;
+ firstcuflags = zerofirstcuflags;
+ reqcu = zeroreqcu;
+ reqcuflags = zeroreqcuflags;
+ }
- case OP_PRUNE:
- case OP_PRUNE_ARG:
- case OP_SKIP:
- case OP_SKIP_ARG:
- cb->had_pruneorskip = TRUE;
- break;
- }
+ /* Note the greediness and possessiveness. */
- break; /* Found verb, exit loop */
- }
+ switch (meta)
+ {
+ case META_MINMAX_PLUS:
+ case META_ASTERISK_PLUS:
+ case META_PLUS_PLUS:
+ case META_QUERY_PLUS:
+ repeat_type = 0; /* Force greedy */
+ possessive_quantifier = TRUE;
+ break;
- vn += verbs[i].len + 1;
- }
+ case META_MINMAX_QUERY:
+ case META_ASTERISK_QUERY:
+ case META_PLUS_QUERY:
+ case META_QUERY_QUERY:
+ repeat_type = greedy_non_default;
+ possessive_quantifier = FALSE;
+ break;
- if (i < verbcount) continue; /* Successfully handled a verb */
- *errorcodeptr = ERR60; /* Verb not recognized */
- goto FAILED;
+ default:
+ repeat_type = greedy_default;
+ possessive_quantifier = FALSE;
+ break;
}
- /* Initialization for "real" parentheses */
+ /* Save start of previous item, in case we have to move it up in order to
+ insert something before it, and remember what it was. */
- newoptions = options;
- skipunits = 0;
- bravalue = OP_CBRA;
- reset_bracount = FALSE;
+ tempcode = previous;
+ op_previous = *previous;
- /* Deal with the extended parentheses; all are introduced by '?', and the
- appearance of any of them means that this is not a capturing group. */
+ /* Now handle repetition for the different types of item. */
- if (*ptr == CHAR_QUESTION_MARK)
+ switch (op_previous)
{
- int i, count;
- int namelen; /* Must be signed */
- uint32_t index;
- uint32_t set, unset, *optset;
- named_group *ng;
- PCRE2_SPTR name;
- PCRE2_UCHAR *slot;
+ /* If previous was a character or negated character match, abolish the
+ item and generate a repeat item instead. If a char item has a minimum of
+ more than one, ensure that it is set in reqcu - it might not be if a
+ sequence such as x{3} is the first thing in a branch because the x will
+ have gone into firstcu instead. */
- switch (*(++ptr))
+ case OP_CHAR:
+ case OP_CHARI:
+ case OP_NOT:
+ case OP_NOTI:
+ op_type = chartypeoffset[op_previous - OP_CHAR];
+
+ /* Deal with UTF characters that take up more than one code unit. */
+
+#ifdef MAYBE_UTF_MULTI
+ if (utf && NOT_FIRSTCU(code[-1]))
{
- /* ------------------------------------------------------------ */
- case CHAR_VERTICAL_LINE: /* Reset capture count for each branch */
- reset_bracount = TRUE;
- /* Fall through */
-
- /* ------------------------------------------------------------ */
- case CHAR_COLON: /* Non-capturing bracket */
- bravalue = OP_BRA;
- ptr++;
- break;
+ PCRE2_UCHAR *lastchar = code - 1;
+ BACKCHAR(lastchar);
+ mclength = (uint32_t)(code - lastchar); /* Length of UTF character */
+ memcpy(mcbuffer, lastchar, CU2BYTES(mclength)); /* Save the char */
+ }
+ else
+#endif /* MAYBE_UTF_MULTI */
- /* ------------------------------------------------------------ */
- case CHAR_LEFT_PARENTHESIS:
- bravalue = OP_COND; /* Conditional group */
- tempptr = ptr;
+ /* Handle the case of a single code unit - either with no UTF support, or
+ with UTF disabled, or for a single-code-unit UTF character. */
+ {
+ mcbuffer[0] = code[-1];
+ mclength = 1;
+ if (op_previous <= OP_CHARI && repeat_min > 1)
+ {
+ reqcu = mcbuffer[0];
+ reqcuflags = req_caseopt | cb->req_varyopt;
+ }
+ }
+ goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */
- /* A condition can be an assertion, a number (referring to a numbered
- group's having been set), a name (referring to a named group), or 'R',
- referring to recursion. R<digits> and R&name are also permitted for
- recursion tests.
+ /* If previous was a character class or a back reference, we put the
+ repeat stuff after it, but just skip the item if the repeat was {0,0}. */
- There are ways of testing a named group: (?(name)) is used by Python;
- Perl 5.10 onwards uses (?(<name>) or (?('name')).
+#ifdef SUPPORT_WIDE_CHARS
+ case OP_XCLASS:
+#endif
+ case OP_CLASS:
+ case OP_NCLASS:
+ case OP_REF:
+ case OP_REFI:
+ case OP_DNREF:
+ case OP_DNREFI:
- There is one unfortunate ambiguity, caused by history. 'R' can be the
- recursive thing or the name 'R' (and similarly for 'R' followed by
- digits). We look for a name first; if not found, we try the other case.
+ if (repeat_max == 0)
+ {
+ code = previous;
+ goto END_REPEAT;
+ }
- For compatibility with auto-callouts, we allow a callout to be
- specified before a condition that is an assertion. First, check for the
- syntax of a callout; if found, adjust the temporary pointer that is
- used to check for an assertion condition. That's all that is needed! */
+ if (repeat_min == 0 && repeat_max == REPEAT_UNLIMITED)
+ *code++ = OP_CRSTAR + repeat_type;
+ else if (repeat_min == 1 && repeat_max == REPEAT_UNLIMITED)
+ *code++ = OP_CRPLUS + repeat_type;
+ else if (repeat_min == 0 && repeat_max == 1)
+ *code++ = OP_CRQUERY + repeat_type;
+ else
+ {
+ *code++ = OP_CRRANGE + repeat_type;
+ PUT2INC(code, 0, repeat_min);
+ if (repeat_max == REPEAT_UNLIMITED) repeat_max = 0; /* 2-byte encoding for max */
+ PUT2INC(code, 0, repeat_max);
+ }
+ break;
- if (ptr[1] == CHAR_QUESTION_MARK && ptr[2] == CHAR_C)
- {
- if (IS_DIGIT(ptr[3]) || ptr[3] == CHAR_RIGHT_PARENTHESIS)
- {
- for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break;
- if (ptr[i] == CHAR_RIGHT_PARENTHESIS)
- tempptr += i + 1;
- }
- else
- {
- uint32_t delimiter = 0;
- for (i = 0; PRIV(callout_start_delims)[i] != 0; i++)
- {
- if (ptr[3] == PRIV(callout_start_delims)[i])
- {
- delimiter = PRIV(callout_end_delims)[i];
- break;
- }
- }
- if (delimiter != 0)
- {
- for (i = 4; ptr + i < cb->end_pattern; i++)
- {
- if (ptr[i] == delimiter)
- {
- if (ptr[i+1] == delimiter) i++;
- else
- {
- if (ptr[i+1] == CHAR_RIGHT_PARENTHESIS) tempptr += i + 2;
- break;
- }
- }
- }
- }
- }
+ /* If previous is OP_FAIL, it was generated by an empty class []
+ (PCRE2_ALLOW_EMPTY_CLASS is set). The other ways in which OP_FAIL can be
+ generated, that is by (*FAIL) or (?!), disallow a quantifier at parse
+ time. We can just ignore this repeat. */
+
+ case OP_FAIL:
+ goto END_REPEAT;
+
+ /* Prior to 10.30, repeated recursions were wrapped in OP_ONCE brackets
+ because pcre2_match() could not handle backtracking into recursively
+ called groups. Now that this backtracking is available, we no longer need
+ to do this. However, we still need to replicate recursions as we do for
+ groups so as to have independent backtracking points. We can replicate
+ for the minimum number of repeats directly. For optional repeats we now
+ wrap the recursion in OP_BRA brackets and make use of the bracket
+ repetition. */
+
+ case OP_RECURSE:
+
+ /* Generate unwrapped repeats for a non-zero minimum, except when the
+ minimum is 1 and the maximum unlimited, because that can be handled with
+ OP_BRA terminated by OP_KETRMAX/MIN. When the maximum is equal to the
+ minimum, we just need to generate the appropriate additional copies.
+ Otherwise we need to generate one more, to simulate the situation when
+ the minimum is zero. */
+
+ if (repeat_min > 0 && (repeat_min != 1 || repeat_max != REPEAT_UNLIMITED))
+ {
+ int replicate = repeat_min;
+ if (repeat_min == repeat_max) replicate--;
- /* tempptr should now be pointing to the opening parenthesis of the
- assertion condition. */
+ /* In the pre-compile phase, we don't actually do the replication. We
+ just adjust the length as if we had. Do some paranoid checks for
+ potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit
+ integer type when available, otherwise double. */
- if (*tempptr != CHAR_LEFT_PARENTHESIS)
+ if (lengthptr != NULL)
+ {
+ PCRE2_SIZE delta = replicate*(1 + LINK_SIZE);
+ if ((INT64_OR_DOUBLE)replicate*
+ (INT64_OR_DOUBLE)(1 + LINK_SIZE) >
+ (INT64_OR_DOUBLE)INT_MAX ||
+ OFLOW_MAX - *lengthptr < delta)
{
- *errorcodeptr = ERR28;
- goto FAILED;
+ *errorcodeptr = ERR20;
+ return 0;
}
+ *lengthptr += delta;
}
- /* For conditions that are assertions, check the syntax, and then exit
- the switch. This will take control down to where bracketed groups
- are processed. The assertion will be handled as part of the group,
- but we need to identify this case because the conditional assertion may
- not be quantifier. */
-
- if (tempptr[1] == CHAR_QUESTION_MARK &&
- (tempptr[2] == CHAR_EQUALS_SIGN ||
- tempptr[2] == CHAR_EXCLAMATION_MARK ||
- (tempptr[2] == CHAR_LESS_THAN_SIGN &&
- (tempptr[3] == CHAR_EQUALS_SIGN ||
- tempptr[3] == CHAR_EXCLAMATION_MARK))))
+ else for (i = 0; i < replicate; i++)
{
- cb->iscondassert = TRUE;
- break;
+ memcpy(code, previous, CU2BYTES(1 + LINK_SIZE));
+ previous = code;
+ code += 1 + LINK_SIZE;
}
- /* Other conditions use OP_CREF/OP_DNCREF/OP_RREF/OP_DNRREF, and all
- need to skip at least 1+IMM2_SIZE bytes at the start of the group. */
-
- code[1+LINK_SIZE] = OP_CREF;
- skipunits = 1+IMM2_SIZE;
- refsign = -1; /* => not a number */
- namelen = -1; /* => not a name; must set to avoid warning */
- name = NULL; /* Always set to avoid warning */
- recno = 0; /* Always set to avoid warning */
+ /* If the number of repeats is fixed, we are done. Otherwise, adjust
+ the counts and fall through. */
- /* Point at character after (?( */
-
- ptr++;
-
- /* Check for (?(VERSION[>]=n.m), which is a facility whereby indirect
- users of PCRE2 via an application can discover which release of PCRE2
- is being used. */
-
- if (PRIV(strncmp_c8)(ptr, STRING_VERSION, 7) == 0 &&
- ptr[7] != CHAR_RIGHT_PARENTHESIS)
- {
- BOOL ge = FALSE;
- int major = 0;
- int minor = 0;
-
- ptr += 7;
- if (*ptr == CHAR_GREATER_THAN_SIGN)
- {
- ge = TRUE;
- ptr++;
- }
+ if (repeat_min == repeat_max) break;
+ if (repeat_max != REPEAT_UNLIMITED) repeat_max -= repeat_min;
+ repeat_min = 0;
+ }
- /* NOTE: cannot write IS_DIGIT(*(++ptr)) here because IS_DIGIT
- references its argument twice. */
+ /* Wrap the recursion call in OP_BRA brackets. */
- if (*ptr != CHAR_EQUALS_SIGN || (ptr++, !IS_DIGIT(*ptr)))
- {
- *errorcodeptr = ERR79;
- goto FAILED;
- }
+ memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE));
+ op_previous = *previous = OP_BRA;
+ PUT(previous, 1, 2 + 2*LINK_SIZE);
+ previous[2 + 2*LINK_SIZE] = OP_KET;
+ PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE);
+ code += 2 + 2 * LINK_SIZE;
+ length_prevgroup = 3 + 3*LINK_SIZE;
+ group_return = -1; /* Set "may match empty string" */
+
+ /* Now treat as a repeated OP_BRA. */
+ /* Fall through */
+
+ /* If previous was a bracket group, we may have to replicate it in
+ certain cases. Note that at this point we can encounter only the "basic"
+ bracket opcodes such as BRA and CBRA, as this is the place where they get
+ converted into the more special varieties such as BRAPOS and SBRA.
+ Originally, PCRE did not allow repetition of assertions, but now it does,
+ for Perl compatibility. */
+
+ case OP_ASSERT:
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ case OP_ONCE:
+ case OP_BRA:
+ case OP_CBRA:
+ case OP_COND:
+ {
+ int len = (int)(code - previous);
+ PCRE2_UCHAR *bralink = NULL;
+ PCRE2_UCHAR *brazeroptr = NULL;
- while (IS_DIGIT(*ptr)) major = major * 10 + *ptr++ - '0';
- if (*ptr == CHAR_DOT)
- {
- ptr++;
- while (IS_DIGIT(*ptr)) minor = minor * 10 + *ptr++ - '0';
- if (minor < 10) minor *= 10;
- }
+ /* Repeating a DEFINE group (or any group where the condition is always
+ FALSE and there is only one branch) is pointless, but Perl allows the
+ syntax, so we just ignore the repeat. */
- if (*ptr != CHAR_RIGHT_PARENTHESIS || minor > 99)
- {
- *errorcodeptr = ERR79;
- goto FAILED;
- }
+ if (op_previous == OP_COND && previous[LINK_SIZE+1] == OP_FALSE &&
+ previous[GET(previous, 1)] != OP_ALT)
+ goto END_REPEAT;
- if (ge)
- code[1+LINK_SIZE] = ((PCRE2_MAJOR > major) ||
- (PCRE2_MAJOR == major && PCRE2_MINOR >= minor))?
- OP_TRUE : OP_FALSE;
- else
- code[1+LINK_SIZE] = (PCRE2_MAJOR == major && PCRE2_MINOR == minor)?
- OP_TRUE : OP_FALSE;
+ /* There is no sense in actually repeating assertions. The only
+ potential use of repetition is in cases when the assertion is optional.
+ Therefore, if the minimum is greater than zero, just ignore the repeat.
+ If the maximum is not zero or one, set it to 1. */
- ptr++;
- skipunits = 1;
- break; /* End of condition processing */
+ if (op_previous < OP_ONCE) /* Assertion */
+ {
+ if (repeat_min > 0) goto END_REPEAT;
+ if (repeat_max > 1) repeat_max = 1;
}
- /* Check for a test for recursion in a named group. */
+ /* The case of a zero minimum is special because of the need to stick
+ OP_BRAZERO in front of it, and because the group appears once in the
+ data, whereas in other cases it appears the minimum number of times. For
+ this reason, it is simplest to treat this case separately, as otherwise
+ the code gets far too messy. There are several special subcases when the
+ minimum is zero. */
- if (*ptr == CHAR_R && ptr[1] == CHAR_AMPERSAND)
+ if (repeat_min == 0)
{
- terminator = -1;
- ptr += 2;
- code[1+LINK_SIZE] = OP_RREF; /* Change the type of test */
- }
+ /* If the maximum is also zero, we used to just omit the group from
+ the output altogether, like this:
- /* Check for a test for a named group's having been set, using the Perl
- syntax (?(<name>) or (?('name'), and also allow for the original PCRE
- syntax of (?(name) or for (?(+n), (?(-n), and just (?(n). */
+ ** if (repeat_max == 0)
+ ** {
+ ** code = previous;
+ ** goto END_REPEAT;
+ ** }
- else if (*ptr == CHAR_LESS_THAN_SIGN)
- {
- terminator = CHAR_GREATER_THAN_SIGN;
- ptr++;
- }
- else if (*ptr == CHAR_APOSTROPHE)
- {
- terminator = CHAR_APOSTROPHE;
- ptr++;
- }
- else
- {
- terminator = CHAR_NULL;
- if (*ptr == CHAR_MINUS || *ptr == CHAR_PLUS) refsign = *ptr++;
- else if (IS_DIGIT(*ptr)) refsign = 0;
- }
+ However, that fails when a group or a subgroup within it is
+ referenced as a subroutine from elsewhere in the pattern, so now we
+ stick in OP_SKIPZERO in front of it so that it is skipped on
+ execution. As we don't have a list of which groups are referenced, we
+ cannot do this selectively.
- /* Handle a number */
+ If the maximum is 1 or unlimited, we just have to stick in the
+ BRAZERO and do no more at this point. */
- if (refsign >= 0)
- {
- while (IS_DIGIT(*ptr))
+ if (repeat_max <= 1 || repeat_max == REPEAT_UNLIMITED)
{
- if (recno > INT_MAX / 10 - 1) /* Integer overflow */
+ memmove(previous + 1, previous, CU2BYTES(len));
+ code++;
+ if (repeat_max == 0)
{
- while (IS_DIGIT(*ptr)) ptr++;
- *errorcodeptr = ERR61;
- goto FAILED;
+ *previous++ = OP_SKIPZERO;
+ goto END_REPEAT;
}
- recno = recno * 10 + (int)(*ptr - CHAR_0);
- ptr++;
+ brazeroptr = previous; /* Save for possessive optimizing */
+ *previous++ = OP_BRAZERO + repeat_type;
}
- }
- /* Otherwise we expect to read a name; anything else is an error. When
- the referenced name is one of a number of duplicates, a different
- opcode is used and it needs more memory. Unfortunately we cannot tell
- whether this is the case in the first pass, so we have to allow for
- more memory always. In the second pass, the additional to skipunits
- happens later. */
+ /* If the maximum is greater than 1 and limited, we have to replicate
+ in a nested fashion, sticking OP_BRAZERO before each set of brackets.
+ The first one has to be handled carefully because it's the original
+ copy, which has to be moved up. The remainder can be handled by code
+ that is common with the non-zero minimum case below. We have to
+ adjust the value or repeat_max, since one less copy is required. */
- else
- {
- if (IS_DIGIT(*ptr))
+ else
{
- *errorcodeptr = ERR44; /* Group name must start with non-digit */
- goto FAILED;
+ int linkoffset;
+ memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len));
+ code += 2 + LINK_SIZE;
+ *previous++ = OP_BRAZERO + repeat_type;
+ *previous++ = OP_BRA;
+
+ /* We chain together the bracket link offset fields that have to be
+ filled in later when the ends of the brackets are reached. */
+
+ linkoffset = (bralink == NULL)? 0 : (int)(previous - bralink);
+ bralink = previous;
+ PUTINC(previous, 0, linkoffset);
}
- if (!MAX_255(*ptr) || (cb->ctypes[*ptr] & ctype_word) == 0)
- {
- *errorcodeptr = ERR28; /* Assertion expected */
- goto FAILED;
- }
- name = ptr;
- /* Increment ptr, set namelen, check length */
- READ_NAME(ctype_word, ERR48, *errorcodeptr);
- if (lengthptr != NULL) skipunits += IMM2_SIZE;
- }
-
- /* Check the terminator */
- if ((terminator > 0 && *ptr++ != (PCRE2_UCHAR)terminator) ||
- *ptr++ != CHAR_RIGHT_PARENTHESIS)
- {
- ptr--; /* Error offset */
- *errorcodeptr = ERR26; /* Malformed number or name */
- goto FAILED;
+ if (repeat_max != REPEAT_UNLIMITED) repeat_max--;
}
- /* Do no further checking in the pre-compile phase. */
+ /* If the minimum is greater than zero, replicate the group as many
+ times as necessary, and adjust the maximum to the number of subsequent
+ copies that we need. */
- if (lengthptr != NULL) break;
-
- /* In the real compile we do the work of looking for the actual
- reference. If refsign is not negative, it means we have a number in
- recno. */
-
- if (refsign >= 0)
+ else
{
- if (recno <= 0)
- {
- *errorcodeptr = ERR35;
- goto FAILED;
- }
- if (refsign != 0) recno = (refsign == CHAR_MINUS)?
- (cb->bracount + 1) - recno : recno + cb->bracount;
- if (recno <= 0 || (uint32_t)recno > cb->final_bracount)
+ if (repeat_min > 1)
{
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- PUT2(code, 2+LINK_SIZE, recno);
- if ((uint32_t)recno > cb->top_backref) cb->top_backref = recno;
- break;
- }
-
- /* Otherwise look for the name. */
+ /* In the pre-compile phase, we don't actually do the replication.
+ We just adjust the length as if we had. Do some paranoid checks for
+ potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit
+ integer type when available, otherwise double. */
- slot = cb->name_table;
- for (i = 0; i < cb->names_found; i++)
- {
- if (PRIV(strncmp)(name, slot+IMM2_SIZE, namelen) == 0) break;
- slot += cb->name_entry_size;
- }
-
- /* Found the named subpattern. If the name is duplicated, add one to
- the opcode to change CREF/RREF into DNCREF/DNRREF and insert
- appropriate data values. Otherwise, just insert the unique subpattern
- number. */
+ if (lengthptr != NULL)
+ {
+ PCRE2_SIZE delta = (repeat_min - 1)*length_prevgroup;
+ if ((INT64_OR_DOUBLE)(repeat_min - 1)*
+ (INT64_OR_DOUBLE)length_prevgroup >
+ (INT64_OR_DOUBLE)INT_MAX ||
+ OFLOW_MAX - *lengthptr < delta)
+ {
+ *errorcodeptr = ERR20;
+ return 0;
+ }
+ *lengthptr += delta;
+ }
- if (i < cb->names_found)
- {
- int offset = i; /* Offset of first name found */
+ /* This is compiling for real. If there is a set first code unit
+ for the group, and we have not yet set a "required code unit", set
+ it. */
- count = 0;
- for (;;)
- {
- recno = GET2(slot, 0); /* Number for last found */
- if ((uint32_t)recno > cb->top_backref) cb->top_backref = recno;
- count++;
- if (++i >= cb->names_found) break;
- slot += cb->name_entry_size;
- if (PRIV(strncmp)(name, slot+IMM2_SIZE, namelen) != 0 ||
- (slot+IMM2_SIZE)[namelen] != 0) break;
+ else
+ {
+ if (groupsetfirstcu && reqcuflags < 0)
+ {
+ reqcu = firstcu;
+ reqcuflags = firstcuflags;
+ }
+ for (i = 1; (uint32_t)i < repeat_min; i++)
+ {
+ memcpy(code, previous, CU2BYTES(len));
+ code += len;
+ }
+ }
}
- if (count > 1)
- {
- PUT2(code, 2+LINK_SIZE, offset);
- PUT2(code, 2+LINK_SIZE+IMM2_SIZE, count);
- skipunits += IMM2_SIZE;
- code[1+LINK_SIZE]++;
- }
- else /* Not a duplicated name */
- {
- PUT2(code, 2+LINK_SIZE, recno);
- }
+ if (repeat_max != REPEAT_UNLIMITED) repeat_max -= repeat_min;
}
- /* If terminator == CHAR_NULL it means that the name followed directly
- after the opening parenthesis [e.g. (?(abc)...] and in this case there
- are some further alternatives to try. For the cases where terminator !=
- CHAR_NULL [things like (?(<name>... or (?('name')... or (?(R&name)... ]
- we have now checked all the possibilities, so give an error. */
+ /* This code is common to both the zero and non-zero minimum cases. If
+ the maximum is limited, it replicates the group in a nested fashion,
+ remembering the bracket starts on a stack. In the case of a zero
+ minimum, the first one was set up above. In all cases the repeat_max
+ now specifies the number of additional copies needed. Again, we must
+ remember to replicate entries on the forward reference list. */
- else if (terminator != CHAR_NULL)
+ if (repeat_max != REPEAT_UNLIMITED)
{
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* Check for (?(R) for recursion. Allow digits after R to specify a
- specific group number. */
+ /* In the pre-compile phase, we don't actually do the replication. We
+ just adjust the length as if we had. For each repetition we must add
+ 1 to the length for BRAZERO and for all but the last repetition we
+ must add 2 + 2*LINKSIZE to allow for the nesting that occurs. Do some
+ paranoid checks to avoid integer overflow. The INT64_OR_DOUBLE type
+ is a 64-bit integer type when available, otherwise double. */
- else if (*name == CHAR_R)
- {
- recno = 0;
- for (i = 1; i < namelen; i++)
+ if (lengthptr != NULL && repeat_max > 0)
{
- if (!IS_DIGIT(name[i]))
- {
- *errorcodeptr = ERR15; /* Non-existent subpattern */
- goto FAILED;
- }
- if (recno > INT_MAX / 10 - 1) /* Integer overflow */
+ PCRE2_SIZE delta = repeat_max*(length_prevgroup + 1 + 2 + 2*LINK_SIZE) -
+ 2 - 2*LINK_SIZE; /* Last one doesn't nest */
+ if ((INT64_OR_DOUBLE)repeat_max *
+ (INT64_OR_DOUBLE)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
+ > (INT64_OR_DOUBLE)INT_MAX ||
+ OFLOW_MAX - *lengthptr < delta)
{
- *errorcodeptr = ERR61;
- goto FAILED;
+ *errorcodeptr = ERR20;
+ return 0;
}
- recno = recno * 10 + name[i] - CHAR_0;
+ *lengthptr += delta;
}
- if (recno == 0) recno = RREF_ANY;
- code[1+LINK_SIZE] = OP_RREF; /* Change test type */
- PUT2(code, 2+LINK_SIZE, recno);
- }
- /* Similarly, check for the (?(DEFINE) "condition", which is always
- false. During compilation we set OP_DEFINE to distinguish this from
- other OP_FALSE conditions so that it can be checked for having only one
- branch, but after that the opcode is changed to OP_FALSE. */
+ /* This is compiling for real */
- else if (namelen == 6 && PRIV(strncmp_c8)(name, STRING_DEFINE, 6) == 0)
- {
- code[1+LINK_SIZE] = OP_DEFINE;
- skipunits = 1;
- }
+ else for (i = repeat_max - 1; i >= 0; i--)
+ {
+ *code++ = OP_BRAZERO + repeat_type;
- /* Reference to an unidentified subpattern. */
-
- else
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- break;
+ /* All but the final copy start a new nesting, maintaining the
+ chain of brackets outstanding. */
+ if (i != 0)
+ {
+ int linkoffset;
+ *code++ = OP_BRA;
+ linkoffset = (bralink == NULL)? 0 : (int)(code - bralink);
+ bralink = code;
+ PUTINC(code, 0, linkoffset);
+ }
- /* ------------------------------------------------------------ */
- case CHAR_EQUALS_SIGN: /* Positive lookahead */
- bravalue = OP_ASSERT;
- cb->assert_depth += 1;
- ptr++;
- break;
+ memcpy(code, previous, CU2BYTES(len));
+ code += len;
+ }
- /* Optimize (?!) to (*FAIL) unless it is quantified - which is a weird
- thing to do, but Perl allows all assertions to be quantified, and when
- they contain capturing parentheses there may be a potential use for
- this feature. Not that that applies to a quantified (?!) but we allow
- it for uniformity. */
+ /* Now chain through the pending brackets, and fill in their length
+ fields (which are holding the chain links pro tem). */
- /* ------------------------------------------------------------ */
- case CHAR_EXCLAMATION_MARK: /* Negative lookahead */
- ptr++;
- if (*ptr == CHAR_RIGHT_PARENTHESIS && ptr[1] != CHAR_ASTERISK &&
- ptr[1] != CHAR_PLUS && ptr[1] != CHAR_QUESTION_MARK &&
- (ptr[1] != CHAR_LEFT_CURLY_BRACKET || !is_counted_repeat(ptr+2)))
- {
- *code++ = OP_FAIL;
- previous = NULL;
- continue;
+ while (bralink != NULL)
+ {
+ int oldlinkoffset;
+ int linkoffset = (int)(code - bralink + 1);
+ PCRE2_UCHAR *bra = code - linkoffset;
+ oldlinkoffset = GET(bra, 1);
+ bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;
+ *code++ = OP_KET;
+ PUTINC(code, 0, linkoffset);
+ PUT(bra, 1, linkoffset);
+ }
}
- bravalue = OP_ASSERT_NOT;
- cb->assert_depth += 1;
- break;
+ /* If the maximum is unlimited, set a repeater in the final copy. For
+ ONCE brackets, that's all we need to do. However, possessively repeated
+ ONCE brackets can be converted into non-capturing brackets, as the
+ behaviour of (?:xx)++ is the same as (?>xx)++ and this saves having to
+ deal with possessive ONCEs specially.
+
+ Otherwise, when we are doing the actual compile phase, check to see
+ whether this group is one that could match an empty string. If so,
+ convert the initial operator to the S form (e.g. OP_BRA -> OP_SBRA) so
+ that runtime checking can be done. [This check is also applied to ONCE
+ groups at runtime, but in a different way.]
+
+ Then, if the quantifier was possessive and the bracket is not a
+ conditional, we convert the BRA code to the POS form, and the KET code to
+ KETRPOS. (It turns out to be convenient at runtime to detect this kind of
+ subpattern at both the start and at the end.) The use of special opcodes
+ makes it possible to reduce greatly the stack usage in pcre2_match(). If
+ the group is preceded by OP_BRAZERO, convert this to OP_BRAPOSZERO.
+
+ Then, if the minimum number of matches is 1 or 0, cancel the possessive
+ flag so that the default action below, of wrapping everything inside
+ atomic brackets, does not happen. When the minimum is greater than 1,
+ there will be earlier copies of the group, and so we still have to wrap
+ the whole thing. */
- /* ------------------------------------------------------------ */
- case CHAR_LESS_THAN_SIGN: /* Lookbehind or named define */
- switch (ptr[1])
+ else
{
- case CHAR_EQUALS_SIGN: /* Positive lookbehind */
- bravalue = OP_ASSERTBACK;
- cb->assert_depth += 1;
- ptr += 2;
- break;
+ PCRE2_UCHAR *ketcode = code - 1 - LINK_SIZE;
+ PCRE2_UCHAR *bracode = ketcode - GET(ketcode, 1);
- case CHAR_EXCLAMATION_MARK: /* Negative lookbehind */
- bravalue = OP_ASSERTBACK_NOT;
- cb->assert_depth += 1;
- ptr += 2;
- break;
+ /* Convert possessive ONCE brackets to non-capturing */
- /* Must be a name definition - as the syntax was checked in the
- pre-pass, we can assume here that it is valid. Skip over the name
- and go to handle the numbered group. */
-
- default:
- while (*(++ptr) != CHAR_GREATER_THAN_SIGN);
- ptr++;
- goto NUMBERED_GROUP;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_GREATER_THAN_SIGN: /* One-time brackets */
- bravalue = OP_ONCE;
- ptr++;
- break;
+ if (*bracode == OP_ONCE && possessive_quantifier) *bracode = OP_BRA;
+ /* For non-possessive ONCE brackets, all we need to do is to
+ set the KET. */
- /* ------------------------------------------------------------ */
- case CHAR_C: /* Callout */
- previous_callout = code; /* Save for later completion */
- after_manual_callout = 1; /* Skip one item before completing */
- ptr++; /* Character after (?C */
+ if (*bracode == OP_ONCE) *ketcode = OP_KETRMAX + repeat_type;
- /* A callout may have a string argument, delimited by one of a fixed
- number of characters, or an undelimited numerical argument, or no
- argument, which is the same as (?C0). Different opcodes are used for
- the two cases. */
-
- if (*ptr != CHAR_RIGHT_PARENTHESIS && !IS_DIGIT(*ptr))
- {
- uint32_t delimiter = 0;
+ /* Handle non-ONCE brackets and possessive ONCEs (which have been
+ converted to non-capturing above). */
- for (i = 0; PRIV(callout_start_delims)[i] != 0; i++)
+ else
{
- if (*ptr == PRIV(callout_start_delims)[i])
+ /* In the compile phase, adjust the opcode if the group can match
+ an empty string. For a conditional group with only one branch, the
+ value of group_return will not show "could be empty", so we must
+ check that separately. */
+
+ if (lengthptr == NULL)
{
- delimiter = PRIV(callout_end_delims)[i];
- break;
+ if (group_return < 0) *bracode += OP_SBRA - OP_BRA;
+ if (*bracode == OP_COND && bracode[GET(bracode,1)] != OP_ALT)
+ *bracode = OP_SCOND;
}
- }
- if (delimiter == 0)
- {
- *errorcodeptr = ERR82;
- goto FAILED;
- }
+ /* Handle possessive quantifiers. */
- /* During the pre-compile phase, we parse the string and update the
- length. There is no need to generate any code. (In fact, the string
- has already been parsed in the pre-pass that looks for named
- parentheses, but it does no harm to leave this code in.) */
-
- if (lengthptr != NULL) /* Only check the string */
- {
- PCRE2_SPTR start = ptr;
- do
+ if (possessive_quantifier)
{
- if (++ptr >= cb->end_pattern)
+ /* For COND brackets, we wrap the whole thing in a possessively
+ repeated non-capturing bracket, because we have not invented POS
+ versions of the COND opcodes. */
+
+ if (*bracode == OP_COND || *bracode == OP_SCOND)
{
- *errorcodeptr = ERR81;
- ptr = start; /* To give a more useful message */
- goto FAILED;
+ int nlen = (int)(code - bracode);
+ memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen));
+ code += 1 + LINK_SIZE;
+ nlen += 1 + LINK_SIZE;
+ *bracode = (*bracode == OP_COND)? OP_BRAPOS : OP_SBRAPOS;
+ *code++ = OP_KETRPOS;
+ PUTINC(code, 0, nlen);
+ PUT(bracode, 1, nlen);
}
- if (ptr[0] == delimiter && ptr[1] == delimiter) ptr += 2;
- }
- while (ptr[0] != delimiter);
-
- /* Start points to the opening delimiter, ptr points to the
- closing delimiter. We must allow for including the delimiter and
- for the terminating zero. Any doubled delimiters within the string
- make this an overestimate, but it is not worth bothering about. */
-
- (*lengthptr) += (ptr - start) + 2 + (1 + 4*LINK_SIZE);
- }
- /* In the real compile we can copy the string, knowing that it is
- syntactically OK. The starting delimiter is included so that the
- client can discover it if they want. We also pass the start offset to
- help a script language give better error messages. */
+ /* For non-COND brackets, we modify the BRA code and use KETRPOS. */
- else
- {
- PCRE2_UCHAR *callout_string = code + (1 + 4*LINK_SIZE);
- *callout_string++ = *ptr++;
- PUT(code, 1 + 3*LINK_SIZE, (int)(ptr - cb->start_pattern)); /* Start offset */
- for(;;)
- {
- if (*ptr == delimiter)
+ else
{
- if (ptr[1] == delimiter) ptr++; else break;
+ *bracode += 1; /* Switch to xxxPOS opcodes */
+ *ketcode = OP_KETRPOS;
}
- *callout_string++ = *ptr++;
- }
- *callout_string++ = CHAR_NULL;
- code[0] = OP_CALLOUT_STR;
- PUT(code, 1, (int)(ptr + 2 - cb->start_pattern)); /* Next offset */
- PUT(code, 1 + LINK_SIZE, 0); /* Default length */
- PUT(code, 1 + 2*LINK_SIZE, /* Compute size */
- (int)(callout_string - code));
- code = callout_string;
- }
- /* Advance to what should be the closing parenthesis, which is
- checked below. */
+ /* If the minimum is zero, mark it as possessive, then unset the
+ possessive flag when the minimum is 0 or 1. */
- ptr++;
- }
-
- /* Handle a callout with an optional numerical argument, which must be
- less than or equal to 255. A missing argument gives 0. */
-
- else
- {
- int n = 0;
- code[0] = OP_CALLOUT; /* Numerical callout */
- while (IS_DIGIT(*ptr))
- {
- n = n * 10 + *ptr++ - CHAR_0;
- if (n > 255)
- {
- *errorcodeptr = ERR38;
- goto FAILED;
+ if (brazeroptr != NULL) *brazeroptr = OP_BRAPOSZERO;
+ if (repeat_min < 2) possessive_quantifier = FALSE;
}
- }
- PUT(code, 1, (int)(ptr - cb->start_pattern + 1)); /* Next offset */
- PUT(code, 1 + LINK_SIZE, 0); /* Default length */
- code[1 + 2*LINK_SIZE] = n; /* Callout number */
- code += PRIV(OP_lengths)[OP_CALLOUT];
- }
- /* Both formats must have a closing parenthesis */
+ /* Non-possessive quantifier */
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR39;
- goto FAILED;
+ else *ketcode = OP_KETRMAX + repeat_type;
+ }
}
+ }
+ break;
- /* Callouts cannot be quantified. */
+ /* If previous was a character type match (\d or similar), abolish it and
+ create a suitable repeat item. The code is shared with single-character
+ repeats by setting op_type to add a suitable offset into repeat_type.
+ Note the the Unicode property types will be present only when
+ SUPPORT_UNICODE is defined, but we don't wrap the little bits of code
+ here because it just makes it horribly messy. */
- previous = NULL;
- continue;
+ default:
+ if (op_previous >= OP_EODN) /* Not a character type - internal error */
+ {
+ *errorcodeptr = ERR10;
+ return 0;
+ }
+ else
+ {
+ int prop_type, prop_value;
+ PCRE2_UCHAR *oldcode;
+ op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */
+ mclength = 0; /* Not a character */
- /* ------------------------------------------------------------ */
- case CHAR_P: /* Python-style named subpattern handling */
- if (*(++ptr) == CHAR_EQUALS_SIGN ||
- *ptr == CHAR_GREATER_THAN_SIGN) /* Reference or recursion */
+ if (op_previous == OP_PROP || op_previous == OP_NOTPROP)
{
- is_recurse = *ptr == CHAR_GREATER_THAN_SIGN;
- terminator = CHAR_RIGHT_PARENTHESIS;
- goto NAMED_REF_OR_RECURSE;
+ prop_type = previous[1];
+ prop_value = previous[2];
}
- else if (*ptr != CHAR_LESS_THAN_SIGN) /* Test for Python-style defn */
+ else
{
- *errorcodeptr = ERR41;
- goto FAILED;
+ /* Come here from just above with a character in mcbuffer/mclength. */
+ OUTPUT_SINGLE_REPEAT:
+ prop_type = prop_value = -1;
}
- /* Fall through to handle (?P< as (?< is handled */
+ /* At this point, if prop_type == prop_value == -1 we either have a
+ character in mcbuffer when mclength is greater than zero, or we have
+ mclength zero, in which case there is a non-property character type in
+ op_previous. If prop_type/value are not negative, we have a property
+ character type in op_previous. */
- /* ------------------------------------------------------------ */
- case CHAR_APOSTROPHE: /* Define a name - note fall through above */
+ oldcode = code; /* Save where we were */
+ code = previous; /* Usually overwrite previous item */
- /* The syntax was checked and the list of names was set up in the
- pre-pass, so there is nothing to be done now except to skip over the
- name. */
+ /* If the maximum is zero then the minimum must also be zero; Perl allows
+ this case, so we do too - by simply omitting the item altogether. */
- terminator = (*ptr == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
- while (*(++ptr) != (unsigned int)terminator);
- ptr++;
- goto NUMBERED_GROUP; /* Set up numbered group */
+ if (repeat_max == 0) goto END_REPEAT;
+ /* Combine the op_type with the repeat_type */
- /* ------------------------------------------------------------ */
- case CHAR_AMPERSAND: /* Perl recursion/subroutine syntax */
- terminator = CHAR_RIGHT_PARENTHESIS;
- is_recurse = TRUE;
- /* Fall through */
+ repeat_type += op_type;
- /* We come here from the Python syntax above that handles both
- references (?P=name) and recursion (?P>name), as well as falling
- through from the Perl recursion syntax (?&name). We also come here from
- the Perl \k<name> or \k'name' back reference syntax and the \k{name}
- .NET syntax, and the Oniguruma \g<...> and \g'...' subroutine syntax. */
+ /* A minimum of zero is handled either as the special case * or ?, or as
+ an UPTO, with the maximum given. */
- NAMED_REF_OR_RECURSE:
- name = ++ptr;
- if (IS_DIGIT(*ptr))
+ if (repeat_min == 0)
{
- *errorcodeptr = ERR44; /* Group name must start with non-digit */
- goto FAILED;
+ if (repeat_max == REPEAT_UNLIMITED) *code++ = OP_STAR + repeat_type;
+ else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;
+ else
+ {
+ *code++ = OP_UPTO + repeat_type;
+ PUT2INC(code, 0, repeat_max);
+ }
}
- /* Increment ptr, set namelen, check length */
- READ_NAME(ctype_word, ERR48, *errorcodeptr);
- /* In the pre-compile phase, do a syntax check. */
+ /* A repeat minimum of 1 is optimized into some special cases. If the
+ maximum is unlimited, we use OP_PLUS. Otherwise, the original item is
+ left in place and, if the maximum is greater than 1, we use OP_UPTO with
+ one less than the maximum. */
- if (lengthptr != NULL)
+ else if (repeat_min == 1)
{
- if (namelen == 0)
- {
- *errorcodeptr = ERR62;
- goto FAILED;
- }
- if (*ptr != (PCRE2_UCHAR)terminator)
+ if (repeat_max == REPEAT_UNLIMITED)
+ *code++ = OP_PLUS + repeat_type;
+ else
{
- *errorcodeptr = ERR42;
- goto FAILED;
+ code = oldcode; /* Leave previous item in place */
+ if (repeat_max == 1) goto END_REPEAT;
+ *code++ = OP_UPTO + repeat_type;
+ PUT2INC(code, 0, repeat_max - 1);
}
}
- /* Scan the list of names generated in the pre-pass in order to get
- a number and whether or not this name is duplicated. */
+ /* The case {n,n} is just an EXACT, while the general case {n,m} is
+ handled as an EXACT followed by an UPTO or STAR or QUERY. */
- recno = 0;
- is_dupname = FALSE;
- ng = cb->named_groups;
-
- for (i = 0; i < cb->names_found; i++, ng++)
+ else
{
- if (namelen == ng->length &&
- PRIV(strncmp)(name, ng->name, namelen) == 0)
- {
- open_capitem *oc;
- is_dupname = ng->isdup;
- recno = ng->number;
-
- /* For a recursion, that's all that is needed. We can now go to the
- code that handles numerical recursion. */
+ *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */
+ PUT2INC(code, 0, repeat_min);
- if (is_recurse) goto HANDLE_RECURSION;
+ /* Unless repeat_max equals repeat_min, fill in the data for EXACT,
+ and then generate the second opcode. For a repeated Unicode property
+ match, there are two extra values that define the required property,
+ and mclength is set zero to indicate this. */
- /* For a back reference, update the back reference map and the
- maximum back reference. Then for each group we must check to see if
- it is recursive, that is, it is inside the group that it
- references. A flag is set so that the group can be made atomic. */
-
- cb->backref_map |= (recno < 32)? (1u << recno) : 1;
- if ((uint32_t)recno > cb->top_backref) cb->top_backref = recno;
-
- for (oc = cb->open_caps; oc != NULL; oc = oc->next)
+ if (repeat_max != repeat_min)
+ {
+ if (mclength > 0)
{
- if (oc->number == recno)
+ memcpy(code, mcbuffer, CU2BYTES(mclength));
+ code += mclength;
+ }
+ else
+ {
+ *code++ = op_previous;
+ if (prop_type >= 0)
{
- oc->flag = TRUE;
- break;
+ *code++ = prop_type;
+ *code++ = prop_value;
}
}
- }
- }
- /* If the name was not found we have a bad reference. */
+ /* Now set up the following opcode */
- if (recno == 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* If a back reference name is not duplicated, we can handle it as a
- numerical reference. */
-
- if (!is_dupname) goto HANDLE_REFERENCE;
-
- /* If a back reference name is duplicated, we generate a different
- opcode to a numerical back reference. In the second pass we must search
- for the index and count in the final name table. */
-
- count = 0;
- index = 0;
-
- if (lengthptr == NULL)
- {
- slot = cb->name_table;
- for (i = 0; i < cb->names_found; i++)
- {
- if (PRIV(strncmp)(name, slot+IMM2_SIZE, namelen) == 0 &&
- slot[IMM2_SIZE+namelen] == 0)
+ if (repeat_max == REPEAT_UNLIMITED)
+ *code++ = OP_STAR + repeat_type;
+ else
{
- if (count == 0) index = i;
- count++;
+ repeat_max -= repeat_min;
+ if (repeat_max == 1)
+ {
+ *code++ = OP_QUERY + repeat_type;
+ }
+ else
+ {
+ *code++ = OP_UPTO + repeat_type;
+ PUT2INC(code, 0, repeat_max);
+ }
}
- slot += cb->name_entry_size;
- }
-
- if (count == 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
}
}
- if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
- previous = code;
- *code++ = ((options & PCRE2_CASELESS) != 0)? OP_DNREFI : OP_DNREF;
- PUT2INC(code, 0, index);
- PUT2INC(code, 0, count);
- continue; /* End of back ref handling */
+ /* Fill in the character or character type for the final opcode. */
-
- /* ------------------------------------------------------------ */
- case CHAR_R: /* Recursion, same as (?0) */
- recno = 0;
- if (*(++ptr) != CHAR_RIGHT_PARENTHESIS)
+ if (mclength > 0)
{
- *errorcodeptr = ERR29;
- goto FAILED;
+ memcpy(code, mcbuffer, CU2BYTES(mclength));
+ code += mclength;
}
- goto HANDLE_RECURSION;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_MINUS: case CHAR_PLUS: /* Recursion or subroutine */
- case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4:
- case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
+ else
{
- terminator = CHAR_RIGHT_PARENTHESIS;
-
- /* Come here from the \g<...> and \g'...' code (Oniguruma
- compatibility). However, the syntax has been checked to ensure that
- the ... are a (signed) number, so that neither ERR63 nor ERR29 will
- be called on this path, nor with the jump to OTHER_CHAR_AFTER_QUERY
- ever be taken. */
-
- HANDLE_NUMERICAL_RECURSION:
-
- if ((refsign = *ptr) == CHAR_PLUS)
- {
- ptr++;
- if (!IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR63;
- goto FAILED;
- }
- }
- else if (refsign == CHAR_MINUS)
+ *code++ = op_previous;
+ if (prop_type >= 0)
{
- if (!IS_DIGIT(ptr[1]))
- goto OTHER_CHAR_AFTER_QUERY;
- ptr++;
+ *code++ = prop_type;
+ *code++ = prop_value;
}
+ }
+ }
+ break;
+ } /* End of switch on different op_previous values */
- recno = 0;
- while (IS_DIGIT(*ptr))
- {
- if (recno > INT_MAX / 10 - 1) /* Integer overflow */
- {
- while (IS_DIGIT(*ptr)) ptr++;
- *errorcodeptr = ERR61;
- goto FAILED;
- }
- recno = recno * 10 + *ptr++ - CHAR_0;
- }
- if (*ptr != (PCRE2_UCHAR)terminator)
- {
- *errorcodeptr = ERR29;
- goto FAILED;
- }
+ /* If the character following a repeat is '+', possessive_quantifier is
+ TRUE. For some opcodes, there are special alternative opcodes for this
+ case. For anything else, we wrap the entire repeated item inside OP_ONCE
+ brackets. Logically, the '+' notation is just syntactic sugar, taken from
+ Sun's Java package, but the special opcodes can optimize it.
- if (refsign == CHAR_MINUS)
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno = (int)(cb->bracount + 1) - recno;
- if (recno <= 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
- else if (refsign == CHAR_PLUS)
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno += cb->bracount;
- }
+ Some (but not all) possessively repeated subpatterns have already been
+ completely handled in the code just above. For them, possessive_quantifier
+ is always FALSE at this stage. Note that the repeated item starts at
+ tempcode, not at previous, which might be the first part of a string whose
+ (former) last char we repeated. */
- if ((uint32_t)recno > cb->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
+ if (possessive_quantifier)
+ {
+ int len;
- /* Come here from code above that handles a named recursion.
- We insert the number of the called group after OP_RECURSE. At the
- end of compiling the pattern is scanned and these numbers are
- replaced by offsets within the pattern. It is done like this to avoid
- problems with forward references and adjusting offsets when groups
- are duplicated and moved (as discovered in previous implementations).
- Note that a recursion does not have a set first character (relevant
- if it is repeated, because it will then be wrapped with ONCE
- brackets). */
-
- HANDLE_RECURSION:
- previous = code;
- *code = OP_RECURSE;
- PUT(code, 1, recno);
- code += 1 + LINK_SIZE;
- groupsetfirstcu = FALSE;
- cb->had_recurse = TRUE;
- }
+ /* Possessifying an EXACT quantifier has no effect, so we can ignore it.
+ However, QUERY, STAR, or UPTO may follow (for quantifiers such as {5,6},
+ {5,}, or {5,10}). We skip over an EXACT item; if the length of what
+ remains is greater than zero, there's a further opcode that can be
+ handled. If not, do nothing, leaving the EXACT alone. */
- /* Can't determine a first byte now */
+ switch(*tempcode)
+ {
+ case OP_TYPEEXACT:
+ tempcode += PRIV(OP_lengths)[*tempcode] +
+ ((tempcode[1 + IMM2_SIZE] == OP_PROP
+ || tempcode[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0);
+ break;
- if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
- continue;
+ /* CHAR opcodes are used for exacts whose count is 1. */
+ case OP_CHAR:
+ case OP_CHARI:
+ case OP_NOT:
+ case OP_NOTI:
+ case OP_EXACT:
+ case OP_EXACTI:
+ case OP_NOTEXACT:
+ case OP_NOTEXACTI:
+ tempcode += PRIV(OP_lengths)[*tempcode];
+#ifdef SUPPORT_UNICODE
+ if (utf && HAS_EXTRALEN(tempcode[-1]))
+ tempcode += GET_EXTRALEN(tempcode[-1]);
+#endif
+ break;
- /* ------------------------------------------------------------ */
- default: /* Other characters: check option setting */
- OTHER_CHAR_AFTER_QUERY:
- set = unset = 0;
- optset = &set;
+ /* For the class opcodes, the repeat operator appears at the end;
+ adjust tempcode to point to it. */
- while (*ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_COLON)
- {
- switch (*ptr++)
- {
- case CHAR_MINUS: optset = &unset; break;
+ case OP_CLASS:
+ case OP_NCLASS:
+ tempcode += 1 + 32/sizeof(PCRE2_UCHAR);
+ break;
- case CHAR_J: /* Record that it changed in the external options */
- *optset |= PCRE2_DUPNAMES;
- cb->external_flags |= PCRE2_JCHANGED;
- break;
+#ifdef SUPPORT_WIDE_CHARS
+ case OP_XCLASS:
+ tempcode += GET(tempcode, 1);
+ break;
+#endif
+ }
- case CHAR_i: *optset |= PCRE2_CASELESS; break;
- case CHAR_m: *optset |= PCRE2_MULTILINE; break;
- case CHAR_s: *optset |= PCRE2_DOTALL; break;
- case CHAR_x: *optset |= PCRE2_EXTENDED; break;
- case CHAR_U: *optset |= PCRE2_UNGREEDY; break;
+ /* If tempcode is equal to code (which points to the end of the repeated
+ item), it means we have skipped an EXACT item but there is no following
+ QUERY, STAR, or UPTO; the value of len will be 0, and we do nothing. In
+ all other cases, tempcode will be pointing to the repeat opcode, and will
+ be less than code, so the value of len will be greater than 0. */
- default: *errorcodeptr = ERR11;
- ptr--; /* Correct the offset */
- goto FAILED;
- }
- }
+ len = (int)(code - tempcode);
+ if (len > 0)
+ {
+ unsigned int repcode = *tempcode;
- /* Set up the changed option bits, but don't change anything yet. */
+ /* There is a table for possessifying opcodes, all of which are less
+ than OP_CALLOUT. A zero entry means there is no possessified version.
+ */
- newoptions = (options | set) & (~unset);
+ if (repcode < OP_CALLOUT && opcode_possessify[repcode] > 0)
+ *tempcode = opcode_possessify[repcode];
- /* If the options ended with ')' this is not the start of a nested
- group with option changes, so the options change at this level. They
- must also be passed back for use in subsequent branches. Reset the
- greedy defaults and the case value for firstcu and reqcu. */
+ /* For opcode without a special possessified version, wrap the item in
+ ONCE brackets. */
- if (*ptr == CHAR_RIGHT_PARENTHESIS)
+ else
{
- *optionsptr = options = newoptions;
- greedy_default = ((newoptions & PCRE2_UNGREEDY) != 0);
- greedy_non_default = greedy_default ^ 1;
- req_caseopt = ((newoptions & PCRE2_CASELESS) != 0)? REQ_CASELESS:0;
- previous = NULL; /* This item can't be repeated */
- continue; /* It is complete */
+ memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len));
+ code += 1 + LINK_SIZE;
+ len += 1 + LINK_SIZE;
+ tempcode[0] = OP_ONCE;
+ *code++ = OP_KET;
+ PUTINC(code, 0, len);
+ PUT(tempcode, 1, len);
}
+ }
+ }
- /* If the options ended with ':' we are heading into a nested group
- with possible change of options. Such groups are non-capturing and are
- not assertions of any kind. All we need to do is skip over the ':';
- the newoptions value is handled below. */
-
- bravalue = OP_BRA;
- ptr++;
- } /* End of switch for character following (? */
- } /* End of (? handling */
+ /* We set the "follows varying string" flag for subsequently encountered
+ reqcus if it isn't already set and we have just passed a varying length
+ item. */
- /* Opening parenthesis not followed by '*' or '?'. If PCRE2_NO_AUTO_CAPTURE
- is set, all unadorned brackets become non-capturing and behave like (?:...)
- brackets. */
+ END_REPEAT:
+ cb->req_varyopt |= reqvary;
+ break;
- else if ((options & PCRE2_NO_AUTO_CAPTURE) != 0)
- {
- bravalue = OP_BRA;
- }
- /* Else we have a capturing group. */
+ /* ===================================================================*/
+ /* Handle a 32-bit data character with a value greater than META_END. */
- else
- {
- NUMBERED_GROUP:
- cb->bracount += 1;
- PUT2(code, 1+LINK_SIZE, cb->bracount);
- skipunits = IMM2_SIZE;
- }
+ case META_BIGVALUE:
+ pptr++;
+ goto NORMAL_CHAR;
- /* Process nested bracketed regex. First check for parentheses nested too
- deeply. */
- if ((cb->parens_depth += 1) > (int)(cb->cx->parens_nest_limit))
- {
- *errorcodeptr = ERR19;
- goto FAILED;
- }
+ /* ===============================================================*/
+ /* Handle a back reference by number, which is the meta argument. The
+ pattern offsets for back references to group numbers less than 10 are held
+ in a special vector, to avoid using more than two parsed pattern elements
+ in 64-bit environments. We only need the offset to the first occurrence,
+ because if that doesn't fail, subsequent ones will also be OK. */
- /* All assertions used not to be repeatable, but this was changed for Perl
- compatibility. All kinds can now be repeated except for assertions that are
- conditions (Perl also forbids these to be repeated). We copy code into a
- non-register variable (tempcode) in order to be able to pass its address
- because some compilers complain otherwise. At the start of a conditional
- group whose condition is an assertion, cb->iscondassert is set. We unset it
- here so as to allow assertions later in the group to be quantified. */
+ case META_BACKREF:
+ if (meta_arg < 10) offset = cb->small_ref_offset[meta_arg];
+ else GETPLUSOFFSET(offset, pptr);
- if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT &&
- cb->iscondassert)
- {
- previous = NULL;
- cb->iscondassert = FALSE;
- }
- else
+ if (meta_arg > cb->bracount)
{
- previous = code;
+ cb->erroroffset = offset;
+ *errorcodeptr = ERR15; /* Non-existent subpattern */
+ return 0;
}
- *code = bravalue;
- tempcode = code;
- tempreqvary = cb->req_varyopt; /* Save value before bracket */
- tempbracount = cb->bracount; /* Save value before bracket */
- length_prevgroup = 0; /* Initialize for pre-compile phase */
-
- if (!compile_regex(
- newoptions, /* The complete new option state */
- &tempcode, /* Where to put code (updated) */
- &ptr, /* Input pointer (updated) */
- errorcodeptr, /* Where to put an error message */
- (bravalue == OP_ASSERTBACK ||
- bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */
- reset_bracount, /* True if (?| group */
- skipunits, /* Skip over bracket number */
- cond_depth +
- ((bravalue == OP_COND)?1:0), /* Depth of condition subpatterns */
- &subfirstcu, /* For possible first char */
- &subfirstcuflags,
- &subreqcu, /* For possible last char */
- &subreqcuflags,
- bcptr, /* Current branch chain */
- cb, /* Compile data block */
- (lengthptr == NULL)? NULL : /* Actual compile phase */
- &length_prevgroup /* Pre-compile phase */
- ))
- goto FAILED;
-
- cb->parens_depth -= 1;
-
- /* If this was an atomic group and there are no capturing groups within it,
- generate OP_ONCE_NC instead of OP_ONCE. */
+ /* Come here from named backref handling when the reference is to a
+ single group (that is, not to a duplicated name). The back reference
+ data will have already been updated. We must disable firstcu if not
+ set, to cope with cases like (?=(\w+))\1: which would otherwise set ':'
+ later. */
- if (bravalue == OP_ONCE && cb->bracount <= tempbracount)
- *code = OP_ONCE_NC;
+ HANDLE_SINGLE_REFERENCE:
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ *code++ = ((options & PCRE2_CASELESS) != 0)? OP_REFI : OP_REF;
+ PUT2INC(code, 0, meta_arg);
- if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT)
- cb->assert_depth -= 1;
+ /* Update the map of back references, and keep the highest one. We
+ could do this in parse_regex() for numerical back references, but not
+ for named back references, because we don't know the numbers to which
+ named back references refer. So we do it all in this function. */
- /* At the end of compiling, code is still pointing to the start of the
- group, while tempcode has been updated to point past the end of the group.
- The pattern pointer (ptr) is on the bracket.
+ cb->backref_map |= (meta_arg < 32)? (1u << meta_arg) : 1;
+ if (meta_arg > cb->top_backref) cb->top_backref = meta_arg;
- If this is a conditional bracket, check that there are no more than
- two branches in the group, or just one if it's a DEFINE group. We do this
- in the real compile phase, not in the pre-pass, where the whole group may
- not be available. */
+ /* Check to see if this back reference is recursive, that it, it
+ is inside the group that it references. A flag is set so that the
+ group can be made atomic. */
- if (bravalue == OP_COND && lengthptr == NULL)
+ for (oc = cb->open_caps; oc != NULL; oc = oc->next)
{
- PCRE2_UCHAR *tc = code;
- int condcount = 0;
-
- do {
- condcount++;
- tc += GET(tc,1);
- }
- while (*tc != OP_KET);
-
- /* A DEFINE group is never obeyed inline (the "condition" is always
- false). It must have only one branch. Having checked this, change the
- opcode to OP_FALSE. */
-
- if (code[LINK_SIZE+1] == OP_DEFINE)
+ if (oc->number == meta_arg)
{
- if (condcount > 1)
- {
- *errorcodeptr = ERR54;
- goto FAILED;
- }
- code[LINK_SIZE+1] = OP_FALSE;
- bravalue = OP_DEFINE; /* Just a flag to suppress char handling below */
- }
-
- /* A "normal" conditional group. If there is just one branch, we must not
- make use of its firstcu or reqcu, because this is equivalent to an
- empty second branch. */
-
- else
- {
- if (condcount > 2)
- {
- *errorcodeptr = ERR27;
- goto FAILED;
- }
- if (condcount == 1) subfirstcuflags = subreqcuflags = REQ_NONE;
+ oc->flag = TRUE;
+ break;
}
}
+ break;
- /* At the end of a group, it's an error if we hit end of pattern or
- any non-closing parenthesis. This check also happens in the pre-scan,
- so should not trigger here, but leave this code as an insurance. */
-
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR14;
- goto FAILED;
- }
- /* In the pre-compile phase, update the length by the length of the group,
- less the brackets at either end. Then reduce the compiled code to just a
- set of non-capturing brackets so that it doesn't use much memory if it is
- duplicated by a quantifier.*/
+ /* ===============================================================*/
+ /* Handle recursion by inserting the number of the called group (which is
+ the meta argument) after OP_RECURSE. At the end of compiling the pattern is
+ scanned and these numbers are replaced by offsets within the pattern. It is
+ done like this to avoid problems with forward references and adjusting
+ offsets when groups are duplicated and moved (as discovered in previous
+ implementations). Note that a recursion does not have a set first character
+ (relevant if it is repeated, because it will then be wrapped with ONCE
+ brackets). */
- if (lengthptr != NULL)
+ case META_RECURSE:
+ GETPLUSOFFSET(offset, pptr);
+ if (meta_arg > cb->bracount)
{
- if (OFLOW_MAX - *lengthptr < length_prevgroup - 2 - 2*LINK_SIZE)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += length_prevgroup - 2 - 2*LINK_SIZE;
- code++; /* This already contains bravalue */
- PUTINC(code, 0, 1 + LINK_SIZE);
- *code++ = OP_KET;
- PUTINC(code, 0, 1 + LINK_SIZE);
- break; /* No need to waste time with special character handling */
+ cb->erroroffset = offset;
+ *errorcodeptr = ERR15; /* Non-existent subpattern */
+ return 0;
}
-
- /* Otherwise update the main code pointer to the end of the group. */
-
- code = tempcode;
-
- /* For a DEFINE group, required and first character settings are not
- relevant. */
-
- if (bravalue == OP_DEFINE) break;
-
- /* Handle updating of the required and first characters for other types of
- group. Update for normal brackets of all kinds, and conditions with two
- branches (see code above). If the bracket is followed by a quantifier with
- zero repeat, we have to back off. Hence the definition of zeroreqcu and
- zerofirstcu outside the main loop so that they can be accessed for the
- back off. */
-
- zeroreqcu = reqcu;
- zeroreqcuflags = reqcuflags;
- zerofirstcu = firstcu;
- zerofirstcuflags = firstcuflags;
+ HANDLE_NUMERICAL_RECURSION:
+ *code = OP_RECURSE;
+ PUT(code, 1, meta_arg);
+ code += 1 + LINK_SIZE;
groupsetfirstcu = FALSE;
+ cb->had_recurse = TRUE;
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ break;
- if (bravalue >= OP_ONCE)
- {
- /* If we have not yet set a firstcu in this branch, take it from the
- subpattern, remembering that it was set here so that a repeat of more
- than one can replicate it as reqcu if necessary. If the subpattern has
- no firstcu, set "none" for the whole branch. In both cases, a zero
- repeat forces firstcu to "none". */
-
- if (firstcuflags == REQ_UNSET && subfirstcuflags != REQ_UNSET)
- {
- if (subfirstcuflags >= 0)
- {
- firstcu = subfirstcu;
- firstcuflags = subfirstcuflags;
- groupsetfirstcu = TRUE;
- }
- else firstcuflags = REQ_NONE;
- zerofirstcuflags = REQ_NONE;
- }
-
- /* If firstcu was previously set, convert the subpattern's firstcu
- into reqcu if there wasn't one, using the vary flag that was in
- existence beforehand. */
-
- else if (subfirstcuflags >= 0 && subreqcuflags < 0)
- {
- subreqcu = subfirstcu;
- subreqcuflags = subfirstcuflags | tempreqvary;
- }
-
- /* If the subpattern set a required byte (or set a first byte that isn't
- really the first byte - see above), set it. */
- if (subreqcuflags >= 0)
- {
- reqcu = subreqcu;
- reqcuflags = subreqcuflags;
- }
- }
+ /* ===============================================================*/
+ /* Handle capturing parentheses; the number is the meta argument. */
- /* For a forward assertion, we take the reqcu, if set. This can be
- helpful if the pattern that follows the assertion doesn't set a different
- char. For example, it's useful for /(?=abcde).+/. We can't set firstcu
- for an assertion, however because it leads to incorrect effect for patterns
- such as /(?=a)a.+/ when the "real" "a" would then become a reqcu instead
- of a firstcu. This is overcome by a scan at the end if there's no
- firstcu, looking for an asserted first char. */
+ case META_CAPTURE:
+ bravalue = OP_CBRA;
+ skipunits = IMM2_SIZE;
+ PUT2(code, 1+LINK_SIZE, meta_arg);
+ cb->lastcapture = meta_arg;
+ goto GROUP_PROCESS_NOTE_EMPTY;
- else if (bravalue == OP_ASSERT && subreqcuflags >= 0)
- {
- reqcu = subreqcu;
- reqcuflags = subreqcuflags;
- }
- break; /* End of processing '(' */
+ /* ===============================================================*/
+ /* Handle escape sequence items. For ones like \d, the ESC_values are
+ arranged to be the same as the corresponding OP_values in the default case
+ when PCRE2_UCP is not set (which is the only case in which they will appear
+ here).
- /* ===================================================================*/
- /* Handle metasequences introduced by \. For ones like \d, the ESC_ values
- are arranged to be the negation of the corresponding OP_values in the
- default case when PCRE2_UCP is not set. For the back references, the values
- are negative the reference number. Only back references and those types
- that consume a character may be repeated. We can test for values between
- ESC_b and ESC_Z for the latter; this may have to change if any new ones are
- ever created.
+ Note: \Q and \E are never seen here, as they were dealt with in
+ parse_pattern(). Neither are numerical back references or recursions, which
+ were turned into META_BACKREF or META_RECURSE items, respectively. \k and
+ \g, when followed by names, are turned into META_BACKREF_BYNAME or
+ META_RECURSE_BYNAME. */
- Note: \Q and \E are handled at the start of the character-processing loop,
- not here. */
+ case META_ESCAPE:
- case CHAR_BACKSLASH:
- tempptr = ptr;
- escape = PRIV(check_escape)(&ptr, cb->end_pattern, &ec, errorcodeptr,
- options, FALSE, cb);
- if (*errorcodeptr != 0) goto FAILED;
+ /* We can test for escape sequences that consume a character because their
+ values lie between ESC_b and ESC_Z; this may have to change if any new ones
+ are ever created. For these sequences, we disable the setting of a first
+ character if it hasn't already been set. */
- if (escape == 0) /* The escape coded a single character */
- c = ec;
- else
+ if (meta_arg > ESC_b && meta_arg < ESC_Z)
{
- /* For metasequences that actually match a character, we disable the
- setting of a first character if it hasn't already been set. */
-
- if (firstcuflags == REQ_UNSET && escape > ESC_b && escape < ESC_Z)
- firstcuflags = REQ_NONE;
-
- /* Set values to reset to if this is followed by a zero repeat. */
-
- zerofirstcu = firstcu;
- zerofirstcuflags = firstcuflags;
- zeroreqcu = reqcu;
- zeroreqcuflags = reqcuflags;
-
- /* \g<name> or \g'name' is a subroutine call by name and \g<n> or \g'n'
- is a subroutine call by number (Oniguruma syntax). In fact, the value
- ESC_g is returned only for these cases. So we don't need to check for <
- or ' if the value is ESC_g. For the Perl syntax \g{n} the value is
- -n, and for the Perl syntax \g{name} the result is ESC_k (as
- that is a synonym for a named back reference). */
-
- if (escape == ESC_g)
- {
- PCRE2_SPTR p;
- uint32_t cf;
-
- terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
-
- /* These two statements stop the compiler for warning about possibly
- unset variables caused by the jump to HANDLE_NUMERICAL_RECURSION. In
- fact, because we do the check for a number below, the paths that
- would actually be in error are never taken. */
-
- skipunits = 0;
- reset_bracount = FALSE;
-
- /* If it's not a signed or unsigned number, treat it as a name. */
-
- cf = ptr[1];
- if (cf != CHAR_PLUS && cf != CHAR_MINUS && !IS_DIGIT(cf))
- {
- is_recurse = TRUE;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Signed or unsigned number (cf = ptr[1]) is known to be plus or minus
- or a digit. */
-
- p = ptr + 2;
- while (IS_DIGIT(*p)) p++;
- if (*p != (PCRE2_UCHAR)terminator)
- {
- *errorcodeptr = ERR57;
- goto FAILED;
- }
- ptr++;
- goto HANDLE_NUMERICAL_RECURSION;
- }
-
- /* \k<name> or \k'name' is a back reference by name (Perl syntax).
- We also support \k{name} (.NET syntax). */
-
- if (escape == ESC_k)
- {
- if ((ptr[1] != CHAR_LESS_THAN_SIGN &&
- ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET))
- {
- *errorcodeptr = ERR69;
- goto FAILED;
- }
- is_recurse = FALSE;
- terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : (*ptr == CHAR_APOSTROPHE)?
- CHAR_APOSTROPHE : CHAR_RIGHT_CURLY_BRACKET;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Back references are handled specially; must disable firstcu if
- not set to cope with cases like (?=(\w+))\1: which would otherwise set
- ':' later. */
-
- if (escape < 0)
- {
- open_capitem *oc;
- recno = -escape;
+ matched_char = TRUE;
+ if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+ }
- /* Come here from named backref handling when the reference is to a
- single group (i.e. not to a duplicated name). */
+ /* Set values to reset to if this is followed by a zero repeat. */
- HANDLE_REFERENCE:
- if (recno > (int)cb->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
- previous = code;
- *code++ = ((options & PCRE2_CASELESS) != 0)? OP_REFI : OP_REF;
- PUT2INC(code, 0, recno);
- cb->backref_map |= (recno < 32)? (1u << recno) : 1;
- if ((uint32_t)recno > cb->top_backref) cb->top_backref = recno;
-
- /* Check to see if this back reference is recursive, that it, it
- is inside the group that it references. A flag is set so that the
- group can be made atomic. */
-
- for (oc = cb->open_caps; oc != NULL; oc = oc->next)
- {
- if (oc->number == recno)
- {
- oc->flag = TRUE;
- break;
- }
- }
- }
+ zerofirstcu = firstcu;
+ zerofirstcuflags = firstcuflags;
+ zeroreqcu = reqcu;
+ zeroreqcuflags = reqcuflags;
- /* So are Unicode property matches, if supported. */
+ /* If Unicode is not supported, \P and \p are not allowed and are
+ faulted at parse time, so will never appear here. */
#ifdef SUPPORT_UNICODE
- else if (escape == ESC_P || escape == ESC_p)
- {
- BOOL negated;
- unsigned int ptype = 0, pdata = 0;
- if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr, cb))
- goto FAILED;
- previous = code;
- *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
- *code++ = ptype;
- *code++ = pdata;
- }
-#else
-
- /* If Unicode properties are not supported, \X, \P, and \p are not
- allowed. */
-
- else if (escape == ESC_X || escape == ESC_P || escape == ESC_p)
- {
- *errorcodeptr = ERR45;
- goto FAILED;
- }
+ if (meta_arg == ESC_P || meta_arg == ESC_p)
+ {
+ uint32_t ptype = *(++pptr) >> 16;
+ uint32_t pdata = *pptr & 0xffff;
+ *code++ = (meta_arg == ESC_p)? OP_PROP : OP_NOTPROP;
+ *code++ = ptype;
+ *code++ = pdata;
+ break; /* End META_ESCAPE */
+ }
#endif
- /* The use of \C can be locked out. */
-
-#ifdef NEVER_BACKSLASH_C
- else if (escape == ESC_C)
- {
- *errorcodeptr = ERR85;
- goto FAILED;
- }
-#else
- else if (escape == ESC_C && (options & PCRE2_NEVER_BACKSLASH_C) != 0)
- {
- *errorcodeptr = ERR83;
- goto FAILED;
- }
-#endif
+ /* For the rest (including \X when Unicode is supported - if not it's
+ faulted at parse time), the OP value is the escape value when PCRE2_UCP is
+ not set; if it is set, these escapes do not show up here because they are
+ converted into Unicode property tests in parse_regex(). Note that \b and \B
+ do a one-character lookbehind, and \A also behaves as if it does. */
- /* For the rest (including \X when Unicode properties are supported), we
- can obtain the OP value by negating the escape value in the default
- situation when PCRE2_UCP is not set. When it *is* set, we substitute
- Unicode property tests. Note that \b and \B do a one-character
- lookbehind, and \A also behaves as if it does. */
+ if (meta_arg == ESC_C) cb->external_flags |= PCRE2_HASBKC; /* Record */
+ if ((meta_arg == ESC_b || meta_arg == ESC_B || meta_arg == ESC_A) &&
+ cb->max_lookbehind == 0)
+ cb->max_lookbehind = 1;
- else
- {
- if (escape == ESC_C) cb->external_flags |= PCRE2_HASBKC; /* Record */
- if ((escape == ESC_b || escape == ESC_B || escape == ESC_A) &&
- cb->max_lookbehind == 0)
- cb->max_lookbehind = 1;
-#ifdef SUPPORT_UNICODE
- if (escape >= ESC_DU && escape <= ESC_wu)
- {
- cb->nestptr[1] = cb->nestptr[0]; /* Back up if at 2nd level */
- cb->nestptr[0] = ptr + 1; /* Where to resume */
- ptr = substitutes[escape - ESC_DU] - 1; /* Just before substitute */
- }
- else
-#endif
- /* In non-UTF mode, and for both 32-bit modes, we turn \C into
- OP_ALLANY instead of OP_ANYBYTE so that it works in DFA mode and in
- lookbehinds. */
+ /* In non-UTF mode, and for both 32-bit modes, we turn \C into OP_ALLANY
+ instead of OP_ANYBYTE so that it works in DFA mode and in lookbehinds. */
- {
- previous = (escape > ESC_b && escape < ESC_Z)? code : NULL;
#if PCRE2_CODE_UNIT_WIDTH == 32
- *code++ = (escape == ESC_C)? OP_ALLANY : escape;
+ *code++ = (meta_arg == ESC_C)? OP_ALLANY : meta_arg;
#else
- *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape;
+ *code++ = (!utf && meta_arg == ESC_C)? OP_ALLANY : meta_arg;
#endif
- }
- }
- continue;
- }
-
- /* We have a data character whose value is in c. In UTF-8 mode it may have
- a value > 127. We set its representation in the length/buffer, and then
- handle it as a data character. */
-
- mclength = PUTCHAR(c, mcbuffer);
- goto ONE_CHAR;
+ break; /* End META_ESCAPE */
/* ===================================================================*/
- /* Handle a literal character. It is guaranteed not to be whitespace or #
- when the extended flag is set. If we are in a UTF mode, it may be a
- multi-unit literal character. */
+ /* Handle an unrecognized meta value. A parsed pattern value less than
+ META_END is a literal. Otherwise we have a problem. */
default:
- NORMAL_CHAR:
- mclength = 1;
- mcbuffer[0] = c;
-
-#ifdef SUPPORT_UNICODE
- if (utf && HAS_EXTRALEN(c))
- ACROSSCHAR(TRUE, ptr[1], mcbuffer[mclength++] = *(++ptr));
+ if (meta >= META_END)
+ {
+#ifdef DEBUG_SHOW_PARSED
+ fprintf(stderr, "** Unrecognized parsed pattern item 0x%.8x\n", *pptr);
#endif
+ *errorcodeptr = ERR89; /* Internal error - unrecognized. */
+ return 0;
+ }
- /* At this point we have the character's bytes in mcbuffer, and the length
- in mclength. When not in UTF mode, the length is always 1. */
+ /* Handle a literal character. We come here by goto in the case of a
+ 32-bit, non-UTF character whose value is greater than META_END. */
- ONE_CHAR:
- previous = code;
+ NORMAL_CHAR:
+ meta = *pptr; /* Get the full 32 bits */
+ NORMAL_CHAR_SET: /* Character is already in meta */
+ matched_char = TRUE;
/* For caseless UTF mode, check whether this character has more than one
other case. If so, generate a special OP_PROP item instead of OP_CHARI. */
@@ -7471,33 +7295,46 @@ for (;; ptr++)
#ifdef SUPPORT_UNICODE
if (utf && (options & PCRE2_CASELESS) != 0)
{
- GETCHAR(c, mcbuffer);
- if ((c = UCD_CASESET(c)) != 0)
+ uint32_t caseset = UCD_CASESET(meta);
+ if (caseset != 0)
{
*code++ = OP_PROP;
*code++ = PT_CLIST;
- *code++ = c;
+ *code++ = caseset;
if (firstcuflags == REQ_UNSET)
firstcuflags = zerofirstcuflags = REQ_NONE;
- break;
+ break; /* End handling this meta item */
}
}
#endif
- /* Caseful matches, or not one of the multicase characters. */
+ /* Caseful matches, or not one of the multicase characters. Get the
+ character's code units into mcbuffer, with the length in mclength. When not
+ in UTF mode, the length is always 1. */
+
+#ifdef SUPPORT_UNICODE
+ if (utf) mclength = PRIV(ord2utf)(meta, mcbuffer); else
+#endif
+ {
+ mclength = 1;
+ mcbuffer[0] = meta;
+ }
+
+ /* Generate the appropriate code */
*code++ = ((options & PCRE2_CASELESS) != 0)? OP_CHARI : OP_CHAR;
- for (c = 0; c < mclength; c++) *code++ = mcbuffer[c];
+ memcpy(code, mcbuffer, CU2BYTES(mclength));
+ code += mclength;
/* Remember if \r or \n were seen */
if (mcbuffer[0] == CHAR_CR || mcbuffer[0] == CHAR_NL)
cb->external_flags |= PCRE2_HASCRORLF;
- /* Set the first and required bytes appropriately. If no previous first
- byte, set it from this character, but revert to none on a zero repeat.
- Otherwise, leave the firstcu value alone, and don't change it on a zero
- repeat. */
+ /* Set the first and required code units appropriately. If no previous
+ first code unit, set it from this character, but revert to none on a zero
+ repeat. Otherwise, leave the firstcu value alone, and don't change it on
+ a zero repeat. */
if (firstcuflags == REQ_UNSET)
{
@@ -7505,15 +7342,13 @@ for (;; ptr++)
zeroreqcu = reqcu;
zeroreqcuflags = reqcuflags;
- /* If the character is more than one byte long, we can set firstcu
+ /* If the character is more than one code unit long, we can set firstcu
only if it is not to be matched caselessly. */
if (mclength == 1 || req_caseopt == 0)
{
- firstcu = mcbuffer[0] | req_caseopt;
firstcu = mcbuffer[0];
firstcuflags = req_caseopt;
-
if (mclength != 1)
{
reqcu = code[-1];
@@ -7538,18 +7373,11 @@ for (;; ptr++)
reqcuflags = req_caseopt | cb->req_varyopt;
}
}
+ break; /* End default meta handling */
+ } /* End of big switch */
+ } /* End of big loop */
- break; /* End of literal character handling */
- }
- } /* end of big loop */
-
-/* Control never reaches here by falling through, only by a goto for all the
-error states. Pass back the position in the pattern so that it can be displayed
-to the user for diagnosing the error. */
-
-FAILED:
-*ptrptr = ptr;
-return FALSE;
+/* Control never reaches here. */
}
@@ -7558,22 +7386,19 @@ return FALSE;
* Compile regex: a sequence of alternatives *
*************************************************/
-/* On entry, ptr is pointing past the bracket character, but on return it
-points to the closing bracket, or vertical bar, or end of string. The code
-variable is pointing at the byte into which the BRA operator has been stored.
-This function is used during the pre-compile phase when we are trying to find
-out the amount of memory needed, as well as during the real compile phase. The
-value of lengthptr distinguishes the two phases.
+/* On entry, pptr is pointing past the bracket meta, but on return it points to
+the closing bracket or META_END. The code variable is pointing at the code unit
+into which the BRA operator has been stored. This function is used during the
+pre-compile phase when we are trying to find out the amount of memory needed,
+as well as during the real compile phase. The value of lengthptr distinguishes
+the two phases.
Arguments:
options option bits, including any changes for this subpattern
codeptr -> the address of the current code pointer
- ptrptr -> the address of the current pattern pointer
+ pptrptr -> the address of the current parsed pattern pointer
errorcodeptr -> pointer to error code variable
- lookbehind TRUE if this is a lookbehind assertion
- reset_bracount TRUE to reset the count for each branch
skipunits skip this many code units at start (for brackets and OP_COND)
- cond_depth depth of nesting for conditional subpatterns
firstcuptr place to put the first required code unit
firstcuflagsptr place to put the first code unit flags, or a negative number
reqcuptr place to put the last required code unit
@@ -7583,30 +7408,31 @@ Arguments:
lengthptr NULL during the real compile phase
points to length accumulator during pre-compile phase
-Returns: TRUE on success
+Returns: 0 There has been an error
+ +1 Success, this group must match at least one character
+ -1 Success, this group may match an empty string
*/
-static BOOL
-compile_regex(uint32_t options, PCRE2_UCHAR **codeptr, PCRE2_SPTR *ptrptr,
- int *errorcodeptr, BOOL lookbehind, BOOL reset_bracount, uint32_t skipunits,
- int cond_depth, uint32_t *firstcuptr, int32_t *firstcuflagsptr,
- uint32_t *reqcuptr, int32_t *reqcuflagsptr, branch_chain *bcptr,
- compile_block *cb, size_t *lengthptr)
+static int
+compile_regex(uint32_t options, PCRE2_UCHAR **codeptr, uint32_t **pptrptr,
+ int *errorcodeptr, uint32_t skipunits, uint32_t *firstcuptr,
+ int32_t *firstcuflagsptr, uint32_t *reqcuptr,int32_t *reqcuflagsptr,
+ branch_chain *bcptr, compile_block *cb, PCRE2_SIZE *lengthptr)
{
-PCRE2_SPTR ptr = *ptrptr;
PCRE2_UCHAR *code = *codeptr;
PCRE2_UCHAR *last_branch = code;
PCRE2_UCHAR *start_bracket = code;
-PCRE2_UCHAR *reverse_count = NULL;
+BOOL lookbehind;
open_capitem capitem;
int capnumber = 0;
+int okreturn = 1;
+uint32_t *pptr = *pptrptr;
uint32_t firstcu, reqcu;
+uint32_t lookbehindlength;
int32_t firstcuflags, reqcuflags;
uint32_t branchfirstcu, branchreqcu;
int32_t branchfirstcuflags, branchreqcuflags;
-size_t length;
-unsigned int orig_bracount;
-unsigned int max_bracount;
+PCRE2_SIZE length;
branch_chain bc;
/* If set, call the external function that checks for stack availability. */
@@ -7615,7 +7441,7 @@ if (cb->cx->stack_guard != NULL &&
cb->cx->stack_guard(cb->parens_depth, cb->cx->stack_guard_data))
{
*errorcodeptr= ERR33;
- return FALSE;
+ return 0;
}
/* Miscellaneous initialization */
@@ -7635,16 +7461,21 @@ the pre-compile phase so that the work space is not exceeded. */
length = 2 + 2*LINK_SIZE + skipunits;
-/* WARNING: If the above line is changed for any reason, you must also change
-the code that abstracts option settings at the start of the pattern and makes
-them global. It tests the value of length for (2 + 2*LINK_SIZE) in the
-pre-compile phase to find out whether or not anything has yet been compiled.
+/* Remember if this is a lookbehind assertion, and if it is, save its length
+and skip over the pattern offset. */
-If this is a capturing subpattern, add to the chain of open capturing items
-so that we can detect them if (*ACCEPT) is encountered. This is also used to
-detect groups that contain recursive back references to themselves. Note that
-only OP_CBRA need be tested here; changing this opcode to one of its variants,
-e.g. OP_SCBRAPOS, happens later, after the group has been compiled. */
+lookbehind = *code == OP_ASSERTBACK || *code == OP_ASSERTBACK_NOT;
+if (lookbehind)
+ {
+ lookbehindlength = META_DATA(pptr[-1]);
+ pptr += SIZEOFFSET;
+ }
+else lookbehindlength = 0;
+
+/* If this is a capturing subpattern, add to the chain of open capturing items
+so that we can detect them if (*ACCEPT) is encountered. Note that only OP_CBRA
+need be tested here; changing this opcode to one of its variants, e.g.
+OP_SCBRAPOS, happens later, after the group has been compiled. */
if (*code == OP_CBRA)
{
@@ -7662,40 +7493,31 @@ code += 1 + LINK_SIZE + skipunits;
/* Loop for each alternative branch */
-orig_bracount = max_bracount = cb->bracount;
-
for (;;)
{
- /* For a (?| group, reset the capturing bracket count so that each branch
- uses the same numbers. */
+ int branch_return;
- if (reset_bracount) cb->bracount = orig_bracount;
+ /* Insert OP_REVERSE if this is as lookbehind assertion. */
- /* Set up dummy OP_REVERSE if lookbehind assertion */
-
- if (lookbehind)
+ if (lookbehind && lookbehindlength > 0)
{
*code++ = OP_REVERSE;
- reverse_count = code;
- PUTINC(code, 0, 0);
+ PUTINC(code, 0, lookbehindlength);
length += 1 + LINK_SIZE;
}
/* Now compile the branch; in the pre-compile phase its length gets added
into the length. */
- if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstcu,
- &branchfirstcuflags, &branchreqcu, &branchreqcuflags, &bc,
- cond_depth, cb, (lengthptr == NULL)? NULL : &length))
- {
- *ptrptr = ptr;
- return FALSE;
- }
+ if ((branch_return =
+ compile_branch(&options, &code, &pptr, errorcodeptr, &branchfirstcu,
+ &branchfirstcuflags, &branchreqcu, &branchreqcuflags, &bc,
+ cb, (lengthptr == NULL)? NULL : &length)) == 0)
+ return 0;
- /* Keep the highest bracket count in case (?| was used and some branch
- has fewer than the rest. */
+ /* If a branch can match an empty string, so can the whole group. */
- if (cb->bracount > max_bracount) max_bracount = cb->bracount;
+ if (branch_return < 0) okreturn = -1;
/* In the real compile phase, there is some post-processing to be done. */
@@ -7757,56 +7579,24 @@ for (;;)
reqcuflags |= branchreqcuflags; /* To "or" REQ_VARY */
}
}
-
- /* If lookbehind, check that this branch matches a fixed-length string, and
- put the length into the OP_REVERSE item. Temporarily mark the end of the
- branch with OP_END. If the branch contains OP_RECURSE, the result is
- FFL_LATER (a negative value) because there may be forward references that
- we can't check here. Set a flag to cause another lookbehind check at the
- end. Why not do it all at the end? Because common errors can be picked up
- here and the offset of the problem can be shown. */
-
- if (lookbehind)
- {
- int fixed_length;
- int count = 0;
- *code = OP_END;
- fixed_length = find_fixedlength(last_branch, (options & PCRE2_UTF) != 0,
- FALSE, cb, NULL, &count);
- if (fixed_length == FFL_LATER)
- {
- cb->check_lookbehind = TRUE;
- }
- else if (fixed_length < 0)
- {
- *errorcodeptr = fixed_length_errors[-fixed_length];
- *ptrptr = ptr;
- return FALSE;
- }
- else
- {
- if (fixed_length > cb->max_lookbehind)
- cb->max_lookbehind = fixed_length;
- PUT(reverse_count, 0, fixed_length);
- }
- }
}
- /* Reached end of expression, either ')' or end of pattern. In the real
- compile phase, go back through the alternative branches and reverse the chain
- of offsets, with the field in the BRA item now becoming an offset to the
- first alternative. If there are no alternatives, it points to the end of the
- group. The length in the terminating ket is always the length of the whole
- bracketed item. Return leaving the pointer at the terminating char. */
+ /* Handle reaching the end of the expression, either ')' or end of pattern.
+ In the real compile phase, go back through the alternative branches and
+ reverse the chain of offsets, with the field in the BRA item now becoming an
+ offset to the first alternative. If there are no alternatives, it points to
+ the end of the group. The length in the terminating ket is always the length
+ of the whole bracketed item. Return leaving the pointer at the terminating
+ char. */
- if (*ptr != CHAR_VERTICAL_LINE)
+ if (META_CODE(*pptr) != META_ALT)
{
if (lengthptr == NULL)
{
- size_t branch_length = code - last_branch;
+ PCRE2_SIZE branch_length = code - last_branch;
do
{
- size_t prev_length = GET(last_branch, 1);
+ PCRE2_SIZE prev_length = GET(last_branch, 1);
PUT(last_branch, 1, branch_length);
branch_length = prev_length;
last_branch -= branch_length;
@@ -7841,14 +7631,10 @@ for (;;)
cb->open_caps = cb->open_caps->next;
}
- /* Retain the highest bracket number, in case resetting was used. */
-
- cb->bracount = max_bracount;
-
/* Set values to pass back */
*codeptr = code;
- *ptrptr = ptr;
+ *pptrptr = pptr;
*firstcuptr = firstcu;
*firstcuflagsptr = firstcuflags;
*reqcuptr = reqcu;
@@ -7858,11 +7644,11 @@ for (;;)
if (OFLOW_MAX - *lengthptr < length)
{
*errorcodeptr = ERR20;
- return FALSE;
+ return 0;
}
*lengthptr += length;
}
- return TRUE;
+ return okreturn;
}
/* Another branch follows. In the pre-compile phase, we can move the code
@@ -7887,9 +7673,11 @@ for (;;)
code += 1 + LINK_SIZE;
}
- /* Advance past the vertical bar */
+ /* Set the lookbehind length (if not in a lookbehind the value will be zero)
+ and then advance past the vertical bar. */
- ptr++;
+ lookbehindlength = META_DATA(*pptr);
+ pptr++;
}
/* Control never reaches here */
}
@@ -7933,25 +7721,27 @@ Arguments:
the less precise approach
cb points to the compile data block
atomcount atomic group level
+ inassert TRUE if in an assertion
Returns: TRUE or FALSE
*/
static BOOL
-is_anchored(register PCRE2_SPTR code, unsigned int bracket_map,
- compile_block *cb, int atomcount)
+is_anchored(PCRE2_SPTR code, unsigned int bracket_map, compile_block *cb,
+ int atomcount, BOOL inassert)
{
do {
PCRE2_SPTR scode = first_significant_code(
code + PRIV(OP_lengths)[*code], FALSE);
- register int op = *scode;
+ int op = *scode;
/* Non-capturing brackets */
if (op == OP_BRA || op == OP_BRAPOS ||
op == OP_SBRA || op == OP_SBRAPOS)
{
- if (!is_anchored(scode, bracket_map, cb, atomcount)) return FALSE;
+ if (!is_anchored(scode, bracket_map, cb, atomcount, inassert))
+ return FALSE;
}
/* Capturing brackets */
@@ -7961,33 +7751,44 @@ do {
{
int n = GET2(scode, 1+LINK_SIZE);
int new_map = bracket_map | ((n < 32)? (1u << n) : 1);
- if (!is_anchored(scode, new_map, cb, atomcount)) return FALSE;
+ if (!is_anchored(scode, new_map, cb, atomcount, inassert)) return FALSE;
}
- /* Positive forward assertions and conditions */
+ /* Positive forward assertion */
- else if (op == OP_ASSERT || op == OP_COND)
+ else if (op == OP_ASSERT)
{
- if (!is_anchored(scode, bracket_map, cb, atomcount)) return FALSE;
+ if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE;
+ }
+
+ /* Condition */
+
+ else if (op == OP_COND)
+ {
+ if (!is_anchored(scode, bracket_map, cb, atomcount, inassert))
+ return FALSE;
}
/* Atomic groups */
- else if (op == OP_ONCE || op == OP_ONCE_NC)
+ else if (op == OP_ONCE)
{
- if (!is_anchored(scode, bracket_map, cb, atomcount + 1))
+ if (!is_anchored(scode, bracket_map, cb, atomcount + 1, inassert))
return FALSE;
}
/* .* is not anchored unless DOTALL is set (which generates OP_ALLANY) and
it isn't in brackets that are or may be referenced or inside an atomic
- group. There is also an option that disables auto-anchoring. */
+ group or an assertion. Also the pattern must not contain *PRUNE or *SKIP,
+ because these break the feature. Consider, for example, /(?s).*?(*PRUNE)b/
+ with the subject "aab", which matches "b", i.e. not at the start of a line.
+ There is also an option that disables auto-anchoring. */
else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR ||
op == OP_TYPEPOSSTAR))
{
if (scode[1] != OP_ALLANY || (bracket_map & cb->backref_map) != 0 ||
- atomcount > 0 || cb->had_pruneorskip ||
+ atomcount > 0 || cb->had_pruneorskip || inassert ||
(cb->external_options & PCRE2_NO_DOTSTAR_ANCHOR) != 0)
return FALSE;
}
@@ -8014,8 +7815,8 @@ matching and for non-DOTALL patterns that start with .* (which must start at
the beginning or after \n). As in the case of is_anchored() (see above), we
have to take account of back references to capturing brackets that contain .*
because in that case we can't make the assumption. Also, the appearance of .*
-inside atomic brackets or in a pattern that contains *PRUNE or *SKIP does not
-count, because once again the assumption no longer holds.
+inside atomic brackets or in an assertion, or in a pattern that contains *PRUNE
+or *SKIP does not count, because once again the assumption no longer holds.
Arguments:
code points to start of the compiled pattern or a group
@@ -8024,18 +7825,19 @@ Arguments:
the less precise approach
cb points to the compile data
atomcount atomic group level
+ inassert TRUE if in an assertion
Returns: TRUE or FALSE
*/
static BOOL
is_startline(PCRE2_SPTR code, unsigned int bracket_map, compile_block *cb,
- int atomcount)
+ int atomcount, BOOL inassert)
{
do {
PCRE2_SPTR scode = first_significant_code(
code + PRIV(OP_lengths)[*code], FALSE);
- register int op = *scode;
+ int op = *scode;
/* If we are at the start of a conditional assertion group, *both* the
conditional assertion *and* what follows the condition must satisfy the test
@@ -8061,7 +7863,7 @@ do {
return FALSE;
default: /* Assertion */
- if (!is_startline(scode, bracket_map, cb, atomcount)) return FALSE;
+ if (!is_startline(scode, bracket_map, cb, atomcount, TRUE)) return FALSE;
do scode += GET(scode, 1); while (*scode == OP_ALT);
scode += 1 + LINK_SIZE;
break;
@@ -8075,7 +7877,8 @@ do {
if (op == OP_BRA || op == OP_BRAPOS ||
op == OP_SBRA || op == OP_SBRAPOS)
{
- if (!is_startline(scode, bracket_map, cb, atomcount)) return FALSE;
+ if (!is_startline(scode, bracket_map, cb, atomcount, inassert))
+ return FALSE;
}
/* Capturing brackets */
@@ -8085,41 +7888,43 @@ do {
{
int n = GET2(scode, 1+LINK_SIZE);
int new_map = bracket_map | ((n < 32)? (1u << n) : 1);
- if (!is_startline(scode, new_map, cb, atomcount)) return FALSE;
+ if (!is_startline(scode, new_map, cb, atomcount, inassert)) return FALSE;
}
/* Positive forward assertions */
else if (op == OP_ASSERT)
{
- if (!is_startline(scode, bracket_map, cb, atomcount)) return FALSE;
+ if (!is_startline(scode, bracket_map, cb, atomcount, TRUE))
+ return FALSE;
}
/* Atomic brackets */
- else if (op == OP_ONCE || op == OP_ONCE_NC)
+ else if (op == OP_ONCE)
{
- if (!is_startline(scode, bracket_map, cb, atomcount + 1)) return FALSE;
+ if (!is_startline(scode, bracket_map, cb, atomcount + 1, inassert))
+ return FALSE;
}
/* .* means "start at start or after \n" if it isn't in atomic brackets or
- brackets that may be referenced, as long as the pattern does not contain
- *PRUNE or *SKIP, because these break the feature. Consider, for example,
- /.*?a(*PRUNE)b/ with the subject "aab", which matches "ab", i.e. not at the
- start of a line. There is also an option that disables this optimization. */
+ brackets that may be referenced or an assertion, and as long as the pattern
+ does not contain *PRUNE or *SKIP, because these break the feature. Consider,
+ for example, /.*?a(*PRUNE)b/ with the subject "aab", which matches "ab",
+ i.e. not at the start of a line. There is also an option that disables this
+ optimization. */
else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR || op == OP_TYPEPOSSTAR)
{
if (scode[1] != OP_ANY || (bracket_map & cb->backref_map) != 0 ||
- atomcount > 0 || cb->had_pruneorskip ||
+ atomcount > 0 || cb->had_pruneorskip || inassert ||
(cb->external_options & PCRE2_NO_DOTSTAR_ANCHOR) != 0)
return FALSE;
}
/* Check for explicit circumflex; anything else gives a FALSE result. Note
- in particular that this includes atomic brackets OP_ONCE and OP_ONCE_NC
- because the number of characters matched by .* cannot be adjusted inside
- them. */
+ in particular that this includes atomic brackets OP_ONCE because the number
+ of characters matched by .* cannot be adjusted inside them. */
else if (op != OP_CIRC && op != OP_CIRCM) return FALSE;
@@ -8134,6 +7939,153 @@ return TRUE;
/*************************************************
+* Scan compiled regex for recursion reference *
+*************************************************/
+
+/* This function scans through a compiled pattern until it finds an instance of
+OP_RECURSE.
+
+Arguments:
+ code points to start of expression
+ utf TRUE in UTF mode
+
+Returns: pointer to the opcode for OP_RECURSE, or NULL if not found
+*/
+
+static PCRE2_SPTR
+find_recurse(PCRE2_SPTR code, BOOL utf)
+{
+for (;;)
+ {
+ PCRE2_UCHAR c = *code;
+ if (c == OP_END) return NULL;
+ if (c == OP_RECURSE) return code;
+
+ /* XCLASS is used for classes that cannot be represented just by a bit map.
+ This includes negated single high-valued characters. CALLOUT_STR is used for
+ callouts with string arguments. In both cases the length in the table is
+ zero; the actual length is stored in the compiled code. */
+
+ if (c == OP_XCLASS) code += GET(code, 1);
+ else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE);
+
+ /* Otherwise, we can get the item's length from the table, except that for
+ repeated character types, we have to test for \p and \P, which have an extra
+ two code units of parameters, and for MARK/PRUNE/SKIP/THEN with an argument,
+ we must add in its length. */
+
+ else
+ {
+ switch(c)
+ {
+ case OP_TYPESTAR:
+ case OP_TYPEMINSTAR:
+ case OP_TYPEPLUS:
+ case OP_TYPEMINPLUS:
+ case OP_TYPEQUERY:
+ case OP_TYPEMINQUERY:
+ case OP_TYPEPOSSTAR:
+ case OP_TYPEPOSPLUS:
+ case OP_TYPEPOSQUERY:
+ if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
+ break;
+
+ case OP_TYPEPOSUPTO:
+ case OP_TYPEUPTO:
+ case OP_TYPEMINUPTO:
+ case OP_TYPEEXACT:
+ if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
+ code += 2;
+ break;
+
+ case OP_MARK:
+ case OP_PRUNE_ARG:
+ case OP_SKIP_ARG:
+ case OP_THEN_ARG:
+ code += code[1];
+ break;
+ }
+
+ /* Add in the fixed length from the table */
+
+ code += PRIV(OP_lengths)[c];
+
+ /* In UTF-8 and UTF-16 modes, opcodes that are followed by a character may
+ be followed by a multi-unit character. The length in the table is a
+ minimum, so we have to arrange to skip the extra units. */
+
+#ifdef MAYBE_UTF_MULTI
+ if (utf) switch(c)
+ {
+ case OP_CHAR:
+ case OP_CHARI:
+ case OP_NOT:
+ case OP_NOTI:
+ case OP_EXACT:
+ case OP_EXACTI:
+ case OP_NOTEXACT:
+ case OP_NOTEXACTI:
+ case OP_UPTO:
+ case OP_UPTOI:
+ case OP_NOTUPTO:
+ case OP_NOTUPTOI:
+ case OP_MINUPTO:
+ case OP_MINUPTOI:
+ case OP_NOTMINUPTO:
+ case OP_NOTMINUPTOI:
+ case OP_POSUPTO:
+ case OP_POSUPTOI:
+ case OP_NOTPOSUPTO:
+ case OP_NOTPOSUPTOI:
+ case OP_STAR:
+ case OP_STARI:
+ case OP_NOTSTAR:
+ case OP_NOTSTARI:
+ case OP_MINSTAR:
+ case OP_MINSTARI:
+ case OP_NOTMINSTAR:
+ case OP_NOTMINSTARI:
+ case OP_POSSTAR:
+ case OP_POSSTARI:
+ case OP_NOTPOSSTAR:
+ case OP_NOTPOSSTARI:
+ case OP_PLUS:
+ case OP_PLUSI:
+ case OP_NOTPLUS:
+ case OP_NOTPLUSI:
+ case OP_MINPLUS:
+ case OP_MINPLUSI:
+ case OP_NOTMINPLUS:
+ case OP_NOTMINPLUSI:
+ case OP_POSPLUS:
+ case OP_POSPLUSI:
+ case OP_NOTPOSPLUS:
+ case OP_NOTPOSPLUSI:
+ case OP_QUERY:
+ case OP_QUERYI:
+ case OP_NOTQUERY:
+ case OP_NOTQUERYI:
+ case OP_MINQUERY:
+ case OP_MINQUERYI:
+ case OP_NOTMINQUERY:
+ case OP_NOTMINQUERYI:
+ case OP_POSQUERY:
+ case OP_POSQUERYI:
+ case OP_NOTPOSQUERY:
+ case OP_NOTPOSQUERYI:
+ if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
+ break;
+ }
+#else
+ (void)(utf); /* Keep compiler happy by referencing function argument */
+#endif /* MAYBE_UTF_MULTI */
+ }
+ }
+}
+
+
+
+/*************************************************
* Check for asserted fixed first code unit *
*************************************************/
@@ -8158,7 +8110,7 @@ Returns: the fixed first code unit, or 0 with REQ_NONE in flags
static uint32_t
find_firstassertedcu(PCRE2_SPTR code, int32_t *flags, BOOL inassert)
{
-register uint32_t c = 0;
+uint32_t c = 0;
int cflags = REQ_NONE;
*flags = REQ_NONE;
@@ -8168,7 +8120,7 @@ do {
int xl = (*code == OP_CBRA || *code == OP_SCBRA ||
*code == OP_CBRAPOS || *code == OP_SCBRAPOS)? IMM2_SIZE:0;
PCRE2_SPTR scode = first_significant_code(code + 1+LINK_SIZE + xl, TRUE);
- register PCRE2_UCHAR op = *scode;
+ PCRE2_UCHAR op = *scode;
switch(op)
{
@@ -8183,7 +8135,6 @@ do {
case OP_SCBRAPOS:
case OP_ASSERT:
case OP_ONCE:
- case OP_ONCE_NC:
d = find_firstassertedcu(scode, &dflags, op == OP_ASSERT);
if (dflags < 0)
return 0;
@@ -8241,18 +8192,19 @@ Arguments:
name the name to add
length the length of the name
groupno the group number
+ tablecount the count of names in the table so far
Returns: nothing
*/
static void
add_name_to_table(compile_block *cb, PCRE2_SPTR name, int length,
- unsigned int groupno)
+ unsigned int groupno, uint32_t tablecount)
{
-int i;
+uint32_t i;
PCRE2_UCHAR *slot = cb->name_table;
-for (i = 0; i < cb->names_found; i++)
+for (i = 0; i < tablecount; i++)
{
int crc = memcmp(name, slot+IMM2_SIZE, CU2BYTES(length));
if (crc == 0 && slot[IMM2_SIZE+length] != 0)
@@ -8266,7 +8218,7 @@ for (i = 0; i < cb->names_found; i++)
if (crc < 0)
{
memmove(slot + cb->name_entry_size, slot,
- CU2BYTES((cb->names_found - i) * cb->name_entry_size));
+ CU2BYTES((tablecount - i) * cb->name_entry_size));
break;
}
@@ -8277,7 +8229,6 @@ for (i = 0; i < cb->names_found; i++)
PUT2(slot, 0, groupno);
memcpy(slot + IMM2_SIZE, name, CU2BYTES(length));
-cb->names_found++;
/* Add a terminating zero and fill the rest of the slot with zeroes so that
the memory is all initialized. Otherwise valgrind moans about uninitialized
@@ -8290,6 +8241,723 @@ memset(slot + IMM2_SIZE + length, 0,
/*************************************************
+* Skip in parsed pattern *
+*************************************************/
+
+/* This function is called to skip parts of the parsed pattern when finding the
+length of a lookbehind branch. It is called after (*ACCEPT) and (*FAIL) to find
+the end of the branch, it is called to skip over an internal lookaround, and it
+is also called to skip to the end of a class, during which it will never
+encounter nested groups (but there's no need to have special code for that).
+
+When called to find the end of a branch or group, pptr must point to the first
+meta code inside the branch, not the branch-starting code. In other cases it
+can point to the item that causes the function to be called.
+
+Arguments:
+ pptr current pointer to skip from
+ skiptype PSKIP_CLASS when skipping to end of class
+ PSKIP_ALT when META_ALT ends the skip
+ PSKIP_KET when only META_KET ends the skip
+
+Returns: new value of pptr
+ NULL if META_END is reached - should never occur
+ or for an unknown meta value - likewise
+*/
+
+static uint32_t *
+parsed_skip(uint32_t *pptr, uint32_t skiptype)
+{
+uint32_t nestlevel = 0;
+
+for (;; pptr++)
+ {
+ uint32_t meta = META_CODE(*pptr);
+
+ switch(meta)
+ {
+ default: /* Just skip over most items */
+ if (meta < META_END) continue; /* Literal */
+ break;
+
+ /* This should never occur. */
+
+ case META_END:
+ return NULL;
+
+ /* The data for these items is variable in length. */
+
+ case META_BACKREF: /* Offset is present only if group >= 10 */
+ if (META_DATA(*pptr) >= 10) pptr += SIZEOFFSET;
+ break;
+
+ case META_ESCAPE: /* A few escapes are followed by data items. */
+ switch (META_DATA(*pptr))
+ {
+ case ESC_P:
+ case ESC_p:
+ pptr += 1;
+ break;
+
+ case ESC_g:
+ case ESC_k:
+ pptr += 1 + SIZEOFFSET;
+ break;
+ }
+ break;
+
+ case META_MARK: /* Add the length of the name. */
+ case META_PRUNE_ARG:
+ case META_SKIP_ARG:
+ case META_THEN_ARG:
+ pptr += pptr[1];
+ break;
+
+ /* These are the "active" items in this loop. */
+
+ case META_CLASS_END:
+ if (skiptype == PSKIP_CLASS) return pptr;
+ break;
+
+ case META_ATOMIC:
+ case META_CAPTURE:
+ case META_COND_ASSERT:
+ case META_COND_DEFINE:
+ case META_COND_NAME:
+ case META_COND_NUMBER:
+ case META_COND_RNAME:
+ case META_COND_RNUMBER:
+ case META_COND_VERSION:
+ case META_LOOKAHEAD:
+ case META_LOOKAHEADNOT:
+ case META_LOOKBEHIND:
+ case META_LOOKBEHINDNOT:
+ case META_NOCAPTURE:
+ nestlevel++;
+ break;
+
+ case META_ALT:
+ if (nestlevel == 0 && skiptype == PSKIP_ALT) return pptr;
+ break;
+
+ case META_KET:
+ if (nestlevel == 0) return pptr;
+ nestlevel--;
+ break;
+ }
+
+ /* The extra data item length for each meta is in a table. */
+
+ meta = (meta >> 16) & 0x7fff;
+ if (meta >= sizeof(meta_extra_lengths)) return NULL;
+ pptr += meta_extra_lengths[meta];
+ }
+/* Control never reaches here */
+return pptr;
+}
+
+
+
+/*************************************************
+* Find length of a parsed group *
+*************************************************/
+
+/* This is called for nested groups within a branch of a lookbehind whose
+length is being computed. If all the branches in the nested group have the same
+length, that is OK. On entry, the pointer must be at the first element after
+the group initializing code. On exit it points to OP_KET. Caching is used to
+improve processing speed when the same capturing group occurs many times.
+
+Arguments:
+ pptrptr pointer to pointer in the parsed pattern
+ isinline FALSE if a reference or recursion; TRUE for inline group
+ errcodeptr pointer to the errorcode
+ lcptr pointer to the loop counter
+ group number of captured group or -1 for a non-capturing group
+ recurses chain of recurse_check to catch mutual recursion
+ cb pointer to the compile data
+
+Returns: the group length or a negative number
+*/
+
+static int
+get_grouplength(uint32_t **pptrptr, BOOL isinline, int *errcodeptr, int *lcptr,
+ int group, parsed_recurse_check *recurses, compile_block *cb)
+{
+int branchlength;
+int grouplength = -1;
+
+/* The cache can be used only if there is no possibility of there being two
+groups with the same number. We do not need to set the end pointer for a group
+that is being processed as a back reference or recursion, but we must do so for
+an inline group. */
+
+if (group > 0 && (cb->external_flags & PCRE2_DUPCAPUSED) == 0)
+ {
+ uint32_t groupinfo = cb->groupinfo[group];
+ if ((groupinfo & GI_NOT_FIXED_LENGTH) != 0) return -1;
+ if ((groupinfo & GI_SET_FIXED_LENGTH) != 0)
+ {
+ if (isinline) *pptrptr = parsed_skip(*pptrptr, PSKIP_KET);
+ return groupinfo & GI_FIXED_LENGTH_MASK;
+ }
+ }
+
+/* Scan the group. In this case we find the end pointer of necessity. */
+
+for(;;)
+ {
+ branchlength = get_branchlength(pptrptr, errcodeptr, lcptr, recurses, cb);
+ if (branchlength < 0) goto ISNOTFIXED;
+ if (grouplength == -1) grouplength = branchlength;
+ else if (grouplength != branchlength) goto ISNOTFIXED;
+ if (**pptrptr == META_KET) break;
+ *pptrptr += 1; /* Skip META_ALT */
+ }
+
+if (group > 0)
+ cb->groupinfo[group] |= (uint32_t)(GI_SET_FIXED_LENGTH | grouplength);
+return grouplength;
+
+ISNOTFIXED:
+if (group > 0) cb->groupinfo[group] |= GI_NOT_FIXED_LENGTH;
+return -1;
+}
+
+
+
+/*************************************************
+* Find length of a parsed branch *
+*************************************************/
+
+/* Return a fixed length for a branch in a lookbehind, giving an error if the
+length is not fixed. If any lookbehinds are encountered on the way, they get
+their length set. On entry, *pptrptr points to the first element inside the
+branch. On exit it is set to point to the ALT or KET.
+
+Arguments:
+ pptrptr pointer to pointer in the parsed pattern
+ errcodeptr pointer to error code
+ lcptr pointer to loop counter
+ recurses chain of recurse_check to catch mutual recursion
+ cb pointer to compile block
+
+Returns: the length, or a negative value on error
+*/
+
+static int
+get_branchlength(uint32_t **pptrptr, int *errcodeptr, int *lcptr,
+ parsed_recurse_check *recurses, compile_block *cb)
+{
+int branchlength = 0;
+int grouplength;
+uint32_t lastitemlength = 0;
+uint32_t *pptr = *pptrptr;
+PCRE2_SIZE offset;
+parsed_recurse_check this_recurse;
+
+/* A large and/or complex regex can take too long to process. This can happen
+more often when (?| groups are present in the pattern because their length
+cannot be cached. */
+
+if ((*lcptr)++ > 2000)
+ {
+ *errcodeptr = ERR35; /* Lookbehind is too complicated */
+ return -1;
+ }
+
+/* Scan the branch, accumulating the length. */
+
+for (;; pptr++)
+ {
+ parsed_recurse_check *r;
+ uint32_t *gptr, *gptrend;
+ uint32_t escape;
+ uint32_t group = 0;
+ uint32_t itemlength = 0;
+
+ if (*pptr < META_END)
+ {
+ itemlength = 1;
+ }
+
+ else switch (META_CODE(*pptr))
+ {
+ case META_KET:
+ case META_ALT:
+ goto EXIT;
+
+ /* (*ACCEPT) and (*FAIL) terminate the branch, but we must skip to the
+ actual termination. */
+
+ case META_ACCEPT:
+ case META_FAIL:
+ pptr = parsed_skip(pptr, PSKIP_ALT);
+ if (pptr == NULL) goto PARSED_SKIP_FAILED;
+ goto EXIT;
+
+ case META_MARK:
+ case META_PRUNE_ARG:
+ case META_SKIP_ARG:
+ case META_THEN_ARG:
+ pptr += pptr[1] + 1;
+ break;
+
+ case META_CIRCUMFLEX:
+ case META_COMMIT:
+ case META_DOLLAR:
+ case META_PRUNE:
+ case META_SKIP:
+ case META_THEN:
+ break;
+
+ case META_OPTIONS:
+ pptr += 1;
+ break;
+
+ case META_BIGVALUE:
+ itemlength = 1;
+ pptr += 1;
+ break;
+
+ case META_CLASS:
+ case META_CLASS_NOT:
+ itemlength = 1;
+ pptr = parsed_skip(pptr, PSKIP_CLASS);
+ if (pptr == NULL) goto PARSED_SKIP_FAILED;
+ break;
+
+ case META_CLASS_EMPTY_NOT:
+ case META_DOT:
+ itemlength = 1;
+ break;
+
+ case META_CALLOUT_NUMBER:
+ pptr += 3;
+ break;
+
+ case META_CALLOUT_STRING:
+ pptr += 3 + SIZEOFFSET;
+ break;
+
+ /* Only some escapes consume a character. Of those, \R and \X are never
+ allowed because they might match more than character. \C is allowed only in
+ 32-bit and non-UTF 8/16-bit modes. */
+
+ case META_ESCAPE:
+ escape = META_DATA(*pptr);
+ if (escape == ESC_R || escape == ESC_X) return -1;
+ if (escape > ESC_b && escape < ESC_Z)
+ {
+#if PCRE2_CODE_UNIT_WIDTH != 32
+ if ((cb->external_options & PCRE2_UTF) != 0 && escape == ESC_C)
+ {
+ *errcodeptr = ERR36;
+ return -1;
+ }
+#endif
+ itemlength = 1;
+ if (escape == ESC_p || escape == ESC_P) pptr++; /* Skip prop data */
+ }
+ break;
+
+ /* Lookaheads can be ignored, but we must start the skip inside the group
+ so that it isn't treated as a group within the branch. */
+
+ case META_LOOKAHEAD:
+ case META_LOOKAHEADNOT:
+ pptr = parsed_skip(pptr + 1, PSKIP_KET);
+ if (pptr == NULL) goto PARSED_SKIP_FAILED;
+ break;
+
+ /* Lookbehinds can be ignored, but must themselves be checked. */
+
+ case META_LOOKBEHIND:
+ case META_LOOKBEHINDNOT:
+ if (!set_lookbehind_lengths(&pptr, errcodeptr, lcptr, recurses, cb))
+ return -1;
+ break;
+
+ /* Back references and recursions are handled by very similar code. At this
+ stage, the names generated in the parsing pass are available, but the main
+ name table has not yet been created. So for the named varieties, scan the
+ list of names in order to get the number of the first one in the pattern,
+ and whether or not this name is duplicated. */
+
+ case META_BACKREF_BYNAME:
+ if ((cb->external_options & PCRE2_MATCH_UNSET_BACKREF) != 0)
+ goto ISNOTFIXED;
+ /* Fall through */
+
+ case META_RECURSE_BYNAME:
+ {
+ int i;
+ PCRE2_SPTR name;
+ BOOL is_dupname = FALSE;
+ named_group *ng = cb->named_groups;
+ uint32_t meta_code = META_CODE(*pptr);
+ uint32_t length = *(++pptr);
+
+ GETPLUSOFFSET(offset, pptr);
+ name = cb->start_pattern + offset;
+ for (i = 0; i < cb->names_found; i++, ng++)
+ {
+ if (length == ng->length && PRIV(strncmp)(name, ng->name, length) == 0)
+ {
+ group = ng->number;
+ is_dupname = ng->isdup;
+ break;
+ }
+ }
+
+ if (group == 0)
+ {
+ *errcodeptr = ERR15; /* Non-existent subpattern */
+ cb->erroroffset = offset;
+ return -1;
+ }
+
+ /* A numerical back reference can be fixed length if duplicate capturing
+ groups are not being used. A non-duplicate named back reference can also
+ be handled. */
+
+ if (meta_code == META_RECURSE_BYNAME ||
+ (!is_dupname && (cb->external_flags & PCRE2_DUPCAPUSED) == 0))
+ goto RECURSE_OR_BACKREF_LENGTH; /* Handle as a numbered version. */
+ }
+ goto ISNOTFIXED; /* Duplicate name or number */
+
+ /* The offset values for back references < 10 are in a separate vector
+ because otherwise they would use more than two parsed pattern elements on
+ 64-bit systems. */
+
+ case META_BACKREF:
+ if ((cb->external_options & PCRE2_MATCH_UNSET_BACKREF) != 0 ||
+ (cb->external_flags & PCRE2_DUPCAPUSED) != 0)
+ goto ISNOTFIXED;
+ group = META_DATA(*pptr);
+ if (group < 10)
+ {
+ offset = cb->small_ref_offset[group];
+ goto RECURSE_OR_BACKREF_LENGTH;
+ }
+
+ /* Fall through */
+ /* For groups >= 10 - picking up group twice does no harm. */
+
+ /* A true recursion implies not fixed length, but a subroutine call may
+ be OK. Back reference "recursions" are also failed. */
+
+ case META_RECURSE:
+ group = META_DATA(*pptr);
+ GETPLUSOFFSET(offset, pptr);
+
+ RECURSE_OR_BACKREF_LENGTH:
+ if (group > cb->bracount)
+ {
+ cb->erroroffset = offset;
+ *errcodeptr = ERR15; /* Non-existent subpattern */
+ return -1;
+ }
+ if (group == 0) goto ISNOTFIXED; /* Local recursion */
+ for (gptr = cb->parsed_pattern; *gptr != META_END; gptr++)
+ {
+ if (META_CODE(*gptr) == META_BIGVALUE) gptr++;
+ else if (*gptr == (META_CAPTURE | group)) break;
+ }
+
+ /* We must start the search for the end of the group at the first meta code
+ inside the group. Otherwise it will be treated as an enclosed group. */
+
+ gptrend = parsed_skip(gptr + 1, PSKIP_KET);
+ if (gptrend == NULL) goto PARSED_SKIP_FAILED;
+ if (pptr > gptr && pptr < gptrend) goto ISNOTFIXED; /* Local recursion */
+ for (r = recurses; r != NULL; r = r->prev) if (r->groupptr == gptr) break;
+ if (r != NULL) goto ISNOTFIXED; /* Mutual recursion */
+ this_recurse.prev = recurses;
+ this_recurse.groupptr = gptr;
+
+ /* We do not need to know the position of the end of the group, that is,
+ gptr is not used after the call to get_grouplength(). Setting the second
+ argument FALSE stops it scanning for the end when the length can be found
+ in the cache. */
+
+ gptr++;
+ grouplength = get_grouplength(&gptr, FALSE, errcodeptr, lcptr, group,
+ &this_recurse, cb);
+ if (grouplength < 0)
+ {
+ if (*errcodeptr == 0) goto ISNOTFIXED;
+ return -1; /* Error already set */
+ }
+ itemlength = grouplength;
+ break;
+
+ /* Check nested groups - advance past the initial data for each type and
+ then seek a fixed length with get_grouplength(). */
+
+ case META_COND_NAME:
+ case META_COND_NUMBER:
+ case META_COND_RNAME:
+ case META_COND_RNUMBER:
+ case META_COND_DEFINE:
+ pptr += 2 + SIZEOFFSET;
+ goto CHECK_GROUP;
+
+ case META_COND_ASSERT:
+ pptr += 1;
+ goto CHECK_GROUP;
+
+ case META_COND_VERSION:
+ pptr += 4;
+ goto CHECK_GROUP;
+
+ case META_CAPTURE:
+ group = META_DATA(*pptr);
+ /* Fall through */
+
+ case META_ATOMIC:
+ case META_NOCAPTURE:
+ pptr++;
+ CHECK_GROUP:
+ grouplength = get_grouplength(&pptr, TRUE, errcodeptr, lcptr, group,
+ recurses, cb);
+ if (grouplength < 0) return -1;
+ itemlength = grouplength;
+ break;
+
+ /* Exact repetition is OK; variable repetition is not. A repetition of zero
+ must subtract the length that has already been added. */
+
+ case META_MINMAX:
+ case META_MINMAX_PLUS:
+ case META_MINMAX_QUERY:
+ if (pptr[1] == pptr[2])
+ {
+ if (pptr[1] == 0) branchlength -= lastitemlength;
+ else itemlength = (pptr[1] - 1) * lastitemlength;
+ pptr += 2;
+ break;
+ }
+ /* Fall through */
+
+ /* Any other item means this branch does not have a fixed length. */
+
+ default:
+ ISNOTFIXED:
+ *errcodeptr = ERR25; /* Not fixed length */
+ return -1;
+ }
+
+ /* Add the item length to the branchlength, and save it for use if the next
+ thing is a quantifier. */
+
+ branchlength += itemlength;
+ lastitemlength = itemlength;
+
+ /* Ensure that the length does not overflow the limit. */
+
+ if (branchlength > LOOKBEHIND_MAX)
+ {
+ *errcodeptr = ERR87;
+ return -1;
+ }
+ }
+
+EXIT:
+*pptrptr = pptr;
+if (branchlength > cb->max_lookbehind) cb->max_lookbehind = branchlength;
+return branchlength;
+
+PARSED_SKIP_FAILED:
+*errcodeptr = ERR90;
+return -1;
+}
+
+
+
+/*************************************************
+* Set lengths in a lookbehind *
+*************************************************/
+
+/* This function is called for each lookbehind, to set the lengths in its
+branches. An error occurs if any branch does not have a fixed length that is
+less than the maximum (65535). On exit, the pointer must be left on the final
+ket.
+
+Arguments:
+ pptrptr pointer to pointer in the parsed pattern
+ errcodeptr pointer to error code
+ lcptr pointer to loop counter
+ recurses chain of recurse_check to catch mutual recursion
+ cb pointer to compile block
+
+Returns: TRUE if all is well
+ FALSE otherwise, with error code and offset set
+*/
+
+static BOOL
+set_lookbehind_lengths(uint32_t **pptrptr, int *errcodeptr, int *lcptr,
+ parsed_recurse_check *recurses, compile_block *cb)
+{
+PCRE2_SIZE offset;
+int branchlength;
+uint32_t *bptr = *pptrptr;
+
+READPLUSOFFSET(offset, bptr); /* Offset for error messages */
+*pptrptr += SIZEOFFSET;
+
+do
+ {
+ *pptrptr += 1;
+ branchlength = get_branchlength(pptrptr, errcodeptr, lcptr, recurses, cb);
+ if (branchlength < 0)
+ {
+ /* The errorcode and offset may already be set from a nested lookbehind. */
+ if (*errcodeptr == 0) *errcodeptr = ERR25;
+ if (cb->erroroffset == PCRE2_UNSET) cb->erroroffset = offset;
+ return FALSE;
+ }
+ *bptr |= branchlength; /* branchlength never more than 65535 */
+ bptr = *pptrptr;
+ }
+while (*bptr == META_ALT);
+
+return TRUE;
+}
+
+
+
+/*************************************************
+* Check parsed pattern lookbehinds *
+*************************************************/
+
+/* This function is called at the end of parsing a pattern if any lookbehinds
+were encountered. It scans the parsed pattern for them, calling
+set_lookbehind_lengths() for each one. At the start, the errorcode is zero and
+the error offset is marked unset. The enables the functions above not to
+override settings from deeper nestings.
+
+Arguments cb points to the compile block
+Returns: 0 on success, or an errorcode (cb->erroroffset will be set)
+*/
+
+static int
+check_lookbehinds(compile_block *cb)
+{
+uint32_t *pptr;
+int errorcode = 0;
+int loopcount = 0;
+
+cb->erroroffset = PCRE2_UNSET;
+
+for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
+ {
+ if (*pptr < META_END) continue; /* Literal */
+
+ switch (META_CODE(*pptr))
+ {
+ default:
+ return ERR70; /* Unrecognized meta code */
+
+ case META_ESCAPE:
+ if (*pptr - META_ESCAPE == ESC_P || *pptr - META_ESCAPE == ESC_p)
+ pptr += 1;
+ break;
+
+ case META_ACCEPT:
+ case META_ALT:
+ case META_ASTERISK:
+ case META_ASTERISK_PLUS:
+ case META_ASTERISK_QUERY:
+ case META_ATOMIC:
+ case META_BACKREF:
+ case META_CAPTURE:
+ case META_CIRCUMFLEX:
+ case META_CLASS:
+ case META_CLASS_EMPTY:
+ case META_CLASS_EMPTY_NOT:
+ case META_CLASS_END:
+ case META_CLASS_NOT:
+ case META_COMMIT:
+ case META_COND_ASSERT:
+ case META_DOLLAR:
+ case META_DOT:
+ case META_FAIL:
+ case META_KET:
+ case META_LOOKAHEAD:
+ case META_LOOKAHEADNOT:
+ case META_NOCAPTURE:
+ case META_PLUS:
+ case META_PLUS_PLUS:
+ case META_PLUS_QUERY:
+ case META_PRUNE:
+ case META_QUERY:
+ case META_QUERY_PLUS:
+ case META_QUERY_QUERY:
+ case META_RANGE_ESCAPED:
+ case META_RANGE_LITERAL:
+ case META_SKIP:
+ case META_THEN:
+ break;
+
+ case META_RECURSE:
+ pptr += SIZEOFFSET;
+ break;
+
+ case META_BACKREF_BYNAME:
+ case META_COND_DEFINE:
+ case META_COND_NAME:
+ case META_COND_NUMBER:
+ case META_COND_RNAME:
+ case META_COND_RNUMBER:
+ case META_RECURSE_BYNAME:
+ pptr += 1 + SIZEOFFSET;
+ break;
+
+ case META_CALLOUT_STRING:
+ pptr += 3 + SIZEOFFSET;
+ break;
+
+ case META_BIGVALUE:
+ case META_OPTIONS:
+ case META_POSIX:
+ case META_POSIX_NEG:
+ pptr += 1;
+ break;
+
+ case META_MINMAX:
+ case META_MINMAX_QUERY:
+ case META_MINMAX_PLUS:
+ pptr += 2;
+ break;
+
+ case META_CALLOUT_NUMBER:
+ case META_COND_VERSION:
+ pptr += 3;
+ break;
+
+ case META_MARK:
+ case META_PRUNE_ARG:
+ case META_SKIP_ARG:
+ case META_THEN_ARG:
+ pptr += 1 + pptr[1];
+ break;
+
+ case META_LOOKBEHIND:
+ case META_LOOKBEHINDNOT:
+ if (!set_lookbehind_lengths(&pptr, &errorcode, &loopcount, NULL, cb))
+ return errorcode;
+ break;
+ }
+ }
+
+return 0;
+}
+
+
+
+/*************************************************
* External function to compile a pattern *
*************************************************/
@@ -8312,43 +8980,51 @@ PCRE2_EXP_DEFN pcre2_code * PCRE2_CALL_CONVENTION
pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE patlen, uint32_t options,
int *errorptr, PCRE2_SIZE *erroroffset, pcre2_compile_context *ccontext)
{
-BOOL utf; /* Set TRUE for UTF mode */
-pcre2_real_code *re = NULL; /* What we will return */
-compile_block cb; /* "Static" compile-time data */
-const uint8_t *tables; /* Char tables base pointer */
-
-PCRE2_UCHAR *code; /* Current pointer in compiled code */
-PCRE2_SPTR codestart; /* Start of compiled code */
-PCRE2_SPTR ptr; /* Current pointer in pattern */
-
-size_t length = 1; /* Allow or final END opcode */
-size_t usedlength; /* Actual length used */
-size_t re_blocksize; /* Size of memory block */
-
-int32_t firstcuflags, reqcuflags; /* Type of first/req code unit */
-uint32_t firstcu, reqcu; /* Value of first/req code unit */
-uint32_t setflags = 0; /* NL and BSR set flags */
-
-uint32_t skipatstart; /* When checking (*UTF) etc */
-uint32_t limit_match = UINT32_MAX; /* Unset match limits */
-uint32_t limit_recursion = UINT32_MAX;
-
-int newline = 0; /* Unset; can be set by the pattern */
-int bsr = 0; /* Unset; can be set by the pattern */
-int errorcode = 0; /* Initialize to avoid compiler warn */
+BOOL utf; /* Set TRUE for UTF mode */
+BOOL has_lookbehind = FALSE; /* Set TRUE if a lookbehind is found */
+BOOL zero_terminated; /* Set TRUE for zero-terminated pattern */
+pcre2_real_code *re = NULL; /* What we will return */
+compile_block cb; /* "Static" compile-time data */
+const uint8_t *tables; /* Char tables base pointer */
+
+PCRE2_UCHAR *code; /* Current pointer in compiled code */
+PCRE2_SPTR codestart; /* Start of compiled code */
+PCRE2_SPTR ptr; /* Current pointer in pattern */
+uint32_t *pptr; /* Current pointer in parsed pattern */
+
+PCRE2_SIZE length = 1; /* Allow for final END opcode */
+PCRE2_SIZE usedlength; /* Actual length used */
+PCRE2_SIZE re_blocksize; /* Size of memory block */
+PCRE2_SIZE big32count = 0; /* 32-bit literals >= 0x80000000 */
+PCRE2_SIZE parsed_size_needed; /* Needed for parsed pattern */
+
+int32_t firstcuflags, reqcuflags; /* Type of first/req code unit */
+uint32_t firstcu, reqcu; /* Value of first/req code unit */
+uint32_t setflags = 0; /* NL and BSR set flags */
+
+uint32_t skipatstart; /* When checking (*UTF) etc */
+uint32_t limit_heap = UINT32_MAX;
+uint32_t limit_match = UINT32_MAX; /* Unset match limits */
+uint32_t limit_depth = UINT32_MAX;
+
+int newline = 0; /* Unset; can be set by the pattern */
+int bsr = 0; /* Unset; can be set by the pattern */
+int errorcode = 0; /* Initialize to avoid compiler warn */
+int regexrc; /* Return from compile */
+
+uint32_t i; /* Local loop counter */
/* Comments at the head of this file explain about these variables. */
-PCRE2_UCHAR *copied_pattern = NULL;
-PCRE2_UCHAR stack_copied_pattern[COPIED_PATTERN_SIZE];
+uint32_t stack_groupinfo[GROUPINFO_DEFAULT_SIZE];
+uint32_t stack_parsed_pattern[PARSED_PATTERN_DEFAULT_SIZE];
named_group named_groups[NAMED_GROUP_LIST_SIZE];
/* The workspace is used in different ways in the different compiling phases.
-It needs to be 16-bit aligned for the preliminary group scan, and 32-bit
-aligned for the group information cache. */
+It needs to be 16-bit aligned for the preliminary parsing scan. */
-uint32_t c32workspace[C32_WORK_SIZE];
-PCRE2_UCHAR *cworkspace = (PCRE2_UCHAR *)c32workspace;
+uint32_t c16workspace[C16_WORK_SIZE];
+PCRE2_UCHAR *cworkspace = (PCRE2_UCHAR *)c16workspace;
/* -------------- Check arguments and set up the pattern ----------------- */
@@ -8367,57 +9043,44 @@ if (pattern == NULL)
return NULL;
}
+/* A NULL compile context means "use a default context" */
+
+if (ccontext == NULL)
+ ccontext = (pcre2_compile_context *)(&PRIV(default_compile_context));
+
/* Check that all undefined public option bits are zero. */
-if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0)
+if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0 ||
+ (ccontext->extra_options & ~PUBLIC_COMPILE_EXTRA_OPTIONS) != 0)
{
*errorptr = ERR17;
return NULL;
}
-/* A NULL compile context means "use a default context" */
-
-if (ccontext == NULL)
- ccontext = (pcre2_compile_context *)(&PRIV(default_compile_context));
+if ((options & PCRE2_LITERAL) != 0 &&
+ ((options & ~PUBLIC_LITERAL_COMPILE_OPTIONS) != 0 ||
+ (ccontext->extra_options & ~PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS) != 0))
+ {
+ *errorptr = ERR92;
+ return NULL;
+ }
/* A zero-terminated pattern is indicated by the special length value
-PCRE2_ZERO_TERMINATED. Otherwise, we make a copy of the pattern and add a zero,
-to ensure that it is always possible to look one code unit beyond the end of
-the pattern's characters. In both cases, check that the pattern is overlong. */
+PCRE2_ZERO_TERMINATED. Check for an overlong pattern. */
-if (patlen == PCRE2_ZERO_TERMINATED)
- {
+if ((zero_terminated = (patlen == PCRE2_ZERO_TERMINATED)))
patlen = PRIV(strlen)(pattern);
- if (patlen > ccontext->max_pattern_length)
- {
- *errorptr = ERR88;
- return NULL;
- }
- }
-else
+
+if (patlen > ccontext->max_pattern_length)
{
- if (patlen > ccontext->max_pattern_length)
- {
- *errorptr = ERR88;
- return NULL;
- }
- if (patlen < COPIED_PATTERN_SIZE)
- copied_pattern = stack_copied_pattern;
- else
- {
- copied_pattern = ccontext->memctl.malloc(CU2BYTES(patlen + 1),
- ccontext->memctl.memory_data);
- if (copied_pattern == NULL)
- {
- *errorptr = ERR21;
- return NULL;
- }
- }
- memcpy(copied_pattern, pattern, CU2BYTES(patlen));
- copied_pattern[patlen] = 0;
- pattern = copied_pattern;
+ *errorptr = ERR88;
+ return NULL;
}
+/* From here on, all returns from this function should end up going via the
+EXIT label. */
+
+
/* ------------ Initialize the "static" compile data -------------- */
tables = (ccontext->tables != NULL)? ccontext->tables : PRIV(default_tables);
@@ -8428,16 +9091,16 @@ cb.cbits = tables + cbits_offset; /* tables */
cb.ctypes = tables + ctypes_offset;
cb.assert_depth = 0;
-cb.bracount = cb.final_bracount = 0;
+cb.bracount = 0;
cb.cx = ccontext;
cb.dupnames = FALSE;
cb.end_pattern = pattern + patlen;
-cb.nestptr[0] = cb.nestptr[1] = NULL;
+cb.erroroffset = 0;
cb.external_flags = 0;
cb.external_options = options;
-cb.groupinfo = c32workspace;
+cb.groupinfo = stack_groupinfo;
cb.had_recurse = FALSE;
-cb.iscondassert = FALSE;
+cb.lastcapture = 0;
cb.max_lookbehind = 0;
cb.name_entry_size = 0;
cb.name_table = NULL;
@@ -8446,6 +9109,7 @@ cb.named_group_list_size = NAMED_GROUP_LIST_SIZE;
cb.names_found = 0;
cb.open_caps = NULL;
cb.parens_depth = 0;
+cb.parsed_pattern = stack_parsed_pattern;
cb.req_varyopt = 0;
cb.start_code = cworkspace;
cb.start_pattern = pattern;
@@ -8459,77 +9123,103 @@ references to help in deciding whether (.*) can be treated as anchored or not.
cb.top_backref = 0;
cb.backref_map = 0;
+/* Escape sequences \1 to \9 are always back references, but as they are only
+two characters long, only two elements can be used in the parsed_pattern
+vector. The first contains the reference, and we'd like to use the second to
+record the offset in the pattern, so that forward references to non-existent
+groups can be diagnosed later with an offset. However, on 64-bit systems,
+PCRE2_SIZE won't fit. Instead, we have a vector of offsets for the first
+occurrence of \1 to \9, indexed by the second parsed_pattern value. All other
+references have enough space for the offset to be put into the parsed pattern.
+*/
+
+for (i = 0; i < 10; i++) cb.small_ref_offset[i] = PCRE2_UNSET;
+
+
/* --------------- Start looking at the pattern --------------- */
-/* Check for global one-time option settings at the start of the pattern, and
-remember the offset to the actual regex. */
+/* Unless PCRE2_LITERAL is set, check for global one-time option settings at
+the start of the pattern, and remember the offset to the actual regex. With
+valgrind support, make the terminator of a zero-terminated pattern
+inaccessible. This catches bugs that would otherwise only show up for
+non-zero-terminated patterns. */
+
+#ifdef SUPPORT_VALGRIND
+if (zero_terminated) VALGRIND_MAKE_MEM_NOACCESS(pattern + patlen, CU2BYTES(1));
+#endif
ptr = pattern;
skipatstart = 0;
-while (ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
- ptr[skipatstart+1] == CHAR_ASTERISK)
+if ((options & PCRE2_LITERAL) == 0)
{
- unsigned int i;
- for (i = 0; i < sizeof(pso_list)/sizeof(pso); i++)
+ while (patlen - skipatstart >= 2 &&
+ ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
+ ptr[skipatstart+1] == CHAR_ASTERISK)
{
- pso *p = pso_list + i;
-
- if (PRIV(strncmp_c8)(ptr+skipatstart+2, (char *)(p->name), p->length) == 0)
+ for (i = 0; i < sizeof(pso_list)/sizeof(pso); i++)
{
uint32_t c, pp;
+ pso *p = pso_list + i;
- skipatstart += p->length + 2;
- switch(p->type)
+ if (patlen - skipatstart - 2 >= p->length &&
+ PRIV(strncmp_c8)(ptr + skipatstart + 2, (char *)(p->name),
+ p->length) == 0)
{
- case PSO_OPT:
- cb.external_options |= p->value;
- break;
+ skipatstart += p->length + 2;
+ switch(p->type)
+ {
+ case PSO_OPT:
+ cb.external_options |= p->value;
+ break;
- case PSO_FLG:
- setflags |= p->value;
- break;
+ case PSO_FLG:
+ setflags |= p->value;
+ break;
- case PSO_NL:
- newline = p->value;
- setflags |= PCRE2_NL_SET;
- break;
+ case PSO_NL:
+ newline = p->value;
+ setflags |= PCRE2_NL_SET;
+ break;
- case PSO_BSR:
- bsr = p->value;
- setflags |= PCRE2_BSR_SET;
- break;
+ case PSO_BSR:
+ bsr = p->value;
+ setflags |= PCRE2_BSR_SET;
+ break;
- case PSO_LIMM:
- case PSO_LIMR:
- c = 0;
- pp = skipatstart;
- if (!IS_DIGIT(ptr[pp]))
- {
- errorcode = ERR60;
- ptr += pp;
- goto HAD_ERROR;
- }
- while (IS_DIGIT(ptr[pp]))
- {
- if (c > UINT32_MAX / 10 - 1) break; /* Integer overflow */
- c = c*10 + (ptr[pp++] - CHAR_0);
- }
- if (ptr[pp++] != CHAR_RIGHT_PARENTHESIS)
- {
- errorcode = ERR60;
- ptr += pp;
- goto HAD_ERROR;
+ case PSO_LIMM:
+ case PSO_LIMD:
+ case PSO_LIMH:
+ c = 0;
+ pp = skipatstart;
+ if (!IS_DIGIT(ptr[pp]))
+ {
+ errorcode = ERR60;
+ ptr += pp;
+ goto HAD_EARLY_ERROR;
+ }
+ while (IS_DIGIT(ptr[pp]))
+ {
+ if (c > UINT32_MAX / 10 - 1) break; /* Integer overflow */
+ c = c*10 + (ptr[pp++] - CHAR_0);
+ }
+ if (ptr[pp++] != CHAR_RIGHT_PARENTHESIS)
+ {
+ errorcode = ERR60;
+ ptr += pp;
+ goto HAD_EARLY_ERROR;
+ }
+ if (p->type == PSO_LIMH) limit_heap = c;
+ else if (p->type == PSO_LIMM) limit_match = c;
+ else limit_depth = c;
+ skipatstart += pp - skipatstart;
+ break;
}
- if (p->type == PSO_LIMM) limit_match = c;
- else limit_recursion = c;
- skipatstart += pp - skipatstart;
- break;
+ break; /* Out of the table scan loop */
}
- break; /* Out of the table scan loop */
}
+ if (i >= sizeof(pso_list)/sizeof(pso)) break; /* Out of pso loop */
}
- if (i >= sizeof(pso_list)/sizeof(pso)) break; /* Out of pso loop */
}
/* End of pattern-start options; advance to start of real regex. */
@@ -8542,12 +9232,14 @@ ptr += skipatstart;
if ((cb.external_options & (PCRE2_UTF|PCRE2_UCP)) != 0)
{
errorcode = ERR32;
- goto HAD_ERROR;
+ goto HAD_EARLY_ERROR;
}
#endif
/* Check UTF. We have the original options in 'options', with that value as
-modified by (*UTF) etc in cb->external_options. */
+modified by (*UTF) etc in cb->external_options. The extra option
+PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not permitted in UTF-16 mode because the
+surrogate code points cannot be represented in UTF-16. */
utf = (cb.external_options & PCRE2_UTF) != 0;
if (utf)
@@ -8555,11 +9247,19 @@ if (utf)
if ((options & PCRE2_NEVER_UTF) != 0)
{
errorcode = ERR74;
- goto HAD_ERROR;
+ goto HAD_EARLY_ERROR;
}
if ((options & PCRE2_NO_UTF_CHECK) == 0 &&
(errorcode = PRIV(valid_utf)(pattern, patlen, erroroffset)) != 0)
- goto HAD_UTF_ERROR;
+ goto HAD_ERROR; /* Offset was set by valid_utf() */
+
+#if PCRE2_CODE_UNIT_WIDTH == 16
+ if ((ccontext->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) != 0)
+ {
+ errorcode = ERR91;
+ goto HAD_EARLY_ERROR;
+ }
+#endif
}
/* Check UCP lockout. */
@@ -8568,7 +9268,7 @@ if ((cb.external_options & (PCRE2_UCP|PCRE2_NEVER_UCP)) ==
(PCRE2_UCP|PCRE2_NEVER_UCP))
{
errorcode = ERR75;
- goto HAD_ERROR;
+ goto HAD_EARLY_ERROR;
}
/* Process the BSR setting. */
@@ -8591,6 +9291,11 @@ switch(newline)
cb.nl[0] = CHAR_NL;
break;
+ case PCRE2_NEWLINE_NUL:
+ cb.nllen = 1;
+ cb.nl[0] = CHAR_NUL;
+ break;
+
case PCRE2_NEWLINE_CRLF:
cb.nllen = 2;
cb.nl[0] = CHAR_CR;
@@ -8607,23 +9312,107 @@ switch(newline)
default:
errorcode = ERR56;
- goto HAD_ERROR;
+ goto HAD_EARLY_ERROR;
}
-/* Before we do anything else, do a pre-scan of the pattern in order to
-discover the named groups and their numerical equivalents, so that this
-information is always available for the remaining processing. */
+/* Pre-scan the pattern to do two things: (1) Discover the named groups and
+their numerical equivalents, so that this information is always available for
+the remaining processing. (2) At the same time, parse the pattern and put a
+processed version into the parsed_pattern vector. This has escapes interpreted
+and comments removed (amongst other things).
-errorcode = scan_for_captures(&ptr, cb.external_options, &cb);
-if (errorcode != 0) goto HAD_ERROR;
+In all but one case, when PCRE2_AUTO_CALLOUT is not set, the number of unsigned
+32-bit ints in the parsed pattern is bounded by the length of the pattern plus
+one (for the terminator) plus four if PCRE2_EXTRA_WORD or PCRE2_EXTRA_LINE is
+set. The exceptional case is when running in 32-bit, non-UTF mode, when literal
+characters greater than META_END (0x80000000) have to be coded as two units. In
+this case, therefore, we scan the pattern to check for such values. */
-/* For obscure debugging this code can be enabled. */
+#if PCRE2_CODE_UNIT_WIDTH == 32
+if (!utf)
+ {
+ PCRE2_SPTR p;
+ for (p = ptr; p < cb.end_pattern; p++) if (*p >= META_END) big32count++;
+ }
+#endif
-#if 0
+/* Ensure that the parsed pattern buffer is big enough. When PCRE2_AUTO_CALLOUT
+is set we have to assume a numerical callout (4 elements) for each character
+plus one at the end. This is overkill, but memory is plentiful these days. For
+many smaller patterns the vector on the stack (which was set up above) can be
+used. */
+
+parsed_size_needed = patlen - skipatstart + big32count;
+
+if ((ccontext->extra_options &
+ (PCRE2_EXTRA_MATCH_WORD|PCRE2_EXTRA_MATCH_LINE)) != 0)
+ parsed_size_needed += 4;
+
+if ((options & PCRE2_AUTO_CALLOUT) != 0)
+ parsed_size_needed = (parsed_size_needed + 1) * 5;
+
+if (parsed_size_needed >= PARSED_PATTERN_DEFAULT_SIZE)
+ {
+ uint32_t *heap_parsed_pattern = ccontext->memctl.malloc(
+ (parsed_size_needed + 1) * sizeof(uint32_t), ccontext->memctl.memory_data);
+ if (heap_parsed_pattern == NULL)
+ {
+ *errorptr = ERR21;
+ goto EXIT;
+ }
+ cb.parsed_pattern = heap_parsed_pattern;
+ }
+cb.parsed_pattern_end = cb.parsed_pattern + parsed_size_needed + 1;
+
+/* Do the parsing scan. */
+
+errorcode = parse_regex(ptr, cb.external_options, &has_lookbehind, &cb);
+if (errorcode != 0) goto HAD_CB_ERROR;
+
+/* Workspace is needed to remember information about numbered groups: whether a
+group can match an empty string and what its fixed length is. This is done to
+avoid the possibility of recursive references causing very long compile times
+when checking these features. Unnumbered groups do not have this exposure since
+they cannot be referenced. We use an indexed vector for this purpose. If there
+are sufficiently few groups, the default vector on the stack, as set up above,
+can be used. Otherwise we have to get/free a special vector. The vector must be
+initialized to zero. */
+
+if (cb.bracount >= GROUPINFO_DEFAULT_SIZE)
+ {
+ cb.groupinfo = ccontext->memctl.malloc(
+ (cb.bracount + 1)*sizeof(uint32_t), ccontext->memctl.memory_data);
+ if (cb.groupinfo == NULL)
+ {
+ errorcode = ERR21;
+ cb.erroroffset = 0;
+ goto HAD_CB_ERROR;
+ }
+ }
+memset(cb.groupinfo, 0, (cb.bracount + 1) * sizeof(uint32_t));
+
+/* If there were any lookbehinds, scan the parsed pattern to figure out their
+lengths. */
+
+if (has_lookbehind)
+ {
+ errorcode = check_lookbehinds(&cb);
+ if (errorcode != 0) goto HAD_CB_ERROR;
+ }
+
+/* For debugging, there is a function that shows the parsed data vector. */
+
+#ifdef DEBUG_SHOW_PARSED
+fprintf(stderr, "+++ Pre-scan complete:\n");
+show_parsed(&cb);
+#endif
+
+/* For debugging capturing information this code can be enabled. */
+
+#ifdef DEBUG_SHOW_CAPTURES
{
- int i;
named_group *ng = cb.named_groups;
- fprintf(stderr, "+++Captures: %d\n", cb.final_bracount);
+ fprintf(stderr, "+++Captures: %d\n", cb.bracount);
for (i = 0; i < cb.names_found; i++, ng++)
{
fprintf(stderr, "+++%3d %.*s\n", ng->number, ng->length, ng->name);
@@ -8631,12 +9420,6 @@ if (errorcode != 0) goto HAD_ERROR;
}
#endif
-/* Reset current bracket count to zero and current pointer to the start of the
-pattern. */
-
-cb.bracount = 0;
-ptr = pattern + skipatstart;
-
/* Pretend to compile the pattern while actually just accumulating the amount
of memory required in the 'length' variable. This behaviour is triggered by
passing a non-NULL final argument to compile_regex(). We pass a block of
@@ -8645,24 +9428,26 @@ compiled code is discarded when it is no longer needed, so hopefully this
workspace will never overflow, though there is a test for its doing so.
On error, errorcode will be set non-zero, so we don't need to look at the
-result of the function. The initial options have been put into the cb block so
-that they can be changed if an option setting is found within the regex right
-at the beginning. Bringing initial option settings outside can help speed up
-starting point checks. We still have to pass a separate options variable (the
-first argument) because that may change as the pattern is processed. */
+result of the function. The initial options have been put into the cb block,
+but we still have to pass a separate options variable (the first argument)
+because the options may change as the pattern is processed. */
+cb.erroroffset = patlen; /* For any subsequent errors that do not set it */
+pptr = cb.parsed_pattern;
code = cworkspace;
*code = OP_BRA;
-(void)compile_regex(cb.external_options, &code, &ptr, &errorcode, FALSE,
- FALSE, 0, 0, &firstcu, &firstcuflags, &reqcu, &reqcuflags, NULL,
- &cb, &length);
+(void)compile_regex(cb.external_options, &code, &pptr, &errorcode, 0, &firstcu,
+ &firstcuflags, &reqcu, &reqcuflags, NULL, &cb, &length);
+
+if (errorcode != 0) goto HAD_CB_ERROR; /* Offset is in cb.erroroffset */
+
+/* This should be caught in compile_regex(), but just in case... */
-if (errorcode != 0) goto HAD_ERROR;
if (length > MAX_PATTERN_SIZE)
{
errorcode = ERR20;
- goto HAD_ERROR;
+ goto HAD_CB_ERROR;
}
/* Compute the size of, and then get and initialize, the data block for storing
@@ -8671,15 +9456,23 @@ possible because nowadays we limit the maximum value of cb.names_found and
cb.name_entry_size. */
re_blocksize = sizeof(pcre2_real_code) +
- CU2BYTES(length + cb.names_found * cb.name_entry_size);
+ CU2BYTES(length +
+ (PCRE2_SIZE)cb.names_found * (PCRE2_SIZE)cb.name_entry_size);
re = (pcre2_real_code *)
ccontext->memctl.malloc(re_blocksize, ccontext->memctl.memory_data);
if (re == NULL)
{
errorcode = ERR21;
- goto HAD_ERROR;
+ goto HAD_CB_ERROR;
}
+/* The compiler may put padding at the end of the pcre2_real_code structure in
+order to round it up to a multiple of 4 or 8 bytes. This means that when a
+compiled pattern is copied (for example, when serialized) undefined bytes are
+read, and this annoys debuggers such as valgrind. To avoid this, we explicitly
+write to the last 8 bytes of the structure before setting the fields. */
+
+memset((char *)re + sizeof(pcre2_real_code) - 8, 0, 8);
re->memctl = ccontext->memctl;
re->tables = tables;
re->executable_jit = NULL;
@@ -8689,8 +9482,9 @@ re->magic_number = MAGIC_NUMBER;
re->compile_options = options;
re->overall_options = cb.external_options;
re->flags = PCRE2_CODE_UNIT_WIDTH/8 | cb.external_flags | setflags;
+re->limit_heap = limit_heap;
re->limit_match = limit_match;
-re->limit_recursion = limit_recursion;
+re->limit_depth = limit_depth;
re->first_codeunit = 0;
re->last_codeunit = 0;
re->bsr_convention = bsr;
@@ -8708,44 +9502,19 @@ code follows after that. */
codestart = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)) +
re->name_entry_size * re->name_count;
-/* Workspace is needed to remember information about numbered groups: whether a
-group can match an empty string and what its fixed length is. This is done to
-avoid the possibility of recursive references causing very long compile times
-when checking these features. Unnumbered groups do not have this exposure since
-they cannot be referenced. We use an indexed vector for this purpose. If there
-are sufficiently few groups, it can be the c32workspace vector, as set up
-above. Otherwise we have to get/free a special vector. The vector must be
-initialized to zero. */
-
-if (cb.final_bracount >= C32_WORK_SIZE)
- {
- cb.groupinfo = ccontext->memctl.malloc(
- (cb.final_bracount + 1)*sizeof(uint32_t), ccontext->memctl.memory_data);
- if (cb.groupinfo == NULL)
- {
- errorcode = ERR21;
- goto HAD_ERROR;
- }
- }
-memset(cb.groupinfo, 0, (cb.final_bracount + 1) * sizeof(uint32_t));
-
/* Update the compile data block for the actual compile. The starting points of
the name/number translation table and of the code are passed around in the
compile data block. The start/end pattern and initial options are already set
-from the pre-compile phase, as is the name_entry_size field. Reset the bracket
-count and the names_found field. */
+from the pre-compile phase, as is the name_entry_size field. */
cb.parens_depth = 0;
cb.assert_depth = 0;
-cb.bracount = 0;
-cb.max_lookbehind = 0;
+cb.lastcapture = 0;
cb.name_table = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code));
cb.start_code = codestart;
-cb.iscondassert = FALSE;
cb.req_varyopt = 0;
cb.had_accept = FALSE;
cb.had_pruneorskip = FALSE;
-cb.check_lookbehind = FALSE;
cb.open_caps = NULL;
/* If any named groups were found, create the name/number table from the list
@@ -8753,23 +9522,21 @@ created in the pre-pass. */
if (cb.names_found > 0)
{
- int i = cb.names_found;
named_group *ng = cb.named_groups;
- cb.names_found = 0;
- for (; i > 0; i--, ng++)
- add_name_to_table(&cb, ng->name, ng->length, ng->number);
+ for (i = 0; i < cb.names_found; i++, ng++)
+ add_name_to_table(&cb, ng->name, ng->length, ng->number, i);
}
/* Set up a starting, non-extracting bracket, then compile the expression. On
error, errorcode will be set non-zero, so we don't need to look at the result
of the function here. */
-ptr = pattern + skipatstart;
+pptr = cb.parsed_pattern;
code = (PCRE2_UCHAR *)codestart;
*code = OP_BRA;
-(void)compile_regex(re->overall_options, &code, &ptr, &errorcode, FALSE, FALSE,
- 0, 0, &firstcu, &firstcuflags, &reqcu, &reqcuflags, NULL, &cb, NULL);
-
+regexrc = compile_regex(re->overall_options, &code, &pptr, &errorcode, 0,
+ &firstcu, &firstcuflags, &reqcu, &reqcuflags, NULL, &cb, NULL);
+if (regexrc < 0) re->flags |= PCRE2_MATCH_EMPTY;
re->top_bracket = cb.bracount;
re->top_backref = cb.top_backref;
re->max_lookbehind = cb.max_lookbehind;
@@ -8805,7 +9572,7 @@ if (errorcode == 0 && cb.had_recurse)
{
PCRE2_UCHAR *rcode;
PCRE2_SPTR rgroup;
- int ccount = 0;
+ unsigned int ccount = 0;
int start = RSCAN_CACHE_SIZE;
recurse_cache rc[RSCAN_CACHE_SIZE];
@@ -8813,16 +9580,16 @@ if (errorcode == 0 && cb.had_recurse)
rcode != NULL;
rcode = (PCRE2_UCHAR *)find_recurse(rcode + 1 + LINK_SIZE, utf))
{
- int i, p, recno;
+ int p, groupnumber;
- recno = (int)GET(rcode, 1);
- if (recno == 0) rgroup = codestart; else
+ groupnumber = (int)GET(rcode, 1);
+ if (groupnumber == 0) rgroup = codestart; else
{
PCRE2_SPTR search_from = codestart;
rgroup = NULL;
for (i = 0, p = start; i < ccount; i++, p = (p + 1) & 7)
{
- if (recno == rc[p].recno)
+ if (groupnumber == rc[p].groupnumber)
{
rgroup = rc[p].group;
break;
@@ -8832,19 +9599,19 @@ if (errorcode == 0 && cb.had_recurse)
search time below when the new group number is greater than any of the
previously found groups. */
- if (recno > rc[p].recno) search_from = rc[p].group;
+ if (groupnumber > rc[p].groupnumber) search_from = rc[p].group;
}
if (rgroup == NULL)
{
- rgroup = PRIV(find_bracket)(search_from, utf, recno);
+ rgroup = PRIV(find_bracket)(search_from, utf, groupnumber);
if (rgroup == NULL)
{
errorcode = ERR53;
break;
}
if (--start < 0) start = RSCAN_CACHE_SIZE - 1;
- rc[start].recno = recno;
+ rc[start].groupnumber = groupnumber;
rc[start].group = rgroup;
if (ccount < RSCAN_CACHE_SIZE) ccount++;
}
@@ -8857,93 +9624,27 @@ if (errorcode == 0 && cb.had_recurse)
/* In rare debugging situations we sometimes need to look at the compiled code
at this stage. */
-#ifdef CALL_PRINTINT
+#ifdef DEBUG_CALL_PRINTINT
pcre2_printint(re, stderr, TRUE);
fprintf(stderr, "Length=%lu Used=%lu\n", length, usedlength);
#endif
-/* After a successful compile, give an error if there's back reference to a
-non-existent capturing subpattern. Then, unless disabled, check whether any
-single character iterators can be auto-possessified. The function overwrites
-the appropriate opcode values, so the type of the pointer must be cast. NOTE:
-the intermediate variable "temp" is used in this code because at least one
-compiler gives a warning about loss of "const" attribute if the cast
-(PCRE2_UCHAR *)codestart is used directly in the function call. */
+/* Unless disabled, check whether any single character iterators can be
+auto-possessified. The function overwrites the appropriate opcode values, so
+the type of the pointer must be cast. NOTE: the intermediate variable "temp" is
+used in this code because at least one compiler gives a warning about loss of
+"const" attribute if the cast (PCRE2_UCHAR *)codestart is used directly in the
+function call. */
-if (errorcode == 0)
+if (errorcode == 0 && (re->overall_options & PCRE2_NO_AUTO_POSSESS) == 0)
{
- if (re->top_backref > re->top_bracket) errorcode = ERR15;
- else if ((re->overall_options & PCRE2_NO_AUTO_POSSESS) == 0)
- {
- PCRE2_UCHAR *temp = (PCRE2_UCHAR *)codestart;
- if (PRIV(auto_possessify)(temp, utf, &cb) != 0) errorcode = ERR80;
- }
- }
-
-/* If there were any lookbehind assertions that contained OP_RECURSE
-(recursions or subroutine calls), a flag is set for them to be checked here,
-because they may contain forward references. Actual recursions cannot be fixed
-length, but subroutine calls can. It is done like this so that those without
-OP_RECURSE that are not fixed length get a diagnosic with a useful offset. The
-exceptional ones forgo this. We scan the pattern to check that they are fixed
-length, and set their lengths. */
-
-if (errorcode == 0 && cb.check_lookbehind)
- {
- PCRE2_UCHAR *cc = (PCRE2_UCHAR *)codestart;
-
- /* Loop, searching for OP_REVERSE items, and process those that do not have
- their length set. (Actually, it will also re-process any that have a length
- of zero, but that is a pathological case, and it does no harm.) When we find
- one, we temporarily terminate the branch it is in while we scan it. Note that
- calling find_bracket() with a negative group number returns a pointer to the
- OP_REVERSE item, not the actual lookbehind. */
-
- for (cc = (PCRE2_UCHAR *)PRIV(find_bracket)(codestart, utf, -1);
- cc != NULL;
- cc = (PCRE2_UCHAR *)PRIV(find_bracket)(cc, utf, -1))
- {
- if (GET(cc, 1) == 0)
- {
- int fixed_length;
- int count = 0;
- PCRE2_UCHAR *be = cc - 1 - LINK_SIZE + GET(cc, -LINK_SIZE);
- int end_op = *be;
- *be = OP_END;
- fixed_length = find_fixedlength(cc, utf, TRUE, &cb, NULL, &count);
- *be = end_op;
- if (fixed_length < 0)
- {
- errorcode = fixed_length_errors[-fixed_length];
- break;
- }
- if (fixed_length > cb.max_lookbehind) cb.max_lookbehind = fixed_length;
- PUT(cc, 1, fixed_length);
- }
- cc += 1 + LINK_SIZE;
- }
-
- /* The previous value of the maximum lookbehind was transferred to the
- compiled regex block above. We could have updated this value in the loop
- above, but keep the two values in step, just in case some later code below
- uses the cb value. */
-
- re->max_lookbehind = cb.max_lookbehind;
+ PCRE2_UCHAR *temp = (PCRE2_UCHAR *)codestart;
+ if (PRIV(auto_possessify)(temp, utf, &cb) != 0) errorcode = ERR80;
}
-/* Failed to compile, or error while post-processing. Earlier errors get here
-via the dreaded goto. */
+/* Failed to compile, or error while post-processing. */
-if (errorcode != 0)
- {
- HAD_ERROR:
- *erroroffset = (int)(ptr - pattern);
- HAD_UTF_ERROR:
- *errorptr = errorcode;
- pcre2_code_free(re);
- re = NULL;
- goto EXIT;
- }
+if (errorcode != 0) goto HAD_CB_ERROR;
/* Successful compile. If the anchored option was not passed, set it if
we can determine that the pattern is anchored by virtue of ^ characters or \A
@@ -8952,17 +9653,22 @@ there are no occurrences of *PRUNE or *SKIP (though there is an option to
disable this case). */
if ((re->overall_options & PCRE2_ANCHORED) == 0 &&
- is_anchored(codestart, 0, &cb, 0))
+ is_anchored(codestart, 0, &cb, 0, FALSE))
re->overall_options |= PCRE2_ANCHORED;
-/* If the pattern is still not anchored and we do not have a first code unit,
-see if there is one that is asserted (these are not saved during the compile
-because they can cause conflicts with actual literals that follow). This code
-need not be obeyed if PCRE2_NO_START_OPTIMIZE is set, as the data it would
-create will not be used. */
+/* Set up the first code unit or startline flag, the required code unit, and
+then study the pattern. This code need not be obeyed if PCRE2_NO_START_OPTIMIZE
+is set, as the data it would create will not be used. Note that a first code
+unit (but not the startline flag) is useful for anchored patterns because it
+can still give a quick "no match" and also avoid searching for a last code
+unit. */
-if ((re->overall_options & (PCRE2_ANCHORED|PCRE2_NO_START_OPTIMIZE)) == 0)
+if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
{
+ /* If we do not have a first code unit, see if there is one that is asserted
+ (these are not saved during the compile because they can cause conflicts with
+ actual literals that follow). */
+
if (firstcuflags < 0)
firstcu = find_firstassertedcu(codestart, &firstcuflags, FALSE);
@@ -8995,87 +9701,86 @@ if ((re->overall_options & (PCRE2_ANCHORED|PCRE2_NO_START_OPTIMIZE)) == 0)
}
}
- /* When there is no first code unit, see if we can set the PCRE2_STARTLINE
- flag. This is helpful for multiline matches when all branches start with ^
- and also when all branches start with non-atomic .* for non-DOTALL matches
- when *PRUNE and SKIP are not present. (There is an option that disables this
- case.) */
+ /* When there is no first code unit, for non-anchored patterns, see if we can
+ set the PCRE2_STARTLINE flag. This is helpful for multiline matches when all
+ branches start with ^ and also when all branches start with non-atomic .* for
+ non-DOTALL matches when *PRUNE and SKIP are not present. (There is an option
+ that disables this case.) */
- else if (is_startline(codestart, 0, &cb, 0)) re->flags |= PCRE2_STARTLINE;
- }
+ else if ((re->overall_options & PCRE2_ANCHORED) == 0 &&
+ is_startline(codestart, 0, &cb, 0, FALSE))
+ re->flags |= PCRE2_STARTLINE;
-/* Handle the "required code unit", if one is set. In the case of an anchored
-pattern, do this only if it follows a variable length item in the pattern.
-Again, skip this if PCRE2_NO_START_OPTIMIZE is set. */
+ /* Handle the "required code unit", if one is set. In the case of an anchored
+ pattern, do this only if it follows a variable length item in the pattern. */
-if (reqcuflags >= 0 &&
- ((re->overall_options & (PCRE2_ANCHORED|PCRE2_NO_START_OPTIMIZE)) == 0 ||
- (reqcuflags & REQ_VARY) != 0))
- {
- re->last_codeunit = reqcu;
- re->flags |= PCRE2_LASTSET;
+ if (reqcuflags >= 0 &&
+ ((re->overall_options & PCRE2_ANCHORED) == 0 ||
+ (reqcuflags & REQ_VARY) != 0))
+ {
+ re->last_codeunit = reqcu;
+ re->flags |= PCRE2_LASTSET;
- /* Handle caseless required code units as for first code units (above). */
+ /* Handle caseless required code units as for first code units (above). */
- if ((reqcuflags & REQ_CASELESS) != 0)
- {
- if (reqcu < 128 || (!utf && reqcu < 255))
+ if ((reqcuflags & REQ_CASELESS) != 0)
{
- if (cb.fcc[reqcu] != reqcu) re->flags |= PCRE2_LASTCASELESS;
- }
+ if (reqcu < 128 || (!utf && reqcu < 255))
+ {
+ if (cb.fcc[reqcu] != reqcu) re->flags |= PCRE2_LASTCASELESS;
+ }
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 8
- else if (reqcu <= MAX_UTF_CODE_POINT && UCD_OTHERCASE(reqcu) != reqcu)
- re->flags |= PCRE2_LASTCASELESS;
+ else if (reqcu <= MAX_UTF_CODE_POINT && UCD_OTHERCASE(reqcu) != reqcu)
+ re->flags |= PCRE2_LASTCASELESS;
#endif
+ }
}
- }
-/* Check for a pattern than can match an empty string, so that this information
-can be provided to applications. */
+ /* Finally, study the compiled pattern to set up information such as a bitmap
+ of starting code units and a minimum matching length. */
-do
- {
- int count = 0;
- int rc = could_be_empty_branch(codestart, code, utf, &cb, TRUE, NULL, &count);
- if (rc < 0)
+ if (PRIV(study)(re) != 0)
{
- errorcode = ERR86;
- goto HAD_ERROR;
- }
- if (rc > 0)
- {
- re->flags |= PCRE2_MATCH_EMPTY;
- break;
+ errorcode = ERR31;
+ goto HAD_CB_ERROR;
}
- codestart += GET(codestart, 1);
- }
-while (*codestart == OP_ALT);
-
-/* Finally, unless PCRE2_NO_START_OPTIMIZE is set, study the compiled pattern
-to set up information such as a bitmap of starting code units and a minimum
-matching length. */
+ } /* End of start-of-match optimizations. */
-if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 &&
- PRIV(study)(re) != 0)
- {
- errorcode = ERR31;
- goto HAD_ERROR;
- }
-
-/* Control ends up here in all cases. If memory was obtained for a
-zero-terminated copy of the pattern, remember to free it before returning. Also
-free the list of named groups if a larger one had to be obtained, and likewise
-the group information vector. */
+/* Control ends up here in all cases. When running under valgrind, make a
+pattern's terminating zero defined again. If memory was obtained for the parsed
+version of the pattern, free it before returning. Also free the list of named
+groups if a larger one had to be obtained, and likewise the group information
+vector. */
EXIT:
-if (copied_pattern != stack_copied_pattern)
- ccontext->memctl.free(copied_pattern, ccontext->memctl.memory_data);
+#ifdef SUPPORT_VALGRIND
+if (zero_terminated) VALGRIND_MAKE_MEM_DEFINED(pattern + patlen, CU2BYTES(1));
+#endif
+if (cb.parsed_pattern != stack_parsed_pattern)
+ ccontext->memctl.free(cb.parsed_pattern, ccontext->memctl.memory_data);
if (cb.named_group_list_size > NAMED_GROUP_LIST_SIZE)
ccontext->memctl.free((void *)cb.named_groups, ccontext->memctl.memory_data);
-if (cb.groupinfo != c32workspace)
+if (cb.groupinfo != stack_groupinfo)
ccontext->memctl.free((void *)cb.groupinfo, ccontext->memctl.memory_data);
-
return re; /* Will be NULL after an error */
+
+/* Errors discovered in parse_regex() set the offset value in the compile
+block. Errors discovered before it is called must compute it from the ptr
+value. After parse_regex() is called, the offset in the compile block is set to
+the end of the pattern, but certain errors in compile_regex() may reset it if
+an offset is available in the parsed pattern. */
+
+HAD_CB_ERROR:
+ptr = pattern + cb.erroroffset;
+
+HAD_EARLY_ERROR:
+*erroroffset = ptr - pattern;
+
+HAD_ERROR:
+*errorptr = errorcode;
+pcre2_code_free(re);
+re = NULL;
+goto EXIT;
}
/* End of pcre2_compile.c */
diff --git a/src/3rdparty/pcre2/src/pcre2_config.c b/src/3rdparty/pcre2/src/pcre2_config.c
index e99272f577..d009c0a676 100644
--- a/src/3rdparty/pcre2/src/pcre2_config.c
+++ b/src/3rdparty/pcre2/src/pcre2_config.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -84,13 +84,14 @@ if (where == NULL) /* Requests a length */
return PCRE2_ERROR_BADOPTION;
case PCRE2_CONFIG_BSR:
+ case PCRE2_CONFIG_HEAPLIMIT:
case PCRE2_CONFIG_JIT:
case PCRE2_CONFIG_LINKSIZE:
case PCRE2_CONFIG_MATCHLIMIT:
+ case PCRE2_CONFIG_DEPTHLIMIT:
case PCRE2_CONFIG_NEWLINE:
case PCRE2_CONFIG_PARENSLIMIT:
- case PCRE2_CONFIG_RECURSIONLIMIT:
- case PCRE2_CONFIG_STACKRECURSE:
+ case PCRE2_CONFIG_STACKRECURSE: /* Obsolete */
case PCRE2_CONFIG_UNICODE:
return sizeof(uint32_t);
@@ -116,6 +117,10 @@ switch (what)
#endif
break;
+ case PCRE2_CONFIG_HEAPLIMIT:
+ *((uint32_t *)where) = HEAP_LIMIT;
+ break;
+
case PCRE2_CONFIG_JIT:
#ifdef SUPPORT_JIT
*((uint32_t *)where) = 1;
@@ -143,6 +148,10 @@ switch (what)
*((uint32_t *)where) = MATCH_LIMIT;
break;
+ case PCRE2_CONFIG_DEPTHLIMIT:
+ *((uint32_t *)where) = MATCH_LIMIT_DEPTH;
+ break;
+
case PCRE2_CONFIG_NEWLINE:
*((uint32_t *)where) = NEWLINE_DEFAULT;
break;
@@ -151,16 +160,11 @@ switch (what)
*((uint32_t *)where) = PARENS_NEST_LIMIT;
break;
- case PCRE2_CONFIG_RECURSIONLIMIT:
- *((uint32_t *)where) = MATCH_LIMIT_RECURSION;
- break;
+ /* This is now obsolete. The stack is no longer used via recursion for
+ handling backtracking in pcre2_match(). */
case PCRE2_CONFIG_STACKRECURSE:
-#ifdef HEAP_MATCH_RECURSE
*((uint32_t *)where) = 0;
-#else
- *((uint32_t *)where) = 1;
-#endif
break;
case PCRE2_CONFIG_UNICODE_VERSION:
diff --git a/src/3rdparty/pcre2/src/pcre2_context.c b/src/3rdparty/pcre2/src/pcre2_context.c
index ae050fe92c..2c14df0080 100644
--- a/src/3rdparty/pcre2/src/pcre2_context.c
+++ b/src/3rdparty/pcre2/src/pcre2_context.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -138,7 +138,8 @@ const pcre2_compile_context PRIV(default_compile_context) = {
PCRE2_UNSET, /* Max pattern length */
BSR_DEFAULT, /* Backslash R default */
NEWLINE_DEFAULT, /* Newline convention */
- PARENS_NEST_LIMIT }; /* As it says */
+ PARENS_NEST_LIMIT, /* As it says */
+ 0 }; /* Extra options */
/* The create function copies the default into the new memory, but must
override the default memory handling functions if a gcontext was provided. */
@@ -161,9 +162,6 @@ when no context is supplied to a match function. */
const pcre2_match_context PRIV(default_match_context) = {
{ default_malloc, default_free, NULL },
-#ifdef HEAP_MATCH_RECURSE
- { default_malloc, default_free, NULL },
-#endif
#ifdef SUPPORT_JIT
NULL,
NULL,
@@ -171,8 +169,9 @@ const pcre2_match_context PRIV(default_match_context) = {
NULL,
NULL,
PCRE2_UNSET, /* Offset limit */
+ HEAP_LIMIT,
MATCH_LIMIT,
- MATCH_LIMIT_RECURSION };
+ MATCH_LIMIT_DEPTH };
/* The create function copies the default into the new memory, but must
override the default memory handling functions if a gcontext was provided. */
@@ -190,6 +189,36 @@ return mcontext;
}
+/* A default convert context is set up to save having to initialize at run time
+when no context is supplied to the convert function. */
+
+const pcre2_convert_context PRIV(default_convert_context) = {
+ { default_malloc, default_free, NULL }, /* Default memory handling */
+#ifdef _WIN32
+ CHAR_BACKSLASH, /* Default path separator */
+ CHAR_GRAVE_ACCENT /* Default escape character */
+#else /* Not Windows */
+ CHAR_SLASH, /* Default path separator */
+ CHAR_BACKSLASH /* Default escape character */
+#endif
+ };
+
+/* The create function copies the default into the new memory, but must
+override the default memory handling functions if a gcontext was provided. */
+
+PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
+pcre2_convert_context_create(pcre2_general_context *gcontext)
+{
+pcre2_convert_context *ccontext = PRIV(memctl_malloc)(
+ sizeof(pcre2_real_convert_context), (pcre2_memctl *)gcontext);
+if (ccontext == NULL) return NULL;
+*ccontext = PRIV(default_convert_context);
+if (gcontext != NULL)
+ *((pcre2_memctl *)ccontext) = *((pcre2_memctl *)gcontext);
+return ccontext;
+}
+
+
/*************************************************
* Context copy functions *
*************************************************/
@@ -231,11 +260,22 @@ return new;
+PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
+pcre2_convert_context_copy(pcre2_convert_context *ccontext)
+{
+pcre2_convert_context *new =
+ ccontext->memctl.malloc(sizeof(pcre2_real_convert_context),
+ ccontext->memctl.memory_data);
+if (new == NULL) return NULL;
+memcpy(new, ccontext, sizeof(pcre2_real_convert_context));
+return new;
+}
+
+
/*************************************************
* Context free functions *
*************************************************/
-
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
pcre2_general_context_free(pcre2_general_context *gcontext)
{
@@ -260,6 +300,12 @@ if (mcontext != NULL)
}
+PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
+pcre2_convert_context_free(pcre2_convert_context *ccontext)
+{
+if (ccontext != NULL)
+ ccontext->memctl.free(ccontext, ccontext->memctl.memory_data);
+}
/*************************************************
@@ -271,7 +317,7 @@ data is given. Only some of the functions are able to test the validity of the
data. */
-/* ------------ Compile contexts ------------ */
+/* ------------ Compile context ------------ */
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_character_tables(pcre2_compile_context *ccontext,
@@ -313,6 +359,7 @@ switch(newline)
case PCRE2_NEWLINE_CRLF:
case PCRE2_NEWLINE_ANY:
case PCRE2_NEWLINE_ANYCRLF:
+ case PCRE2_NEWLINE_NUL:
ccontext->newline_convention = newline;
return 0;
@@ -329,6 +376,13 @@ return 0;
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, uint32_t options)
+{
+ccontext->extra_options = options;
+return 0;
+}
+
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext,
int (*guard)(uint32_t, void *), void *user_data)
{
@@ -338,7 +392,7 @@ return 0;
}
-/* ------------ Match contexts ------------ */
+/* ------------ Match context ------------ */
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_callout(pcre2_match_context *mcontext,
@@ -350,6 +404,13 @@ return 0;
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit)
+{
+mcontext->heap_limit = limit;
+return 0;
+}
+
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_match_limit(pcre2_match_context *mcontext, uint32_t limit)
{
mcontext->match_limit = limit;
@@ -357,17 +418,26 @@ return 0;
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_depth_limit(pcre2_match_context *mcontext, uint32_t limit)
+{
+mcontext->depth_limit = limit;
+return 0;
+}
+
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_offset_limit(pcre2_match_context *mcontext, PCRE2_SIZE limit)
{
mcontext->offset_limit = limit;
return 0;
}
+/* This function became obsolete at release 10.30. It is kept as a synonym for
+backwards compatibility. */
+
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_recursion_limit(pcre2_match_context *mcontext, uint32_t limit)
{
-mcontext->recursion_limit = limit;
-return 0;
+return pcre2_set_depth_limit(mcontext, limit);
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
@@ -375,17 +445,32 @@ pcre2_set_recursion_memory_management(pcre2_match_context *mcontext,
void *(*mymalloc)(size_t, void *), void (*myfree)(void *, void *),
void *mydata)
{
-#ifdef HEAP_MATCH_RECURSE
-mcontext->stack_memctl.malloc = mymalloc;
-mcontext->stack_memctl.free = myfree;
-mcontext->stack_memctl.memory_data = mydata;
-#else
(void)mcontext;
(void)mymalloc;
(void)myfree;
(void)mydata;
-#endif
+return 0;
+}
+
+/* ------------ Convert context ------------ */
+
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_glob_separator(pcre2_convert_context *ccontext, uint32_t separator)
+{
+if (separator != CHAR_SLASH && separator != CHAR_BACKSLASH &&
+ separator != CHAR_DOT) return PCRE2_ERROR_BADDATA;
+ccontext->glob_separator = separator;
+return 0;
+}
+
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_glob_escape(pcre2_convert_context *ccontext, uint32_t escape)
+{
+if (escape > 255 || (escape != 0 && !ispunct(escape)))
+ return PCRE2_ERROR_BADDATA;
+ccontext->glob_escape = escape;
return 0;
}
/* End of pcre2_context.c */
+
diff --git a/src/3rdparty/pcre2/src/pcre2_dfa_match.c b/src/3rdparty/pcre2/src/pcre2_dfa_match.c
index 12b31b1b36..5ae13944c7 100644
--- a/src/3rdparty/pcre2/src/pcre2_dfa_match.c
+++ b/src/3rdparty/pcre2/src/pcre2_dfa_match.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -83,7 +83,7 @@ in others, so I abandoned this code. */
#include "pcre2_internal.h"
#define PUBLIC_DFA_MATCH_OPTIONS \
- (PCRE2_ANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
+ (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART)
@@ -172,7 +172,7 @@ static const uint8_t coptable[] = {
0, /* Assert not */
0, /* Assert behind */
0, /* Assert behind not */
- 0, 0, /* ONCE, ONCE_NC */
+ 0, /* ONCE */
0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */
0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */
0, 0, /* CREF, DNCREF */
@@ -245,7 +245,7 @@ static const uint8_t poptable[] = {
0, /* Assert not */
0, /* Assert behind */
0, /* Assert behind not */
- 0, 0, /* ONCE, ONCE_NC */
+ 0, /* ONCE */
0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */
0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */
0, 0, /* CREF, DNCREF */
@@ -371,18 +371,14 @@ internal_dfa_match(
uint32_t offsetcount,
int *workspace,
int wscount,
- int rlevel)
+ uint32_t rlevel)
{
stateblock *active_states, *new_states, *temp_states;
stateblock *next_active_state, *next_new_state;
-
const uint8_t *ctypes, *lcc, *fcc;
PCRE2_SPTR ptr;
PCRE2_SPTR end_code;
-PCRE2_SPTR first_op;
-
dfa_recursion_info new_recursive;
-
int active_count, new_count, match_count;
/* Some fields in the mb block are frequently referenced, so we load them into
@@ -400,7 +396,8 @@ BOOL utf = FALSE;
BOOL reset_could_continue = FALSE;
-rlevel++;
+if (mb->match_call_count++ >= mb->match_limit) return PCRE2_ERROR_MATCHLIMIT;
+if (rlevel++ > mb->match_limit_depth) return PCRE2_ERROR_DEPTHLIMIT;
offsetcount &= (uint32_t)(-2); /* Round down */
wscount -= 2;
@@ -417,21 +414,15 @@ active_states = (stateblock *)(workspace + 2);
next_new_state = new_states = active_states + wscount;
new_count = 0;
-first_op = this_start_code + 1 + LINK_SIZE +
- ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA ||
- *this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS)
- ? IMM2_SIZE:0);
-
/* The first thing in any (sub) pattern is a bracket of some sort. Push all
the alternative states onto the list, and find out where the end is. This
makes is possible to use this function recursively, when we want to stop at a
matching internal ket rather than at the end.
-If the first opcode in the first alternative is OP_REVERSE, we are dealing with
-a backward assertion. In that case, we have to find out the maximum amount to
-move back, and set up each alternative appropriately. */
+If we are dealing with a backward assertion we have to find out the maximum
+amount to move back, and set up each alternative appropriately. */
-if (*first_op == OP_REVERSE)
+if (*this_start_code == OP_ASSERTBACK || *this_start_code == OP_ASSERTBACK_NOT)
{
size_t max_back = 0;
size_t gone_back;
@@ -476,15 +467,17 @@ if (*first_op == OP_REVERSE)
if (current_subject < mb->start_used_ptr)
mb->start_used_ptr = current_subject;
- /* Now we can process the individual branches. */
+ /* Now we can process the individual branches. There will be an OP_REVERSE at
+ the start of each branch, except when the length of the branch is zero. */
end_code = this_start_code;
do
{
- size_t back = (size_t)GET(end_code, 2+LINK_SIZE);
+ uint32_t revlen = (end_code[1+LINK_SIZE] == OP_REVERSE)? 1 + LINK_SIZE : 0;
+ size_t back = (revlen == 0)? 0 : (size_t)GET(end_code, 2+LINK_SIZE);
if (back <= gone_back)
{
- int bstate = (int)(end_code - start_code + 2 + 2*LINK_SIZE);
+ int bstate = (int)(end_code - start_code + 1 + LINK_SIZE + revlen);
ADD_NEW_DATA(-bstate, 0, (int)(gone_back - back));
}
end_code += GET(end_code, 1);
@@ -697,7 +690,7 @@ for (;;)
case OP_TABLE_LENGTH +
((sizeof(coptable) == OP_TABLE_LENGTH) &&
(sizeof(poptable) == OP_TABLE_LENGTH)):
- break;
+ return 0;
/* ========================================================================== */
/* Reached a closing bracket. If not at the end of the pattern, carry
@@ -1386,8 +1379,46 @@ for (;;)
if (!utf) d = *nptr; else { GETCHARLEN(d, nptr, dlen); }
rgb = UCD_GRAPHBREAK(d);
if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = nptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(d, bptr);
+ }
+ else
+#endif
+ d = *bptr;
+ if (UCD_GRAPHBREAK(d) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
ncount++;
- lgb = rgb;
nptr += dlen;
}
count++;
@@ -1648,8 +1679,46 @@ for (;;)
if (!utf) d = *nptr; else { GETCHARLEN(d, nptr, dlen); }
rgb = UCD_GRAPHBREAK(d);
if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = nptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(d, bptr);
+ }
+ else
+#endif
+ d = *bptr;
+ if (UCD_GRAPHBREAK(d) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
ncount++;
- lgb = rgb;
nptr += dlen;
}
ADD_NEW_DATA(-(state_offset + count), 0, ncount);
@@ -1919,8 +1988,46 @@ for (;;)
if (!utf) d = *nptr; else { GETCHARLEN(d, nptr, dlen); }
rgb = UCD_GRAPHBREAK(d);
if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = nptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(d, bptr);
+ }
+ else
+#endif
+ d = *bptr;
+ if (UCD_GRAPHBREAK(d) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
ncount++;
- lgb = rgb;
nptr += dlen;
}
if (nptr >= end_subject && (mb->moptions & PCRE2_PARTIAL_HARD) != 0)
@@ -2109,8 +2216,46 @@ for (;;)
if (!utf) d = *nptr; else { GETCHARLEN(d, nptr, dlen); }
rgb = UCD_GRAPHBREAK(d);
if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = nptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(d, bptr);
+ }
+ else
+#endif
+ d = *bptr;
+ if (UCD_GRAPHBREAK(d) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
ncount++;
- lgb = rgb;
nptr += dlen;
}
if (nptr >= end_subject && (mb->moptions & PCRE2_PARTIAL_HARD) != 0)
@@ -2136,6 +2281,7 @@ for (;;)
case 0x2029:
#endif /* Not EBCDIC */
if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break;
+ /* Fall through */
case CHAR_LF:
ADD_NEW(state_offset + 1, 0);
@@ -2539,11 +2685,13 @@ for (;;)
if (isinclass)
{
int max = (int)GET2(ecode, 1 + IMM2_SIZE);
- if (*ecode == OP_CRPOSRANGE)
+
+ if (*ecode == OP_CRPOSRANGE && count >= (int)GET2(ecode, 1))
{
active_count--; /* Remove non-match possibility */
next_active_state--;
}
+
if (++count >= max && max != 0) /* Max 0 => no limit */
{ ADD_NEW(next_state_offset + 1 + 2 * IMM2_SIZE, 0); }
else
@@ -2591,7 +2739,7 @@ for (;;)
sizeof(local_workspace)/sizeof(int), /* size of same */
rlevel); /* function recursion level */
- if (rc == PCRE2_ERROR_DFA_UITEM) return rc;
+ if (rc < 0 && rc != PCRE2_ERROR_NOMATCH) return rc;
if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))
{ ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
}
@@ -2710,7 +2858,7 @@ for (;;)
sizeof(local_workspace)/sizeof(int), /* size of same */
rlevel); /* function recursion level */
- if (rc == PCRE2_ERROR_DFA_UITEM) return rc;
+ if (rc < 0 && rc != PCRE2_ERROR_NOMATCH) return rc;
if ((rc >= 0) ==
(condcode == OP_ASSERT || condcode == OP_ASSERTBACK))
{ ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
@@ -2889,7 +3037,6 @@ for (;;)
/*-----------------------------------------------------------------*/
case OP_ONCE:
- case OP_ONCE_NC:
{
PCRE2_SIZE local_offsets[2];
int local_workspace[1000];
@@ -3069,7 +3216,7 @@ for (;;)
)
)
match_count = PCRE2_ERROR_PARTIAL;
- break; /* In effect, "return", but see the comment below */
+ break; /* Exit from loop along the subject string */
}
/* One or more states are active for the next character. */
@@ -3077,11 +3224,13 @@ for (;;)
ptr += clen; /* Advance to next subject character */
} /* Loop to move along the subject string */
-/* Control gets here from "break" a few lines above. We do it this way because
-if we use "return" above, we have compiler trouble. Some compilers warn if
-there's nothing here because they think the function doesn't return a value. On
-the other hand, if we put a dummy statement here, some more clever compilers
-complain that it can't be reached. Sigh. */
+/* Control gets here from "break" a few lines above. If we have a match and
+PCRE2_ENDANCHORED is set, the match fails. */
+
+if (match_count >= 0 &&
+ ((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0 &&
+ ptr < end_subject)
+ match_count = PCRE2_ERROR_NOMATCH;
return match_count;
}
@@ -3115,7 +3264,7 @@ Returns: > 0 => number of match offset pairs placed in offsets
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
PCRE2_SIZE start_offset, uint32_t options, pcre2_match_data *match_data,
- pcre2_match_context *mcontext, int *workspace, size_t wscount)
+ pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount)
{
const pcre2_real_code *re = (const pcre2_real_code *)code;
@@ -3154,6 +3303,13 @@ if (re == NULL || subject == NULL || workspace == NULL || match_data == NULL)
if (wscount < 20) return PCRE2_ERROR_DFA_WSSIZE;
if (start_offset > length) return PCRE2_ERROR_BADOFFSET;
+/* Partial matching and PCRE2_ENDANCHORED are currently not allowed at the same
+time. */
+
+if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0 &&
+ ((re->overall_options | options) & PCRE2_ENDANCHORED) != 0)
+ return PCRE2_ERROR_BADOPTION;
+
/* Check that the first field in the block is the magic number. If it is not,
return with PCRE2_ERROR_BADMAGIC. */
@@ -3216,6 +3372,8 @@ if (mcontext == NULL)
{
mb->callout = NULL;
mb->memctl = re->memctl;
+ mb->match_limit = PRIV(default_match_context).match_limit;
+ mb->match_limit_depth = PRIV(default_match_context).depth_limit;
}
else
{
@@ -3228,8 +3386,16 @@ else
mb->callout = mcontext->callout;
mb->callout_data = mcontext->callout_data;
mb->memctl = mcontext->memctl;
+ mb->match_limit = mcontext->match_limit;
+ mb->match_limit_depth = mcontext->depth_limit;
}
+if (mb->match_limit > re->limit_match)
+ mb->match_limit = re->limit_match;
+
+if (mb->match_limit_depth > re->limit_depth)
+ mb->match_limit_depth = re->limit_depth;
+
mb->start_code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) +
re->name_count * re->name_entry_size;
mb->tables = re->tables;
@@ -3238,6 +3404,7 @@ mb->end_subject = end_subject;
mb->start_offset = start_offset;
mb->moptions = options;
mb->poptions = re->overall_options;
+mb->match_call_count = 0;
/* Process the \R and newline settings. */
@@ -3255,6 +3422,11 @@ switch(re->newline_convention)
mb->nl[0] = CHAR_NL;
break;
+ case PCRE2_NEWLINE_NUL:
+ mb->nllen = 1;
+ mb->nl[0] = CHAR_NUL;
+ break;
+
case PCRE2_NEWLINE_CRLF:
mb->nllen = 2;
mb->nl[0] = CHAR_CR;
@@ -3321,34 +3493,27 @@ if (utf && (options & PCRE2_NO_UTF_CHECK) == 0)
}
#endif /* SUPPORT_UNICODE */
-/* Set up the first code unit to match, if available. The first_codeunit value
-is never set for an anchored regular expression, but the anchoring may be
-forced at run time, so we have to test for anchoring. The first code unit may
-be unset for an unanchored pattern, of course. If there's no first code unit
-there may be a bitmap of possible first characters. */
+/* Set up the first code unit to match, if available. If there's no first code
+unit there may be a bitmap of possible first characters. */
-if (!anchored)
+if ((re->flags & PCRE2_FIRSTSET) != 0)
{
- if ((re->flags & PCRE2_FIRSTSET) != 0)
+ has_first_cu = TRUE;
+ first_cu = first_cu2 = (PCRE2_UCHAR)(re->first_codeunit);
+ if ((re->flags & PCRE2_FIRSTCASELESS) != 0)
{
- has_first_cu = TRUE;
- first_cu = first_cu2 = (PCRE2_UCHAR)(re->first_codeunit);
- if ((re->flags & PCRE2_FIRSTCASELESS) != 0)
- {
- first_cu2 = TABLE_GET(first_cu, mb->tables + fcc_offset, first_cu);
+ first_cu2 = TABLE_GET(first_cu, mb->tables + fcc_offset, first_cu);
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 8
- if (utf && first_cu > 127)
- first_cu2 = (PCRE2_UCHAR)UCD_OTHERCASE(first_cu);
+ if (utf && first_cu > 127)
+ first_cu2 = (PCRE2_UCHAR)UCD_OTHERCASE(first_cu);
#endif
- }
}
- else
- if (!startline && (re->flags & PCRE2_FIRSTMAPSET) != 0)
- start_bits = re->start_bitmap;
}
+else
+ if (!startline && (re->flags & PCRE2_FIRSTMAPSET) != 0)
+ start_bits = re->start_bitmap;
-/* For anchored or unanchored matches, there may be a "last known required
-character" set. */
+/* There may be a "last known required code unit" set. */
if ((re->flags & PCRE2_LASTSET) != 0)
{
@@ -3394,8 +3559,8 @@ for (;;)
/* If firstline is TRUE, the start of the match is constrained to the first
line of a multiline string. That is, the match must be before or at the
first newline. Implement this by temporarily adjusting end_subject so that
- we stop the optimization scans at a newline. If the match fails at the
- newline, later code breaks this loop. */
+ we stop the optimization scans for a first code unit at a newline. If the
+ match fails at the newline, later code breaks this loop. */
if (firstline)
{
@@ -3415,69 +3580,137 @@ for (;;)
end_subject = t;
}
- /* Advance to a unique first code unit if there is one. */
+ /* Anchored: check the first code unit if one is recorded. This may seem
+ pointless but it can help in detecting a no match case without scanning for
+ the required code unit. */
- if (has_first_cu)
+ if (anchored)
{
- PCRE2_UCHAR smc;
- if (first_cu != first_cu2)
- while (start_match < end_subject &&
- (smc = UCHAR21TEST(start_match)) != first_cu && smc != first_cu2)
- start_match++;
- else
- while (start_match < end_subject && UCHAR21TEST(start_match) != first_cu)
- start_match++;
+ if (has_first_cu || start_bits != NULL)
+ {
+ BOOL ok = start_match < end_subject;
+ if (ok)
+ {
+ PCRE2_UCHAR c = UCHAR21TEST(start_match);
+ ok = has_first_cu && (c == first_cu || c == first_cu2);
+ if (!ok && start_bits != NULL)
+ {
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ if (c > 255) c = 255;
+#endif
+ ok = (start_bits[c/8] & (1 << (c&7))) != 0;
+ }
+ }
+ if (!ok) break;
+ }
}
- /* Or to just after a linebreak for a multiline match */
+ /* Not anchored. Advance to a unique first code unit if there is one. In
+ 8-bit mode, the use of memchr() gives a big speed up, even though we have
+ to call it twice in caseless mode, in order to find the earliest occurrence
+ of the character in either of its cases. */
- else if (startline)
+ else
{
- if (start_match > mb->start_subject + start_offset)
+ if (has_first_cu)
{
-#ifdef SUPPORT_UNICODE
- if (utf)
+ if (first_cu != first_cu2) /* Caseless */
{
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- {
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ PCRE2_UCHAR smc;
+ while (start_match < end_subject &&
+ (smc = UCHAR21TEST(start_match)) != first_cu &&
+ smc != first_cu2)
start_match++;
- ACROSSCHAR(start_match < end_subject, *start_match,
- start_match++);
- }
+#else /* 8-bit code units */
+ PCRE2_SPTR pp1 =
+ memchr(start_match, first_cu, end_subject-start_match);
+ PCRE2_SPTR pp2 =
+ memchr(start_match, first_cu2, end_subject-start_match);
+ if (pp1 == NULL)
+ start_match = (pp2 == NULL)? end_subject : pp2;
+ else
+ start_match = (pp2 == NULL || pp1 < pp2)? pp1 : pp2;
+#endif
}
+
+ /* The caseful case */
+
else
+ {
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ while (start_match < end_subject && UCHAR21TEST(start_match) !=
+ first_cu)
+ start_match++;
+#else
+ start_match = memchr(start_match, first_cu, end_subject - start_match);
+ if (start_match == NULL) start_match = end_subject;
#endif
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- start_match++;
+ }
- /* If we have just passed a CR and the newline option is ANY or
- ANYCRLF, and we are now at a LF, advance the match position by one more
- code unit. */
+ /* If we can't find the required code unit, break the bumpalong loop,
+ to force a match failure, except when doing partial matching, when we
+ let the next cycle run at the end of the subject. To see why, consider
+ the pattern /(?<=abc)def/, which partially matches "abc", even though
+ the string does not contain the starting character "d". */
- if (start_match[-1] == CHAR_CR &&
- (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) &&
- start_match < end_subject &&
- UCHAR21TEST(start_match) == CHAR_NL)
- start_match++;
+ if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0 &&
+ start_match >= end_subject)
+ break;
}
- }
- /* Or to a non-unique first code unit if any have been identified. The
- bitmap contains only 256 bits. When code units are 16 or 32 bits wide, all
- code units greater than 254 set the 255 bit. */
+ /* If there's no first code unit, advance to just after a linebreak for a
+ multiline match if required. */
- else if (start_bits != NULL)
- {
- while (start_match < end_subject)
+ else if (startline)
+ {
+ if (start_match > mb->start_subject + start_offset)
+ {
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ while (start_match < end_subject && !WAS_NEWLINE(start_match))
+ {
+ start_match++;
+ ACROSSCHAR(start_match < end_subject, *start_match,
+ start_match++);
+ }
+ }
+ else
+#endif
+ while (start_match < end_subject && !WAS_NEWLINE(start_match))
+ start_match++;
+
+ /* If we have just passed a CR and the newline option is ANY or
+ ANYCRLF, and we are now at a LF, advance the match position by one
+ more code unit. */
+
+ if (start_match[-1] == CHAR_CR &&
+ (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) &&
+ start_match < end_subject &&
+ UCHAR21TEST(start_match) == CHAR_NL)
+ start_match++;
+ }
+ }
+
+ /* If there's no first code unit or a requirement for a multiline line
+ start, advance to a non-unique first code unit if any have been
+ identified. The bitmap contains only 256 bits. When code units are 16 or
+ 32 bits wide, all code units greater than 254 set the 255 bit. */
+
+ else if (start_bits != NULL)
{
- register uint32_t c = UCHAR21TEST(start_match);
+ while (start_match < end_subject)
+ {
+ uint32_t c = UCHAR21TEST(start_match);
#if PCRE2_CODE_UNIT_WIDTH != 8
- if (c > 255) c = 255;
+ if (c > 255) c = 255;
#endif
- if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
- start_match++;
+ if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
+ start_match++;
+ }
}
- }
+ } /* End of first code unit handling */
/* Restore fudged end_subject */
@@ -3510,7 +3743,7 @@ for (;;)
if (has_req_cu && end_subject - start_match < REQ_CU_MAX)
{
- register PCRE2_SPTR p = start_match + (has_first_cu? 1:0);
+ PCRE2_SPTR p = start_match + (has_first_cu? 1:0);
/* We don't need to repeat the search if we haven't yet reached the
place we found it at last time. */
@@ -3521,7 +3754,7 @@ for (;;)
{
while (p < end_subject)
{
- register uint32_t pp = UCHAR21INCTEST(p);
+ uint32_t pp = UCHAR21INCTEST(p);
if (pp == req_cu || pp == req_cu2) { p--; break; }
}
}
diff --git a/src/3rdparty/pcre2/src/pcre2_error.c b/src/3rdparty/pcre2/src/pcre2_error.c
index 77fd5f4124..d98cae9963 100644
--- a/src/3rdparty/pcre2/src/pcre2_error.c
+++ b/src/3rdparty/pcre2/src/pcre2_error.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -91,13 +91,13 @@ static const unsigned char compile_error_texts[] =
"failed to allocate heap memory\0"
"unmatched closing parenthesis\0"
"internal error: code overflow\0"
- "letter or underscore expected after (?< or (?'\0"
+ "missing closing parenthesis for condition\0"
/* 25 */
"lookbehind assertion is not fixed length\0"
- "malformed number or name after (?(\0"
+ "a relative value of zero is not allowed\0"
"conditional group contains more than two branches\0"
"assertion expected after (?( or (?(?C)\0"
- "(?R or (?[+-]digits must be followed by )\0"
+ "digit expected after (?+ or (?-\0"
/* 30 */
"unknown POSIX class name\0"
"internal error in pcre2_study(): should not occur\0"
@@ -105,7 +105,7 @@ static const unsigned char compile_error_texts[] =
"parentheses are too deeply nested (stack check)\0"
"character code point value in \\x{} or \\o{} is too large\0"
/* 35 */
- "invalid condition (?(0)\0"
+ "lookbehind is too complicated\0"
"\\C is not allowed in a lookbehind assertion in UTF-" XSTRING(PCRE2_CODE_UNIT_WIDTH) " mode\0"
"PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0"
"number after (?C is greater than 255\0"
@@ -132,13 +132,13 @@ static const unsigned char compile_error_texts[] =
"missing opening brace after \\o\0"
"internal error: unknown newline setting\0"
"\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0"
- "a numbered reference must not be zero\0"
+ "(?R (recursive pattern call) must be followed by a closing parenthesis\0"
"an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0"
/* 60 */
"(*VERB) not recognized or malformed\0"
- "number is too big\0"
+ "group number is too big\0"
"subpattern name expected\0"
- "digit expected after (?+\0"
+ "internal error: parsed pattern overflow\0"
"non-octal character in \\o{} (closing brace missing?)\0"
/* 65 */
"different names for subpatterns of the same number are not allowed\0"
@@ -151,9 +151,9 @@ static const unsigned char compile_error_texts[] =
#endif
"\\k is not followed by a braced, angle-bracketed, or quoted name\0"
/* 70 */
- "internal error: unknown opcode in find_fixedlength()\0"
+ "internal error: unknown meta code in check_lookbehinds()\0"
"\\N is not supported in a class\0"
- "SPARE ERROR\0"
+ "callout string is too long\0"
"disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0"
"using UTF is disabled by the application\0"
/* 75 */
@@ -161,7 +161,7 @@ static const unsigned char compile_error_texts[] =
"name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0"
"character code point value in \\u.... sequence is too large\0"
"digits missing in \\x{} or \\o{}\0"
- "syntax error in (?(VERSION condition\0"
+ "syntax error or number too big in (?(VERSION condition\0"
/* 80 */
"internal error: unknown opcode in auto_possessify()\0"
"missing terminating delimiter for callout with string argument\0"
@@ -173,6 +173,11 @@ static const unsigned char compile_error_texts[] =
"regular expression is too complicated\0"
"lookbehind assertion is too long\0"
"pattern string is longer than the limit set by the application\0"
+ "internal error: unknown code in parsed pattern\0"
+ /* 90 */
+ "internal error: bad code value in parsed_skip()\0"
+ "PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode\0"
+ "invalid option bits with PCRE2_LITERAL\0"
;
/* Match-time and UTF error texts are in the same format. */
@@ -241,7 +246,7 @@ static const unsigned char match_error_texts[] =
"non-unique substring name\0"
"NULL argument passed\0"
"nested recursion at the same subject position\0"
- "recursion limit exceeded\0"
+ "matching depth limit exceeded\0"
"requested value is not available\0"
/* 55 */
"requested value is not set\0"
@@ -253,6 +258,8 @@ static const unsigned char match_error_texts[] =
"match with end before start is not supported\0"
"too many replacements (more than INT_MAX)\0"
"bad serialized data\0"
+ "heap limit exceeded\0"
+ "invalid syntax\0"
;
@@ -268,17 +275,17 @@ distinct.
Arguments:
enumber error number
buffer where to put the message (zero terminated)
- size size of the buffer
+ size size of the buffer in code units
Returns: length of message if all is well
negative on error
*/
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
-pcre2_get_error_message(int enumber, PCRE2_UCHAR *buffer, size_t size)
+pcre2_get_error_message(int enumber, PCRE2_UCHAR *buffer, PCRE2_SIZE size)
{
const unsigned char *message;
-size_t i;
+PCRE2_SIZE i;
int n;
if (size == 0) return PCRE2_ERROR_NOMEMORY;
@@ -301,8 +308,8 @@ else /* Invalid error number */
for (; n > 0; n--)
{
- while (*message++ != CHAR_NULL) {};
- if (*message == CHAR_NULL) return PCRE2_ERROR_BADDATA;
+ while (*message++ != CHAR_NUL) {};
+ if (*message == CHAR_NUL) return PCRE2_ERROR_BADDATA;
}
for (i = 0; *message != 0; i++)
diff --git a/src/3rdparty/pcre2/src/pcre2_find_bracket.c b/src/3rdparty/pcre2/src/pcre2_find_bracket.c
index 803e719765..357385a11c 100644
--- a/src/3rdparty/pcre2/src/pcre2_find_bracket.c
+++ b/src/3rdparty/pcre2/src/pcre2_find_bracket.c
@@ -71,7 +71,7 @@ PRIV(find_bracket)(PCRE2_SPTR code, BOOL utf, int number)
{
for (;;)
{
- register PCRE2_UCHAR c = *code;
+ PCRE2_UCHAR c = *code;
if (c == OP_END) return NULL;
diff --git a/src/3rdparty/pcre2/src/pcre2_internal.h b/src/3rdparty/pcre2/src/pcre2_internal.h
index 56908708aa..9ccce25d47 100644
--- a/src/3rdparty/pcre2/src/pcre2_internal.h
+++ b/src/3rdparty/pcre2/src/pcre2_internal.h
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -142,20 +142,6 @@ pcre2_match() because of the way it backtracks. */
#define PCRE2_SPTR CUSTOM_SUBJECT_PTR
#endif
-/* When compiling with the MSVC compiler, it is sometimes necessary to include
-a "calling convention" before exported function names. (This is secondhand
-information; I know nothing about MSVC myself). For example, something like
-
- void __cdecl function(....)
-
-might be needed. In order so make this easy, all the exported functions have
-PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
-set, we ensure here that it has no effect. */
-
-#ifndef PCRE2_CALL_CONVENTION
-#define PCRE2_CALL_CONVENTION
-#endif
-
/* When checking for integer overflow in pcre2_compile(), we need to handle
large integers. If a 64-bit integer type is available, we can use that.
Otherwise we have to cast to double, which of course requires floating point
@@ -254,6 +240,16 @@ not rely on this. */
#define COMPILE_ERROR_BASE 100
+/* The initial frames vector for remembering backtracking points in
+pcre2_match() is allocated on the system stack, of this size (bytes). The size
+must be a multiple of sizeof(PCRE2_SPTR) in all environments, so making it a
+multiple of 8 is best. Typical frame sizes are a few hundred bytes (it depends
+on the number of capturing parentheses) so 20K handles quite a few frames. A
+larger vector on the heap is obtained for patterns that need more frames. The
+maximum size of this can be limited. */
+
+#define START_FRAMES_SIZE 20480
+
/* Define the default BSR convention. */
#ifdef BSR_ANYCRLF
@@ -561,9 +557,14 @@ enum { PCRE2_MATCHEDBY_INTERPRETER, /* pcre2_match() */
#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */
/* The maximum remaining length of subject we are prepared to search for a
-req_unit match. */
+req_unit match. In 8-bit mode, memchr() is used and is much faster than the
+search loop that has to be used in 16-bit and 32-bit modes. */
+#if PCRE2_CODE_UNIT_WIDTH == 8
+#define REQ_CU_MAX 2000
+#else
#define REQ_CU_MAX 1000
+#endif
/* Offsets for the bitmap tables in the cbits set of tables. Each table
contains a set of bits for a class map. Some classes are built by combining
@@ -682,7 +683,7 @@ a positive value. */
/* The remaining definitions work in both environments. */
-#define CHAR_NULL '\0'
+#define CHAR_NUL '\0'
#define CHAR_HT '\t'
#define CHAR_VT '\v'
#define CHAR_FF '\f'
@@ -923,6 +924,7 @@ a positive value. */
#define STRING_CRLF_RIGHTPAR "CRLF)"
#define STRING_ANY_RIGHTPAR "ANY)"
#define STRING_ANYCRLF_RIGHTPAR "ANYCRLF)"
+#define STRING_NUL_RIGHTPAR "NUL)"
#define STRING_BSR_ANYCRLF_RIGHTPAR "BSR_ANYCRLF)"
#define STRING_BSR_UNICODE_RIGHTPAR "BSR_UNICODE)"
#define STRING_UTF8_RIGHTPAR "UTF8)"
@@ -936,7 +938,9 @@ a positive value. */
#define STRING_NO_START_OPT_RIGHTPAR "NO_START_OPT)"
#define STRING_NOTEMPTY_RIGHTPAR "NOTEMPTY)"
#define STRING_NOTEMPTY_ATSTART_RIGHTPAR "NOTEMPTY_ATSTART)"
+#define STRING_LIMIT_HEAP_EQ "LIMIT_HEAP="
#define STRING_LIMIT_MATCH_EQ "LIMIT_MATCH="
+#define STRING_LIMIT_DEPTH_EQ "LIMIT_DEPTH="
#define STRING_LIMIT_RECURSION_EQ "LIMIT_RECURSION="
#define STRING_MARK "MARK"
@@ -958,7 +962,7 @@ only. */
#define CHAR_ESC '\033'
#define CHAR_DEL '\177'
-#define CHAR_NULL '\0'
+#define CHAR_NUL '\0'
#define CHAR_SPACE '\040'
#define CHAR_EXCLAMATION_MARK '\041'
#define CHAR_QUOTATION_MARK '\042'
@@ -1196,6 +1200,7 @@ only. */
#define STRING_CRLF_RIGHTPAR STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS
#define STRING_ANY_RIGHTPAR STR_A STR_N STR_Y STR_RIGHT_PARENTHESIS
#define STRING_ANYCRLF_RIGHTPAR STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS
+#define STRING_NUL_RIGHTPAR STR_N STR_U STR_L STR_RIGHT_PARENTHESIS
#define STRING_BSR_ANYCRLF_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS
#define STRING_BSR_UNICODE_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_U STR_N STR_I STR_C STR_O STR_D STR_E STR_RIGHT_PARENTHESIS
#define STRING_UTF8_RIGHTPAR STR_U STR_T STR_F STR_8 STR_RIGHT_PARENTHESIS
@@ -1209,7 +1214,9 @@ only. */
#define STRING_NO_START_OPT_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS
#define STRING_NOTEMPTY_RIGHTPAR STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_RIGHT_PARENTHESIS
#define STRING_NOTEMPTY_ATSTART_RIGHTPAR STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_UNDERSCORE STR_A STR_T STR_S STR_T STR_A STR_R STR_T STR_RIGHT_PARENTHESIS
+#define STRING_LIMIT_HEAP_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_H STR_E STR_A STR_P STR_EQUALS_SIGN
#define STRING_LIMIT_MATCH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_M STR_A STR_T STR_C STR_H STR_EQUALS_SIGN
+#define STRING_LIMIT_DEPTH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_D STR_E STR_P STR_T STR_H STR_EQUALS_SIGN
#define STRING_LIMIT_RECURSION_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_R STR_E STR_C STR_U STR_R STR_S STR_I STR_O STR_N STR_EQUALS_SIGN
#define STRING_MARK STR_M STR_A STR_R STR_K
@@ -1298,23 +1305,16 @@ mode rather than an escape sequence. It is also used for [^] in JavaScript
compatibility mode, and for \C in non-utf mode. In non-DOTALL mode, "." behaves
like \N.
-The special values ESC_DU, ESC_du, etc. are used instead of ESC_D, ESC_d, etc.
-when PCRE2_UCP is set and replacement of \d etc by \p sequences is required.
-They must be contiguous, and remain in order so that the replacements can be
-looked up from a table.
-
Negative numbers are used to encode a backreference (\1, \2, \3, etc.) in
-check_escape(). There are two tests in the code for an escape
-greater than ESC_b and less than ESC_Z to detect the types that may be
-repeated. These are the types that consume characters. If any new escapes are
-put in between that don't consume a character, that code will have to change.
-*/
+check_escape(). There are tests in the code for an escape greater than ESC_b
+and less than ESC_Z to detect the types that may be repeated. These are the
+types that consume characters. If any new escapes are put in between that don't
+consume a character, that code will have to change. */
enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s,
ESC_W, ESC_w, ESC_N, ESC_dum, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H,
ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z,
- ESC_E, ESC_Q, ESC_g, ESC_k,
- ESC_DU, ESC_du, ESC_SU, ESC_su, ESC_WU, ESC_wu };
+ ESC_E, ESC_Q, ESC_g, ESC_k };
/********************** Opcode definitions ******************/
@@ -1380,7 +1380,8 @@ enum {
OP_CIRC, /* 27 Start of line - not multiline */
OP_CIRCM, /* 28 Start of line - multiline */
- /* Single characters; caseful must precede the caseless ones */
+ /* Single characters; caseful must precede the caseless ones, and these
+ must remain in this order, and adjacent. */
OP_CHAR, /* 29 Match one character, casefully */
OP_CHARI, /* 30 Match one character, caselessly */
@@ -1530,68 +1531,67 @@ enum {
OP_ASSERTBACK, /* 128 Positive lookbehind */
OP_ASSERTBACK_NOT, /* 129 Negative lookbehind */
- /* ONCE, ONCE_NC, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately
- after the assertions, with ONCE first, as there's a test for >= ONCE for a
- subpattern that isn't an assertion. The POS versions must immediately follow
- the non-POS versions in each case. */
+ /* ONCE, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately after the
+ assertions, with ONCE first, as there's a test for >= ONCE for a subpattern
+ that isn't an assertion. The POS versions must immediately follow the non-POS
+ versions in each case. */
OP_ONCE, /* 130 Atomic group, contains captures */
- OP_ONCE_NC, /* 131 Atomic group containing no captures */
- OP_BRA, /* 132 Start of non-capturing bracket */
- OP_BRAPOS, /* 133 Ditto, with unlimited, possessive repeat */
- OP_CBRA, /* 134 Start of capturing bracket */
- OP_CBRAPOS, /* 135 Ditto, with unlimited, possessive repeat */
- OP_COND, /* 136 Conditional group */
+ OP_BRA, /* 131 Start of non-capturing bracket */
+ OP_BRAPOS, /* 132 Ditto, with unlimited, possessive repeat */
+ OP_CBRA, /* 133 Start of capturing bracket */
+ OP_CBRAPOS, /* 134 Ditto, with unlimited, possessive repeat */
+ OP_COND, /* 135 Conditional group */
/* These five must follow the previous five, in the same order. There's a
check for >= SBRA to distinguish the two sets. */
- OP_SBRA, /* 137 Start of non-capturing bracket, check empty */
- OP_SBRAPOS, /* 138 Ditto, with unlimited, possessive repeat */
- OP_SCBRA, /* 139 Start of capturing bracket, check empty */
- OP_SCBRAPOS, /* 140 Ditto, with unlimited, possessive repeat */
- OP_SCOND, /* 141 Conditional group, check empty */
+ OP_SBRA, /* 136 Start of non-capturing bracket, check empty */
+ OP_SBRAPOS, /* 137 Ditto, with unlimited, possessive repeat */
+ OP_SCBRA, /* 138 Start of capturing bracket, check empty */
+ OP_SCBRAPOS, /* 139 Ditto, with unlimited, possessive repeat */
+ OP_SCOND, /* 140 Conditional group, check empty */
/* The next two pairs must (respectively) be kept together. */
- OP_CREF, /* 142 Used to hold a capture number as condition */
- OP_DNCREF, /* 143 Used to point to duplicate names as a condition */
- OP_RREF, /* 144 Used to hold a recursion number as condition */
- OP_DNRREF, /* 145 Used to point to duplicate names as a condition */
- OP_FALSE, /* 146 Always false (used by DEFINE and VERSION) */
- OP_TRUE, /* 147 Always true (used by VERSION) */
+ OP_CREF, /* 141 Used to hold a capture number as condition */
+ OP_DNCREF, /* 142 Used to point to duplicate names as a condition */
+ OP_RREF, /* 143 Used to hold a recursion number as condition */
+ OP_DNRREF, /* 144 Used to point to duplicate names as a condition */
+ OP_FALSE, /* 145 Always false (used by DEFINE and VERSION) */
+ OP_TRUE, /* 146 Always true (used by VERSION) */
- OP_BRAZERO, /* 148 These two must remain together and in this */
- OP_BRAMINZERO, /* 149 order. */
- OP_BRAPOSZERO, /* 150 */
+ OP_BRAZERO, /* 147 These two must remain together and in this */
+ OP_BRAMINZERO, /* 148 order. */
+ OP_BRAPOSZERO, /* 149 */
/* These are backtracking control verbs */
- OP_MARK, /* 151 always has an argument */
- OP_PRUNE, /* 152 */
- OP_PRUNE_ARG, /* 153 same, but with argument */
- OP_SKIP, /* 154 */
- OP_SKIP_ARG, /* 155 same, but with argument */
- OP_THEN, /* 156 */
- OP_THEN_ARG, /* 157 same, but with argument */
- OP_COMMIT, /* 158 */
+ OP_MARK, /* 150 always has an argument */
+ OP_PRUNE, /* 151 */
+ OP_PRUNE_ARG, /* 152 same, but with argument */
+ OP_SKIP, /* 153 */
+ OP_SKIP_ARG, /* 154 same, but with argument */
+ OP_THEN, /* 155 */
+ OP_THEN_ARG, /* 156 same, but with argument */
+ OP_COMMIT, /* 157 */
/* These are forced failure and success verbs */
- OP_FAIL, /* 159 */
- OP_ACCEPT, /* 160 */
- OP_ASSERT_ACCEPT, /* 161 Used inside assertions */
- OP_CLOSE, /* 162 Used before OP_ACCEPT to close open captures */
+ OP_FAIL, /* 158 */
+ OP_ACCEPT, /* 159 */
+ OP_ASSERT_ACCEPT, /* 160 Used inside assertions */
+ OP_CLOSE, /* 161 Used before OP_ACCEPT to close open captures */
/* This is used to skip a subpattern with a {0} quantifier */
- OP_SKIPZERO, /* 163 */
+ OP_SKIPZERO, /* 162 */
/* This is used to identify a DEFINE group during compilation so that it can
be checked for having only one branch. It is changed to OP_FALSE before
compilation finishes. */
- OP_DEFINE, /* 164 */
+ OP_DEFINE, /* 163 */
/* This is not an opcode, but is used to check that tables indexed by opcode
are the correct length, in order to catch updating errors - there have been
@@ -1638,7 +1638,7 @@ some cases doesn't actually use these names at all). */
"Recurse", "Callout", "CalloutStr", \
"Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \
"Reverse", "Assert", "Assert not", "AssertB", "AssertB not", \
- "Once", "Once_NC", \
+ "Once", \
"Bra", "BraPos", "CBra", "CBraPos", \
"Cond", \
"SBra", "SBraPos", "SCBra", "SCBraPos", \
@@ -1722,7 +1722,6 @@ in UTF-8 mode. The code that uses this table must know about such things. */
1+LINK_SIZE, /* Assert behind */ \
1+LINK_SIZE, /* Assert behind not */ \
1+LINK_SIZE, /* ONCE */ \
- 1+LINK_SIZE, /* ONCE_NC */ \
1+LINK_SIZE, /* BRA */ \
1+LINK_SIZE, /* BRAPOS */ \
1+LINK_SIZE+IMM2_SIZE, /* CBRA */ \
@@ -1794,10 +1793,17 @@ typedef struct {
/* UCD access macros */
#define UCD_BLOCK_SIZE 128
-#define GET_UCD(ch) (PRIV(ucd_records) + \
+#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \
PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
+#if PCRE2_CODE_UNIT_WIDTH == 32
+#define GET_UCD(ch) ((ch > MAX_UTF_CODE_POINT)? \
+ PRIV(dummy_ucd_record) : REAL_GET_UCD(ch))
+#else
+#define GET_UCD(ch) REAL_GET_UCD(ch)
+#endif
+
#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype
#define UCD_SCRIPT(ch) GET_UCD(ch)->script
#define UCD_CATEGORY(ch) PRIV(ucp_gentype)[UCD_CHARTYPE(ch)]
@@ -1852,8 +1858,12 @@ extern const uint8_t PRIV(utf8_table4)[];
#define _pcre2_callout_end_delims PCRE2_SUFFIX(_pcre2_callout_end_delims_)
#define _pcre2_callout_start_delims PCRE2_SUFFIX(_pcre2_callout_start_delims_)
#define _pcre2_default_compile_context PCRE2_SUFFIX(_pcre2_default_compile_context_)
+#define _pcre2_default_convert_context PCRE2_SUFFIX(_pcre2_default_convert_context_)
#define _pcre2_default_match_context PCRE2_SUFFIX(_pcre2_default_match_context_)
#define _pcre2_default_tables PCRE2_SUFFIX(_pcre2_default_tables_)
+#if PCRE2_CODE_UNIT_WIDTH == 32
+#define _pcre2_dummy_ucd_record PCRE2_SUFFIX(_pcre2_dummy_ucd_record_)
+#endif
#define _pcre2_hspace_list PCRE2_SUFFIX(_pcre2_hspace_list_)
#define _pcre2_vspace_list PCRE2_SUFFIX(_pcre2_vspace_list_)
#define _pcre2_ucd_caseless_sets PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_)
@@ -1872,12 +1882,16 @@ extern const uint8_t PRIV(OP_lengths)[];
extern const uint32_t PRIV(callout_end_delims)[];
extern const uint32_t PRIV(callout_start_delims)[];
extern const pcre2_compile_context PRIV(default_compile_context);
+extern const pcre2_convert_context PRIV(default_convert_context);
extern const pcre2_match_context PRIV(default_match_context);
extern const uint8_t PRIV(default_tables)[];
extern const uint32_t PRIV(hspace_list)[];
extern const uint32_t PRIV(vspace_list)[];
extern const uint32_t PRIV(ucd_caseless_sets)[];
extern const ucd_record PRIV(ucd_records)[];
+#if PCRE2_CODE_UNIT_WIDTH == 32
+extern const ucd_record PRIV(dummy_ucd_record)[];
+#endif
extern const uint8_t PRIV(ucd_stage1)[];
extern const uint16_t PRIV(ucd_stage2)[];
extern const uint32_t PRIV(ucp_gbtable)[];
diff --git a/src/3rdparty/pcre2/src/pcre2_intmodedep.h b/src/3rdparty/pcre2/src/pcre2_intmodedep.h
index 596d62cfdc..387f65eb08 100644
--- a/src/3rdparty/pcre2/src/pcre2_intmodedep.h
+++ b/src/3rdparty/pcre2/src/pcre2_intmodedep.h
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,7 @@ just to undefine them all. */
#undef ACROSSCHAR
#undef BACKCHAR
#undef BYTES2CU
+#undef CHMAX_255
#undef CU2BYTES
#undef FORWARDCHAR
#undef FORWARDCHARTEST
@@ -140,7 +141,7 @@ values of 3 or 4 are also supported. */
#undef LINK_SIZE
#define LINK_SIZE 1
#define PUT(a,n,d) \
- (a[n] = (d))
+ (a[n] = (PCRE2_UCHAR)(d))
#define GET(a,n) \
(a[n])
#define MAX_PATTERN_SIZE (1 << 16)
@@ -200,21 +201,26 @@ arithmetic results in a signed value. Hence the cast. */
#endif
/* Other macros that are different for 8-bit mode. The MAX_255 macro checks
-whether its argument is less than 256. The maximum length of a MARK name must
-fit in one code unit; currently it is set to 255 or 65535. The TABLE_GET macro
-is used to access elements of tables containing exactly 256 items. When code
-points can be greater than 255, a check is needed before accessing these
-tables. */
+whether its argument, which is assumed to be one code unit, is less than 256.
+The CHMAX_255 macro does not assume one code unit. The maximum length of a MARK
+name must fit in one code unit; currently it is set to 255 or 65535. The
+TABLE_GET macro is used to access elements of tables containing exactly 256
+items. When code points can be greater than 255, a check is needed before
+accessing these tables. */
#if PCRE2_CODE_UNIT_WIDTH == 8
#define MAX_255(c) TRUE
#define MAX_MARK ((1u << 8) - 1)
#ifdef SUPPORT_UNICODE
#define SUPPORT_WIDE_CHARS
+#define CHMAX_255(c) ((c) <= 255u)
+#else
+#define CHMAX_255(c) TRUE
#endif /* SUPPORT_UNICODE */
#define TABLE_GET(c, table, default) ((table)[c])
#else /* Code units are 16 or 32 bits */
+#define CHMAX_255(c) ((c) <= 255u)
#define MAX_255(c) ((c) <= 255u)
#define MAX_MARK ((1u << 16) - 1)
#define SUPPORT_WIDE_CHARS
@@ -566,15 +572,13 @@ typedef struct pcre2_real_compile_context {
uint16_t bsr_convention;
uint16_t newline_convention;
uint32_t parens_nest_limit;
+ uint32_t extra_options;
} pcre2_real_compile_context;
/* The real match context structure. */
typedef struct pcre2_real_match_context {
pcre2_memctl memctl;
-#ifdef HEAP_MATCH_RECURSE
- pcre2_memctl stack_memctl;
-#endif
#ifdef SUPPORT_JIT
pcre2_jit_callback jit_callback;
void *jit_callback_data;
@@ -582,10 +586,19 @@ typedef struct pcre2_real_match_context {
int (*callout)(pcre2_callout_block *, void *);
void *callout_data;
PCRE2_SIZE offset_limit;
+ uint32_t heap_limit;
uint32_t match_limit;
- uint32_t recursion_limit;
+ uint32_t depth_limit;
} pcre2_real_match_context;
+/* The real convert context structure. */
+
+typedef struct pcre2_real_convert_context {
+ pcre2_memctl memctl;
+ uint32_t glob_separator;
+ uint32_t glob_escape;
+} pcre2_real_convert_context;
+
/* The real compiled code structure. The type for the blocksize field is
defined specially because it is required in pcre2_serialize_decode() when
copying the size from possibly unaligned memory into a variable of the same
@@ -611,8 +624,9 @@ typedef struct pcre2_real_code {
uint32_t compile_options; /* Options passed to pcre2_compile() */
uint32_t overall_options; /* Options after processing the pattern */
uint32_t flags; /* Various state flags */
+ uint32_t limit_heap; /* Limit set in the pattern */
uint32_t limit_match; /* Limit set in the pattern */
- uint32_t limit_recursion; /* Limit set in the pattern */
+ uint32_t limit_depth; /* Limit set in the pattern */
uint32_t first_codeunit; /* Starting code unit */
uint32_t last_codeunit; /* This codeunit must be seen */
uint16_t bsr_convention; /* What \R matches */
@@ -625,7 +639,11 @@ typedef struct pcre2_real_code {
uint16_t name_count; /* Number of name entries in the table */
} pcre2_real_code;
-/* The real match data structure. */
+/* The real match data structure. Define ovector large so that array bound
+checkers don't grumble. Memory for this structure is obtained by calling
+pcre2_match_data_create(), which sets the size as the offset of ovector plus
+pairs of elements for each capturing group. (See also the heapframe structure
+below.) */
typedef struct pcre2_real_match_data {
pcre2_memctl memctl;
@@ -638,7 +656,7 @@ typedef struct pcre2_real_match_data {
uint16_t matchedby; /* Type of match (normal, JIT, DFA) */
uint16_t oveccount; /* Number of pairs */
int rc; /* The return code from the match */
- PCRE2_SIZE ovector[1]; /* The first field */
+ PCRE2_SIZE ovector[10000];/* The first field */
} pcre2_real_match_data;
@@ -648,18 +666,24 @@ typedef struct pcre2_real_match_data {
#ifndef PCRE2_PCRE2TEST
-/* Structure for checking for mutual recursion when scanning compiled code. */
+/* Structures for checking for mutual recursion when scanning compiled or
+parsed code. */
typedef struct recurse_check {
struct recurse_check *prev;
PCRE2_SPTR group;
} recurse_check;
+typedef struct parsed_recurse_check {
+ struct parsed_recurse_check *prev;
+ uint32_t *groupptr;
+} parsed_recurse_check;
+
/* Structure for building a cache when filling in recursion offsets. */
typedef struct recurse_cache {
PCRE2_SPTR group;
- int recno;
+ int groupnumber;
} recurse_cache;
/* Structure for maintaining a chain of pointers to the currently incomplete
@@ -693,9 +717,10 @@ typedef struct compile_block {
PCRE2_SPTR start_code; /* The start of the compiled code */
PCRE2_SPTR start_pattern; /* The start of the pattern */
PCRE2_SPTR end_pattern; /* The end of the pattern */
- PCRE2_SPTR nestptr[2]; /* Pointer(s) saved for string substitution */
PCRE2_UCHAR *name_table; /* The name/number table */
- size_t workspace_size; /* Size of workspace */
+ PCRE2_SIZE workspace_size; /* Size of workspace */
+ PCRE2_SIZE small_ref_offset[10]; /* Offsets for \1 to \9 */
+ PCRE2_SIZE erroroffset; /* Offset of error in pattern */
uint16_t names_found; /* Number of entries so far */
uint16_t name_entry_size; /* Size of each entry */
open_capitem *open_caps; /* Chain of open capture items */
@@ -703,13 +728,17 @@ typedef struct compile_block {
uint32_t named_group_list_size; /* Number of entries in the list */
uint32_t external_options; /* External (initial) options */
uint32_t external_flags; /* External flag bits to be set */
- uint32_t bracount; /* Count of capturing parens as we compile */
- uint32_t final_bracount; /* Saved value after first pass */
+ uint32_t bracount; /* Count of capturing parentheses */
+ uint32_t lastcapture; /* Last capture encountered */
+ uint32_t *parsed_pattern; /* Parsed pattern buffer */
+ uint32_t *parsed_pattern_end; /* Parsed pattern should not get here */
uint32_t *groupinfo; /* Group info vector */
uint32_t top_backref; /* Maximum back reference */
uint32_t backref_map; /* Bitmap of low back refs */
uint32_t nltype; /* Newline type */
uint32_t nllen; /* Newline string length */
+ uint32_t class_range_start; /* Overall class range start */
+ uint32_t class_range_end; /* Overall class range end */
PCRE2_UCHAR nl[4]; /* Newline string when fixed length */
int max_lookbehind; /* Maximum lookbehind (characters) */
int parens_depth; /* Depth of nested parentheses */
@@ -718,9 +747,7 @@ typedef struct compile_block {
BOOL had_accept; /* (*ACCEPT) encountered */
BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */
BOOL had_recurse; /* Had a recursion or subroutine call */
- BOOL check_lookbehind; /* Lookbehinds need later checking */
BOOL dupnames; /* Duplicate names exist */
- BOOL iscondassert; /* Next assert is a condition */
} compile_block;
/* Structure for keeping the properties of the in-memory stack used
@@ -731,27 +758,8 @@ typedef struct pcre2_real_jit_stack {
void* stack;
} pcre2_real_jit_stack;
-/* Structure for keeping a chain of heap blocks used for saving ovectors
-during pattern recursion when the ovector is larger than can be saved on
-the system stack. */
-
-typedef struct ovecsave_frame {
- struct ovecsave_frame *next; /* Next frame on free chain */
- PCRE2_SIZE saved_ovec[1]; /* First vector element */
-} ovecsave_frame;
-
/* Structure for items in a linked list that represents an explicit recursive
-call within the pattern; used by pcre_match(). */
-
-typedef struct recursion_info {
- struct recursion_info *prevrec; /* Previous recursion record (or NULL) */
- unsigned int group_num; /* Number of group that was called */
- PCRE2_SIZE *ovec_save; /* Pointer to saved ovector frame */
- uint32_t saved_capture_last; /* Last capture number */
- PCRE2_SPTR subject_position; /* Position at start of recursion */
-} recursion_info;
-
-/* A similar structure for pcre_dfa_match(). */
+call within the pattern when running pcre_dfa_match(). */
typedef struct dfa_recursion_info {
struct dfa_recursion_info *prevrec;
@@ -759,35 +767,75 @@ typedef struct dfa_recursion_info {
uint32_t group_num;
} dfa_recursion_info;
-/* Structure for building a chain of data for holding the values of the subject
-pointer at the start of each subpattern, so as to detect when an empty string
-has been matched by a subpattern - to break infinite loops; used by
-pcre2_match(). */
+/* Structure for "stack" frames that are used for remembering backtracking
+positions during matching. As these are used in a vector, with the ovector item
+being extended, the size of the structure must be a multiple of PCRE2_SIZE. The
+only way to check this at compile time is to force an error by generating an
+array with a negative size. By putting this in a typedef (which is never used),
+we don't generate any code when all is well. */
+
+typedef struct heapframe {
+
+ /* The first set of fields are variables that have to be preserved over calls
+ to RRMATCH(), but which do not need to be copied to new frames. */
+
+ PCRE2_SPTR ecode; /* The current position in the pattern */
+ PCRE2_SPTR temp_sptr[2]; /* Used for short-term PCRE_SPTR values */
+ PCRE2_SIZE length; /* Used for character, string, or code lengths */
+ PCRE2_SIZE back_frame; /* Amount to subtract on RRETURN */
+ PCRE2_SIZE temp_size; /* Used for short-term PCRE2_SIZE values */
+ uint32_t rdepth; /* "Recursion" depth */
+ uint32_t group_frame_type; /* Type information for group frames */
+ uint32_t temp_32[4]; /* Used for short-term 32-bit or BOOL values */
+ uint8_t return_id; /* Where to go on in internal "return" */
+ uint8_t op; /* Processing opcode */
-typedef struct eptrblock {
- struct eptrblock *epb_prev;
- PCRE2_SPTR epb_saved_eptr;
-} eptrblock;
+#if PCRE2_CODE_UNIT_WIDTH == 8
+ PCRE2_UCHAR occu[6]; /* Used for other case code units */
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+ PCRE2_UCHAR occu[2]; /* Used for other case code units */
+#else
+ PCRE2_UCHAR occu[1]; /* Used for other case code units */
+#endif
+
+ /* The rest have to be copied from the previous frame whenever a new frame
+ becomes current. The final field is specified as a large vector so that
+ runtime array bound checks don't catch references to it. However, for any
+ specific call to pcre2_match() the memory allocated for each frame structure
+ allows for exactly the right size ovector for the number of capturing
+ parentheses. */
+
+ PCRE2_SPTR eptr; /* MUST BE FIRST */
+ PCRE2_SPTR start_match; /* Can be adjusted by \K */
+ PCRE2_SPTR mark; /* Most recent mark on the success path */
+ uint32_t current_recurse; /* Current (deepest) recursion number */
+ uint32_t capture_last; /* Most recent capture */
+ PCRE2_SIZE last_group_offset; /* Saved offset to most recent group frame */
+ PCRE2_SIZE offset_top; /* Offset after highest capture */
+ PCRE2_SIZE ovector[10000]; /* Must be last in the structure */
+} heapframe;
+
+typedef char check_heapframe_size[
+ ((sizeof(heapframe) % sizeof(PCRE2_SIZE)) == 0)? (+1):(-1)];
/* Structure for passing "static" information around between the functions
doing traditional NFA matching (pcre2_match() and friends). */
typedef struct match_block {
pcre2_memctl memctl; /* For general use */
-#ifdef HEAP_MATCH_RECURSE
- pcre2_memctl stack_memctl; /* For "stack" frames */
-#endif
- uint32_t match_call_count; /* As it says */
+ PCRE2_SIZE frame_vector_size; /* Size of a backtracking frame */
+ heapframe *match_frames; /* Points to vector of frames */
+ heapframe *match_frames_top; /* Points after the end of the vector */
+ heapframe *stack_frames; /* The original vector on the stack */
+ PCRE2_SIZE heap_limit; /* As it says */
uint32_t match_limit; /* As it says */
- uint32_t match_limit_recursion; /* As it says */
+ uint32_t match_limit_depth; /* As it says */
+ uint32_t match_call_count; /* Number of times a new frame is created */
BOOL hitend; /* Hit the end of the subject at some point */
BOOL hasthen; /* Pattern contains (*THEN) */
const uint8_t *lcc; /* Points to lower casing table */
const uint8_t *fcc; /* Points to case-flipping table */
const uint8_t *ctypes; /* Points to table of type maps */
- PCRE2_SIZE *ovector; /* Pointer to the offset vector */
- PCRE2_SIZE offset_end; /* One past the end */
- PCRE2_SIZE offset_max; /* The maximum usable for return data */
PCRE2_SIZE start_offset; /* The start offset value */
PCRE2_SIZE end_offset_top; /* Highwater mark at end of match */
uint16_t partial; /* PARTIAL options */
@@ -798,30 +846,23 @@ typedef struct match_block {
PCRE2_SPTR start_code; /* For use when recursing */
PCRE2_SPTR start_subject; /* Start of the subject string */
PCRE2_SPTR end_subject; /* End of the subject string */
- PCRE2_SPTR start_match_ptr; /* Start of matched string */
PCRE2_SPTR end_match_ptr; /* Subject position at end match */
PCRE2_SPTR start_used_ptr; /* Earliest consulted character */
PCRE2_SPTR last_used_ptr; /* Latest consulted character */
PCRE2_SPTR mark; /* Mark pointer to pass back on success */
PCRE2_SPTR nomatch_mark; /* Mark pointer to pass back on failure */
- PCRE2_SPTR once_target; /* Where to back up to for atomic groups */
+ PCRE2_SPTR verb_ecode_ptr; /* For passing back info */
+ PCRE2_SPTR verb_skip_ptr; /* For passing back a (*SKIP) name */
+ uint32_t verb_current_recurse; /* Current recurse when (*VERB) happens */
uint32_t moptions; /* Match options */
uint32_t poptions; /* Pattern options */
- uint32_t capture_last; /* Most recent capture number + overflow flag */
uint32_t skip_arg_count; /* For counting SKIP_ARGs */
uint32_t ignore_skip_arg; /* For re-run when SKIP arg name not found */
- uint32_t match_function_type; /* Set for certain special calls of match() */
uint32_t nltype; /* Newline type */
uint32_t nllen; /* Newline string length */
PCRE2_UCHAR nl[4]; /* Newline string when fixed */
- eptrblock *eptrchain; /* Chain of eptrblocks for tail recursions */
- recursion_info *recursive; /* Linked list of recursion data */
- ovecsave_frame *ovecsave_chain; /* Linked list of free ovecsave blocks */
void *callout_data; /* To pass back to callouts */
int (*callout)(pcre2_callout_block *,void *); /* Callout function or NULL */
-#ifdef HEAP_MATCH_RECURSE
- void *match_frames_base; /* For remembering malloc'd frames */
-#endif
} match_block;
/* A similar structure is used for the same purpose by the DFA matching
@@ -836,6 +877,9 @@ typedef struct dfa_match_block {
PCRE2_SPTR last_used_ptr; /* Latest consulted character */
const uint8_t *tables; /* Character tables */
PCRE2_SIZE start_offset; /* The start offset value */
+ uint32_t match_limit; /* As it says */
+ uint32_t match_limit_depth; /* As it says */
+ uint32_t match_call_count; /* Number of calls of internal function */
uint32_t moptions; /* Match options */
uint32_t poptions; /* Pattern options */
uint32_t nltype; /* Newline type */
diff --git a/src/3rdparty/pcre2/src/pcre2_jit_compile.c b/src/3rdparty/pcre2/src/pcre2_jit_compile.c
index 8dea90a1c5..c7bf0b2c3e 100644
--- a/src/3rdparty/pcre2/src/pcre2_jit_compile.c
+++ b/src/3rdparty/pcre2/src/pcre2_jit_compile.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -313,16 +313,25 @@ typedef struct ref_iterator_backtrack {
typedef struct recurse_entry {
struct recurse_entry *next;
- /* Contains the function entry. */
- struct sljit_label *entry;
- /* Collects the calls until the function is not created. */
- jump_list *calls;
+ /* Contains the function entry label. */
+ struct sljit_label *entry_label;
+ /* Contains the function entry label. */
+ struct sljit_label *backtrack_label;
+ /* Collects the entry calls until the function is not created. */
+ jump_list *entry_calls;
+ /* Collects the backtrack calls until the function is not created. */
+ jump_list *backtrack_calls;
/* Points to the starting opcode. */
sljit_sw start;
} recurse_entry;
typedef struct recurse_backtrack {
backtrack_common common;
+ /* Return to the matching path. */
+ struct sljit_label *matchingpath;
+ /* Recursive pattern. */
+ recurse_entry *entry;
+ /* Pattern is inlined. */
BOOL inlined_pattern;
} recurse_backtrack;
@@ -341,11 +350,26 @@ typedef struct then_trap_backtrack {
int framesize;
} then_trap_backtrack;
-#define MAX_RANGE_SIZE 4
+#define MAX_N_CHARS 12
+#define MAX_DIFF_CHARS 5
+
+typedef struct fast_forward_char_data {
+ /* Number of characters in the chars array, 255 for any character. */
+ sljit_u8 count;
+ /* Number of last UTF-8 characters in the chars array. */
+ sljit_u8 last_count;
+ /* Available characters in the current position. */
+ PCRE2_UCHAR chars[MAX_DIFF_CHARS];
+} fast_forward_char_data;
+
+#define MAX_CLASS_RANGE_SIZE 4
+#define MAX_CLASS_CHARS_SIZE 3
typedef struct compiler_common {
/* The sljit ceneric compiler. */
struct sljit_compiler *compiler;
+ /* Compiled regular expression. */
+ pcre2_real_code *re;
/* First byte code. */
PCRE2_SPTR start;
/* Maps private data offset to each opcode. */
@@ -402,10 +426,10 @@ typedef struct compiler_common {
BOOL has_then;
/* (*SKIP) or (*SKIP:arg) is found in lookbehind assertion. */
BOOL has_skip_in_assert_back;
- /* Currently in recurse or negative assert. */
- BOOL local_exit;
- /* Currently in a positive assert. */
- BOOL positive_assert;
+ /* Quit is redirected by recurse, negative assertion, or positive assertion in conditional block. */
+ BOOL local_quit_available;
+ /* Currently in a positive assertion. */
+ BOOL in_positive_assertion;
/* Newline control. */
int nltype;
sljit_u32 nlmax;
@@ -426,7 +450,7 @@ typedef struct compiler_common {
/* Labels and jump lists. */
struct sljit_label *partialmatchlabel;
struct sljit_label *quit_label;
- struct sljit_label *forced_quit_label;
+ struct sljit_label *abort_label;
struct sljit_label *accept_label;
struct sljit_label *ff_newline_shortcut;
stub_list *stubs;
@@ -435,8 +459,9 @@ typedef struct compiler_common {
recurse_entry *currententry;
jump_list *partialmatch;
jump_list *quit;
- jump_list *positive_assert_quit;
- jump_list *forced_quit;
+ jump_list *positive_assertion_quit;
+ jump_list *abort;
+ jump_list *failed_match;
jump_list *accept;
jump_list *calllimit;
jump_list *stackalloc;
@@ -500,7 +525,7 @@ typedef struct compare_context {
#undef CMP
/* Used for accessing the elements of the stack. */
-#define STACK(i) ((-(i) - 1) * (int)sizeof(sljit_sw))
+#define STACK(i) ((i) * (int)sizeof(sljit_sw))
#define TMP1 SLJIT_R0
#define TMP2 SLJIT_R2
@@ -570,13 +595,17 @@ the start pointers when the end of the capturing group has not yet reached. */
sljit_emit_cmp(compiler, (type), (src1), (src1w), (src2), (src2w))
#define CMPTO(type, src1, src1w, src2, src2w, label) \
sljit_set_label(sljit_emit_cmp(compiler, (type), (src1), (src1w), (src2), (src2w)), (label))
-#define OP_FLAGS(op, dst, dstw, src, srcw, type) \
- sljit_emit_op_flags(compiler, (op), (dst), (dstw), (src), (srcw), (type))
+#define OP_FLAGS(op, dst, dstw, type) \
+ sljit_emit_op_flags(compiler, (op), (dst), (dstw), (type))
+#define CMOV(type, dst_reg, src, srcw) \
+ sljit_emit_cmov(compiler, (type), (dst_reg), (src), (srcw))
#define GET_LOCAL_BASE(dst, dstw, offset) \
sljit_get_local_base(compiler, (dst), (dstw), (offset))
#define READ_CHAR_MAX 0x7fffffff
+#define INVALID_UTF_CHAR 888
+
static PCRE2_SPTR bracketend(PCRE2_SPTR cc)
{
SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NOT) || (*cc >= OP_ONCE && *cc <= OP_SCOND));
@@ -606,8 +635,8 @@ return count;
set_private_data_ptrs
get_framesize
init_frame
- get_private_data_copy_length
- copy_private_data
+ get_recurse_data_length
+ copy_recurse_data
compile_matchingpath
compile_backtrackingpath
*/
@@ -675,7 +704,6 @@ switch(*cc)
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRA:
case OP_BRAPOS:
case OP_CBRA:
@@ -806,7 +834,7 @@ switch(*cc)
default:
/* All opcodes are supported now! */
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
}
@@ -1304,7 +1332,7 @@ while (cc < ccend)
if (private_data_ptr > SLJIT_MAX_LOCAL_SIZE)
break;
- if (repeat_check && (*cc == OP_ONCE || *cc == OP_ONCE_NC || *cc == OP_BRA || *cc == OP_CBRA || *cc == OP_COND))
+ if (repeat_check && (*cc == OP_ONCE || *cc == OP_BRA || *cc == OP_CBRA || *cc == OP_COND))
{
if (detect_repeat(common, cc))
{
@@ -1333,7 +1361,6 @@ while (cc < ccend)
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRAPOS:
case OP_SBRA:
case OP_SBRAPOS:
@@ -1654,11 +1681,11 @@ if (length > 0)
return stack_restore ? no_frame : no_stack;
}
-static void init_frame(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int stackpos, int stacktop, BOOL recursive)
+static void init_frame(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int stackpos, int stacktop)
{
DEFINE_COMPILER;
-BOOL setsom_found = recursive;
-BOOL setmark_found = recursive;
+BOOL setsom_found = FALSE;
+BOOL setmark_found = FALSE;
/* The last capture is a local variable even for recursions. */
BOOL capture_last_found = FALSE;
int offset;
@@ -1671,7 +1698,7 @@ stackpos = STACK(stackpos);
if (ccend == NULL)
{
ccend = bracketend(cc) - (1 + LINK_SIZE);
- if (recursive || (*cc != OP_CBRAPOS && *cc != OP_SCBRAPOS))
+ if (*cc != OP_CBRAPOS && *cc != OP_SCBRAPOS)
cc = next_opcode(common, cc);
}
@@ -1685,9 +1712,9 @@ while (cc < ccend)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -OVECTOR(0));
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
setsom_found = TRUE;
}
cc += 1;
@@ -1701,9 +1728,9 @@ while (cc < ccend)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
setmark_found = TRUE;
}
cc += 1 + 2 + cc[1];
@@ -1714,27 +1741,27 @@ while (cc < ccend)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -OVECTOR(0));
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
setsom_found = TRUE;
}
if (common->mark_ptr != 0 && !setmark_found)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
setmark_found = TRUE;
}
if (common->capture_last_ptr != 0 && !capture_last_found)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
capture_last_found = TRUE;
}
cc += 1 + LINK_SIZE;
@@ -1748,20 +1775,20 @@ while (cc < ccend)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
capture_last_found = TRUE;
}
offset = (GET2(cc, 1 + LINK_SIZE)) << 1;
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, OVECTOR(offset));
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset));
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP2, 0);
- stackpos += (int)sizeof(sljit_sw);
+ stackpos -= (int)sizeof(sljit_sw);
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
@@ -1776,21 +1803,127 @@ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, 0);
SLJIT_ASSERT(stackpos == STACK(stacktop));
}
-static SLJIT_INLINE int get_private_data_copy_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL needs_control_head)
+#define RECURSE_TMP_REG_COUNT 3
+
+typedef struct delayed_mem_copy_status {
+ struct sljit_compiler *compiler;
+ int store_bases[RECURSE_TMP_REG_COUNT];
+ int store_offsets[RECURSE_TMP_REG_COUNT];
+ int tmp_regs[RECURSE_TMP_REG_COUNT];
+ int saved_tmp_regs[RECURSE_TMP_REG_COUNT];
+ int next_tmp_reg;
+} delayed_mem_copy_status;
+
+static void delayed_mem_copy_init(delayed_mem_copy_status *status, compiler_common *common)
{
-int private_data_length = needs_control_head ? 3 : 2;
+int i;
+
+for (i = 0; i < RECURSE_TMP_REG_COUNT; i++)
+ {
+ SLJIT_ASSERT(status->tmp_regs[i] >= 0);
+ SLJIT_ASSERT(sljit_get_register_index(status->saved_tmp_regs[i]) < 0 || status->tmp_regs[i] == status->saved_tmp_regs[i]);
+
+ status->store_bases[i] = -1;
+ }
+status->next_tmp_reg = 0;
+status->compiler = common->compiler;
+}
+
+static void delayed_mem_copy_move(delayed_mem_copy_status *status, int load_base, sljit_sw load_offset,
+ int store_base, sljit_sw store_offset)
+{
+struct sljit_compiler *compiler = status->compiler;
+int next_tmp_reg = status->next_tmp_reg;
+int tmp_reg = status->tmp_regs[next_tmp_reg];
+
+SLJIT_ASSERT(load_base > 0 && store_base > 0);
+
+if (status->store_bases[next_tmp_reg] == -1)
+ {
+ /* Preserve virtual registers. */
+ if (sljit_get_register_index(status->saved_tmp_regs[next_tmp_reg]) < 0)
+ OP1(SLJIT_MOV, status->saved_tmp_regs[next_tmp_reg], 0, tmp_reg, 0);
+ }
+else
+ OP1(SLJIT_MOV, SLJIT_MEM1(status->store_bases[next_tmp_reg]), status->store_offsets[next_tmp_reg], tmp_reg, 0);
+
+OP1(SLJIT_MOV, tmp_reg, 0, SLJIT_MEM1(load_base), load_offset);
+status->store_bases[next_tmp_reg] = store_base;
+status->store_offsets[next_tmp_reg] = store_offset;
+
+status->next_tmp_reg = (next_tmp_reg + 1) % RECURSE_TMP_REG_COUNT;
+}
+
+static void delayed_mem_copy_finish(delayed_mem_copy_status *status)
+{
+struct sljit_compiler *compiler = status->compiler;
+int next_tmp_reg = status->next_tmp_reg;
+int tmp_reg, saved_tmp_reg, i;
+
+for (i = 0; i < RECURSE_TMP_REG_COUNT; i++)
+ {
+ if (status->store_bases[next_tmp_reg] != -1)
+ {
+ tmp_reg = status->tmp_regs[next_tmp_reg];
+ saved_tmp_reg = status->saved_tmp_regs[next_tmp_reg];
+
+ OP1(SLJIT_MOV, SLJIT_MEM1(status->store_bases[next_tmp_reg]), status->store_offsets[next_tmp_reg], tmp_reg, 0);
+
+ /* Restore virtual registers. */
+ if (sljit_get_register_index(saved_tmp_reg) < 0)
+ OP1(SLJIT_MOV, tmp_reg, 0, saved_tmp_reg, 0);
+ }
+
+ next_tmp_reg = (next_tmp_reg + 1) % RECURSE_TMP_REG_COUNT;
+ }
+}
+
+#undef RECURSE_TMP_REG_COUNT
+
+static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
+ BOOL *needs_control_head, BOOL *has_quit, BOOL *has_accept)
+{
+int length = 1;
int size;
PCRE2_SPTR alternative;
+BOOL quit_found = FALSE;
+BOOL accept_found = FALSE;
+BOOL setsom_found = FALSE;
+BOOL setmark_found = FALSE;
+BOOL capture_last_found = FALSE;
+BOOL control_head_found = FALSE;
+
+#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
+SLJIT_ASSERT(common->control_head_ptr != 0);
+control_head_found = TRUE;
+#endif
+
/* Calculate the sum of the private machine words. */
while (cc < ccend)
{
size = 0;
switch(*cc)
{
+ case OP_SET_SOM:
+ SLJIT_ASSERT(common->has_set_som);
+ setsom_found = TRUE;
+ cc += 1;
+ break;
+
+ case OP_RECURSE:
+ if (common->has_set_som)
+ setsom_found = TRUE;
+ if (common->mark_ptr != 0)
+ setmark_found = TRUE;
+ if (common->capture_last_ptr != 0)
+ capture_last_found = TRUE;
+ cc += 1 + LINK_SIZE;
+ break;
+
case OP_KET:
if (PRIVATE_DATA(cc) != 0)
{
- private_data_length++;
+ length++;
SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
cc += PRIVATE_DATA(cc + 1);
}
@@ -1802,26 +1935,30 @@ while (cc < ccend)
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRAPOS:
case OP_SBRA:
case OP_SBRAPOS:
case OP_SCOND:
- private_data_length++;
+ length++;
SLJIT_ASSERT(PRIVATE_DATA(cc) != 0);
cc += 1 + LINK_SIZE;
break;
case OP_CBRA:
case OP_SCBRA:
+ length += 2;
+ if (common->capture_last_ptr != 0)
+ capture_last_found = TRUE;
if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
- private_data_length++;
+ length++;
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
case OP_CBRAPOS:
case OP_SCBRAPOS:
- private_data_length += 2;
+ length += 2 + 2;
+ if (common->capture_last_ptr != 0)
+ capture_last_found = TRUE;
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
@@ -1829,13 +1966,13 @@ while (cc < ccend)
/* Might be a hidden SCOND. */
alternative = cc + GET(cc, 1);
if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
- private_data_length++;
+ length++;
cc += 1 + LINK_SIZE;
break;
CASE_ITERATOR_PRIVATE_DATA_1
- if (PRIVATE_DATA(cc))
- private_data_length++;
+ if (PRIVATE_DATA(cc) != 0)
+ length++;
cc += 2;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
@@ -1843,8 +1980,8 @@ while (cc < ccend)
break;
CASE_ITERATOR_PRIVATE_DATA_2A
- if (PRIVATE_DATA(cc))
- private_data_length += 2;
+ if (PRIVATE_DATA(cc) != 0)
+ length += 2;
cc += 2;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
@@ -1852,8 +1989,8 @@ while (cc < ccend)
break;
CASE_ITERATOR_PRIVATE_DATA_2B
- if (PRIVATE_DATA(cc))
- private_data_length += 2;
+ if (PRIVATE_DATA(cc) != 0)
+ length += 2;
cc += 2 + IMM2_SIZE;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
@@ -1861,20 +1998,20 @@ while (cc < ccend)
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_1
- if (PRIVATE_DATA(cc))
- private_data_length++;
+ if (PRIVATE_DATA(cc) != 0)
+ length++;
cc += 1;
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_2A
- if (PRIVATE_DATA(cc))
- private_data_length += 2;
+ if (PRIVATE_DATA(cc) != 0)
+ length += 2;
cc += 1;
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_2B
- if (PRIVATE_DATA(cc))
- private_data_length += 2;
+ if (PRIVATE_DATA(cc) != 0)
+ length += 2;
cc += 1 + IMM2_SIZE;
break;
@@ -1886,11 +2023,51 @@ while (cc < ccend)
#else
size = 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#endif
- if (PRIVATE_DATA(cc))
- private_data_length += get_class_iterator_size(cc + size);
+ if (PRIVATE_DATA(cc) != 0)
+ length += get_class_iterator_size(cc + size);
cc += size;
break;
+ case OP_MARK:
+ case OP_PRUNE_ARG:
+ case OP_THEN_ARG:
+ SLJIT_ASSERT(common->mark_ptr != 0);
+ if (!setmark_found)
+ setmark_found = TRUE;
+ if (common->control_head_ptr != 0)
+ control_head_found = TRUE;
+ if (*cc != OP_MARK)
+ quit_found = TRUE;
+
+ cc += 1 + 2 + cc[1];
+ break;
+
+ case OP_PRUNE:
+ case OP_SKIP:
+ case OP_COMMIT:
+ quit_found = TRUE;
+ cc++;
+ break;
+
+ case OP_SKIP_ARG:
+ quit_found = TRUE;
+ cc += 1 + 2 + cc[1];
+ break;
+
+ case OP_THEN:
+ SLJIT_ASSERT(common->control_head_ptr != 0);
+ quit_found = TRUE;
+ if (!control_head_found)
+ control_head_found = TRUE;
+ cc++;
+ break;
+
+ case OP_ACCEPT:
+ case OP_ASSERT_ACCEPT:
+ accept_found = TRUE;
+ cc++;
+ break;
+
default:
cc = next_opcode(common, cc);
SLJIT_ASSERT(cc != NULL);
@@ -1898,329 +2075,446 @@ while (cc < ccend)
}
}
SLJIT_ASSERT(cc == ccend);
-return private_data_length;
+
+if (control_head_found)
+ length++;
+if (capture_last_found)
+ length++;
+if (quit_found)
+ {
+ if (setsom_found)
+ length++;
+ if (setmark_found)
+ length++;
+ }
+
+*needs_control_head = control_head_found;
+*has_quit = quit_found;
+*has_accept = accept_found;
+return length;
}
-static void copy_private_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
- BOOL save, int stackptr, int stacktop, BOOL needs_control_head)
+enum copy_recurse_data_types {
+ recurse_copy_from_global,
+ recurse_copy_private_to_global,
+ recurse_copy_shared_to_global,
+ recurse_copy_kept_shared_to_global,
+ recurse_swap_global
+};
+
+static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
+ int type, int stackptr, int stacktop, BOOL has_quit)
{
-DEFINE_COMPILER;
-int srcw[2];
-int count, size;
-BOOL tmp1next = TRUE;
-BOOL tmp1empty = TRUE;
-BOOL tmp2empty = TRUE;
+delayed_mem_copy_status status;
PCRE2_SPTR alternative;
-enum {
- start,
- loop,
- end
-} status;
+sljit_sw private_srcw[2];
+sljit_sw shared_srcw[3];
+sljit_sw kept_shared_srcw[2];
+int private_count, shared_count, kept_shared_count;
+int from_sp, base_reg, offset, i;
+BOOL setsom_found = FALSE;
+BOOL setmark_found = FALSE;
+BOOL capture_last_found = FALSE;
+BOOL control_head_found = FALSE;
-status = save ? start : loop;
-stackptr = STACK(stackptr - 2);
-stacktop = STACK(stacktop - 1);
+#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
+SLJIT_ASSERT(common->control_head_ptr != 0);
+control_head_found = TRUE;
+#endif
-if (!save)
+switch (type)
{
- stackptr += (needs_control_head ? 2 : 1) * sizeof(sljit_sw);
- if (stackptr < stacktop)
- {
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), stackptr);
- stackptr += sizeof(sljit_sw);
- tmp1empty = FALSE;
- }
- if (stackptr < stacktop)
- {
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), stackptr);
- stackptr += sizeof(sljit_sw);
- tmp2empty = FALSE;
- }
- /* The tmp1next must be TRUE in either way. */
+ case recurse_copy_from_global:
+ from_sp = TRUE;
+ base_reg = STACK_TOP;
+ break;
+
+ case recurse_copy_private_to_global:
+ case recurse_copy_shared_to_global:
+ case recurse_copy_kept_shared_to_global:
+ from_sp = FALSE;
+ base_reg = STACK_TOP;
+ break;
+
+ default:
+ SLJIT_ASSERT(type == recurse_swap_global);
+ from_sp = FALSE;
+ base_reg = TMP2;
+ break;
}
-do
+stackptr = STACK(stackptr);
+stacktop = STACK(stacktop);
+
+status.tmp_regs[0] = TMP1;
+status.saved_tmp_regs[0] = TMP1;
+
+if (base_reg != TMP2)
{
- count = 0;
- switch(status)
+ status.tmp_regs[1] = TMP2;
+ status.saved_tmp_regs[1] = TMP2;
+ }
+else
+ {
+ status.saved_tmp_regs[1] = RETURN_ADDR;
+ if (sljit_get_register_index (RETURN_ADDR) == -1)
+ status.tmp_regs[1] = STR_PTR;
+ else
+ status.tmp_regs[1] = RETURN_ADDR;
+ }
+
+status.saved_tmp_regs[2] = TMP3;
+if (sljit_get_register_index (TMP3) == -1)
+ status.tmp_regs[2] = STR_END;
+else
+ status.tmp_regs[2] = TMP3;
+
+delayed_mem_copy_init(&status, common);
+
+if (type != recurse_copy_shared_to_global && type != recurse_copy_kept_shared_to_global)
+ {
+ SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_private_to_global || type == recurse_swap_global);
+
+ if (!from_sp)
+ delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->recursive_head_ptr);
+
+ if (from_sp || type == recurse_swap_global)
+ delayed_mem_copy_move(&status, SLJIT_SP, common->recursive_head_ptr, base_reg, stackptr);
+ }
+
+stackptr += sizeof(sljit_sw);
+
+#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
+if (type != recurse_copy_shared_to_global)
+ {
+ if (!from_sp)
+ delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->control_head_ptr);
+
+ if (from_sp || type == recurse_swap_global)
+ delayed_mem_copy_move(&status, SLJIT_SP, common->control_head_ptr, base_reg, stackptr);
+ }
+
+stackptr += sizeof(sljit_sw);
+#endif
+
+while (cc < ccend)
+ {
+ private_count = 0;
+ shared_count = 0;
+ kept_shared_count = 0;
+
+ switch(*cc)
{
- case start:
- SLJIT_ASSERT(save && common->recursive_head_ptr != 0);
- count = 1;
- srcw[0] = common->recursive_head_ptr;
- if (needs_control_head)
+ case OP_SET_SOM:
+ SLJIT_ASSERT(common->has_set_som);
+ if (has_quit && !setsom_found)
{
- SLJIT_ASSERT(common->control_head_ptr != 0);
- count = 2;
- srcw[1] = common->control_head_ptr;
+ kept_shared_srcw[0] = OVECTOR(0);
+ kept_shared_count = 1;
+ setsom_found = TRUE;
}
- status = loop;
+ cc += 1;
break;
- case loop:
- if (cc >= ccend)
+ case OP_RECURSE:
+ if (has_quit)
{
- status = end;
- break;
+ if (common->has_set_som && !setsom_found)
+ {
+ kept_shared_srcw[0] = OVECTOR(0);
+ kept_shared_count = 1;
+ setsom_found = TRUE;
+ }
+ if (common->mark_ptr != 0 && !setmark_found)
+ {
+ kept_shared_srcw[kept_shared_count] = common->mark_ptr;
+ kept_shared_count++;
+ setmark_found = TRUE;
+ }
}
+ if (common->capture_last_ptr != 0 && !capture_last_found)
+ {
+ shared_srcw[0] = common->capture_last_ptr;
+ shared_count = 1;
+ capture_last_found = TRUE;
+ }
+ cc += 1 + LINK_SIZE;
+ break;
- switch(*cc)
+ case OP_KET:
+ if (PRIVATE_DATA(cc) != 0)
{
- case OP_KET:
- if (PRIVATE_DATA(cc) != 0)
- {
- count = 1;
- srcw[0] = PRIVATE_DATA(cc);
- SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
- cc += PRIVATE_DATA(cc + 1);
- }
- cc += 1 + LINK_SIZE;
- break;
+ private_count = 1;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
+ cc += PRIVATE_DATA(cc + 1);
+ }
+ cc += 1 + LINK_SIZE;
+ break;
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- case OP_ONCE:
- case OP_ONCE_NC:
- case OP_BRAPOS:
- case OP_SBRA:
- case OP_SBRAPOS:
- case OP_SCOND:
- count = 1;
- srcw[0] = PRIVATE_DATA(cc);
- SLJIT_ASSERT(srcw[0] != 0);
- cc += 1 + LINK_SIZE;
- break;
+ case OP_ASSERT:
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ case OP_ONCE:
+ case OP_BRAPOS:
+ case OP_SBRA:
+ case OP_SBRAPOS:
+ case OP_SCOND:
+ private_count = 1;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ cc += 1 + LINK_SIZE;
+ break;
- case OP_CBRA:
- case OP_SCBRA:
- if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
- {
- count = 1;
- srcw[0] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
- }
- cc += 1 + LINK_SIZE + IMM2_SIZE;
- break;
+ case OP_CBRA:
+ case OP_SCBRA:
+ offset = (GET2(cc, 1 + LINK_SIZE)) << 1;
+ shared_srcw[0] = OVECTOR(offset);
+ shared_srcw[1] = OVECTOR(offset + 1);
+ shared_count = 2;
- case OP_CBRAPOS:
- case OP_SCBRAPOS:
- count = 2;
- srcw[0] = PRIVATE_DATA(cc);
- srcw[1] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
- SLJIT_ASSERT(srcw[0] != 0 && srcw[1] != 0);
- cc += 1 + LINK_SIZE + IMM2_SIZE;
- break;
+ if (common->capture_last_ptr != 0 && !capture_last_found)
+ {
+ shared_srcw[2] = common->capture_last_ptr;
+ shared_count = 3;
+ capture_last_found = TRUE;
+ }
- case OP_COND:
- /* Might be a hidden SCOND. */
- alternative = cc + GET(cc, 1);
- if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
- {
- count = 1;
- srcw[0] = PRIVATE_DATA(cc);
- SLJIT_ASSERT(srcw[0] != 0);
- }
- cc += 1 + LINK_SIZE;
- break;
+ if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
+ {
+ private_count = 1;
+ private_srcw[0] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
+ }
+ cc += 1 + LINK_SIZE + IMM2_SIZE;
+ break;
- CASE_ITERATOR_PRIVATE_DATA_1
- if (PRIVATE_DATA(cc))
- {
- count = 1;
- srcw[0] = PRIVATE_DATA(cc);
- }
- cc += 2;
+ case OP_CBRAPOS:
+ case OP_SCBRAPOS:
+ offset = (GET2(cc, 1 + LINK_SIZE)) << 1;
+ shared_srcw[0] = OVECTOR(offset);
+ shared_srcw[1] = OVECTOR(offset + 1);
+ shared_count = 2;
+
+ if (common->capture_last_ptr != 0 && !capture_last_found)
+ {
+ shared_srcw[2] = common->capture_last_ptr;
+ shared_count = 3;
+ capture_last_found = TRUE;
+ }
+
+ private_count = 2;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ private_srcw[1] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
+ cc += 1 + LINK_SIZE + IMM2_SIZE;
+ break;
+
+ case OP_COND:
+ /* Might be a hidden SCOND. */
+ alternative = cc + GET(cc, 1);
+ if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
+ {
+ private_count = 1;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ }
+ cc += 1 + LINK_SIZE;
+ break;
+
+ CASE_ITERATOR_PRIVATE_DATA_1
+ if (PRIVATE_DATA(cc))
+ {
+ private_count = 1;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ }
+ cc += 2;
#ifdef SUPPORT_UNICODE
- if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
+ if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
- break;
+ break;
- CASE_ITERATOR_PRIVATE_DATA_2A
- if (PRIVATE_DATA(cc))
- {
- count = 2;
- srcw[0] = PRIVATE_DATA(cc);
- srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw);
- }
- cc += 2;
+ CASE_ITERATOR_PRIVATE_DATA_2A
+ if (PRIVATE_DATA(cc))
+ {
+ private_count = 2;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw);
+ }
+ cc += 2;
#ifdef SUPPORT_UNICODE
- if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
+ if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
- break;
+ break;
- CASE_ITERATOR_PRIVATE_DATA_2B
- if (PRIVATE_DATA(cc))
- {
- count = 2;
- srcw[0] = PRIVATE_DATA(cc);
- srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw);
- }
- cc += 2 + IMM2_SIZE;
+ CASE_ITERATOR_PRIVATE_DATA_2B
+ if (PRIVATE_DATA(cc))
+ {
+ private_count = 2;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw);
+ }
+ cc += 2 + IMM2_SIZE;
#ifdef SUPPORT_UNICODE
- if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
+ if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
- break;
+ break;
- CASE_ITERATOR_TYPE_PRIVATE_DATA_1
- if (PRIVATE_DATA(cc))
- {
- count = 1;
- srcw[0] = PRIVATE_DATA(cc);
- }
- cc += 1;
- break;
+ CASE_ITERATOR_TYPE_PRIVATE_DATA_1
+ if (PRIVATE_DATA(cc))
+ {
+ private_count = 1;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ }
+ cc += 1;
+ break;
- CASE_ITERATOR_TYPE_PRIVATE_DATA_2A
- if (PRIVATE_DATA(cc))
- {
- count = 2;
- srcw[0] = PRIVATE_DATA(cc);
- srcw[1] = srcw[0] + sizeof(sljit_sw);
- }
- cc += 1;
- break;
+ CASE_ITERATOR_TYPE_PRIVATE_DATA_2A
+ if (PRIVATE_DATA(cc))
+ {
+ private_count = 2;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ private_srcw[1] = private_srcw[0] + sizeof(sljit_sw);
+ }
+ cc += 1;
+ break;
- CASE_ITERATOR_TYPE_PRIVATE_DATA_2B
- if (PRIVATE_DATA(cc))
- {
- count = 2;
- srcw[0] = PRIVATE_DATA(cc);
- srcw[1] = srcw[0] + sizeof(sljit_sw);
- }
- cc += 1 + IMM2_SIZE;
- break;
+ CASE_ITERATOR_TYPE_PRIVATE_DATA_2B
+ if (PRIVATE_DATA(cc))
+ {
+ private_count = 2;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ private_srcw[1] = private_srcw[0] + sizeof(sljit_sw);
+ }
+ cc += 1 + IMM2_SIZE;
+ break;
- case OP_CLASS:
- case OP_NCLASS:
+ case OP_CLASS:
+ case OP_NCLASS:
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
- case OP_XCLASS:
- size = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR);
+ case OP_XCLASS:
+ i = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#else
- size = 1 + 32 / (int)sizeof(PCRE2_UCHAR);
+ i = 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#endif
- if (PRIVATE_DATA(cc))
- switch(get_class_iterator_size(cc + size))
- {
- case 1:
- count = 1;
- srcw[0] = PRIVATE_DATA(cc);
- break;
-
- case 2:
- count = 2;
- srcw[0] = PRIVATE_DATA(cc);
- srcw[1] = srcw[0] + sizeof(sljit_sw);
- break;
+ if (PRIVATE_DATA(cc) != 0)
+ switch(get_class_iterator_size(cc + i))
+ {
+ case 1:
+ private_count = 1;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ break;
+
+ case 2:
+ private_count = 2;
+ private_srcw[0] = PRIVATE_DATA(cc);
+ private_srcw[1] = private_srcw[0] + sizeof(sljit_sw);
+ break;
+
+ default:
+ SLJIT_UNREACHABLE();
+ break;
+ }
+ cc += i;
+ break;
- default:
- SLJIT_ASSERT_STOP();
- break;
- }
- cc += size;
- break;
+ case OP_MARK:
+ case OP_PRUNE_ARG:
+ case OP_THEN_ARG:
+ SLJIT_ASSERT(common->mark_ptr != 0);
+ if (has_quit && !setmark_found)
+ {
+ kept_shared_srcw[0] = common->mark_ptr;
+ kept_shared_count = 1;
+ setmark_found = TRUE;
+ }
+ if (common->control_head_ptr != 0 && !control_head_found)
+ {
+ shared_srcw[0] = common->control_head_ptr;
+ shared_count = 1;
+ control_head_found = TRUE;
+ }
+ cc += 1 + 2 + cc[1];
+ break;
- default:
- cc = next_opcode(common, cc);
- SLJIT_ASSERT(cc != NULL);
- break;
+ case OP_THEN:
+ SLJIT_ASSERT(common->control_head_ptr != 0);
+ if (!control_head_found)
+ {
+ shared_srcw[0] = common->control_head_ptr;
+ shared_count = 1;
+ control_head_found = TRUE;
}
+ cc++;
break;
- case end:
- SLJIT_ASSERT_STOP();
+ default:
+ cc = next_opcode(common, cc);
+ SLJIT_ASSERT(cc != NULL);
break;
}
- while (count > 0)
+ if (type != recurse_copy_shared_to_global && type != recurse_copy_kept_shared_to_global)
{
- count--;
- if (save)
- {
- if (tmp1next)
- {
- if (!tmp1empty)
- {
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackptr, TMP1, 0);
- stackptr += sizeof(sljit_sw);
- }
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), srcw[count]);
- tmp1empty = FALSE;
- tmp1next = FALSE;
- }
- else
- {
- if (!tmp2empty)
- {
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackptr, TMP2, 0);
- stackptr += sizeof(sljit_sw);
- }
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), srcw[count]);
- tmp2empty = FALSE;
- tmp1next = TRUE;
- }
- }
- else
+ SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_private_to_global || type == recurse_swap_global);
+
+ for (i = 0; i < private_count; i++)
{
- if (tmp1next)
- {
- SLJIT_ASSERT(!tmp1empty);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), srcw[count], TMP1, 0);
- tmp1empty = stackptr >= stacktop;
- if (!tmp1empty)
- {
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), stackptr);
- stackptr += sizeof(sljit_sw);
- }
- tmp1next = FALSE;
- }
- else
- {
- SLJIT_ASSERT(!tmp2empty);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), srcw[count], TMP2, 0);
- tmp2empty = stackptr >= stacktop;
- if (!tmp2empty)
- {
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), stackptr);
- stackptr += sizeof(sljit_sw);
- }
- tmp1next = TRUE;
- }
+ SLJIT_ASSERT(private_srcw[i] != 0);
+
+ if (!from_sp)
+ delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, private_srcw[i]);
+
+ if (from_sp || type == recurse_swap_global)
+ delayed_mem_copy_move(&status, SLJIT_SP, private_srcw[i], base_reg, stackptr);
+
+ stackptr += sizeof(sljit_sw);
}
}
- }
-while (status != end);
+ else
+ stackptr += sizeof(sljit_sw) * private_count;
-if (save)
- {
- if (tmp1next)
+ if (type != recurse_copy_private_to_global && type != recurse_copy_kept_shared_to_global)
{
- if (!tmp1empty)
- {
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackptr, TMP1, 0);
- stackptr += sizeof(sljit_sw);
- }
- if (!tmp2empty)
+ SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_shared_to_global || type == recurse_swap_global);
+
+ for (i = 0; i < shared_count; i++)
{
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackptr, TMP2, 0);
+ SLJIT_ASSERT(shared_srcw[i] != 0);
+
+ if (!from_sp)
+ delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, shared_srcw[i]);
+
+ if (from_sp || type == recurse_swap_global)
+ delayed_mem_copy_move(&status, SLJIT_SP, shared_srcw[i], base_reg, stackptr);
+
stackptr += sizeof(sljit_sw);
}
}
else
+ stackptr += sizeof(sljit_sw) * shared_count;
+
+ if (type != recurse_copy_private_to_global && type != recurse_swap_global)
{
- if (!tmp2empty)
- {
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackptr, TMP2, 0);
- stackptr += sizeof(sljit_sw);
- }
- if (!tmp1empty)
+ SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_shared_to_global || type == recurse_copy_kept_shared_to_global);
+
+ for (i = 0; i < kept_shared_count; i++)
{
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackptr, TMP1, 0);
+ SLJIT_ASSERT(kept_shared_srcw[i] != 0);
+
+ if (!from_sp)
+ delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, kept_shared_srcw[i]);
+
+ if (from_sp || type == recurse_swap_global)
+ delayed_mem_copy_move(&status, SLJIT_SP, kept_shared_srcw[i], base_reg, stackptr);
+
stackptr += sizeof(sljit_sw);
}
}
+ else
+ stackptr += sizeof(sljit_sw) * kept_shared_count;
}
-SLJIT_ASSERT(cc == ccend && stackptr == stacktop && (save || (tmp1empty && tmp2empty)));
+
+SLJIT_ASSERT(cc == ccend && stackptr == stacktop);
+
+delayed_mem_copy_finish(&status);
}
static SLJIT_INLINE PCRE2_SPTR set_then_offsets(compiler_common *common, PCRE2_SPTR cc, sljit_u8 *current_offset)
@@ -2337,7 +2631,7 @@ static SLJIT_INLINE void count_match(compiler_common *common)
{
DEFINE_COMPILER;
-OP2(SLJIT_SUB | SLJIT_SET_E, COUNT_MATCH, 0, COUNT_MATCH, 0, SLJIT_IMM, 1);
+OP2(SLJIT_SUB | SLJIT_SET_Z, COUNT_MATCH, 0, COUNT_MATCH, 0, SLJIT_IMM, 1);
add_jump(compiler, &common->calllimit, JUMP(SLJIT_ZERO));
}
@@ -2347,7 +2641,7 @@ static SLJIT_INLINE void allocate_stack(compiler_common *common, int size)
DEFINE_COMPILER;
SLJIT_ASSERT(size > 0);
-OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * sizeof(sljit_sw));
+OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * sizeof(sljit_sw));
#ifdef DESTROY_REGISTERS
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 12345);
OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);
@@ -2355,7 +2649,7 @@ OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, TMP1, 0);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP1, 0);
#endif
-add_stub(common, CMP(SLJIT_GREATER, STACK_TOP, 0, STACK_LIMIT, 0));
+add_stub(common, CMP(SLJIT_LESS, STACK_TOP, 0, STACK_LIMIT, 0));
}
static SLJIT_INLINE void free_stack(compiler_common *common, int size)
@@ -2363,7 +2657,7 @@ static SLJIT_INLINE void free_stack(compiler_common *common, int size)
DEFINE_COMPILER;
SLJIT_ASSERT(size > 0);
-OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * sizeof(sljit_sw));
+OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * sizeof(sljit_sw));
}
static sljit_uw * allocate_read_only_data(compiler_common *common, sljit_uw size)
@@ -2407,7 +2701,7 @@ else
OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_IMM, length - 1);
loop = LABEL();
OP1(SLJIT_MOVU, SLJIT_MEM1(SLJIT_R1), sizeof(sljit_sw), SLJIT_R0, 0);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_R2, 0, SLJIT_R2, 0, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_R2, 0, SLJIT_R2, 0, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, loop);
}
}
@@ -2445,7 +2739,7 @@ else
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_IMM, length - 2);
loop = LABEL();
OP1(SLJIT_MOVU, SLJIT_MEM1(TMP2), sizeof(sljit_sw), TMP1, 0);
- OP2(SLJIT_SUB | SLJIT_SET_E, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, loop);
}
@@ -2463,22 +2757,22 @@ static sljit_sw SLJIT_CALL do_search_mark(sljit_sw *current, PCRE2_SPTR skip_arg
{
while (current != NULL)
{
- switch (current[-2])
+ switch (current[1])
{
case type_then_trap:
break;
case type_mark:
- if (PRIV(strcmp)(skip_arg, (PCRE2_SPTR)current[-3]) == 0)
- return current[-4];
+ if (PRIV(strcmp)(skip_arg, (PCRE2_SPTR)current[2]) == 0)
+ return current[3];
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
- SLJIT_ASSERT(current > (sljit_sw*)current[-1]);
- current = (sljit_sw*)current[-1];
+ SLJIT_ASSERT(current[0] == 0 || current < (sljit_sw*)current[0]);
+ current = (sljit_sw*)current[0];
}
return -1;
}
@@ -2518,7 +2812,7 @@ if (sizeof(PCRE2_SIZE) == 4)
OP1(SLJIT_MOVU_U32, SLJIT_MEM1(SLJIT_R2), sizeof(PCRE2_SIZE), SLJIT_S1, 0);
else
OP1(SLJIT_MOVU, SLJIT_MEM1(SLJIT_R2), sizeof(PCRE2_SIZE), SLJIT_S1, 0);
-OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, 1);
+OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, loop);
/* Calculate the return value, which is the maximum ovector value. */
@@ -3104,8 +3398,8 @@ if (common->utf)
OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
/* Skip low surrogate if necessary. */
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xdc00);
- OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xdc00);
+ OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
return;
@@ -3124,6 +3418,7 @@ struct sljit_jump *jump;
if (nltype == NLTYPE_ANY)
{
add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL));
+ sljit_set_current_flags(compiler, SLJIT_SET_Z);
add_jump(compiler, backtracks, JUMP(jumpifmatch ? SLJIT_NOT_ZERO : SLJIT_ZERO));
}
else if (nltype == NLTYPE_ANYCRLF)
@@ -3165,7 +3460,7 @@ OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
/* Searching for the first zero. */
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
jump = JUMP(SLJIT_NOT_ZERO);
/* Two byte sequence. */
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
@@ -3179,7 +3474,7 @@ OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x10000);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x10000);
jump = JUMP(SLJIT_NOT_ZERO);
/* Three byte sequence. */
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
@@ -3213,15 +3508,15 @@ OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
/* Searching for the first zero. */
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
jump = JUMP(SLJIT_NOT_ZERO);
/* Two byte sequence. */
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
JUMPHERE(jump);
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400);
-OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_NOT_ZERO);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400);
+OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_NOT_ZERO);
/* This code runs only in 8 bit mode. No need to shift the value. */
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
@@ -3244,7 +3539,7 @@ struct sljit_jump *compare;
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x20);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x20);
jump = JUMP(SLJIT_NOT_ZERO);
/* Two byte sequence. */
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
@@ -3281,10 +3576,30 @@ static void do_getucd(compiler_common *common)
/* Search the UCD record for the character comes in TMP1.
Returns chartype in TMP1 and UCD offset in TMP2. */
DEFINE_COMPILER;
+#if PCRE2_CODE_UNIT_WIDTH == 32
+struct sljit_jump *jump;
+#endif
+
+#if defined SLJIT_DEBUG && SLJIT_DEBUG
+/* dummy_ucd_record */
+const ucd_record *record = GET_UCD(INVALID_UTF_CHAR);
+SLJIT_ASSERT(record->script == ucp_Common && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther);
+SLJIT_ASSERT(record->caseset == 0 && record->other_case == 0);
+#endif
SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 8);
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+if (!common->utf)
+ {
+ jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+ JUMPHERE(jump);
+ }
+#endif
+
OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
@@ -3299,7 +3614,7 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
#endif /* SUPPORT_UNICODE */
-static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common, BOOL hascrorlf, sljit_u32 overall_options)
+static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common)
{
DEFINE_COMPILER;
struct sljit_label *mainloop;
@@ -3311,6 +3626,8 @@ struct sljit_jump *end2 = NULL;
struct sljit_jump *singlechar;
#endif
jump_list *newline = NULL;
+sljit_u32 overall_options = common->re->overall_options;
+BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0;
BOOL newlinecheck = FALSE;
BOOL readuchar = FALSE;
@@ -3318,7 +3635,7 @@ if (!(hascrorlf || (overall_options & PCRE2_FIRSTLINE) != 0)
&& (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255))
newlinecheck = TRUE;
-SLJIT_ASSERT(common->forced_quit_label == NULL);
+SLJIT_ASSERT(common->abort_label == NULL);
if ((overall_options & PCRE2_FIRSTLINE) != 0)
{
@@ -3375,7 +3692,7 @@ else if ((overall_options & PCRE2_USE_OFFSET_LIMIT) != 0)
OP1(SLJIT_MOV, TMP2, 0, STR_END, 0);
JUMPHERE(end2);
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
- add_jump(compiler, &common->forced_quit, CMP(SLJIT_LESS, TMP2, 0, STR_PTR, 0));
+ add_jump(compiler, &common->abort, CMP(SLJIT_LESS, TMP2, 0, STR_PTR, 0));
JUMPHERE(end);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, TMP2, 0);
}
@@ -3388,8 +3705,8 @@ if (newlinecheck)
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
end = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff);
- OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff);
+ OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
#if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
#endif
@@ -3426,8 +3743,8 @@ if (common->utf)
{
singlechar = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800);
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800);
- OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+ OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
JUMPHERE(singlechar);
@@ -3445,40 +3762,42 @@ if (newlinecheck)
return mainloop;
}
-#define MAX_N_CHARS 16
-#define MAX_DIFF_CHARS 6
-static SLJIT_INLINE void add_prefix_char(PCRE2_UCHAR chr, PCRE2_UCHAR *chars)
+static SLJIT_INLINE void add_prefix_char(PCRE2_UCHAR chr, fast_forward_char_data *chars, BOOL last)
{
-PCRE2_UCHAR i, len;
+sljit_u32 i, count = chars->count;
-len = chars[0];
-if (len == 255)
+if (count == 255)
return;
-if (len == 0)
+if (count == 0)
{
- chars[0] = 1;
- chars[1] = chr;
+ chars->count = 1;
+ chars->chars[0] = chr;
+
+ if (last)
+ chars->last_count = 1;
return;
}
-for (i = len; i > 0; i--)
- if (chars[i] == chr)
+for (i = 0; i < count; i++)
+ if (chars->chars[i] == chr)
return;
-if (len >= MAX_DIFF_CHARS - 1)
+if (count >= MAX_DIFF_CHARS)
{
- chars[0] = 255;
+ chars->count = 255;
return;
}
-len++;
-chars[len] = chr;
-chars[0] = len;
+chars->chars[count] = chr;
+chars->count = count + 1;
+
+if (last)
+ chars->last_count++;
}
-static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, PCRE2_UCHAR *chars, int max_chars, sljit_u32 *rec_count)
+static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int max_chars, sljit_u32 *rec_count)
{
/* Recursive function, which scans prefix literals. */
BOOL last, any, class, caseless;
@@ -3487,7 +3806,7 @@ sljit_u32 chr; /* Any unicode character. */
sljit_u8 *bytes, *bytes_end, byte;
PCRE2_SPTR alternative, cc_save, oc;
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
-PCRE2_UCHAR othercase[8];
+PCRE2_UCHAR othercase[4];
#elif defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16
PCRE2_UCHAR othercase[2];
#else
@@ -3510,6 +3829,7 @@ while (TRUE)
{
case OP_CHARI:
caseless = TRUE;
+ /* Fall through */
case OP_CHAR:
last = FALSE;
cc++;
@@ -3541,6 +3861,7 @@ while (TRUE)
case OP_MINPLUSI:
case OP_POSPLUSI:
caseless = TRUE;
+ /* Fall through */
case OP_PLUS:
case OP_MINPLUS:
case OP_POSPLUS:
@@ -3549,6 +3870,7 @@ while (TRUE)
case OP_EXACTI:
caseless = TRUE;
+ /* Fall through */
case OP_EXACT:
repeat = GET2(cc, 1);
last = FALSE;
@@ -3559,6 +3881,7 @@ while (TRUE)
case OP_MINQUERYI:
case OP_POSQUERYI:
caseless = TRUE;
+ /* Fall through */
case OP_QUERY:
case OP_MINQUERY:
case OP_POSQUERY:
@@ -3582,7 +3905,6 @@ while (TRUE)
continue;
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRA:
case OP_BRAPOS:
case OP_CBRA:
@@ -3703,12 +4025,12 @@ while (TRUE)
{
do
{
- chars[0] = 255;
+ chars->count = 255;
consumed++;
if (--max_chars == 0)
return consumed;
- chars += MAX_DIFF_CHARS;
+ chars++;
}
while (--repeat > 0);
@@ -3752,8 +4074,8 @@ while (TRUE)
do
{
if (bytes[31] & 0x80)
- chars[0] = 255;
- else if (chars[0] != 255)
+ chars->count = 255;
+ else if (chars->count != 255)
{
bytes_end = bytes + 32;
chr = 0;
@@ -3768,7 +4090,7 @@ while (TRUE)
do
{
if ((byte & 0x1) != 0)
- add_prefix_char(chr, chars);
+ add_prefix_char(chr, chars, TRUE);
byte >>= 1;
chr++;
}
@@ -3776,14 +4098,14 @@ while (TRUE)
chr = (chr + 7) & ~7;
}
}
- while (chars[0] != 255 && bytes < bytes_end);
+ while (chars->count != 255 && bytes < bytes_end);
bytes = bytes_end - 32;
}
consumed++;
if (--max_chars == 0)
return consumed;
- chars += MAX_DIFF_CHARS;
+ chars++;
}
while (--repeat > 0);
@@ -3847,17 +4169,18 @@ while (TRUE)
oc = othercase;
do
{
+ len--;
+ consumed++;
+
chr = *cc;
- add_prefix_char(*cc, chars);
+ add_prefix_char(*cc, chars, len == 0);
if (caseless)
- add_prefix_char(*oc, chars);
+ add_prefix_char(*oc, chars, len == 0);
- len--;
- consumed++;
if (--max_chars == 0)
return consumed;
- chars += MAX_DIFF_CHARS;
+ chars++;
cc++;
oc++;
}
@@ -3876,7 +4199,37 @@ while (TRUE)
}
}
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+static void jumpto_if_not_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg, struct sljit_label *label)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0);
+CMPTO(SLJIT_EQUAL, reg, 0, SLJIT_IMM, 0x80, label);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00);
+CMPTO(SLJIT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00, label);
+#else
+#error "Unknown code width"
+#endif
+}
+#endif
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND)
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+static struct sljit_jump *jump_if_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0);
+return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0x80);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00);
+return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00);
+#else
+#error "Unknown code width"
+#endif
+}
+#endif
static sljit_s32 character_to_int32(PCRE2_UCHAR chr)
{
@@ -3895,39 +4248,143 @@ return value;
#endif
}
-static SLJIT_INLINE void fast_forward_first_char2_sse2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2)
+static void load_from_mem_sse2(struct sljit_compiler *compiler, sljit_s32 dst_xmm_reg, sljit_s32 src_general_reg)
+{
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+sljit_u8 instruction[5];
+#else
+sljit_u8 instruction[4];
+#endif
+
+SLJIT_ASSERT(dst_xmm_reg < 8);
+
+/* MOVDQA xmm1, xmm2/m128 */
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+if (src_general_reg < 8)
+ {
+ instruction[0] = 0x66;
+ instruction[1] = 0x0f;
+ instruction[2] = 0x6f;
+ instruction[3] = (dst_xmm_reg << 3) | src_general_reg;
+ sljit_emit_op_custom(compiler, instruction, 4);
+ }
+else
+ {
+ instruction[0] = 0x66;
+ instruction[1] = 0x41;
+ instruction[2] = 0x0f;
+ instruction[3] = 0x6f;
+ instruction[4] = (dst_xmm_reg << 3) | (src_general_reg & 0x7);
+ sljit_emit_op_custom(compiler, instruction, 4);
+ }
+#else
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+instruction[2] = 0x6f;
+instruction[3] = (dst_xmm_reg << 3) | src_general_reg;
+sljit_emit_op_custom(compiler, instruction, 4);
+#endif
+}
+
+static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, PCRE2_UCHAR char1, PCRE2_UCHAR char2,
+ sljit_u32 bit, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind)
+{
+sljit_u8 instruction[4];
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+
+if (char1 == char2 || bit != 0)
+ {
+ if (bit != 0)
+ {
+ /* POR xmm1, xmm2/m128 */
+ /* instruction[0] = 0x66; */
+ /* instruction[1] = 0x0f; */
+ instruction[2] = 0xeb;
+ instruction[3] = 0xc0 | (dst_ind << 3) | cmp2_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+ }
+
+ /* PCMPEQB/W/D xmm1, xmm2/m128 */
+ /* instruction[0] = 0x66; */
+ /* instruction[1] = 0x0f; */
+ instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+ instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+ }
+else
+ {
+ /* MOVDQA xmm1, xmm2/m128 */
+ /* instruction[0] = 0x66; */
+ /* instruction[1] = 0x0f; */
+ instruction[2] = 0x6f;
+ instruction[3] = 0xc0 | (tmp_ind << 3) | dst_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+
+ /* PCMPEQB/W/D xmm1, xmm2/m128 */
+ /* instruction[0] = 0x66; */
+ /* instruction[1] = 0x0f; */
+ instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+ instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+
+ instruction[3] = 0xc0 | (tmp_ind << 3) | cmp2_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+
+ /* POR xmm1, xmm2/m128 */
+ /* instruction[0] = 0x66; */
+ /* instruction[1] = 0x0f; */
+ instruction[2] = 0xeb;
+ instruction[3] = 0xc0 | (dst_ind << 3) | tmp_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+ }
+}
+
+static void fast_forward_first_char2_sse2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
{
DEFINE_COMPILER;
struct sljit_label *start;
-struct sljit_jump *quit[3];
-struct sljit_jump *nomatch;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *restart;
+#endif
+struct sljit_jump *quit;
+struct sljit_jump *partial_quit[2];
sljit_u8 instruction[8];
sljit_s32 tmp1_ind = sljit_get_register_index(TMP1);
-sljit_s32 tmp2_ind = sljit_get_register_index(TMP2);
+// sljit_s32 tmp2_ind = sljit_get_register_index(TMP2);
sljit_s32 str_ptr_ind = sljit_get_register_index(STR_PTR);
-BOOL load_twice = FALSE;
-PCRE2_UCHAR bit;
+sljit_s32 data_ind = 0;
+sljit_s32 tmp_ind = 1;
+sljit_s32 cmp1_ind = 2;
+sljit_s32 cmp2_ind = 3;
+sljit_u32 bit = 0;
-bit = char1 ^ char2;
-if (!is_powerof2(bit))
- bit = 0;
+SLJIT_UNUSED_ARG(offset);
-if ((char1 != char2) && bit == 0)
- load_twice = TRUE;
+if (char1 != char2)
+ {
+ bit = char1 ^ char2;
+ if (!is_powerof2(bit))
+ bit = 0;
+ }
-quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+partial_quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+ add_jump(compiler, &common->failed_match, partial_quit[0]);
/* First part (unaligned start) */
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit));
-SLJIT_ASSERT(tmp1_ind < 8 && tmp2_ind == 1);
+// SLJIT_ASSERT(tmp1_ind < 8 && tmp2_ind == 1);
+
+SLJIT_ASSERT(tmp1_ind < 8);
/* MOVD xmm, r/m32 */
instruction[0] = 0x66;
instruction[1] = 0x0f;
instruction[2] = 0x6e;
-instruction[3] = 0xc0 | (2 << 3) | tmp1_ind;
+instruction[3] = 0xc0 | (cmp1_ind << 3) | tmp1_ind;
sljit_emit_op_custom(compiler, instruction, 4);
if (char1 != char2)
@@ -3935,224 +4392,521 @@ if (char1 != char2)
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(bit != 0 ? bit : char2));
/* MOVD xmm, r/m32 */
- instruction[3] = 0xc0 | (3 << 3) | tmp1_ind;
+ instruction[3] = 0xc0 | (cmp2_ind << 3) | tmp1_ind;
sljit_emit_op_custom(compiler, instruction, 4);
}
+OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+
/* PSHUFD xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
instruction[2] = 0x70;
-instruction[3] = 0xc0 | (2 << 3) | 2;
+instruction[3] = 0xc0 | (cmp1_ind << 3) | 2;
instruction[4] = 0;
sljit_emit_op_custom(compiler, instruction, 5);
if (char1 != char2)
{
/* PSHUFD xmm1, xmm2/m128, imm8 */
- instruction[3] = 0xc0 | (3 << 3) | 3;
- instruction[4] = 0;
+ instruction[3] = 0xc0 | (cmp2_ind << 3) | 3;
sljit_emit_op_custom(compiler, instruction, 5);
}
-OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 0xf);
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+restart = LABEL();
+#endif
OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf);
-/* MOVDQA xmm1, xmm2/m128 */
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+load_from_mem_sse2(compiler, data_ind, str_ptr_ind);
+fast_forward_char_pair_sse2_compare(compiler, char1, char2, bit, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
-if (str_ptr_ind < 8)
- {
- instruction[2] = 0x6f;
- instruction[3] = (0 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 4);
-
- if (load_twice)
- {
- instruction[3] = (1 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 4);
- }
- }
-else
- {
- instruction[1] = 0x41;
- instruction[2] = 0x0f;
- instruction[3] = 0x6f;
- instruction[4] = (0 << 3) | (str_ptr_ind & 0x7);
- sljit_emit_op_custom(compiler, instruction, 5);
+/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
+sljit_emit_op_custom(compiler, instruction, 4);
- if (load_twice)
- {
- instruction[4] = (1 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 5);
- }
- instruction[1] = 0x0f;
- }
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0);
-#else
+/* BSF r32, r/m32 */
+instruction[0] = 0x0f;
+instruction[1] = 0xbc;
+instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind;
+sljit_emit_op_custom(compiler, instruction, 3);
+sljit_set_current_flags(compiler, SLJIT_SET_Z);
-instruction[2] = 0x6f;
-instruction[3] = (0 << 3) | str_ptr_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
+quit = JUMP(SLJIT_NOT_ZERO);
-if (load_twice)
- {
- instruction[3] = (1 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 4);
- }
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
-#endif
+start = LABEL();
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
-if (bit != 0)
- {
- /* POR xmm1, xmm2/m128 */
- instruction[2] = 0xeb;
- instruction[3] = 0xc0 | (0 << 3) | 3;
- sljit_emit_op_custom(compiler, instruction, 4);
- }
+partial_quit[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+ add_jump(compiler, &common->failed_match, partial_quit[1]);
-/* PCMPEQB/W/D xmm1, xmm2/m128 */
-instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
-instruction[3] = 0xc0 | (0 << 3) | 2;
-sljit_emit_op_custom(compiler, instruction, 4);
+/* Second part (aligned) */
-if (load_twice)
- {
- instruction[3] = 0xc0 | (1 << 3) | 3;
- sljit_emit_op_custom(compiler, instruction, 4);
- }
+load_from_mem_sse2(compiler, 0, str_ptr_ind);
+fast_forward_char_pair_sse2_compare(compiler, char1, char2, bit, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
/* PMOVMSKB reg, xmm */
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
instruction[2] = 0xd7;
instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
sljit_emit_op_custom(compiler, instruction, 4);
-if (load_twice)
- {
- OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP2, 0);
- instruction[3] = 0xc0 | (tmp2_ind << 3) | 1;
- sljit_emit_op_custom(compiler, instruction, 4);
-
- OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
- OP1(SLJIT_MOV, TMP2, 0, RETURN_ADDR, 0);
- }
-
-OP2(SLJIT_ASHR, TMP1, 0, TMP1, 0, TMP2, 0);
-
/* BSF r32, r/m32 */
instruction[0] = 0x0f;
instruction[1] = 0xbc;
instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind;
sljit_emit_op_custom(compiler, instruction, 3);
+sljit_set_current_flags(compiler, SLJIT_SET_Z);
-nomatch = JUMP(SLJIT_ZERO);
+JUMPTO(SLJIT_ZERO, start);
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+JUMPHERE(quit);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-quit[1] = JUMP(SLJIT_JUMP);
-JUMPHERE(nomatch);
+if (common->mode != PCRE2_JIT_COMPLETE)
+ {
+ JUMPHERE(partial_quit[0]);
+ JUMPHERE(partial_quit[1]);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
+ CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0);
+ }
+else
+ add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-start = LABEL();
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
-quit[2] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && offset > 0)
+ {
+ SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
-/* Second part (aligned) */
+ OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset));
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
+ quit = jump_if_utf_char_start(compiler, TMP1);
-/* MOVDQA xmm1, xmm2/m128 */
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+ add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+ OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+ JUMPTO(SLJIT_JUMP, restart);
+
+ JUMPHERE(quit);
+ }
+#endif
+}
+
+#ifndef _WIN64
-if (str_ptr_ind < 8)
+static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_sse2_offset(void)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+return 15;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+return 7;
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+return 3;
+#else
+#error "Unsupported unit width"
+#endif
+}
+
+static void fast_forward_char_pair_sse2(compiler_common *common, sljit_s32 offs1,
+ PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b)
+{
+DEFINE_COMPILER;
+sljit_u32 bit1 = 0;
+sljit_u32 bit2 = 0;
+sljit_u32 diff = IN_UCHARS(offs1 - offs2);
+sljit_s32 tmp1_ind = sljit_get_register_index(TMP1);
+sljit_s32 tmp2_ind = sljit_get_register_index(TMP2);
+sljit_s32 str_ptr_ind = sljit_get_register_index(STR_PTR);
+sljit_s32 data1_ind = 0;
+sljit_s32 data2_ind = 1;
+sljit_s32 tmp_ind = 2;
+sljit_s32 cmp1a_ind = 3;
+sljit_s32 cmp1b_ind = 4;
+sljit_s32 cmp2a_ind = 5;
+sljit_s32 cmp2b_ind = 6;
+struct sljit_label *start;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *restart;
+#endif
+struct sljit_jump *jump[2];
+
+sljit_u8 instruction[8];
+
+SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2);
+SLJIT_ASSERT(diff <= IN_UCHARS(max_fast_forward_char_pair_sse2_offset()));
+SLJIT_ASSERT(tmp1_ind < 8 && tmp2_ind == 1);
+
+/* Initialize. */
+if (common->match_end_ptr != 0)
{
- instruction[2] = 0x6f;
- instruction[3] = (0 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 4);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+ OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
+ OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1));
- if (load_twice)
+ OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, STR_END, 0);
+ CMOV(SLJIT_LESS, STR_END, TMP1, 0);
+ }
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+/* MOVD xmm, r/m32 */
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+instruction[2] = 0x6e;
+
+if (char1a == char1b)
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
+else
+ {
+ bit1 = char1a ^ char1b;
+ if (is_powerof2(bit1))
{
- instruction[3] = (1 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 4);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a | bit1));
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit1));
+ }
+ else
+ {
+ bit1 = 0;
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char1b));
}
}
-else
+
+instruction[3] = 0xc0 | (cmp1a_ind << 3) | tmp1_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (char1a != char1b)
{
- instruction[1] = 0x41;
- instruction[2] = 0x0f;
- instruction[3] = 0x6f;
- instruction[4] = (0 << 3) | (str_ptr_ind & 0x7);
- sljit_emit_op_custom(compiler, instruction, 5);
+ instruction[3] = 0xc0 | (cmp1b_ind << 3) | tmp2_ind;
+ sljit_emit_op_custom(compiler, instruction, 4);
+ }
- if (load_twice)
+if (char2a == char2b)
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
+else
+ {
+ bit2 = char2a ^ char2b;
+ if (is_powerof2(bit2))
{
- instruction[4] = (1 << 3) | str_ptr_ind;
- sljit_emit_op_custom(compiler, instruction, 5);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a | bit2));
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit2));
+ }
+ else
+ {
+ bit2 = 0;
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char2b));
}
- instruction[1] = 0x0f;
}
-#else
-
-instruction[2] = 0x6f;
-instruction[3] = (0 << 3) | str_ptr_ind;
+instruction[3] = 0xc0 | (cmp2a_ind << 3) | tmp1_ind;
sljit_emit_op_custom(compiler, instruction, 4);
-if (load_twice)
+if (char2a != char2b)
{
- instruction[3] = (1 << 3) | str_ptr_ind;
+ instruction[3] = 0xc0 | (cmp2b_ind << 3) | tmp2_ind;
sljit_emit_op_custom(compiler, instruction, 4);
}
-#endif
+/* PSHUFD xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x70;
+instruction[4] = 0;
-if (bit != 0)
+instruction[3] = 0xc0 | (cmp1a_ind << 3) | cmp1a_ind;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+if (char1a != char1b)
{
- /* POR xmm1, xmm2/m128 */
- instruction[2] = 0xeb;
- instruction[3] = 0xc0 | (0 << 3) | 3;
- sljit_emit_op_custom(compiler, instruction, 4);
+ instruction[3] = 0xc0 | (cmp1b_ind << 3) | cmp1b_ind;
+ sljit_emit_op_custom(compiler, instruction, 5);
}
-/* PCMPEQB/W/D xmm1, xmm2/m128 */
-instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
-instruction[3] = 0xc0 | (0 << 3) | 2;
-sljit_emit_op_custom(compiler, instruction, 4);
+instruction[3] = 0xc0 | (cmp2a_ind << 3) | cmp2a_ind;
+sljit_emit_op_custom(compiler, instruction, 5);
-if (load_twice)
+if (char2a != char2b)
{
- instruction[3] = 0xc0 | (1 << 3) | 3;
- sljit_emit_op_custom(compiler, instruction, 4);
+ instruction[3] = 0xc0 | (cmp2b_ind << 3) | cmp2b_ind;
+ sljit_emit_op_custom(compiler, instruction, 5);
}
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+restart = LABEL();
+#endif
+
+OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1 - offs2));
+OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
+OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, ~0xf);
+
+load_from_mem_sse2(compiler, data1_ind, str_ptr_ind);
+
+jump[0] = CMP(SLJIT_EQUAL, STR_PTR, 0, TMP1, 0);
+
+load_from_mem_sse2(compiler, data2_ind, tmp1_ind);
+
+/* MOVDQA xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x6f;
+instruction[3] = 0xc0 | (tmp_ind << 3) | data1_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PSLLDQ xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x73;
+instruction[3] = 0xc0 | (7 << 3) | tmp_ind;
+instruction[4] = diff;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+/* PSRLDQ xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+/* instruction[2] = 0x73; */
+instruction[3] = 0xc0 | (3 << 3) | data2_ind;
+instruction[4] = 16 - diff;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+/* POR xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xeb;
+instruction[3] = 0xc0 | (data2_ind << 3) | tmp_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+jump[1] = JUMP(SLJIT_JUMP);
+
+JUMPHERE(jump[0]);
+
+/* MOVDQA xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x6f;
+instruction[3] = 0xc0 | (data2_ind << 3) | data1_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PSLLDQ xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x73;
+instruction[3] = 0xc0 | (7 << 3) | data2_ind;
+instruction[4] = diff;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+JUMPHERE(jump[1]);
+
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf);
+
+fast_forward_char_pair_sse2_compare(compiler, char2a, char2b, bit2, data2_ind, cmp2a_ind, cmp2b_ind, tmp_ind);
+fast_forward_char_pair_sse2_compare(compiler, char1a, char1b, bit1, data1_ind, cmp1a_ind, cmp1b_ind, tmp_ind);
+
+/* PAND xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xdb;
+instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
instruction[2] = 0xd7;
instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
sljit_emit_op_custom(compiler, instruction, 4);
-if (load_twice)
- {
- instruction[3] = 0xc0 | (tmp2_ind << 3) | 1;
- sljit_emit_op_custom(compiler, instruction, 4);
+/* Ignore matches before the first STR_PTR. */
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0);
- OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
- }
+/* BSF r32, r/m32 */
+instruction[0] = 0x0f;
+instruction[1] = 0xbc;
+instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind;
+sljit_emit_op_custom(compiler, instruction, 3);
+sljit_set_current_flags(compiler, SLJIT_SET_Z);
+
+jump[0] = JUMP(SLJIT_NOT_ZERO);
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+
+/* Main loop. */
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+
+start = LABEL();
+
+load_from_mem_sse2(compiler, data2_ind, str_ptr_ind);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+load_from_mem_sse2(compiler, data1_ind, str_ptr_ind);
+
+/* PSRLDQ xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x73;
+instruction[3] = 0xc0 | (3 << 3) | data2_ind;
+instruction[4] = 16 - diff;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+/* MOVDQA xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x6f;
+instruction[3] = 0xc0 | (tmp_ind << 3) | data1_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PSLLDQ xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x73;
+instruction[3] = 0xc0 | (7 << 3) | tmp_ind;
+instruction[4] = diff;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+/* POR xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xeb;
+instruction[3] = 0xc0 | (data2_ind << 3) | tmp_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+fast_forward_char_pair_sse2_compare(compiler, char1a, char1b, bit1, data1_ind, cmp1a_ind, cmp1b_ind, tmp_ind);
+fast_forward_char_pair_sse2_compare(compiler, char2a, char2b, bit2, data2_ind, cmp2a_ind, cmp2b_ind, tmp_ind);
+
+/* PAND xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xdb;
+instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
+sljit_emit_op_custom(compiler, instruction, 4);
/* BSF r32, r/m32 */
instruction[0] = 0x0f;
instruction[1] = 0xbc;
instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind;
sljit_emit_op_custom(compiler, instruction, 3);
+sljit_set_current_flags(compiler, SLJIT_SET_Z);
JUMPTO(SLJIT_ZERO, start);
+JUMPHERE(jump[0]);
+
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-start = LABEL();
-SET_LABEL(quit[0], start);
-SET_LABEL(quit[1], start);
-SET_LABEL(quit[2], start);
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+if (common->match_end_ptr != 0)
+ OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf)
+ {
+ OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offs1));
+
+ jump[0] = jump_if_utf_char_start(compiler, TMP1);
+
+ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+ CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, restart);
+
+ add_jump(compiler, &common->failed_match, JUMP(SLJIT_JUMP));
+
+ JUMPHERE(jump[0]);
+ }
+#endif
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
+
+if (common->match_end_ptr != 0)
+ OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
}
+static BOOL check_fast_forward_char_pair_sse2(compiler_common *common, fast_forward_char_data *chars, int max)
+{
+sljit_s32 i, j, priority, count;
+sljit_u32 priorities;
+PCRE2_UCHAR a1, a2, b1, b2;
+
+priorities = 0;
+
+count = 0;
+for (i = 0; i < max; i++)
+ {
+ if (chars[i].last_count > 2)
+ {
+ SLJIT_ASSERT(chars[i].last_count <= 7);
+
+ priorities |= (1 << chars[i].last_count);
+ count++;
+ }
+ }
+
+if (count < 2)
+ return FALSE;
+
+for (priority = 7; priority > 2; priority--)
+ {
+ if ((priorities & (1 << priority)) == 0)
+ continue;
+
+ for (i = max - 1; i >= 1; i--)
+ if (chars[i].last_count >= priority)
+ {
+ SLJIT_ASSERT(chars[i].count <= 2 && chars[i].count >= 1);
+
+ a1 = chars[i].chars[0];
+ a2 = chars[i].chars[1];
+
+ j = i - max_fast_forward_char_pair_sse2_offset();
+ if (j < 0)
+ j = 0;
+
+ while (j < i)
+ {
+ if (chars[j].last_count >= priority)
+ {
+ b1 = chars[j].chars[0];
+ b2 = chars[j].chars[1];
+
+ if (a1 != b1 && a1 != b2 && a2 != b1 && a2 != b2)
+ {
+ fast_forward_char_pair_sse2(common, i, a1, a2, j, b1, b2);
+ return TRUE;
+ }
+ }
+ j++;
+ }
+ }
+ }
+
+return FALSE;
+}
+
+#endif
+
#undef SSE2_COMPARE_TYPE_INDEX
#endif
@@ -4161,15 +4915,16 @@ static void fast_forward_first_char2(compiler_common *common, PCRE2_UCHAR char1,
{
DEFINE_COMPILER;
struct sljit_label *start;
-struct sljit_jump *quit;
-struct sljit_jump *found;
+struct sljit_jump *match;
+struct sljit_jump *partial_quit;
PCRE2_UCHAR mask;
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-struct sljit_label *utf_start = NULL;
-struct sljit_jump *utf_quit = NULL;
-#endif
BOOL has_match_end = (common->match_end_ptr != 0);
+SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE || offset == 0);
+
+if (has_match_end)
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+
if (offset > 0)
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
@@ -4177,76 +4932,21 @@ if (has_match_end)
{
OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
- OP2(SLJIT_ADD, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, SLJIT_IMM, IN_UCHARS(offset + 1));
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
- if (sljit_x86_is_cmov_available())
- {
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_END, 0, TMP3, 0);
- sljit_x86_emit_cmov(compiler, SLJIT_GREATER, STR_END, TMP3, 0);
- }
-#endif
- {
- quit = CMP(SLJIT_LESS_EQUAL, STR_END, 0, TMP3, 0);
- OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
- JUMPHERE(quit);
- }
+ OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offset + 1));
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_END, 0, TMP1, 0);
+ CMOV(SLJIT_GREATER, STR_END, TMP1, 0);
}
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-if (common->utf && offset > 0)
- utf_start = LABEL();
-#endif
-
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND)
/* SSE2 accelerated first character search. */
-if (sljit_x86_is_sse2_available())
+if (sljit_has_cpu_feature(SLJIT_HAS_SSE2))
{
- fast_forward_first_char2_sse2(common, char1, char2);
-
- SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE || offset == 0);
- if (common->mode == PCRE2_JIT_COMPLETE)
- {
- /* In complete mode, we don't need to run a match when STR_PTR == STR_END. */
- SLJIT_ASSERT(common->forced_quit_label == NULL);
- OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
- add_jump(compiler, &common->forced_quit, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
- if (common->utf && offset > 0)
- {
- SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
-
- OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset));
- OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-#if PCRE2_CODE_UNIT_WIDTH == 8
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
- CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, utf_start);
-#elif PCRE2_CODE_UNIT_WIDTH == 16
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, utf_start);
-#else
-#error "Unknown code width"
-#endif
- OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
- }
-#endif
+ fast_forward_first_char2_sse2(common, char1, char2, offset);
- if (offset > 0)
- OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
- }
- else if (sljit_x86_is_cmov_available())
- {
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
- sljit_x86_emit_cmov(compiler, SLJIT_GREATER_EQUAL, STR_PTR, has_match_end ? SLJIT_MEM1(SLJIT_SP) : STR_END, has_match_end ? common->match_end_ptr : 0);
- }
- else
- {
- quit = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
- OP1(SLJIT_MOV, STR_PTR, 0, has_match_end ? SLJIT_MEM1(SLJIT_SP) : STR_END, has_match_end ? common->match_end_ptr : 0);
- JUMPHERE(quit);
- }
+ if (offset > 0)
+ OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
if (has_match_end)
OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
@@ -4255,85 +4955,56 @@ if (sljit_x86_is_sse2_available())
#endif
-quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
-
start = LABEL();
+
+partial_quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+ add_jump(compiler, &common->failed_match, partial_quit);
+
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
if (char1 == char2)
- found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1);
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, char1, start);
else
{
mask = char1 ^ char2;
if (is_powerof2(mask))
{
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, mask);
- found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1 | mask);
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, char1 | mask, start);
}
else
{
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char1);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char2);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- found = JUMP(SLJIT_NOT_ZERO);
+ match = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1);
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, char2, start);
+ JUMPHERE(match);
}
}
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, start);
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-if (common->utf && offset > 0)
- utf_quit = JUMP(SLJIT_JUMP);
-#endif
-
-JUMPHERE(found);
-
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
if (common->utf && offset > 0)
{
- OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset));
- OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-#if PCRE2_CODE_UNIT_WIDTH == 8
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
- CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, utf_start);
-#elif PCRE2_CODE_UNIT_WIDTH == 16
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, utf_start);
-#else
-#error "Unknown code width"
-#endif
- OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
- JUMPHERE(utf_quit);
+ OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-(offset + 1)));
+ jumpto_if_not_utf_char_start(compiler, TMP1, start);
}
#endif
-JUMPHERE(quit);
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset + 1));
+
+if (common->mode != PCRE2_JIT_COMPLETE)
+ JUMPHERE(partial_quit);
if (has_match_end)
- {
- quit = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
- if (offset > 0)
- OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
- JUMPHERE(quit);
OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
- }
-
-if (offset > 0)
- OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
}
static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common)
{
DEFINE_COMPILER;
struct sljit_label *start;
-struct sljit_jump *quit;
struct sljit_jump *match;
-/* bytes[0] represent the number of characters between 0
-and MAX_N_BYTES - 1, 255 represents any character. */
-PCRE2_UCHAR chars[MAX_N_CHARS * MAX_DIFF_CHARS];
+fast_forward_char_data chars[MAX_N_CHARS];
sljit_s32 offset;
PCRE2_UCHAR mask;
PCRE2_UCHAR *char_set, *char_set_end;
@@ -4344,7 +5015,10 @@ BOOL in_range;
sljit_u32 rec_count;
for (i = 0; i < MAX_N_CHARS; i++)
- chars[i * MAX_DIFF_CHARS] = 0;
+ {
+ chars[i].count = 0;
+ chars[i].last_count = 0;
+ }
rec_count = 10000;
max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count);
@@ -4352,21 +5026,50 @@ max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count);
if (max < 1)
return FALSE;
+/* Convert last_count to priority. */
+for (i = 0; i < max; i++)
+ {
+ SLJIT_ASSERT(chars[i].count > 0 && chars[i].last_count <= chars[i].count);
+
+ if (chars[i].count == 1)
+ {
+ chars[i].last_count = (chars[i].last_count == 1) ? 7 : 5;
+ /* Simplifies algorithms later. */
+ chars[i].chars[1] = chars[i].chars[0];
+ }
+ else if (chars[i].count == 2)
+ {
+ SLJIT_ASSERT(chars[i].chars[0] != chars[i].chars[1]);
+
+ if (is_powerof2(chars[i].chars[0] ^ chars[i].chars[1]))
+ chars[i].last_count = (chars[i].last_count == 2) ? 6 : 4;
+ else
+ chars[i].last_count = (chars[i].last_count == 2) ? 3 : 2;
+ }
+ else
+ chars[i].last_count = (chars[i].count == 255) ? 0 : 1;
+ }
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND) && !(defined _WIN64)
+if (check_fast_forward_char_pair_sse2(common, chars, max))
+ return TRUE;
+#endif
+
in_range = FALSE;
/* Prevent compiler "uninitialized" warning */
from = 0;
range_len = 4 /* minimum length */ - 1;
for (i = 0; i <= max; i++)
{
- if (in_range && (i - from) > range_len && (chars[(i - 1) * MAX_DIFF_CHARS] < 255))
+ if (in_range && (i - from) > range_len && (chars[i - 1].count < 255))
{
range_len = i - from;
range_right = i - 1;
}
- if (i < max && chars[i * MAX_DIFF_CHARS] < 255)
+ if (i < max && chars[i].count < 255)
{
- SLJIT_ASSERT(chars[i * MAX_DIFF_CHARS] > 0);
+ SLJIT_ASSERT(chars[i].count > 0);
if (!in_range)
{
in_range = TRUE;
@@ -4386,16 +5089,17 @@ if (range_right >= 0)
for (i = 0; i < range_len; i++)
{
- char_set = chars + ((range_right - i) * MAX_DIFF_CHARS);
- SLJIT_ASSERT(char_set[0] > 0 && char_set[0] < 255);
- char_set_end = char_set + char_set[0];
- char_set++;
- while (char_set <= char_set_end)
+ SLJIT_ASSERT(chars[range_right - i].count > 0 && chars[range_right - i].count < 255);
+
+ char_set = chars[range_right - i].chars;
+ char_set_end = char_set + chars[range_right - i].count;
+ do
{
if (update_table[(*char_set) & 0xff] > IN_UCHARS(i))
update_table[(*char_set) & 0xff] = IN_UCHARS(i);
char_set++;
}
+ while (char_set < char_set_end);
}
}
@@ -4403,54 +5107,38 @@ offset = -1;
/* Scan forward. */
for (i = 0; i < max; i++)
{
+ if (range_right == i)
+ continue;
+
if (offset == -1)
{
- if (chars[i * MAX_DIFF_CHARS] <= 2)
+ if (chars[i].last_count >= 2)
offset = i;
}
- else if (chars[offset * MAX_DIFF_CHARS] == 2 && chars[i * MAX_DIFF_CHARS] <= 2)
- {
- if (chars[i * MAX_DIFF_CHARS] == 1)
- offset = i;
- else
- {
- mask = chars[offset * MAX_DIFF_CHARS + 1] ^ chars[offset * MAX_DIFF_CHARS + 2];
- if (!is_powerof2(mask))
- {
- mask = chars[i * MAX_DIFF_CHARS + 1] ^ chars[i * MAX_DIFF_CHARS + 2];
- if (is_powerof2(mask))
- offset = i;
- }
- }
- }
+ else if (chars[offset].last_count < chars[i].last_count)
+ offset = i;
}
+SLJIT_ASSERT(offset == -1 || (chars[offset].count >= 1 && chars[offset].count <= 2));
+
if (range_right < 0)
{
if (offset < 0)
return FALSE;
- SLJIT_ASSERT(chars[offset * MAX_DIFF_CHARS] >= 1 && chars[offset * MAX_DIFF_CHARS] <= 2);
/* Works regardless the value is 1 or 2. */
- mask = chars[offset * MAX_DIFF_CHARS + chars[offset * MAX_DIFF_CHARS]];
- fast_forward_first_char2(common, chars[offset * MAX_DIFF_CHARS + 1], mask, offset);
+ fast_forward_first_char2(common, chars[offset].chars[0], chars[offset].chars[1], offset);
return TRUE;
}
-if (range_right == offset)
- offset = -1;
-
-SLJIT_ASSERT(offset == -1 || (chars[offset * MAX_DIFF_CHARS] >= 1 && chars[offset * MAX_DIFF_CHARS] <= 2));
+SLJIT_ASSERT(range_right != offset);
-max -= 1;
-SLJIT_ASSERT(max > 0);
if (common->match_end_ptr != 0)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
- quit = CMP(SLJIT_LESS_EQUAL, STR_END, 0, TMP1, 0);
- OP1(SLJIT_MOV, STR_END, 0, TMP1, 0);
- JUMPHERE(quit);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_END, 0, TMP1, 0);
+ CMOV(SLJIT_GREATER, STR_END, TMP1, 0);
}
else
OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
@@ -4462,7 +5150,7 @@ OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table);
#endif
start = LABEL();
-quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0));
#if PCRE2_CODE_UNIT_WIDTH == 8 || (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right));
@@ -4483,20 +5171,20 @@ if (offset >= 0)
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offset));
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
- if (chars[offset * MAX_DIFF_CHARS] == 1)
- CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1], start);
+ if (chars[offset].count == 1)
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset].chars[0], start);
else
{
- mask = chars[offset * MAX_DIFF_CHARS + 1] ^ chars[offset * MAX_DIFF_CHARS + 2];
+ mask = chars[offset].chars[0] ^ chars[offset].chars[1];
if (is_powerof2(mask))
{
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, mask);
- CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1] | mask, start);
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset].chars[0] | mask, start);
}
else
{
- match = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1]);
- CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 2], start);
+ match = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset].chars[0]);
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset].chars[1], start);
JUMPHERE(match);
}
}
@@ -4512,15 +5200,9 @@ if (common->utf && offset != 0)
}
else
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
-#if PCRE2_CODE_UNIT_WIDTH == 8
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
- CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, start);
-#elif PCRE2_CODE_UNIT_WIDTH == 16
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, start);
-#else
-#error "Unknown code width"
-#endif
+
+ jumpto_if_not_utf_char_start(compiler, TMP1, start);
+
if (offset < 0)
OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
}
@@ -4529,33 +5211,20 @@ if (common->utf && offset != 0)
if (offset >= 0)
OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-JUMPHERE(quit);
-
if (common->match_end_ptr != 0)
- {
- if (range_right >= 0)
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
- if (range_right >= 0)
- {
- quit = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP1, 0);
- OP1(SLJIT_MOV, STR_PTR, 0, TMP1, 0);
- JUMPHERE(quit);
- }
- }
else
OP2(SLJIT_ADD, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
return TRUE;
}
-#undef MAX_N_CHARS
-
-static SLJIT_INLINE void fast_forward_first_char(compiler_common *common, PCRE2_UCHAR first_char, BOOL caseless)
+static SLJIT_INLINE void fast_forward_first_char(compiler_common *common)
{
+PCRE2_UCHAR first_char = (PCRE2_UCHAR)(common->re->first_codeunit);
PCRE2_UCHAR oc;
oc = first_char;
-if (caseless)
+if ((common->re->flags & PCRE2_FIRSTCASELESS) != 0)
{
oc = TABLE_GET(first_char, common->fcc, first_char);
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 8
@@ -4593,8 +5262,8 @@ if (common->nltype == NLTYPE_FIXED && common->newline > 255)
firstchar = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0);
OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(2));
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_PTR, 0, TMP1, 0);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_GREATER_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, STR_PTR, 0, TMP1, 0);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER_EQUAL);
#if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCHAR_SHIFT);
#endif
@@ -4638,8 +5307,8 @@ if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF)
JUMPHERE(foundcr);
notfoundnl = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, CHAR_NL);
- OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, CHAR_NL);
+ OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
#if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
#endif
@@ -4654,79 +5323,75 @@ if (common->match_end_ptr != 0)
OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
}
-static BOOL check_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks);
+static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks);
-static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, const sljit_u8 *start_bits)
+static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common)
{
DEFINE_COMPILER;
+const sljit_u8 *start_bits = common->re->start_bitmap;
struct sljit_label *start;
-struct sljit_jump *quit;
-struct sljit_jump *found = NULL;
-jump_list *matches = NULL;
+struct sljit_jump *partial_quit;
#if PCRE2_CODE_UNIT_WIDTH != 8
-struct sljit_jump *jump;
+struct sljit_jump *found = NULL;
#endif
+jump_list *matches = NULL;
if (common->match_end_ptr != 0)
{
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
OP1(SLJIT_MOV, RETURN_ADDR, 0, STR_END, 0);
- OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+ OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(1));
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_END, 0, TMP1, 0);
+ CMOV(SLJIT_GREATER, STR_END, TMP1, 0);
}
start = LABEL();
-quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+partial_quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+ add_jump(compiler, &common->failed_match, partial_quit);
+
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
-#ifdef SUPPORT_UNICODE
-if (common->utf)
- OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);
-#endif
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-if (!check_class_ranges(common, start_bits, (start_bits[31] & 0x80) != 0, TRUE, &matches))
+if (!optimize_class(common, start_bits, (start_bits[31] & 0x80) != 0, FALSE, &matches))
{
#if PCRE2_CODE_UNIT_WIDTH != 8
- jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 255);
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 255);
- JUMPHERE(jump);
+ if ((start_bits[31] & 0x80) != 0)
+ found = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 255);
+ else
+ CMPTO(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 255, start);
+#elif defined SUPPORT_UNICODE
+ if (common->utf && is_char7_bitset(start_bits, FALSE))
+ CMPTO(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 127, start);
#endif
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)start_bits);
- OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
- found = JUMP(SLJIT_NOT_ZERO);
+ if (sljit_get_register_index(TMP3) >= 0)
+ {
+ OP2(SLJIT_SHL, TMP3, 0, SLJIT_IMM, 1, TMP2, 0);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP3, 0);
+ }
+ else
+ {
+ OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
+ }
+ JUMPTO(SLJIT_ZERO, start);
}
+else
+ set_jumps(matches, start);
-#ifdef SUPPORT_UNICODE
-if (common->utf)
- OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
-#endif
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-#ifdef SUPPORT_UNICODE
-#if PCRE2_CODE_UNIT_WIDTH == 8
-if (common->utf)
- {
- CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);
- OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
- OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
- }
-#elif PCRE2_CODE_UNIT_WIDTH == 16
-if (common->utf)
- {
- CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800, start);
- OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800);
- OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
- OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
- OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
- }
-#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */
-#endif /* SUPPORT_UNICODE */
-JUMPTO(SLJIT_JUMP, start);
+#if PCRE2_CODE_UNIT_WIDTH != 8
if (found != NULL)
JUMPHERE(found);
-if (matches != NULL)
- set_jumps(matches, LABEL());
-JUMPHERE(quit);
+#endif
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+if (common->mode != PCRE2_JIT_COMPLETE)
+ JUMPHERE(partial_quit);
if (common->match_end_ptr != 0)
OP1(SLJIT_MOV, STR_END, 0, RETURN_ADDR, 0);
@@ -4802,31 +5467,50 @@ struct sljit_jump *jump;
struct sljit_label *mainloop;
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
-OP1(SLJIT_MOV, TMP1, 0, STACK_TOP, 0);
-GET_LOCAL_BASE(TMP3, 0, 0);
+GET_LOCAL_BASE(TMP1, 0, 0);
/* Drop frames until we reach STACK_TOP. */
mainloop = LABEL();
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), 0);
-OP2(SLJIT_SUB | SLJIT_SET_S, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0);
-jump = JUMP(SLJIT_SIG_LESS_EQUAL);
-
-OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP3, 0);
-OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(TMP1), sizeof(sljit_sw));
-OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), SLJIT_MEM1(TMP1), 2 * sizeof(sljit_sw));
-OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 3 * sizeof(sljit_sw));
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), -sizeof(sljit_sw));
+jump = CMP(SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0);
+
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+if (sljit_get_register_index (TMP3) < 0)
+ {
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), SLJIT_MEM1(STACK_TOP), -(3 * sizeof(sljit_sw)));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 3 * sizeof(sljit_sw));
+ }
+else
+ {
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
+ OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(STACK_TOP), -(3 * sizeof(sljit_sw)));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 3 * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, TMP1, 0);
+ GET_LOCAL_BASE(TMP1, 0, 0);
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), TMP3, 0);
+ }
JUMPTO(SLJIT_JUMP, mainloop);
JUMPHERE(jump);
-jump = JUMP(SLJIT_SIG_LESS);
-/* End of dropping frames. */
+jump = CMP(SLJIT_NOT_ZERO /* SIG_LESS */, TMP2, 0, SLJIT_IMM, 0);
+/* End of reverting values. */
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
JUMPHERE(jump);
OP1(SLJIT_NEG, TMP2, 0, TMP2, 0);
-OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP3, 0);
-OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(TMP1), sizeof(sljit_sw));
-OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_sw));
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+if (sljit_get_register_index (TMP3) < 0)
+ {
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2 * sizeof(sljit_sw));
+ }
+else
+ {
+ OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2 * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, TMP3, 0);
+ }
JUMPTO(SLJIT_JUMP, mainloop);
}
@@ -4859,11 +5543,11 @@ if (common->use_ucp)
jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_UNDERSCORE);
add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Nd - ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_No - ucp_Nd);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_No - ucp_Nd);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
JUMPHERE(jump);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP2, 0);
}
@@ -4903,11 +5587,11 @@ if (common->use_ucp)
jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_UNDERSCORE);
add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Nd - ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_No - ucp_Nd);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_No - ucp_Nd);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
JUMPHERE(jump);
}
else
@@ -4935,15 +5619,15 @@ else
}
set_jumps(skipread_list, LABEL());
-OP2(SLJIT_XOR | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
+OP2(SLJIT_XOR | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
sljit_emit_fast_return(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0);
}
-static BOOL check_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)
+static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)
{
/* May destroy TMP1. */
DEFINE_COMPILER;
-int ranges[MAX_RANGE_SIZE];
+int ranges[MAX_CLASS_RANGE_SIZE];
sljit_u8 bit, cbit, all;
int i, byte, length = 0;
@@ -4961,7 +5645,7 @@ for (i = 0; i < 256; )
cbit = (bits[byte] >> (i & 0x7)) & 0x1;
if (cbit != bit)
{
- if (length >= MAX_RANGE_SIZE)
+ if (length >= MAX_CLASS_RANGE_SIZE)
return FALSE;
ranges[length] = i;
length++;
@@ -4974,7 +5658,7 @@ for (i = 0; i < 256; )
if (((bit == 0) && nclass) || ((bit == 1) && !nclass))
{
- if (length >= MAX_RANGE_SIZE)
+ if (length >= MAX_CLASS_RANGE_SIZE)
return FALSE;
ranges[length] = 256;
length++;
@@ -5086,11 +5770,118 @@ switch(length)
return TRUE;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return FALSE;
}
}
+static BOOL optimize_class_chars(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)
+{
+/* May destroy TMP1. */
+DEFINE_COMPILER;
+uint16_t char_list[MAX_CLASS_CHARS_SIZE];
+uint8_t byte;
+sljit_s32 type;
+int i, j, k, len, c;
+
+if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV))
+ return FALSE;
+
+if (invert)
+ nclass = !nclass;
+
+len = 0;
+
+for (i = 0; i < 32; i++)
+ {
+ byte = bits[i];
+
+ if (nclass)
+ byte = ~byte;
+
+ j = 0;
+ while (byte != 0)
+ {
+ if (byte & 0x1)
+ {
+ c = i * 8 + j;
+
+ k = len;
+
+ if ((c & 0x20) != 0)
+ {
+ for (k = 0; k < len; k++)
+ if (char_list[k] == c - 0x20)
+ {
+ char_list[k] |= 0x120;
+ break;
+ }
+ }
+
+ if (k == len)
+ {
+ if (len >= MAX_CLASS_CHARS_SIZE)
+ return FALSE;
+
+ char_list[len++] = (uint16_t) c;
+ }
+ }
+
+ byte >>= 1;
+ j++;
+ }
+ }
+
+i = 0;
+j = 0;
+
+if (char_list[0] == 0)
+ {
+ i++;
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_ZERO);
+ }
+else
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0);
+
+while (i < len)
+ {
+ if ((char_list[i] & 0x100) != 0)
+ j++;
+ else
+ {
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char_list[i]);
+ CMOV(SLJIT_ZERO, TMP2, TMP1, 0);
+ }
+ i++;
+ }
+
+if (j != 0)
+ {
+ OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x20);
+
+ for (i = 0; i < len; i++)
+ if ((char_list[i] & 0x100) != 0)
+ {
+ j--;
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char_list[i] & 0xff);
+ CMOV(SLJIT_ZERO, TMP2, TMP1, 0);
+ }
+ }
+
+type = nclass ? SLJIT_NOT_EQUAL : SLJIT_EQUAL;
+add_jump(compiler, backtracks, CMP(type, TMP2, 0, SLJIT_IMM, 0));
+return TRUE;
+}
+
+static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)
+{
+/* May destroy TMP1. */
+if (optimize_class_ranges(common, bits, nclass, invert, backtracks))
+ return TRUE;
+return optimize_class_chars(common, bits, nclass, invert, backtracks);
+}
+
static void check_anynewline(compiler_common *common)
{
/* Check whether TMP1 contains a newline character. TMP2 destroyed. */
@@ -5099,22 +5890,22 @@ DEFINE_COMPILER;
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x0a);
-OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);
-OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
-OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);
+OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);
+OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
+OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
#if PCRE2_CODE_UNIT_WIDTH == 8
if (common->utf)
{
#endif
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2029 - 0x0a);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2029 - 0x0a);
#if PCRE2_CODE_UNIT_WIDTH == 8
}
#endif
#endif /* SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == [16|32] */
-OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
}
@@ -5125,34 +5916,34 @@ DEFINE_COMPILER;
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
-OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x09);
-OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
-OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x20);
-OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
-OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xa0);
+OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x09);
+OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
+OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x20);
+OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xa0);
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
#if PCRE2_CODE_UNIT_WIDTH == 8
if (common->utf)
{
#endif
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x1680);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x1680);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x2000);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x200A - 0x2000);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x202f - 0x2000);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x205f - 0x2000);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x3000 - 0x2000);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x200A - 0x2000);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x202f - 0x2000);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x205f - 0x2000);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x3000 - 0x2000);
#if PCRE2_CODE_UNIT_WIDTH == 8
}
#endif
#endif /* SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == [16|32] */
-OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
}
@@ -5165,22 +5956,22 @@ DEFINE_COMPILER;
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x0a);
-OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);
-OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
-OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);
+OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);
+OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
+OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
#if PCRE2_CODE_UNIT_WIDTH == 8
if (common->utf)
{
#endif
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2029 - 0x0a);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2029 - 0x0a);
#if PCRE2_CODE_UNIT_WIDTH == 8
}
#endif
#endif /* SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == [16|32] */
-OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
}
@@ -5205,7 +5996,7 @@ label = LABEL();
OP1(MOVU_UCHAR, CHAR1, 0, SLJIT_MEM1(TMP1), IN_UCHARS(1));
OP1(MOVU_UCHAR, CHAR2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
jump = CMP(SLJIT_NOT_EQUAL, CHAR1, 0, CHAR2, 0);
-OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1));
+OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1));
JUMPTO(SLJIT_NOT_ZERO, label);
JUMPHERE(jump);
@@ -5249,7 +6040,7 @@ OP1(SLJIT_MOV_U8, CHAR2, 0, SLJIT_MEM2(LCC_TABLE, CHAR2), 0);
JUMPHERE(jump);
#endif
jump = CMP(SLJIT_NOT_EQUAL, CHAR1, 0, CHAR2, 0);
-OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1));
+OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1));
JUMPTO(SLJIT_NOT_ZERO, label);
JUMPHERE(jump);
@@ -5416,7 +6207,7 @@ do
#endif
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
context->ucharptr = 0;
@@ -5591,7 +6382,7 @@ while (*cc != XCL_END)
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
cc += 2;
@@ -5609,13 +6400,13 @@ if ((cc[-1] & XCL_HASPROP) == 0)
if ((cc[-1] & XCL_MAP) != 0)
{
jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
- if (!check_class_ranges(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, &found))
+ if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, &found))
{
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
add_jump(compiler, &found, JUMP(SLJIT_NOT_ZERO));
}
@@ -5636,7 +6427,7 @@ else if ((cc[-1] & XCL_MAP) != 0)
#ifdef SUPPORT_UNICODE
charsaved = TRUE;
#endif
- if (!check_class_ranges(common, (const sljit_u8 *)cc, FALSE, TRUE, list))
+ if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list))
{
#if PCRE2_CODE_UNIT_WIDTH == 8
jump = NULL;
@@ -5648,7 +6439,7 @@ else if ((cc[-1] & XCL_MAP) != 0)
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO));
#if PCRE2_CODE_UNIT_WIDTH == 8
@@ -5667,6 +6458,15 @@ if (needstype || needsscript)
if (needschar && !charsaved)
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
+#if PCRE2_CODE_UNIT_WIDTH == 32
+ if (!common->utf)
+ {
+ jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+ JUMPHERE(jump);
+ }
+#endif
+
OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
@@ -5758,14 +6558,14 @@ while (*cc != XCL_END)
if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE))
{
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
- OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, numberofcmps == 0 ? SLJIT_UNUSED : TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
+ OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
numberofcmps++;
}
else if (numberofcmps > 0)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
numberofcmps = 0;
}
@@ -5784,14 +6584,14 @@ while (*cc != XCL_END)
if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE))
{
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
- OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, numberofcmps == 0 ? SLJIT_UNUSED : TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
+ OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
numberofcmps++;
}
else if (numberofcmps > 0)
{
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
numberofcmps = 0;
}
@@ -5816,12 +6616,12 @@ while (*cc != XCL_END)
break;
case PT_LAMP:
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Lu - typeoffset);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Ll - typeoffset);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Lt - typeoffset);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Lu - typeoffset);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Ll - typeoffset);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Lt - typeoffset);
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
@@ -5843,33 +6643,33 @@ while (*cc != XCL_END)
case PT_SPACE:
case PT_PXSPACE:
SET_CHAR_OFFSET(9);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd - 0x9);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd - 0x9);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x9);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x9);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e - 0x9);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e - 0x9);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
SET_TYPE_OFFSET(ucp_Zl);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Zl);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Zl);
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_WORD:
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_UNDERSCORE - charoffset));
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_UNDERSCORE - charoffset));
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
/* Fall through. */
case PT_ALNUM:
SET_TYPE_OFFSET(ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
- OP_FLAGS((*cc == PT_ALNUM) ? SLJIT_MOV : SLJIT_OR, TMP2, 0, (*cc == PT_ALNUM) ? SLJIT_UNUSED : TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
+ OP_FLAGS((*cc == PT_ALNUM) ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Nd);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_No - ucp_Nd);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_No - ucp_Nd);
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
@@ -5891,8 +6691,8 @@ while (*cc != XCL_END)
OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset);
OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
}
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, other_cases[1]);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, other_cases[1]);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
other_cases += 2;
}
else if (is_powerof2(other_cases[2] ^ other_cases[1]))
@@ -5904,63 +6704,63 @@ while (*cc != XCL_END)
OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset);
OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
}
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, other_cases[2]);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, other_cases[2]);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(other_cases[0] - charoffset));
- OP_FLAGS(SLJIT_OR | ((other_cases[3] == NOTACHAR) ? SLJIT_SET_E : 0), TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(other_cases[0] - charoffset));
+ OP_FLAGS(SLJIT_OR | ((other_cases[3] == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL);
other_cases += 3;
}
else
{
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
}
while (*other_cases != NOTACHAR)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
- OP_FLAGS(SLJIT_OR | ((*other_cases == NOTACHAR) ? SLJIT_SET_E : 0), TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
+ OP_FLAGS(SLJIT_OR | ((*other_cases == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL);
}
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_UCNC:
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_DOLLAR_SIGN - charoffset));
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_COMMERCIAL_AT - charoffset));
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_GRAVE_ACCENT - charoffset));
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_DOLLAR_SIGN - charoffset));
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_COMMERCIAL_AT - charoffset));
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_GRAVE_ACCENT - charoffset));
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
SET_CHAR_OFFSET(0xa0);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(0xd7ff - charoffset));
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(0xd7ff - charoffset));
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xe000 - 0);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_GREATER_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xe000 - 0);
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_GREATER_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_PXGRAPH:
/* C and Z groups are the farthest two groups. */
SET_TYPE_OFFSET(ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_GREATER);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER);
jump = CMP(SLJIT_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
/* In case of ucp_Cf, we overwrite the result. */
SET_CHAR_OFFSET(0x2066);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e - 0x2066);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e - 0x2066);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
JUMPHERE(jump);
jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
@@ -5969,21 +6769,21 @@ while (*cc != XCL_END)
case PT_PXPRINT:
/* C and Z groups are the farthest two groups. */
SET_TYPE_OFFSET(ucp_Ll);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_GREATER);
+ OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Ll);
- OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_NOT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Ll);
+ OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_NOT_EQUAL);
jump = CMP(SLJIT_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
/* In case of ucp_Cf, we overwrite the result. */
SET_CHAR_OFFSET(0x2066);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
- OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
+ OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
JUMPHERE(jump);
jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
@@ -5991,21 +6791,21 @@ while (*cc != XCL_END)
case PT_PXPUNCT:
SET_TYPE_OFFSET(ucp_Sc);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Sc);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Sc);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x7f);
- OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x7f);
+ OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Pc);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Ps - ucp_Pc);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Ps - ucp_Pc);
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
cc += 2;
@@ -6051,6 +6851,7 @@ switch(type)
case OP_NOT_WORD_BOUNDARY:
case OP_WORD_BOUNDARY:
add_jump(compiler, &common->wordboundary, JUMP(SLJIT_FAST_CALL));
+ sljit_set_current_flags(compiler, SLJIT_SET_Z);
add_jump(compiler, backtracks, JUMP(type == OP_NOT_WORD_BOUNDARY ? SLJIT_NOT_ZERO : SLJIT_ZERO));
return cc;
@@ -6066,10 +6867,10 @@ switch(type)
else
{
jump[1] = CMP(SLJIT_EQUAL, TMP2, 0, STR_END, 0);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP2, 0, STR_END, 0);
- OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff);
- OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_NOT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, STR_END, 0);
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff);
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_NOT_EQUAL);
add_jump(compiler, backtracks, JUMP(SLJIT_NOT_EQUAL));
check_partial(common, TRUE);
add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
@@ -6091,9 +6892,9 @@ switch(type)
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
jump[1] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR);
OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP2, 0, STR_END, 0);
+ OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, TMP2, 0, STR_END, 0);
jump[2] = JUMP(SLJIT_GREATER);
- add_jump(compiler, backtracks, JUMP(SLJIT_LESS));
+ add_jump(compiler, backtracks, JUMP(SLJIT_NOT_EQUAL) /* LESS */);
/* Equal. */
OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
jump[3] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL);
@@ -6112,6 +6913,7 @@ switch(type)
read_char_range(common, common->nlmin, common->nlmax, TRUE);
add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0));
add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL));
+ sljit_set_current_flags(compiler, SLJIT_SET_Z);
add_jump(compiler, backtracks, JUMP(SLJIT_ZERO));
OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
}
@@ -6129,8 +6931,8 @@ switch(type)
case OP_DOLL:
OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
- OP2(SLJIT_AND32 | SLJIT_SET_E, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
- add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO));
+ OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
+ add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
if (!common->endonly)
compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks);
@@ -6144,8 +6946,8 @@ switch(type)
case OP_DOLLM:
jump[1] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
- OP2(SLJIT_AND32 | SLJIT_SET_E, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
- add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO));
+ OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
+ add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
check_partial(common, FALSE);
jump[0] = JUMP(SLJIT_JUMP);
JUMPHERE(jump[1]);
@@ -6182,16 +6984,16 @@ switch(type)
OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0));
- OP2(SLJIT_AND32 | SLJIT_SET_E, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
- add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO));
+ OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+ add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
return cc;
case OP_CIRCM:
OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0);
- OP2(SLJIT_AND32 | SLJIT_SET_E, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
- add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO));
+ OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+ add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
jump[0] = JUMP(SLJIT_JUMP);
JUMPHERE(jump[1]);
@@ -6229,7 +7031,7 @@ switch(type)
label = LABEL();
add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP3, 0));
skip_char_back(common);
- OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
}
else
@@ -6242,7 +7044,7 @@ switch(type)
check_start_used_ptr(common);
return cc + LINK_SIZE;
}
-SLJIT_ASSERT_STOP();
+SLJIT_UNREACHABLE();
return cc;
}
@@ -6273,7 +7075,7 @@ switch(type)
#endif
read_char8_type(common, type == OP_NOT_DIGIT);
/* Flip the starting bit in the negative case. */
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_digit);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_digit);
add_jump(compiler, backtracks, JUMP(type == OP_DIGIT ? SLJIT_ZERO : SLJIT_NOT_ZERO));
return cc;
@@ -6287,7 +7089,7 @@ switch(type)
else
#endif
read_char8_type(common, type == OP_NOT_WHITESPACE);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_space);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_space);
add_jump(compiler, backtracks, JUMP(type == OP_WHITESPACE ? SLJIT_ZERO : SLJIT_NOT_ZERO));
return cc;
@@ -6301,7 +7103,7 @@ switch(type)
else
#endif
read_char8_type(common, type == OP_NOT_WORDCHAR);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_word);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_word);
add_jump(compiler, backtracks, JUMP(type == OP_WORDCHAR ? SLJIT_ZERO : SLJIT_NOT_ZERO));
return cc;
@@ -6343,8 +7145,8 @@ switch(type)
#elif PCRE2_CODE_UNIT_WIDTH == 16
jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800);
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800);
- OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+ OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
#endif
@@ -6404,6 +7206,7 @@ switch(type)
detect_partial_match(common, backtracks);
read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE);
add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL));
+ sljit_set_current_flags(compiler, SLJIT_SET_Z);
add_jump(compiler, backtracks, JUMP(type == OP_NOT_HSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO));
return cc;
@@ -6413,6 +7216,7 @@ switch(type)
detect_partial_match(common, backtracks);
read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE);
add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL));
+ sljit_set_current_flags(compiler, SLJIT_SET_Z);
add_jump(compiler, backtracks, JUMP(type == OP_NOT_VSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO));
return cc;
@@ -6439,7 +7243,7 @@ switch(type)
OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(STACK_TOP), (sljit_sw)PRIV(ucp_gbtable));
OP1(SLJIT_MOV, STACK_TOP, 0, TMP2, 0);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
JUMPTO(SLJIT_NOT_ZERO, label);
OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);
@@ -6582,7 +7386,7 @@ switch(type)
read_char_range(common, 0, 255, type == OP_NCLASS);
#endif
- if (check_class_ranges(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks))
+ if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks))
return cc + 32 / sizeof(PCRE2_UCHAR);
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
@@ -6609,7 +7413,7 @@ switch(type)
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
add_jump(compiler, backtracks, JUMP(SLJIT_ZERO));
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
@@ -6626,7 +7430,7 @@ switch(type)
return cc + GET(cc, 0) - 1;
#endif
}
-SLJIT_ASSERT_STOP();
+SLJIT_UNREACHABLE();
return cc;
}
@@ -6812,9 +7616,9 @@ else
#endif /* SUPPORT_UNICODE */
{
if (ref)
- OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1), TMP1, 0);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1), TMP1, 0);
else
- OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw), TMP1, 0);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw), TMP1, 0);
if (withchecks)
jump = JUMP(SLJIT_ZERO);
@@ -6905,7 +7709,7 @@ switch(type)
cc += 1 + IMM2_SIZE + 1 + 2 * IMM2_SIZE;
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
@@ -6919,7 +7723,7 @@ if (!minimize)
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 0);
/* Temporary release of STR_PTR. */
- OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
/* Handles both invalid and empty cases. Since the minimum repeat,
is zero the invalid case is basically the same as an empty case. */
if (ref)
@@ -6932,7 +7736,7 @@ if (!minimize)
zerolength = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw));
}
/* Restore if not zero length. */
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
}
else
{
@@ -7096,8 +7900,10 @@ if (entry == NULL)
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
return NULL;
entry->next = NULL;
- entry->entry = NULL;
- entry->calls = NULL;
+ entry->entry_label = NULL;
+ entry->backtrack_label = NULL;
+ entry->entry_calls = NULL;
+ entry->backtrack_calls = NULL;
entry->start = start;
if (prev != NULL)
@@ -7106,71 +7912,73 @@ if (entry == NULL)
common->entries = entry;
}
-if (common->has_set_som && common->mark_ptr != 0)
- {
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0));
- allocate_stack(common, 2);
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP2, 0);
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), TMP1, 0);
- }
-else if (common->has_set_som || common->mark_ptr != 0)
- {
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->has_set_som ? (int)(OVECTOR(0)) : common->mark_ptr);
- allocate_stack(common, 1);
- OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP2, 0);
- }
+BACKTRACK_AS(recurse_backtrack)->entry = entry;
-if (entry->entry == NULL)
- add_jump(compiler, &entry->calls, JUMP(SLJIT_FAST_CALL));
+if (entry->entry_label == NULL)
+ add_jump(compiler, &entry->entry_calls, JUMP(SLJIT_FAST_CALL));
else
- JUMPTO(SLJIT_FAST_CALL, entry->entry);
+ JUMPTO(SLJIT_FAST_CALL, entry->entry_label);
/* Leave if the match is failed. */
add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0));
+BACKTRACK_AS(recurse_backtrack)->matchingpath = LABEL();
return cc + 1 + LINK_SIZE;
}
static int SLJIT_CALL do_callout(struct jit_arguments *arguments, pcre2_callout_block *callout_block, PCRE2_SPTR *jit_ovector)
{
-PCRE2_SPTR begin = arguments->begin;
-PCRE2_SIZE *ovector = arguments->match_data->ovector;
-sljit_u32 oveccount = arguments->oveccount;
-sljit_u32 i;
+PCRE2_SPTR begin;
+PCRE2_SIZE *ovector;
+sljit_u32 oveccount, capture_top;
if (arguments->callout == NULL)
return 0;
+SLJIT_COMPILE_ASSERT(sizeof (PCRE2_SIZE) <= sizeof (sljit_sw), pcre2_size_must_be_lower_than_sljit_sw_size);
+
+begin = arguments->begin;
+ovector = (PCRE2_SIZE*)(callout_block + 1);
+oveccount = callout_block->capture_top;
+
+SLJIT_ASSERT(oveccount >= 1);
+
callout_block->version = 1;
/* Offsets in subject. */
callout_block->subject_length = arguments->end - arguments->begin;
-callout_block->start_match = (PCRE2_SPTR)callout_block->subject - arguments->begin;
-callout_block->current_position = (PCRE2_SPTR)callout_block->offset_vector - arguments->begin;
+callout_block->start_match = jit_ovector[0] - begin;
+callout_block->current_position = (PCRE2_SPTR)callout_block->offset_vector - begin;
callout_block->subject = begin;
/* Convert and copy the JIT offset vector to the ovector array. */
-callout_block->capture_top = 0;
+callout_block->capture_top = 1;
callout_block->offset_vector = ovector;
-for (i = 2; i < oveccount; i += 2)
- {
- ovector[i] = jit_ovector[i] - begin;
- ovector[i + 1] = jit_ovector[i + 1] - begin;
- if (jit_ovector[i] >= begin)
- callout_block->capture_top = i;
- }
-callout_block->capture_top = (callout_block->capture_top >> 1) + 1;
ovector[0] = PCRE2_UNSET;
ovector[1] = PCRE2_UNSET;
+ovector += 2;
+jit_ovector += 2;
+capture_top = 1;
+
+/* Convert pointers to sizes. */
+while (--oveccount != 0)
+ {
+ capture_top++;
+
+ ovector[0] = (PCRE2_SIZE)(jit_ovector[0] - begin);
+ ovector[1] = (PCRE2_SIZE)(jit_ovector[1] - begin);
+
+ if (ovector[0] != PCRE2_UNSET)
+ callout_block->capture_top = capture_top;
+
+ ovector += 2;
+ jit_ovector += 2;
+ }
+
return (arguments->callout)(callout_block, arguments->callout_data);
}
-/* Aligning to 8 byte. */
-#define CALLOUT_ARG_SIZE \
- (((int)sizeof(pcre2_callout_block) + 7) & ~7)
-
#define CALLOUT_ARG_OFFSET(arg) \
- (-CALLOUT_ARG_SIZE + SLJIT_OFFSETOF(pcre2_callout_block, arg))
+ SLJIT_OFFSETOF(pcre2_callout_block, arg)
static SLJIT_INLINE PCRE2_SPTR compile_callout_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_common *parent)
{
@@ -7182,10 +7990,13 @@ unsigned int callout_length = (*cc == OP_CALLOUT)
sljit_sw value1;
sljit_sw value2;
sljit_sw value3;
+sljit_uw callout_arg_size = (common->re->top_bracket + 1) * 2 * sizeof(sljit_sw);
PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL);
-allocate_stack(common, CALLOUT_ARG_SIZE / sizeof(sljit_sw));
+callout_arg_size = (sizeof(pcre2_callout_block) + callout_arg_size + sizeof(sljit_sw) - 1) / sizeof(sljit_sw);
+
+allocate_stack(common, callout_arg_size);
SLJIT_ASSERT(common->capture_last_ptr != 0);
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr);
@@ -7193,11 +8004,10 @@ OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
value1 = (*cc == OP_CALLOUT) ? cc[1 + 2 * LINK_SIZE] : 0;
OP1(SLJIT_MOV_U32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(callout_number), SLJIT_IMM, value1);
OP1(SLJIT_MOV_U32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_last), TMP2, 0);
+OP1(SLJIT_MOV_U32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_top), SLJIT_IMM, common->re->top_bracket + 1);
/* These pointer sized fields temporarly stores internal variables. */
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(offset_vector), STR_PTR, 0);
-OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(subject), TMP2, 0);
if (common->mark_ptr != 0)
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, mark_ptr));
@@ -7225,20 +8035,21 @@ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_pt
/* Needed to save important temporary registers. */
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STACK_TOP, 0);
-OP2(SLJIT_SUB, SLJIT_R1, 0, STACK_TOP, 0, SLJIT_IMM, CALLOUT_ARG_SIZE);
+/* SLJIT_R0 = arguments */
+OP1(SLJIT_MOV, SLJIT_R1, 0, STACK_TOP, 0);
GET_LOCAL_BASE(SLJIT_R2, 0, OVECTOR_START);
sljit_emit_ijump(compiler, SLJIT_CALL3, SLJIT_IMM, SLJIT_FUNC_OFFSET(do_callout));
OP1(SLJIT_MOV_S32, SLJIT_RETURN_REG, 0, SLJIT_RETURN_REG, 0);
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
-free_stack(common, CALLOUT_ARG_SIZE / sizeof(sljit_sw));
+free_stack(common, callout_arg_size);
/* Check return value. */
-OP2(SLJIT_SUB | SLJIT_SET_S, SLJIT_UNUSED, 0, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0);
+OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_SIG_GREATER, SLJIT_UNUSED, 0, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0);
add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_SIG_GREATER));
-if (common->forced_quit_label == NULL)
- add_jump(compiler, &common->forced_quit, JUMP(SLJIT_SIG_LESS));
+if (common->abort_label == NULL)
+ add_jump(compiler, &common->abort, JUMP(SLJIT_NOT_EQUAL) /* SIG_LESS */);
else
- JUMPTO(SLJIT_SIG_LESS, common->forced_quit_label);
+ JUMPTO(SLJIT_NOT_EQUAL /* SIG_LESS */, common->abort_label);
return cc + callout_length;
}
@@ -7280,6 +8091,7 @@ static PCRE2_SPTR compile_assert_matchingpath(compiler_common *common, PCRE2_SPT
DEFINE_COMPILER;
int framesize;
int extrasize;
+BOOL local_quit_available = FALSE;
BOOL needs_control_head;
int private_data_ptr;
backtrack_common altbacktrack;
@@ -7290,13 +8102,13 @@ jump_list *tmp = NULL;
jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.topbacktracks;
jump_list **found;
/* Saving previous accept variables. */
-BOOL save_local_exit = common->local_exit;
-BOOL save_positive_assert = common->positive_assert;
+BOOL save_local_quit_available = common->local_quit_available;
+BOOL save_in_positive_assertion = common->in_positive_assertion;
then_trap_backtrack *save_then_trap = common->then_trap;
struct sljit_label *save_quit_label = common->quit_label;
struct sljit_label *save_accept_label = common->accept_label;
jump_list *save_quit = common->quit;
-jump_list *save_positive_assert_quit = common->positive_assert_quit;
+jump_list *save_positive_assertion_quit = common->positive_assertion_quit;
jump_list *save_accept = common->accept;
struct sljit_jump *jump;
struct sljit_jump *brajump = NULL;
@@ -7363,7 +8175,7 @@ else
allocate_stack(common, framesize + extrasize);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
- OP2(SLJIT_SUB, TMP2, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + extrasize) * sizeof(sljit_sw));
+ OP2(SLJIT_ADD, TMP2, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + extrasize) * sizeof(sljit_sw));
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP2, 0);
if (needs_control_head)
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr);
@@ -7378,21 +8190,21 @@ else
else
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), TMP1, 0);
- init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize, FALSE);
+ init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize);
}
memset(&altbacktrack, 0, sizeof(backtrack_common));
-if (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT)
+if (conditional || (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT))
{
- /* Negative assert is stronger than positive assert. */
- common->local_exit = TRUE;
+ /* Control verbs cannot escape from these asserts. */
+ local_quit_available = TRUE;
+ common->local_quit_available = TRUE;
common->quit_label = NULL;
common->quit = NULL;
- common->positive_assert = FALSE;
}
-else
- common->positive_assert = TRUE;
-common->positive_assert_quit = NULL;
+
+common->in_positive_assertion = (opcode == OP_ASSERT || opcode == OP_ASSERTBACK);
+common->positive_assertion_quit = NULL;
while (1)
{
@@ -7408,16 +8220,16 @@ while (1)
compile_matchingpath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack);
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
{
- if (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT)
+ if (local_quit_available)
{
- common->local_exit = save_local_exit;
+ common->local_quit_available = save_local_quit_available;
common->quit_label = save_quit_label;
common->quit = save_quit;
}
- common->positive_assert = save_positive_assert;
+ common->in_positive_assertion = save_in_positive_assertion;
common->then_trap = save_then_trap;
common->accept_label = save_accept_label;
- common->positive_assert_quit = save_positive_assert_quit;
+ common->positive_assertion_quit = save_positive_assertion_quit;
common->accept = save_accept;
return NULL;
}
@@ -7434,23 +8246,24 @@ while (1)
free_stack(common, extrasize);
if (needs_control_head)
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), 0);
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1));
}
else
{
if ((opcode != OP_ASSERT_NOT && opcode != OP_ASSERTBACK_NOT) || conditional)
{
/* We don't need to keep the STR_PTR, only the previous private_data_ptr. */
- OP2(SLJIT_ADD, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + 1) * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + 1) * sizeof(sljit_sw));
if (needs_control_head)
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), 0);
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1));
}
else
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
if (needs_control_head)
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), (framesize + 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-framesize - 2));
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize - 1) * sizeof(sljit_sw));
}
}
@@ -7460,25 +8273,25 @@ while (1)
if (conditional)
{
if (extrasize > 0)
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), needs_control_head ? sizeof(sljit_sw) : 0);
+ OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), needs_control_head ? STACK(-2) : STACK(-1));
}
else if (bra == OP_BRAZERO)
{
if (framesize < 0)
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), (extrasize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(-extrasize));
else
{
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), framesize * sizeof(sljit_sw));
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), (framesize + extrasize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-framesize - 1));
+ OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(-framesize - extrasize));
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP1, 0);
}
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0);
}
else if (framesize >= 0)
{
/* For OP_BRA and OP_BRAMINZERO. */
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), framesize * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(-framesize - 1));
}
}
add_jump(compiler, found, JUMP(SLJIT_JUMP));
@@ -7486,16 +8299,16 @@ while (1)
compile_backtrackingpath(common, altbacktrack.top);
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
{
- if (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT)
+ if (local_quit_available)
{
- common->local_exit = save_local_exit;
+ common->local_quit_available = save_local_quit_available;
common->quit_label = save_quit_label;
common->quit = save_quit;
}
- common->positive_assert = save_positive_assert;
+ common->in_positive_assertion = save_in_positive_assertion;
common->then_trap = save_then_trap;
common->accept_label = save_accept_label;
- common->positive_assert_quit = save_positive_assert_quit;
+ common->positive_assertion_quit = save_positive_assertion_quit;
common->accept = save_accept;
return NULL;
}
@@ -7508,26 +8321,26 @@ while (1)
cc += GET(cc, 1);
}
-if (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT)
+if (local_quit_available)
{
- SLJIT_ASSERT(common->positive_assert_quit == NULL);
+ SLJIT_ASSERT(common->positive_assertion_quit == NULL);
/* Makes the check less complicated below. */
- common->positive_assert_quit = common->quit;
+ common->positive_assertion_quit = common->quit;
}
/* None of them matched. */
-if (common->positive_assert_quit != NULL)
+if (common->positive_assertion_quit != NULL)
{
jump = JUMP(SLJIT_JUMP);
- set_jumps(common->positive_assert_quit, LABEL());
+ set_jumps(common->positive_assertion_quit, LABEL());
SLJIT_ASSERT(framesize != no_stack);
if (framesize < 0)
- OP2(SLJIT_ADD, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, extrasize * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, extrasize * sizeof(sljit_sw));
else
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + extrasize) * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (extrasize + 1) * sizeof(sljit_sw));
}
JUMPHERE(jump);
}
@@ -7576,18 +8389,18 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK)
{
/* We know that STR_PTR was stored on the top of the stack. */
if (extrasize > 0)
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), (extrasize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(-extrasize));
/* Keep the STR_PTR on the top of the stack. */
if (bra == OP_BRAZERO)
{
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
if (extrasize == 2)
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);
}
else if (bra == OP_BRAMINZERO)
{
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0);
}
}
@@ -7596,13 +8409,13 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK)
if (bra == OP_BRA)
{
/* We don't need to keep the STR_PTR, only the previous private_data_ptr. */
- OP2(SLJIT_ADD, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + 1) * sizeof(sljit_sw));
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), (extrasize - 2) * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(-extrasize + 1));
}
else
{
/* We don't need to keep the STR_PTR, only the previous private_data_ptr. */
- OP2(SLJIT_ADD, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + 2) * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + 2) * sizeof(sljit_sw));
if (extrasize == 2)
{
OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
@@ -7630,7 +8443,9 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK)
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), framesize * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-2));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP1, 0);
}
set_jumps(backtrack->common.topbacktracks, LABEL());
}
@@ -7683,16 +8498,16 @@ else
}
}
-if (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT)
+if (local_quit_available)
{
- common->local_exit = save_local_exit;
+ common->local_quit_available = save_local_quit_available;
common->quit_label = save_quit_label;
common->quit = save_quit;
}
-common->positive_assert = save_positive_assert;
+common->in_positive_assertion = save_in_positive_assertion;
common->then_trap = save_then_trap;
common->accept_label = save_accept_label;
-common->positive_assert_quit = save_positive_assert_quit;
+common->positive_assertion_quit = save_positive_assertion_quit;
common->accept = save_accept;
return cc + 1 + LINK_SIZE;
}
@@ -7717,23 +8532,23 @@ if (framesize < 0)
}
if (needs_control_head)
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), (ket != OP_KET || has_alternatives) ? sizeof(sljit_sw) : 0);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), (ket != OP_KET || has_alternatives) ? STACK(-2) : STACK(-1));
/* TMP2 which is set here used by OP_KETRMAX below. */
if (ket == OP_KETRMAX)
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), 0);
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(-1));
else if (ket == OP_KETRMIN)
{
/* Move the STR_PTR to the private_data_ptr. */
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), 0);
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1));
}
}
else
{
stacksize = (ket != OP_KET || has_alternatives) ? 2 : 1;
- OP2(SLJIT_ADD, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + stacksize) * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, (framesize + stacksize) * sizeof(sljit_sw));
if (needs_control_head)
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), 0);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-1));
if (ket == OP_KETRMAX)
{
@@ -7820,7 +8635,6 @@ return stacksize;
(|) OP_*BRA | OP_ALT ... M A
(?()|) OP_*COND | OP_ALT M A
(?>|) OP_ONCE | OP_ALT ... [stack trace] M A
- (?>|) OP_ONCE_NC | OP_ALT ... [stack trace] M A
Or nothing, if trace is unnecessary
*/
@@ -7888,8 +8702,6 @@ if (SLJIT_UNLIKELY(opcode == OP_COND || opcode == OP_SCOND))
if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN))
opcode = OP_SCOND;
-if (SLJIT_UNLIKELY(opcode == OP_ONCE_NC))
- opcode = OP_ONCE;
if (opcode == OP_CBRA || opcode == OP_SCBRA)
{
@@ -7966,7 +8778,7 @@ if (bra == OP_BRAMINZERO)
{
/* Except when the whole stack frame must be saved. */
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
- braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), (BACKTRACK_AS(bracket_backtrack)->u.framesize + 1) * sizeof(sljit_sw));
+ braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), STACK(-BACKTRACK_AS(bracket_backtrack)->u.framesize - 2));
}
JUMPHERE(skip);
}
@@ -8039,7 +8851,7 @@ if (opcode == OP_ONCE)
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), STR_PTR, 0);
if (BACKTRACK_AS(bracket_backtrack)->u.framesize == no_frame)
- OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STACK_TOP, 0, SLJIT_IMM, needs_control_head ? (2 * sizeof(sljit_sw)) : sizeof(sljit_sw));
+ OP2(SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STACK_TOP, 0, SLJIT_IMM, needs_control_head ? (2 * sizeof(sljit_sw)) : sizeof(sljit_sw));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize + 1), TMP2, 0);
}
else if (ket == OP_KETRMAX || has_alternatives)
@@ -8057,7 +8869,7 @@ if (opcode == OP_ONCE)
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP2, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
- OP2(SLJIT_SUB, TMP2, 0, STACK_TOP, 0, SLJIT_IMM, stacksize * sizeof(sljit_sw));
+ OP2(SLJIT_ADD, TMP2, 0, STACK_TOP, 0, SLJIT_IMM, stacksize * sizeof(sljit_sw));
stacksize = needs_control_head ? 1 : 0;
if (ket != OP_KET || has_alternatives)
@@ -8072,7 +8884,7 @@ if (opcode == OP_ONCE)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP2, 0);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), TMP1, 0);
}
- init_frame(common, ccbegin, NULL, BACKTRACK_AS(bracket_backtrack)->u.framesize + stacksize, stacksize + 1, FALSE);
+ init_frame(common, ccbegin, NULL, BACKTRACK_AS(bracket_backtrack)->u.framesize + stacksize, stacksize + 1);
}
}
else if (opcode == OP_CBRA || opcode == OP_SCBRA)
@@ -8129,13 +8941,13 @@ if (opcode == OP_COND || opcode == OP_SCOND)
slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size;
OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(1));
- OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(GET2(slot, 0) << 1), TMP1, 0);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(GET2(slot, 0) << 1), TMP1, 0);
slot += common->name_entry_size;
i--;
while (i-- > 0)
{
OP2(SLJIT_SUB, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(GET2(slot, 0) << 1), TMP1, 0);
- OP2(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, STR_PTR, 0);
+ OP2(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, TMP2, 0, STR_PTR, 0);
slot += common->name_entry_size;
}
OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);
@@ -8288,7 +9100,7 @@ if (ket == OP_KETRMAX)
{
if (has_alternatives)
BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = LABEL();
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, rmax_label);
/* Drop STR_PTR for greedy plus quantifier. */
if (opcode != OP_ONCE)
@@ -8318,7 +9130,7 @@ if (ket == OP_KETRMAX)
if (repeat_type == OP_EXACT)
{
count_match(common);
- OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_MEM1(SLJIT_SP), repeat_ptr, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, rmax_label);
}
else if (repeat_type == OP_UPTO)
@@ -8346,6 +9158,7 @@ if (bra == OP_BRAMINZERO)
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (BACKTRACK_AS(bracket_backtrack)->u.framesize - 1) * sizeof(sljit_sw));
}
else if (ket == OP_KETRMIN && opcode != OP_ONCE)
free_stack(common, 1);
@@ -8418,7 +9231,7 @@ switch(opcode)
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
@@ -8496,7 +9309,7 @@ else
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
if (needs_control_head)
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr);
- OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STACK_TOP, 0, SLJIT_IMM, -STACK(stacksize - 1));
+ OP2(SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STACK_TOP, 0, SLJIT_IMM, stacksize * sizeof(sljit_sw));
stack = 0;
if (!zero)
@@ -8515,7 +9328,7 @@ else
stack++;
}
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stack), TMP1, 0);
- init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize, FALSE);
+ init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize);
stack -= 1 + (offset == 0);
}
@@ -8568,7 +9381,7 @@ while (*cc != OP_KETRPOS)
{
if (offset != 0)
{
- OP2(SLJIT_ADD, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, stacksize * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_IMM, stacksize * sizeof(sljit_sw));
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), cbraprivptr);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1), STR_PTR, 0);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), cbraprivptr, STR_PTR, 0);
@@ -8579,10 +9392,10 @@ while (*cc != OP_KETRPOS)
else
{
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
- OP2(SLJIT_ADD, STACK_TOP, 0, TMP2, 0, SLJIT_IMM, stacksize * sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, TMP2, 0, SLJIT_IMM, stacksize * sizeof(sljit_sw));
if (opcode == OP_SBRAPOS)
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), (framesize + 1) * sizeof(sljit_sw));
- OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), (framesize + 1) * sizeof(sljit_sw), STR_PTR, 0);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), STACK(-framesize - 2));
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), STACK(-framesize - 2), STR_PTR, 0);
}
/* Even if the match is empty, we need to reset the control head. */
@@ -8628,7 +9441,7 @@ while (*cc != OP_KETRPOS)
else
{
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
- OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(TMP2), (framesize + 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(TMP2), STACK(-framesize - 2));
}
}
@@ -8645,7 +9458,7 @@ if (!zero)
if (framesize < 0)
add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(stacksize - 1), SLJIT_IMM, 0));
else /* TMP2 is set to [private_data_ptr] above. */
- add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(TMP2), (stacksize - 1) * sizeof(sljit_sw), SLJIT_IMM, 0));
+ add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(TMP2), STACK(-stacksize), SLJIT_IMM, 0));
}
/* None of them matched. */
@@ -8868,7 +9681,7 @@ if (exact > 1)
OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact);
label = LABEL();
compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE);
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
}
else
@@ -8876,7 +9689,7 @@ if (exact > 1)
OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact);
label = LABEL();
compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE);
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
}
}
@@ -8906,7 +9719,7 @@ switch(opcode)
if (opcode == OP_UPTO)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0);
- OP2(SLJIT_SUB | SLJIT_SET_E, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
jump = JUMP(SLJIT_ZERO);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, TMP1, 0);
}
@@ -8968,7 +9781,7 @@ switch(opcode)
label = LABEL();
if (opcode == OP_UPTO)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_ZERO));
}
compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE);
@@ -8988,7 +9801,7 @@ switch(opcode)
OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
if (opcode == OP_UPTO)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
}
@@ -9015,7 +9828,7 @@ switch(opcode)
if (opcode == OP_UPTO)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
}
else
@@ -9044,7 +9857,7 @@ switch(opcode)
if (opcode == OP_UPTO)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
}
else
@@ -9070,7 +9883,7 @@ switch(opcode)
compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE);
if (opcode == OP_UPTO)
{
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
}
@@ -9157,7 +9970,7 @@ switch(opcode)
label = LABEL();
compile_char1_matchingpath(common, type, cc, &no_match, TRUE);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0);
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
set_jumps(no_match, LABEL());
OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1);
@@ -9168,7 +9981,7 @@ switch(opcode)
label = LABEL();
detect_partial_match(common, &no_match);
compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE);
- OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
JUMPTO(SLJIT_NOT_ZERO, label);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
set_jumps(no_char1_match, LABEL());
@@ -9186,7 +9999,7 @@ switch(opcode)
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
@@ -9207,6 +10020,9 @@ if (*cc == OP_FAIL)
return cc + 1;
}
+if (*cc == OP_ACCEPT && common->currententry == NULL && (common->re->overall_options & PCRE2_ENDANCHORED) != 0)
+ add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0));
+
if (*cc == OP_ASSERT_ACCEPT || common->currententry != NULL || !common->might_be_empty)
{
/* No need to check notempty conditions. */
@@ -9223,9 +10039,9 @@ else
CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label);
OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
OP1(SLJIT_MOV_U32, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options));
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY);
add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_NOT_ZERO));
-OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY_ATSTART);
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY_ATSTART);
if (common->accept_label == NULL)
add_jump(compiler, &common->accept, JUMP(SLJIT_ZERO));
else
@@ -9309,7 +10125,7 @@ size = 3 + (size < 0 ? 0 : size);
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr);
allocate_stack(common, size);
if (size > 3)
- OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0, SLJIT_IMM, (size - 3) * sizeof(sljit_sw));
+ OP2(SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0, SLJIT_IMM, (size - 3) * sizeof(sljit_sw));
else
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0);
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(size - 1), SLJIT_IMM, BACKTRACK_AS(then_trap_backtrack)->start);
@@ -9318,7 +10134,7 @@ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(size - 3), TMP2, 0);
size = BACKTRACK_AS(then_trap_backtrack)->framesize;
if (size >= 0)
- init_frame(common, cc, ccend, size - 1, 0, FALSE);
+ init_frame(common, cc, ccend, size - 1, 0);
}
static void compile_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, backtrack_common *parent)
@@ -9540,7 +10356,6 @@ while (cc < ccend)
break;
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRA:
case OP_CBRA:
case OP_COND:
@@ -9615,7 +10430,7 @@ while (cc < ccend)
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return;
}
if (cc == NULL)
@@ -9723,7 +10538,7 @@ switch(opcode)
case OP_MINUPTO:
OP1(SLJIT_MOV, TMP1, 0, base, offset1);
OP1(SLJIT_MOV, STR_PTR, 0, base, offset0);
- OP2(SLJIT_SUB | SLJIT_SET_E, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
+ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
add_jump(compiler, &jumplist, JUMP(SLJIT_ZERO));
OP1(SLJIT_MOV, base, offset1, TMP1, 0);
@@ -9769,7 +10584,7 @@ switch(opcode)
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
@@ -9804,27 +10619,21 @@ free_stack(common, ref ? 2 : 3);
static SLJIT_INLINE void compile_recurse_backtrackingpath(compiler_common *common, struct backtrack_common *current)
{
DEFINE_COMPILER;
+recurse_entry *entry;
-if (CURRENT_AS(recurse_backtrack)->inlined_pattern)
- compile_backtrackingpath(common, current->top);
-set_jumps(current->topbacktracks, LABEL());
-if (CURRENT_AS(recurse_backtrack)->inlined_pattern)
- return;
-
-if (common->has_set_som && common->mark_ptr != 0)
+if (!CURRENT_AS(recurse_backtrack)->inlined_pattern)
{
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
- free_stack(common, 2);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), TMP2, 0);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP1, 0);
- }
-else if (common->has_set_som || common->mark_ptr != 0)
- {
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
- free_stack(common, 1);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->has_set_som ? (int)(OVECTOR(0)) : common->mark_ptr, TMP2, 0);
+ entry = CURRENT_AS(recurse_backtrack)->entry;
+ if (entry->backtrack_label == NULL)
+ add_jump(compiler, &entry->backtrack_calls, JUMP(SLJIT_FAST_CALL));
+ else
+ JUMPTO(SLJIT_FAST_CALL, entry->backtrack_label);
+ CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, CURRENT_AS(recurse_backtrack)->matchingpath);
}
+else
+ compile_backtrackingpath(common, current->top);
+
+set_jumps(current->topbacktracks, LABEL());
}
static void compile_assert_backtrackingpath(compiler_common *common, struct backtrack_common *current)
@@ -9877,7 +10686,9 @@ if (*cc == OP_ASSERT || *cc == OP_ASSERTBACK)
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), CURRENT_AS(assert_backtrack)->private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), CURRENT_AS(assert_backtrack)->private_data_ptr, SLJIT_MEM1(STACK_TOP), CURRENT_AS(assert_backtrack)->framesize * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-2));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (CURRENT_AS(assert_backtrack)->framesize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), CURRENT_AS(assert_backtrack)->private_data_ptr, TMP1, 0);
set_jumps(current->topbacktracks, LABEL());
}
@@ -9887,7 +10698,7 @@ else
if (bra == OP_BRAZERO)
{
/* We know there is enough place on the stack. */
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
+ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw));
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0);
JUMPTO(SLJIT_JUMP, CURRENT_AS(assert_backtrack)->matchingpath);
JUMPHERE(brajump);
@@ -9947,8 +10758,6 @@ if (opcode == OP_CBRA || opcode == OP_SCBRA)
offset = (GET2(ccbegin, 1 + LINK_SIZE)) << 1;
if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN))
opcode = OP_SCOND;
-if (SLJIT_UNLIKELY(opcode == OP_ONCE_NC))
- opcode = OP_ONCE;
alt_max = has_alternatives ? no_alternatives(ccbegin) : 0;
@@ -10000,7 +10809,7 @@ else if (ket == OP_KETRMIN)
else
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
- CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), (CURRENT_AS(bracket_backtrack)->u.framesize + 1) * sizeof(sljit_sw), CURRENT_AS(bracket_backtrack)->recursive_matchingpath);
+ CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), STACK(-CURRENT_AS(bracket_backtrack)->u.framesize - 2), CURRENT_AS(bracket_backtrack)->recursive_matchingpath);
}
/* Drop STR_PTR for non-greedy plus quantifier. */
if (opcode != OP_ONCE)
@@ -10054,6 +10863,7 @@ if (SLJIT_UNLIKELY(opcode == OP_ONCE))
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (CURRENT_AS(bracket_backtrack)->u.framesize - 1) * sizeof(sljit_sw));
}
once = JUMP(SLJIT_JUMP);
}
@@ -10106,7 +10916,9 @@ if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND))
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr, SLJIT_MEM1(STACK_TOP), assert->framesize * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-2));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (assert->framesize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr, TMP1, 0);
}
cond = JUMP(SLJIT_JUMP);
set_jumps(CURRENT_AS(bracket_backtrack)->u.assert->condfailed, LABEL());
@@ -10247,7 +11059,9 @@ if (has_alternatives)
{
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr, SLJIT_MEM1(STACK_TOP), assert->framesize * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-2));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (assert->framesize - 1) * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr, TMP1, 0);
}
JUMPHERE(cond);
}
@@ -10302,7 +11116,7 @@ else if (opcode == OP_ONCE)
JUMPHERE(once);
/* Restore previous private_data_ptr */
if (CURRENT_AS(bracket_backtrack)->u.framesize >= 0)
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), CURRENT_AS(bracket_backtrack)->u.framesize * sizeof(sljit_sw));
+ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(-CURRENT_AS(bracket_backtrack)->u.framesize - 1));
else if (ket == OP_KETRMIN)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
@@ -10383,6 +11197,7 @@ if (CURRENT_AS(bracketpos_backtrack)->framesize < 0)
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), CURRENT_AS(bracketpos_backtrack)->private_data_ptr);
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
+OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (CURRENT_AS(bracketpos_backtrack)->framesize - 1) * sizeof(sljit_sw));
if (current->topbacktracks)
{
@@ -10392,7 +11207,7 @@ if (current->topbacktracks)
free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize);
JUMPHERE(jump);
}
-OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), CURRENT_AS(bracketpos_backtrack)->private_data_ptr, SLJIT_MEM1(STACK_TOP), CURRENT_AS(bracketpos_backtrack)->framesize * sizeof(sljit_sw));
+OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), CURRENT_AS(bracketpos_backtrack)->private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(-CURRENT_AS(bracketpos_backtrack)->framesize - 1));
}
static SLJIT_INLINE void compile_braminzero_backtrackingpath(compiler_common *common, struct backtrack_common *current)
@@ -10438,22 +11253,23 @@ if (opcode == OP_THEN || opcode == OP_THEN_ARG)
jump = JUMP(SLJIT_JUMP);
loop = LABEL();
- OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(STACK_TOP), -(int)sizeof(sljit_sw));
+ OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
JUMPHERE(jump);
- CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), -(int)(2 * sizeof(sljit_sw)), TMP1, 0, loop);
- CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), -(int)(3 * sizeof(sljit_sw)), TMP2, 0, loop);
+ CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(1), TMP1, 0, loop);
+ CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(2), TMP2, 0, loop);
add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP));
return;
}
- else if (common->positive_assert)
+ else if (!common->local_quit_available && common->in_positive_assertion)
{
- add_jump(compiler, &common->positive_assert_quit, JUMP(SLJIT_JUMP));
+ add_jump(compiler, &common->positive_assertion_quit, JUMP(SLJIT_JUMP));
return;
}
}
-if (common->local_exit)
+if (common->local_quit_available)
{
+ /* Abort match with a fail. */
if (common->quit_label == NULL)
add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP));
else
@@ -10504,7 +11320,10 @@ jump = JUMP(SLJIT_JUMP);
set_jumps(CURRENT_AS(then_trap_backtrack)->quit, LABEL());
/* STACK_TOP is set by THEN. */
if (CURRENT_AS(then_trap_backtrack)->framesize >= 0)
+ {
add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
+ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (CURRENT_AS(then_trap_backtrack)->framesize - 1) * sizeof(sljit_sw));
+ }
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
free_stack(common, 3);
@@ -10621,7 +11440,6 @@ while (current)
break;
case OP_ONCE:
- case OP_ONCE_NC:
case OP_BRA:
case OP_CBRA:
case OP_COND:
@@ -10670,7 +11488,7 @@ while (current)
break;
case OP_COMMIT:
- if (!common->local_exit)
+ if (!common->local_quit_available)
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
if (common->quit_label == NULL)
add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP));
@@ -10692,7 +11510,7 @@ while (current)
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
current = current->prev;
@@ -10707,38 +11525,52 @@ PCRE2_SPTR cc = common->start + common->currententry->start;
PCRE2_SPTR ccbegin = cc + 1 + LINK_SIZE + (*cc == OP_BRA ? 0 : IMM2_SIZE);
PCRE2_SPTR ccend = bracketend(cc) - (1 + LINK_SIZE);
BOOL needs_control_head;
-int framesize = get_framesize(common, cc, NULL, TRUE, &needs_control_head);
-int private_data_size = get_private_data_copy_length(common, ccbegin, ccend, needs_control_head);
-int alternativesize;
-BOOL needs_frame;
+BOOL has_quit;
+BOOL has_accept;
+int private_data_size = get_recurse_data_length(common, ccbegin, ccend, &needs_control_head, &has_quit, &has_accept);
+int alt_count, alt_max, local_size;
backtrack_common altbacktrack;
-struct sljit_jump *jump;
+jump_list *match = NULL;
+sljit_uw *next_update_addr = NULL;
+struct sljit_jump *alt1 = NULL;
+struct sljit_jump *alt2 = NULL;
+struct sljit_jump *accept_exit = NULL;
+struct sljit_label *quit;
/* Recurse captures then. */
common->then_trap = NULL;
SLJIT_ASSERT(*cc == OP_BRA || *cc == OP_CBRA || *cc == OP_CBRAPOS || *cc == OP_SCBRA || *cc == OP_SCBRAPOS);
-needs_frame = framesize >= 0;
-if (!needs_frame)
- framesize = 0;
-alternativesize = *(cc + GET(cc, 1)) == OP_ALT ? 1 : 0;
-SLJIT_ASSERT(common->currententry->entry == NULL && common->recursive_head_ptr != 0);
-common->currententry->entry = LABEL();
-set_jumps(common->currententry->calls, common->currententry->entry);
+alt_max = no_alternatives(cc);
+alt_count = 0;
+
+/* Matching path. */
+SLJIT_ASSERT(common->currententry->entry_label == NULL && common->recursive_head_ptr != 0);
+common->currententry->entry_label = LABEL();
+set_jumps(common->currententry->entry_calls, common->currententry->entry_label);
sljit_emit_fast_enter(compiler, TMP2, 0);
count_match(common);
-allocate_stack(common, private_data_size + framesize + alternativesize);
-OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(private_data_size + framesize + alternativesize - 1), TMP2, 0);
-copy_private_data(common, ccbegin, ccend, TRUE, private_data_size + framesize + alternativesize, framesize + alternativesize, needs_control_head);
+
+local_size = (alt_max > 1) ? 2 : 1;
+
+/* (Reversed) stack layout:
+ [private data][return address][optional: str ptr] ... [optional: alternative index][recursive_head_ptr] */
+
+allocate_stack(common, private_data_size + local_size);
+/* Save return address. */
+OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(local_size - 1), TMP2, 0);
+
+copy_recurse_data(common, ccbegin, ccend, recurse_copy_from_global, local_size, private_data_size + local_size, has_quit);
+
+/* This variable is saved and restored all time when we enter or exit from a recursive context. */
+OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, STACK_TOP, 0);
+
if (needs_control_head)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0);
-OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, STACK_TOP, 0);
-if (needs_frame)
- init_frame(common, cc, NULL, framesize + alternativesize - 1, alternativesize, TRUE);
-if (alternativesize > 0)
+if (alt_max > 1)
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);
memset(&altbacktrack, 0, sizeof(backtrack_common));
@@ -10760,7 +11592,75 @@ while (1)
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
return;
- add_jump(compiler, &common->accept, JUMP(SLJIT_JUMP));
+ allocate_stack(common, (alt_max > 1 || has_accept) ? 2 : 1);
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr);
+
+ if (alt_max > 1 || has_accept)
+ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_count);
+
+ add_jump(compiler, &match, JUMP(SLJIT_JUMP));
+
+ if (alt_count == 0)
+ {
+ /* Backtracking path entry. */
+ SLJIT_ASSERT(common->currententry->backtrack_label == NULL);
+ common->currententry->backtrack_label = LABEL();
+ set_jumps(common->currententry->backtrack_calls, common->currententry->backtrack_label);
+
+ sljit_emit_fast_enter(compiler, TMP1, 0);
+
+ if (has_accept)
+ accept_exit = CMP(SLJIT_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_max * sizeof (sljit_sw));
+
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
+ /* Save return address. */
+ OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), STACK(local_size - 1), TMP1, 0);
+
+ copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + local_size, has_quit);
+
+ if (alt_max > 1)
+ {
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
+ free_stack(common, 2);
+
+ if (alt_max > 4)
+ {
+ /* Table jump if alt_max is greater than 4. */
+ next_update_addr = allocate_read_only_data(common, alt_max * sizeof(sljit_uw));
+ if (SLJIT_UNLIKELY(next_update_addr == NULL))
+ return;
+ sljit_emit_ijump(compiler, SLJIT_JUMP, SLJIT_MEM1(TMP1), (sljit_sw)next_update_addr);
+ add_label_addr(common, next_update_addr++);
+ }
+ else
+ {
+ if (alt_max == 4)
+ alt2 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_uw));
+ alt1 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, sizeof(sljit_uw));
+ }
+ }
+ else
+ free_stack(common, has_accept ? 2 : 1);
+ }
+ else if (alt_max > 4)
+ add_label_addr(common, next_update_addr++);
+ else
+ {
+ if (alt_count != 2 * sizeof(sljit_uw))
+ {
+ JUMPHERE(alt1);
+ if (alt_max == 3 && alt_count == sizeof(sljit_uw))
+ alt2 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_uw));
+ }
+ else
+ {
+ JUMPHERE(alt2);
+ if (alt_max == 4)
+ alt1 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 3 * sizeof(sljit_uw));
+ }
+ }
+
+ alt_count += sizeof(sljit_uw);
compile_backtrackingpath(common, altbacktrack.top);
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
@@ -10774,55 +11674,65 @@ while (1)
cc += GET(cc, 1);
}
-/* None of them matched. */
-OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0);
-jump = JUMP(SLJIT_JUMP);
+/* No alternative is matched. */
+
+quit = LABEL();
+
+copy_recurse_data(common, ccbegin, ccend, recurse_copy_private_to_global, local_size, private_data_size + local_size, has_quit);
+
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(local_size - 1));
+free_stack(common, private_data_size + local_size);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+sljit_emit_fast_return(compiler, TMP2, 0);
if (common->quit != NULL)
{
+ SLJIT_ASSERT(has_quit);
+
set_jumps(common->quit, LABEL());
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr);
- if (needs_frame)
- {
- OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + alternativesize) * sizeof(sljit_sw));
- add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + alternativesize) * sizeof(sljit_sw));
- }
- OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0);
- common->quit = NULL;
- add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP));
+ copy_recurse_data(common, ccbegin, ccend, recurse_copy_shared_to_global, local_size, private_data_size + local_size, has_quit);
+ JUMPTO(SLJIT_JUMP, quit);
}
-set_jumps(common->accept, LABEL());
-OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr);
-if (needs_frame)
+if (has_accept)
{
- OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + alternativesize) * sizeof(sljit_sw));
- add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
- OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + alternativesize) * sizeof(sljit_sw));
- }
-OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 1);
+ JUMPHERE(accept_exit);
+ free_stack(common, 2);
-JUMPHERE(jump);
-if (common->quit != NULL)
- set_jumps(common->quit, LABEL());
-copy_private_data(common, ccbegin, ccend, FALSE, private_data_size + framesize + alternativesize, framesize + alternativesize, needs_control_head);
-free_stack(common, private_data_size + framesize + alternativesize);
-if (needs_control_head)
- {
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), 2 * sizeof(sljit_sw));
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), sizeof(sljit_sw));
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, TMP1, 0);
- OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP2, 0);
+ /* Save return address. */
+ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(local_size - 1), TMP1, 0);
+
+ copy_recurse_data(common, ccbegin, ccend, recurse_copy_kept_shared_to_global, local_size, private_data_size + local_size, has_quit);
+
+ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(local_size - 1));
+ free_stack(common, private_data_size + local_size);
+ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+ sljit_emit_fast_return(compiler, TMP2, 0);
}
-else
+
+if (common->accept != NULL)
{
- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), sizeof(sljit_sw));
- OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, TMP2, 0);
+ SLJIT_ASSERT(has_accept);
+
+ set_jumps(common->accept, LABEL());
+
+ OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr);
+ OP1(SLJIT_MOV, TMP2, 0, STACK_TOP, 0);
+
+ allocate_stack(common, 2);
+ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_count);
}
-sljit_emit_fast_return(compiler, SLJIT_MEM1(STACK_TOP), 0);
+
+set_jumps(match, LABEL());
+
+OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP2, 0);
+
+copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + local_size, has_quit);
+
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP2), STACK(local_size - 1));
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1);
+sljit_emit_fast_return(compiler, TMP2, 0);
}
#undef COMPILE_BACKTRACKINGPATH
@@ -10854,11 +11764,13 @@ struct sljit_jump *jump;
struct sljit_jump *minlength_check_failed = NULL;
struct sljit_jump *reqbyte_notfound = NULL;
struct sljit_jump *empty_match = NULL;
+struct sljit_jump *end_anchor_failed = NULL;
SLJIT_ASSERT(tables);
memset(&rootbacktrack, 0, sizeof(backtrack_common));
memset(common, 0, sizeof(compiler_common));
+common->re = re;
common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code));
rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size;
@@ -11076,7 +11988,7 @@ if (common->control_head_ptr != 0)
/* Main part of the matching */
if ((re->overall_options & PCRE2_ANCHORED) == 0)
{
- mainloop_label = mainloop_entry(common, (re->flags & PCRE2_HASCRORLF) != 0, re->overall_options);
+ mainloop_label = mainloop_entry(common);
continue_match_label = LABEL();
/* Forward search if possible. */
if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
@@ -11084,11 +11996,11 @@ if ((re->overall_options & PCRE2_ANCHORED) == 0)
if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common))
;
else if ((re->flags & PCRE2_FIRSTSET) != 0)
- fast_forward_first_char(common, (PCRE2_UCHAR)(re->first_codeunit), (re->flags & PCRE2_FIRSTCASELESS) != 0);
+ fast_forward_first_char(common);
else if ((re->flags & PCRE2_STARTLINE) != 0)
fast_forward_newline(common);
else if ((re->flags & PCRE2_FIRSTMAPSET) != 0)
- fast_forward_start_bits(common, re->start_bitmap);
+ fast_forward_start_bits(common);
}
}
else
@@ -11135,6 +12047,9 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
return PCRE2_ERROR_NOMEMORY;
}
+if ((re->overall_options & PCRE2_ENDANCHORED) != 0)
+ end_anchor_failed = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0);
+
if (common->might_be_empty)
{
empty_match = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0));
@@ -11147,15 +12062,26 @@ if (common->accept != NULL)
/* This means we have a match. Update the ovector. */
copy_ovector(common, re->top_bracket + 1);
-common->quit_label = common->forced_quit_label = LABEL();
+common->quit_label = common->abort_label = LABEL();
if (common->quit != NULL)
set_jumps(common->quit, common->quit_label);
-if (common->forced_quit != NULL)
- set_jumps(common->forced_quit, common->forced_quit_label);
+if (common->abort != NULL)
+ set_jumps(common->abort, common->abort_label);
if (minlength_check_failed != NULL)
- SET_LABEL(minlength_check_failed, common->forced_quit_label);
+ SET_LABEL(minlength_check_failed, common->abort_label);
sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);
+if (common->failed_match != NULL)
+ {
+ SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
+ set_jumps(common->failed_match, LABEL());
+ OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
+ JUMPTO(SLJIT_JUMP, common->abort_label);
+ }
+
+if ((re->overall_options & PCRE2_ENDANCHORED) != 0)
+ JUMPHERE(end_anchor_failed);
+
if (mode != PCRE2_JIT_COMPLETE)
{
common->partialmatchlabel = LABEL();
@@ -11236,9 +12162,9 @@ if (common->might_be_empty)
JUMPHERE(empty_match);
OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
OP1(SLJIT_MOV_U32, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options));
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY);
JUMPTO(SLJIT_NOT_ZERO, empty_match_backtrack_label);
- OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY_ATSTART);
+ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY_ATSTART);
JUMPTO(SLJIT_ZERO, empty_match_found_label);
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, empty_match_found_label);
@@ -11249,7 +12175,7 @@ common->fast_forward_bc_ptr = NULL;
common->fast_fail_start_ptr = 0;
common->fast_fail_end_ptr = 0;
common->currententry = common->entries;
-common->local_exit = TRUE;
+common->local_quit_available = TRUE;
quit_label = common->quit_label;
while (common->currententry != NULL)
{
@@ -11266,7 +12192,7 @@ while (common->currententry != NULL)
flush_stubs(common);
common->currententry = common->currententry->next;
}
-common->local_exit = FALSE;
+common->local_quit_available = FALSE;
common->quit_label = quit_label;
/* Allocating stack, returns with PCRE_ERROR_JIT_STACKLIMIT if fails. */
@@ -11278,7 +12204,7 @@ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP2, 0);
OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, stack));
OP1(SLJIT_MOV, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(struct sljit_stack, top), STACK_TOP, 0);
-OP2(SLJIT_ADD, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(struct sljit_stack, limit), SLJIT_IMM, STACK_GROWTH_RATE);
+OP2(SLJIT_SUB, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(struct sljit_stack, limit), SLJIT_IMM, STACK_GROWTH_RATE);
sljit_emit_ijump(compiler, SLJIT_CALL2, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_stack_resize));
jump = CMP(SLJIT_NOT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0);
diff --git a/src/3rdparty/pcre2/src/pcre2_jit_match.c b/src/3rdparty/pcre2/src/pcre2_jit_match.c
index a323971ff3..4cad754c75 100644
--- a/src/3rdparty/pcre2/src/pcre2_jit_match.c
+++ b/src/3rdparty/pcre2/src/pcre2_jit_match.c
@@ -49,10 +49,10 @@ static SLJIT_NOINLINE int jit_machine_stack_exec(jit_arguments *arguments, jit_f
sljit_u8 local_space[MACHINE_STACK_SIZE];
struct sljit_stack local_stack;
-local_stack.top = (sljit_sw)&local_space;
-local_stack.base = local_stack.top;
-local_stack.limit = local_stack.base + MACHINE_STACK_SIZE;
-local_stack.max_limit = local_stack.limit;
+local_stack.max_limit = local_space;
+local_stack.limit = local_space;
+local_stack.base = local_space + MACHINE_STACK_SIZE;
+local_stack.top = local_space + MACHINE_STACK_SIZE;
arguments->stack = &local_stack;
return executable_func(arguments);
}
diff --git a/src/3rdparty/pcre2/src/pcre2_match.c b/src/3rdparty/pcre2/src/pcre2_match.c
index 0763a239e1..050b7e93ec 100644
--- a/src/3rdparty/pcre2/src/pcre2_match.c
+++ b/src/3rdparty/pcre2/src/pcre2_match.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2015-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -43,17 +43,31 @@ POSSIBILITY OF SUCH DAMAGE.
#include "config.h"
#endif
-#define NLBLOCK mb /* Block containing newline information */
-#define PSSTART start_subject /* Field containing processed string start */
-#define PSEND end_subject /* Field containing processed string end */
+/* These defines enables debugging code */
+
+//#define DEBUG_FRAMES_DISPLAY
+//#define DEBUG_SHOW_OPS
+//#define DEBUG_SHOW_RMATCH
+
+#ifdef DEBUG_FRAME_DISPLAY
+#include <stdarg.h>
+#endif
+
+/* These defines identify the name of the block containing "static"
+information, and fields within it. */
+
+#define NLBLOCK mb /* Block containing newline information */
+#define PSSTART start_subject /* Field containing processed string start */
+#define PSEND end_subject /* Field containing processed string end */
#include "pcre2_internal.h"
-/* Masks for identifying the public options that are permitted at match time.
-*/
+#define RECURSE_UNSET 0xffffffffu /* Bigger than max group number */
+
+/* Masks for identifying the public options that are permitted at match time. */
#define PUBLIC_MATCH_OPTIONS \
- (PCRE2_ANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
+ (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT)
@@ -61,60 +75,252 @@ POSSIBILITY OF SUCH DAMAGE.
(PCRE2_NO_UTF_CHECK|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY|\
PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD)
-/* The mb->capture_last field uses the lower 16 bits for the last captured
-substring (which can never be greater than 65535) and a bit in the top half
-to mean "capture vector overflowed". This odd way of doing things was
-implemented when it was realized that preserving and restoring the overflow bit
-whenever the last capture number was saved/restored made for a neater
-interface, and doing it this way saved on (a) another variable, which would
-have increased the stack frame size (a big NO-NO in PCRE) and (b) another
-separate set of save/restore instructions. The following defines are used in
-implementing this. */
-
-#define CAPLMASK 0x0000ffff /* The bits used for last_capture */
-#define OVFLMASK 0xffff0000 /* The bits used for the overflow flag */
-#define OVFLBIT 0x00010000 /* The bit that is set for overflow */
-
-/* Bits for setting in mb->match_function_type to indicate two special types
-of call to match(). We do it this way to save on using another stack variable,
-as stack usage is to be discouraged. */
-
-#define MATCH_CONDASSERT 1 /* Called to check a condition assertion */
-#define MATCH_CBEGROUP 2 /* Could-be-empty unlimited repeat group */
-
-/* Non-error returns from the match() function. Error returns are externally
-defined PCRE2_ERROR_xxx codes, which are all negative. */
+/* Non-error returns from and within the match() function. Error returns are
+externally defined PCRE2_ERROR_xxx codes, which are all negative. */
#define MATCH_MATCH 1
#define MATCH_NOMATCH 0
-/* Special internal returns from the match() function. Make them sufficiently
-negative to avoid the external error codes. */
+/* Special internal returns used in the match() function. Make them
+sufficiently negative to avoid the external error codes. */
#define MATCH_ACCEPT (-999)
#define MATCH_KETRPOS (-998)
-#define MATCH_ONCE (-997)
/* The next 5 must be kept together and in sequence so that a test that checks
for any one of them can use a range. */
-#define MATCH_COMMIT (-996)
-#define MATCH_PRUNE (-995)
-#define MATCH_SKIP (-994)
-#define MATCH_SKIP_ARG (-993)
-#define MATCH_THEN (-992)
+#define MATCH_COMMIT (-997)
+#define MATCH_PRUNE (-996)
+#define MATCH_SKIP (-995)
+#define MATCH_SKIP_ARG (-994)
+#define MATCH_THEN (-993)
#define MATCH_BACKTRACK_MAX MATCH_THEN
#define MATCH_BACKTRACK_MIN MATCH_COMMIT
-/* Min and max values for the common repeats; for the maxima, 0 => infinity */
+/* Group frame type values. Zero means the frame is not a group frame. The
+lower 16 bits are used for data (e.g. the capture number). Group frames are
+used for most groups so that information about the start is easily available at
+the end without having to scan back through intermediate frames (backtrack
+points). */
+
+#define GF_CAPTURE 0x00010000u
+#define GF_NOCAPTURE 0x00020000u
+#define GF_CONDASSERT 0x00030000u
+#define GF_RECURSE 0x00040000u
-static const char rep_min[] = { 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, };
-static const char rep_max[] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, };
+/* Masks for the identity and data parts of the group frame type. */
-/* Maximum number of ovector elements that can be saved on the system stack
-when processing OP_RECURSE in non-HEAP_MATCH_RECURSE mode. If the ovector is
-bigger, malloc() is used. This value should be a multiple of 3, because the
-ovector length is always a multiple of 3. */
+#define GF_IDMASK(a) ((a) & 0xffff0000u)
+#define GF_DATAMASK(a) ((a) & 0x0000ffffu)
-#define OP_RECURSE_STACK_SAVE_MAX 45
+/* Repetition types */
+
+enum { REPTYPE_MIN, REPTYPE_MAX, REPTYPE_POS };
+
+/* Min and max values for the common repeats; a maximum of UINT32_MAX =>
+infinity. */
+
+static const uint32_t rep_min[] = {
+ 0, 0, /* * and *? */
+ 1, 1, /* + and +? */
+ 0, 0, /* ? and ?? */
+ 0, 0, /* dummy placefillers for OP_CR[MIN]RANGE */
+ 0, 1, 0 }; /* OP_CRPOS{STAR, PLUS, QUERY} */
+
+static const uint32_t rep_max[] = {
+ UINT32_MAX, UINT32_MAX, /* * and *? */
+ UINT32_MAX, UINT32_MAX, /* + and +? */
+ 1, 1, /* ? and ?? */
+ 0, 0, /* dummy placefillers for OP_CR[MIN]RANGE */
+ UINT32_MAX, UINT32_MAX, 1 }; /* OP_CRPOS{STAR, PLUS, QUERY} */
+
+/* Repetition types - must include OP_CRPOSRANGE (not needed above) */
+
+static const uint32_t rep_typ[] = {
+ REPTYPE_MAX, REPTYPE_MIN, /* * and *? */
+ REPTYPE_MAX, REPTYPE_MIN, /* + and +? */
+ REPTYPE_MAX, REPTYPE_MIN, /* ? and ?? */
+ REPTYPE_MAX, REPTYPE_MIN, /* OP_CRRANGE and OP_CRMINRANGE */
+ REPTYPE_POS, REPTYPE_POS, /* OP_CRPOSSTAR, OP_CRPOSPLUS */
+ REPTYPE_POS, REPTYPE_POS }; /* OP_CRPOSQUERY, OP_CRPOSRANGE */
+
+/* Numbers for RMATCH calls at backtracking points. When these lists are
+changed, the code at RETURN_SWITCH below must be updated in sync. */
+
+enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10,
+ RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20,
+ RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
+ RM31, RM32, RM33, RM34, RM35 };
+
+#ifdef SUPPORT_WIDE_CHARS
+enum { RM100=100, RM101 };
+#endif
+
+#ifdef SUPPORT_UNICODE
+enum { RM200=200, RM201, RM202, RM203, RM204, RM205, RM206, RM207,
+ RM208, RM209, RM210, RM211, RM212, RM213, RM214, RM215,
+ RM216, RM217, RM218, RM219, RM220, RM221, RM222 };
+#endif
+
+/* Define short names for general fields in the current backtrack frame, which
+is always pointed to by the F variable. Occasional references to fields in
+other frames are written out explicitly. There are also some fields in the
+current frame whose names start with "temp" that are used for short-term,
+localised backtracking memory. These are #defined with Lxxx names at the point
+of use and undefined afterwards. */
+
+#define Fback_frame F->back_frame
+#define Fcapture_last F->capture_last
+#define Fcurrent_recurse F->current_recurse
+#define Fecode F->ecode
+#define Feptr F->eptr
+#define Fgroup_frame_type F->group_frame_type
+#define Flast_group_offset F->last_group_offset
+#define Flength F->length
+#define Fmark F->mark
+#define Frdepth F->rdepth
+#define Fstart_match F->start_match
+#define Foffset_top F->offset_top
+#define Foccu F->occu
+#define Fop F->op
+#define Fovector F->ovector
+#define Freturn_id F->return_id
+
+
+#ifdef DEBUG_FRAMES_DISPLAY
+/*************************************************
+* Display current frames and contents *
+*************************************************/
+
+/* This debugging function displays the current set of frames and their
+contents. It is not called automatically from anywhere, the intention being
+that calls can be inserted where necessary when debugging frame-related
+problems.
+
+Arguments:
+ f the file to write to
+ F the current top frame
+ P a previous frame of interest
+ frame_size the frame size
+ mb points to the match block
+ s identification text
+
+Returns: nothing
+*/
+
+static void
+display_frames(FILE *f, heapframe *F, heapframe *P, PCRE2_SIZE frame_size,
+ match_block *mb, const char *s, ...)
+{
+uint32_t i;
+heapframe *Q;
+va_list ap;
+va_start(ap, s);
+
+fprintf(f, "FRAMES ");
+vfprintf(f, s, ap);
+va_end(ap);
+
+if (P != NULL) fprintf(f, " P=%lu",
+ ((char *)P - (char *)(mb->match_frames))/frame_size);
+fprintf(f, "\n");
+
+for (i = 0, Q = mb->match_frames;
+ Q <= F;
+ i++, Q = (heapframe *)((char *)Q + frame_size))
+ {
+ fprintf(f, "Frame %d type=%x subj=%lu code=%d back=%lu id=%d",
+ i, Q->group_frame_type, Q->eptr - mb->start_subject, *(Q->ecode),
+ Q->back_frame, Q->return_id);
+
+ if (Q->last_group_offset == PCRE2_UNSET)
+ fprintf(f, " lgoffset=unset\n");
+ else
+ fprintf(f, " lgoffset=%lu\n", Q->last_group_offset/frame_size);
+ }
+}
+
+#endif
+
+
+
+/*************************************************
+* Process a callout *
+*************************************************/
+
+/* This function is called for all callouts, whether "standalone" or at the
+start of a conditional group. Feptr will be pointing to either OP_CALLOUT or
+OP_CALLOUT_STR.
+
+Arguments:
+ F points to the current backtracking frame
+ mb points to the match block
+ lengthptr where to return the length of the callout item
+
+Returns: the return from the callout
+ or 0 if no callout function exists
+*/
+
+static int
+do_callout(heapframe *F, match_block *mb, PCRE2_SIZE *lengthptr)
+{
+int rc;
+PCRE2_SIZE save0, save1;
+PCRE2_SIZE *callout_ovector;
+pcre2_callout_block cb;
+
+*lengthptr = (*Fecode == OP_CALLOUT)?
+ PRIV(OP_lengths)[OP_CALLOUT] : GET(Fecode, 1 + 2*LINK_SIZE);
+
+if (mb->callout == NULL) return 0; /* No callout function provided */
+
+/* The original matching code (pre 10.30) worked directly with the ovector
+passed by the user, and this was passed to callouts. Now that the working
+ovector is in the backtracking frame, it no longer needs to reserve space for
+the overall match offsets (which would waste space in the frame). For backward
+compatibility, however, we pass capture_top and offset_vector to the callout as
+if for the extended ovector, and we ensure that the first two slots are unset
+by preserving and restoring their current contents. Picky compilers complain if
+references such as Fovector[-2] are use directly, so we set up a separate
+pointer. */
+
+callout_ovector = (PCRE2_SIZE *)(Fovector) - 2;
+
+cb.version = 1;
+cb.capture_top = (uint32_t)Foffset_top/2 + 1;
+cb.capture_last = Fcapture_last;
+cb.offset_vector = callout_ovector;
+cb.mark = mb->nomatch_mark;
+cb.subject = mb->start_subject;
+cb.subject_length = (PCRE2_SIZE)(mb->end_subject - mb->start_subject);
+cb.start_match = (PCRE2_SIZE)(Fstart_match - mb->start_subject);
+cb.current_position = (PCRE2_SIZE)(Feptr - mb->start_subject);
+cb.pattern_position = GET(Fecode, 1);
+cb.next_item_length = GET(Fecode, 1 + LINK_SIZE);
+
+if (*Fecode == OP_CALLOUT) /* Numerical callout */
+ {
+ cb.callout_number = Fecode[1 + 2*LINK_SIZE];
+ cb.callout_string_offset = 0;
+ cb.callout_string = NULL;
+ cb.callout_string_length = 0;
+ }
+else /* String callout */
+ {
+ cb.callout_number = 0;
+ cb.callout_string_offset = GET(Fecode, 1 + 3*LINK_SIZE);
+ cb.callout_string = Fecode + (1 + 4*LINK_SIZE) + 1;
+ cb.callout_string_length =
+ *lengthptr - (1 + 4*LINK_SIZE) - 2;
+ }
+
+save0 = callout_ovector[0];
+save1 = callout_ovector[1];
+callout_ovector[0] = callout_ovector[1] = PCRE2_UNSET;
+rc = mb->callout(&cb, mb->callout_data);
+callout_ovector[0] = save0;
+callout_ovector[1] = save1;
+return rc;
+}
@@ -130,10 +336,9 @@ seems unlikely.)
Arguments:
offset index into the offset vector
- offset_top top of the used offset vector
- eptr pointer into the subject
- mb points to match block
caseless TRUE if caseless
+ F the current backtracking frame pointer
+ mb points to match block
lengthptr pointer for returning the length matched
Returns: = 0 sucessful match; number of code units matched is set
@@ -142,21 +347,18 @@ Returns: = 0 sucessful match; number of code units matched is set
*/
static int
-match_ref(PCRE2_SIZE offset, PCRE2_SIZE offset_top, register PCRE2_SPTR eptr,
- match_block *mb, BOOL caseless, PCRE2_SIZE *lengthptr)
+match_ref(PCRE2_SIZE offset, BOOL caseless, heapframe *F, match_block *mb,
+ PCRE2_SIZE *lengthptr)
{
-#if defined SUPPORT_UNICODE
-BOOL utf = (mb->poptions & PCRE2_UTF) != 0;
-#endif
-
-register PCRE2_SPTR p;
+PCRE2_SPTR p;
PCRE2_SIZE length;
-PCRE2_SPTR eptr_start = eptr;
+PCRE2_SPTR eptr;
+PCRE2_SPTR eptr_start;
/* Deal with an unset group. The default is no match, but there is an option to
match an empty string. */
-if (offset >= offset_top || mb->ovector[offset] == PCRE2_UNSET)
+if (offset >= Foffset_top || Fovector[offset] == PCRE2_UNSET)
{
if ((mb->poptions & PCRE2_MATCH_UNSET_BACKREF) != 0)
{
@@ -168,19 +370,20 @@ if (offset >= offset_top || mb->ovector[offset] == PCRE2_UNSET)
/* Separate the caseless and UTF cases for speed. */
-p = mb->start_subject + mb->ovector[offset];
-length = mb->ovector[offset+1] - mb->ovector[offset];
+eptr = eptr_start = Feptr;
+p = mb->start_subject + Fovector[offset];
+length = Fovector[offset+1] - Fovector[offset];
if (caseless)
{
#if defined SUPPORT_UNICODE
- if (utf)
+ if ((mb->poptions & PCRE2_UTF) != 0)
{
/* Match characters up to the end of the reference. NOTE: the number of
code units matched may differ, because in UTF-8 there are some characters
- whose upper and lower case versions code have different numbers of bytes.
- For example, U+023A (2 bytes in UTF-8) is the upper case version of U+2C65
- (3 bytes in UTF-8); a sequence of 3 of the former uses 6 bytes, as does a
+ whose upper and lower case codes have different numbers of bytes. For
+ example, U+023A (2 bytes in UTF-8) is the upper case version of U+2C65 (3
+ bytes in UTF-8); a sequence of 3 of the former uses 6 bytes, as does a
sequence of two of the latter. It is important, therefore, to check the
length along the reference, not along the subject (earlier code did this
wrong). */
@@ -226,14 +429,26 @@ if (caseless)
}
/* In the caseful case, we can just compare the code units, whether or not we
-are in UTF mode. */
+are in UTF mode. When partial matching, we have to do this unit-by-unit. */
else
{
- for (; length > 0; length--)
+ if (mb->partial != 0)
+ {
+ for (; length > 0; length--)
+ {
+ if (eptr >= mb->end_subject) return 1; /* Partial match */
+ if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1; /* No match */
+ }
+ }
+
+ /* Not partial matching */
+
+ else
{
- if (eptr >= mb->end_subject) return 1; /* Partial match */
- if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1; /*No match */
+ if ((PCRE2_SIZE)(mb->end_subject - eptr) < length) return 1; /* Partial */
+ if (memcmp(p, eptr, CU2BYTES(length)) != 0) return -1; /* No match */
+ eptr += length;
}
}
@@ -243,281 +458,73 @@ return 0; /* Match */
-/***************************************************************************
-****************************************************************************
- RECURSION IN THE match() FUNCTION
-
-The match() function is highly recursive, though not every recursive call
-increases the recursion depth. Nevertheless, some regular expressions can cause
-it to recurse to a great depth. I was writing for Unix, so I just let it call
-itself recursively. This uses the stack for saving everything that has to be
-saved for a recursive call. On Unix, the stack can be large, and this works
-fine.
-
-It turns out that on some non-Unix-like systems there are problems with
-programs that use a lot of stack. (This despite the fact that every last chip
-has oodles of memory these days, and techniques for extending the stack have
-been known for decades.) So....
-
-There is a fudge, triggered by defining HEAP_MATCH_RECURSE, which avoids
-recursive calls by keeping local variables that need to be preserved in blocks
-of memory on the heap instead instead of on the stack. Macros are used to
-achieve this so that the actual code doesn't look very different to what it
-always used to.
-
-The original heap-recursive code used longjmp(). However, it seems that this
-can be very slow on some operating systems. Following a suggestion from Stan
-Switzer, the use of longjmp() has been abolished, at the cost of having to
-provide a unique number for each call to RMATCH. There is no way of generating
-a sequence of numbers at compile time in C. I have given them names, to make
-them stand out more clearly.
-
-Crude tests on x86 Linux show a small speedup of around 5-8%. However, on
-FreeBSD, avoiding longjmp() more than halves the time taken to run the standard
-tests. Furthermore, not using longjmp() means that local dynamic variables
-don't have indeterminate values; this has meant that the frame size can be
-reduced because the result can be "passed back" by straight setting of the
-variable instead of being passed in the frame.
-****************************************************************************
-***************************************************************************/
-
-/* Numbers for RMATCH calls. When this list is changed, the code at HEAP_RETURN
-below must be updated in sync. */
-
-enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10,
- RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20,
- RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
- RM31, RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
- RM41, RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
- RM51, RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
- RM61, RM62, RM63, RM64, RM65, RM66, RM67, RM68 };
-
-/* These versions of the macros use the stack, as normal. Note that the "rw"
-argument of RMATCH isn't actually used in this definition. */
-
-#ifndef HEAP_MATCH_RECURSE
-#define REGISTER register
-#define RMATCH(ra,rb,rc,rd,re,rw) \
- rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1)
-#define RRETURN(ra) return ra
-#else
-
-/* These versions of the macros manage a private stack on the heap. Note that
-the "rd" argument of RMATCH isn't actually used in this definition. It's the mb
-argument of match(), which never changes. */
-
-#define REGISTER
-
-#define RMATCH(ra,rb,rc,rd,re,rw)\
- {\
- heapframe *newframe = frame->Xnextframe;\
- if (newframe == NULL)\
- {\
- newframe = (heapframe *)(mb->stack_memctl.malloc)\
- (sizeof(heapframe), mb->stack_memctl.memory_data);\
- if (newframe == NULL) RRETURN(PCRE2_ERROR_NOMEMORY);\
- newframe->Xnextframe = NULL;\
- frame->Xnextframe = newframe;\
- }\
- frame->Xwhere = rw;\
- newframe->Xeptr = ra;\
- newframe->Xecode = rb;\
- newframe->Xmstart = mstart;\
- newframe->Xoffset_top = rc;\
- newframe->Xeptrb = re;\
- newframe->Xrdepth = frame->Xrdepth + 1;\
- newframe->Xprevframe = frame;\
- frame = newframe;\
- goto HEAP_RECURSE;\
- L_##rw:;\
- }
-
-#define RRETURN(ra)\
- {\
- heapframe *oldframe = frame;\
- frame = oldframe->Xprevframe;\
- if (frame != NULL)\
- {\
- rrc = ra;\
- goto HEAP_RETURN;\
- }\
- return ra;\
- }
-
-
-/* Structure for remembering the local variables in a private frame. Arrange it
-so as to minimize the number of holes. */
-
-typedef struct heapframe {
- struct heapframe *Xprevframe;
- struct heapframe *Xnextframe;
-
-#ifdef SUPPORT_UNICODE
- PCRE2_SPTR Xcharptr;
-#endif
- PCRE2_SPTR Xeptr;
- PCRE2_SPTR Xecode;
- PCRE2_SPTR Xmstart;
- PCRE2_SPTR Xcallpat;
- PCRE2_SPTR Xdata;
- PCRE2_SPTR Xnext_ecode;
- PCRE2_SPTR Xpp;
- PCRE2_SPTR Xprev;
- PCRE2_SPTR Xsaved_eptr;
-
- eptrblock *Xeptrb;
-
- PCRE2_SIZE Xlength;
- PCRE2_SIZE Xoffset;
- PCRE2_SIZE Xoffset_top;
- PCRE2_SIZE Xsave_offset1, Xsave_offset2, Xsave_offset3;
-
- uint32_t Xfc;
- uint32_t Xnumber;
- uint32_t Xrdepth;
- uint32_t Xop;
- uint32_t Xsave_capture_last;
-
-#ifdef SUPPORT_UNICODE
- uint32_t Xprop_value;
- int Xprop_type;
- int Xprop_fail_result;
- int Xoclength;
-#endif
-
- int Xcodelink;
- int Xctype;
- int Xfi;
- int Xmax;
- int Xmin;
- int Xwhere; /* Where to jump back to */
-
- BOOL Xcondition;
- BOOL Xcur_is_word;
- BOOL Xprev_is_word;
-
- eptrblock Xnewptrb;
- recursion_info Xnew_recursive;
-
-#ifdef SUPPORT_UNICODE
- PCRE2_UCHAR Xocchars[6];
-#endif
-} heapframe;
-
-#endif
-
-
-/***************************************************************************
-***************************************************************************/
+/******************************************************************************
+*******************************************************************************
+ "Recursion" in the match() function
+The original match() function was highly recursive, but this proved to be the
+source of a number of problems over the years, mostly because of the relatively
+small system stacks that are commonly found. As new features were added to
+patterns, various kludges were invented to reduce the amount of stack used,
+making the code hard to understand in places.
-/* When HEAP_MATCH_RECURSE is not defined, the match() function implements
-backtrack points by calling itself recursively in all but one case. The one
-special case is when processing OP_RECURSE, which specifies recursion in the
-pattern. The entire ovector must be saved and restored while processing
-OP_RECURSE. If the ovector is small enough, instead of calling match()
-directly, op_recurse_ovecsave() is called. This function uses the system stack
-to save the ovector while calling match() to process the pattern recursion. */
+A version did exist that used individual frames on the heap instead of calling
+match() recursively, but this ran substantially slower. The current version is
+a refactoring that uses a vector of frames to remember backtracking points.
+This runs no slower, and possibly even a bit faster than the original recursive
+implementation. An initial vector of size START_FRAMES_SIZE (enough for maybe
+50 frames) is allocated on the system stack. If this is not big enough, the
+heap is used for a larger vector.
-#ifndef HEAP_MATCH_RECURSE
+*******************************************************************************
+******************************************************************************/
-/* We need a prototype for match() because it is mutually recursive with
-op_recurse_ovecsave(). */
-static int
-match(REGISTER PCRE2_SPTR eptr, REGISTER PCRE2_SPTR ecode, PCRE2_SPTR mstart,
- PCRE2_SIZE offset_top, match_block *mb, eptrblock *eptrb, uint32_t rdepth);
/*************************************************
-* Process OP_RECURSE, stacking ovector *
+* Macros for the match() function *
*************************************************/
-/* When this function is called, mb->recursive has already been updated to
-point to a new recursion data block, and all its fields other than ovec_save
-have been set.
-
-This function exists so that the local vector variable ovecsave is no longer
-defined in the match() function, as it was in PCRE1. It is used only when there
-is recursion in the pattern, so it wastes a lot of stack to have it defined for
-every call of match(). We now use this function as an indirect way of calling
-match() only in the case when ovecsave is needed. (David Wheeler used to say
-"All problems in computer science can be solved by another level of
-indirection.")
-
-HOWEVER: when this file is compiled by gcc in an optimizing mode, because this
-function is called only once, and only from within match(), gcc will "inline"
-it - that is, move it inside match() - and this completely negates its reason
-for existence. Therefore, we mark it as non-inline when gcc is in use.
+/* These macros pack up tests that are used for partial matching several times
+in the code. We set the "hit end" flag if the pointer is at the end of the
+subject and also past the earliest inspected character (i.e. something has been
+matched, even if not part of the actual matched string). For hard partial
+matching, we then return immediately. The second one is used when we already
+know we are past the end of the subject. */
-Arguments:
- eptr pointer to current character in subject
- callpat the recursion point in the pattern
- mstart pointer to the current match start position (can be modified
- by encountering \K)
- offset_top current top pointer (highest ovector offset used + 1)
- mb pointer to "static" info block for the match
- eptrb pointer to chain of blocks containing eptr at start of
- brackets - for testing for empty matches
- rdepth the recursion depth
-
-Returns: a match() return code
-*/
-
-static int
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-__attribute__ ((noinline))
-#endif
-op_recurse_ovecsave(REGISTER PCRE2_SPTR eptr, PCRE2_SPTR callpat,
- PCRE2_SPTR mstart, PCRE2_SIZE offset_top, match_block *mb, eptrblock *eptrb,
- uint32_t rdepth)
-{
-register int rrc;
-BOOL cbegroup = *callpat >= OP_SBRA;
-recursion_info *new_recursive = mb->recursive;
-PCRE2_SIZE ovecsave[OP_RECURSE_STACK_SAVE_MAX];
-
-/* Save the ovector */
+#define CHECK_PARTIAL()\
+ if (mb->partial != 0 && Feptr >= mb->end_subject && \
+ Feptr > mb->start_used_ptr) \
+ { \
+ mb->hitend = TRUE; \
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; \
+ }
-new_recursive->ovec_save = ovecsave;
-memcpy(ovecsave, mb->ovector, mb->offset_end * sizeof(PCRE2_SIZE));
+#define SCHECK_PARTIAL()\
+ if (mb->partial != 0 && Feptr > mb->start_used_ptr) \
+ { \
+ mb->hitend = TRUE; \
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; \
+ }
-/* Do the recursion. After processing each alternative, restore the ovector
-data and the last captured value. */
+/* These macros are used to implement backtracking. They simulate a recursive
+call to the match() function by means of a local vector of frames which
+remember the backtracking points. */
-do
- {
- if (cbegroup) mb->match_function_type |= MATCH_CBEGROUP;
- rrc = match(eptr, callpat + PRIV(OP_lengths)[*callpat], mstart, offset_top,
- mb, eptrb, rdepth + 1);
- memcpy(mb->ovector, new_recursive->ovec_save,
- mb->offset_end * sizeof(PCRE2_SIZE));
- mb->capture_last = new_recursive->saved_capture_last;
- if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) return rrc;
-
- /* PCRE does not allow THEN, SKIP, PRUNE or COMMIT to escape beyond a
- recursion; they cause a NOMATCH for the entire recursion. These codes
- are defined in a range that can be tested for. */
-
- if (rrc >= MATCH_BACKTRACK_MIN && rrc <= MATCH_BACKTRACK_MAX)
- return MATCH_NOMATCH;
-
- /* Any return code other than NOMATCH is an error. Otherwise, advance to the
- next alternative or to the end of the recursing subpattern. If there were
- nested recursions, mb->recursive might be changed, so reset it before
- looping. */
-
- if (rrc != MATCH_NOMATCH) return rrc;
- mb->recursive = new_recursive;
- callpat += GET(callpat, 1);
+#define RMATCH(ra,rb)\
+ {\
+ start_ecode = ra;\
+ Freturn_id = rb;\
+ goto MATCH_RECURSE;\
+ L_##rb:;\
}
-while (*callpat == OP_ALT); /* Loop for the alternatives */
-
-/* None of the alternatives matched. */
-return MATCH_NOMATCH;
-}
-#endif /* HEAP_MATCH_RECURSE */
+#define RRETURN(ra)\
+ {\
+ rrc = ra;\
+ goto RETURN_SWITCH;\
+ }
@@ -525,2470 +532,1270 @@ return MATCH_NOMATCH;
* Match from current position *
*************************************************/
-/* This function is called recursively in many circumstances. Whenever it
-returns a negative (error) response, the outer incarnation must also return the
-same response. */
-
-/* These macros pack up tests that are used for partial matching, and which
-appear several times in the code. We set the "hit end" flag if the pointer is
-at the end of the subject and also past the earliest inspected character (i.e.
-something has been matched, even if not part of the actual matched string). For
-hard partial matching, we then return immediately. The second one is used when
-we already know we are past the end of the subject. */
+/* This function is called to run one match attempt at a single starting point
+in the subject.
-#define CHECK_PARTIAL()\
- if (mb->partial != 0 && eptr >= mb->end_subject && \
- eptr > mb->start_used_ptr) \
- { \
- mb->hitend = TRUE; \
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL); \
- }
-
-#define SCHECK_PARTIAL()\
- if (mb->partial != 0 && eptr > mb->start_used_ptr) \
- { \
- mb->hitend = TRUE; \
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL); \
- }
-
-
-/* Performance note: It might be tempting to extract commonly used fields from
-the mb structure (e.g. utf, end_subject) into individual variables to improve
+Performance note: It might be tempting to extract commonly used fields from the
+mb structure (e.g. end_subject) into individual variables to improve
performance. Tests using gcc on a SPARC disproved this; in the first case, it
made performance worse.
Arguments:
- eptr pointer to current character in subject
- ecode pointer to current position in compiled code
- mstart pointer to the current match start position (can be modified
- by encountering \K)
- offset_top current top pointer (highest ovector offset used + 1)
- mb pointer to "static" info block for the match
- eptrb pointer to chain of blocks containing eptr at start of
- brackets - for testing for empty matches
- rdepth the recursion depth
-
-Returns: MATCH_MATCH if matched ) these values are >= 0
- MATCH_NOMATCH if failed to match )
- a negative MATCH_xxx value for PRUNE, SKIP, etc
- a negative PCRE2_ERROR_xxx value if aborted by an error condition
- (e.g. stopped by repeated call or recursion limit)
+ start_eptr starting character in subject
+ start_ecode starting position in compiled code
+ ovector pointer to the final output vector
+ oveccount number of pairs in ovector
+ top_bracket number of capturing parentheses in the pattern
+ frame_size size of each backtracking frame
+ mb pointer to "static" variables block
+
+Returns: MATCH_MATCH if matched ) these values are >= 0
+ MATCH_NOMATCH if failed to match )
+ negative MATCH_xxx value for PRUNE, SKIP, etc
+ negative PCRE2_ERROR_xxx value if aborted by an error condition
+ (e.g. stopped by repeated call or depth limit)
*/
static int
-match(REGISTER PCRE2_SPTR eptr, REGISTER PCRE2_SPTR ecode, PCRE2_SPTR mstart,
- PCRE2_SIZE offset_top, match_block *mb, eptrblock *eptrb, uint32_t rdepth)
+match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, PCRE2_SIZE *ovector,
+ uint16_t oveccount, uint16_t top_bracket, PCRE2_SIZE frame_size,
+ match_block *mb)
{
-/* These variables do not need to be preserved over recursion in this function,
-so they can be ordinary variables in all cases. Mark some of them with
-"register" because they are used a lot in loops. */
-
-register int rrc; /* Returns from recursive calls */
-register int i; /* Used for loops not involving calls to RMATCH() */
-register uint32_t c; /* Character values not kept over RMATCH() calls */
-register BOOL utf; /* Local copy of UTF flag for speed */
+/* Frame-handling variables */
-BOOL minimize, possessive; /* Quantifier options */
-BOOL caseless;
-int condcode;
+heapframe *F; /* Current frame pointer */
+heapframe *N = NULL; /* Temporary frame pointers */
+heapframe *P = NULL;
+heapframe *assert_accept_frame; /* For passing back the frame with captures */
+PCRE2_SIZE frame_copy_size; /* Amount to copy when creating a new frame */
-/* When recursion is not being used, all "local" variables that have to be
-preserved over calls to RMATCH() are part of a "frame". We set up the top-level
-frame on the stack here; subsequent instantiations are obtained from the heap
-whenever RMATCH() does a "recursion". See the macro definitions above. Putting
-the top-level on the stack rather than malloc-ing them all gives a performance
-boost in many cases where there is not much "recursion". */
+/* Local variables that do not need to be preserved over calls to RRMATCH(). */
-#ifdef HEAP_MATCH_RECURSE
-heapframe *frame = (heapframe *)mb->match_frames_base;
+PCRE2_SPTR bracode; /* Temp pointer to start of group */
+PCRE2_SIZE offset; /* Used for group offsets */
+PCRE2_SIZE length; /* Used for various length calculations */
-/* Copy in the original argument variables */
-
-frame->Xeptr = eptr;
-frame->Xecode = ecode;
-frame->Xmstart = mstart;
-frame->Xoffset_top = offset_top;
-frame->Xeptrb = eptrb;
-frame->Xrdepth = rdepth;
-
-/* This is where control jumps back to to effect "recursion" */
-
-HEAP_RECURSE:
+int rrc; /* Return from functions & backtracking "recursions" */
+#ifdef SUPPORT_UNICODE
+int proptype; /* Type of character property */
+#endif
-/* Macros make the argument variables come from the current frame */
+uint32_t i; /* Used for local loops */
+uint32_t fc; /* Character values */
+uint32_t number; /* Used for group and other numbers */
+uint32_t reptype = 0; /* Type of repetition (0 to avoid compiler warning) */
+uint32_t group_frame_type; /* Specifies type for new group frames */
-#define eptr frame->Xeptr
-#define ecode frame->Xecode
-#define mstart frame->Xmstart
-#define offset_top frame->Xoffset_top
-#define eptrb frame->Xeptrb
-#define rdepth frame->Xrdepth
+BOOL condition; /* Used in conditional groups */
+BOOL cur_is_word; /* Used in "word" tests */
+BOOL prev_is_word; /* Used in "word" tests */
-/* Ditto for the local variables */
+/* UTF flag */
#ifdef SUPPORT_UNICODE
-#define charptr frame->Xcharptr
-#define prop_value frame->Xprop_value
-#define prop_type frame->Xprop_type
-#define prop_fail_result frame->Xprop_fail_result
-#define oclength frame->Xoclength
-#define occhars frame->Xocchars
+BOOL utf = (mb->poptions & PCRE2_UTF) != 0;
+#else
+BOOL utf = FALSE;
#endif
+/* This is the length of the last part of a backtracking frame that must be
+copied when a new frame is created. */
-#define callpat frame->Xcallpat
-#define codelink frame->Xcodelink
-#define data frame->Xdata
-#define next_ecode frame->Xnext_ecode
-#define pp frame->Xpp
-#define prev frame->Xprev
-#define saved_eptr frame->Xsaved_eptr
-
-#define new_recursive frame->Xnew_recursive
-
-#define ctype frame->Xctype
-#define fc frame->Xfc
-#define fi frame->Xfi
-#define length frame->Xlength
-#define max frame->Xmax
-#define min frame->Xmin
-#define number frame->Xnumber
-#define offset frame->Xoffset
-#define op frame->Xop
-#define save_capture_last frame->Xsave_capture_last
-#define save_offset1 frame->Xsave_offset1
-#define save_offset2 frame->Xsave_offset2
-#define save_offset3 frame->Xsave_offset3
-
-#define condition frame->Xcondition
-#define cur_is_word frame->Xcur_is_word
-#define prev_is_word frame->Xprev_is_word
-
-#define newptrb frame->Xnewptrb
-
-/* When normal stack-based recursion is being used for match(), local variables
-are allocated on the stack and get preserved during recursion in the usual way.
-In this environment, fi and i, and fc and c, can be the same variables. */
-
-#else /* HEAP_MATCH_RECURSE not defined */
-#define fi i
-#define fc c
-
-/* Many of the following variables are used only in small blocks of the code.
-My normal style of coding would have declared them within each of those blocks.
-However, in order to accommodate the version of this code that uses an external
-"stack" implemented on the heap, it is easier to declare them all here, so the
-declarations can be cut out in a block. The only declarations within blocks
-below are for variables that do not have to be preserved over a recursive call
-to RMATCH(). */
+frame_copy_size = frame_size - offsetof(heapframe, eptr);
-#ifdef SUPPORT_UNICODE
-PCRE2_SPTR charptr;
-#endif
-PCRE2_SPTR callpat;
-PCRE2_SPTR data;
-PCRE2_SPTR next_ecode;
-PCRE2_SPTR pp;
-PCRE2_SPTR prev;
-PCRE2_SPTR saved_eptr;
-
-PCRE2_SIZE length;
-PCRE2_SIZE offset;
-PCRE2_SIZE save_offset1, save_offset2, save_offset3;
+/* Set up the first current frame at the start of the vector, and initialize
+fields that are not reset for new frames. */
-uint32_t number;
-uint32_t op;
-uint32_t save_capture_last;
+F = mb->match_frames;
+Frdepth = 0; /* "Recursion" depth */
+Fcapture_last = 0; /* Number of most recent capture */
+Fcurrent_recurse = RECURSE_UNSET; /* Not pattern recursing. */
+Fstart_match = Feptr = start_eptr; /* Current data pointer and start match */
+Fmark = NULL; /* Most recent mark */
+Foffset_top = 0; /* End of captures within the frame */
+Flast_group_offset = PCRE2_UNSET; /* Saved frame of most recent group */
+group_frame_type = 0; /* Not a start of group frame */
+goto NEW_FRAME; /* Start processing with this frame */
-#ifdef SUPPORT_UNICODE
-uint32_t prop_value;
-int prop_type;
-int prop_fail_result;
-int oclength;
-PCRE2_UCHAR occhars[6];
-#endif
+/* Come back here when we want to create a new frame for remembering a
+backtracking point. */
-int codelink;
-int ctype;
-int max;
-int min;
+MATCH_RECURSE:
-BOOL condition;
-BOOL cur_is_word;
-BOOL prev_is_word;
+/* Set up a new backtracking frame. If the vector is full, get a new one
+on the heap, doubling the size, but constrained by the heap limit. */
-eptrblock newptrb;
-recursion_info new_recursive;
-#endif /* HEAP_MATCH_RECURSE not defined */
+N = (heapframe *)((char *)F + frame_size);
+if (N >= mb->match_frames_top)
+ {
+ PCRE2_SIZE newsize = mb->frame_vector_size * 2;
+ heapframe *new;
-/* To save space on the stack and in the heap frame, I have doubled up on some
-of the local variables that are used only in localised parts of the code, but
-still need to be preserved over recursive calls of match(). These macros define
-the alternative names that are used. */
+ if ((newsize / 1024) > mb->heap_limit)
+ {
+ PCRE2_SIZE maxsize = ((mb->heap_limit * 1024)/frame_size) * frame_size;
+ if (mb->frame_vector_size >= maxsize) return PCRE2_ERROR_HEAPLIMIT;
+ newsize = maxsize;
+ }
-#define allow_zero cur_is_word
-#define cbegroup condition
-#define code_offset codelink
-#define condassert condition
-#define foc number
-#define matched_once prev_is_word
-#define save_mark data
+ new = mb->memctl.malloc(newsize, mb->memctl.memory_data);
+ if (new == NULL) return PCRE2_ERROR_NOMEMORY;
+ memcpy(new, mb->match_frames, mb->frame_vector_size);
-/* These statements are here to stop the compiler complaining about unitialized
-variables. */
+ F = (heapframe *)((char *)new + ((char *)F - (char *)mb->match_frames));
+ N = (heapframe *)((char *)F + frame_size);
-#ifdef SUPPORT_UNICODE
-prop_value = 0;
-prop_fail_result = 0;
-#endif
+ if (mb->match_frames != mb->stack_frames)
+ mb->memctl.free(mb->match_frames, mb->memctl.memory_data);
+ mb->match_frames = new;
+ mb->match_frames_top = (heapframe *)((char *)mb->match_frames + newsize);
+ mb->frame_vector_size = newsize;
+ }
+#ifdef DEBUG_SHOW_RMATCH
+fprintf(stderr, "++ RMATCH %2d frame=%d", Freturn_id, Frdepth + 1);
+if (group_frame_type != 0)
+ {
+ fprintf(stderr, " type=%x ", group_frame_type);
+ switch (GF_IDMASK(group_frame_type))
+ {
+ case GF_CAPTURE:
+ fprintf(stderr, "capture=%d", GF_DATAMASK(group_frame_type));
+ break;
-/* This label is used for tail recursion, which is used in a few cases even
-when HEAP_MATCH_RECURSE is not defined, in order to reduce the amount of stack
-that is used. Thanks to Ian Taylor for noticing this possibility and sending
-the original patch. */
+ case GF_NOCAPTURE:
+ fprintf(stderr, "nocapture op=%d", GF_DATAMASK(group_frame_type));
+ break;
-TAIL_RECURSE:
+ case GF_CONDASSERT:
+ fprintf(stderr, "condassert op=%d", GF_DATAMASK(group_frame_type));
+ break;
-/* OK, now we can get on with the real code of the function. Recursive calls
-are specified by the macro RMATCH and RRETURN is used to return. When
-HEAP_MATCH_RECURSE is *not* defined, these just turn into a recursive call to
-match() and a "return", respectively. However, RMATCH isn't like a function
-call because it's quite a complicated macro. It has to be used in one
-particular way. This shouldn't, however, impact performance when true recursion
-is being used. */
+ case GF_RECURSE:
+ fprintf(stderr, "recurse=%d", GF_DATAMASK(group_frame_type));
+ break;
-#ifdef SUPPORT_UNICODE
-utf = (mb->poptions & PCRE2_UTF) != 0;
-#else
-utf = FALSE;
+ default:
+ fprintf(stderr, "*** unknown ***");
+ break;
+ }
+ }
+fprintf(stderr, "\n");
#endif
-/* First check that we haven't called match() too many times, or that we
-haven't exceeded the recursive call limit. */
+/* Copy those fields that must be copied into the new frame, increase the
+"recursion" depth (i.e. the new frame's index) and then make the new frame
+current. */
+
+memcpy((char *)N + offsetof(heapframe, eptr),
+ (char *)F + offsetof(heapframe, eptr),
+ frame_copy_size);
-if (mb->match_call_count++ >= mb->match_limit) RRETURN(PCRE2_ERROR_MATCHLIMIT);
-if (rdepth >= mb->match_limit_recursion) RRETURN(PCRE2_ERROR_RECURSIONLIMIT);
+N->rdepth = Frdepth + 1;
+F = N;
-/* At the start of a group with an unlimited repeat that may match an empty
-string, the variable mb->match_function_type contains the MATCH_CBEGROUP bit.
-It is done this way to save having to use another function argument, which
-would take up space on the stack. See also MATCH_CONDASSERT below.
+/* Carry on processing with a new frame. */
-When MATCH_CBEGROUP is set, add the current subject pointer to the chain of
-such remembered pointers, to be checked when we hit the closing ket, in order
-to break infinite loops that match no characters. When match() is called in
-other circumstances, don't add to the chain. The MATCH_CBEGROUP feature must
-NOT be used with tail recursion, because the memory block that is used is on
-the stack, so a new one may be required for each match(). */
+NEW_FRAME:
+Fgroup_frame_type = group_frame_type;
+Fecode = start_ecode; /* Starting code pointer */
+Fback_frame = frame_size; /* Default is go back one frame */
-if ((mb->match_function_type & MATCH_CBEGROUP) != 0)
+/* If this is a special type of group frame, remember its offset for quick
+access at the end of the group. If this is a recursion, set a new current
+recursion value. */
+
+if (group_frame_type != 0)
{
- newptrb.epb_saved_eptr = eptr;
- newptrb.epb_prev = eptrb;
- eptrb = &newptrb;
- mb->match_function_type &= ~MATCH_CBEGROUP;
+ Flast_group_offset = (char *)F - (char *)mb->match_frames;
+ if (GF_IDMASK(group_frame_type) == GF_RECURSE)
+ Fcurrent_recurse = GF_DATAMASK(group_frame_type);
+ group_frame_type = 0;
}
-/* Now, at last, we can start processing the opcodes. */
+
+/* ========================================================================= */
+/* This is the main processing loop. First check that we haven't recorded too
+many backtracks (search tree is too large), or that we haven't exceeded the
+recursive depth limit (used too many backtracking frames). If not, process the
+opcodes. */
+
+if (mb->match_call_count++ >= mb->match_limit) return PCRE2_ERROR_MATCHLIMIT;
+if (Frdepth >= mb->match_limit_depth) return PCRE2_ERROR_DEPTHLIMIT;
for (;;)
{
- minimize = possessive = FALSE;
- op = *ecode;
+#ifdef DEBUG_SHOW_OPS
+fprintf(stderr, "++ op=%d\n", *Fecode);
+#endif
- switch(op)
+ Fop = *Fecode;
+ switch(Fop)
{
- case OP_MARK:
- mb->nomatch_mark = ecode + 2;
- mb->mark = NULL; /* In case previously set by assertion */
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, mb,
- eptrb, RM55);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
- mb->mark == NULL) mb->mark = ecode + 2;
-
- /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
- argument, and we must check whether that argument matches this MARK's
- argument. It is passed back in mb->start_match_ptr (an overloading of that
- variable). If it does match, we reset that variable to the current subject
- position and return MATCH_SKIP. Otherwise, pass back the return code
- unaltered. */
+ /* ===================================================================== */
+ /* Before OP_ACCEPT there may be any number of OP_CLOSE opcodes, to close
+ any currently open capturing brackets. Unlike reaching the end of a group,
+ where we know the starting frame is at the top of the chained frames, in
+ this case we have to search back for the relevant frame in case other types
+ of group that use chained frames have intervened. Multiple OP_CLOSEs always
+ come innermost first, which matches the chain order. We can ignore this in
+ a recursion, because captures are not passed out of recursions. */
- else if (rrc == MATCH_SKIP_ARG &&
- PRIV(strcmp)(ecode + 2, mb->start_match_ptr) == 0)
+ case OP_CLOSE:
+ if (Fcurrent_recurse == RECURSE_UNSET)
{
- mb->start_match_ptr = eptr;
- RRETURN(MATCH_SKIP);
+ number = GET2(Fecode, 1);
+ offset = Flast_group_offset;
+ for(;;)
+ {
+ if (offset == PCRE2_UNSET) return PCRE2_ERROR_INTERNAL;
+ N = (heapframe *)((char *)mb->match_frames + offset);
+ P = (heapframe *)((char *)N - frame_size);
+ if (N->group_frame_type == (GF_CAPTURE | number)) break;
+ offset = P->last_group_offset;
+ }
+ offset = (number << 1) - 2;
+ Fcapture_last = number;
+ Fovector[offset] = P->eptr - mb->start_subject;
+ Fovector[offset+1] = Feptr - mb->start_subject;
+ if (offset >= Foffset_top) Foffset_top = offset + 2;
}
- RRETURN(rrc);
-
- case OP_FAIL:
- RRETURN(MATCH_NOMATCH);
-
- case OP_COMMIT:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM52);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_COMMIT);
-
- case OP_PRUNE:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM51);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_PRUNE);
-
- case OP_PRUNE_ARG:
- mb->nomatch_mark = ecode + 2;
- mb->mark = NULL; /* In case previously set by assertion */
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, mb,
- eptrb, RM56);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
- mb->mark == NULL) mb->mark = ecode + 2;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_PRUNE);
-
- case OP_SKIP:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM53);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->start_match_ptr = eptr; /* Pass back current position */
- RRETURN(MATCH_SKIP);
-
- /* Note that, for Perl compatibility, SKIP with an argument does NOT set
- nomatch_mark. When a pattern match ends with a SKIP_ARG for which there was
- not a matching mark, we have to re-run the match, ignoring the SKIP_ARG
- that failed and any that precede it (either they also failed, or were not
- triggered). To do this, we maintain a count of executed SKIP_ARGs. If a
- SKIP_ARG gets to top level, the match is re-run with mb->ignore_skip_arg
- set to the count of the one that failed. */
+ Fecode += PRIV(OP_lengths)[*Fecode];
+ break;
- case OP_SKIP_ARG:
- mb->skip_arg_count++;
- if (mb->skip_arg_count <= mb->ignore_skip_arg)
- {
- ecode += PRIV(OP_lengths)[*ecode] + ecode[1];
- break;
- }
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, mb,
- eptrb, RM57);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- /* Pass back the current skip name by overloading mb->start_match_ptr and
- returning the special MATCH_SKIP_ARG return code. This will either be
- caught by a matching MARK, or get to the top, where it causes a rematch
- with mb->ignore_skip_arg set to the value of mb->skip_arg_count. */
+ /* ===================================================================== */
+ /* Real or forced end of the pattern, assertion, or recursion. In an
+ assertion ACCEPT, update the last used pointer and remember the current
+ frame so that the captures can be fished out of it. */
- mb->start_match_ptr = ecode + 2;
- RRETURN(MATCH_SKIP_ARG);
+ case OP_ASSERT_ACCEPT:
+ if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
+ assert_accept_frame = F;
+ RRETURN(MATCH_ACCEPT);
- /* For THEN (and THEN_ARG) we pass back the address of the opcode, so that
- the branch in which it occurs can be determined. Overload the start of
- match pointer to do this. */
+ /* If recursing, we have to find the most recent recursion. */
- case OP_THEN:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM54);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->start_match_ptr = ecode;
- RRETURN(MATCH_THEN);
+ case OP_ACCEPT:
+ case OP_END:
- case OP_THEN_ARG:
- mb->nomatch_mark = ecode + 2;
- mb->mark = NULL; /* In case previously set by assertion */
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top,
- mb, eptrb, RM58);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
- mb->mark == NULL) mb->mark = ecode + 2;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->start_match_ptr = ecode;
- RRETURN(MATCH_THEN);
+ /* Handle end of a recursion. */
- /* Handle an atomic group that does not contain any capturing parentheses.
- This can be handled like an assertion. Prior to 8.13, all atomic groups
- were handled this way. In 8.13, the code was changed as below for ONCE, so
- that backups pass through the group and thereby reset captured values.
- However, this uses a lot more stack, so in 8.20, atomic groups that do not
- contain any captures generate OP_ONCE_NC, which can be handled in the old,
- less stack intensive way.
-
- Check the alternative branches in turn - the matching won't pass the KET
- for this kind of subpattern. If any one branch matches, we carry on as at
- the end of a normal bracket, leaving the subject pointer, but resetting
- the start-of-match value in case it was changed by \K. */
-
- case OP_ONCE_NC:
- prev = ecode;
- saved_eptr = eptr;
- save_mark = mb->mark;
- do
+ if (Fcurrent_recurse != RECURSE_UNSET)
{
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, eptrb, RM64);
- if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */
+ offset = Flast_group_offset;
+ for(;;)
{
- mstart = mb->start_match_ptr;
- break;
+ if (offset == PCRE2_UNSET) return PCRE2_ERROR_INTERNAL;
+ N = (heapframe *)((char *)mb->match_frames + offset);
+ P = (heapframe *)((char *)N - frame_size);
+ if (GF_IDMASK(N->group_frame_type) == GF_RECURSE) break;
+ offset = P->last_group_offset;
}
- if (rrc == MATCH_THEN)
- {
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += GET(ecode,1);
- mb->mark = save_mark;
- }
- while (*ecode == OP_ALT);
- /* If hit the end of the group (which could be repeated), fail */
+ /* N is now the frame of the recursion; the previous frame is at the
+ OP_RECURSE position. Go back there, copying the current subject position
+ and mark, and move on past the OP_RECURSE. */
- if (*ecode != OP_ONCE_NC && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH);
-
- /* Continue as from after the group, updating the offsets high water
- mark, since extracts may have been taken. */
-
- do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
-
- offset_top = mb->end_offset_top;
- eptr = mb->end_match_ptr;
+ P->eptr = Feptr;
+ P->mark = Fmark;
+ F = P;
+ Fecode += 1 + LINK_SIZE;
+ continue;
+ }
- /* For a non-repeating ket, just continue at this level. This also
- happens for a repeating ket if no characters were matched in the group.
- This is the forcible breaking of infinite loops as implemented in Perl
- 5.005. */
+ /* Not a recursion. Fail for an empty string match if either PCRE2_NOTEMPTY
+ is set, or if PCRE2_NOTEMPTY_ATSTART is set and we have matched at the
+ start of the subject. In both cases, backtracking will then try other
+ alternatives, if any. */
- if (*ecode == OP_KET || eptr == saved_eptr)
- {
- ecode += 1+LINK_SIZE;
- break;
- }
+ if (Feptr == Fstart_match &&
+ ((mb->moptions & PCRE2_NOTEMPTY) != 0 ||
+ ((mb->moptions & PCRE2_NOTEMPTY_ATSTART) != 0 &&
+ Fstart_match == mb->start_subject + mb->start_offset)))
+ RRETURN(MATCH_NOMATCH);
- /* The repeating kets try the rest of the pattern or restart from the
- preceding bracket, in the appropriate order. The second "call" of match()
- uses tail recursion, to avoid using another stack frame. */
+ /* Also fail if PCRE2_ENDANCHORED is set and the end of the match is not
+ the end of the subject. After (*ACCEPT) we fail the entire match (at this
+ position) but backtrack on reaching the end of the pattern. */
- if (*ecode == OP_KETRMIN)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, eptrb, RM65);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode = prev;
- goto TAIL_RECURSE;
- }
- else /* OP_KETRMAX */
+ if (Feptr < mb->end_subject &&
+ ((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0)
{
- RMATCH(eptr, prev, offset_top, mb, eptrb, RM66);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += 1 + LINK_SIZE;
- goto TAIL_RECURSE;
+ if (Fop == OP_END) RRETURN(MATCH_NOMATCH);
+ return MATCH_NOMATCH;
}
- /* Control never gets here */
- /* Handle a capturing bracket, other than those that are possessive with an
- unlimited repeat. If there is space in the offset vector, save the current
- subject position in the working slot at the top of the vector. We mustn't
- change the current values of the data slot, because they may be set from a
- previous iteration of this group, and be referred to by a reference inside
- the group. A failure to match might occur after the group has succeeded,
- if something later on doesn't match. For this reason, we need to restore
- the working value and also the values of the final offsets, in case they
- were set by a previous iteration of the same bracket.
-
- If there isn't enough space in the offset vector, treat this as if it were
- a non-capturing bracket. Don't worry about setting the flag for the error
- case here; that is handled in the code for KET. */
+ /* We have a successful match of the whole pattern. Record the result and
+ then do a direct return from the function. If there is space in the offset
+ vector, set any pairs that follow the highest-numbered captured string but
+ are less than the number of capturing groups in the pattern to PCRE2_UNSET.
+ It is documented that this happens. "Gaps" are set to PCRE2_UNSET
+ dynamically. It is only those at the end that need setting here. */
- case OP_CBRA:
- case OP_SCBRA:
- number = GET2(ecode, 1+LINK_SIZE);
- offset = number << 1;
+ mb->end_match_ptr = Feptr; /* Record where we ended */
+ mb->end_offset_top = Foffset_top; /* and how many extracts were taken */
+ mb->mark = Fmark; /* and the last success mark */
+ if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
- if (offset < mb->offset_max)
- {
- save_offset1 = mb->ovector[offset];
- save_offset2 = mb->ovector[offset+1];
- save_offset3 = mb->ovector[mb->offset_end - number];
- save_capture_last = mb->capture_last;
- save_mark = mb->mark;
+ ovector[0] = Fstart_match - mb->start_subject;
+ ovector[1] = Feptr - mb->start_subject;
- mb->ovector[mb->offset_end - number] = eptr - mb->start_subject;
+ /* Set i to the smaller of the sizes of the external and frame ovectors. */
- for (;;)
- {
- if (op >= OP_SBRA) mb->match_function_type |= MATCH_CBEGROUP;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM1);
- if (rrc == MATCH_ONCE) break; /* Backing up through an atomic group */
-
- /* If we backed up to a THEN, check whether it is within the current
- branch by comparing the address of the THEN that is passed back with
- the end of the branch. If it is within the current branch, and the
- branch is one of two or more alternatives (it either starts or ends
- with OP_ALT), we have reached the limit of THEN's action, so convert
- the return code to NOMATCH, which will cause normal backtracking to
- happen from now on. Otherwise, THEN is passed back to an outer
- alternative. This implements Perl's treatment of parenthesized groups,
- where a group not containing | does not affect the current alternative,
- that is, (X) is NOT the same as (X|(*F)). */
-
- if (rrc == MATCH_THEN)
- {
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
+ i = 2 * ((top_bracket + 1 > oveccount)? oveccount : top_bracket + 1);
+ memcpy(ovector + 2, Fovector, (i - 2) * sizeof(PCRE2_SIZE));
+ while (--i >= Foffset_top + 2) ovector[i] = PCRE2_UNSET;
+ return MATCH_MATCH; /* Note: NOT RRETURN */
- /* Anything other than NOMATCH is passed back. */
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->capture_last = save_capture_last;
- ecode += GET(ecode, 1);
- mb->mark = save_mark;
- if (*ecode != OP_ALT) break;
- }
-
- mb->ovector[offset] = save_offset1;
- mb->ovector[offset+1] = save_offset2;
- mb->ovector[mb->offset_end - number] = save_offset3;
-
- /* At this point, rrc will be one of MATCH_ONCE or MATCH_NOMATCH. */
+ /*===================================================================== */
+ /* Match any single character type except newline; have to take care with
+ CRLF newlines and partial matching. */
- RRETURN(rrc);
+ case OP_ANY:
+ if (IS_NEWLINE(Feptr)) RRETURN(MATCH_NOMATCH);
+ if (mb->partial != 0 &&
+ Feptr == mb->end_subject - 1 &&
+ NLBLOCK->nltype == NLTYPE_FIXED &&
+ NLBLOCK->nllen == 2 &&
+ UCHAR21TEST(Feptr) == NLBLOCK->nl[0])
+ {
+ mb->hitend = TRUE;
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
+ /* Fall through */
- /* FALL THROUGH ... Insufficient room for saving captured contents. Treat
- as a non-capturing bracket. */
+ /* Match any single character whatsoever. */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
+ case OP_ALLANY:
+ if (Feptr >= mb->end_subject) /* DO NOT merge the Feptr++ here; it must */
+ { /* not be updated before SCHECK_PARTIAL. */
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ Feptr++;
+#ifdef SUPPORT_UNICODE
+ if (utf) ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
+#endif
+ Fecode++;
+ break;
- /* Non-capturing or atomic group, except for possessive with unlimited
- repeat and ONCE group with no captures. Loop for all the alternatives.
- When we get to the final alternative within the brackets, we used to return
- the result of a recursive call to match() whatever happened so it was
- possible to reduce stack usage by turning this into a tail recursion,
- except in the case of a possibly empty group. However, now that there is
- the possiblity of (*THEN) occurring in the final alternative, this
- optimization is no longer always possible.
+ /* ===================================================================== */
+ /* Match a single code unit, even in UTF mode. This opcode really does
+ match any code unit, even newline. (It really should be called ANYCODEUNIT,
+ of course - the byte name is from pre-16 bit days.) */
- We can optimize if we know there are no (*THEN)s in the pattern; at present
- this is the best that can be done.
+ case OP_ANYBYTE:
+ if (Feptr >= mb->end_subject) /* DO NOT merge the Feptr++ here; it must */
+ { /* not be updated before SCHECK_PARTIAL. */
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ Feptr++;
+ Fecode++;
+ break;
- MATCH_ONCE is returned when the end of an atomic group is successfully
- reached, but subsequent matching fails. It passes back up the tree (causing
- captured values to be reset) until the original atomic group level is
- reached. This is tested by comparing mb->once_target with the start of the
- group. At this point, the return is converted into MATCH_NOMATCH so that
- previous backup points can be taken. */
- case OP_ONCE:
- case OP_BRA:
- case OP_SBRA:
+ /* ===================================================================== */
+ /* Match a single character, casefully */
- for (;;)
+ case OP_CHAR:
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- if (op >= OP_SBRA || op == OP_ONCE)
- mb->match_function_type |= MATCH_CBEGROUP;
-
- /* If this is not a possibly empty group, and there are no (*THEN)s in
- the pattern, and this is the final alternative, optimize as described
- above. */
-
- else if (!mb->hasthen && ecode[GET(ecode, 1)] != OP_ALT)
+ Flength = 1;
+ Fecode++;
+ GETCHARLEN(fc, Fecode, Flength);
+ if (Flength > (PCRE2_SIZE)(mb->end_subject - Feptr))
{
- ecode += PRIV(OP_lengths)[*ecode];
- goto TAIL_RECURSE;
+ CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */
+ RRETURN(MATCH_NOMATCH);
}
-
- /* In all other cases, we have to make another call to match(). */
-
- save_mark = mb->mark;
- save_capture_last = mb->capture_last;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb, eptrb,
- RM2);
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- if (rrc == MATCH_THEN)
+ for (; Flength > 0; Flength--)
{
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
- rrc = MATCH_NOMATCH;
+ if (*Fecode++ != UCHAR21INC(Feptr)) RRETURN(MATCH_NOMATCH);
}
-
- if (rrc != MATCH_NOMATCH)
- {
- if (rrc == MATCH_ONCE)
- {
- PCRE2_SPTR scode = ecode;
- if (*scode != OP_ONCE) /* If not at start, find it */
- {
- while (*scode == OP_ALT) scode += GET(scode, 1);
- scode -= GET(scode, 1);
- }
- if (mb->once_target == scode) rrc = MATCH_NOMATCH;
- }
- RRETURN(rrc);
- }
- ecode += GET(ecode, 1);
- mb->mark = save_mark;
- if (*ecode != OP_ALT) break;
- mb->capture_last = save_capture_last;
}
-
- RRETURN(MATCH_NOMATCH);
-
- /* Handle possessive capturing brackets with an unlimited repeat. We come
- here from BRAZERO with allow_zero set TRUE. The ovector values are
- handled similarly to the normal case above. However, the matching is
- different. The end of these brackets will always be OP_KETRPOS, which
- returns MATCH_KETRPOS without going further in the pattern. By this means
- we can handle the group by iteration rather than recursion, thereby
- reducing the amount of stack needed. If the ovector is too small for
- capturing, treat as non-capturing. */
-
- case OP_CBRAPOS:
- case OP_SCBRAPOS:
- allow_zero = FALSE;
-
- POSSESSIVE_CAPTURE:
- number = GET2(ecode, 1+LINK_SIZE);
- offset = number << 1;
- if (offset >= mb->offset_max) goto POSSESSIVE_NON_CAPTURE;
-
- matched_once = FALSE;
- code_offset = (int)(ecode - mb->start_code);
-
- save_offset1 = mb->ovector[offset];
- save_offset2 = mb->ovector[offset+1];
- save_offset3 = mb->ovector[mb->offset_end - number];
- save_capture_last = mb->capture_last;
-
- /* Each time round the loop, save the current subject position for use
- when the group matches. For MATCH_MATCH, the group has matched, so we
- restart it with a new subject starting position, remembering that we had
- at least one match. For MATCH_NOMATCH, carry on with the alternatives, as
- usual. If we haven't matched any alternatives in any iteration, check to
- see if a previous iteration matched. If so, the group has matched;
- continue from afterwards. Otherwise it has failed; restore the previous
- capture values before returning NOMATCH. */
-
- for (;;)
+ else
+#endif
+ /* Not UTF mode */
{
- mb->ovector[mb->offset_end - number] = eptr - mb->start_subject;
- if (op >= OP_SBRA) mb->match_function_type |= MATCH_CBEGROUP;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM63);
- if (rrc == MATCH_KETRPOS)
+ if (mb->end_subject - Feptr < 1)
{
- offset_top = mb->end_offset_top;
- ecode = mb->start_code + code_offset;
- save_capture_last = mb->capture_last;
- matched_once = TRUE;
- mstart = mb->start_match_ptr; /* In case \K changed it */
- if (eptr == mb->end_match_ptr) /* Matched an empty string */
- {
- do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
- break;
- }
- eptr = mb->end_match_ptr;
- continue;
+ SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */
+ RRETURN(MATCH_NOMATCH);
}
+ if (Fecode[1] != *Feptr++) RRETURN(MATCH_NOMATCH);
+ Fecode += 2;
+ }
+ break;
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- if (rrc == MATCH_THEN)
- {
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->capture_last = save_capture_last;
- ecode += GET(ecode, 1);
- if (*ecode != OP_ALT) break;
- }
+ /* ===================================================================== */
+ /* Match a single character, caselessly. If we are at the end of the
+ subject, give up immediately. We get here only when the pattern character
+ has at most one other case. Characters with more than two cases are coded
+ as OP_PROP with the pseudo-property PT_CLIST. */
- if (!matched_once)
+ case OP_CHARI:
+ if (Feptr >= mb->end_subject)
{
- mb->ovector[offset] = save_offset1;
- mb->ovector[offset+1] = save_offset2;
- mb->ovector[mb->offset_end - number] = save_offset3;
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
- if (allow_zero || matched_once)
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- ecode += 1 + LINK_SIZE;
- break;
- }
- RRETURN(MATCH_NOMATCH);
-
- /* Non-capturing possessive bracket with unlimited repeat. We come here
- from BRAZERO with allow_zero = TRUE. The code is similar to the above,
- without the capturing complication. It is written out separately for speed
- and cleanliness. */
-
- case OP_BRAPOS:
- case OP_SBRAPOS:
- allow_zero = FALSE;
+ Flength = 1;
+ Fecode++;
+ GETCHARLEN(fc, Fecode, Flength);
- POSSESSIVE_NON_CAPTURE:
- matched_once = FALSE;
- code_offset = (int)(ecode - mb->start_code);
- save_capture_last = mb->capture_last;
+ /* If the pattern character's value is < 128, we know that its other case
+ (if any) is also < 128 (and therefore only one code unit long in all
+ code-unit widths), so we can use the fast lookup table. We checked above
+ that there is at least one character left in the subject. */
- for (;;)
- {
- if (op >= OP_SBRA) mb->match_function_type |= MATCH_CBEGROUP;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, mb,
- eptrb, RM48);
- if (rrc == MATCH_KETRPOS)
+ if (fc < 128)
{
- offset_top = mb->end_offset_top;
- ecode = mb->start_code + code_offset;
- matched_once = TRUE;
- mstart = mb->start_match_ptr; /* In case \K reset it */
- if (eptr == mb->end_match_ptr) /* Matched an empty string */
- {
- do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
- break;
- }
- eptr = mb->end_match_ptr;
- continue;
+ uint32_t cc = UCHAR21(Feptr);
+ if (mb->lcc[fc] != TABLE_GET(cc, mb->lcc, cc)) RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ Feptr++;
}
- /* See comment in the code for capturing groups above about handling
- THEN. */
+ /* Otherwise we must pick up the subject character and use Unicode
+ property support to test its other case. Note that we cannot use the
+ value of "Flength" to check for sufficient bytes left, because the other
+ case of the character may have more or fewer code units. */
- if (rrc == MATCH_THEN)
+ else
{
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
- rrc = MATCH_NOMATCH;
+ uint32_t dc;
+ GETCHARINC(dc, Feptr);
+ Fecode += Flength;
+ if (dc != fc && dc != UCD_OTHERCASE(fc)) RRETURN(MATCH_NOMATCH);
}
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += GET(ecode, 1);
- if (*ecode != OP_ALT) break;
- mb->capture_last = save_capture_last;
}
+ else
+#endif /* SUPPORT_UNICODE */
- if (matched_once || allow_zero)
+ /* Not UTF mode; use the table for characters < 256. */
{
- ecode += 1 + LINK_SIZE;
- break;
+ if (TABLE_GET(Fecode[1], mb->lcc, Fecode[1])
+ != TABLE_GET(*Feptr, mb->lcc, *Feptr)) RRETURN(MATCH_NOMATCH);
+ Feptr++;
+ Fecode += 2;
}
- RRETURN(MATCH_NOMATCH);
-
- /* Control never reaches here. */
-
- /* Conditional group: compilation checked that there are no more than two
- branches. If the condition is false, skipping the first branch takes us
- past the end of the item if there is only one branch, but that's exactly
- what we want. */
-
- case OP_COND:
- case OP_SCOND:
-
- /* The variable codelink will be added to ecode when the condition is
- false, to get to the second branch. Setting it to the offset to the ALT
- or KET, then incrementing ecode achieves this effect. We now have ecode
- pointing to the condition or callout. */
+ break;
- codelink = GET(ecode, 1); /* Offset to the second branch */
- ecode += 1 + LINK_SIZE; /* From this opcode */
- /* Because of the way auto-callout works during compile, a callout item is
- inserted between OP_COND and an assertion condition. */
+ /* ===================================================================== */
+ /* Match not a single character. */
- if (*ecode == OP_CALLOUT || *ecode == OP_CALLOUT_STR)
+ case OP_NOT:
+ case OP_NOTI:
+ if (Feptr >= mb->end_subject)
{
- unsigned int callout_length = (*ecode == OP_CALLOUT)
- ? PRIV(OP_lengths)[OP_CALLOUT] : GET(ecode, 1 + 2*LINK_SIZE);
-
- if (mb->callout != NULL)
- {
- pcre2_callout_block cb;
- cb.version = 1;
- cb.capture_top = offset_top/2;
- cb.capture_last = mb->capture_last & CAPLMASK;
- cb.offset_vector = mb->ovector;
- cb.mark = mb->nomatch_mark;
- cb.subject = mb->start_subject;
- cb.subject_length = (PCRE2_SIZE)(mb->end_subject - mb->start_subject);
- cb.start_match = (PCRE2_SIZE)(mstart - mb->start_subject);
- cb.current_position = (PCRE2_SIZE)(eptr - mb->start_subject);
- cb.pattern_position = GET(ecode, 1);
- cb.next_item_length = GET(ecode, 1 + LINK_SIZE);
-
- if (*ecode == OP_CALLOUT)
- {
- cb.callout_number = ecode[1 + 2*LINK_SIZE];
- cb.callout_string_offset = 0;
- cb.callout_string = NULL;
- cb.callout_string_length = 0;
- }
- else
- {
- cb.callout_number = 0;
- cb.callout_string_offset = GET(ecode, 1 + 3*LINK_SIZE);
- cb.callout_string = ecode + (1 + 4*LINK_SIZE) + 1;
- cb.callout_string_length =
- callout_length - (1 + 4*LINK_SIZE) - 2;
- }
-
- if ((rrc = mb->callout(&cb, mb->callout_data)) > 0)
- RRETURN(MATCH_NOMATCH);
- if (rrc < 0) RRETURN(rrc);
- }
-
- /* Advance ecode past the callout, so it now points to the condition. We
- must adjust codelink so that the value of ecode+codelink is unchanged. */
-
- ecode += callout_length;
- codelink -= callout_length;
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
-
- /* Test the various possible conditions */
-
- condition = FALSE;
- switch(condcode = *ecode)
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- case OP_RREF: /* Numbered group recursion test */
- if (mb->recursive != NULL) /* Not recursing => FALSE */
- {
- uint32_t recno = GET2(ecode, 1); /* Recursion group number*/
- condition = (recno == RREF_ANY || recno == mb->recursive->group_num);
- }
- break;
-
- case OP_DNRREF: /* Duplicate named group recursion test */
- if (mb->recursive != NULL)
- {
- int count = GET2(ecode, 1 + IMM2_SIZE);
- PCRE2_SPTR slot = mb->name_table + GET2(ecode, 1) * mb->name_entry_size;
- while (count-- > 0)
- {
- uint32_t recno = GET2(slot, 0);
- condition = recno == mb->recursive->group_num;
- if (condition) break;
- slot += mb->name_entry_size;
- }
- }
- break;
-
- case OP_CREF: /* Numbered group used test */
- offset = GET2(ecode, 1) << 1; /* Doubled ref number */
- condition = offset < offset_top &&
- mb->ovector[offset] != PCRE2_UNSET;
- break;
-
- case OP_DNCREF: /* Duplicate named group used test */
- {
- int count = GET2(ecode, 1 + IMM2_SIZE);
- PCRE2_SPTR slot = mb->name_table + GET2(ecode, 1) * mb->name_entry_size;
- while (count-- > 0)
- {
- offset = GET2(slot, 0) << 1;
- condition = offset < offset_top &&
- mb->ovector[offset] != PCRE2_UNSET;
- if (condition) break;
- slot += mb->name_entry_size;
- }
- }
- break;
-
- case OP_FALSE:
- case OP_FAIL: /* The assertion (?!) becomes OP_FAIL */
- break;
-
- case OP_TRUE:
- condition = TRUE;
- break;
-
- /* The condition is an assertion. Call match() to evaluate it - setting
- the MATCH_CONDASSERT bit in mb->match_function_type causes it to stop at
- the end of an assertion. */
-
- default:
- mb->match_function_type |= MATCH_CONDASSERT;
- RMATCH(eptr, ecode, offset_top, mb, NULL, RM3);
- if (rrc == MATCH_MATCH)
- {
- if (mb->end_offset_top > offset_top)
- offset_top = mb->end_offset_top; /* Captures may have happened */
- condition = TRUE;
-
- /* Advance ecode past the assertion to the start of the first branch,
- but adjust it so that the general choosing code below works. If the
- assertion has a quantifier that allows zero repeats we must skip over
- the BRAZERO. This is a lunatic thing to do, but somebody did! */
-
- if (*ecode == OP_BRAZERO) ecode++;
- ecode += GET(ecode, 1);
- while (*ecode == OP_ALT) ecode += GET(ecode, 1);
- ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode];
- }
-
- /* PCRE doesn't allow the effect of (*THEN) to escape beyond an
- assertion; it is therefore treated as NOMATCH. Any other return is an
- error. */
-
- else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN)
+ uint32_t ch;
+ Fecode++;
+ GETCHARINC(ch, Fecode);
+ GETCHARINC(fc, Feptr);
+ if (ch == fc)
{
- RRETURN(rrc); /* Need braces because of following else */
+ RRETURN(MATCH_NOMATCH); /* Caseful match */
}
- break;
- }
-
- /* Choose branch according to the condition */
-
- ecode += condition? PRIV(OP_lengths)[condcode] : codelink;
-
- /* We are now at the branch that is to be obeyed. As there is only one, we
- can use tail recursion to avoid using another stack frame, except when
- there is unlimited repeat of a possibly empty group. In the latter case, a
- recursive call to match() is always required, unless the second alternative
- doesn't exist, in which case we can just plough on. Note that, for
- compatibility with Perl, the | in a conditional group is NOT treated as
- creating two alternatives. If a THEN is encountered in the branch, it
- propagates out to the enclosing alternative (unless nested in a deeper set
- of alternatives, of course). */
-
- if (condition || ecode[-(1+LINK_SIZE)] == OP_ALT)
- {
- if (op != OP_SCOND)
+ else if (Fop == OP_NOTI) /* If caseless */
{
- goto TAIL_RECURSE;
+ if (ch > 127)
+ ch = UCD_OTHERCASE(ch);
+ else
+ ch = TABLE_GET(ch, mb->fcc, ch);
+ if (ch == fc) RRETURN(MATCH_NOMATCH);
}
-
- mb->match_function_type |= MATCH_CBEGROUP;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM49);
- RRETURN(rrc);
}
-
- /* Condition false & no alternative; continue after the group. */
-
else
+#endif /* SUPPORT_UNICODE */
{
+ uint32_t ch = Fecode[1];
+ fc = *Feptr++;
+ if (ch == fc || (Fop == OP_NOTI && TABLE_GET(ch, mb->fcc, ch) == fc))
+ RRETURN(MATCH_NOMATCH);
+ Fecode += 2;
}
break;
- /* Before OP_ACCEPT there may be any number of OP_CLOSE opcodes,
- to close any currently open capturing brackets. */
-
- case OP_CLOSE:
- number = GET2(ecode, 1); /* Must be less than 65536 */
- offset = number << 1;
- mb->capture_last = (mb->capture_last & OVFLMASK) | number;
- if (offset >= mb->offset_max) mb->capture_last |= OVFLBIT; else
- {
- mb->ovector[offset] =
- mb->ovector[mb->offset_end - number];
- mb->ovector[offset+1] = eptr - mb->start_subject;
-
- /* If this group is at or above the current highwater mark, ensure that
- any groups between the current high water mark and this group are marked
- unset and then update the high water mark. */
-
- if (offset >= offset_top)
- {
- register PCRE2_SIZE *iptr = mb->ovector + offset_top;
- register PCRE2_SIZE *iend = mb->ovector + offset;
- while (iptr < iend) *iptr++ = PCRE2_UNSET;
- offset_top = offset + 2;
- }
- }
- ecode += 1 + IMM2_SIZE;
- break;
-
+ /* ===================================================================== */
+ /* Match a single character repeatedly. */
- /* End of the pattern, either real or forced. In an assertion ACCEPT,
- update the last used pointer. */
+#define Loclength F->temp_size
+#define Lstart_eptr F->temp_sptr[0]
+#define Lcharptr F->temp_sptr[1]
+#define Lmin F->temp_32[0]
+#define Lmax F->temp_32[1]
+#define Lc F->temp_32[2]
+#define Loc F->temp_32[3]
- case OP_ASSERT_ACCEPT:
- if (eptr > mb->last_used_ptr) mb->last_used_ptr = eptr;
+ case OP_EXACT:
+ case OP_EXACTI:
+ Lmin = Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATCHAR;
- case OP_ACCEPT:
- case OP_END:
+ case OP_POSUPTO:
+ case OP_POSUPTOI:
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATCHAR;
- /* If we have matched an empty string, fail if not in an assertion and not
- in a recursion if either PCRE2_NOTEMPTY is set, or if PCRE2_NOTEMPTY_ATSTART
- is set and we have matched at the start of the subject. In both cases,
- backtracking will then try other alternatives, if any. */
+ case OP_UPTO:
+ case OP_UPTOI:
+ reptype = REPTYPE_MAX;
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATCHAR;
- if (eptr == mstart && op != OP_ASSERT_ACCEPT &&
- mb->recursive == NULL &&
- ((mb->moptions & PCRE2_NOTEMPTY) != 0 ||
- ((mb->moptions & PCRE2_NOTEMPTY_ATSTART) != 0 &&
- mstart == mb->start_subject + mb->start_offset)))
- RRETURN(MATCH_NOMATCH);
+ case OP_MINUPTO:
+ case OP_MINUPTOI:
+ reptype = REPTYPE_MIN;
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATCHAR;
- /* Otherwise, we have a match. */
+ case OP_POSSTAR:
+ case OP_POSSTARI:
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = UINT32_MAX;
+ Fecode++;
+ goto REPEATCHAR;
- mb->end_match_ptr = eptr; /* Record where we ended */
- mb->end_offset_top = offset_top; /* and how many extracts were taken */
- mb->start_match_ptr = mstart; /* and the start (\K can modify) */
+ case OP_POSPLUS:
+ case OP_POSPLUSI:
+ reptype = REPTYPE_POS;
+ Lmin = 1;
+ Lmax = UINT32_MAX;
+ Fecode++;
+ goto REPEATCHAR;
- /* For some reason, the macros don't work properly if an expression is
- given as the argument to RRETURN when the heap is in use. */
+ case OP_POSQUERY:
+ case OP_POSQUERYI:
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = 1;
+ Fecode++;
+ goto REPEATCHAR;
- rrc = (op == OP_END)? MATCH_MATCH : MATCH_ACCEPT;
- RRETURN(rrc);
+ case OP_STAR:
+ case OP_STARI:
+ case OP_MINSTAR:
+ case OP_MINSTARI:
+ case OP_PLUS:
+ case OP_PLUSI:
+ case OP_MINPLUS:
+ case OP_MINPLUSI:
+ case OP_QUERY:
+ case OP_QUERYI:
+ case OP_MINQUERY:
+ case OP_MINQUERYI:
+ fc = *Fecode++ - ((Fop < OP_STARI)? OP_STAR : OP_STARI);
+ Lmin = rep_min[fc];
+ Lmax = rep_max[fc];
+ reptype = rep_typ[fc];
- /* Assertion brackets. Check the alternative branches in turn - the
- matching won't pass the KET for an assertion. If any one branch matches,
- the assertion is true. Lookbehind assertions have an OP_REVERSE item at the
- start of each branch to move the current point backwards, so the code at
- this level is identical to the lookahead case. When the assertion is part
- of a condition, we want to return immediately afterwards. The caller of
- this incarnation of the match() function will have set MATCH_CONDASSERT in
- mb->match_function type, and one of these opcodes will be the first opcode
- that is processed. We use a local variable that is preserved over calls to
- match() to remember this case. */
+ /* Common code for all repeated single-character matches. We first check
+ for the minimum number of characters. If the minimum equals the maximum, we
+ are done. Otherwise, if minimizing, check the rest of the pattern for a
+ match; if there isn't one, advance up to the maximum, one character at a
+ time.
- case OP_ASSERT:
- case OP_ASSERTBACK:
- save_mark = mb->mark;
- if ((mb->match_function_type & MATCH_CONDASSERT) != 0)
- {
- condassert = TRUE;
- mb->match_function_type &= ~MATCH_CONDASSERT;
- }
- else condassert = FALSE;
+ If maximizing, advance up to the maximum number of matching characters,
+ until Feptr is past the end of the maximum run. If possessive, we are
+ then done (no backing up). Otherwise, match at this position; anything
+ other than no match is immediately returned. For nomatch, back up one
+ character, unless we are matching \R and the last thing matched was
+ \r\n, in which case, back up two code units until we reach the first
+ optional character position.
- /* Loop for each branch */
+ The various UTF/non-UTF and caseful/caseless cases are handled separately,
+ for speed. */
- do
+ REPEATCHAR:
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, NULL, RM4);
+ Flength = 1;
+ Lcharptr = Fecode;
+ GETCHARLEN(fc, Fecode, Flength);
+ Fecode += Flength;
- /* A match means that the assertion is true; break out of the loop
- that matches its alternatives. */
+ /* Handle multi-code-unit character matching, caseful and caseless. */
- if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)
+ if (Flength > 1)
{
- mstart = mb->start_match_ptr; /* In case \K reset it */
- break;
- }
-
- /* If not matched, restore the previous mark setting. */
-
- mb->mark = save_mark;
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
+ uint32_t othercase;
- if (rrc == MATCH_THEN)
- {
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
+ if (Fop >= OP_STARI && /* Caseless */
+ (othercase = UCD_OTHERCASE(fc)) != fc)
+ Loclength = PRIV(ord2utf)(othercase, Foccu);
+ else Loclength = 0;
- /* Anything other than NOMATCH causes the entire assertion to fail,
- passing back the return code. This includes COMMIT, SKIP, PRUNE and an
- uncaptured THEN, which means they take their normal effect. This
- consistent approach does not always have exactly the same effect as in
- Perl. */
+ for (i = 1; i <= Lmin; i++)
+ {
+ if (Feptr <= mb->end_subject - Flength &&
+ memcmp(Feptr, Lcharptr, CU2BYTES(Flength)) == 0) Feptr += Flength;
+ else if (Loclength > 0 &&
+ Feptr <= mb->end_subject - Loclength &&
+ memcmp(Feptr, Foccu, CU2BYTES(Loclength)) == 0)
+ Feptr += Loclength;
+ else
+ {
+ CHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ }
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += GET(ecode, 1);
- }
- while (*ecode == OP_ALT); /* Continue for next alternative */
+ if (Lmin == Lmax) continue;
- /* If we have tried all the alternative branches, the assertion has
- failed. If not, we broke out after a match. */
+ if (reptype == REPTYPE_MIN)
+ {
+ for (;;)
+ {
+ RMATCH(Fecode, RM202);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr <= mb->end_subject - Flength &&
+ memcmp(Feptr, Lcharptr, CU2BYTES(Flength)) == 0) Feptr += Flength;
+ else if (Loclength > 0 &&
+ Feptr <= mb->end_subject - Loclength &&
+ memcmp(Feptr, Foccu, CU2BYTES(Loclength)) == 0)
+ Feptr += Loclength;
+ else
+ {
+ CHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ }
+ /* Control never gets here */
+ }
- if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH);
+ else /* Maximize */
+ {
+ Lstart_eptr = Feptr;
+ for (i = Lmin; i < Lmax; i++)
+ {
+ if (Feptr <= mb->end_subject - Flength &&
+ memcmp(Feptr, Lcharptr, CU2BYTES(Flength)) == 0)
+ Feptr += Flength;
+ else if (Loclength > 0 &&
+ Feptr <= mb->end_subject - Loclength &&
+ memcmp(Feptr, Foccu, CU2BYTES(Loclength)) == 0)
+ Feptr += Loclength;
+ else
+ {
+ CHECK_PARTIAL();
+ break;
+ }
+ }
- /* If checking an assertion for a condition, return MATCH_MATCH. */
+ /* After \C in UTF mode, Lstart_eptr might be in the middle of a
+ Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't
+ go too far. */
- if (condassert) RRETURN(MATCH_MATCH);
+ if (reptype != REPTYPE_POS) for(;;)
+ {
+ if (Feptr <= Lstart_eptr) break;
+ RMATCH(Fecode, RM203);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Feptr--;
+ BACKCHAR(Feptr);
+ }
+ }
+ break; /* End of repeated wide character handling */
+ }
- /* Continue from after a successful assertion, updating the offsets high
- water mark, since extracts may have been taken during the assertion. */
+ /* Length of UTF character is 1. Put it into the preserved variable and
+ fall through to the non-UTF code. */
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- ecode += 1 + LINK_SIZE;
- offset_top = mb->end_offset_top;
- continue;
+ Lc = fc;
+ }
+ else
+#endif /* SUPPORT_UNICODE */
- /* Negative assertion: all branches must fail to match for the assertion to
- succeed. */
+ /* When not in UTF mode, load a single-code-unit character. Then proceed as
+ above. */
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK_NOT:
- save_mark = mb->mark;
- if ((mb->match_function_type & MATCH_CONDASSERT) != 0)
- {
- condassert = TRUE;
- mb->match_function_type &= ~MATCH_CONDASSERT;
- }
- else condassert = FALSE;
+ Lc = *Fecode++;
- /* Loop for each alternative branch. */
+ /* Caseless comparison */
- do
+ if (Fop >= OP_STARI)
{
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, NULL, RM5);
- mb->mark = save_mark; /* Always restore the mark setting */
+#if PCRE2_CODE_UNIT_WIDTH == 8
+ /* Lc must be < 128 in UTF-8 mode. */
+ Loc = mb->fcc[Lc];
+#else /* 16-bit & 32-bit */
+#ifdef SUPPORT_UNICODE
+ if (utf && Lc > 127) Loc = UCD_OTHERCASE(Lc);
+ else
+#endif /* SUPPORT_UNICODE */
+ Loc = TABLE_GET(Lc, mb->fcc, Lc);
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
- switch(rrc)
+ for (i = 1; i <= Lmin; i++)
{
- case MATCH_MATCH: /* A successful match means */
- case MATCH_ACCEPT: /* the assertion has failed. */
- RRETURN(MATCH_NOMATCH);
-
- case MATCH_NOMATCH: /* Carry on with next branch */
- break;
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- case MATCH_THEN:
- next_ecode = ecode + GET(ecode,1);
- if (mb->start_match_ptr < next_ecode &&
- (*ecode == OP_ALT || *next_ecode == OP_ALT))
+ uint32_t cc; /* Faster than PCRE2_UCHAR */
+ if (Feptr >= mb->end_subject)
{
- rrc = MATCH_NOMATCH;
- break;
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
- /* Otherwise fall through. */
-
- /* COMMIT, SKIP, PRUNE, and an uncaptured THEN cause the whole
- assertion to fail to match, without considering any more alternatives.
- Failing to match means the assertion is true. This is a consistent
- approach, but does not always have the same effect as in Perl. */
-
- case MATCH_COMMIT:
- case MATCH_SKIP:
- case MATCH_SKIP_ARG:
- case MATCH_PRUNE:
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- goto NEG_ASSERT_TRUE; /* Break out of alternation loop */
-
- /* Anything else is an error */
-
- default:
- RRETURN(rrc);
+ cc = UCHAR21TEST(Feptr);
+ if (Lc != cc && Loc != cc) RRETURN(MATCH_NOMATCH);
+ Feptr++;
}
+ if (Lmin == Lmax) continue;
- /* Continue with next branch */
-
- ecode += GET(ecode,1);
- }
- while (*ecode == OP_ALT);
-
- /* All branches in the assertion failed to match. */
-
- NEG_ASSERT_TRUE:
- if (condassert) RRETURN(MATCH_MATCH); /* Condition assertion */
- ecode += 1 + LINK_SIZE; /* Continue with current branch */
- continue;
-
- /* Move the subject pointer back. This occurs only at the start of
- each branch of a lookbehind assertion. If we are too close to the start to
- move back, this match function fails. When working with UTF-8 we move
- back a number of characters, not bytes. */
-
- case OP_REVERSE:
- i = GET(ecode, 1);
-#ifdef SUPPORT_UNICODE
- if (utf)
- {
- while (i-- > 0)
+ if (reptype == REPTYPE_MIN)
{
- if (eptr <= mb->start_subject) RRETURN(MATCH_NOMATCH);
- eptr--;
- BACKCHAR(eptr);
+ for (;;)
+ {
+ uint32_t cc; /* Faster than PCRE2_UCHAR */
+ RMATCH(Fecode, RM25);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ cc = UCHAR21TEST(Feptr);
+ if (Lc != cc && Loc != cc) RRETURN(MATCH_NOMATCH);
+ Feptr++;
+ }
+ /* Control never gets here */
}
- }
- else
-#endif
- /* No UTF-8 support, or not in UTF-8 mode: count is byte count */
-
- {
- if (i > eptr - mb->start_subject) RRETURN(MATCH_NOMATCH);
- eptr -= i;
- }
-
- /* Save the earliest consulted character, then skip to next op code */
-
- if (eptr < mb->start_used_ptr) mb->start_used_ptr = eptr;
- ecode += 1 + LINK_SIZE;
- break;
-
- /* The callout item calls an external function, if one is provided, passing
- details of the match so far. This is mainly for debugging, though the
- function is able to force a failure. */
-
- case OP_CALLOUT:
- case OP_CALLOUT_STR:
- {
- unsigned int callout_length = (*ecode == OP_CALLOUT)
- ? PRIV(OP_lengths)[OP_CALLOUT] : GET(ecode, 1 + 2*LINK_SIZE);
-
- if (mb->callout != NULL)
+ else /* Maximize */
{
- pcre2_callout_block cb;
- cb.version = 1;
- cb.callout_number = ecode[LINK_SIZE + 1];
- cb.capture_top = offset_top/2;
- cb.capture_last = mb->capture_last & CAPLMASK;
- cb.offset_vector = mb->ovector;
- cb.mark = mb->nomatch_mark;
- cb.subject = mb->start_subject;
- cb.subject_length = (PCRE2_SIZE)(mb->end_subject - mb->start_subject);
- cb.start_match = (PCRE2_SIZE)(mstart - mb->start_subject);
- cb.current_position = (PCRE2_SIZE)(eptr - mb->start_subject);
- cb.pattern_position = GET(ecode, 1);
- cb.next_item_length = GET(ecode, 1 + LINK_SIZE);
-
- if (*ecode == OP_CALLOUT)
+ Lstart_eptr = Feptr;
+ for (i = Lmin; i < Lmax; i++)
{
- cb.callout_number = ecode[1 + 2*LINK_SIZE];
- cb.callout_string_offset = 0;
- cb.callout_string = NULL;
- cb.callout_string_length = 0;
+ uint32_t cc; /* Faster than PCRE2_UCHAR */
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ break;
+ }
+ cc = UCHAR21TEST(Feptr);
+ if (Lc != cc && Loc != cc) break;
+ Feptr++;
}
- else
+ if (reptype != REPTYPE_POS) for (;;)
{
- cb.callout_number = 0;
- cb.callout_string_offset = GET(ecode, 1 + 3*LINK_SIZE);
- cb.callout_string = ecode + (1 + 4*LINK_SIZE) + 1;
- cb.callout_string_length =
- callout_length - (1 + 4*LINK_SIZE) - 2;
+ if (Feptr == Lstart_eptr) break;
+ RMATCH(Fecode, RM26);
+ Feptr--;
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
}
-
- if ((rrc = mb->callout(&cb, mb->callout_data)) > 0)
- RRETURN(MATCH_NOMATCH);
- if (rrc < 0) RRETURN(rrc);
}
- ecode += callout_length;
}
- break;
-
- /* Recursion either matches the current regex, or some subexpression. The
- offset data is the offset to the starting bracket from the start of the
- whole pattern. (This is so that it works from duplicated subpatterns.)
-
- The state of the capturing groups is preserved over recursion, and
- re-instated afterwards. We don't know how many are started and not yet
- finished (offset_top records the completed total) so we just have to save
- all the potential data. There may be up to 65535 such values, which is too
- large to put on the stack, but using malloc for small numbers seems
- expensive. As a compromise, the stack is used when there are no more than
- OP_RECURSE_STACK_SAVE_MAX values to store; otherwise malloc is used.
- There are also other values that have to be saved. We use a chained
- sequence of blocks that actually live on the stack. Thanks to Robin Houston
- for the original version of this logic. It has, however, been hacked around
- a lot, so he is not to blame for the current way it works. */
+ /* Caseful comparisons (includes all multi-byte characters) */
- case OP_RECURSE:
+ else
{
- ovecsave_frame *fr;
- recursion_info *ri;
- uint32_t recno;
-
- callpat = mb->start_code + GET(ecode, 1);
- recno = (callpat == mb->start_code)? 0 : GET2(callpat, 1 + LINK_SIZE);
-
- /* Check for repeating a pattern recursion without advancing the subject
- pointer. This should catch convoluted mutual recursions. (Some simple
- cases are caught at compile time.) */
-
- for (ri = mb->recursive; ri != NULL; ri = ri->prevrec)
- if (recno == ri->group_num && eptr == ri->subject_position)
- RRETURN(PCRE2_ERROR_RECURSELOOP);
-
- /* Add to "recursing stack" */
-
- new_recursive.group_num = recno;
- new_recursive.saved_capture_last = mb->capture_last;
- new_recursive.subject_position = eptr;
- new_recursive.prevrec = mb->recursive;
- mb->recursive = &new_recursive;
-
- /* Where to continue from afterwards */
-
- ecode += 1 + LINK_SIZE;
-
- /* When we are using the system stack for match() recursion we can call a
- function that uses the system stack for preserving the ovector while
- processing the pattern recursion, but only if the ovector is small
- enough. */
-
-#ifndef HEAP_MATCH_RECURSE
- if (mb->offset_end <= OP_RECURSE_STACK_SAVE_MAX)
+ for (i = 1; i <= Lmin; i++)
{
- rrc = op_recurse_ovecsave(eptr, callpat, mstart, offset_top, mb,
- eptrb, rdepth);
- mb->recursive = new_recursive.prevrec;
- if (rrc != MATCH_MATCH && rrc != MATCH_ACCEPT) RRETURN(rrc);
-
- /* Set where we got to in the subject, and reset the start, in case
- it was changed by \K. This *is* propagated back out of a recursion,
- for Perl compatibility. */
-
- eptr = mb->end_match_ptr;
- mstart = mb->start_match_ptr;
- break; /* End of processing OP_RECURSE */
- }
-#endif
- /* If the ovector is too big, or if we are using the heap for match()
- recursion, we have to use the heap for saving the ovector. Used ovecsave
- frames are kept on a chain and re-used. This makes a small improvement in
- execution time on Linux. */
-
- if (mb->ovecsave_chain != NULL)
- {
- new_recursive.ovec_save = mb->ovecsave_chain->saved_ovec;
- mb->ovecsave_chain = mb->ovecsave_chain->next;
- }
- else
- {
- fr = (ovecsave_frame *)(mb->memctl.malloc(sizeof(ovecsave_frame *) +
- mb->offset_end * sizeof(PCRE2_SIZE), mb->memctl.memory_data));
- if (fr == NULL) RRETURN(PCRE2_ERROR_NOMEMORY);
- new_recursive.ovec_save = fr->saved_ovec;
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (Lc != UCHAR21INCTEST(Feptr)) RRETURN(MATCH_NOMATCH);
}
- memcpy(new_recursive.ovec_save, mb->ovector,
- mb->offset_end * sizeof(PCRE2_SIZE));
-
- /* Do the recursion. After processing each alternative, restore the
- ovector data and the last captured value. This code has the same overall
- logic as the code in the op_recurse_ovecsave() function, but is adapted
- to use RMATCH/RRETURN and to release the heap block containing the saved
- ovector. */
+ if (Lmin == Lmax) continue;
- cbegroup = (*callpat >= OP_SBRA);
- do
+ if (reptype == REPTYPE_MIN)
{
- if (cbegroup) mb->match_function_type |= MATCH_CBEGROUP;
- RMATCH(eptr, callpat + PRIV(OP_lengths)[*callpat], offset_top,
- mb, eptrb, RM6);
- memcpy(mb->ovector, new_recursive.ovec_save,
- mb->offset_end * sizeof(PCRE2_SIZE));
- mb->capture_last = new_recursive.saved_capture_last;
- mb->recursive = new_recursive.prevrec;
-
- if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)
+ for (;;)
{
- fr = (ovecsave_frame *)
- ((uint8_t *)new_recursive.ovec_save - sizeof(ovecsave_frame *));
- fr->next = mb->ovecsave_chain;
- mb->ovecsave_chain = fr;
-
- /* Set where we got to in the subject, and reset the start, in case
- it was changed by \K. This *is* propagated back out of a recursion,
- for Perl compatibility. */
-
- eptr = mb->end_match_ptr;
- mstart = mb->start_match_ptr;
- goto RECURSION_MATCHED; /* Exit loop; end processing */
+ RMATCH(Fecode, RM27);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (Lc != UCHAR21INCTEST(Feptr)) RRETURN(MATCH_NOMATCH);
}
+ /* Control never gets here */
+ }
+ else /* Maximize */
+ {
+ Lstart_eptr = Feptr;
+ for (i = Lmin; i < Lmax; i++)
+ {
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ break;
+ }
- /* PCRE does not allow THEN, SKIP, PRUNE or COMMIT to escape beyond a
- recursion; they cause a NOMATCH for the entire recursion. These codes
- are defined in a range that can be tested for. */
+ if (Lc != UCHAR21TEST(Feptr)) break;
+ Feptr++;
+ }
- if (rrc >= MATCH_BACKTRACK_MIN && rrc <= MATCH_BACKTRACK_MAX)
+ if (reptype != REPTYPE_POS) for (;;)
{
- rrc = MATCH_NOMATCH;
- goto RECURSION_RETURN;
+ if (Feptr <= Lstart_eptr) break;
+ RMATCH(Fecode, RM28);
+ Feptr--;
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
}
-
- /* Any return code other than NOMATCH is an error. */
-
- if (rrc != MATCH_NOMATCH) goto RECURSION_RETURN;
- mb->recursive = &new_recursive;
- callpat += GET(callpat, 1);
}
- while (*callpat == OP_ALT);
-
- RECURSION_RETURN:
- mb->recursive = new_recursive.prevrec;
- fr = (ovecsave_frame *)
- ((uint8_t *)new_recursive.ovec_save - sizeof(ovecsave_frame *));
- fr->next = mb->ovecsave_chain;
- mb->ovecsave_chain = fr;
- RRETURN(rrc);
}
-
- RECURSION_MATCHED:
break;
- /* An alternation is the end of a branch; scan along to find the end of the
- bracketed group and go to there. */
+#undef Loclength
+#undef Lstart_eptr
+#undef Lcharptr
+#undef Lmin
+#undef Lmax
+#undef Lc
+#undef Loc
- case OP_ALT:
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- break;
- /* BRAZERO, BRAMINZERO and SKIPZERO occur just before a bracket group,
- indicating that it may occur zero times. It may repeat infinitely, or not
- at all - i.e. it could be ()* or ()? or even (){0} in the pattern. Brackets
- with fixed upper repeat limits are compiled as a number of copies, with the
- optional ones preceded by BRAZERO or BRAMINZERO. */
+ /* ===================================================================== */
+ /* Match a negated single one-byte character repeatedly. This is almost a
+ repeat of the code for a repeated single character, but I haven't found a
+ nice way of commoning these up that doesn't require a test of the
+ positive/negative option for each character match. Maybe that wouldn't add
+ very much to the time taken, but character matching *is* what this is all
+ about... */
- case OP_BRAZERO:
- next_ecode = ecode + 1;
- RMATCH(eptr, next_ecode, offset_top, mb, eptrb, RM10);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- do next_ecode += GET(next_ecode, 1); while (*next_ecode == OP_ALT);
- ecode = next_ecode + 1 + LINK_SIZE;
- break;
+#define Lstart_eptr F->temp_sptr[0]
+#define Lmin F->temp_32[0]
+#define Lmax F->temp_32[1]
+#define Lc F->temp_32[2]
+#define Loc F->temp_32[3]
- case OP_BRAMINZERO:
- next_ecode = ecode + 1;
- do next_ecode += GET(next_ecode, 1); while (*next_ecode == OP_ALT);
- RMATCH(eptr, next_ecode + 1+LINK_SIZE, offset_top, mb, eptrb, RM11);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode++;
- break;
+ case OP_NOTEXACT:
+ case OP_NOTEXACTI:
+ Lmin = Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATNOTCHAR;
- case OP_SKIPZERO:
- next_ecode = ecode+1;
- do next_ecode += GET(next_ecode,1); while (*next_ecode == OP_ALT);
- ecode = next_ecode + 1 + LINK_SIZE;
- break;
+ case OP_NOTUPTO:
+ case OP_NOTUPTOI:
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ reptype = REPTYPE_MAX;
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATNOTCHAR;
- /* BRAPOSZERO occurs before a possessive bracket group. Don't do anything
- here; just jump to the group, with allow_zero set TRUE. */
+ case OP_NOTMINUPTO:
+ case OP_NOTMINUPTOI:
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ reptype = REPTYPE_MIN;
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATNOTCHAR;
- case OP_BRAPOSZERO:
- op = *(++ecode);
- allow_zero = TRUE;
- if (op == OP_CBRAPOS || op == OP_SCBRAPOS) goto POSSESSIVE_CAPTURE;
- goto POSSESSIVE_NON_CAPTURE;
+ case OP_NOTPOSSTAR:
+ case OP_NOTPOSSTARI:
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = UINT32_MAX;
+ Fecode++;
+ goto REPEATNOTCHAR;
- /* End of a group, repeated or non-repeating. */
+ case OP_NOTPOSPLUS:
+ case OP_NOTPOSPLUSI:
+ reptype = REPTYPE_POS;
+ Lmin = 1;
+ Lmax = UINT32_MAX;
+ Fecode++;
+ goto REPEATNOTCHAR;
- case OP_KET:
- case OP_KETRMIN:
- case OP_KETRMAX:
- case OP_KETRPOS:
- prev = ecode - GET(ecode, 1);
+ case OP_NOTPOSQUERY:
+ case OP_NOTPOSQUERYI:
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = 1;
+ Fecode++;
+ goto REPEATNOTCHAR;
- /* If this was a group that remembered the subject start, in order to break
- infinite repeats of empty string matches, retrieve the subject start from
- the chain. Otherwise, set it NULL. */
+ case OP_NOTPOSUPTO:
+ case OP_NOTPOSUPTOI:
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
+ goto REPEATNOTCHAR;
- if (*prev >= OP_SBRA || *prev == OP_ONCE)
- {
- saved_eptr = eptrb->epb_saved_eptr; /* Value at start of group */
- eptrb = eptrb->epb_prev; /* Backup to previous group */
- }
- else saved_eptr = NULL;
+ case OP_NOTSTAR:
+ case OP_NOTSTARI:
+ case OP_NOTMINSTAR:
+ case OP_NOTMINSTARI:
+ case OP_NOTPLUS:
+ case OP_NOTPLUSI:
+ case OP_NOTMINPLUS:
+ case OP_NOTMINPLUSI:
+ case OP_NOTQUERY:
+ case OP_NOTQUERYI:
+ case OP_NOTMINQUERY:
+ case OP_NOTMINQUERYI:
+ fc = *Fecode++ - ((Fop >= OP_NOTSTARI)? OP_NOTSTARI: OP_NOTSTAR);
+ Lmin = rep_min[fc];
+ Lmax = rep_max[fc];
+ reptype = rep_typ[fc];
- /* If we are at the end of an assertion group or a non-capturing atomic
- group, stop matching and return MATCH_MATCH, but record the current high
- water mark for use by positive assertions. We also need to record the match
- start in case it was changed by \K. */
+ /* Common code for all repeated single-character non-matches. */
- if ((*prev >= OP_ASSERT && *prev <= OP_ASSERTBACK_NOT) ||
- *prev == OP_ONCE_NC)
- {
- mb->end_match_ptr = eptr; /* For ONCE_NC */
- mb->end_offset_top = offset_top;
- mb->start_match_ptr = mstart;
- if (eptr > mb->last_used_ptr) mb->last_used_ptr = eptr;
- RRETURN(MATCH_MATCH); /* Sets mb->mark */
- }
+ REPEATNOTCHAR:
+ GETCHARINCTEST(Lc, Fecode);
- /* For capturing groups we have to check the group number back at the start
- and if necessary complete handling an extraction by setting the offsets and
- bumping the high water mark. Whole-pattern recursion is coded as a recurse
- into group 0, so it won't be picked up here. Instead, we catch it when the
- OP_END is reached. Other recursion is handled here. We just have to record
- the current subject position and start match pointer and give a MATCH
- return. */
+ /* The code is duplicated for the caseless and caseful cases, for speed,
+ since matching characters is likely to be quite common. First, ensure the
+ minimum number of matches are present. If Lmin = Lmax, we are done.
+ Otherwise, if minimizing, keep trying the rest of the expression and
+ advancing one matching character if failing, up to the maximum.
+ Alternatively, if maximizing, find the maximum number of characters and
+ work backwards. */
- if (*prev == OP_CBRA || *prev == OP_SCBRA ||
- *prev == OP_CBRAPOS || *prev == OP_SCBRAPOS)
+ if (Fop >= OP_NOTSTARI) /* Caseless */
{
- number = GET2(prev, 1+LINK_SIZE);
- offset = number << 1;
-
- /* Handle a recursively called group. */
-
- if (mb->recursive != NULL && mb->recursive->group_num == number)
- {
- mb->end_match_ptr = eptr;
- mb->start_match_ptr = mstart;
- if (eptr > mb->last_used_ptr) mb->last_used_ptr = eptr;
- RRETURN(MATCH_MATCH);
- }
+#ifdef SUPPORT_UNICODE
+ if (utf && Lc > 127)
+ Loc = UCD_OTHERCASE(Lc);
+ else
+#endif /* SUPPORT_UNICODE */
- /* Deal with capturing */
+ Loc = TABLE_GET(Lc, mb->fcc, Lc); /* Other case from table */
- mb->capture_last = (mb->capture_last & OVFLMASK) | number;
- if (offset >= mb->offset_max) mb->capture_last |= OVFLBIT; else
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- /* If offset is greater than offset_top, it means that we are
- "skipping" a capturing group, and that group's offsets must be marked
- unset. In earlier versions of PCRE, all the offsets were unset at the
- start of matching, but this doesn't work because atomic groups and
- assertions can cause a value to be set that should later be unset.
- Example: matching /(?>(a))b|(a)c/ against "ac". This sets group 1 as
- part of the atomic group, but this is not on the final matching path,
- so must be unset when 2 is set. (If there is no group 2, there is no
- problem, because offset_top will then be 2, indicating no capture.) */
-
- if (offset > offset_top)
+ uint32_t d;
+ for (i = 1; i <= Lmin; i++)
{
- register PCRE2_SIZE *iptr = mb->ovector + offset_top;
- register PCRE2_SIZE *iend = mb->ovector + offset;
- while (iptr < iend) *iptr++ = PCRE2_UNSET;
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ GETCHARINC(d, Feptr);
+ if (Lc == d || Loc == d) RRETURN(MATCH_NOMATCH);
}
-
- /* Now make the extraction */
-
- mb->ovector[offset] = mb->ovector[mb->offset_end - number];
- mb->ovector[offset+1] = eptr - mb->start_subject;
- if (offset_top <= offset) offset_top = offset + 2;
- }
- }
-
- /* OP_KETRPOS is a possessive repeating ket. Remember the current position,
- and return the MATCH_KETRPOS. This makes it possible to do the repeats one
- at a time from the outer level, thus saving stack. This must precede the
- empty string test - in this case that test is done at the outer level. */
-
- if (*ecode == OP_KETRPOS)
- {
- mb->start_match_ptr = mstart; /* In case \K reset it */
- mb->end_match_ptr = eptr;
- mb->end_offset_top = offset_top;
- if (eptr > mb->last_used_ptr) mb->last_used_ptr = eptr;
- RRETURN(MATCH_KETRPOS);
- }
-
- /* For an ordinary non-repeating ket, just continue at this level. This
- also happens for a repeating ket if no characters were matched in the
- group. This is the forcible breaking of infinite loops as implemented in
- Perl 5.005. For a non-repeating atomic group that includes captures,
- establish a backup point by processing the rest of the pattern at a lower
- level. If this results in a NOMATCH return, pass MATCH_ONCE back to the
- original OP_ONCE level, thereby bypassing intermediate backup points, but
- resetting any captures that happened along the way. */
-
- if (*ecode == OP_KET || eptr == saved_eptr)
- {
- if (*prev == OP_ONCE)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, eptrb, RM12);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->once_target = prev; /* Level at which to change to MATCH_NOMATCH */
- RRETURN(MATCH_ONCE);
- }
- ecode += 1 + LINK_SIZE; /* Carry on at this level */
- break;
- }
-
- /* The normal repeating kets try the rest of the pattern or restart from
- the preceding bracket, in the appropriate order. In the second case, we can
- use tail recursion to avoid using another stack frame, unless we have an
- an atomic group or an unlimited repeat of a group that can match an empty
- string. */
-
- if (*ecode == OP_KETRMIN)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, eptrb, RM7);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (*prev == OP_ONCE)
- {
- RMATCH(eptr, prev, offset_top, mb, eptrb, RM8);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->once_target = prev; /* Level at which to change to MATCH_NOMATCH */
- RRETURN(MATCH_ONCE);
- }
- if (*prev >= OP_SBRA) /* Could match an empty string */
- {
- RMATCH(eptr, prev, offset_top, mb, eptrb, RM50);
- RRETURN(rrc);
- }
- ecode = prev;
- goto TAIL_RECURSE;
- }
- else /* OP_KETRMAX */
- {
- RMATCH(eptr, prev, offset_top, mb, eptrb, RM13);
- if (rrc == MATCH_ONCE && mb->once_target == prev) rrc = MATCH_NOMATCH;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (*prev == OP_ONCE)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, mb, eptrb, RM9);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- mb->once_target = prev;
- RRETURN(MATCH_ONCE);
}
- ecode += 1 + LINK_SIZE;
- goto TAIL_RECURSE;
- }
- /* Control never gets here */
-
- /* Not multiline mode: start of subject assertion, unless notbol. */
-
- case OP_CIRC:
- if ((mb->moptions & PCRE2_NOTBOL) != 0 && eptr == mb->start_subject)
- RRETURN(MATCH_NOMATCH);
-
- /* Start of subject assertion */
-
- case OP_SOD:
- if (eptr != mb->start_subject) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Multiline mode: start of subject unless notbol, or after any newline
- except for one at the very end, unless PCRE2_ALT_CIRCUMFLEX is set. */
-
- case OP_CIRCM:
- if ((mb->moptions & PCRE2_NOTBOL) != 0 && eptr == mb->start_subject)
- RRETURN(MATCH_NOMATCH);
- if (eptr != mb->start_subject &&
- ((eptr == mb->end_subject &&
- (mb->poptions & PCRE2_ALT_CIRCUMFLEX) == 0) ||
- !WAS_NEWLINE(eptr)))
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Start of match assertion */
-
- case OP_SOM:
- if (eptr != mb->start_subject + mb->start_offset) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Reset the start of match point */
-
- case OP_SET_SOM:
- mstart = eptr;
- ecode++;
- break;
-
- /* Multiline mode: assert before any newline, or before end of subject
- unless noteol is set. */
+ else
+#endif /* SUPPORT_UNICODE */
- case OP_DOLLM:
- if (eptr < mb->end_subject)
- {
- if (!IS_NEWLINE(eptr))
+ /* Not UTF mode */
{
- if (mb->partial != 0 &&
- eptr + 1 >= mb->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21TEST(eptr) == NLBLOCK->nl[0])
+ for (i = 1; i <= Lmin; i++)
{
- mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (Lc == *Feptr || Loc == *Feptr) RRETURN(MATCH_NOMATCH);
+ Feptr++;
}
- RRETURN(MATCH_NOMATCH);
}
- }
- else
- {
- if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH);
- SCHECK_PARTIAL();
- }
- ecode++;
- break;
-
- /* Not multiline mode: assert before a terminating newline or before end of
- subject unless noteol is set. */
-
- case OP_DOLL:
- if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH);
- if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS;
-
- /* ... else fall through for endonly */
-
- /* End of subject assertion (\z) */
- case OP_EOD:
- if (eptr < mb->end_subject) RRETURN(MATCH_NOMATCH);
- SCHECK_PARTIAL();
- ecode++;
- break;
+ if (Lmin == Lmax) continue; /* Finished for exact count */
- /* End of subject or ending \n assertion (\Z) */
-
- case OP_EODN:
- ASSERT_NL_OR_EOS:
- if (eptr < mb->end_subject &&
- (!IS_NEWLINE(eptr) || eptr != mb->end_subject - mb->nllen))
- {
- if (mb->partial != 0 &&
- eptr + 1 >= mb->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21TEST(eptr) == NLBLOCK->nl[0])
+ if (reptype == REPTYPE_MIN)
{
- mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
- }
- RRETURN(MATCH_NOMATCH);
- }
-
- /* Either at end of string or \n before end. */
-
- SCHECK_PARTIAL();
- ecode++;
- break;
-
- /* Word boundary assertions */
-
- case OP_NOT_WORD_BOUNDARY:
- case OP_WORD_BOUNDARY:
- {
-
- /* Find out if the previous and current characters are "word" characters.
- It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to
- be "non-word" characters. Remember the earliest consulted character for
- partial matching. */
-
#ifdef SUPPORT_UNICODE
- if (utf)
- {
- /* Get status of previous character */
-
- if (eptr == mb->start_subject) prev_is_word = FALSE; else
+ if (utf)
{
- PCRE2_SPTR lastptr = eptr - 1;
- BACKCHAR(lastptr);
- if (lastptr < mb->start_used_ptr) mb->start_used_ptr = lastptr;
- GETCHAR(c, lastptr);
- if ((mb->poptions & PCRE2_UCP) != 0)
+ uint32_t d;
+ for (;;)
{
- if (c == '_') prev_is_word = TRUE; else
+ RMATCH(Fecode, RM204);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
- int cat = UCD_CATEGORY(c);
- prev_is_word = (cat == ucp_L || cat == ucp_N);
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
+ GETCHARINC(d, Feptr);
+ if (Lc == d || Loc == d) RRETURN(MATCH_NOMATCH);
}
- else
- prev_is_word = c < 256 && (mb->ctypes[c] & ctype_word) != 0;
- }
-
- /* Get status of next character */
-
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- cur_is_word = FALSE;
}
else
+#endif /*SUPPORT_UNICODE */
+
+ /* Not UTF mode */
{
- PCRE2_SPTR nextptr = eptr + 1;
- FORWARDCHARTEST(nextptr, mb->end_subject);
- if (nextptr > mb->last_used_ptr) mb->last_used_ptr = nextptr;
- GETCHAR(c, eptr);
- if ((mb->poptions & PCRE2_UCP) != 0)
+ for (;;)
{
- if (c == '_') cur_is_word = TRUE; else
+ RMATCH(Fecode, RM29);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
- int cat = UCD_CATEGORY(c);
- cur_is_word = (cat == ucp_L || cat == ucp_N);
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
+ if (Lc == *Feptr || Loc == *Feptr) RRETURN(MATCH_NOMATCH);
+ Feptr++;
}
- else
- cur_is_word = c < 256 && (mb->ctypes[c] & ctype_word) != 0;
}
+ /* Control never gets here */
}
- else
-#endif /* SUPPORT UTF */
- /* Not in UTF-8 mode, but we may still have PCRE2_UCP set, and for
- consistency with the behaviour of \w we do use it in this case. */
+ /* Maximize case */
+ else
{
- /* Get status of previous character */
+ Lstart_eptr = Feptr;
- if (eptr == mb->start_subject) prev_is_word = FALSE; else
- {
- if (eptr <= mb->start_used_ptr) mb->start_used_ptr = eptr - 1;
#ifdef SUPPORT_UNICODE
- if ((mb->poptions & PCRE2_UCP) != 0)
+ if (utf)
+ {
+ uint32_t d;
+ for (i = Lmin; i < Lmax; i++)
{
- c = eptr[-1];
- if (c == '_') prev_is_word = TRUE; else
+ int len = 1;
+ if (Feptr >= mb->end_subject)
{
- int cat = UCD_CATEGORY(c);
- prev_is_word = (cat == ucp_L || cat == ucp_N);
+ SCHECK_PARTIAL();
+ break;
}
+ GETCHARLEN(d, Feptr, len);
+ if (Lc == d || Loc == d) break;
+ Feptr += len;
}
- else
-#endif
- prev_is_word = MAX_255(eptr[-1])
- && ((mb->ctypes[eptr[-1]] & ctype_word) != 0);
- }
- /* Get status of next character */
+ /* After \C in UTF mode, Lstart_eptr might be in the middle of a
+ Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't
+ go too far. */
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- cur_is_word = FALSE;
+ if (reptype != REPTYPE_POS) for(;;)
+ {
+ if (Feptr <= Lstart_eptr) break;
+ RMATCH(Fecode, RM205);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Feptr--;
+ BACKCHAR(Feptr);
+ }
}
else
+#endif /* SUPPORT_UNICODE */
+
+ /* Not UTF mode */
{
- if (eptr >= mb->last_used_ptr) mb->last_used_ptr = eptr + 1;
-#ifdef SUPPORT_UNICODE
- if ((mb->poptions & PCRE2_UCP) != 0)
+ for (i = Lmin; i < Lmax; i++)
{
- c = *eptr;
- if (c == '_') cur_is_word = TRUE; else
+ if (Feptr >= mb->end_subject)
{
- int cat = UCD_CATEGORY(c);
- cur_is_word = (cat == ucp_L || cat == ucp_N);
+ SCHECK_PARTIAL();
+ break;
}
+ if (Lc == *Feptr || Loc == *Feptr) break;
+ Feptr++;
+ }
+ if (reptype != REPTYPE_POS) for (;;)
+ {
+ if (Feptr == Lstart_eptr) break;
+ RMATCH(Fecode, RM30);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Feptr--;
}
- else
-#endif
- cur_is_word = MAX_255(*eptr)
- && ((mb->ctypes[*eptr] & ctype_word) != 0);
}
}
-
- /* Now see if the situation is what we want */
-
- if ((*ecode++ == OP_WORD_BOUNDARY)?
- cur_is_word == prev_is_word : cur_is_word != prev_is_word)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- /* Match any single character type except newline; have to take care with
- CRLF newlines and partial matching. */
-
- case OP_ANY:
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
- if (mb->partial != 0 &&
- eptr + 1 >= mb->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21TEST(eptr) == NLBLOCK->nl[0])
- {
- mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
- }
-
- /* Fall through */
-
- /* Match any single character whatsoever. */
-
- case OP_ALLANY:
- if (eptr >= mb->end_subject) /* DO NOT merge the eptr++ here; it must */
- { /* not be updated before SCHECK_PARTIAL. */
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr++;
-#ifdef SUPPORT_UNICODE
- if (utf) ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
-#endif
- ecode++;
- break;
-
- /* Match a single code unit, even in UTF-8 mode. This opcode really does
- match any code unit, even newline. (It really should be called ANYCODEUNIT,
- of course - the byte name is from pre-16 bit days.) */
-
- case OP_ANYBYTE:
- if (eptr >= mb->end_subject) /* DO NOT merge the eptr++ here; it must */
- { /* not be updated before SCHECK_PARTIAL. */
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr++;
- ecode++;
- break;
-
- case OP_NOT_DIGIT:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_WIDE_CHARS
- c < 256 &&
-#endif
- (mb->ctypes[c] & ctype_digit) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_DIGIT:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_WIDE_CHARS
- c > 255 ||
-#endif
- (mb->ctypes[c] & ctype_digit) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_WHITESPACE:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_WIDE_CHARS
- c < 256 &&
-#endif
- (mb->ctypes[c] & ctype_space) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_WHITESPACE:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_WIDE_CHARS
- c > 255 ||
-#endif
- (mb->ctypes[c] & ctype_space) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_WORDCHAR:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_WIDE_CHARS
- c < 256 &&
-#endif
- (mb->ctypes[c] & ctype_word) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_WORDCHAR:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#ifdef SUPPORT_WIDE_CHARS
- c > 255 ||
-#endif
- (mb->ctypes[c] & ctype_word) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_ANYNL:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
-
- case CHAR_CR:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- }
- else if (UCHAR21TEST(eptr) == CHAR_LF) eptr++;
- break;
-
- case CHAR_LF:
- break;
-
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#ifndef EBCDIC
- case 0x2028:
- case 0x2029:
-#endif /* Not EBCDIC */
- if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) RRETURN(MATCH_NOMATCH);
- break;
}
- ecode++;
- break;
- case OP_NOT_HSPACE:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- HSPACE_CASES: RRETURN(MATCH_NOMATCH); /* Byte and multibyte cases */
- default: break;
- }
- ecode++;
- break;
-
- case OP_HSPACE:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- HSPACE_CASES: break; /* Byte and multibyte cases */
- default: RRETURN(MATCH_NOMATCH);
- }
- ecode++;
- break;
-
- case OP_NOT_VSPACE:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- VSPACE_CASES: RRETURN(MATCH_NOMATCH);
- default: break;
- }
- ecode++;
- break;
+ /* Caseful comparisons */
- case OP_VSPACE:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
+ else
{
- VSPACE_CASES: break;
- default: RRETURN(MATCH_NOMATCH);
- }
- ecode++;
- break;
-
#ifdef SUPPORT_UNICODE
- /* Check the next character by Unicode property. We will get here only
- if the support is in the binary; otherwise a compile-time error occurs. */
-
- case OP_PROP:
- case OP_NOTPROP:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- {
- const uint32_t *cp;
- const ucd_record *prop = GET_UCD(c);
-
- switch(ecode[1])
+ if (utf)
{
- case PT_ANY:
- if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_LAMP:
- if ((prop->chartype == ucp_Lu ||
- prop->chartype == ucp_Ll ||
- prop->chartype == ucp_Lt) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_GC:
- if ((ecode[2] != PRIV(ucp_gentype)[prop->chartype]) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_PC:
- if ((ecode[2] != prop->chartype) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_SC:
- if ((ecode[2] != prop->script) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- /* These are specials */
-
- case PT_ALNUM:
- if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included,
- which means that Perl space and POSIX space are now identical. PCRE
- was changed at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- switch(c)
+ uint32_t d;
+ for (i = 1; i <= Lmin; i++)
{
- HSPACE_CASES:
- VSPACE_CASES:
- if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z) ==
- (op == OP_NOTPROP)) RRETURN(MATCH_NOMATCH);
- break;
- }
- break;
-
- case PT_WORD:
- if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
- c == CHAR_UNDERSCORE) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + ecode[2];
- for (;;)
- {
- if (c < *cp)
- { if (op == OP_PROP) { RRETURN(MATCH_NOMATCH); } else break; }
- if (c == *cp++)
- { if (op == OP_PROP) break; else { RRETURN(MATCH_NOMATCH); } }
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ GETCHARINC(d, Feptr);
+ if (Lc == d) RRETURN(MATCH_NOMATCH);
}
- break;
-
- case PT_UCNC:
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- /* This should never occur */
-
- default:
- RRETURN(PCRE2_ERROR_INTERNAL);
}
-
- ecode += 3;
- }
- break;
-
- /* Match an extended Unicode sequence. We will get here only if the support
- is in the binary; otherwise a compile-time error occurs. */
-
- case OP_EXTUNI:
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- else
- {
- int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < mb->end_subject)
- {
- int len = 1;
- if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); }
- rgb = UCD_GRAPHBREAK(c);
- if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- lgb = rgb;
- eptr += len;
- }
- }
- CHECK_PARTIAL();
- ecode++;
- break;
-#endif /* SUPPORT_UNICODE */
-
-
- /* Match a back reference, possibly repeatedly. Look past the end of the
- item to see if there is repeat information following.
-
- The OP_REF and OP_REFI opcodes are used for a reference to a numbered group
- or to a non-duplicated named group. For a duplicated named group, OP_DNREF
- and OP_DNREFI are used. In this case we must scan the list of groups to
- which the name refers, and use the first one that is set. */
-
- case OP_DNREF:
- case OP_DNREFI:
- caseless = op == OP_DNREFI;
- {
- int count = GET2(ecode, 1+IMM2_SIZE);
- PCRE2_SPTR slot = mb->name_table + GET2(ecode, 1) * mb->name_entry_size;
- ecode += 1 + 2*IMM2_SIZE;
-
- /* Initializing 'offset' avoids a compiler warning in the REF_REPEAT
- code. */
-
- offset = 0;
- while (count-- > 0)
- {
- offset = GET2(slot, 0) << 1;
- if (offset < offset_top && mb->ovector[offset] != PCRE2_UNSET) break;
- slot += mb->name_entry_size;
- }
- }
- goto REF_REPEAT;
-
- case OP_REF:
- case OP_REFI:
- caseless = op == OP_REFI;
- offset = GET2(ecode, 1) << 1; /* Doubled ref number */
- ecode += 1 + IMM2_SIZE;
-
- /* Set up for repetition, or handle the non-repeated case */
-
- REF_REPEAT:
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- c = *ecode++ - OP_CRSTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 1 + IMM2_SIZE);
- if (max == 0) max = INT_MAX;
- ecode += 1 + 2 * IMM2_SIZE;
- break;
-
- default: /* No repeat follows */
+ else
+#endif
+ /* Not UTF mode */
{
- int rc = match_ref(offset, offset_top, eptr, mb, caseless, &length);
- if (rc != 0)
+ for (i = 1; i <= Lmin; i++)
{
- if (rc > 0) eptr = mb->end_subject; /* Partial match */
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (Lc == *Feptr++) RRETURN(MATCH_NOMATCH);
}
}
- eptr += length;
- continue; /* With the main loop */
- }
- /* Handle repeated back references. If a set group has length zero, just
- continue with the main loop, because it matches however many times. For an
- unset reference, if the minimum is zero, we can also just continue. We an
- also continue if PCRE2_MATCH_UNSET_BACKREF is set, because this makes unset
- group be have as a zero-length group. For any other unset cases, carrying
- on will result in NOMATCH. */
-
- if (offset < offset_top && mb->ovector[offset] != PCRE2_UNSET)
- {
- if (mb->ovector[offset] == mb->ovector[offset + 1]) continue;
- }
- else /* Group is not set */
- {
- if (min == 0 || (mb->poptions & PCRE2_MATCH_UNSET_BACKREF) != 0)
- continue;
- }
+ if (Lmin == Lmax) continue;
- /* First, ensure the minimum number of matches are present. We get back
- the length of the reference string explicitly rather than passing the
- address of eptr, so that eptr can be a register variable. */
-
- for (i = 1; i <= min; i++)
- {
- PCRE2_SIZE slength;
- int rc = match_ref(offset, offset_top, eptr, mb, caseless, &slength);
- if (rc != 0)
- {
- if (rc > 0) eptr = mb->end_subject; /* Partial match */
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += slength;
- }
-
- /* If min = max, continue at the same level without recursion.
- They are not both allowed to be zero. */
-
- if (min == max) continue;
-
- /* If minimizing, keep trying and advancing the pointer */
-
- if (minimize)
- {
- for (fi = min;; fi++)
+ if (reptype == REPTYPE_MIN)
{
- int rc;
- PCRE2_SIZE slength;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM14);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- rc = match_ref(offset, offset_top, eptr, mb, caseless, &slength);
- if (rc != 0)
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- if (rc > 0) eptr = mb->end_subject; /* Partial match */
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
+ uint32_t d;
+ for (;;)
+ {
+ RMATCH(Fecode, RM206);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ GETCHARINC(d, Feptr);
+ if (Lc == d) RRETURN(MATCH_NOMATCH);
+ }
}
- eptr += slength;
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest string and work backwards, as long as
- the matched lengths for each iteration are the same. */
-
- else
- {
- BOOL samelengths = TRUE;
- pp = eptr;
- length = mb->ovector[offset+1] - mb->ovector[offset];
-
- for (i = min; i < max; i++)
- {
- PCRE2_SIZE slength;
- int rc = match_ref(offset, offset_top, eptr, mb, caseless, &slength);
-
- if (rc != 0)
+ else
+#endif
+ /* Not UTF mode */
{
- /* Can't use CHECK_PARTIAL because we don't want to update eptr in
- the soft partial matching case. */
-
- if (rc > 0 && mb->partial != 0 &&
- mb->end_subject > mb->start_used_ptr)
+ for (;;)
{
- mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ RMATCH(Fecode, RM31);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (Lc == *Feptr++) RRETURN(MATCH_NOMATCH);
}
- break;
}
-
- if (slength != length) samelengths = FALSE;
- eptr += slength;
+ /* Control never gets here */
}
- /* If the length matched for each repetition is the same as the length of
- the captured group, we can easily work backwards. This is the normal
- case. However, in caseless UTF-8 mode there are pairs of case-equivalent
- characters whose lengths (in terms of code units) differ. However, this
- is very rare, so we handle it by re-matching fewer and fewer times. */
+ /* Maximize case */
- if (samelengths)
+ else
{
- while (eptr >= pp)
+ Lstart_eptr = Feptr;
+
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM15);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr -= length;
- }
- }
+ uint32_t d;
+ for (i = Lmin; i < Lmax; i++)
+ {
+ int len = 1;
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ break;
+ }
+ GETCHARLEN(d, Feptr, len);
+ if (Lc == d) break;
+ Feptr += len;
+ }
- /* The rare case of non-matching lengths. Re-scan the repetition for each
- iteration. We know that match_ref() will succeed every time. */
+ /* After \C in UTF mode, Lstart_eptr might be in the middle of a
+ Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't
+ go too far. */
- else
- {
- max = i;
- for (;;)
+ if (reptype != REPTYPE_POS) for(;;)
+ {
+ if (Feptr <= Lstart_eptr) break;
+ RMATCH(Fecode, RM207);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Feptr--;
+ BACKCHAR(Feptr);
+ }
+ }
+ else
+#endif
+ /* Not UTF mode */
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM68);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr == pp) break; /* Failed after minimal repetition */
- eptr = pp;
- max--;
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- PCRE2_SIZE slength;
- (void)match_ref(offset, offset_top, eptr, mb, caseless, &slength);
- eptr += slength;
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ break;
+ }
+ if (Lc == *Feptr) break;
+ Feptr++;
+ }
+ if (reptype != REPTYPE_POS) for (;;)
+ {
+ if (Feptr == Lstart_eptr) break;
+ RMATCH(Fecode, RM32);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Feptr--;
}
}
}
-
- RRETURN(MATCH_NOMATCH);
}
- /* Control never gets here */
+ break;
+
+#undef Lstart_eptr
+#undef Lmin
+#undef Lmax
+#undef Lc
+#undef Loc
+
- /* Match a bit-mapped character class, possibly repeatedly. This op code is
- used when all the characters in the class have values in the range 0-255,
- and either the matching is caseful, or the characters are in the range
- 0-127 when UTF-8 processing is enabled. The only difference between
+ /* ===================================================================== */
+ /* Match a bit-mapped character class, possibly repeatedly. These op codes
+ are used when all the characters in the class have values in the range
+ 0-255, and either the matching is caseful, or the characters are in the
+ range 0-127 when UTF processing is enabled. The only difference between
OP_CLASS and OP_NCLASS occurs when a data character outside the range is
- encountered.
+ encountered. */
- First, look past the end of the item to see if there is repeat information
- following. Then obey similar code to character type repeats - written out
- again for speed. */
+#define Lmin F->temp_32[0]
+#define Lmax F->temp_32[1]
+#define Lstart_eptr F->temp_sptr[0]
+#define Lbyte_map_address F->temp_sptr[1]
+#define Lbyte_map ((unsigned char *)Lbyte_map_address)
case OP_NCLASS:
case OP_CLASS:
{
- /* The data variable is saved across frames, so the byte map needs to
- be stored there. */
-#define BYTE_MAP ((uint8_t *)data)
- data = ecode + 1; /* Save for matching */
- ecode += 1 + (32 / sizeof(PCRE2_UCHAR)); /* Advance past the item */
+ Lbyte_map_address = Fecode + 1; /* Save for matching */
+ Fecode += 1 + (32 / sizeof(PCRE2_UCHAR)); /* Advance past the item */
- switch (*ecode)
+ /* Look past the end of the item to see if there is repeat information
+ following. Then obey similar code to character type repeats. */
+
+ switch (*Fecode)
{
case OP_CRSTAR:
case OP_CRMINSTAR:
@@ -2999,27 +1806,24 @@ for (;;)
case OP_CRPOSSTAR:
case OP_CRPOSPLUS:
case OP_CRPOSQUERY:
- c = *ecode++ - OP_CRSTAR;
- if (c < OP_CRPOSSTAR - OP_CRSTAR) minimize = (c & 1) != 0;
- else possessive = TRUE;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
+ fc = *Fecode++ - OP_CRSTAR;
+ Lmin = rep_min[fc];
+ Lmax = rep_max[fc];
+ reptype = rep_typ[fc];
break;
case OP_CRRANGE:
case OP_CRMINRANGE:
case OP_CRPOSRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- possessive = (*ecode == OP_CRPOSRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 1 + IMM2_SIZE);
- if (max == 0) max = INT_MAX;
- ecode += 1 + 2 * IMM2_SIZE;
+ Lmin = GET2(Fecode, 1);
+ Lmax = GET2(Fecode, 1 + IMM2_SIZE);
+ if (Lmax == 0) Lmax = UINT32_MAX; /* Max 0 => infinity */
+ reptype = rep_typ[*Fecode - OP_CRSTAR];
+ Fecode += 1 + 2 * IMM2_SIZE;
break;
default: /* No repeat follows */
- min = max = 1;
+ Lmin = Lmax = 1;
break;
}
@@ -3028,100 +1832,99 @@ for (;;)
#ifdef SUPPORT_UNICODE
if (utf)
{
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- if (c > 255)
+ GETCHARINC(fc, Feptr);
+ if (fc > 255)
{
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
+ if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
}
else
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
+ if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
}
}
else
#endif
/* Not UTF mode */
{
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- c = *eptr++;
+ fc = *Feptr++;
#if PCRE2_CODE_UNIT_WIDTH != 8
- if (c > 255)
+ if (fc > 255)
{
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
+ if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
}
else
#endif
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
+ if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
}
}
- /* If max == min we can continue with the main loop without the
- need to recurse. */
+ /* If Lmax == Lmin we are done. Continue with main loop. */
- if (min == max) continue;
+ if (Lmin == Lmax) continue;
/* If minimizing, keep testing the rest of the expression and advancing
the pointer while it matches the class. */
- if (minimize)
+ if (reptype == REPTYPE_MIN)
{
#ifdef SUPPORT_UNICODE
if (utf)
{
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM16);
+ RMATCH(Fecode, RM200);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- if (c > 255)
+ GETCHARINC(fc, Feptr);
+ if (fc > 255)
{
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
+ if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
}
else
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
+ if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
}
}
else
#endif
/* Not UTF mode */
{
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM17);
+ RMATCH(Fecode, RM23);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- c = *eptr++;
+ fc = *Feptr++;
#if PCRE2_CODE_UNIT_WIDTH != 8
- if (c > 255)
+ if (fc > 255)
{
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
+ if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
}
else
#endif
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
+ if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
}
}
/* Control never gets here */
@@ -3131,91 +1934,102 @@ for (;;)
else
{
- pp = eptr;
+ Lstart_eptr = Feptr;
#ifdef SUPPORT_UNICODE
if (utf)
{
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c > 255)
+ GETCHARLEN(fc, Feptr, len);
+ if (fc > 255)
{
- if (op == OP_CLASS) break;
+ if (Fop == OP_CLASS) break;
}
else
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;
- eptr += len;
+ if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break;
+ Feptr += len;
}
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM18);
+ RMATCH(Fecode, RM201);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- BACKCHAR(eptr);
+ if (Feptr-- == Lstart_eptr) break; /* Tried at original position */
+ BACKCHAR(Feptr);
}
}
else
#endif
/* Not UTF mode */
{
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- c = *eptr;
+ fc = *Feptr;
#if PCRE2_CODE_UNIT_WIDTH != 8
- if (c > 255)
+ if (fc > 255)
{
- if (op == OP_CLASS) break;
+ if (Fop == OP_CLASS) break;
}
else
#endif
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;
- eptr++;
+ if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break;
+ Feptr++;
}
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
- while (eptr >= pp)
+ while (Feptr >= Lstart_eptr)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM19);
+ RMATCH(Fecode, RM24);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
+ Feptr--;
}
}
RRETURN(MATCH_NOMATCH);
}
-#undef BYTE_MAP
}
/* Control never gets here */
+#undef Lbyte_map_address
+#undef Lbyte_map
+#undef Lstart_eptr
+#undef Lmin
+#undef Lmax
+
+ /* ===================================================================== */
/* Match an extended character class. In the 8-bit library, this opcode is
encountered only when UTF-8 mode mode is supported. In the 16-bit and
32-bit libraries, codepoints greater than 255 may be encountered even when
UTF is not supported. */
+#define Lstart_eptr F->temp_sptr[0]
+#define Lxclass_data F->temp_sptr[1]
+#define Lmin F->temp_32[0]
+#define Lmax F->temp_32[1]
+
#ifdef SUPPORT_WIDE_CHARS
case OP_XCLASS:
{
- data = ecode + 1 + LINK_SIZE; /* Save for matching */
- ecode += GET(ecode, 1); /* Advance past the item */
+ Lxclass_data = Fecode + 1 + LINK_SIZE; /* Save for matching */
+ Fecode += GET(Fecode, 1); /* Advance past the item */
- switch (*ecode)
+ switch (*Fecode)
{
case OP_CRSTAR:
case OP_CRMINSTAR:
@@ -3226,65 +2040,61 @@ for (;;)
case OP_CRPOSSTAR:
case OP_CRPOSPLUS:
case OP_CRPOSQUERY:
- c = *ecode++ - OP_CRSTAR;
- if (c < OP_CRPOSSTAR - OP_CRSTAR) minimize = (c & 1) != 0;
- else possessive = TRUE;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
+ fc = *Fecode++ - OP_CRSTAR;
+ Lmin = rep_min[fc];
+ Lmax = rep_max[fc];
+ reptype = rep_typ[fc];
break;
case OP_CRRANGE:
case OP_CRMINRANGE:
case OP_CRPOSRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- possessive = (*ecode == OP_CRPOSRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 1 + IMM2_SIZE);
- if (max == 0) max = INT_MAX;
- ecode += 1 + 2 * IMM2_SIZE;
+ Lmin = GET2(Fecode, 1);
+ Lmax = GET2(Fecode, 1 + IMM2_SIZE);
+ if (Lmax == 0) Lmax = UINT32_MAX; /* Max 0 => infinity */
+ reptype = rep_typ[*Fecode - OP_CRSTAR];
+ Fecode += 1 + 2 * IMM2_SIZE;
break;
default: /* No repeat follows */
- min = max = 1;
+ Lmin = Lmax = 1;
break;
}
/* First, ensure the minimum number of matches are present. */
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH);
+ GETCHARINCTEST(fc, Feptr);
+ if (!PRIV(xclass)(fc, Lxclass_data, utf)) RRETURN(MATCH_NOMATCH);
}
- /* If max == min we can continue with the main loop without the
- need to recurse. */
+ /* If Lmax == Lmin we can just continue with the main loop. */
- if (min == max) continue;
+ if (Lmin == Lmax) continue;
/* If minimizing, keep testing the rest of the expression and advancing
the pointer while it matches the class. */
- if (minimize)
+ if (reptype == REPTYPE_MIN)
{
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM20);
+ RMATCH(Fecode, RM100);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH);
+ GETCHARINCTEST(fc, Feptr);
+ if (!PRIV(xclass)(fc, Lxclass_data, utf)) RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
}
@@ -3293,33 +2103,33 @@ for (;;)
else
{
- pp = eptr;
- for (i = min; i < max; i++)
+ Lstart_eptr = Feptr;
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
#ifdef SUPPORT_UNICODE
- GETCHARLENTEST(c, eptr, len);
+ GETCHARLENTEST(fc, Feptr, len);
#else
- c = *eptr;
+ fc = *Feptr;
#endif
- if (!PRIV(xclass)(c, data, utf)) break;
- eptr += len;
+ if (!PRIV(xclass)(fc, Lxclass_data, utf)) break;
+ Feptr += len;
}
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
for(;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM21);
+ RMATCH(Fecode, RM101);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
+ if (Feptr-- == Lstart_eptr) break; /* Tried at original position */
#ifdef SUPPORT_UNICODE
- if (utf) BACKCHAR(eptr);
+ if (utf) BACKCHAR(Feptr);
#endif
}
RRETURN(MATCH_NOMATCH);
@@ -3327,887 +2137,416 @@ for (;;)
/* Control never gets here */
}
-#endif /* End of XCLASS */
+#endif /* SUPPORT_WIDE_CHARS: end of XCLASS */
- /* Match a single character, casefully */
+#undef Lstart_eptr
+#undef Lxclass_data
+#undef Lmin
+#undef Lmax
- case OP_CHAR:
-#ifdef SUPPORT_UNICODE
- if (utf)
+
+ /* ===================================================================== */
+ /* Match various character types when PCRE2_UCP is not set. These opcodes
+ are not generated when PCRE2_UCP is set - instead appropriate property
+ tests are compiled. */
+
+ case OP_NOT_DIGIT:
+ if (Feptr >= mb->end_subject)
{
- length = 1;
- ecode++;
- GETCHARLEN(fc, ecode, length);
- if (length > (PCRE2_SIZE)(mb->end_subject - eptr))
- {
- CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */
- RRETURN(MATCH_NOMATCH);
- }
- for (; length > 0; length--)
- {
- if (*ecode++ != UCHAR21INC(eptr)) RRETURN(MATCH_NOMATCH);
- }
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
- else
-#endif
- /* Not UTF mode */
+ GETCHARINCTEST(fc, Feptr);
+ if (CHMAX_255(fc) && (mb->ctypes[fc] & ctype_digit) != 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
+
+ case OP_DIGIT:
+ if (Feptr >= mb->end_subject)
{
- if (mb->end_subject - eptr < 1)
- {
- SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */
- RRETURN(MATCH_NOMATCH);
- }
- if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH);
- ecode += 2;
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
+ GETCHARINCTEST(fc, Feptr);
+ if (!CHMAX_255(fc) || (mb->ctypes[fc] & ctype_digit) == 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
break;
- /* Match a single character, caselessly. If we are at the end of the
- subject, give up immediately. */
-
- case OP_CHARI:
- if (eptr >= mb->end_subject)
+ case OP_NOT_WHITESPACE:
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
+ GETCHARINCTEST(fc, Feptr);
+ if (CHMAX_255(fc) && (mb->ctypes[fc] & ctype_space) != 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
-#ifdef SUPPORT_UNICODE
- if (utf)
+ case OP_WHITESPACE:
+ if (Feptr >= mb->end_subject)
{
- length = 1;
- ecode++;
- GETCHARLEN(fc, ecode, length);
-
- /* If the pattern character's value is < 128, we have only one byte, and
- we know that its other case must also be one byte long, so we can use the
- fast lookup table. We know that there is at least one byte left in the
- subject. */
-
- if (fc < 128)
- {
- uint32_t cc = UCHAR21(eptr);
- if (mb->lcc[fc] != TABLE_GET(cc, mb->lcc, cc)) RRETURN(MATCH_NOMATCH);
- ecode++;
- eptr++;
- }
-
- /* Otherwise we must pick up the subject character. Note that we cannot
- use the value of "length" to check for sufficient bytes left, because the
- other case of the character may have more or fewer bytes. */
-
- else
- {
- uint32_t dc;
- GETCHARINC(dc, eptr);
- ecode += length;
-
- /* If we have Unicode property support, we can use it to test the other
- case of the character, if there is one. */
-
- if (fc != dc)
- {
-#ifdef SUPPORT_UNICODE
- if (dc != UCD_OTHERCASE(fc))
-#endif
- RRETURN(MATCH_NOMATCH);
- }
- }
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
- else
-#endif /* SUPPORT_UNICODE */
+ GETCHARINCTEST(fc, Feptr);
+ if (!CHMAX_255(fc) || (mb->ctypes[fc] & ctype_space) == 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
- /* Not UTF mode */
+ case OP_NOT_WORDCHAR:
+ if (Feptr >= mb->end_subject)
{
- if (TABLE_GET(ecode[1], mb->lcc, ecode[1])
- != TABLE_GET(*eptr, mb->lcc, *eptr)) RRETURN(MATCH_NOMATCH);
- eptr++;
- ecode += 2;
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
+ GETCHARINCTEST(fc, Feptr);
+ if (CHMAX_255(fc) && (mb->ctypes[fc] & ctype_word) != 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
break;
- /* Match a single character repeatedly. */
-
- case OP_EXACT:
- case OP_EXACTI:
- min = max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATCHAR;
-
- case OP_POSUPTO:
- case OP_POSUPTOI:
- possessive = TRUE;
- /* Fall through */
-
- case OP_UPTO:
- case OP_UPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_MINUPTO || *ecode == OP_MINUPTOI;
- ecode += 1 + IMM2_SIZE;
- goto REPEATCHAR;
-
- case OP_POSSTAR:
- case OP_POSSTARI:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATCHAR;
-
- case OP_POSPLUS:
- case OP_POSPLUSI:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATCHAR;
-
- case OP_POSQUERY:
- case OP_POSQUERYI:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATCHAR;
-
- case OP_STAR:
- case OP_STARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- c = *ecode++ - ((op < OP_STARI)? OP_STAR : OP_STARI);
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single-character matches. We first check
- for the minimum number of characters. If the minimum equals the maximum, we
- are done. Otherwise, if minimizing, check the rest of the pattern for a
- match; if there isn't one, advance up to the maximum, one character at a
- time.
-
- If maximizing, advance up to the maximum number of matching characters,
- until eptr is past the end of the maximum run. If possessive, we are
- then done (no backing up). Otherwise, match at this position; anything
- other than no match is immediately returned. For nomatch, back up one
- character, unless we are matching \R and the last thing matched was
- \r\n, in which case, back up two bytes. When we reach the first optional
- character position, we can save stack by doing a tail recurse.
-
- The various UTF/non-UTF and caseful/caseless cases are handled separately,
- for speed. */
-
- REPEATCHAR:
-#ifdef SUPPORT_UNICODE
- if (utf)
+ case OP_WORDCHAR:
+ if (Feptr >= mb->end_subject)
{
- length = 1;
- charptr = ecode;
- GETCHARLEN(fc, ecode, length);
- ecode += length;
-
- /* Handle multibyte character matching specially here. There is
- support for caseless matching if UCP support is present. */
-
- if (length > 1)
- {
- uint32_t othercase;
- if (op >= OP_STARI && /* Caseless */
- (othercase = UCD_OTHERCASE(fc)) != fc)
- oclength = PRIV(ord2utf)(othercase, occhars);
- else oclength = 0;
-
- for (i = 1; i <= min; i++)
- {
- if (eptr <= mb->end_subject - length &&
- memcmp(eptr, charptr, CU2BYTES(length)) == 0) eptr += length;
- else if (oclength > 0 &&
- eptr <= mb->end_subject - oclength &&
- memcmp(eptr, occhars, CU2BYTES(oclength)) == 0) eptr += oclength;
- else
- {
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM22);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr <= mb->end_subject - length &&
- memcmp(eptr, charptr, CU2BYTES(length)) == 0) eptr += length;
- else if (oclength > 0 &&
- eptr <= mb->end_subject - oclength &&
- memcmp(eptr, occhars, CU2BYTES(oclength)) == 0) eptr += oclength;
- else
- {
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr <= mb->end_subject - length &&
- memcmp(eptr, charptr, CU2BYTES(length)) == 0) eptr += length;
- else if (oclength > 0 &&
- eptr <= mb->end_subject - oclength &&
- memcmp(eptr, occhars, CU2BYTES(oclength)) == 0) eptr += oclength;
- else
- {
- CHECK_PARTIAL();
- break;
- }
- }
-
- if (possessive) continue; /* No backtracking */
-
- /* After \C in UTF mode, pp might be in the middle of a Unicode
- character. Use <= pp to ensure backtracking doesn't go too far. */
-
- for(;;)
- {
- if (eptr <= pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM23);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- }
- }
- /* Control never gets here */
- }
-
- /* If the length of a UTF-8 character is 1, we fall through here, and
- obey the code as for non-UTF-8 characters below, though in this case the
- value of fc will always be < 128. */
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
- else
-#endif /* SUPPORT_UNICODE */
-
- /* When not in UTF-8 mode, load a single-byte character. */
- fc = *ecode++;
-
- /* The value of fc at this point is always one character, though we may
- or may not be in UTF mode. The code is duplicated for the caseless and
- caseful cases, for speed, since matching characters is likely to be quite
- common. First, ensure the minimum number of matches are present. If min =
- max, continue at the same level without recursing. Otherwise, if
- minimizing, keep trying the rest of the expression and advancing one
- matching character if failing, up to the maximum. Alternatively, if
- maximizing, find the maximum number of characters and work backwards. */
+ GETCHARINCTEST(fc, Feptr);
+ if (!CHMAX_255(fc) || (mb->ctypes[fc] & ctype_word) == 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
- if (op >= OP_STARI) /* Caseless */
+ case OP_ANYNL:
+ if (Feptr >= mb->end_subject)
{
-#if PCRE2_CODE_UNIT_WIDTH == 8
- /* fc must be < 128 if UTF is enabled. */
- foc = mb->fcc[fc];
-#else
-#ifdef SUPPORT_UNICODE
- if (utf && fc > 127)
- foc = UCD_OTHERCASE(fc);
- else
-#endif /* SUPPORT_UNICODE */
- foc = TABLE_GET(fc, mb->fcc, fc);
-#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
-
- for (i = 1; i <= min; i++)
- {
- uint32_t cc; /* Faster than PCRE2_UCHAR */
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21TEST(eptr);
- if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- if (min == max) continue;
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- uint32_t cc; /* Faster than PCRE2_UCHAR */
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM24);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21TEST(eptr);
- if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- /* Control never gets here */
- }
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- uint32_t cc; /* Faster than PCRE2_UCHAR */
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- cc = UCHAR21TEST(eptr);
- if (fc != cc && foc != cc) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM25);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- /* Control never gets here */
- }
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
-
- /* Caseful comparisons (includes all multi-byte characters) */
-
- else
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
{
- for (i = 1; i <= min; i++)
+ default: RRETURN(MATCH_NOMATCH);
+
+ case CHAR_CR:
+ if (Feptr >= mb->end_subject)
{
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
+ SCHECK_PARTIAL();
}
+ else if (UCHAR21TEST(Feptr) == CHAR_LF) Feptr++;
+ break;
- if (min == max) continue;
+ case CHAR_LF:
+ break;
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM26);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (fc != UCHAR21TEST(eptr)) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM27);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- /* Control never gets here */
- }
+ case CHAR_VT:
+ case CHAR_FF:
+ case CHAR_NEL:
+#ifndef EBCDIC
+ case 0x2028:
+ case 0x2029:
+#endif /* Not EBCDIC */
+ if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) RRETURN(MATCH_NOMATCH);
+ break;
}
- /* Control never gets here */
+ Fecode++;
+ break;
- /* Match a negated single one-byte character. The character we are
- checking can be multibyte. */
+ case OP_NOT_HSPACE:
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
+ {
+ HSPACE_CASES: RRETURN(MATCH_NOMATCH); /* Byte and multibyte cases */
+ default: break;
+ }
+ Fecode++;
+ break;
- case OP_NOT:
- case OP_NOTI:
- if (eptr >= mb->end_subject)
+ case OP_HSPACE:
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
-#ifdef SUPPORT_UNICODE
- if (utf)
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
{
- register uint32_t ch, och;
+ HSPACE_CASES: break; /* Byte and multibyte cases */
+ default: RRETURN(MATCH_NOMATCH);
+ }
+ Fecode++;
+ break;
- ecode++;
- GETCHARINC(ch, ecode);
- GETCHARINC(c, eptr);
+ case OP_NOT_VSPACE:
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
+ {
+ VSPACE_CASES: RRETURN(MATCH_NOMATCH);
+ default: break;
+ }
+ Fecode++;
+ break;
- if (op == OP_NOT)
- {
- if (ch == c) RRETURN(MATCH_NOMATCH);
- }
- else
- {
- if (ch > 127)
- och = UCD_OTHERCASE(ch);
- else
- och = TABLE_GET(ch, mb->fcc, ch);
- if (ch == c || och == c) RRETURN(MATCH_NOMATCH);
- }
+ case OP_VSPACE:
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
- else
-#endif /* SUPPORT_UNICODE */
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
{
- register uint32_t ch = ecode[1];
- c = *eptr++;
- if (ch == c || (op == OP_NOTI && TABLE_GET(ch, mb->fcc, ch) == c))
- RRETURN(MATCH_NOMATCH);
- ecode += 2;
+ VSPACE_CASES: break;
+ default: RRETURN(MATCH_NOMATCH);
}
+ Fecode++;
break;
- /* Match a negated single one-byte character repeatedly. This is almost a
- repeat of the code for a repeated single character, but I haven't found a
- nice way of commoning these up that doesn't require a test of the
- positive/negative option for each character match. Maybe that wouldn't add
- very much to the time taken, but character matching *is* what this is all
- about... */
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- min = max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATNOTCHAR;
+#ifdef SUPPORT_UNICODE
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_NOTMINUPTO || *ecode == OP_NOTMINUPTOI;
- ecode += 1 + IMM2_SIZE;
- goto REPEATNOTCHAR;
+ /* ===================================================================== */
+ /* Check the next character by Unicode property. We will get here only
+ if the support is in the binary; otherwise a compile-time error occurs. */
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATNOTCHAR;
+ case OP_PROP:
+ case OP_NOTPROP:
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ GETCHARINCTEST(fc, Feptr);
+ {
+ const uint32_t *cp;
+ const ucd_record *prop = GET_UCD(fc);
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATNOTCHAR;
+ switch(Fecode[1])
+ {
+ case PT_ANY:
+ if (Fop == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
+ break;
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATNOTCHAR;
+ case PT_LAMP:
+ if ((prop->chartype == ucp_Lu ||
+ prop->chartype == ucp_Ll ||
+ prop->chartype == ucp_Lt) == (Fop == OP_NOTPROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- possessive = TRUE;
- min = 0;
- max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATNOTCHAR;
+ case PT_GC:
+ if ((Fecode[2] != PRIV(ucp_gentype)[prop->chartype]) == (Fop == OP_PROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- c = *ecode++ - ((op >= OP_NOTSTARI)? OP_NOTSTARI: OP_NOTSTAR);
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
+ case PT_PC:
+ if ((Fecode[2] != prop->chartype) == (Fop == OP_PROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- /* Common code for all repeated single-byte matches. */
+ case PT_SC:
+ if ((Fecode[2] != prop->script) == (Fop == OP_PROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- REPEATNOTCHAR:
- GETCHARINCTEST(fc, ecode);
+ /* These are specials */
- /* The code is duplicated for the caseless and caseful cases, for speed,
- since matching characters is likely to be quite common. First, ensure the
- minimum number of matches are present. If min = max, continue at the same
- level without recursing. Otherwise, if minimizing, keep trying the rest of
- the expression and advancing one matching character if failing, up to the
- maximum. Alternatively, if maximizing, find the maximum number of
- characters and work backwards. */
+ case PT_ALNUM:
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (Fop == OP_NOTPROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- if (op >= OP_NOTSTARI) /* Caseless */
- {
-#ifdef SUPPORT_UNICODE
- if (utf && fc > 127)
- foc = UCD_OTHERCASE(fc);
- else
-#endif /* SUPPORT_UNICODE */
- foc = TABLE_GET(fc, mb->fcc, fc);
+ /* Perl space used to exclude VT, but from Perl 5.18 it is included,
+ which means that Perl space and POSIX space are now identical. PCRE
+ was changed at release 8.34. */
-#ifdef SUPPORT_UNICODE
- if (utf)
- {
- register uint32_t d;
- for (i = 1; i <= min; i++)
- {
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d || (uint32_t)foc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif /* SUPPORT_UNICODE */
- /* Not UTF mode */
- {
- for (i = 1; i <= min; i++)
+ case PT_SPACE: /* Perl space */
+ case PT_PXSPACE: /* POSIX space */
+ switch(fc)
{
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH);
- eptr++;
+ HSPACE_CASES:
+ VSPACE_CASES:
+ if (Fop == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
+ break;
+
+ default:
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z) ==
+ (Fop == OP_NOTPROP)) RRETURN(MATCH_NOMATCH);
+ break;
}
- }
+ break;
- if (min == max) continue;
+ case PT_WORD:
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
+ fc == CHAR_UNDERSCORE) == (Fop == OP_NOTPROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- if (minimize)
- {
-#ifdef SUPPORT_UNICODE
- if (utf)
- {
- register uint32_t d;
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM28);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d || (uint32_t)foc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif /*SUPPORT_UNICODE */
- /* Not UTF mode */
+ case PT_CLIST:
+ cp = PRIV(ucd_caseless_sets) + Fecode[2];
+ for (;;)
{
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM29);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
+ if (fc < *cp)
+ { if (Fop == OP_PROP) { RRETURN(MATCH_NOMATCH); } else break; }
+ if (fc == *cp++)
+ { if (Fop == OP_PROP) break; else { RRETURN(MATCH_NOMATCH); } }
}
- /* Control never gets here */
- }
-
- /* Maximize case */
-
- else
- {
- pp = eptr;
+ break;
-#ifdef SUPPORT_UNICODE
- if (utf)
- {
- register uint32_t d;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(d, eptr, len);
- if (fc == d || (uint32_t)foc == d) break;
- eptr += len;
- }
- if (possessive) continue; /* No backtracking */
+ case PT_UCNC:
+ if ((fc == CHAR_DOLLAR_SIGN || fc == CHAR_COMMERCIAL_AT ||
+ fc == CHAR_GRAVE_ACCENT || (fc >= 0xa0 && fc <= 0xd7ff) ||
+ fc >= 0xe000) == (Fop == OP_NOTPROP))
+ RRETURN(MATCH_NOMATCH);
+ break;
- /* After \C in UTF mode, pp might be in the middle of a Unicode
- character. Use <= pp to ensure backtracking doesn't go too far. */
+ /* This should never occur */
- for(;;)
- {
- if (eptr <= pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM30);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- }
- }
- else
-#endif /* SUPPORT_UNICODE */
- /* Not UTF mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (fc == *eptr || foc == *eptr) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM31);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
- /* Control never gets here */
+ default:
+ return PCRE2_ERROR_INTERNAL;
}
+
+ Fecode += 3;
}
+ break;
- /* Caseful comparisons */
+ /* ===================================================================== */
+ /* Match an extended Unicode sequence. We will get here only if the support
+ is in the binary; otherwise a compile-time error occurs. */
+
+ case OP_EXTUNI:
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
else
{
-#ifdef SUPPORT_UNICODE
- if (utf)
- {
- register uint32_t d;
- for (i = 1; i <= min; i++)
- {
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF mode */
+ int lgb, rgb;
+ GETCHARINCTEST(fc, Feptr);
+ lgb = UCD_GRAPHBREAK(fc);
+ while (Feptr < mb->end_subject)
{
- for (i = 1; i <= min; i++)
- {
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr++) RRETURN(MATCH_NOMATCH);
- }
- }
+ int len = 1;
+ if (!utf) fc = *Feptr; else { GETCHARLEN(fc, Feptr, len); }
+ rgb = UCD_GRAPHBREAK(fc);
+ if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- if (min == max) continue;
+ /* Not breaking between Regional Indicators is allowed only if there
+ are an even number of preceding RIs. */
- if (minimize)
- {
-#ifdef SUPPORT_UNICODE
- if (utf)
+ if (lgb == ucp_gbRegionalIndicator && rgb == ucp_gbRegionalIndicator)
{
- register uint32_t d;
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM32);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
+ int ricount = 0;
+ PCRE2_SPTR bptr = Feptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
#endif
- /* Not UTF mode */
- {
- for (fi = min;; fi++)
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM33);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
{
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
+ BACKCHAR(bptr);
+ GETCHAR(fc, bptr);
}
- if (fc == *eptr++) RRETURN(MATCH_NOMATCH);
+ else
+#endif
+ fc = *bptr;
+ if (UCD_GRAPHBREAK(fc) != ucp_gbRegionalIndicator) break;
+ ricount++;
}
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
}
- /* Control never gets here */
- }
- /* Maximize case */
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
- else
- {
- pp = eptr;
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
-#ifdef SUPPORT_UNICODE
- if (utf)
- {
- register uint32_t d;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(d, eptr, len);
- if (fc == d) break;
- eptr += len;
- }
- if (possessive) continue; /* No backtracking */
-
- /* After \C in UTF mode, pp might be in the middle of a Unicode
- character. Use <= pp to ensure backtracking doesn't go too far. */
-
- for(;;)
- {
- if (eptr <= pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM34);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= mb->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (fc == *eptr) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM35);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
- /* Control never gets here */
+ Feptr += len;
}
}
- /* Control never gets here */
+ CHECK_PARTIAL();
+ Fecode++;
+ break;
- /* Match a single character type repeatedly; several different opcodes
- share code. This is very similar to the code for single characters, but we
- repeat it in the interests of efficiency. */
+#endif /* SUPPORT_UNICODE */
+
+
+ /* ===================================================================== */
+ /* Match a single character type repeatedly. Note that the property type
+ does not need to be in a stack frame as it not used within an RMATCH()
+ loop. */
+
+#define Lstart_eptr F->temp_sptr[0]
+#define Lmin F->temp_32[0]
+#define Lmax F->temp_32[1]
+#define Lctype F->temp_32[2]
+#define Lpropvalue F->temp_32[3]
case OP_TYPEEXACT:
- min = max = GET2(ecode, 1);
- minimize = TRUE;
- ecode += 1 + IMM2_SIZE;
+ Lmin = Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
goto REPEATTYPE;
case OP_TYPEUPTO:
case OP_TYPEMINUPTO:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_TYPEMINUPTO;
- ecode += 1 + IMM2_SIZE;
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ reptype = (*Fecode == OP_TYPEMINUPTO)? REPTYPE_MIN : REPTYPE_MAX;
+ Fecode += 1 + IMM2_SIZE;
goto REPEATTYPE;
case OP_TYPEPOSSTAR:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = UINT32_MAX;
+ Fecode++;
goto REPEATTYPE;
case OP_TYPEPOSPLUS:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
+ reptype = REPTYPE_POS;
+ Lmin = 1;
+ Lmax = UINT32_MAX;
+ Fecode++;
goto REPEATTYPE;
case OP_TYPEPOSQUERY:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = 1;
+ Fecode++;
goto REPEATTYPE;
case OP_TYPEPOSUPTO:
- possessive = TRUE;
- min = 0;
- max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
+ reptype = REPTYPE_POS;
+ Lmin = 0;
+ Lmax = GET2(Fecode, 1);
+ Fecode += 1 + IMM2_SIZE;
goto REPEATTYPE;
case OP_TYPESTAR:
@@ -4216,127 +2555,122 @@ for (;;)
case OP_TYPEMINPLUS:
case OP_TYPEQUERY:
case OP_TYPEMINQUERY:
- c = *ecode++ - OP_TYPESTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
+ fc = *Fecode++ - OP_TYPESTAR;
+ Lmin = rep_min[fc];
+ Lmax = rep_max[fc];
+ reptype = rep_typ[fc];
- /* Common code for all repeated single character type matches. Note that
- in UTF-8 mode, '.' matches a character of any length, but for the other
- character types, the valid characters are all one-byte long. */
+ /* Common code for all repeated character type matches. */
REPEATTYPE:
- ctype = *ecode++; /* Code for the character type */
+ Lctype = *Fecode++; /* Code for the character type */
#ifdef SUPPORT_UNICODE
- if (ctype == OP_PROP || ctype == OP_NOTPROP)
+ if (Lctype == OP_PROP || Lctype == OP_NOTPROP)
{
- prop_fail_result = ctype == OP_NOTPROP;
- prop_type = *ecode++;
- prop_value = *ecode++;
+ proptype = *Fecode++;
+ Lpropvalue = *Fecode++;
}
- else prop_type = -1;
+ else proptype = -1;
#endif
/* First, ensure the minimum number of matches are present. Use inline
code for maximizing the speed, and do the type test once at the start
- (i.e. keep it out of the loop). Separate the UTF-8 code completely as that
- is tidier. Also separate the UCP code, which can be the same for both UTF-8
- and single-bytes. */
+ (i.e. keep it out of the loop). The code for UTF mode is separated out for
+ tidiness, except for Unicode property tests. */
- if (min > 0)
+ if (Lmin > 0)
{
#ifdef SUPPORT_UNICODE
- if (prop_type >= 0)
+ if (proptype >= 0) /* Property tests in all modes */
{
- switch(prop_type)
+ switch(proptype)
{
case PT_ANY:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- for (i = 1; i <= min; i++)
+ if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
+ GETCHARINCTEST(fc, Feptr);
}
break;
case PT_LAMP:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
int chartype;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- chartype = UCD_CHARTYPE(c);
+ GETCHARINCTEST(fc, Feptr);
+ chartype = UCD_CHARTYPE(fc);
if ((chartype == ucp_Lu ||
chartype == ucp_Ll ||
- chartype == ucp_Lt) == prop_fail_result)
+ chartype == ucp_Lt) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
case PT_GC:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((UCD_CATEGORY(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
case PT_PC:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((UCD_CHARTYPE(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
case PT_SC:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((UCD_SCRIPT(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
case PT_ALNUM:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
int category;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ category = UCD_CATEGORY(fc);
+ if ((category == ucp_L || category == ucp_N) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
@@ -4347,23 +2681,23 @@ for (;;)
case PT_SPACE: /* Perl space */
case PT_PXSPACE: /* POSIX space */
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- switch(c)
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
{
HSPACE_CASES:
VSPACE_CASES:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
+ if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
break;
default:
- if ((UCD_CATEGORY(c) == ucp_Z) == prop_fail_result)
+ if ((UCD_CATEGORY(fc) == ucp_Z) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
break;
}
@@ -4371,55 +2705,61 @@ for (;;)
break;
case PT_WORD:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
int category;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N || c == CHAR_UNDERSCORE)
- == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ category = UCD_CATEGORY(fc);
+ if ((category == ucp_L || category == ucp_N ||
+ fc == CHAR_UNDERSCORE) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
case PT_CLIST:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
const uint32_t *cp;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + prop_value;
+ GETCHARINCTEST(fc, Feptr);
+ cp = PRIV(ucd_caseless_sets) + Lpropvalue;
for (;;)
{
- if (c < *cp)
- { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }
- if (c == *cp++)
- { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }
+ if (fc < *cp)
+ {
+ if (Lctype == OP_NOTPROP) break;
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (fc == *cp++)
+ {
+ if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
+ break;
+ }
}
}
break;
case PT_UCNC:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((fc == CHAR_DOLLAR_SIGN || fc == CHAR_COMMERCIAL_AT ||
+ fc == CHAR_GRAVE_ACCENT || (fc >= 0xa0 && fc <= 0xd7ff) ||
+ fc >= 0xe000) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
break;
@@ -4427,18 +2767,18 @@ for (;;)
/* This should not occur */
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
}
/* Match extended Unicode sequences. We will get here only if the
support is in the binary; otherwise a compile-time error occurs. */
- else if (ctype == OP_EXTUNI)
+ else if (Lctype == OP_EXTUNI)
{
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
@@ -4446,16 +2786,54 @@ for (;;)
else
{
int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < mb->end_subject)
+ GETCHARINCTEST(fc, Feptr);
+ lgb = UCD_GRAPHBREAK(fc);
+ while (Feptr < mb->end_subject)
{
int len = 1;
- if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); }
- rgb = UCD_GRAPHBREAK(c);
+ if (!utf) fc = *Feptr; else { GETCHARLEN(fc, Feptr, len); }
+ rgb = UCD_GRAPHBREAK(fc);
if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- lgb = rgb;
- eptr += len;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = Feptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(fc, bptr);
+ }
+ else
+#endif
+ fc = *bptr;
+ if (UCD_GRAPHBREAK(fc) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
+ Feptr += len;
}
}
CHECK_PARTIAL();
@@ -4465,67 +2843,67 @@ for (;;)
else
#endif /* SUPPORT_UNICODE */
-/* Handle all other cases when the coding is UTF-8 */
+/* Handle all other cases in UTF mode */
#ifdef SUPPORT_UNICODE
- if (utf) switch(ctype)
+ if (utf) switch(Lctype)
{
case OP_ANY:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
+ if (IS_NEWLINE(Feptr)) RRETURN(MATCH_NOMATCH);
if (mb->partial != 0 &&
- eptr + 1 >= mb->end_subject &&
+ Feptr + 1 >= mb->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
+ UCHAR21(Feptr) == NLBLOCK->nl[0])
{
mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
- eptr++;
- ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
+ Feptr++;
+ ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
}
break;
case OP_ALLANY:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- eptr++;
- ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
+ Feptr++;
+ ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
}
break;
case OP_ANYBYTE:
- if (eptr > mb->end_subject - min) RRETURN(MATCH_NOMATCH);
- eptr += min;
+ if (Feptr > mb->end_subject - Lmin) RRETURN(MATCH_NOMATCH);
+ Feptr += Lmin;
break;
case OP_ANYNL:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- switch(c)
+ GETCHARINC(fc, Feptr);
+ switch(fc)
{
default: RRETURN(MATCH_NOMATCH);
case CHAR_CR:
- if (eptr < mb->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
+ if (Feptr < mb->end_subject && UCHAR21(Feptr) == CHAR_LF) Feptr++;
break;
case CHAR_LF:
@@ -4545,49 +2923,49 @@ for (;;)
break;
case OP_NOT_HSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- switch(c)
+ GETCHARINC(fc, Feptr);
+ switch(fc)
{
- HSPACE_CASES: RRETURN(MATCH_NOMATCH); /* Byte and multibyte cases */
+ HSPACE_CASES: RRETURN(MATCH_NOMATCH);
default: break;
}
}
break;
case OP_HSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- switch(c)
+ GETCHARINC(fc, Feptr);
+ switch(fc)
{
- HSPACE_CASES: break; /* Byte and multibyte cases */
+ HSPACE_CASES: break;
default: RRETURN(MATCH_NOMATCH);
}
}
break;
case OP_NOT_VSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- switch(c)
+ GETCHARINC(fc, Feptr);
+ switch(fc)
{
VSPACE_CASES: RRETURN(MATCH_NOMATCH);
default: break;
@@ -4596,15 +2974,15 @@ for (;;)
break;
case OP_VSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- switch(c)
+ GETCHARINC(fc, Feptr);
+ switch(fc)
{
VSPACE_CASES: break;
default: RRETURN(MATCH_NOMATCH);
@@ -4613,170 +2991,174 @@ for (;;)
break;
case OP_NOT_DIGIT:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINC(c, eptr);
- if (c < 128 && (mb->ctypes[c] & ctype_digit) != 0)
+ GETCHARINC(fc, Feptr);
+ if (fc < 128 && (mb->ctypes[fc] & ctype_digit) != 0)
RRETURN(MATCH_NOMATCH);
}
break;
case OP_DIGIT:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
uint32_t cc;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- cc = UCHAR21(eptr);
+ cc = UCHAR21(Feptr);
if (cc >= 128 || (mb->ctypes[cc] & ctype_digit) == 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
- /* No need to skip more bytes - we know it's a 1-byte character */
+ Feptr++;
+ /* No need to skip more code units - we know it has only one. */
}
break;
case OP_NOT_WHITESPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
uint32_t cc;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- cc = UCHAR21(eptr);
+ cc = UCHAR21(Feptr);
if (cc < 128 && (mb->ctypes[cc] & ctype_space) != 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
- ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
+ Feptr++;
+ ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
}
break;
case OP_WHITESPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
uint32_t cc;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- cc = UCHAR21(eptr);
+ cc = UCHAR21(Feptr);
if (cc >= 128 || (mb->ctypes[cc] & ctype_space) == 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
- /* No need to skip more bytes - we know it's a 1-byte character */
+ Feptr++;
+ /* No need to skip more code units - we know it has only one. */
}
break;
case OP_NOT_WORDCHAR:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
uint32_t cc;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- cc = UCHAR21(eptr);
+ cc = UCHAR21(Feptr);
if (cc < 128 && (mb->ctypes[cc] & ctype_word) != 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
- ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
+ Feptr++;
+ ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
}
break;
case OP_WORDCHAR:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
uint32_t cc;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- cc = UCHAR21(eptr);
+ cc = UCHAR21(Feptr);
if (cc >= 128 || (mb->ctypes[cc] & ctype_word) == 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
- /* No need to skip more bytes - we know it's a 1-byte character */
+ Feptr++;
+ /* No need to skip more code units - we know it has only one. */
}
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
- } /* End switch(ctype) */
+ return PCRE2_ERROR_INTERNAL;
+ } /* End switch(Lctype) */
else
#endif /* SUPPORT_UNICODE */
- /* Code for the non-UTF-8 case for minimum matching of operators other
+ /* Code for the non-UTF case for minimum matching of operators other
than OP_PROP and OP_NOTPROP. */
- switch(ctype)
+ switch(Lctype)
{
case OP_ANY:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
+ if (IS_NEWLINE(Feptr)) RRETURN(MATCH_NOMATCH);
if (mb->partial != 0 &&
- eptr + 1 >= mb->end_subject &&
+ Feptr + 1 >= mb->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
- *eptr == NLBLOCK->nl[0])
+ *Feptr == NLBLOCK->nl[0])
{
mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
- eptr++;
+ Feptr++;
}
break;
case OP_ALLANY:
- if (eptr > mb->end_subject - min)
+ if (Feptr > mb->end_subject - Lmin)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- eptr += min;
- break;
-
- case OP_ANYBYTE:
- if (eptr > mb->end_subject - min)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += min;
+ Feptr += Lmin;
break;
+ /* This OP_ANYBYTE case will never be reached because \C gets turned
+ into OP_ALLANY in non-UTF mode. Cut out the code so that coverage
+ reports don't complain about it's never being used. */
+
+/* case OP_ANYBYTE:
+* if (Feptr > mb->end_subject - Lmin)
+* {
+* SCHECK_PARTIAL();
+* RRETURN(MATCH_NOMATCH);
+* }
+* Feptr += Lmin;
+* break;
+*/
case OP_ANYNL:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- switch(*eptr++)
+ switch(*Feptr++)
{
default: RRETURN(MATCH_NOMATCH);
case CHAR_CR:
- if (eptr < mb->end_subject && *eptr == CHAR_LF) eptr++;
+ if (Feptr < mb->end_subject && *Feptr == CHAR_LF) Feptr++;
break;
case CHAR_LF:
@@ -4796,14 +3178,14 @@ for (;;)
break;
case OP_NOT_HSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- switch(*eptr++)
+ switch(*Feptr++)
{
default: break;
HSPACE_BYTE_CASES:
@@ -4816,14 +3198,14 @@ for (;;)
break;
case OP_HSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- switch(*eptr++)
+ switch(*Feptr++)
{
default: RRETURN(MATCH_NOMATCH);
HSPACE_BYTE_CASES:
@@ -4836,14 +3218,14 @@ for (;;)
break;
case OP_NOT_VSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- switch(*eptr++)
+ switch(*Feptr++)
{
VSPACE_BYTE_CASES:
#if PCRE2_CODE_UNIT_WIDTH != 8
@@ -4856,14 +3238,14 @@ for (;;)
break;
case OP_VSPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- switch(*eptr++)
+ switch(*Feptr++)
{
default: RRETURN(MATCH_NOMATCH);
VSPACE_BYTE_CASES:
@@ -4876,212 +3258,212 @@ for (;;)
break;
case OP_NOT_DIGIT:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (MAX_255(*eptr) && (mb->ctypes[*eptr] & ctype_digit) != 0)
+ if (MAX_255(*Feptr) && (mb->ctypes[*Feptr] & ctype_digit) != 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
+ Feptr++;
}
break;
case OP_DIGIT:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (!MAX_255(*eptr) || (mb->ctypes[*eptr] & ctype_digit) == 0)
+ if (!MAX_255(*Feptr) || (mb->ctypes[*Feptr] & ctype_digit) == 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
+ Feptr++;
}
break;
case OP_NOT_WHITESPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (MAX_255(*eptr) && (mb->ctypes[*eptr] & ctype_space) != 0)
+ if (MAX_255(*Feptr) && (mb->ctypes[*Feptr] & ctype_space) != 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
+ Feptr++;
}
break;
case OP_WHITESPACE:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (!MAX_255(*eptr) || (mb->ctypes[*eptr] & ctype_space) == 0)
+ if (!MAX_255(*Feptr) || (mb->ctypes[*Feptr] & ctype_space) == 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
+ Feptr++;
}
break;
case OP_NOT_WORDCHAR:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (MAX_255(*eptr) && (mb->ctypes[*eptr] & ctype_word) != 0)
+ if (MAX_255(*Feptr) && (mb->ctypes[*Feptr] & ctype_word) != 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
+ Feptr++;
}
break;
case OP_WORDCHAR:
- for (i = 1; i <= min; i++)
+ for (i = 1; i <= Lmin; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (!MAX_255(*eptr) || (mb->ctypes[*eptr] & ctype_word) == 0)
+ if (!MAX_255(*Feptr) || (mb->ctypes[*Feptr] & ctype_word) == 0)
RRETURN(MATCH_NOMATCH);
- eptr++;
+ Feptr++;
}
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
}
- /* If min = max, continue at the same level without recursing */
+ /* If Lmin = Lmax we are done. Continue with the main loop. */
- if (min == max) continue;
+ if (Lmin == Lmax) continue;
/* If minimizing, we have to test the rest of the pattern before each
- subsequent match. Again, separate the UTF-8 case for speed, and also
- separate the UCP cases. */
+ subsequent match. */
- if (minimize)
+ if (reptype == REPTYPE_MIN)
{
#ifdef SUPPORT_UNICODE
- if (prop_type >= 0)
+ if (proptype >= 0)
{
- switch(prop_type)
+ switch(proptype)
{
case PT_ANY:
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM36);
+ RMATCH(Fecode, RM208);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
+ GETCHARINCTEST(fc, Feptr);
+ if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
case PT_LAMP:
- for (fi = min;; fi++)
+ for (;;)
{
int chartype;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM37);
+ RMATCH(Fecode, RM209);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- chartype = UCD_CHARTYPE(c);
+ GETCHARINCTEST(fc, Feptr);
+ chartype = UCD_CHARTYPE(fc);
if ((chartype == ucp_Lu ||
chartype == ucp_Ll ||
- chartype == ucp_Lt) == prop_fail_result)
+ chartype == ucp_Lt) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
case PT_GC:
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM38);
+ RMATCH(Fecode, RM210);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((UCD_CATEGORY(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
case PT_PC:
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM39);
+ RMATCH(Fecode, RM211);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((UCD_CHARTYPE(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
case PT_SC:
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM40);
+ RMATCH(Fecode, RM212);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((UCD_SCRIPT(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
case PT_ALNUM:
- for (fi = min;; fi++)
+ for (;;)
{
int category;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM59);
+ RMATCH(Fecode, RM213);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ category = UCD_CATEGORY(fc);
+ if ((category == ucp_L || category == ucp_N) ==
+ (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
@@ -5092,26 +3474,26 @@ for (;;)
case PT_SPACE: /* Perl space */
case PT_PXSPACE: /* POSIX space */
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM61);
+ RMATCH(Fecode, RM214);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- switch(c)
+ GETCHARINCTEST(fc, Feptr);
+ switch(fc)
{
HSPACE_CASES:
VSPACE_CASES:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
+ if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
break;
default:
- if ((UCD_CATEGORY(c) == ucp_Z) == prop_fail_result)
+ if ((UCD_CATEGORY(fc) == ucp_Z) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
break;
}
@@ -5119,87 +3501,92 @@ for (;;)
/* Control never gets here */
case PT_WORD:
- for (fi = min;; fi++)
+ for (;;)
{
int category;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM62);
+ RMATCH(Fecode, RM215);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
+ GETCHARINCTEST(fc, Feptr);
+ category = UCD_CATEGORY(fc);
if ((category == ucp_L ||
category == ucp_N ||
- c == CHAR_UNDERSCORE)
- == prop_fail_result)
+ fc == CHAR_UNDERSCORE) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
case PT_CLIST:
- for (fi = min;; fi++)
+ for (;;)
{
const uint32_t *cp;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM67);
+ RMATCH(Fecode, RM216);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + prop_value;
+ GETCHARINCTEST(fc, Feptr);
+ cp = PRIV(ucd_caseless_sets) + Lpropvalue;
for (;;)
{
- if (c < *cp)
- { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }
- if (c == *cp++)
- { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }
+ if (fc < *cp)
+ {
+ if (Lctype == OP_NOTPROP) break;
+ RRETURN(MATCH_NOMATCH);
+ }
+ if (fc == *cp++)
+ {
+ if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
+ break;
+ }
}
}
/* Control never gets here */
case PT_UCNC:
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM60);
+ RMATCH(Fecode, RM217);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- GETCHARINCTEST(c, eptr);
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == prop_fail_result)
+ GETCHARINCTEST(fc, Feptr);
+ if ((fc == CHAR_DOLLAR_SIGN || fc == CHAR_COMMERCIAL_AT ||
+ fc == CHAR_GRAVE_ACCENT || (fc >= 0xa0 && fc <= 0xd7ff) ||
+ fc >= 0xe000) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
/* This should never occur */
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
}
/* Match extended Unicode sequences. We will get here only if the
support is in the binary; otherwise a compile-time error occurs. */
- else if (ctype == OP_EXTUNI)
+ else if (Lctype == OP_EXTUNI)
{
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM41);
+ RMATCH(Fecode, RM218);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
@@ -5207,16 +3594,54 @@ for (;;)
else
{
int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < mb->end_subject)
+ GETCHARINCTEST(fc, Feptr);
+ lgb = UCD_GRAPHBREAK(fc);
+ while (Feptr < mb->end_subject)
{
int len = 1;
- if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); }
- rgb = UCD_GRAPHBREAK(c);
+ if (!utf) fc = *Feptr; else { GETCHARLEN(fc, Feptr, len); }
+ rgb = UCD_GRAPHBREAK(fc);
if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- lgb = rgb;
- eptr += len;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = Feptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(fc, bptr);
+ }
+ else
+#endif
+ fc = *bptr;
+ if (UCD_GRAPHBREAK(fc) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
+ Feptr += len;
}
}
CHECK_PARTIAL();
@@ -5225,33 +3650,34 @@ for (;;)
else
#endif /* SUPPORT_UNICODE */
+ /* UTF mode for non-property testing character types. */
+
#ifdef SUPPORT_UNICODE
if (utf)
{
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM42);
+ RMATCH(Fecode, RM219);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (ctype == OP_ANY && IS_NEWLINE(eptr))
- RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(ctype)
+ if (Lctype == OP_ANY && IS_NEWLINE(Feptr)) RRETURN(MATCH_NOMATCH);
+ GETCHARINC(fc, Feptr);
+ switch(Lctype)
{
case OP_ANY: /* This is the non-NL case */
if (mb->partial != 0 && /* Take care with CRLF partial */
- eptr >= mb->end_subject &&
+ Feptr >= mb->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
- c == NLBLOCK->nl[0])
+ fc == NLBLOCK->nl[0])
{
mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
break;
@@ -5260,11 +3686,12 @@ for (;;)
break;
case OP_ANYNL:
- switch(c)
+ switch(fc)
{
default: RRETURN(MATCH_NOMATCH);
+
case CHAR_CR:
- if (eptr < mb->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
+ if (Feptr < mb->end_subject && UCHAR21(Feptr) == CHAR_LF) Feptr++;
break;
case CHAR_LF:
@@ -5277,13 +3704,14 @@ for (;;)
case 0x2028:
case 0x2029:
#endif /* Not EBCDIC */
- if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) RRETURN(MATCH_NOMATCH);
+ if (mb->bsr_convention == PCRE2_BSR_ANYCRLF)
+ RRETURN(MATCH_NOMATCH);
break;
}
break;
case OP_NOT_HSPACE:
- switch(c)
+ switch(fc)
{
HSPACE_CASES: RRETURN(MATCH_NOMATCH);
default: break;
@@ -5291,7 +3719,7 @@ for (;;)
break;
case OP_HSPACE:
- switch(c)
+ switch(fc)
{
HSPACE_CASES: break;
default: RRETURN(MATCH_NOMATCH);
@@ -5299,7 +3727,7 @@ for (;;)
break;
case OP_NOT_VSPACE:
- switch(c)
+ switch(fc)
{
VSPACE_CASES: RRETURN(MATCH_NOMATCH);
default: break;
@@ -5307,7 +3735,7 @@ for (;;)
break;
case OP_VSPACE:
- switch(c)
+ switch(fc)
{
VSPACE_CASES: break;
default: RRETURN(MATCH_NOMATCH);
@@ -5315,68 +3743,69 @@ for (;;)
break;
case OP_NOT_DIGIT:
- if (c < 256 && (mb->ctypes[c] & ctype_digit) != 0)
+ if (fc < 256 && (mb->ctypes[fc] & ctype_digit) != 0)
RRETURN(MATCH_NOMATCH);
break;
case OP_DIGIT:
- if (c >= 256 || (mb->ctypes[c] & ctype_digit) == 0)
+ if (fc >= 256 || (mb->ctypes[fc] & ctype_digit) == 0)
RRETURN(MATCH_NOMATCH);
break;
case OP_NOT_WHITESPACE:
- if (c < 256 && (mb->ctypes[c] & ctype_space) != 0)
+ if (fc < 256 && (mb->ctypes[fc] & ctype_space) != 0)
RRETURN(MATCH_NOMATCH);
break;
case OP_WHITESPACE:
- if (c >= 256 || (mb->ctypes[c] & ctype_space) == 0)
+ if (fc >= 256 || (mb->ctypes[fc] & ctype_space) == 0)
RRETURN(MATCH_NOMATCH);
break;
case OP_NOT_WORDCHAR:
- if (c < 256 && (mb->ctypes[c] & ctype_word) != 0)
+ if (fc < 256 && (mb->ctypes[fc] & ctype_word) != 0)
RRETURN(MATCH_NOMATCH);
break;
case OP_WORDCHAR:
- if (c >= 256 || (mb->ctypes[c] & ctype_word) == 0)
+ if (fc >= 256 || (mb->ctypes[fc] & ctype_word) == 0)
RRETURN(MATCH_NOMATCH);
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
}
}
else
-#endif
+#endif /* SUPPORT_UNICODE */
+
/* Not UTF mode */
{
- for (fi = min;; fi++)
+ for (;;)
{
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM43);
+ RMATCH(Fecode, RM33);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= mb->end_subject)
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
- if (ctype == OP_ANY && IS_NEWLINE(eptr))
+ if (Lctype == OP_ANY && IS_NEWLINE(Feptr))
RRETURN(MATCH_NOMATCH);
- c = *eptr++;
- switch(ctype)
+ fc = *Feptr++;
+ switch(Lctype)
{
case OP_ANY: /* This is the non-NL case */
if (mb->partial != 0 && /* Take care with CRLF partial */
- eptr >= mb->end_subject &&
+ Feptr >= mb->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
- c == NLBLOCK->nl[0])
+ fc == NLBLOCK->nl[0])
{
mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
break;
@@ -5385,11 +3814,12 @@ for (;;)
break;
case OP_ANYNL:
- switch(c)
+ switch(fc)
{
default: RRETURN(MATCH_NOMATCH);
+
case CHAR_CR:
- if (eptr < mb->end_subject && *eptr == CHAR_LF) eptr++;
+ if (Feptr < mb->end_subject && *Feptr == CHAR_LF) Feptr++;
break;
case CHAR_LF:
@@ -5402,13 +3832,14 @@ for (;;)
case 0x2028:
case 0x2029:
#endif
- if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) RRETURN(MATCH_NOMATCH);
+ if (mb->bsr_convention == PCRE2_BSR_ANYCRLF)
+ RRETURN(MATCH_NOMATCH);
break;
}
break;
case OP_NOT_HSPACE:
- switch(c)
+ switch(fc)
{
default: break;
HSPACE_BYTE_CASES:
@@ -5420,7 +3851,7 @@ for (;;)
break;
case OP_HSPACE:
- switch(c)
+ switch(fc)
{
default: RRETURN(MATCH_NOMATCH);
HSPACE_BYTE_CASES:
@@ -5432,7 +3863,7 @@ for (;;)
break;
case OP_NOT_VSPACE:
- switch(c)
+ switch(fc)
{
default: break;
VSPACE_BYTE_CASES:
@@ -5444,7 +3875,7 @@ for (;;)
break;
case OP_VSPACE:
- switch(c)
+ switch(fc)
{
default: RRETURN(MATCH_NOMATCH);
VSPACE_BYTE_CASES:
@@ -5456,31 +3887,37 @@ for (;;)
break;
case OP_NOT_DIGIT:
- if (MAX_255(c) && (mb->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH);
+ if (MAX_255(fc) && (mb->ctypes[fc] & ctype_digit) != 0)
+ RRETURN(MATCH_NOMATCH);
break;
case OP_DIGIT:
- if (!MAX_255(c) || (mb->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH);
+ if (!MAX_255(fc) || (mb->ctypes[fc] & ctype_digit) == 0)
+ RRETURN(MATCH_NOMATCH);
break;
case OP_NOT_WHITESPACE:
- if (MAX_255(c) && (mb->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH);
+ if (MAX_255(fc) && (mb->ctypes[fc] & ctype_space) != 0)
+ RRETURN(MATCH_NOMATCH);
break;
case OP_WHITESPACE:
- if (!MAX_255(c) || (mb->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH);
+ if (!MAX_255(fc) || (mb->ctypes[fc] & ctype_space) == 0)
+ RRETURN(MATCH_NOMATCH);
break;
case OP_NOT_WORDCHAR:
- if (MAX_255(c) && (mb->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH);
+ if (MAX_255(fc) && (mb->ctypes[fc] & ctype_word) != 0)
+ RRETURN(MATCH_NOMATCH);
break;
case OP_WORDCHAR:
- if (!MAX_255(c) || (mb->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH);
+ if (!MAX_255(fc) || (mb->ctypes[fc] & ctype_word) == 0)
+ RRETURN(MATCH_NOMATCH);
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
}
}
@@ -5488,113 +3925,116 @@ for (;;)
}
/* If maximizing, it is worth using inline code for speed, doing the type
- test once at the start (i.e. keep it out of the loop). Again, keep the
- UTF-8 and UCP stuff separate. */
+ test once at the start (i.e. keep it out of the loop). */
else
{
- pp = eptr; /* Remember where we started */
+ Lstart_eptr = Feptr; /* Remember where we started */
#ifdef SUPPORT_UNICODE
- if (prop_type >= 0)
+ if (proptype >= 0)
{
- switch(prop_type)
+ switch(proptype)
{
case PT_ANY:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- if (prop_fail_result) break;
- eptr+= len;
+ GETCHARLENTEST(fc, Feptr, len);
+ if (Lctype == OP_NOTPROP) break;
+ Feptr+= len;
}
break;
case PT_LAMP:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int chartype;
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- chartype = UCD_CHARTYPE(c);
+ GETCHARLENTEST(fc, Feptr, len);
+ chartype = UCD_CHARTYPE(fc);
if ((chartype == ucp_Lu ||
chartype == ucp_Ll ||
- chartype == ucp_Lt) == prop_fail_result)
+ chartype == ucp_Lt) == (Lctype == OP_NOTPROP))
break;
- eptr+= len;
+ Feptr+= len;
}
break;
case PT_GC:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) break;
- eptr+= len;
+ GETCHARLENTEST(fc, Feptr, len);
+ if ((UCD_CATEGORY(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
+ break;
+ Feptr+= len;
}
break;
case PT_PC:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) break;
- eptr+= len;
+ GETCHARLENTEST(fc, Feptr, len);
+ if ((UCD_CHARTYPE(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
+ break;
+ Feptr+= len;
}
break;
case PT_SC:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) break;
- eptr+= len;
+ GETCHARLENTEST(fc, Feptr, len);
+ if ((UCD_SCRIPT(fc) == Lpropvalue) == (Lctype == OP_NOTPROP))
+ break;
+ Feptr+= len;
}
break;
case PT_ALNUM:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int category;
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N) == prop_fail_result)
+ GETCHARLENTEST(fc, Feptr, len);
+ category = UCD_CATEGORY(fc);
+ if ((category == ucp_L || category == ucp_N) ==
+ (Lctype == OP_NOTPROP))
break;
- eptr+= len;
+ Feptr+= len;
}
break;
@@ -5604,122 +4044,123 @@ for (;;)
case PT_SPACE: /* Perl space */
case PT_PXSPACE: /* POSIX space */
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- switch(c)
+ GETCHARLENTEST(fc, Feptr, len);
+ switch(fc)
{
HSPACE_CASES:
VSPACE_CASES:
- if (prop_fail_result) goto ENDLOOP99; /* Break the loop */
+ if (Lctype == OP_NOTPROP) goto ENDLOOP99; /* Break the loop */
break;
default:
- if ((UCD_CATEGORY(c) == ucp_Z) == prop_fail_result)
+ if ((UCD_CATEGORY(fc) == ucp_Z) == (Lctype == OP_NOTPROP))
goto ENDLOOP99; /* Break the loop */
break;
}
- eptr+= len;
+ Feptr+= len;
}
ENDLOOP99:
break;
case PT_WORD:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int category;
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- category = UCD_CATEGORY(c);
+ GETCHARLENTEST(fc, Feptr, len);
+ category = UCD_CATEGORY(fc);
if ((category == ucp_L || category == ucp_N ||
- c == CHAR_UNDERSCORE) == prop_fail_result)
+ fc == CHAR_UNDERSCORE) == (Lctype == OP_NOTPROP))
break;
- eptr+= len;
+ Feptr+= len;
}
break;
case PT_CLIST:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
const uint32_t *cp;
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- cp = PRIV(ucd_caseless_sets) + prop_value;
+ GETCHARLENTEST(fc, Feptr, len);
+ cp = PRIV(ucd_caseless_sets) + Lpropvalue;
for (;;)
{
- if (c < *cp)
- { if (prop_fail_result) break; else goto GOT_MAX; }
- if (c == *cp++)
- { if (prop_fail_result) goto GOT_MAX; else break; }
+ if (fc < *cp)
+ { if (Lctype == OP_NOTPROP) break; else goto GOT_MAX; }
+ if (fc == *cp++)
+ { if (Lctype == OP_NOTPROP) goto GOT_MAX; else break; }
}
- eptr += len;
+ Feptr += len;
}
GOT_MAX:
break;
case PT_UCNC:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLENTEST(c, eptr, len);
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == prop_fail_result)
+ GETCHARLENTEST(fc, Feptr, len);
+ if ((fc == CHAR_DOLLAR_SIGN || fc == CHAR_COMMERCIAL_AT ||
+ fc == CHAR_GRAVE_ACCENT || (fc >= 0xa0 && fc <= 0xd7ff) ||
+ fc >= 0xe000) == (Lctype == OP_NOTPROP))
break;
- eptr += len;
+ Feptr += len;
}
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
- /* eptr is now past the end of the maximum run */
+ /* Feptr is now past the end of the maximum run */
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
- /* After \C in UTF mode, pp might be in the middle of a Unicode
- character. Use <= pp to ensure backtracking doesn't go too far. */
+ /* After \C in UTF mode, Lstart_eptr might be in the middle of a
+ Unicode character. Use <= pp to ensure backtracking doesn't go too far.
+ */
for(;;)
{
- if (eptr <= pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM44);
+ if (Feptr <= Lstart_eptr) break;
+ RMATCH(Fecode, RM222);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- if (utf) BACKCHAR(eptr);
+ Feptr--;
+ if (utf) BACKCHAR(Feptr);
}
}
/* Match extended Unicode grapheme clusters. We will get here only if the
support is in the binary; otherwise a compile-time error occurs. */
- else if (ctype == OP_EXTUNI)
+ else if (Lctype == OP_EXTUNI)
{
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
@@ -5727,63 +4168,101 @@ for (;;)
else
{
int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < mb->end_subject)
+ GETCHARINCTEST(fc, Feptr);
+ lgb = UCD_GRAPHBREAK(fc);
+ while (Feptr < mb->end_subject)
{
int len = 1;
- if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); }
- rgb = UCD_GRAPHBREAK(c);
+ if (!utf) fc = *Feptr; else { GETCHARLEN(fc, Feptr, len); }
+ rgb = UCD_GRAPHBREAK(fc);
if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- lgb = rgb;
- eptr += len;
+
+ /* Not breaking between Regional Indicators is allowed only if
+ there are an even number of preceding RIs. */
+
+ if (lgb == ucp_gbRegionalIndicator &&
+ rgb == ucp_gbRegionalIndicator)
+ {
+ int ricount = 0;
+ PCRE2_SPTR bptr = Feptr - 1;
+#ifdef SUPPORT_UNICODE
+ if (utf) BACKCHAR(bptr);
+#endif
+ /* bptr is pointing to the left-hand character */
+
+ while (bptr > mb->start_subject)
+ {
+ bptr--;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ BACKCHAR(bptr);
+ GETCHAR(fc, bptr);
+ }
+ else
+#endif
+ fc = *bptr;
+ if (UCD_GRAPHBREAK(fc) != ucp_gbRegionalIndicator) break;
+ ricount++;
+ }
+ if ((ricount & 1) != 0) break; /* Grapheme break required */
+ }
+
+ /* If Extend follows E_Base[_GAZ] do not update lgb; this allows
+ any number of Extend before a following E_Modifier. */
+
+ if (rgb != ucp_gbExtend ||
+ (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ))
+ lgb = rgb;
+
+ Feptr += len;
}
}
CHECK_PARTIAL();
}
- /* eptr is now past the end of the maximum run */
+ /* Feptr is now past the end of the maximum run */
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
- /* We use <= pp rather than == pp to detect the start of the run while
- backtracking because the use of \C in UTF mode can cause BACKCHAR to
- move back past pp. This is just palliative; the use of \C in UTF mode
- is fraught with danger. */
+ /* We use <= Lstart_eptr rather than == Lstart_eptr to detect the start
+ of the run while backtracking because the use of \C in UTF mode can
+ cause BACKCHAR to move back past Lstart_eptr. This is just palliative;
+ the use of \C in UTF mode is fraught with danger. */
for(;;)
{
int lgb, rgb;
PCRE2_SPTR fptr;
- if (eptr <= pp) goto TAIL_RECURSE; /* At start of char run */
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM45);
+ if (Feptr <= Lstart_eptr) break; /* At start of char run */
+ RMATCH(Fecode, RM220);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
/* Backtracking over an extended grapheme cluster involves inspecting
the previous two characters (if present) to see if a break is
permitted between them. */
- eptr--;
- if (!utf) c = *eptr; else
+ Feptr--;
+ if (!utf) fc = *Feptr; else
{
- BACKCHAR(eptr);
- GETCHAR(c, eptr);
+ BACKCHAR(Feptr);
+ GETCHAR(fc, Feptr);
}
- rgb = UCD_GRAPHBREAK(c);
+ rgb = UCD_GRAPHBREAK(fc);
for (;;)
{
- if (eptr <= pp) goto TAIL_RECURSE; /* At start of char run */
- fptr = eptr - 1;
- if (!utf) c = *fptr; else
+ if (Feptr <= Lstart_eptr) break; /* At start of char run */
+ fptr = Feptr - 1;
+ if (!utf) fc = *fptr; else
{
BACKCHAR(fptr);
- GETCHAR(c, fptr);
+ GETCHAR(fc, fptr);
}
- lgb = UCD_GRAPHBREAK(c);
+ lgb = UCD_GRAPHBREAK(fc);
if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- eptr = fptr;
+ Feptr = fptr;
rgb = lgb;
}
}
@@ -5795,325 +4274,328 @@ for (;;)
#ifdef SUPPORT_UNICODE
if (utf)
{
- switch(ctype)
+ switch(Lctype)
{
case OP_ANY:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (IS_NEWLINE(eptr)) break;
+ if (IS_NEWLINE(Feptr)) break;
if (mb->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= mb->end_subject &&
+ Feptr + 1 >= mb->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
+ UCHAR21(Feptr) == NLBLOCK->nl[0])
{
mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
- eptr++;
- ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
+ Feptr++;
+ ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
}
break;
case OP_ALLANY:
- if (max < INT_MAX)
+ if (Lmax < UINT32_MAX)
{
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- eptr++;
- ACROSSCHAR(eptr < mb->end_subject, *eptr, eptr++);
+ Feptr++;
+ ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
}
}
else
{
- eptr = mb->end_subject; /* Unlimited UTF-8 repeat */
+ Feptr = mb->end_subject; /* Unlimited UTF-8 repeat */
SCHECK_PARTIAL();
}
break;
- /* The byte case is the same as non-UTF8 */
+ /* The "byte" (i.e. "code unit") case is the same as non-UTF */
case OP_ANYBYTE:
- c = max - min;
- if (c > (uint32_t)(mb->end_subject - eptr))
+ fc = Lmax - Lmin;
+ if (fc > (uint32_t)(mb->end_subject - Feptr))
{
- eptr = mb->end_subject;
+ Feptr = mb->end_subject;
SCHECK_PARTIAL();
}
- else eptr += c;
+ else Feptr += fc;
break;
case OP_ANYNL:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c == CHAR_CR)
+ GETCHARLEN(fc, Feptr, len);
+ if (fc == CHAR_CR)
{
- if (++eptr >= mb->end_subject) break;
- if (UCHAR21(eptr) == CHAR_LF) eptr++;
+ if (++Feptr >= mb->end_subject) break;
+ if (UCHAR21(Feptr) == CHAR_LF) Feptr++;
}
else
{
- if (c != CHAR_LF &&
+ if (fc != CHAR_LF &&
(mb->bsr_convention == PCRE2_BSR_ANYCRLF ||
- (c != CHAR_VT && c != CHAR_FF && c != CHAR_NEL
+ (fc != CHAR_VT && fc != CHAR_FF && fc != CHAR_NEL
#ifndef EBCDIC
- && c != 0x2028 && c != 0x2029
+ && fc != 0x2028 && fc != 0x2029
#endif /* Not EBCDIC */
)))
break;
- eptr += len;
+ Feptr += len;
}
}
break;
case OP_NOT_HSPACE:
case OP_HSPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
BOOL gotspace;
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- switch(c)
+ GETCHARLEN(fc, Feptr, len);
+ switch(fc)
{
HSPACE_CASES: gotspace = TRUE; break;
default: gotspace = FALSE; break;
}
- if (gotspace == (ctype == OP_NOT_HSPACE)) break;
- eptr += len;
+ if (gotspace == (Lctype == OP_NOT_HSPACE)) break;
+ Feptr += len;
}
break;
case OP_NOT_VSPACE:
case OP_VSPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
BOOL gotspace;
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- switch(c)
+ GETCHARLEN(fc, Feptr, len);
+ switch(fc)
{
VSPACE_CASES: gotspace = TRUE; break;
default: gotspace = FALSE; break;
}
- if (gotspace == (ctype == OP_NOT_VSPACE)) break;
- eptr += len;
+ if (gotspace == (Lctype == OP_NOT_VSPACE)) break;
+ Feptr += len;
}
break;
case OP_NOT_DIGIT:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (mb->ctypes[c] & ctype_digit) != 0) break;
- eptr+= len;
+ GETCHARLEN(fc, Feptr, len);
+ if (fc < 256 && (mb->ctypes[fc] & ctype_digit) != 0) break;
+ Feptr+= len;
}
break;
case OP_DIGIT:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c >= 256 ||(mb->ctypes[c] & ctype_digit) == 0) break;
- eptr+= len;
+ GETCHARLEN(fc, Feptr, len);
+ if (fc >= 256 ||(mb->ctypes[fc] & ctype_digit) == 0) break;
+ Feptr+= len;
}
break;
case OP_NOT_WHITESPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (mb->ctypes[c] & ctype_space) != 0) break;
- eptr+= len;
+ GETCHARLEN(fc, Feptr, len);
+ if (fc < 256 && (mb->ctypes[fc] & ctype_space) != 0) break;
+ Feptr+= len;
}
break;
case OP_WHITESPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c >= 256 ||(mb->ctypes[c] & ctype_space) == 0) break;
- eptr+= len;
+ GETCHARLEN(fc, Feptr, len);
+ if (fc >= 256 ||(mb->ctypes[fc] & ctype_space) == 0) break;
+ Feptr+= len;
}
break;
case OP_NOT_WORDCHAR:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (mb->ctypes[c] & ctype_word) != 0) break;
- eptr+= len;
+ GETCHARLEN(fc, Feptr, len);
+ if (fc < 256 && (mb->ctypes[fc] & ctype_word) != 0) break;
+ Feptr+= len;
}
break;
case OP_WORDCHAR:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
int len = 1;
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- GETCHARLEN(c, eptr, len);
- if (c >= 256 || (mb->ctypes[c] & ctype_word) == 0) break;
- eptr+= len;
+ GETCHARLEN(fc, Feptr, len);
+ if (fc >= 256 || (mb->ctypes[fc] & ctype_word) == 0) break;
+ Feptr+= len;
}
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
- /* After \C in UTF mode, pp might be in the middle of a Unicode
- character. Use <= pp to ensure backtracking doesn't go too far. */
+ /* After \C in UTF mode, Lstart_eptr might be in the middle of a
+ Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't go
+ too far. */
for(;;)
{
- if (eptr <= pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM46);
+ if (Feptr <= Lstart_eptr) break;
+ RMATCH(Fecode, RM221);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- if (ctype == OP_ANYNL && eptr > pp && UCHAR21(eptr) == CHAR_NL &&
- UCHAR21(eptr - 1) == CHAR_CR) eptr--;
+ Feptr--;
+ BACKCHAR(Feptr);
+ if (Lctype == OP_ANYNL && Feptr > Lstart_eptr &&
+ UCHAR21(Feptr) == CHAR_NL && UCHAR21(Feptr - 1) == CHAR_CR)
+ Feptr--;
}
}
else
#endif /* SUPPORT_UNICODE */
+
/* Not UTF mode */
{
- switch(ctype)
+ switch(Lctype)
{
case OP_ANY:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (IS_NEWLINE(eptr)) break;
+ if (IS_NEWLINE(Feptr)) break;
if (mb->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= mb->end_subject &&
+ Feptr + 1 >= mb->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
- *eptr == NLBLOCK->nl[0])
+ *Feptr == NLBLOCK->nl[0])
{
mb->hitend = TRUE;
- if (mb->partial > 1) RRETURN(PCRE2_ERROR_PARTIAL);
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
}
- eptr++;
+ Feptr++;
}
break;
case OP_ALLANY:
case OP_ANYBYTE:
- c = max - min;
- if (c > (uint32_t)(mb->end_subject - eptr))
+ fc = Lmax - Lmin;
+ if (fc > (uint32_t)(mb->end_subject - Feptr))
{
- eptr = mb->end_subject;
+ Feptr = mb->end_subject;
SCHECK_PARTIAL();
}
- else eptr += c;
+ else Feptr += fc;
break;
case OP_ANYNL:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- c = *eptr;
- if (c == CHAR_CR)
+ fc = *Feptr;
+ if (fc == CHAR_CR)
{
- if (++eptr >= mb->end_subject) break;
- if (*eptr == CHAR_LF) eptr++;
+ if (++Feptr >= mb->end_subject) break;
+ if (*Feptr == CHAR_LF) Feptr++;
}
else
{
- if (c != CHAR_LF && (mb->bsr_convention == PCRE2_BSR_ANYCRLF ||
- (c != CHAR_VT && c != CHAR_FF && c != CHAR_NEL
+ if (fc != CHAR_LF && (mb->bsr_convention == PCRE2_BSR_ANYCRLF ||
+ (fc != CHAR_VT && fc != CHAR_FF && fc != CHAR_NEL
#if PCRE2_CODE_UNIT_WIDTH != 8
- && c != 0x2028 && c != 0x2029
+ && fc != 0x2028 && fc != 0x2029
#endif
))) break;
- eptr++;
+ Feptr++;
}
}
break;
case OP_NOT_HSPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- switch(*eptr)
+ switch(*Feptr)
{
- default: eptr++; break;
+ default: Feptr++; break;
HSPACE_BYTE_CASES:
#if PCRE2_CODE_UNIT_WIDTH != 8
HSPACE_MULTIBYTE_CASES:
@@ -6125,37 +4607,37 @@ for (;;)
break;
case OP_HSPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- switch(*eptr)
+ switch(*Feptr)
{
default: goto ENDLOOP01;
HSPACE_BYTE_CASES:
#if PCRE2_CODE_UNIT_WIDTH != 8
HSPACE_MULTIBYTE_CASES:
#endif
- eptr++; break;
+ Feptr++; break;
}
}
ENDLOOP01:
break;
case OP_NOT_VSPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- switch(*eptr)
+ switch(*Feptr)
{
- default: eptr++; break;
+ default: Feptr++; break;
VSPACE_BYTE_CASES:
#if PCRE2_CODE_UNIT_WIDTH != 8
VSPACE_MULTIBYTE_CASES:
@@ -6167,251 +4649,1493 @@ for (;;)
break;
case OP_VSPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- switch(*eptr)
+ switch(*Feptr)
{
default: goto ENDLOOP03;
VSPACE_BYTE_CASES:
#if PCRE2_CODE_UNIT_WIDTH != 8
VSPACE_MULTIBYTE_CASES:
#endif
- eptr++; break;
+ Feptr++; break;
}
}
ENDLOOP03:
break;
case OP_NOT_DIGIT:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (MAX_255(*eptr) && (mb->ctypes[*eptr] & ctype_digit) != 0) break;
- eptr++;
+ if (MAX_255(*Feptr) && (mb->ctypes[*Feptr] & ctype_digit) != 0)
+ break;
+ Feptr++;
}
break;
case OP_DIGIT:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (!MAX_255(*eptr) || (mb->ctypes[*eptr] & ctype_digit) == 0) break;
- eptr++;
+ if (!MAX_255(*Feptr) || (mb->ctypes[*Feptr] & ctype_digit) == 0)
+ break;
+ Feptr++;
}
break;
case OP_NOT_WHITESPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (MAX_255(*eptr) && (mb->ctypes[*eptr] & ctype_space) != 0) break;
- eptr++;
+ if (MAX_255(*Feptr) && (mb->ctypes[*Feptr] & ctype_space) != 0)
+ break;
+ Feptr++;
}
break;
case OP_WHITESPACE:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (!MAX_255(*eptr) || (mb->ctypes[*eptr] & ctype_space) == 0) break;
- eptr++;
+ if (!MAX_255(*Feptr) || (mb->ctypes[*Feptr] & ctype_space) == 0)
+ break;
+ Feptr++;
}
break;
case OP_NOT_WORDCHAR:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (MAX_255(*eptr) && (mb->ctypes[*eptr] & ctype_word) != 0) break;
- eptr++;
+ if (MAX_255(*Feptr) && (mb->ctypes[*Feptr] & ctype_word) != 0)
+ break;
+ Feptr++;
}
break;
case OP_WORDCHAR:
- for (i = min; i < max; i++)
+ for (i = Lmin; i < Lmax; i++)
{
- if (eptr >= mb->end_subject)
+ if (Feptr >= mb->end_subject)
{
SCHECK_PARTIAL();
break;
}
- if (!MAX_255(*eptr) || (mb->ctypes[*eptr] & ctype_word) == 0) break;
- eptr++;
+ if (!MAX_255(*Feptr) || (mb->ctypes[*Feptr] & ctype_word) == 0)
+ break;
+ Feptr++;
}
break;
default:
- RRETURN(PCRE2_ERROR_INTERNAL);
+ return PCRE2_ERROR_INTERNAL;
}
- if (possessive) continue; /* No backtracking */
+ if (reptype == REPTYPE_POS) continue; /* No backtracking */
+
for (;;)
{
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, mb, eptrb, RM47);
+ if (Feptr == Lstart_eptr) break;
+ RMATCH(Fecode, RM34);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- if (ctype == OP_ANYNL && eptr > pp && *eptr == CHAR_LF &&
- eptr[-1] == CHAR_CR) eptr--;
+ Feptr--;
+ if (Lctype == OP_ANYNL && Feptr > Lstart_eptr && *Feptr == CHAR_LF &&
+ Feptr[-1] == CHAR_CR) Feptr--;
+ }
+ }
+ }
+ break; /* End of repeat character type processing */
+
+#undef Lstart_eptr
+#undef Lmin
+#undef Lmax
+#undef Lctype
+#undef Lpropvalue
+
+
+ /* ===================================================================== */
+ /* Match a back reference, possibly repeatedly. Look past the end of the
+ item to see if there is repeat information following. The OP_REF and
+ OP_REFI opcodes are used for a reference to a numbered group or to a
+ non-duplicated named group. For a duplicated named group, OP_DNREF and
+ OP_DNREFI are used. In this case we must scan the list of groups to which
+ the name refers, and use the first one that is set. */
+
+#define Lmin F->temp_32[0]
+#define Lmax F->temp_32[1]
+#define Lcaseless F->temp_32[2]
+#define Lstart F->temp_sptr[0]
+#define Loffset F->temp_size
+
+ case OP_DNREF:
+ case OP_DNREFI:
+ Lcaseless = (Fop == OP_DNREFI);
+ {
+ int count = GET2(Fecode, 1+IMM2_SIZE);
+ PCRE2_SPTR slot = mb->name_table + GET2(Fecode, 1) * mb->name_entry_size;
+ Fecode += 1 + 2*IMM2_SIZE;
+
+ while (count-- > 0)
+ {
+ Loffset = (GET2(slot, 0) << 1) - 2;
+ if (Loffset < Foffset_top && Fovector[Loffset] != PCRE2_UNSET) break;
+ slot += mb->name_entry_size;
+ }
+ }
+ goto REF_REPEAT;
+
+ case OP_REF:
+ case OP_REFI:
+ Lcaseless = (Fop == OP_REFI);
+ Loffset = (GET2(Fecode, 1) << 1) - 2;
+ Fecode += 1 + IMM2_SIZE;
+
+ /* Set up for repetition, or handle the non-repeated case. The maximum and
+ minimum must be in the heap frame, but as they are short-term values, we
+ use temporary fields. */
+
+ REF_REPEAT:
+ switch (*Fecode)
+ {
+ case OP_CRSTAR:
+ case OP_CRMINSTAR:
+ case OP_CRPLUS:
+ case OP_CRMINPLUS:
+ case OP_CRQUERY:
+ case OP_CRMINQUERY:
+ fc = *Fecode++ - OP_CRSTAR;
+ Lmin = rep_min[fc];
+ Lmax = rep_max[fc];
+ reptype = rep_typ[fc];
+ break;
+
+ case OP_CRRANGE:
+ case OP_CRMINRANGE:
+ Lmin = GET2(Fecode, 1);
+ Lmax = GET2(Fecode, 1 + IMM2_SIZE);
+ reptype = rep_typ[*Fecode - OP_CRSTAR];
+ if (Lmax == 0) Lmax = UINT32_MAX; /* Max 0 => infinity */
+ Fecode += 1 + 2 * IMM2_SIZE;
+ break;
+
+ default: /* No repeat follows */
+ {
+ rrc = match_ref(Loffset, Lcaseless, F, mb, &length);
+ if (rrc != 0)
+ {
+ if (rrc > 0) Feptr = mb->end_subject; /* Partial match */
+ CHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
}
}
+ Feptr += length;
+ continue; /* With the main loop */
+ }
+
+ /* Handle repeated back references. If a set group has length zero, just
+ continue with the main loop, because it matches however many times. For an
+ unset reference, if the minimum is zero, we can also just continue. We can
+ also continue if PCRE2_MATCH_UNSET_BACKREF is set, because this makes unset
+ group behave as a zero-length group. For any other unset cases, carrying
+ on will result in NOMATCH. */
+ if (Loffset < Foffset_top && Fovector[Loffset] != PCRE2_UNSET)
+ {
+ if (Fovector[Loffset] == Fovector[Loffset + 1]) continue;
+ }
+ else /* Group is not set */
+ {
+ if (Lmin == 0 || (mb->poptions & PCRE2_MATCH_UNSET_BACKREF) != 0)
+ continue;
+ }
+
+ /* First, ensure the minimum number of matches are present. */
+
+ for (i = 1; i <= Lmin; i++)
+ {
+ PCRE2_SIZE slength;
+ rrc = match_ref(Loffset, Lcaseless, F, mb, &slength);
+ if (rrc != 0)
+ {
+ if (rrc > 0) Feptr = mb->end_subject; /* Partial match */
+ CHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ Feptr += slength;
+ }
+
+ /* If min = max, we are done. They are not both allowed to be zero. */
+
+ if (Lmin == Lmax) continue;
+
+ /* If minimizing, keep trying and advancing the pointer. */
+
+ if (reptype == REPTYPE_MIN)
+ {
+ for (;;)
+ {
+ PCRE2_SIZE slength;
+ RMATCH(Fecode, RM20);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
+ rrc = match_ref(Loffset, Lcaseless, F, mb, &slength);
+ if (rrc != 0)
+ {
+ if (rrc > 0) Feptr = mb->end_subject; /* Partial match */
+ CHECK_PARTIAL();
+ RRETURN(MATCH_NOMATCH);
+ }
+ Feptr += slength;
+ }
/* Control never gets here */
}
- /* There's been some horrible disaster. Arrival here can only mean there is
- something seriously wrong in the code above or the OP_xxx definitions. */
+ /* If maximizing, find the longest string and work backwards, as long as
+ the matched lengths for each iteration are the same. */
- default:
- RRETURN(PCRE2_ERROR_INTERNAL);
- }
+ else
+ {
+ BOOL samelengths = TRUE;
+ Lstart = Feptr; /* Starting position */
+ Flength = Fovector[Loffset+1] - Fovector[Loffset];
- /* Do not stick any code in here without much thought; it is assumed
- that "continue" in the code above comes out to here to repeat the main
- loop. */
+ for (i = Lmin; i < Lmax; i++)
+ {
+ PCRE2_SIZE slength;
+ rrc = match_ref(Loffset, Lcaseless, F, mb, &slength);
+ if (rrc != 0)
+ {
+ /* Can't use CHECK_PARTIAL because we don't want to update Feptr in
+ the soft partial matching case. */
- } /* End of main loop */
-/* Control never reaches here */
+ if (rrc > 0 && mb->partial != 0 &&
+ mb->end_subject > mb->start_used_ptr)
+ {
+ mb->hitend = TRUE;
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
+ }
+ break;
+ }
+ if (slength != Flength) samelengths = FALSE;
+ Feptr += slength;
+ }
-/* When compiling to use the heap rather than the stack for recursive calls to
-match(), the RRETURN() macro jumps here. The number that is saved in
-frame->Xwhere indicates which label we actually want to return to. */
+ /* If the length matched for each repetition is the same as the length of
+ the captured group, we can easily work backwards. This is the normal
+ case. However, in caseless UTF-8 mode there are pairs of case-equivalent
+ characters whose lengths (in terms of code units) differ. However, this
+ is very rare, so we handle it by re-matching fewer and fewer times. */
-#ifdef HEAP_MATCH_RECURSE
-#define LBL(val) case val: goto L_RM##val;
-HEAP_RETURN:
-switch (frame->Xwhere)
- {
- LBL( 1) LBL( 2) LBL( 3) LBL( 4) LBL( 5) LBL( 6) LBL( 7) LBL( 8)
- LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(17)
- LBL(19) LBL(24) LBL(25) LBL(26) LBL(27) LBL(29) LBL(31) LBL(33)
- LBL(35) LBL(43) LBL(47) LBL(48) LBL(49) LBL(50) LBL(51) LBL(52)
- LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64)
- LBL(65) LBL(66) LBL(68)
-#ifdef SUPPORT_WIDE_CHARS
- LBL(20) LBL(21)
+ if (samelengths)
+ {
+ while (Feptr >= Lstart)
+ {
+ RMATCH(Fecode, RM21);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Feptr -= Flength;
+ }
+ }
+
+ /* The rare case of non-matching lengths. Re-scan the repetition for each
+ iteration. We know that match_ref() will succeed every time. */
+
+ else
+ {
+ Lmax = i;
+ for (;;)
+ {
+ RMATCH(Fecode, RM22);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ if (Feptr == Lstart) break; /* Failed after minimal repetition */
+ Feptr = Lstart;
+ Lmax--;
+ for (i = Lmin; i < Lmax; i++)
+ {
+ PCRE2_SIZE slength;
+ (void)match_ref(Loffset, Lcaseless, F, mb, &slength);
+ Feptr += slength;
+ }
+ }
+ }
+
+ RRETURN(MATCH_NOMATCH);
+ }
+ /* Control never gets here */
+
+#undef Lcaseless
+#undef Lmin
+#undef Lmax
+#undef Lstart
+#undef Loffset
+
+
+
+/* ========================================================================= */
+/* Opcodes for the start of various parenthesized items */
+/* ========================================================================= */
+
+ /* In all cases, if the result of RMATCH() is MATCH_THEN, check whether the
+ (*THEN) is within the current branch by comparing the address of OP_THEN
+ that is passed back with the end of the branch. If (*THEN) is within the
+ current branch, and the branch is one of two or more alternatives (it
+ either starts or ends with OP_ALT), we have reached the limit of THEN's
+ action, so convert the return code to NOMATCH, which will cause normal
+ backtracking to happen from now on. Otherwise, THEN is passed back to an
+ outer alternative. This implements Perl's treatment of parenthesized
+ groups, where a group not containing | does not affect the current
+ alternative, that is, (X) is NOT the same as (X|(*F)). */
+
+
+ /* ===================================================================== */
+ /* BRAZERO, BRAMINZERO and SKIPZERO occur just before a non-possessive
+ bracket group, indicating that it may occur zero times. It may repeat
+ infinitely, or not at all - i.e. it could be ()* or ()? or even (){0} in
+ the pattern. Brackets with fixed upper repeat limits are compiled as a
+ number of copies, with the optional ones preceded by BRAZERO or BRAMINZERO.
+ Possessive groups with possible zero repeats are preceded by BRAPOSZERO. */
+
+#define Lnext_ecode F->temp_sptr[0]
+
+ case OP_BRAZERO:
+ Lnext_ecode = Fecode + 1;
+ RMATCH(Lnext_ecode, RM9);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ do Lnext_ecode += GET(Lnext_ecode, 1); while (*Lnext_ecode == OP_ALT);
+ Fecode = Lnext_ecode + 1 + LINK_SIZE;
+ break;
+
+ case OP_BRAMINZERO:
+ Lnext_ecode = Fecode + 1;
+ do Lnext_ecode += GET(Lnext_ecode, 1); while (*Lnext_ecode == OP_ALT);
+ RMATCH(Lnext_ecode + 1 + LINK_SIZE, RM10);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Fecode++;
+ break;
+
+#undef Lnext_ecode
+
+ case OP_SKIPZERO:
+ Fecode++;
+ do Fecode += GET(Fecode,1); while (*Fecode == OP_ALT);
+ Fecode += 1 + LINK_SIZE;
+ break;
+
+
+ /* ===================================================================== */
+ /* Handle possessive brackets with an unlimited repeat. The end of these
+ brackets will always be OP_KETRPOS, which returns MATCH_KETRPOS without
+ going further in the pattern. */
+
+#define Lframe_type F->temp_32[0]
+#define Lmatched_once F->temp_32[1]
+#define Lzero_allowed F->temp_32[2]
+#define Lstart_eptr F->temp_sptr[0]
+#define Lstart_group F->temp_sptr[1]
+
+ case OP_BRAPOSZERO:
+ Lzero_allowed = TRUE; /* Zero repeat is allowed */
+ Fecode += 1;
+ if (*Fecode == OP_CBRAPOS || *Fecode == OP_SCBRAPOS)
+ goto POSSESSIVE_CAPTURE;
+ goto POSSESSIVE_NON_CAPTURE;
+
+ case OP_BRAPOS:
+ case OP_SBRAPOS:
+ Lzero_allowed = FALSE; /* Zero repeat not allowed */
+
+ POSSESSIVE_NON_CAPTURE:
+ Lframe_type = GF_NOCAPTURE; /* Remembered frame type */
+ goto POSSESSIVE_GROUP;
+
+ case OP_CBRAPOS:
+ case OP_SCBRAPOS:
+ Lzero_allowed = FALSE; /* Zero repeat not allowed */
+
+ POSSESSIVE_CAPTURE:
+ number = GET2(Fecode, 1+LINK_SIZE);
+ Lframe_type = GF_CAPTURE | number; /* Remembered frame type */
+
+ POSSESSIVE_GROUP:
+ Lmatched_once = FALSE; /* Never matched */
+ Lstart_group = Fecode; /* Start of this group */
+
+ for (;;)
+ {
+ Lstart_eptr = Feptr; /* Position at group start */
+ group_frame_type = Lframe_type;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM8);
+ if (rrc == MATCH_KETRPOS)
+ {
+ Lmatched_once = TRUE; /* Matched at least once */
+ if (Feptr == Lstart_eptr) /* Empty match; skip to end */
+ {
+ do Fecode += GET(Fecode, 1); while (*Fecode == OP_ALT);
+ break;
+ }
+
+ Fecode = Lstart_group;
+ continue;
+ }
+
+ /* See comment above about handling THEN. */
+
+ if (rrc == MATCH_THEN)
+ {
+ PCRE2_SPTR next_ecode = Fecode + GET(Fecode,1);
+ if (mb->verb_ecode_ptr < next_ecode &&
+ (*Fecode == OP_ALT || *next_ecode == OP_ALT))
+ rrc = MATCH_NOMATCH;
+ }
+
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Fecode += GET(Fecode, 1);
+ if (*Fecode != OP_ALT) break;
+ }
+
+ /* Success if matched something or zero repeat allowed */
+
+ if (Lmatched_once || Lzero_allowed)
+ {
+ Fecode += 1 + LINK_SIZE;
+ break;
+ }
+
+ RRETURN(MATCH_NOMATCH);
+
+#undef Lmatched_once
+#undef Lzero_allowed
+#undef Lframe_type
+#undef Lstart_eptr
+#undef Lstart_group
+
+
+ /* ===================================================================== */
+ /* Handle non-capturing brackets that cannot match an empty string. When we
+ get to the final alternative within the brackets, as long as there are no
+ THEN's in the pattern, we can optimize by not recording a new backtracking
+ point. (Ideally we should test for a THEN within this group, but we don't
+ have that information.) Don't do this if we are at the very top level,
+ however, because that would make handling assertions and once-only brackets
+ messier when there is nothing to go back to. */
+
+#define Lframe_type F->temp_32[0] /* Set for all that use GROUPLOOP */
+#define Lnext_branch F->temp_sptr[0] /* Used only in OP_BRA handling */
+
+ case OP_BRA:
+ if (mb->hasthen || Frdepth == 0)
+ {
+ Lframe_type = 0;
+ goto GROUPLOOP;
+ }
+
+ for (;;)
+ {
+ Lnext_branch = Fecode + GET(Fecode, 1);
+ if (*Lnext_branch != OP_ALT) break;
+
+ /* This is never the final branch. We do not need to test for MATCH_THEN
+ here because this code is not used when there is a THEN in the pattern. */
+
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM1);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Fecode = Lnext_branch;
+ }
+
+ /* Hit the start of the final branch. Continue at this level. */
+
+ Fecode += PRIV(OP_lengths)[*Fecode];
+ break;
+
+#undef Lnext_branch
+
+
+ /* ===================================================================== */
+ /* Handle a capturing bracket, other than those that are possessive with an
+ unlimited repeat. */
+
+ case OP_CBRA:
+ case OP_SCBRA:
+ Lframe_type = GF_CAPTURE | GET2(Fecode, 1+LINK_SIZE);
+ goto GROUPLOOP;
+
+
+ /* ===================================================================== */
+ /* Atomic groups and non-capturing brackets that can match an empty string
+ must record a backtracking point and also set up a chained frame. */
+
+ case OP_ONCE:
+ case OP_SBRA:
+ Lframe_type = GF_NOCAPTURE | Fop;
+
+ GROUPLOOP:
+ for (;;)
+ {
+ group_frame_type = Lframe_type;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM2);
+ if (rrc == MATCH_THEN)
+ {
+ PCRE2_SPTR next_ecode = Fecode + GET(Fecode,1);
+ if (mb->verb_ecode_ptr < next_ecode &&
+ (*Fecode == OP_ALT || *next_ecode == OP_ALT))
+ rrc = MATCH_NOMATCH;
+ }
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Fecode += GET(Fecode, 1);
+ if (*Fecode != OP_ALT) RRETURN(MATCH_NOMATCH);
+ }
+ /* Control never reaches here. */
+
+#undef Lframe_type
+
+
+ /* ===================================================================== */
+ /* Recursion either matches the current regex, or some subexpression. The
+ offset data is the offset to the starting bracket from the start of the
+ whole pattern. (This is so that it works from duplicated subpatterns.) */
+
+#define Lframe_type F->temp_32[0]
+#define Lstart_branch F->temp_sptr[0]
+
+ case OP_RECURSE:
+ bracode = mb->start_code + GET(Fecode, 1);
+ number = (bracode == mb->start_code)? 0 : GET2(bracode, 1 + LINK_SIZE);
+
+ /* If we are already in a recursion, check for repeating the same one
+ without advancing the subject pointer. This should catch convoluted mutual
+ recursions. (Some simple cases are caught at compile time.) */
+
+ if (Fcurrent_recurse != RECURSE_UNSET)
+ {
+ offset = Flast_group_offset;
+ while (offset != PCRE2_UNSET)
+ {
+ N = (heapframe *)((char *)mb->match_frames + offset);
+ P = (heapframe *)((char *)N - frame_size);
+ if (N->group_frame_type == (GF_RECURSE | number))
+ {
+ if (Feptr == P->eptr) RRETURN(PCRE2_ERROR_RECURSELOOP);
+ break;
+ }
+ offset = P->last_group_offset;
+ }
+ }
+
+ /* Now run the recursion, branch by branch. */
+
+ Lstart_branch = bracode;
+ Lframe_type = GF_RECURSE | number;
+
+ for (;;)
+ {
+ PCRE2_SPTR next_ecode;
+
+ group_frame_type = Lframe_type;
+ RMATCH(Lstart_branch + PRIV(OP_lengths)[*Lstart_branch], RM11);
+ next_ecode = Lstart_branch + GET(Lstart_branch,1);
+
+ /* Handle backtracking verbs, which are defined in a range that can
+ easily be tested for. PCRE does not allow THEN, SKIP, PRUNE or COMMIT to
+ escape beyond a recursion; they cause a NOMATCH for the entire recursion.
+
+ When one of these verbs triggers, the current recursion group number is
+ recorded. If it matches the recursion we are processing, the verb
+ happened within the recursion and we must deal with it. Otherwise it must
+ have happened after the recursion completed, and so has to be passed
+ back. See comment above about handling THEN. */
+
+ if (rrc >= MATCH_BACKTRACK_MIN && rrc <= MATCH_BACKTRACK_MAX &&
+ mb->verb_current_recurse == (Lframe_type ^ GF_RECURSE))
+ {
+ if (rrc == MATCH_THEN && mb->verb_ecode_ptr < next_ecode &&
+ (*Lstart_branch == OP_ALT || *next_ecode == OP_ALT))
+ rrc = MATCH_NOMATCH;
+ else RRETURN(MATCH_NOMATCH);
+ }
+
+ /* Note that carrying on after (*ACCEPT) in a recursion is handled in the
+ OP_ACCEPT code. Nothing needs to be done here. */
+
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Lstart_branch = next_ecode;
+ if (*Lstart_branch != OP_ALT) RRETURN(MATCH_NOMATCH);
+ }
+ /* Control never reaches here. */
+
+#undef Lframe_type
+#undef Lstart_branch
+
+
+ /* ===================================================================== */
+ /* Positive assertions are like other groups except that PCRE doesn't allow
+ the effect of (*THEN) to escape beyond an assertion; it is therefore
+ treated as NOMATCH. (*ACCEPT) is treated as successful assertion, with its
+ captures retained. Any other return is an error. */
+
+#define Lframe_type F->temp_32[0]
+
+ case OP_ASSERT:
+ case OP_ASSERTBACK:
+ Lframe_type = GF_NOCAPTURE | Fop;
+ for (;;)
+ {
+ group_frame_type = Lframe_type;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM3);
+ if (rrc == MATCH_ACCEPT)
+ {
+ memcpy(Fovector,
+ (char *)assert_accept_frame + offsetof(heapframe, ovector),
+ assert_accept_frame->offset_top * sizeof(PCRE2_SIZE));
+ Foffset_top = assert_accept_frame->offset_top;
+ break;
+ }
+ if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
+ Fecode += GET(Fecode, 1);
+ if (*Fecode != OP_ALT) RRETURN(MATCH_NOMATCH);
+ }
+
+ do Fecode += GET(Fecode, 1); while (*Fecode == OP_ALT);
+ Fecode += 1 + LINK_SIZE;
+ break;
+
+#undef Lframe_type
+
+
+ /* ===================================================================== */
+ /* Handle negative assertions. Loop for each non-matching branch as for
+ positive assertions. */
+
+#define Lframe_type F->temp_32[0]
+
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK_NOT:
+ Lframe_type = GF_NOCAPTURE | Fop;
+
+ for (;;)
+ {
+ group_frame_type = Lframe_type;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM4);
+ switch(rrc)
+ {
+ case MATCH_ACCEPT: /* Assertion matched, therefore it fails. */
+ case MATCH_MATCH:
+ RRETURN (MATCH_NOMATCH);
+
+ case MATCH_NOMATCH: /* Branch failed, try next if present. */
+ case MATCH_THEN:
+ Fecode += GET(Fecode, 1);
+ if (*Fecode != OP_ALT) goto ASSERT_NOT_FAILED;
+ break;
+
+ case MATCH_COMMIT: /* Assertion forced to fail, therefore continue. */
+ case MATCH_SKIP:
+ case MATCH_PRUNE:
+ do Fecode += GET(Fecode, 1); while (*Fecode == OP_ALT);
+ goto ASSERT_NOT_FAILED;
+
+ default: /* Pass back any other return */
+ RRETURN(rrc);
+ }
+ }
+
+ /* None of the branches have matched or there was a backtrack to (*COMMIT),
+ (*SKIP), (*PRUNE), or (*THEN) in the last branch. This is success for a
+ negative assertion, so carry on. */
+
+ ASSERT_NOT_FAILED:
+ Fecode += 1 + LINK_SIZE;
+ break;
+
+#undef Lframe_type
+
+
+ /* ===================================================================== */
+ /* The callout item calls an external function, if one is provided, passing
+ details of the match so far. This is mainly for debugging, though the
+ function is able to force a failure. */
+
+ case OP_CALLOUT:
+ case OP_CALLOUT_STR:
+ rrc = do_callout(F, mb, &length);
+ if (rrc > 0) RRETURN(MATCH_NOMATCH);
+ if (rrc < 0) RRETURN(rrc);
+ Fecode += length;
+ break;
+
+
+ /* ===================================================================== */
+ /* Conditional group: compilation checked that there are no more than two
+ branches. If the condition is false, skipping the first branch takes us
+ past the end of the item if there is only one branch, but that's exactly
+ what we want. */
+
+ case OP_COND:
+ case OP_SCOND:
+
+ /* The variable Flength will be added to Fecode when the condition is
+ false, to get to the second branch. Setting it to the offset to the ALT or
+ KET, then incrementing Fecode achieves this effect. However, if the second
+ branch is non-existent, we must point to the KET so that the end of the
+ group is correctly processed. We now have Fecode pointing to the condition
+ or callout. */
+
+ Flength = GET(Fecode, 1); /* Offset to the second branch */
+ if (Fecode[Flength] != OP_ALT) Flength -= 1 + LINK_SIZE;
+ Fecode += 1 + LINK_SIZE; /* From this opcode */
+
+ /* Because of the way auto-callout works during compile, a callout item is
+ inserted between OP_COND and an assertion condition. Such a callout can
+ also be inserted manually. */
+
+ if (*Fecode == OP_CALLOUT || *Fecode == OP_CALLOUT_STR)
+ {
+ rrc = do_callout(F, mb, &length);
+ if (rrc > 0) RRETURN(MATCH_NOMATCH);
+ if (rrc < 0) RRETURN(rrc);
+
+ /* Advance Fecode past the callout, so it now points to the condition. We
+ must adjust Flength so that the value of Fecode+Flength is unchanged. */
+
+ Fecode += length;
+ Flength -= length;
+ }
+
+ /* Test the various possible conditions */
+
+ condition = FALSE;
+ switch(*Fecode)
+ {
+ case OP_RREF: /* Group recursion test */
+ if (Fcurrent_recurse != RECURSE_UNSET)
+ {
+ number = GET2(Fecode, 1);
+ condition = (number == RREF_ANY || number == Fcurrent_recurse);
+ }
+ break;
+
+ case OP_DNRREF: /* Duplicate named group recursion test */
+ if (Fcurrent_recurse != RECURSE_UNSET)
+ {
+ int count = GET2(Fecode, 1 + IMM2_SIZE);
+ PCRE2_SPTR slot = mb->name_table + GET2(Fecode, 1) * mb->name_entry_size;
+ while (count-- > 0)
+ {
+ number = GET2(slot, 0);
+ condition = number == Fcurrent_recurse;
+ if (condition) break;
+ slot += mb->name_entry_size;
+ }
+ }
+ break;
+
+ case OP_CREF: /* Numbered group used test */
+ offset = (GET2(Fecode, 1) << 1) - 2; /* Doubled ref number */
+ condition = offset < Foffset_top && Fovector[offset] != PCRE2_UNSET;
+ break;
+
+ case OP_DNCREF: /* Duplicate named group used test */
+ {
+ int count = GET2(Fecode, 1 + IMM2_SIZE);
+ PCRE2_SPTR slot = mb->name_table + GET2(Fecode, 1) * mb->name_entry_size;
+ while (count-- > 0)
+ {
+ offset = (GET2(slot, 0) << 1) - 2;
+ condition = offset < Foffset_top && Fovector[offset] != PCRE2_UNSET;
+ if (condition) break;
+ slot += mb->name_entry_size;
+ }
+ }
+ break;
+
+ case OP_FALSE:
+ case OP_FAIL: /* The assertion (?!) becomes OP_FAIL */
+ break;
+
+ case OP_TRUE:
+ condition = TRUE;
+ break;
+
+ /* The condition is an assertion. Run code similar to the assertion code
+ above. */
+
+#define Lpositive F->temp_32[0]
+#define Lstart_branch F->temp_sptr[0]
+
+ default:
+ Lpositive = (*Fecode == OP_ASSERT || *Fecode == OP_ASSERTBACK);
+ Lstart_branch = Fecode;
+
+ for (;;)
+ {
+ group_frame_type = GF_CONDASSERT | *Fecode;
+ RMATCH(Lstart_branch + PRIV(OP_lengths)[*Lstart_branch], RM5);
+
+ switch(rrc)
+ {
+ case MATCH_ACCEPT: /* Save captures */
+ memcpy(Fovector,
+ (char *)assert_accept_frame + offsetof(heapframe, ovector),
+ assert_accept_frame->offset_top * sizeof(PCRE2_SIZE));
+ Foffset_top = assert_accept_frame->offset_top;
+
+ /* Fall through */
+ /* In the case of a match, the captures have already been put into
+ the current frame. */
+
+ case MATCH_MATCH:
+ condition = Lpositive; /* TRUE for positive assertion */
+ break;
+
+ /* PCRE doesn't allow the effect of (*THEN) to escape beyond an
+ assertion; it is therefore always treated as NOMATCH. */
+
+ case MATCH_NOMATCH:
+ case MATCH_THEN:
+ Lstart_branch += GET(Lstart_branch, 1);
+ if (*Lstart_branch == OP_ALT) continue; /* Try next branch */
+ condition = !Lpositive; /* TRUE for negative assertion */
+ break;
+
+ /* These force no match without checking other branches. */
+
+ case MATCH_COMMIT:
+ case MATCH_SKIP:
+ case MATCH_PRUNE:
+ condition = !Lpositive;
+ break;
+
+ default:
+ RRETURN(rrc);
+ }
+ break; /* Out of the branch loop */
+ }
+
+ /* If the condition is true, find the end of the assertion so that
+ advancing past it gets us to the start of the first branch. */
+
+ if (condition)
+ {
+ do Fecode += GET(Fecode, 1); while (*Fecode == OP_ALT);
+ }
+ break; /* End of assertion condition */
+ }
+
+#undef Lpositive
+#undef Lstart_branch
+
+ /* Choose branch according to the condition. */
+
+ Fecode += condition? PRIV(OP_lengths)[*Fecode] : Flength;
+
+ /* If the opcode is OP_SCOND it means we are at a repeated conditional
+ group that might match an empty string. We must therefore descend a level
+ so that the start is remembered for checking. For OP_COND we can just
+ continue at this level. */
+
+ if (Fop == OP_SCOND)
+ {
+ group_frame_type = GF_NOCAPTURE | Fop;
+ RMATCH(Fecode, RM35);
+ RRETURN(rrc);
+ }
+ break;
+
+
+
+/* ========================================================================= */
+/* End of start of parenthesis opcodes */
+/* ========================================================================= */
+
+
+ /* ===================================================================== */
+ /* Move the subject pointer back. This occurs only at the start of each
+ branch of a lookbehind assertion. If we are too close to the start to move
+ back, fail. When working with UTF-8 we move back a number of characters,
+ not bytes. */
+
+ case OP_REVERSE:
+ number = GET(Fecode, 1);
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ while (number-- > 0)
+ {
+ if (Feptr <= mb->start_subject) RRETURN(MATCH_NOMATCH);
+ Feptr--;
+ BACKCHAR(Feptr);
+ }
+ }
+ else
#endif
+
+ /* No UTF-8 support, or not in UTF-8 mode: count is byte count */
+
+ {
+ if ((ptrdiff_t)number > Feptr - mb->start_subject) RRETURN(MATCH_NOMATCH);
+ Feptr -= number;
+ }
+
+ /* Save the earliest consulted character, then skip to next op code */
+
+ if (Feptr < mb->start_used_ptr) mb->start_used_ptr = Feptr;
+ Fecode += 1 + LINK_SIZE;
+ break;
+
+
+ /* ===================================================================== */
+ /* An alternation is the end of a branch; scan along to find the end of the
+ bracketed group. */
+
+ case OP_ALT:
+ do Fecode += GET(Fecode,1); while (*Fecode == OP_ALT);
+ break;
+
+
+ /* ===================================================================== */
+ /* The end of a parenthesized group. For all but OP_BRA and OP_COND, the
+ starting frame was added to the chained frames in order to remember the
+ starting subject position for the group. */
+
+ case OP_KET:
+ case OP_KETRMIN:
+ case OP_KETRMAX:
+ case OP_KETRPOS:
+
+ bracode = Fecode - GET(Fecode, 1);
+
+ /* Point N to the frame at the start of the most recent group.
+ Remember the subject pointer at the start of the group. */
+
+ if (*bracode != OP_BRA && *bracode != OP_COND)
+ {
+ N = (heapframe *)((char *)mb->match_frames + Flast_group_offset);
+ P = (heapframe *)((char *)N - frame_size);
+ Flast_group_offset = P->last_group_offset;
+
+#ifdef DEBUG_SHOW_RMATCH
+ fprintf(stderr, "++ KET for frame=%d type=%x prev char offset=%lu\n",
+ N->rdepth, N->group_frame_type,
+ (char *)P->eptr - (char *)mb->start_subject);
+#endif
+
+ /* If we are at the end of an assertion that is a condition, return a
+ match, discarding any intermediate backtracking points. Copy back the
+ captures into the frame before N so that they are set on return. Doing
+ this for all assertions, both positive and negative, seems to match what
+ Perl does. */
+
+ if (GF_IDMASK(N->group_frame_type) == GF_CONDASSERT)
+ {
+ memcpy((char *)P + offsetof(heapframe, ovector), Fovector,
+ Foffset_top * sizeof(PCRE2_SIZE));
+ P->offset_top = Foffset_top;
+ Fback_frame = (char *)F - (char *)P;
+ RRETURN(MATCH_MATCH);
+ }
+ }
+ else P = NULL; /* Indicates starting frame not recorded */
+
+ /* The group was not a conditional assertion. */
+
+ switch (*bracode)
+ {
+ case OP_BRA: /* No need to do anything for these */
+ case OP_COND:
+ case OP_SCOND:
+ break;
+
+ /* Positive assertions are like OP_ONCE, except that in addition the
+ subject pointer must be put back to where it was at the start of the
+ assertion. */
+
+ case OP_ASSERT:
+ case OP_ASSERTBACK:
+ if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
+ Feptr = P->eptr;
+ /* Fall through */
+
+ /* For an atomic group, discard internal backtracking points. We must
+ also ensure that any remaining branches within the top-level of the group
+ are not tried. Do this by adjusting the code pointer within the backtrack
+ frame so that it points to the final branch. */
+
+ case OP_ONCE:
+ Fback_frame = ((char *)F - (char *)P) + frame_size;
+ for (;;)
+ {
+ uint32_t y = GET(P->ecode,1);
+ if ((P->ecode)[y] != OP_ALT) break;
+ P->ecode += y;
+ }
+ break;
+
+ /* A matching negative assertion returns MATCH, which is turned into
+ NOMATCH at the assertion level. */
+
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK_NOT:
+ RRETURN(MATCH_MATCH);
+
+ /* Whole-pattern recursion is coded as a recurse into group 0, so it
+ won't be picked up here. Instead, we catch it when the OP_END is reached.
+ Other recursion is handled here. */
+
+ case OP_CBRA:
+ case OP_CBRAPOS:
+ case OP_SCBRA:
+ case OP_SCBRAPOS:
+ number = GET2(bracode, 1+LINK_SIZE);
+
+ /* Handle a recursively called group. We reinstate the previous set of
+ captures and then carry on after the recursion call. */
+
+ if (Fcurrent_recurse == number)
+ {
+ P = (heapframe *)((char *)N - frame_size);
+ memcpy((char *)F + offsetof(heapframe, ovector), P->ovector,
+ P->offset_top * sizeof(PCRE2_SIZE));
+ Foffset_top = P->offset_top;
+ Fcapture_last = P->capture_last;
+ Fcurrent_recurse = P->current_recurse;
+ Fecode = P->ecode + 1 + LINK_SIZE;
+ continue; /* With next opcode */
+ }
+
+ /* Deal with actual capturing. */
+
+ offset = (number << 1) - 2;
+ Fcapture_last = number;
+ Fovector[offset] = P->eptr - mb->start_subject;
+ Fovector[offset+1] = Feptr - mb->start_subject;
+ if (offset >= Foffset_top) Foffset_top = offset + 2;
+ break;
+ } /* End actions relating to the starting opcode */
+
+ /* OP_KETRPOS is a possessive repeating ket. Remember the current position,
+ and return the MATCH_KETRPOS. This makes it possible to do the repeats one
+ at a time from the outer level. This must precede the empty string test -
+ in this case that test is done at the outer level. */
+
+ if (*Fecode == OP_KETRPOS)
+ {
+ memcpy((char *)P + offsetof(heapframe, eptr),
+ (char *)F + offsetof(heapframe, eptr),
+ frame_copy_size);
+ RRETURN(MATCH_KETRPOS);
+ }
+
+ /* Handle the different kinds of closing brackets. A non-repeating ket
+ needs no special action, just continuing at this level. This also happens
+ for the repeating kets if the group matched no characters, in order to
+ forcibly break infinite loops. Otherwise, the repeating kets try the rest
+ of the pattern or restart from the preceding bracket, in the appropriate
+ order. */
+
+ if (Fop != OP_KET && (P == NULL || Feptr != P->eptr))
+ {
+ if (Fop == OP_KETRMIN)
+ {
+ RMATCH(Fecode + 1 + LINK_SIZE, RM6);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ Fecode -= GET(Fecode, 1);
+ break; /* End of ket processing */
+ }
+
+ /* Repeat the maximum number of times (KETRMAX) */
+
+ RMATCH(bracode, RM7);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ }
+
+ /* Carry on at this level for a non-repeating ket, or after matching an
+ empty string, or after repeating for a maximum number of times. */
+
+ Fecode += 1 + LINK_SIZE;
+ break;
+
+
+ /* ===================================================================== */
+ /* Start and end of line assertions, not multiline mode. */
+
+ case OP_CIRC: /* Start of line, unless PCRE2_NOTBOL is set. */
+ if (Feptr != mb->start_subject || (mb->moptions & PCRE2_NOTBOL) != 0)
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
+
+ case OP_SOD: /* Unconditional start of subject */
+ if (Feptr != mb->start_subject) RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
+
+ /* When PCRE2_NOTEOL is unset, assert before the subject end, or a
+ terminating newline unless PCRE2_DOLLAR_ENDONLY is set. */
+
+ case OP_DOLL:
+ if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH);
+ if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS;
+
+ /* Fall through */
+ /* Unconditional end of subject assertion (\z) */
+
+ case OP_EOD:
+ if (Feptr < mb->end_subject) RRETURN(MATCH_NOMATCH);
+ SCHECK_PARTIAL();
+ Fecode++;
+ break;
+
+ /* End of subject or ending \n assertion (\Z) */
+
+ case OP_EODN:
+ ASSERT_NL_OR_EOS:
+ if (Feptr < mb->end_subject &&
+ (!IS_NEWLINE(Feptr) || Feptr != mb->end_subject - mb->nllen))
+ {
+ if (mb->partial != 0 &&
+ Feptr + 1 >= mb->end_subject &&
+ NLBLOCK->nltype == NLTYPE_FIXED &&
+ NLBLOCK->nllen == 2 &&
+ UCHAR21TEST(Feptr) == NLBLOCK->nl[0])
+ {
+ mb->hitend = TRUE;
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
+ }
+ RRETURN(MATCH_NOMATCH);
+ }
+
+ /* Either at end of string or \n before end. */
+
+ SCHECK_PARTIAL();
+ Fecode++;
+ break;
+
+
+ /* ===================================================================== */
+ /* Start and end of line assertions, multiline mode. */
+
+ /* Start of subject unless notbol, or after any newline except for one at
+ the very end, unless PCRE2_ALT_CIRCUMFLEX is set. */
+
+ case OP_CIRCM:
+ if ((mb->moptions & PCRE2_NOTBOL) != 0 && Feptr == mb->start_subject)
+ RRETURN(MATCH_NOMATCH);
+ if (Feptr != mb->start_subject &&
+ ((Feptr == mb->end_subject &&
+ (mb->poptions & PCRE2_ALT_CIRCUMFLEX) == 0) ||
+ !WAS_NEWLINE(Feptr)))
+ RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
+
+ /* Assert before any newline, or before end of subject unless noteol is
+ set. */
+
+ case OP_DOLLM:
+ if (Feptr < mb->end_subject)
+ {
+ if (!IS_NEWLINE(Feptr))
+ {
+ if (mb->partial != 0 &&
+ Feptr + 1 >= mb->end_subject &&
+ NLBLOCK->nltype == NLTYPE_FIXED &&
+ NLBLOCK->nllen == 2 &&
+ UCHAR21TEST(Feptr) == NLBLOCK->nl[0])
+ {
+ mb->hitend = TRUE;
+ if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
+ }
+ RRETURN(MATCH_NOMATCH);
+ }
+ }
+ else
+ {
+ if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH);
+ SCHECK_PARTIAL();
+ }
+ Fecode++;
+ break;
+
+
+ /* ===================================================================== */
+ /* Start of match assertion */
+
+ case OP_SOM:
+ if (Feptr != mb->start_subject + mb->start_offset) RRETURN(MATCH_NOMATCH);
+ Fecode++;
+ break;
+
+
+ /* ===================================================================== */
+ /* Reset the start of match point */
+
+ case OP_SET_SOM:
+ Fstart_match = Feptr;
+ Fecode++;
+ break;
+
+
+ /* ===================================================================== */
+ /* Word boundary assertions. Find out if the previous and current
+ characters are "word" characters. It takes a bit more work in UTF mode.
+ Characters > 255 are assumed to be "non-word" characters when PCRE2_UCP is
+ not set. When it is set, use Unicode properties if available, even when not
+ in UTF mode. Remember the earliest and latest consulted characters. */
+
+ case OP_NOT_WORD_BOUNDARY:
+ case OP_WORD_BOUNDARY:
+ if (Feptr == mb->start_subject) prev_is_word = FALSE; else
+ {
+ PCRE2_SPTR lastptr = Feptr - 1;
#ifdef SUPPORT_UNICODE
- LBL(16) LBL(18)
- LBL(22) LBL(23) LBL(28) LBL(30)
- LBL(32) LBL(34) LBL(42) LBL(46)
- LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)
- LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)
+ if (utf)
+ {
+ BACKCHAR(lastptr);
+ GETCHAR(fc, lastptr);
+ }
+ else
#endif /* SUPPORT_UNICODE */
- default:
- return PCRE2_ERROR_INTERNAL;
- }
-#undef LBL
-#endif /* HEAP_MATCH_RECURSE */
-}
+ fc = *lastptr;
+ if (lastptr < mb->start_used_ptr) mb->start_used_ptr = lastptr;
+#ifdef SUPPORT_UNICODE
+ if ((mb->poptions & PCRE2_UCP) != 0)
+ {
+ if (fc == '_') prev_is_word = TRUE; else
+ {
+ int cat = UCD_CATEGORY(fc);
+ prev_is_word = (cat == ucp_L || cat == ucp_N);
+ }
+ }
+ else
+#endif /* SUPPORT_UNICODE */
+ prev_is_word = CHMAX_255(fc) && (mb->ctypes[fc] & ctype_word) != 0;
+ }
+ /* Get status of next character */
-/***************************************************************************
-****************************************************************************
- RECURSION IN THE match() FUNCTION
+ if (Feptr >= mb->end_subject)
+ {
+ SCHECK_PARTIAL();
+ cur_is_word = FALSE;
+ }
+ else
+ {
+ PCRE2_SPTR nextptr = Feptr + 1;
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ FORWARDCHARTEST(nextptr, mb->end_subject);
+ GETCHAR(fc, Feptr);
+ }
+ else
+#endif /* SUPPORT_UNICODE */
+ fc = *Feptr;
+ if (nextptr > mb->last_used_ptr) mb->last_used_ptr = nextptr;
+#ifdef SUPPORT_UNICODE
+ if ((mb->poptions & PCRE2_UCP) != 0)
+ {
+ if (fc == '_') cur_is_word = TRUE; else
+ {
+ int cat = UCD_CATEGORY(fc);
+ cur_is_word = (cat == ucp_L || cat == ucp_N);
+ }
+ }
+ else
+#endif /* SUPPORT_UNICODE */
+ cur_is_word = CHMAX_255(fc) && (mb->ctypes[fc] & ctype_word) != 0;
+ }
-Undefine all the macros that were defined above to handle this. */
+ /* Now see if the situation is what we want */
-#ifdef HEAP_MATCH_RECURSE
-#undef eptr
-#undef ecode
-#undef mstart
-#undef offset_top
-#undef eptrb
-#undef flags
+ if ((*Fecode++ == OP_WORD_BOUNDARY)?
+ cur_is_word == prev_is_word : cur_is_word != prev_is_word)
+ RRETURN(MATCH_NOMATCH);
+ break;
-#undef callpat
-#undef charptr
-#undef data
-#undef next_ecode
-#undef pp
-#undef prev
-#undef saved_eptr
-#undef new_recursive
+ /* ===================================================================== */
+ /* Backtracking (*VERB)s, with and without arguments. Note that if the
+ pattern is successfully matched, we do not come back from RMATCH. */
-#undef cur_is_word
-#undef condition
-#undef prev_is_word
+ case OP_MARK:
+ Fmark = mb->nomatch_mark = Fecode + 2;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode] + Fecode[1], RM12);
-#undef ctype
-#undef length
-#undef max
-#undef min
-#undef number
-#undef offset
-#undef op
-#undef save_capture_last
-#undef save_offset1
-#undef save_offset2
-#undef save_offset3
+ /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
+ argument, and we must check whether that argument matches this MARK's
+ argument. It is passed back in mb->verb_skip_ptr. If it does match, we
+ return MATCH_SKIP with mb->verb_skip_ptr now pointing to the subject
+ position that corresponds to this mark. Otherwise, pass back the return
+ code unaltered. */
-#undef newptrb
-#endif /* HEAP_MATCH_RECURSE */
+ if (rrc == MATCH_SKIP_ARG &&
+ PRIV(strcmp)(Fecode + 2, mb->verb_skip_ptr) == 0)
+ {
+ mb->verb_skip_ptr = Feptr; /* Pass back current position */
+ RRETURN(MATCH_SKIP);
+ }
+ RRETURN(rrc);
-/* These two are defined as macros in both cases */
+ case OP_FAIL:
+ RRETURN(MATCH_NOMATCH);
-#undef fc
-#undef fi
+ /* Record the current recursing group number in mb->verb_current_recurse
+ when a backtracking return such as MATCH_COMMIT is given. This enables the
+ recurse processing to catch verbs from within the recursion. */
-/***************************************************************************
-***************************************************************************/
+ case OP_COMMIT:
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM13);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_COMMIT);
+ case OP_PRUNE:
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM14);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_PRUNE);
-#ifdef HEAP_MATCH_RECURSE
-/*************************************************
-* Release allocated heap frames *
-*************************************************/
+ case OP_PRUNE_ARG:
+ Fmark = mb->nomatch_mark = Fecode + 2;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode] + Fecode[1], RM15);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_PRUNE);
-/* This function releases all the allocated frames. The base frame is on the
-machine stack, and so must not be freed.
+ case OP_SKIP:
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM16);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ mb->verb_skip_ptr = Feptr; /* Pass back current position */
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_SKIP);
-Argument:
- frame_base the address of the base frame
- mb the match block
+ /* Note that, for Perl compatibility, SKIP with an argument does NOT set
+ nomatch_mark. When a pattern match ends with a SKIP_ARG for which there was
+ not a matching mark, we have to re-run the match, ignoring the SKIP_ARG
+ that failed and any that precede it (either they also failed, or were not
+ triggered). To do this, we maintain a count of executed SKIP_ARGs. If a
+ SKIP_ARG gets to top level, the match is re-run with mb->ignore_skip_arg
+ set to the count of the one that failed. */
-Returns: nothing
-*/
+ case OP_SKIP_ARG:
+ mb->skip_arg_count++;
+ if (mb->skip_arg_count <= mb->ignore_skip_arg)
+ {
+ Fecode += PRIV(OP_lengths)[*Fecode] + Fecode[1];
+ break;
+ }
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode] + Fecode[1], RM17);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
-static void
-release_match_heapframes (heapframe *frame_base, match_block *mb)
-{
-heapframe *nextframe = frame_base->Xnextframe;
-while (nextframe != NULL)
+ /* Pass back the current skip name and return the special MATCH_SKIP_ARG
+ return code. This will either be caught by a matching MARK, or get to the
+ top, where it causes a rematch with mb->ignore_skip_arg set to the value of
+ mb->skip_arg_count. */
+
+ mb->verb_skip_ptr = Fecode + 2;
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_SKIP_ARG);
+
+ /* For THEN (and THEN_ARG) we pass back the address of the opcode, so that
+ the branch in which it occurs can be determined. */
+
+ case OP_THEN:
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM18);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ mb->verb_ecode_ptr = Fecode;
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_THEN);
+
+ case OP_THEN_ARG:
+ Fmark = mb->nomatch_mark = Fecode + 2;
+ RMATCH(Fecode + PRIV(OP_lengths)[*Fecode] + Fecode[1], RM19);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ mb->verb_ecode_ptr = Fecode;
+ mb->verb_current_recurse = Fcurrent_recurse;
+ RRETURN(MATCH_THEN);
+
+
+ /* ===================================================================== */
+ /* There's been some horrible disaster. Arrival here can only mean there is
+ something seriously wrong in the code above or the OP_xxx definitions. */
+
+ default:
+ return PCRE2_ERROR_INTERNAL;
+ }
+
+ /* Do not insert any code in here without much thought; it is assumed
+ that "continue" in the code above comes out to here to repeat the main
+ loop. */
+
+ } /* End of main loop */
+/* Control never reaches here */
+
+
+/* ========================================================================= */
+/* The RRETURN() macro jumps here. The number that is saved in Freturn_id
+indicates which label we actually want to return to. The value in Frdepth is
+the index number of the frame in the vector. The return value has been placed
+in rrc. */
+
+#define LBL(val) case val: goto L_RM##val;
+
+RETURN_SWITCH:
+if (Frdepth == 0) return rrc; /* Exit from the top level */
+F = (heapframe *)((char *)F - Fback_frame); /* Back track */
+
+#ifdef DEBUG_SHOW_RMATCH
+fprintf(stderr, "++ RETURN %d to %d\n", rrc, Freturn_id);
+#endif
+
+switch (Freturn_id)
{
- heapframe *oldframe = nextframe;
- nextframe = nextframe->Xnextframe;
- mb->stack_memctl.free(oldframe, mb->stack_memctl.memory_data);
+ LBL( 1) LBL( 2) LBL( 3) LBL( 4) LBL( 5) LBL( 6) LBL( 7) LBL( 8)
+ LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(16)
+ LBL(17) LBL(18) LBL(19) LBL(20) LBL(21) LBL(22) LBL(23) LBL(24)
+ LBL(25) LBL(26) LBL(27) LBL(28) LBL(29) LBL(30) LBL(31) LBL(32)
+ LBL(33) LBL(34) LBL(35)
+
+#ifdef SUPPORT_WIDE_CHARS
+ LBL(100) LBL(101)
+#endif
+
+#ifdef SUPPORT_UNICODE
+ LBL(200) LBL(201) LBL(202) LBL(203) LBL(204) LBL(205) LBL(206)
+ LBL(207) LBL(208) LBL(209) LBL(210) LBL(211) LBL(212) LBL(213)
+ LBL(214) LBL(215) LBL(216) LBL(217) LBL(218) LBL(219) LBL(220)
+ LBL(221) LBL(222)
+#endif
+
+ default:
+ return PCRE2_ERROR_INTERNAL;
}
+#undef LBL
}
-#endif /* HEAP_MATCH_RECURSE */
-
/*************************************************
@@ -6444,8 +6168,6 @@ pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
pcre2_match_context *mcontext)
{
int rc;
-int ocount;
-
const uint8_t *start_bits = NULL;
const pcre2_real_code *re = (const pcre2_real_code *)code;
@@ -6455,7 +6177,6 @@ BOOL firstline;
BOOL has_first_cu = FALSE;
BOOL has_req_cu = FALSE;
BOOL startline;
-BOOL using_temporary_offsets = FALSE;
BOOL utf;
PCRE2_UCHAR first_cu = 0;
@@ -6470,18 +6191,21 @@ PCRE2_SPTR req_cu_ptr = start_match - 1;
PCRE2_SPTR start_partial = NULL;
PCRE2_SPTR match_partial = NULL;
-/* We need to have mb pointing to a match block, because the IS_NEWLINE macro
-is used below, and it expects NLBLOCK to be defined as a pointer. */
+PCRE2_SIZE frame_size;
+
+/* We need to have mb as a pointer to a match block, because the IS_NEWLINE
+macro is used below, and it expects NLBLOCK to be defined as a pointer. */
match_block actual_match_block;
match_block *mb = &actual_match_block;
-#ifdef HEAP_MATCH_RECURSE
-heapframe frame_zero;
-frame_zero.Xprevframe = NULL; /* Marks the top level */
-frame_zero.Xnextframe = NULL; /* None are allocated yet */
-mb->match_frames_base = &frame_zero;
-#endif
+/* Allocate an initial vector of backtracking frames on the stack. If this
+proves to be too small, it is replaced by a larger one on the heap. To get a
+vector of the size required that is aligned for pointers, allocate it as a
+vector of pointers. */
+
+PCRE2_SPTR stack_frames_vector[START_FRAMES_SIZE/sizeof(PCRE2_SPTR)];
+mb->stack_frames = (heapframe *)stack_frames_vector;
/* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated
subject string. */
@@ -6510,8 +6234,8 @@ options variable for this function. Users of PCRE2 who are not calling the
function directly would like to have a way of setting these flags, in the same
way that they can set pcre2_compile() flags like PCRE2_NO_AUTOPOSSESS with
constructions like (*NO_AUTOPOSSESS). To enable this, (*NOTEMPTY) and
-(*NOTEMPTY_ATSTART) set bits in the pattern's "flag" function which can now be
-transferred to the options for this function. The bits are guaranteed to be
+(*NOTEMPTY_ATSTART) set bits in the pattern's "flag" function which we now
+transfer to the options for this function. The bits are guaranteed to be
adjacent, but do not have the same values. This bit of Boolean trickery assumes
that the match-time bits are not more significant than the flag bits. If by
accident this is not the case, a compile-time division by zero error will
@@ -6523,20 +6247,22 @@ options |= (re->flags & FF) / ((FF & (~FF+1)) / (OO & (~OO+1)));
#undef FF
#undef OO
-/* A NULL match context means "use a default context" */
-
-if (mcontext == NULL)
- mcontext = (pcre2_match_context *)(&PRIV(default_match_context));
-
/* These two settings are used in the code for checking a UTF string that
follows immediately afterwards. Other values in the mb block are used only
-during interpretive pcre_match() processing, not when the JIT support is in
-use, so they are set up later. */
+during interpretive processing, not when the JIT support is in use, so they are
+set up later. */
utf = (re->overall_options & PCRE2_UTF) != 0;
mb->partial = ((options & PCRE2_PARTIAL_HARD) != 0)? 2 :
((options & PCRE2_PARTIAL_SOFT) != 0)? 1 : 0;
+/* Partial matching and PCRE2_ENDANCHORED are currently not allowed at the same
+time. */
+
+if (mb->partial != 0 &&
+ ((re->overall_options | options) & PCRE2_ENDANCHORED) != 0)
+ return PCRE2_ERROR_BADOPTION;
+
/* Check a UTF string for validity if required. For 8-bit and 16-bit strings,
we must also check that a starting offset does not point into the middle of a
multiunit character. We check only the portion of the subject that is going to
@@ -6595,7 +6321,7 @@ if (utf && (options & PCRE2_NO_UTF_CHECK) == 0)
/* It is an error to set an offset limit without setting the flag at compile
time. */
-if (mcontext->offset_limit != PCRE2_UNSET &&
+if (mcontext != NULL && mcontext->offset_limit != PCRE2_UNSET &&
(re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0)
return PCRE2_ERROR_BADOFFSETLIMIT;
@@ -6614,7 +6340,15 @@ if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0)
}
#endif
-/* Carry on with non-JIT matching. */
+/* Carry on with non-JIT matching. A NULL match context means "use a default
+context", but we take the memory control functions from the pattern. */
+
+if (mcontext == NULL)
+ {
+ mcontext = (pcre2_match_context *)(&PRIV(default_match_context));
+ mb->memctl = re->memctl;
+ }
+else mb->memctl = mcontext->memctl;
anchored = ((re->overall_options | options) & PCRE2_ANCHORED) != 0;
firstline = (re->overall_options & PCRE2_FIRSTLINE) != 0;
@@ -6622,14 +6356,10 @@ startline = (re->flags & PCRE2_STARTLINE) != 0;
bumpalong_limit = (mcontext->offset_limit == PCRE2_UNSET)?
end_subject : subject + mcontext->offset_limit;
-/* Fill in the fields in the match block. */
+/* Fill in the remaining fields in the match block. */
mb->callout = mcontext->callout;
mb->callout_data = mcontext->callout_data;
-mb->memctl = mcontext->memctl;
-#ifdef HEAP_MATCH_RECURSE
-mb->stack_memctl = mcontext->stack_memctl;
-#endif
mb->start_subject = subject;
mb->start_offset = start_offset;
@@ -6641,8 +6371,6 @@ mb->poptions = re->overall_options; /* Pattern options */
mb->ignore_skip_arg = 0;
mb->mark = mb->nomatch_mark = NULL; /* In case never set */
-mb->recursive = NULL; /* No recursion at top level */
-mb->ovecsave_chain = NULL; /* No ovecsave blocks yet */
mb->hitend = FALSE;
/* The name table is needed for finding all the numbers associated with a
@@ -6653,20 +6381,6 @@ mb->name_count = re->name_count;
mb->name_entry_size = re->name_entry_size;
mb->start_code = mb->name_table + re->name_count * re->name_entry_size;
-/* Limits set in the pattern override the match context only if they are
-smaller. */
-
-mb->match_limit = (mcontext->match_limit < re->limit_match)?
- mcontext->match_limit : re->limit_match;
-mb->match_limit_recursion = (mcontext->recursion_limit < re->limit_recursion)?
- mcontext->recursion_limit : re->limit_recursion;
-
-/* Pointers to the individual character tables */
-
-mb->lcc = re->tables + lcc_offset;
-mb->fcc = re->tables + fcc_offset;
-mb->ctypes = re->tables + ctypes_offset;
-
/* Process the \R and newline settings. */
mb->bsr_convention = re->bsr_convention;
@@ -6683,6 +6397,11 @@ switch(re->newline_convention)
mb->nl[0] = CHAR_NL;
break;
+ case PCRE2_NEWLINE_NUL:
+ mb->nllen = 1;
+ mb->nl[0] = CHAR_NUL;
+ break;
+
case PCRE2_NEWLINE_CRLF:
mb->nllen = 2;
mb->nl[0] = CHAR_CR;
@@ -6700,71 +6419,91 @@ switch(re->newline_convention)
default: return PCRE2_ERROR_INTERNAL;
}
-/* If the expression has got more back references than the offsets supplied can
-hold, we get a temporary chunk of memory to use during the matching. Otherwise,
-we can use the vector supplied. The size of the ovector is three times the
-value in the oveccount field. Two-thirds of it is pairs for storing matching
-offsets, and the top third is working space. */
+/* The backtracking frames have fixed data at the front, and a PCRE2_SIZE
+vector at the end, whose size depends on the number of capturing parentheses in
+the pattern. It is not used at all if there are no capturing parentheses.
+
+ frame_size is the total size of each frame
+ mb->frame_vector_size is the total usable size of the vector (rounded down
+ to a whole number of frames)
+
+The last of these is changed within the match() function if the frame vector
+has to be expanded. We therefore put it into the match block so that it is
+correct when calling match() more than once for non-anchored patterns. */
+
+frame_size = offsetof(heapframe, ovector) +
+ re->top_bracket * 2 * sizeof(PCRE2_SIZE);
+
+/* Limits set in the pattern override the match context only if they are
+smaller. */
+
+mb->heap_limit = (mcontext->heap_limit < re->limit_heap)?
+ mcontext->heap_limit : re->limit_heap;
+
+mb->match_limit = (mcontext->match_limit < re->limit_match)?
+ mcontext->match_limit : re->limit_match;
+
+mb->match_limit_depth = (mcontext->depth_limit < re->limit_depth)?
+ mcontext->depth_limit : re->limit_depth;
+
+/* If a pattern has very many capturing parentheses, the frame size may be very
+large. Ensure that there are at least 10 available frames by getting an initial
+vector on the heap if necessary, except when the heap limit prevents this. Get
+fewer if possible. (The heap limit is in kilobytes.) */
-if (re->top_backref >= match_data->oveccount)
+if (frame_size <= START_FRAMES_SIZE/10)
{
- ocount = re->top_backref * 3 + 3;
- mb->ovector = (PCRE2_SIZE *)(mb->memctl.malloc(ocount * sizeof(PCRE2_SIZE),
- mb->memctl.memory_data));
- if (mb->ovector == NULL) return PCRE2_ERROR_NOMEMORY;
- using_temporary_offsets = TRUE;
+ mb->match_frames = mb->stack_frames; /* Initial frame vector on the stack */
+ mb->frame_vector_size = ((START_FRAMES_SIZE/frame_size) * frame_size);
}
else
{
- ocount = 3 * match_data->oveccount;
- mb->ovector = match_data->ovector;
+ mb->frame_vector_size = frame_size * 10;
+ if ((mb->frame_vector_size / 1024) > mb->heap_limit)
+ {
+ if (frame_size > mb->heap_limit * 1024) return PCRE2_ERROR_HEAPLIMIT;
+ mb->frame_vector_size = ((mb->heap_limit * 1024)/frame_size) * frame_size;
+ }
+ mb->match_frames = mb->memctl.malloc(mb->frame_vector_size,
+ mb->memctl.memory_data);
+ if (mb->match_frames == NULL) return PCRE2_ERROR_NOMEMORY;
}
-mb->offset_end = ocount;
-mb->offset_max = (2*ocount)/3;
+mb->match_frames_top =
+ (heapframe *)((char *)mb->match_frames + mb->frame_vector_size);
-/* Reset the working variable associated with each extraction. These should
-never be used unless previously set, but they get saved and restored, and so we
-initialize them to avoid reading uninitialized locations. Also, unset the
-offsets for the matched string. This is really just for tidiness with callouts,
-in case they inspect these fields. */
+/* Write to the ovector within the first frame to mark every capture unset and
+to avoid uninitialized memory read errors when it is copied to a new frame. */
-if (ocount > 0)
- {
- register PCRE2_SIZE *iptr = mb->ovector + ocount;
- register PCRE2_SIZE *iend = iptr - re->top_bracket;
- if (iend < mb->ovector + 2) iend = mb->ovector + 2;
- while (--iptr >= iend) *iptr = PCRE2_UNSET;
- mb->ovector[0] = mb->ovector[1] = PCRE2_UNSET;
- }
+memset((char *)(mb->match_frames) + offsetof(heapframe, ovector), 0xff,
+ re->top_bracket * 2 * sizeof(PCRE2_SIZE));
+
+/* Pointers to the individual character tables */
+
+mb->lcc = re->tables + lcc_offset;
+mb->fcc = re->tables + fcc_offset;
+mb->ctypes = re->tables + ctypes_offset;
-/* Set up the first code unit to match, if available. The first_codeunit value
-is never set for an anchored regular expression, but the anchoring may be
-forced at run time, so we have to test for anchoring. The first code unit may
-be unset for an unanchored pattern, of course. If there's no first code unit
-there may be a bitmap of possible first characters. */
+/* Set up the first code unit to match, if available. If there's no first code
+unit there may be a bitmap of possible first characters. */
-if (!anchored)
+if ((re->flags & PCRE2_FIRSTSET) != 0)
{
- if ((re->flags & PCRE2_FIRSTSET) != 0)
+ has_first_cu = TRUE;
+ first_cu = first_cu2 = (PCRE2_UCHAR)(re->first_codeunit);
+ if ((re->flags & PCRE2_FIRSTCASELESS) != 0)
{
- has_first_cu = TRUE;
- first_cu = first_cu2 = (PCRE2_UCHAR)(re->first_codeunit);
- if ((re->flags & PCRE2_FIRSTCASELESS) != 0)
- {
- first_cu2 = TABLE_GET(first_cu, mb->fcc, first_cu);
+ first_cu2 = TABLE_GET(first_cu, mb->fcc, first_cu);
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 8
- if (utf && first_cu > 127) first_cu2 = UCD_OTHERCASE(first_cu);
+ if (utf && first_cu > 127) first_cu2 = UCD_OTHERCASE(first_cu);
#endif
- }
}
- else
- if (!startline && (re->flags & PCRE2_FIRSTMAPSET) != 0)
- start_bits = re->start_bitmap;
}
+else
+ if (!startline && (re->flags & PCRE2_FIRSTMAPSET) != 0)
+ start_bits = re->start_bitmap;
-/* For anchored or unanchored matches, there may be a "last known required
-character" set. */
+/* There may also be a "last known required character" set. */
if ((re->flags & PCRE2_LASTSET) != 0)
{
@@ -6788,7 +6527,6 @@ the loop runs just once. */
for(;;)
{
PCRE2_SPTR new_start_match;
- mb->capture_last = 0;
/* ----------------- Start of match optimizations ---------------- */
@@ -6804,8 +6542,8 @@ for(;;)
/* If firstline is TRUE, the start of the match is constrained to the first
line of a multiline string. That is, the match must be before or at the
first newline. Implement this by temporarily adjusting end_subject so that
- we stop the optimization scans at a newline. If the match fails at the
- newline, later code breaks this loop. */
+ we stop the optimization scans for a first code unit at a newline. If the
+ match fails at the newline, later code breaks this loop. */
if (firstline)
{
@@ -6825,90 +6563,156 @@ for(;;)
end_subject = t;
}
- /* Advance to a unique first code unit if there is one. In 8-bit mode, the
- use of memchr() gives a big speed up. */
+ /* Anchored: check the first code unit if one is recorded. This may seem
+ pointless but it can help in detecting a no match case without scanning for
+ the required code unit. */
- if (has_first_cu)
+ if (anchored)
{
- PCRE2_UCHAR smc;
- if (first_cu != first_cu2)
- while (start_match < end_subject &&
- (smc = UCHAR21TEST(start_match)) != first_cu && smc != first_cu2)
- start_match++;
- else
+ if (has_first_cu || start_bits != NULL)
{
+ BOOL ok = start_match < end_subject;
+ if (ok)
+ {
+ PCRE2_UCHAR c = UCHAR21TEST(start_match);
+ ok = has_first_cu && (c == first_cu || c == first_cu2);
+ if (!ok && start_bits != NULL)
+ {
#if PCRE2_CODE_UNIT_WIDTH != 8
- while (start_match < end_subject && UCHAR21TEST(start_match) != first_cu)
- start_match++;
-#else
- start_match = memchr(start_match, first_cu, end_subject - start_match);
- if (start_match == NULL) start_match = end_subject;
+ if (c > 255) c = 255;
#endif
+ ok = (start_bits[c/8] & (1 << (c&7))) != 0;
+ }
+ }
+ if (!ok)
+ {
+ rc = MATCH_NOMATCH;
+ break;
+ }
}
}
- /* Or to just after a linebreak for a multiline match */
+ /* Not anchored. Advance to a unique first code unit if there is one. In
+ 8-bit mode, the use of memchr() gives a big speed up, even though we have
+ to call it twice in caseless mode, in order to find the earliest occurrence
+ of the character in either of its cases. */
- else if (startline)
+ else
{
- if (start_match > mb->start_subject + start_offset)
+ if (has_first_cu)
{
-#ifdef SUPPORT_UNICODE
- if (utf)
+ if (first_cu != first_cu2) /* Caseless */
{
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- {
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ PCRE2_UCHAR smc;
+ while (start_match < end_subject &&
+ (smc = UCHAR21TEST(start_match)) != first_cu &&
+ smc != first_cu2)
start_match++;
- ACROSSCHAR(start_match < end_subject, *start_match,
- start_match++);
- }
+#else /* 8-bit code units */
+ PCRE2_SPTR pp1 =
+ memchr(start_match, first_cu, end_subject-start_match);
+ PCRE2_SPTR pp2 =
+ memchr(start_match, first_cu2, end_subject-start_match);
+ if (pp1 == NULL)
+ start_match = (pp2 == NULL)? end_subject : pp2;
+ else
+ start_match = (pp2 == NULL || pp1 < pp2)? pp1 : pp2;
+#endif
}
+
+ /* The caseful case */
+
else
+ {
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ while (start_match < end_subject && UCHAR21TEST(start_match) !=
+ first_cu)
+ start_match++;
+#else
+ start_match = memchr(start_match, first_cu, end_subject - start_match);
+ if (start_match == NULL) start_match = end_subject;
#endif
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- start_match++;
+ }
- /* If we have just passed a CR and the newline option is ANY or
- ANYCRLF, and we are now at a LF, advance the match position by one more
- code unit. */
+ /* If we can't find the required code unit, break the bumpalong loop,
+ to force a match failure, except when doing partial matching, when we
+ let the next cycle run at the end of the subject. To see why, consider
+ the pattern /(?<=abc)def/, which partially matches "abc", even though
+ the string does not contain the starting character "d". */
- if (start_match[-1] == CHAR_CR &&
- (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) &&
- start_match < end_subject &&
- UCHAR21TEST(start_match) == CHAR_NL)
- start_match++;
+ if (!mb->partial && start_match >= end_subject)
+ {
+ rc = MATCH_NOMATCH;
+ break;
+ }
}
- }
- /* Or to a non-unique first code unit if any have been identified. The
- bitmap contains only 256 bits. When code units are 16 or 32 bits wide, all
- code units greater than 254 set the 255 bit. */
+ /* If there's no first code unit, advance to just after a linebreak for a
+ multiline match if required. */
- else if (start_bits != NULL)
- {
- while (start_match < end_subject)
+ else if (startline)
{
- register uint32_t c = UCHAR21TEST(start_match);
+ if (start_match > mb->start_subject + start_offset)
+ {
+#ifdef SUPPORT_UNICODE
+ if (utf)
+ {
+ while (start_match < end_subject && !WAS_NEWLINE(start_match))
+ {
+ start_match++;
+ ACROSSCHAR(start_match < end_subject, *start_match,
+ start_match++);
+ }
+ }
+ else
+#endif
+ while (start_match < end_subject && !WAS_NEWLINE(start_match))
+ start_match++;
+
+ /* If we have just passed a CR and the newline option is ANY or
+ ANYCRLF, and we are now at a LF, advance the match position by one
+ more code unit. */
+
+ if (start_match[-1] == CHAR_CR &&
+ (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) &&
+ start_match < end_subject &&
+ UCHAR21TEST(start_match) == CHAR_NL)
+ start_match++;
+ }
+ }
+
+ /* If there's no first code unit or a requirement for a multiline line
+ start, advance to a non-unique first code unit if any have been
+ identified. The bitmap contains only 256 bits. When code units are 16 or
+ 32 bits wide, all code units greater than 254 set the 255 bit. */
+
+ else if (start_bits != NULL)
+ {
+ while (start_match < end_subject)
+ {
+ uint32_t c = UCHAR21TEST(start_match);
#if PCRE2_CODE_UNIT_WIDTH != 8
- if (c > 255) c = 255;
+ if (c > 255) c = 255;
#endif
- if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
- start_match++;
+ if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
+ start_match++;
+ }
}
- }
+ } /* End first code unit handling */
/* Restore fudged end_subject */
end_subject = save_end_subject;
- /* The following two optimizations are disabled for partial matching. */
+ /* The following two optimizations must be disabled for partial matching. */
if (!mb->partial)
{
- /* The minimum matching length is a lower bound; no actual string of that
- length may actually match the pattern. Although the value is, strictly,
- in characters, we treat it as code units to avoid spending too much time
- in this optimization. */
+ /* The minimum matching length is a lower bound; no string of that length
+ may actually match the pattern. Although the value is, strictly, in
+ characters, we treat it as code units to avoid spending too much time in
+ this optimization. */
if (end_subject - start_match < re->minlength)
{
@@ -6917,12 +6721,16 @@ for(;;)
}
/* If req_cu is set, we know that that code unit must appear in the
- subject for the match to succeed. If the first code unit is set, req_cu
- must be later in the subject; otherwise the test starts at the match
- point. This optimization can save a huge amount of backtracking in
- patterns with nested unlimited repeats that aren't going to match.
- Writing separate code for cased/caseless versions makes it go faster, as
- does using an autoincrement and backing off on a match.
+ subject for the (non-partial) match to succeed. If the first code unit is
+ set, req_cu must be later in the subject; otherwise the test starts at
+ the match point. This optimization can save a huge amount of backtracking
+ in patterns with nested unlimited repeats that aren't going to match.
+ Writing separate code for caseful/caseless versions makes it go faster,
+ as does using an autoincrement and backing off on a match. As in the case
+ of the first code unit, using memchr() in the 8-bit library gives a big
+ speed up. Unlike the first_cu check above, we do not need to call
+ memchr() twice in the caseless case because we only need to check for the
+ presence of the character in either case, not find the first occurrence.
HOWEVER: when the subject string is very, very long, searching to its end
can take a long time, and give bad performance on quite ordinary
@@ -6932,30 +6740,55 @@ for(;;)
if (has_req_cu && end_subject - start_match < REQ_CU_MAX)
{
- register PCRE2_SPTR p = start_match + (has_first_cu? 1:0);
+ PCRE2_SPTR p = start_match + (has_first_cu? 1:0);
/* We don't need to repeat the search if we haven't yet reached the
- place we found it at last time. */
+ place we found it last time round the bumpalong loop. */
if (p > req_cu_ptr)
{
- if (req_cu != req_cu2)
+ if (p < end_subject)
{
- while (p < end_subject)
+ if (req_cu != req_cu2) /* Caseless */
{
- register uint32_t pp = UCHAR21INCTEST(p);
- if (pp == req_cu || pp == req_cu2) { p--; break; }
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ do
+ {
+ uint32_t pp = UCHAR21INCTEST(p);
+ if (pp == req_cu || pp == req_cu2) { p--; break; }
+ }
+ while (p < end_subject);
+
+#else /* 8-bit code units */
+ PCRE2_SPTR pp = p;
+ p = memchr(pp, req_cu, end_subject - pp);
+ if (p == NULL)
+ {
+ p = memchr(pp, req_cu2, end_subject - pp);
+ if (p == NULL) p = end_subject;
+ }
+#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */
}
- }
- else
- {
- while (p < end_subject)
+
+ /* The caseful case */
+
+ else
{
- if (UCHAR21INCTEST(p) == req_cu) { p--; break; }
+#if PCRE2_CODE_UNIT_WIDTH != 8
+ do
+ {
+ if (UCHAR21INCTEST(p) == req_cu) { p--; break; }
+ }
+ while (p < end_subject);
+
+#else /* 8-bit code units */
+ p = memchr(p, req_cu, end_subject - p);
+ if (p == NULL) p = end_subject;
+#endif
}
}
- /* If we can't find the required code unit, break the matching loop,
+ /* If we can't find the required code unit, break the bumpalong loop,
forcing a match failure. */
if (p >= end_subject)
@@ -6965,8 +6798,8 @@ for(;;)
}
/* If we have found the required code unit, save the point where we
- found it, so that we don't search again next time round the loop if
- the start hasn't passed this code unit yet. */
+ found it, so that we don't search again next time round the bumpalong
+ loop if the start hasn't yet passed this code unit. */
req_cu_ptr = p;
}
@@ -6987,14 +6820,14 @@ for(;;)
/* OK, we can now run the match. If "hitend" is set afterwards, remember the
first starting point for which a partial match was found. */
- mb->start_match_ptr = start_match;
mb->start_used_ptr = start_match;
mb->last_used_ptr = start_match;
mb->match_call_count = 0;
- mb->match_function_type = 0;
mb->end_offset_top = 0;
mb->skip_arg_count = 0;
- rc = match(start_match, mb->start_code, start_match, 2, mb, NULL, 0);
+
+ rc = match(start_match, mb->start_code, match_data->ovector,
+ match_data->oveccount, re->top_bracket, frame_size, mb);
if (mb->hitend && start_partial == NULL)
{
@@ -7020,9 +6853,9 @@ for(;;)
greater than the match we have just done, treat it as NOMATCH. */
case MATCH_SKIP:
- if (mb->start_match_ptr > start_match)
+ if (mb->verb_skip_ptr > start_match)
{
- new_start_match = mb->start_match_ptr;
+ new_start_match = mb->verb_skip_ptr;
break;
}
/* Fall through */
@@ -7096,11 +6929,11 @@ for(;;)
/* ==========================================================================*/
-/* When we reach here, one of the stopping conditions is true:
+/* When we reach here, one of the following stopping conditions is true:
(1) The match succeeded, either completely, or partially;
-(2) The pattern is anchored or the match was failed by (*COMMIT);
+(2) The pattern is anchored or the match was failed after (*COMMIT);
(3) We are past the end of the subject or the bumpalong limit;
@@ -7114,18 +6947,10 @@ for(;;)
ENDLOOP:
-#ifdef HEAP_MATCH_RECURSE
-release_match_heapframes(&frame_zero, mb);
-#endif
-
-/* Release any frames that were saved from recursions. */
+/* Release an enlarged frame vector that is on the heap. */
-while (mb->ovecsave_chain != NULL)
- {
- ovecsave_frame *this = mb->ovecsave_chain;
- mb->ovecsave_chain = this->next;
- mb->memctl.free(this, mb->memctl.memory_data);
- }
+if (mb->match_frames != mb->stack_frames)
+ mb->memctl.free(mb->match_frames, mb->memctl.memory_data);
/* Fill in fields that are always returned in the match data. */
@@ -7134,68 +6959,14 @@ match_data->subject = subject;
match_data->mark = mb->mark;
match_data->matchedby = PCRE2_MATCHEDBY_INTERPRETER;
-/* Handle a fully successful match. */
+/* Handle a fully successful match. Set the return code to the number of
+captured strings, or 0 if there were too many to fit into the ovector, and then
+set the remaining returned values before returning. */
-if (rc == MATCH_MATCH || rc == MATCH_ACCEPT)
+if (rc == MATCH_MATCH)
{
- uint32_t arg_offset_max = 2 * match_data->oveccount;
-
- /* When the offset vector is big enough to deal with any backreferences,
- captured substring offsets will already be set up. In the case where we had
- to get some local memory to hold offsets for backreference processing, copy
- those that we can. In this case there need not be overflow if certain parts
- of the pattern were not used, even though there are more capturing
- parentheses than vector slots. */
-
- if (using_temporary_offsets)
- {
- if (arg_offset_max >= 4)
- {
- memcpy(match_data->ovector + 2, mb->ovector + 2,
- (arg_offset_max - 2) * sizeof(PCRE2_SIZE));
- }
- if (mb->end_offset_top > arg_offset_max) mb->capture_last |= OVFLBIT;
- mb->memctl.free(mb->ovector, mb->memctl.memory_data);
- }
-
- /* Set the return code to the number of captured strings, or 0 if there were
- too many to fit into the ovector. */
-
- match_data->rc = ((mb->capture_last & OVFLBIT) != 0)?
- 0 : mb->end_offset_top/2;
-
- /* If there is space in the offset vector, set any pairs that follow the
- highest-numbered captured string but are less than the number of capturing
- groups in the pattern (and are within the ovector) to PCRE2_UNSET. It is
- documented that this happens. In earlier versions, the whole set of potential
- capturing offsets was initialized each time round the loop, but this is
- handled differently now. "Gaps" are set to PCRE2_UNSET dynamically instead
- (this fixed a bug). Thus, it is only those at the end that need setting here.
- We can't just mark them all unset at the start of the whole thing because
- they may get set in one branch that is not the final matching branch. */
-
- if (mb->end_offset_top/2 <= re->top_bracket)
- {
- register PCRE2_SIZE *iptr, *iend;
- int resetcount = re->top_bracket + 1;
- if (resetcount > match_data->oveccount) resetcount = match_data->oveccount;
- iptr = match_data->ovector + mb->end_offset_top;
- iend = match_data->ovector + 2 * resetcount;
- while (iptr < iend) *iptr++ = PCRE2_UNSET;
- }
-
- /* If there is space, set up the whole thing as substring 0. The value of
- mb->start_match_ptr might be modified if \K was encountered on the success
- matching path. */
-
- if (match_data->oveccount < 1) rc = 0; else
- {
- match_data->ovector[0] = mb->start_match_ptr - mb->start_subject;
- match_data->ovector[1] = mb->end_match_ptr - mb->start_subject;
- }
-
- /* Set the remaining returned values */
-
+ match_data->rc = ((int)mb->end_offset_top >= 2 * match_data->oveccount)?
+ 0 : (int)mb->end_offset_top/2 + 1;
match_data->startchar = start_match - subject;
match_data->leftchar = mb->start_used_ptr - subject;
match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)?
@@ -7211,18 +6982,14 @@ match_data->mark = mb->nomatch_mark;
/* For anything other than nomatch or partial match, just return the code. */
-if (rc != MATCH_NOMATCH && rc != PCRE2_ERROR_PARTIAL)
- match_data->rc = rc;
+if (rc != MATCH_NOMATCH && rc != PCRE2_ERROR_PARTIAL) match_data->rc = rc;
-/* Else handle a partial match. */
+/* Handle a partial match. */
else if (match_partial != NULL)
{
- if (match_data->oveccount > 0)
- {
- match_data->ovector[0] = match_partial - subject;
- match_data->ovector[1] = end_subject - subject;
- }
+ match_data->ovector[0] = match_partial - subject;
+ match_data->ovector[1] = end_subject - subject;
match_data->startchar = match_partial - subject;
match_data->leftchar = start_partial - subject;
match_data->rightchar = end_subject - subject;
@@ -7233,10 +7000,6 @@ else if (match_partial != NULL)
else match_data->rc = PCRE2_ERROR_NOMATCH;
-/* Free any temporary offsets. */
-
-if (using_temporary_offsets)
- mb->memctl.free(mb->ovector, mb->memctl.memory_data);
return match_data->rc;
}
diff --git a/src/3rdparty/pcre2/src/pcre2_match_data.c b/src/3rdparty/pcre2/src/pcre2_match_data.c
index 85ac998348..b297f326b5 100644
--- a/src/3rdparty/pcre2/src/pcre2_match_data.c
+++ b/src/3rdparty/pcre2/src/pcre2_match_data.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
* Create a match data block given ovector size *
*************************************************/
-/* A minimum of 1 is imposed on the number of ovector triplets. */
+/* A minimum of 1 is imposed on the number of ovector pairs. */
PCRE2_EXP_DEFN pcre2_match_data * PCRE2_CALL_CONVENTION
pcre2_match_data_create(uint32_t oveccount, pcre2_general_context *gcontext)
@@ -59,7 +59,7 @@ pcre2_match_data_create(uint32_t oveccount, pcre2_general_context *gcontext)
pcre2_match_data *yield;
if (oveccount < 1) oveccount = 1;
yield = PRIV(memctl_malloc)(
- sizeof(pcre2_match_data) + 3*oveccount*sizeof(PCRE2_SIZE),
+ offsetof(pcre2_match_data, ovector) + 2*oveccount*sizeof(PCRE2_SIZE),
(pcre2_memctl *)gcontext);
if (yield == NULL) return NULL;
yield->oveccount = oveccount;
diff --git a/src/3rdparty/pcre2/src/pcre2_ord2utf.c b/src/3rdparty/pcre2/src/pcre2_ord2utf.c
index 75252b763a..1403730996 100644
--- a/src/3rdparty/pcre2/src/pcre2_ord2utf.c
+++ b/src/3rdparty/pcre2/src/pcre2_ord2utf.c
@@ -83,7 +83,7 @@ PRIV(ord2utf)(uint32_t cvalue, PCRE2_UCHAR *buffer)
/* Convert to UTF-8 */
#if PCRE2_CODE_UNIT_WIDTH == 8
-register int i, j;
+int i, j;
for (i = 0; i < PRIV(utf8_table1_size); i++)
if ((int)cvalue <= PRIV(utf8_table1)[i]) break;
buffer += i;
diff --git a/src/3rdparty/pcre2/src/pcre2_pattern_info.c b/src/3rdparty/pcre2/src/pcre2_pattern_info.c
index 5b32a905b0..540707b225 100644
--- a/src/3rdparty/pcre2/src/pcre2_pattern_info.c
+++ b/src/3rdparty/pcre2/src/pcre2_pattern_info.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -75,10 +75,12 @@ if (where == NULL) /* Requests field length */
case PCRE2_INFO_BACKREFMAX:
case PCRE2_INFO_BSR:
case PCRE2_INFO_CAPTURECOUNT:
+ case PCRE2_INFO_DEPTHLIMIT:
case PCRE2_INFO_FIRSTCODETYPE:
case PCRE2_INFO_FIRSTCODEUNIT:
case PCRE2_INFO_HASBACKSLASHC:
case PCRE2_INFO_HASCRORLF:
+ case PCRE2_INFO_HEAPLIMIT:
case PCRE2_INFO_JCHANGED:
case PCRE2_INFO_LASTCODETYPE:
case PCRE2_INFO_LASTCODEUNIT:
@@ -89,7 +91,6 @@ if (where == NULL) /* Requests field length */
case PCRE2_INFO_NAMEENTRYSIZE:
case PCRE2_INFO_NAMECOUNT:
case PCRE2_INFO_NEWLINE:
- case PCRE2_INFO_RECURSIONLIMIT:
return sizeof(uint32_t);
case PCRE2_INFO_FIRSTBITMAP:
@@ -97,6 +98,7 @@ if (where == NULL) /* Requests field length */
case PCRE2_INFO_JITSIZE:
case PCRE2_INFO_SIZE:
+ case PCRE2_INFO_FRAMESIZE:
return sizeof(size_t);
case PCRE2_INFO_NAMETABLE:
@@ -137,6 +139,11 @@ switch(what)
*((uint32_t *)where) = re->top_bracket;
break;
+ case PCRE2_INFO_DEPTHLIMIT:
+ *((uint32_t *)where) = re->limit_depth;
+ if (re->limit_depth == UINT32_MAX) return PCRE2_ERROR_UNSET;
+ break;
+
case PCRE2_INFO_FIRSTCODETYPE:
*((uint32_t *)where) = ((re->flags & PCRE2_FIRSTSET) != 0)? 1 :
((re->flags & PCRE2_STARTLINE) != 0)? 2 : 0;
@@ -152,6 +159,11 @@ switch(what)
&(re->start_bitmap[0]) : NULL;
break;
+ case PCRE2_INFO_FRAMESIZE:
+ *((size_t *)where) = offsetof(heapframe, ovector) +
+ re->top_bracket * 2 * sizeof(PCRE2_SIZE);
+ break;
+
case PCRE2_INFO_HASBACKSLASHC:
*((uint32_t *)where) = (re->flags & PCRE2_HASBKC) != 0;
break;
@@ -160,6 +172,11 @@ switch(what)
*((uint32_t *)where) = (re->flags & PCRE2_HASCRORLF) != 0;
break;
+ case PCRE2_INFO_HEAPLIMIT:
+ *((uint32_t *)where) = re->limit_heap;
+ if (re->limit_heap == UINT32_MAX) return PCRE2_ERROR_UNSET;
+ break;
+
case PCRE2_INFO_JCHANGED:
*((uint32_t *)where) = (re->flags & PCRE2_JCHANGED) != 0;
break;
@@ -215,11 +232,6 @@ switch(what)
*((uint32_t *)where) = re->newline_convention;
break;
- case PCRE2_INFO_RECURSIONLIMIT:
- *((uint32_t *)where) = re->limit_recursion;
- if (re->limit_recursion == UINT32_MAX) return PCRE2_ERROR_UNSET;
- break;
-
case PCRE2_INFO_SIZE:
*((size_t *)where) = re->blocksize;
break;
@@ -255,11 +267,15 @@ pcre2_real_code *re = (pcre2_real_code *)code;
pcre2_callout_enumerate_block cb;
PCRE2_SPTR cc;
#ifdef SUPPORT_UNICODE
-BOOL utf = (re->overall_options & PCRE2_UTF) != 0;
+BOOL utf;
#endif
if (re == NULL) return PCRE2_ERROR_NULL;
+#ifdef SUPPORT_UNICODE
+utf = (re->overall_options & PCRE2_UTF) != 0;
+#endif
+
/* Check that the first field in the block is the magic number. If it is not,
return with PCRE2_ERROR_BADMAGIC. */
diff --git a/src/3rdparty/pcre2/src/pcre2_serialize.c b/src/3rdparty/pcre2/src/pcre2_serialize.c
index 0af26d8fc3..d2cc603cbb 100644
--- a/src/3rdparty/pcre2/src/pcre2_serialize.c
+++ b/src/3rdparty/pcre2/src/pcre2_serialize.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -214,7 +214,10 @@ for (i = 0; i < number_of_codes; i++)
if (dst_re->magic_number != MAGIC_NUMBER ||
dst_re->name_entry_size > MAX_NAME_SIZE + IMM2_SIZE + 1 ||
dst_re->name_count > MAX_NAME_COUNT)
+ {
+ memctl->free(dst_re, memctl->memory_data);
return PCRE2_ERROR_BADSERIALIZEDDATA;
+ }
/* At the moment only one table is supported. */
diff --git a/src/3rdparty/pcre2/src/pcre2_study.c b/src/3rdparty/pcre2/src/pcre2_study.c
index db08266745..b92686759d 100644
--- a/src/3rdparty/pcre2/src/pcre2_study.c
+++ b/src/3rdparty/pcre2/src/pcre2_study.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -46,9 +46,11 @@ collecting data (e.g. minimum matching length). */
#include "config.h"
#endif
-
#include "pcre2_internal.h"
+/* The maximum remembered capturing brackets minimum. */
+
+#define MAX_CACHE_BACKREF 128
/* Set a bit in the starting code unit bit map. */
@@ -71,6 +73,12 @@ length is 16-bits long (on the grounds that anything longer than that is
pathological), so we give up when we reach that amount. This also means that
integer overflow for really crazy patterns cannot happen.
+Backreference minimum lengths are cached to speed up multiple references. This
+function is called only when the highest back reference in the pattern is less
+than or equal to MAX_CACHE_BACKREF, which is one less than the size of the
+caching vector. The zeroth element contains the number of the highest set
+value.
+
Arguments:
re compiled pattern block
code pointer to start of group (the bracket)
@@ -78,6 +86,7 @@ Arguments:
utf UTF flag
recurses chain of recurse_check to catch mutual recursion
countptr pointer to call count (to catch over complexity)
+ backref_cache vector for caching back references.
Returns: the minimum length
-1 \C in UTF-8 mode
@@ -90,7 +99,8 @@ Returns: the minimum length
static int
find_minlength(const pcre2_real_code *re, PCRE2_SPTR code,
- PCRE2_SPTR startcode, BOOL utf, recurse_check *recurses, int *countptr)
+ PCRE2_SPTR startcode, BOOL utf, recurse_check *recurses, int *countptr,
+ int *backref_cache)
{
int length = -1;
int prev_cap_recno = -1;
@@ -101,8 +111,8 @@ uint32_t once_fudge = 0;
BOOL had_recurse = FALSE;
BOOL dupcapused = (re->flags & PCRE2_DUPCAPUSED) != 0;
recurse_check this_recurse;
-register int branchlength = 0;
-register PCRE2_UCHAR *cc = (PCRE2_UCHAR *)code + 1 + LINK_SIZE;
+int branchlength = 0;
+PCRE2_UCHAR *cc = (PCRE2_UCHAR *)code + 1 + LINK_SIZE;
/* If this is a "could be empty" group, its minimum length is 0. */
@@ -124,7 +134,7 @@ for (;;)
{
int d, min, recno;
PCRE2_UCHAR *cs, *ce;
- register PCRE2_UCHAR op = *cc;
+ PCRE2_UCHAR op = *cc;
if (branchlength >= UINT16_MAX) return UINT16_MAX;
@@ -146,12 +156,12 @@ for (;;)
}
goto PROCESS_NON_CAPTURE;
- /* There's a special case of OP_ONCE, when it is wrapped round an
+ case OP_BRA:
+ /* There's a special case of OP_BRA, when it is wrapped round a repeated
OP_RECURSE. We'd like to process the latter at this level so that
remembering the value works for repeated cases. So we do nothing, but
set a fudge value to skip over the OP_KET after the recurse. */
- case OP_ONCE:
if (cc[1+LINK_SIZE] == OP_RECURSE && cc[2*(1+LINK_SIZE)] == OP_KET)
{
once_fudge = 1 + LINK_SIZE;
@@ -160,13 +170,13 @@ for (;;)
}
/* Fall through */
- case OP_ONCE_NC:
- case OP_BRA:
+ case OP_ONCE:
case OP_SBRA:
case OP_BRAPOS:
case OP_SBRAPOS:
PROCESS_NON_CAPTURE:
- d = find_minlength(re, cc, startcode, utf, recurses, countptr);
+ d = find_minlength(re, cc, startcode, utf, recurses, countptr,
+ backref_cache);
if (d < 0) return d;
branchlength += d;
do cc += GET(cc, 1); while (*cc == OP_ALT);
@@ -182,11 +192,12 @@ for (;;)
case OP_SCBRA:
case OP_CBRAPOS:
case OP_SCBRAPOS:
- recno = dupcapused? prev_cap_recno - 1 : (int)GET2(cc, 1+LINK_SIZE);
- if (recno != prev_cap_recno)
+ recno = (int)GET2(cc, 1+LINK_SIZE);
+ if (dupcapused || recno != prev_cap_recno)
{
prev_cap_recno = recno;
- prev_cap_d = find_minlength(re, cc, startcode, utf, recurses, countptr);
+ prev_cap_d = find_minlength(re, cc, startcode, utf, recurses, countptr,
+ backref_cache);
if (prev_cap_d < 0) return prev_cap_d;
}
branchlength += prev_cap_d;
@@ -456,38 +467,52 @@ for (;;)
d = INT_MAX;
- /* Scan all groups with the same name */
+ /* Scan all groups with the same name; find the shortest. */
while (count-- > 0)
{
- ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, GET2(slot, 0));
- if (cs == NULL) return -2;
- do ce += GET(ce, 1); while (*ce == OP_ALT);
- if (cc > cs && cc < ce) /* Simple recursion */
- {
- d = 0;
- had_recurse = TRUE;
- break;
- }
+ int dd, i;
+ recno = GET2(slot, 0);
+
+ if (recno <= backref_cache[0] && backref_cache[recno] >= 0)
+ dd = backref_cache[recno];
else
{
- recurse_check *r = recurses;
- for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
- if (r != NULL) /* Mutual recursion */
+ ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, recno);
+ if (cs == NULL) return -2;
+ do ce += GET(ce, 1); while (*ce == OP_ALT);
+ if (cc > cs && cc < ce) /* Simple recursion */
{
- d = 0;
+ dd = 0;
had_recurse = TRUE;
- break;
}
else
{
- int dd;
- this_recurse.prev = recurses;
- this_recurse.group = cs;
- dd = find_minlength(re, cs, startcode, utf, &this_recurse, countptr);
- if (dd < d) d = dd;
+ recurse_check *r = recurses;
+ for (r = recurses; r != NULL; r = r->prev)
+ if (r->group == cs) break;
+ if (r != NULL) /* Mutual recursion */
+ {
+ dd = 0;
+ had_recurse = TRUE;
+ }
+ else
+ {
+ this_recurse.prev = recurses;
+ this_recurse.group = cs;
+ dd = find_minlength(re, cs, startcode, utf, &this_recurse,
+ countptr, backref_cache);
+ if (dd < 0) return dd;
+ }
}
+
+ backref_cache[recno] = dd;
+ for (i = backref_cache[0] + 1; i < recno; i++) backref_cache[i] = -1;
+ backref_cache[0] = recno;
}
+
+ if (dd < d) d = dd;
+ if (d <= 0) break; /* No point looking at any more */
slot += re->name_entry_size;
}
}
@@ -501,34 +526,48 @@ for (;;)
case OP_REF:
case OP_REFI:
if (dupcapused) return -1;
- if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
+ recno = GET2(cc, 1);
+ if (recno <= backref_cache[0] && backref_cache[recno] >= 0)
+ d = backref_cache[recno];
+ else
{
- ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, GET2(cc, 1));
- if (cs == NULL) return -2;
- do ce += GET(ce, 1); while (*ce == OP_ALT);
- if (cc > cs && cc < ce) /* Simple recursion */
- {
- d = 0;
- had_recurse = TRUE;
- }
- else
+ int i;
+ if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
{
- recurse_check *r = recurses;
- for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
- if (r != NULL) /* Mutual recursion */
+ ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, recno);
+ if (cs == NULL) return -2;
+ do ce += GET(ce, 1); while (*ce == OP_ALT);
+ if (cc > cs && cc < ce) /* Simple recursion */
{
d = 0;
had_recurse = TRUE;
}
else
{
- this_recurse.prev = recurses;
- this_recurse.group = cs;
- d = find_minlength(re, cs, startcode, utf, &this_recurse, countptr);
+ recurse_check *r = recurses;
+ for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
+ if (r != NULL) /* Mutual recursion */
+ {
+ d = 0;
+ had_recurse = TRUE;
+ }
+ else
+ {
+ this_recurse.prev = recurses;
+ this_recurse.group = cs;
+ d = find_minlength(re, cs, startcode, utf, &this_recurse, countptr,
+ backref_cache);
+ if (d < 0) return d;
+ }
}
}
+ else d = 0;
+
+ backref_cache[recno] = d;
+ for (i = backref_cache[0] + 1; i < recno; i++) backref_cache[i] = -1;
+ backref_cache[0] = recno;
}
- else d = 0;
+
cc += 1 + IMM2_SIZE;
/* Handle repeated back references */
@@ -601,7 +640,7 @@ for (;;)
this_recurse.prev = recurses;
this_recurse.group = cs;
prev_recurse_d = find_minlength(re, cs, startcode, utf, &this_recurse,
- countptr);
+ countptr, backref_cache);
if (prev_recurse_d < 0) return prev_recurse_d;
prev_recurse_recno = recno;
branchlength += prev_recurse_d;
@@ -747,6 +786,7 @@ if (utf)
if (caseless)
{
+#ifdef SUPPORT_UNICODE
if (utf)
{
#if PCRE2_CODE_UNIT_WIDTH == 8
@@ -759,10 +799,12 @@ if (caseless)
if (c > 0xff) SET_BIT(0xff); else SET_BIT(c);
#endif
}
+ else
+#endif /* SUPPORT_UNICODE */
/* Not UTF */
- else if (MAX_255(c)) SET_BIT(re->tables[fcc_offset + c]);
+ if (MAX_255(c)) SET_BIT(re->tables[fcc_offset + c]);
}
return p;
@@ -792,7 +834,7 @@ Returns: nothing
static void
set_type_bits(pcre2_real_code *re, int cbit_type, unsigned int table_limit)
{
-register uint32_t c;
+uint32_t c;
for (c = 0; c < table_limit; c++)
re->start_bitmap[c] |= re->tables[c+cbits_offset+cbit_type];
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
@@ -833,7 +875,7 @@ Returns: nothing
static void
set_nottype_bits(pcre2_real_code *re, int cbit_type, unsigned int table_limit)
{
-register uint32_t c;
+uint32_t c;
for (c = 0; c < table_limit; c++)
re->start_bitmap[c] |= ~(re->tables[c+cbits_offset+cbit_type]);
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
@@ -873,7 +915,7 @@ Returns: SSB_FAIL => Failed to find any starting code units
static int
set_start_bits(pcre2_real_code *re, PCRE2_SPTR code, BOOL utf)
{
-register uint32_t c;
+uint32_t c;
int yield = SSB_DONE;
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
@@ -911,7 +953,6 @@ do
case OP_ALLANY:
case OP_ANY:
case OP_ANYBYTE:
- case OP_CIRC:
case OP_CIRCM:
case OP_CLOSE:
case OP_COMMIT:
@@ -979,6 +1020,13 @@ do
case OP_THEN_ARG:
return SSB_FAIL;
+ /* OP_CIRC happens only at the start of an anchored branch (multiline ^
+ uses OP_CIRCM). Skip over it. */
+
+ case OP_CIRC:
+ tcode += PRIV(OP_lengths)[OP_CIRC];
+ break;
+
/* A "real" property test implies no starting bits, but the fake property
PT_CLIST identifies a list of characters. These lists are short, as they
are used for characters with more than one "other case", so there is no
@@ -1025,7 +1073,6 @@ do
case OP_CBRAPOS:
case OP_SCBRAPOS:
case OP_ONCE:
- case OP_ONCE_NC:
case OP_ASSERT:
rc = set_start_bits(re, tcode, utf);
if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
@@ -1407,6 +1454,10 @@ do
classmap = ((tcode[1 + LINK_SIZE] & XCL_MAP) == 0)? NULL :
(uint8_t *)(tcode + 1 + LINK_SIZE + 1);
#endif
+ /* It seems that the fall through comment must be outside the #ifdef if
+ it is to avoid the gcc compiler warning. */
+
+ /* Fall through */
/* Enter here for a negative non-XCLASS. In the 8-bit library, if we are
in UTF mode, any byte with a value >= 0xc4 is a potentially valid starter
@@ -1534,24 +1585,31 @@ BOOL utf = (re->overall_options & PCRE2_UTF) != 0;
code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) +
re->name_entry_size * re->name_count;
-/* For an anchored pattern, or an unanchored pattern that has a first code
-unit, or a multiline pattern that matches only at "line start", there is no
-point in seeking a list of starting code units. */
+/* For a pattern that has a first code unit, or a multiline pattern that
+matches only at "line start", there is no point in seeking a list of starting
+code units. */
-if ((re->overall_options & PCRE2_ANCHORED) == 0 &&
- (re->flags & (PCRE2_FIRSTSET|PCRE2_STARTLINE)) == 0)
+if ((re->flags & (PCRE2_FIRSTSET|PCRE2_STARTLINE)) == 0)
{
int rc = set_start_bits(re, code, utf);
if (rc == SSB_UNKNOWN) return 1;
if (rc == SSB_DONE) re->flags |= PCRE2_FIRSTMAPSET;
}
-/* Find the minimum length of subject string. If it can match an empty string,
-the minimum length is already known. */
+/* Find the minimum length of subject string. If the pattern can match an empty
+string, the minimum length is already known. If there are more back references
+than the size of the vector we are going to cache them in, do nothing. A
+pattern that complicated will probably take a long time to analyze and may in
+any case turn out to be too complicated. Note that back reference minima are
+held as 16-bit numbers. */
-if ((re->flags & PCRE2_MATCH_EMPTY) == 0)
+if ((re->flags & PCRE2_MATCH_EMPTY) == 0 &&
+ re->top_backref <= MAX_CACHE_BACKREF)
{
- switch(min = find_minlength(re, code, code, utf, NULL, &count))
+ int backref_cache[MAX_CACHE_BACKREF+1];
+ backref_cache[0] = 0; /* Highest one that is set */
+ min = find_minlength(re, code, code, utf, NULL, &count, backref_cache);
+ switch(min)
{
case -1: /* \C in UTF mode or (*ACCEPT) or over-complex regex */
break; /* Leave minlength unchanged (will be zero) */
diff --git a/src/3rdparty/pcre2/src/pcre2_substitute.c b/src/3rdparty/pcre2/src/pcre2_substitute.c
index 0bf781efc1..8da951fc6e 100644
--- a/src/3rdparty/pcre2/src/pcre2_substitute.c
+++ b/src/3rdparty/pcre2/src/pcre2_substitute.c
@@ -114,7 +114,7 @@ for (; ptr < ptrend; ptr++)
else if (*ptr == CHAR_BACKSLASH)
{
int erc;
- int errorcode = 0;
+ int errorcode;
uint32_t ch;
if (ptr < ptrend - 1) switch (ptr[1])
@@ -127,8 +127,10 @@ for (; ptr < ptrend; ptr++)
continue;
}
+ ptr += 1; /* Must point after \ */
erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode,
code->overall_options, FALSE, NULL);
+ ptr -= 1; /* Back to last code unit of escape */
if (errorcode != 0)
{
rc = errorcode;
@@ -287,6 +289,12 @@ options &= ~SUBSTITUTE_OPTIONS;
/* Copy up to the start offset */
+if (start_offset > length)
+ {
+ match_data->leftchar = 0;
+ rc = PCRE2_ERROR_BADOFFSET;
+ goto EXIT;
+ }
CHECKMEMCPY(subject, start_offset);
/* Loop for global substituting. */
@@ -698,7 +706,7 @@ do
else if ((suboptions & PCRE2_SUBSTITUTE_EXTENDED) != 0 &&
*ptr == CHAR_BACKSLASH)
{
- int errorcode = 0;
+ int errorcode;
if (ptr < repend - 1) switch (ptr[1])
{
@@ -728,10 +736,10 @@ do
break;
}
+ ptr++; /* Point after \ */
rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode,
code->overall_options, FALSE, NULL);
if (errorcode != 0) goto BADESCAPE;
- ptr++;
switch(rc)
{
diff --git a/src/3rdparty/pcre2/src/pcre2_tables.c b/src/3rdparty/pcre2/src/pcre2_tables.c
index b945ed7a7f..9f8dc293aa 100644
--- a/src/3rdparty/pcre2/src/pcre2_tables.c
+++ b/src/3rdparty/pcre2/src/pcre2_tables.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
/* This module contains some fixed tables that are used by more than one of the
-PCRE code modules. The tables are also #included by the pcre2test program,
+PCRE2 code modules. The tables are also #included by the pcre2test program,
which uses macros to change their names from _pcre2_xxx to xxxx, thereby
avoiding name clashes with the library. In this case, PCRE2_PCRE2TEST is
defined. */
@@ -148,7 +148,7 @@ two code points. The breaking rules are as follows:
1. Break at the start and end of text (pretty obviously).
-2. Do not break between a CR and LF; otherwise, break before and after
+2. Do not break between a CR and LF; otherwise, break before and after
controls.
3. Do not break Hangul syllable sequences, the rules for which are:
@@ -157,44 +157,62 @@ two code points. The breaking rules are as follows:
LV or V may be followed by V or T
LVT or T may be followed by T
-4. Do not break before extending characters.
+4. Do not break before extending characters or zero-width-joiner (ZWJ).
-The next two rules are only for extended grapheme clusters (but that's what we
+The following rules are only for extended grapheme clusters (but that's what we
are implementing).
5. Do not break before SpacingMarks.
6. Do not break after Prepend characters.
-7. Otherwise, break everywhere.
+7. Do not break within emoji modifier sequences (E_Base or E_Base_GAZ followed
+ by E_Modifier). Extend characters are allowed before the modifier; this
+ cannot be represented in this table, the code has to deal with it.
+
+8. Do not break within emoji zwj sequences (ZWJ followed by Glue_After_Zwj or
+ E_Base_GAZ).
+
+9. Do not break within emoji flag sequences. That is, do not break between
+ regional indicator (RI) symbols if there are an odd number of RI characters
+ before the break point. This table encodes "join RI characters"; the code
+ has to deal with checking for previous adjoining RIs.
+
+10. Otherwise, break everywhere.
*/
+#define ESZ (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbZWJ)
+
const uint32_t PRIV(ucp_gbtable)[] = {
(1<<ucp_gbLF), /* 0 CR */
0, /* 1 LF */
0, /* 2 Control */
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark), /* 3 Extend */
- (1<<ucp_gbExtend)|(1<<ucp_gbPrepend)| /* 4 Prepend */
- (1<<ucp_gbSpacingMark)|(1<<ucp_gbL)|
- (1<<ucp_gbV)|(1<<ucp_gbT)|(1<<ucp_gbLV)|
- (1<<ucp_gbLVT)|(1<<ucp_gbOther),
-
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark), /* 5 SpacingMark */
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbL)| /* 6 L */
- (1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)|(1<<ucp_gbLVT),
-
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbV)| /* 7 V */
- (1<<ucp_gbT),
-
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbT), /* 8 T */
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbV)| /* 9 LV */
- (1<<ucp_gbT),
-
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbT), /* 10 LVT */
+ ESZ, /* 3 Extend */
+ ESZ|(1<<ucp_gbPrepend)| /* 4 Prepend */
+ (1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbT)|
+ (1<<ucp_gbLV)|(1<<ucp_gbLVT)|(1<<ucp_gbOther)|
+ (1<<ucp_gbRegionalIndicator)|
+ (1<<ucp_gbE_Base)|(1<<ucp_gbE_Modifier)|
+ (1<<ucp_gbE_Base_GAZ)|
+ (1<<ucp_gbZWJ)|(1<<ucp_gbGlue_After_Zwj),
+ ESZ, /* 5 SpacingMark */
+ ESZ|(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)| /* 6 L */
+ (1<<ucp_gbLVT),
+ ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 7 V */
+ ESZ|(1<<ucp_gbT), /* 8 T */
+ ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 9 LV */
+ ESZ|(1<<ucp_gbT), /* 10 LVT */
(1<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */
- (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark) /* 12 Other */
+ ESZ, /* 12 Other */
+ ESZ|(1<<ucp_gbE_Modifier), /* 13 E_Base */
+ ESZ, /* 14 E_Modifier */
+ ESZ|(1<<ucp_gbE_Modifier), /* 15 E_Base_GAZ */
+ ESZ|(1<<ucp_gbGlue_After_Zwj)|(1<<ucp_gbE_Base_GAZ), /* 16 ZWJ */
+ ESZ /* 12 Glue_After_Zwj */
};
+#undef ESZ
+
#ifdef SUPPORT_JIT
/* This table reverses PRIV(ucp_gentype). We can save the cost
of a memory load. */
@@ -227,6 +245,7 @@ version. Like all other character and string literals that are compared against
the regular expression pattern, we must use STR_ macros instead of literal
strings to make sure that UTF-8 support works on EBCDIC platforms. */
+#define STRING_Adlam0 STR_A STR_d STR_l STR_a STR_m "\0"
#define STRING_Ahom0 STR_A STR_h STR_o STR_m "\0"
#define STRING_Anatolian_Hieroglyphs0 STR_A STR_n STR_a STR_t STR_o STR_l STR_i STR_a STR_n STR_UNDERSCORE STR_H STR_i STR_e STR_r STR_o STR_g STR_l STR_y STR_p STR_h STR_s "\0"
#define STRING_Any0 STR_A STR_n STR_y "\0"
@@ -238,6 +257,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Bassa_Vah0 STR_B STR_a STR_s STR_s STR_a STR_UNDERSCORE STR_V STR_a STR_h "\0"
#define STRING_Batak0 STR_B STR_a STR_t STR_a STR_k "\0"
#define STRING_Bengali0 STR_B STR_e STR_n STR_g STR_a STR_l STR_i "\0"
+#define STRING_Bhaiksuki0 STR_B STR_h STR_a STR_i STR_k STR_s STR_u STR_k STR_i "\0"
#define STRING_Bopomofo0 STR_B STR_o STR_p STR_o STR_m STR_o STR_f STR_o "\0"
#define STRING_Brahmi0 STR_B STR_r STR_a STR_h STR_m STR_i "\0"
#define STRING_Braille0 STR_B STR_r STR_a STR_i STR_l STR_l STR_e "\0"
@@ -313,6 +333,8 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Malayalam0 STR_M STR_a STR_l STR_a STR_y STR_a STR_l STR_a STR_m "\0"
#define STRING_Mandaic0 STR_M STR_a STR_n STR_d STR_a STR_i STR_c "\0"
#define STRING_Manichaean0 STR_M STR_a STR_n STR_i STR_c STR_h STR_a STR_e STR_a STR_n "\0"
+#define STRING_Marchen0 STR_M STR_a STR_r STR_c STR_h STR_e STR_n "\0"
+#define STRING_Masaram_Gondi0 STR_M STR_a STR_s STR_a STR_r STR_a STR_m STR_UNDERSCORE STR_G STR_o STR_n STR_d STR_i "\0"
#define STRING_Mc0 STR_M STR_c "\0"
#define STRING_Me0 STR_M STR_e "\0"
#define STRING_Meetei_Mayek0 STR_M STR_e STR_e STR_t STR_e STR_i STR_UNDERSCORE STR_M STR_a STR_y STR_e STR_k "\0"
@@ -330,9 +352,11 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Nabataean0 STR_N STR_a STR_b STR_a STR_t STR_a STR_e STR_a STR_n "\0"
#define STRING_Nd0 STR_N STR_d "\0"
#define STRING_New_Tai_Lue0 STR_N STR_e STR_w STR_UNDERSCORE STR_T STR_a STR_i STR_UNDERSCORE STR_L STR_u STR_e "\0"
+#define STRING_Newa0 STR_N STR_e STR_w STR_a "\0"
#define STRING_Nko0 STR_N STR_k STR_o "\0"
#define STRING_Nl0 STR_N STR_l "\0"
#define STRING_No0 STR_N STR_o "\0"
+#define STRING_Nushu0 STR_N STR_u STR_s STR_h STR_u "\0"
#define STRING_Ogham0 STR_O STR_g STR_h STR_a STR_m "\0"
#define STRING_Ol_Chiki0 STR_O STR_l STR_UNDERSCORE STR_C STR_h STR_i STR_k STR_i "\0"
#define STRING_Old_Hungarian0 STR_O STR_l STR_d STR_UNDERSCORE STR_H STR_u STR_n STR_g STR_a STR_r STR_i STR_a STR_n "\0"
@@ -343,6 +367,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Old_South_Arabian0 STR_O STR_l STR_d STR_UNDERSCORE STR_S STR_o STR_u STR_t STR_h STR_UNDERSCORE STR_A STR_r STR_a STR_b STR_i STR_a STR_n "\0"
#define STRING_Old_Turkic0 STR_O STR_l STR_d STR_UNDERSCORE STR_T STR_u STR_r STR_k STR_i STR_c "\0"
#define STRING_Oriya0 STR_O STR_r STR_i STR_y STR_a "\0"
+#define STRING_Osage0 STR_O STR_s STR_a STR_g STR_e "\0"
#define STRING_Osmanya0 STR_O STR_s STR_m STR_a STR_n STR_y STR_a "\0"
#define STRING_P0 STR_P "\0"
#define STRING_Pahawh_Hmong0 STR_P STR_a STR_h STR_a STR_w STR_h STR_UNDERSCORE STR_H STR_m STR_o STR_n STR_g "\0"
@@ -373,6 +398,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Sm0 STR_S STR_m "\0"
#define STRING_So0 STR_S STR_o "\0"
#define STRING_Sora_Sompeng0 STR_S STR_o STR_r STR_a STR_UNDERSCORE STR_S STR_o STR_m STR_p STR_e STR_n STR_g "\0"
+#define STRING_Soyombo0 STR_S STR_o STR_y STR_o STR_m STR_b STR_o "\0"
#define STRING_Sundanese0 STR_S STR_u STR_n STR_d STR_a STR_n STR_e STR_s STR_e "\0"
#define STRING_Syloti_Nagri0 STR_S STR_y STR_l STR_o STR_t STR_i STR_UNDERSCORE STR_N STR_a STR_g STR_r STR_i "\0"
#define STRING_Syriac0 STR_S STR_y STR_r STR_i STR_a STR_c "\0"
@@ -383,6 +409,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Tai_Viet0 STR_T STR_a STR_i STR_UNDERSCORE STR_V STR_i STR_e STR_t "\0"
#define STRING_Takri0 STR_T STR_a STR_k STR_r STR_i "\0"
#define STRING_Tamil0 STR_T STR_a STR_m STR_i STR_l "\0"
+#define STRING_Tangut0 STR_T STR_a STR_n STR_g STR_u STR_t "\0"
#define STRING_Telugu0 STR_T STR_e STR_l STR_u STR_g STR_u "\0"
#define STRING_Thaana0 STR_T STR_h STR_a STR_a STR_n STR_a "\0"
#define STRING_Thai0 STR_T STR_h STR_a STR_i "\0"
@@ -399,11 +426,13 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Xwd0 STR_X STR_w STR_d "\0"
#define STRING_Yi0 STR_Y STR_i "\0"
#define STRING_Z0 STR_Z "\0"
+#define STRING_Zanabazar_Square0 STR_Z STR_a STR_n STR_a STR_b STR_a STR_z STR_a STR_r STR_UNDERSCORE STR_S STR_q STR_u STR_a STR_r STR_e "\0"
#define STRING_Zl0 STR_Z STR_l "\0"
#define STRING_Zp0 STR_Z STR_p "\0"
#define STRING_Zs0 STR_Z STR_s "\0"
const char PRIV(utt_names)[] =
+ STRING_Adlam0
STRING_Ahom0
STRING_Anatolian_Hieroglyphs0
STRING_Any0
@@ -415,6 +444,7 @@ const char PRIV(utt_names)[] =
STRING_Bassa_Vah0
STRING_Batak0
STRING_Bengali0
+ STRING_Bhaiksuki0
STRING_Bopomofo0
STRING_Brahmi0
STRING_Braille0
@@ -490,6 +520,8 @@ const char PRIV(utt_names)[] =
STRING_Malayalam0
STRING_Mandaic0
STRING_Manichaean0
+ STRING_Marchen0
+ STRING_Masaram_Gondi0
STRING_Mc0
STRING_Me0
STRING_Meetei_Mayek0
@@ -507,9 +539,11 @@ const char PRIV(utt_names)[] =
STRING_Nabataean0
STRING_Nd0
STRING_New_Tai_Lue0
+ STRING_Newa0
STRING_Nko0
STRING_Nl0
STRING_No0
+ STRING_Nushu0
STRING_Ogham0
STRING_Ol_Chiki0
STRING_Old_Hungarian0
@@ -520,6 +554,7 @@ const char PRIV(utt_names)[] =
STRING_Old_South_Arabian0
STRING_Old_Turkic0
STRING_Oriya0
+ STRING_Osage0
STRING_Osmanya0
STRING_P0
STRING_Pahawh_Hmong0
@@ -550,6 +585,7 @@ const char PRIV(utt_names)[] =
STRING_Sm0
STRING_So0
STRING_Sora_Sompeng0
+ STRING_Soyombo0
STRING_Sundanese0
STRING_Syloti_Nagri0
STRING_Syriac0
@@ -560,6 +596,7 @@ const char PRIV(utt_names)[] =
STRING_Tai_Viet0
STRING_Takri0
STRING_Tamil0
+ STRING_Tangut0
STRING_Telugu0
STRING_Thaana0
STRING_Thai0
@@ -576,186 +613,197 @@ const char PRIV(utt_names)[] =
STRING_Xwd0
STRING_Yi0
STRING_Z0
+ STRING_Zanabazar_Square0
STRING_Zl0
STRING_Zp0
STRING_Zs0;
const ucp_type_table PRIV(utt)[] = {
- { 0, PT_SC, ucp_Ahom },
- { 5, PT_SC, ucp_Anatolian_Hieroglyphs },
- { 27, PT_ANY, 0 },
- { 31, PT_SC, ucp_Arabic },
- { 38, PT_SC, ucp_Armenian },
- { 47, PT_SC, ucp_Avestan },
- { 55, PT_SC, ucp_Balinese },
- { 64, PT_SC, ucp_Bamum },
- { 70, PT_SC, ucp_Bassa_Vah },
- { 80, PT_SC, ucp_Batak },
- { 86, PT_SC, ucp_Bengali },
- { 94, PT_SC, ucp_Bopomofo },
- { 103, PT_SC, ucp_Brahmi },
- { 110, PT_SC, ucp_Braille },
- { 118, PT_SC, ucp_Buginese },
- { 127, PT_SC, ucp_Buhid },
- { 133, PT_GC, ucp_C },
- { 135, PT_SC, ucp_Canadian_Aboriginal },
- { 155, PT_SC, ucp_Carian },
- { 162, PT_SC, ucp_Caucasian_Albanian },
- { 181, PT_PC, ucp_Cc },
- { 184, PT_PC, ucp_Cf },
- { 187, PT_SC, ucp_Chakma },
- { 194, PT_SC, ucp_Cham },
- { 199, PT_SC, ucp_Cherokee },
- { 208, PT_PC, ucp_Cn },
- { 211, PT_PC, ucp_Co },
- { 214, PT_SC, ucp_Common },
- { 221, PT_SC, ucp_Coptic },
- { 228, PT_PC, ucp_Cs },
- { 231, PT_SC, ucp_Cuneiform },
- { 241, PT_SC, ucp_Cypriot },
- { 249, PT_SC, ucp_Cyrillic },
- { 258, PT_SC, ucp_Deseret },
- { 266, PT_SC, ucp_Devanagari },
- { 277, PT_SC, ucp_Duployan },
- { 286, PT_SC, ucp_Egyptian_Hieroglyphs },
- { 307, PT_SC, ucp_Elbasan },
- { 315, PT_SC, ucp_Ethiopic },
- { 324, PT_SC, ucp_Georgian },
- { 333, PT_SC, ucp_Glagolitic },
- { 344, PT_SC, ucp_Gothic },
- { 351, PT_SC, ucp_Grantha },
- { 359, PT_SC, ucp_Greek },
- { 365, PT_SC, ucp_Gujarati },
- { 374, PT_SC, ucp_Gurmukhi },
- { 383, PT_SC, ucp_Han },
- { 387, PT_SC, ucp_Hangul },
- { 394, PT_SC, ucp_Hanunoo },
- { 402, PT_SC, ucp_Hatran },
- { 409, PT_SC, ucp_Hebrew },
- { 416, PT_SC, ucp_Hiragana },
- { 425, PT_SC, ucp_Imperial_Aramaic },
- { 442, PT_SC, ucp_Inherited },
- { 452, PT_SC, ucp_Inscriptional_Pahlavi },
- { 474, PT_SC, ucp_Inscriptional_Parthian },
- { 497, PT_SC, ucp_Javanese },
- { 506, PT_SC, ucp_Kaithi },
- { 513, PT_SC, ucp_Kannada },
- { 521, PT_SC, ucp_Katakana },
- { 530, PT_SC, ucp_Kayah_Li },
- { 539, PT_SC, ucp_Kharoshthi },
- { 550, PT_SC, ucp_Khmer },
- { 556, PT_SC, ucp_Khojki },
- { 563, PT_SC, ucp_Khudawadi },
- { 573, PT_GC, ucp_L },
- { 575, PT_LAMP, 0 },
- { 578, PT_SC, ucp_Lao },
- { 582, PT_SC, ucp_Latin },
- { 588, PT_SC, ucp_Lepcha },
- { 595, PT_SC, ucp_Limbu },
- { 601, PT_SC, ucp_Linear_A },
- { 610, PT_SC, ucp_Linear_B },
- { 619, PT_SC, ucp_Lisu },
- { 624, PT_PC, ucp_Ll },
- { 627, PT_PC, ucp_Lm },
- { 630, PT_PC, ucp_Lo },
- { 633, PT_PC, ucp_Lt },
- { 636, PT_PC, ucp_Lu },
- { 639, PT_SC, ucp_Lycian },
- { 646, PT_SC, ucp_Lydian },
- { 653, PT_GC, ucp_M },
- { 655, PT_SC, ucp_Mahajani },
- { 664, PT_SC, ucp_Malayalam },
- { 674, PT_SC, ucp_Mandaic },
- { 682, PT_SC, ucp_Manichaean },
- { 693, PT_PC, ucp_Mc },
- { 696, PT_PC, ucp_Me },
- { 699, PT_SC, ucp_Meetei_Mayek },
- { 712, PT_SC, ucp_Mende_Kikakui },
- { 726, PT_SC, ucp_Meroitic_Cursive },
- { 743, PT_SC, ucp_Meroitic_Hieroglyphs },
- { 764, PT_SC, ucp_Miao },
- { 769, PT_PC, ucp_Mn },
- { 772, PT_SC, ucp_Modi },
- { 777, PT_SC, ucp_Mongolian },
- { 787, PT_SC, ucp_Mro },
- { 791, PT_SC, ucp_Multani },
- { 799, PT_SC, ucp_Myanmar },
- { 807, PT_GC, ucp_N },
- { 809, PT_SC, ucp_Nabataean },
- { 819, PT_PC, ucp_Nd },
- { 822, PT_SC, ucp_New_Tai_Lue },
- { 834, PT_SC, ucp_Nko },
- { 838, PT_PC, ucp_Nl },
- { 841, PT_PC, ucp_No },
- { 844, PT_SC, ucp_Ogham },
- { 850, PT_SC, ucp_Ol_Chiki },
- { 859, PT_SC, ucp_Old_Hungarian },
- { 873, PT_SC, ucp_Old_Italic },
- { 884, PT_SC, ucp_Old_North_Arabian },
- { 902, PT_SC, ucp_Old_Permic },
- { 913, PT_SC, ucp_Old_Persian },
- { 925, PT_SC, ucp_Old_South_Arabian },
- { 943, PT_SC, ucp_Old_Turkic },
- { 954, PT_SC, ucp_Oriya },
- { 960, PT_SC, ucp_Osmanya },
- { 968, PT_GC, ucp_P },
- { 970, PT_SC, ucp_Pahawh_Hmong },
- { 983, PT_SC, ucp_Palmyrene },
- { 993, PT_SC, ucp_Pau_Cin_Hau },
- { 1005, PT_PC, ucp_Pc },
- { 1008, PT_PC, ucp_Pd },
- { 1011, PT_PC, ucp_Pe },
- { 1014, PT_PC, ucp_Pf },
- { 1017, PT_SC, ucp_Phags_Pa },
- { 1026, PT_SC, ucp_Phoenician },
- { 1037, PT_PC, ucp_Pi },
- { 1040, PT_PC, ucp_Po },
- { 1043, PT_PC, ucp_Ps },
- { 1046, PT_SC, ucp_Psalter_Pahlavi },
- { 1062, PT_SC, ucp_Rejang },
- { 1069, PT_SC, ucp_Runic },
- { 1075, PT_GC, ucp_S },
- { 1077, PT_SC, ucp_Samaritan },
- { 1087, PT_SC, ucp_Saurashtra },
- { 1098, PT_PC, ucp_Sc },
- { 1101, PT_SC, ucp_Sharada },
- { 1109, PT_SC, ucp_Shavian },
- { 1117, PT_SC, ucp_Siddham },
- { 1125, PT_SC, ucp_SignWriting },
- { 1137, PT_SC, ucp_Sinhala },
- { 1145, PT_PC, ucp_Sk },
- { 1148, PT_PC, ucp_Sm },
- { 1151, PT_PC, ucp_So },
- { 1154, PT_SC, ucp_Sora_Sompeng },
- { 1167, PT_SC, ucp_Sundanese },
- { 1177, PT_SC, ucp_Syloti_Nagri },
- { 1190, PT_SC, ucp_Syriac },
- { 1197, PT_SC, ucp_Tagalog },
- { 1205, PT_SC, ucp_Tagbanwa },
- { 1214, PT_SC, ucp_Tai_Le },
- { 1221, PT_SC, ucp_Tai_Tham },
- { 1230, PT_SC, ucp_Tai_Viet },
- { 1239, PT_SC, ucp_Takri },
- { 1245, PT_SC, ucp_Tamil },
- { 1251, PT_SC, ucp_Telugu },
- { 1258, PT_SC, ucp_Thaana },
- { 1265, PT_SC, ucp_Thai },
- { 1270, PT_SC, ucp_Tibetan },
- { 1278, PT_SC, ucp_Tifinagh },
- { 1287, PT_SC, ucp_Tirhuta },
- { 1295, PT_SC, ucp_Ugaritic },
- { 1304, PT_SC, ucp_Vai },
- { 1308, PT_SC, ucp_Warang_Citi },
- { 1320, PT_ALNUM, 0 },
- { 1324, PT_PXSPACE, 0 },
- { 1328, PT_SPACE, 0 },
- { 1332, PT_UCNC, 0 },
- { 1336, PT_WORD, 0 },
- { 1340, PT_SC, ucp_Yi },
- { 1343, PT_GC, ucp_Z },
- { 1345, PT_PC, ucp_Zl },
- { 1348, PT_PC, ucp_Zp },
- { 1351, PT_PC, ucp_Zs }
+ { 0, PT_SC, ucp_Adlam },
+ { 6, PT_SC, ucp_Ahom },
+ { 11, PT_SC, ucp_Anatolian_Hieroglyphs },
+ { 33, PT_ANY, 0 },
+ { 37, PT_SC, ucp_Arabic },
+ { 44, PT_SC, ucp_Armenian },
+ { 53, PT_SC, ucp_Avestan },
+ { 61, PT_SC, ucp_Balinese },
+ { 70, PT_SC, ucp_Bamum },
+ { 76, PT_SC, ucp_Bassa_Vah },
+ { 86, PT_SC, ucp_Batak },
+ { 92, PT_SC, ucp_Bengali },
+ { 100, PT_SC, ucp_Bhaiksuki },
+ { 110, PT_SC, ucp_Bopomofo },
+ { 119, PT_SC, ucp_Brahmi },
+ { 126, PT_SC, ucp_Braille },
+ { 134, PT_SC, ucp_Buginese },
+ { 143, PT_SC, ucp_Buhid },
+ { 149, PT_GC, ucp_C },
+ { 151, PT_SC, ucp_Canadian_Aboriginal },
+ { 171, PT_SC, ucp_Carian },
+ { 178, PT_SC, ucp_Caucasian_Albanian },
+ { 197, PT_PC, ucp_Cc },
+ { 200, PT_PC, ucp_Cf },
+ { 203, PT_SC, ucp_Chakma },
+ { 210, PT_SC, ucp_Cham },
+ { 215, PT_SC, ucp_Cherokee },
+ { 224, PT_PC, ucp_Cn },
+ { 227, PT_PC, ucp_Co },
+ { 230, PT_SC, ucp_Common },
+ { 237, PT_SC, ucp_Coptic },
+ { 244, PT_PC, ucp_Cs },
+ { 247, PT_SC, ucp_Cuneiform },
+ { 257, PT_SC, ucp_Cypriot },
+ { 265, PT_SC, ucp_Cyrillic },
+ { 274, PT_SC, ucp_Deseret },
+ { 282, PT_SC, ucp_Devanagari },
+ { 293, PT_SC, ucp_Duployan },
+ { 302, PT_SC, ucp_Egyptian_Hieroglyphs },
+ { 323, PT_SC, ucp_Elbasan },
+ { 331, PT_SC, ucp_Ethiopic },
+ { 340, PT_SC, ucp_Georgian },
+ { 349, PT_SC, ucp_Glagolitic },
+ { 360, PT_SC, ucp_Gothic },
+ { 367, PT_SC, ucp_Grantha },
+ { 375, PT_SC, ucp_Greek },
+ { 381, PT_SC, ucp_Gujarati },
+ { 390, PT_SC, ucp_Gurmukhi },
+ { 399, PT_SC, ucp_Han },
+ { 403, PT_SC, ucp_Hangul },
+ { 410, PT_SC, ucp_Hanunoo },
+ { 418, PT_SC, ucp_Hatran },
+ { 425, PT_SC, ucp_Hebrew },
+ { 432, PT_SC, ucp_Hiragana },
+ { 441, PT_SC, ucp_Imperial_Aramaic },
+ { 458, PT_SC, ucp_Inherited },
+ { 468, PT_SC, ucp_Inscriptional_Pahlavi },
+ { 490, PT_SC, ucp_Inscriptional_Parthian },
+ { 513, PT_SC, ucp_Javanese },
+ { 522, PT_SC, ucp_Kaithi },
+ { 529, PT_SC, ucp_Kannada },
+ { 537, PT_SC, ucp_Katakana },
+ { 546, PT_SC, ucp_Kayah_Li },
+ { 555, PT_SC, ucp_Kharoshthi },
+ { 566, PT_SC, ucp_Khmer },
+ { 572, PT_SC, ucp_Khojki },
+ { 579, PT_SC, ucp_Khudawadi },
+ { 589, PT_GC, ucp_L },
+ { 591, PT_LAMP, 0 },
+ { 594, PT_SC, ucp_Lao },
+ { 598, PT_SC, ucp_Latin },
+ { 604, PT_SC, ucp_Lepcha },
+ { 611, PT_SC, ucp_Limbu },
+ { 617, PT_SC, ucp_Linear_A },
+ { 626, PT_SC, ucp_Linear_B },
+ { 635, PT_SC, ucp_Lisu },
+ { 640, PT_PC, ucp_Ll },
+ { 643, PT_PC, ucp_Lm },
+ { 646, PT_PC, ucp_Lo },
+ { 649, PT_PC, ucp_Lt },
+ { 652, PT_PC, ucp_Lu },
+ { 655, PT_SC, ucp_Lycian },
+ { 662, PT_SC, ucp_Lydian },
+ { 669, PT_GC, ucp_M },
+ { 671, PT_SC, ucp_Mahajani },
+ { 680, PT_SC, ucp_Malayalam },
+ { 690, PT_SC, ucp_Mandaic },
+ { 698, PT_SC, ucp_Manichaean },
+ { 709, PT_SC, ucp_Marchen },
+ { 717, PT_SC, ucp_Masaram_Gondi },
+ { 731, PT_PC, ucp_Mc },
+ { 734, PT_PC, ucp_Me },
+ { 737, PT_SC, ucp_Meetei_Mayek },
+ { 750, PT_SC, ucp_Mende_Kikakui },
+ { 764, PT_SC, ucp_Meroitic_Cursive },
+ { 781, PT_SC, ucp_Meroitic_Hieroglyphs },
+ { 802, PT_SC, ucp_Miao },
+ { 807, PT_PC, ucp_Mn },
+ { 810, PT_SC, ucp_Modi },
+ { 815, PT_SC, ucp_Mongolian },
+ { 825, PT_SC, ucp_Mro },
+ { 829, PT_SC, ucp_Multani },
+ { 837, PT_SC, ucp_Myanmar },
+ { 845, PT_GC, ucp_N },
+ { 847, PT_SC, ucp_Nabataean },
+ { 857, PT_PC, ucp_Nd },
+ { 860, PT_SC, ucp_New_Tai_Lue },
+ { 872, PT_SC, ucp_Newa },
+ { 877, PT_SC, ucp_Nko },
+ { 881, PT_PC, ucp_Nl },
+ { 884, PT_PC, ucp_No },
+ { 887, PT_SC, ucp_Nushu },
+ { 893, PT_SC, ucp_Ogham },
+ { 899, PT_SC, ucp_Ol_Chiki },
+ { 908, PT_SC, ucp_Old_Hungarian },
+ { 922, PT_SC, ucp_Old_Italic },
+ { 933, PT_SC, ucp_Old_North_Arabian },
+ { 951, PT_SC, ucp_Old_Permic },
+ { 962, PT_SC, ucp_Old_Persian },
+ { 974, PT_SC, ucp_Old_South_Arabian },
+ { 992, PT_SC, ucp_Old_Turkic },
+ { 1003, PT_SC, ucp_Oriya },
+ { 1009, PT_SC, ucp_Osage },
+ { 1015, PT_SC, ucp_Osmanya },
+ { 1023, PT_GC, ucp_P },
+ { 1025, PT_SC, ucp_Pahawh_Hmong },
+ { 1038, PT_SC, ucp_Palmyrene },
+ { 1048, PT_SC, ucp_Pau_Cin_Hau },
+ { 1060, PT_PC, ucp_Pc },
+ { 1063, PT_PC, ucp_Pd },
+ { 1066, PT_PC, ucp_Pe },
+ { 1069, PT_PC, ucp_Pf },
+ { 1072, PT_SC, ucp_Phags_Pa },
+ { 1081, PT_SC, ucp_Phoenician },
+ { 1092, PT_PC, ucp_Pi },
+ { 1095, PT_PC, ucp_Po },
+ { 1098, PT_PC, ucp_Ps },
+ { 1101, PT_SC, ucp_Psalter_Pahlavi },
+ { 1117, PT_SC, ucp_Rejang },
+ { 1124, PT_SC, ucp_Runic },
+ { 1130, PT_GC, ucp_S },
+ { 1132, PT_SC, ucp_Samaritan },
+ { 1142, PT_SC, ucp_Saurashtra },
+ { 1153, PT_PC, ucp_Sc },
+ { 1156, PT_SC, ucp_Sharada },
+ { 1164, PT_SC, ucp_Shavian },
+ { 1172, PT_SC, ucp_Siddham },
+ { 1180, PT_SC, ucp_SignWriting },
+ { 1192, PT_SC, ucp_Sinhala },
+ { 1200, PT_PC, ucp_Sk },
+ { 1203, PT_PC, ucp_Sm },
+ { 1206, PT_PC, ucp_So },
+ { 1209, PT_SC, ucp_Sora_Sompeng },
+ { 1222, PT_SC, ucp_Soyombo },
+ { 1230, PT_SC, ucp_Sundanese },
+ { 1240, PT_SC, ucp_Syloti_Nagri },
+ { 1253, PT_SC, ucp_Syriac },
+ { 1260, PT_SC, ucp_Tagalog },
+ { 1268, PT_SC, ucp_Tagbanwa },
+ { 1277, PT_SC, ucp_Tai_Le },
+ { 1284, PT_SC, ucp_Tai_Tham },
+ { 1293, PT_SC, ucp_Tai_Viet },
+ { 1302, PT_SC, ucp_Takri },
+ { 1308, PT_SC, ucp_Tamil },
+ { 1314, PT_SC, ucp_Tangut },
+ { 1321, PT_SC, ucp_Telugu },
+ { 1328, PT_SC, ucp_Thaana },
+ { 1335, PT_SC, ucp_Thai },
+ { 1340, PT_SC, ucp_Tibetan },
+ { 1348, PT_SC, ucp_Tifinagh },
+ { 1357, PT_SC, ucp_Tirhuta },
+ { 1365, PT_SC, ucp_Ugaritic },
+ { 1374, PT_SC, ucp_Vai },
+ { 1378, PT_SC, ucp_Warang_Citi },
+ { 1390, PT_ALNUM, 0 },
+ { 1394, PT_PXSPACE, 0 },
+ { 1398, PT_SPACE, 0 },
+ { 1402, PT_UCNC, 0 },
+ { 1406, PT_WORD, 0 },
+ { 1410, PT_SC, ucp_Yi },
+ { 1413, PT_GC, ucp_Z },
+ { 1415, PT_SC, ucp_Zanabazar_Square },
+ { 1432, PT_PC, ucp_Zl },
+ { 1435, PT_PC, ucp_Zp },
+ { 1438, PT_PC, ucp_Zs }
};
const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
diff --git a/src/3rdparty/pcre2/src/pcre2_ucd.c b/src/3rdparty/pcre2/src/pcre2_ucd.c
index 116f537b38..ac7649b99e 100644
--- a/src/3rdparty/pcre2/src/pcre2_ucd.c
+++ b/src/3rdparty/pcre2/src/pcre2_ucd.c
@@ -20,7 +20,7 @@ needed. */
/* Unicode character database. */
/* This file was autogenerated by the MultiStage2.py script. */
-/* Total size: 75072 bytes, block size: 128. */
+/* Total size: 80808 bytes, block size: 128. */
/* The tables herein are needed only when UCP support is built,
and in PCRE2 that happens automatically with UTF support.
@@ -39,7 +39,21 @@ const uint16_t PRIV(ucd_stage2)[] = {0};
const uint32_t PRIV(ucd_caseless_sets)[] = {0};
#else
-const char *PRIV(unicode_version) = "8.0.0";
+const char *PRIV(unicode_version) = "10.0.0";
+
+/* If the 32-bit library is run in non-32-bit mode, character values
+greater than 0x10ffff may be encountered. For these we set up a
+special record. */
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+const ucd_record PRIV(dummy_ucd_record)[] = {{
+ ucp_Common, /* script */
+ ucp_Cn, /* type unassigned */
+ ucp_gbOther, /* grapheme break property */
+ 0, /* case set */
+ 0, /* other case */
+ }};
+#endif
/* When recompiling tables with a new Unicode version, please check the
types in this structure definition from pcre2_internal.h (the actual
@@ -72,17 +86,25 @@ const uint32_t PRIV(ucd_caseless_sets)[] = {
0x039a, 0x03ba, 0x03f0, NOTACHAR,
0x03a1, 0x03c1, 0x03f1, NOTACHAR,
0x0395, 0x03b5, 0x03f5, NOTACHAR,
+ 0x0412, 0x0432, 0x1c80, NOTACHAR,
+ 0x0414, 0x0434, 0x1c81, NOTACHAR,
+ 0x041e, 0x043e, 0x1c82, NOTACHAR,
+ 0x0421, 0x0441, 0x1c83, NOTACHAR,
+ 0x0422, 0x0442, 0x1c84, 0x1c85, NOTACHAR,
+ 0x042a, 0x044a, 0x1c86, NOTACHAR,
+ 0x0462, 0x0463, 0x1c87, NOTACHAR,
0x1e60, 0x1e61, 0x1e9b, NOTACHAR,
0x03a9, 0x03c9, 0x2126, NOTACHAR,
0x004b, 0x006b, 0x212a, NOTACHAR,
0x00c5, 0x00e5, 0x212b, NOTACHAR,
+ 0x1c88, 0xa64a, 0xa64b, NOTACHAR,
};
/* When #included in pcre2test, we don't need this large table. */
#ifndef PCRE2_PCRE2TEST
-const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
+const ucd_record PRIV(ucd_records)[] = { /* 6568 bytes, record size 8 */
{ 9, 0, 2, 0, 0, }, /* 0 */
{ 9, 0, 1, 0, 0, }, /* 1 */
{ 9, 0, 0, 0, 0, }, /* 2 */
@@ -95,12 +117,12 @@ const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
{ 9, 17, 12, 0, 0, }, /* 9 */
{ 9, 13, 12, 0, 0, }, /* 10 */
{ 33, 9, 12, 0, 32, }, /* 11 */
- { 33, 9, 12, 71, 32, }, /* 12 */
+ { 33, 9, 12, 100, 32, }, /* 12 */
{ 33, 9, 12, 1, 32, }, /* 13 */
{ 9, 24, 12, 0, 0, }, /* 14 */
{ 9, 16, 12, 0, 0, }, /* 15 */
{ 33, 5, 12, 0, -32, }, /* 16 */
- { 33, 5, 12, 71, -32, }, /* 17 */
+ { 33, 5, 12, 100, -32, }, /* 17 */
{ 33, 5, 12, 1, -32, }, /* 18 */
{ 9, 26, 12, 0, 0, }, /* 19 */
{ 33, 7, 12, 0, 0, }, /* 20 */
@@ -109,9 +131,9 @@ const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
{ 9, 15, 12, 0, 0, }, /* 23 */
{ 9, 5, 12, 26, 775, }, /* 24 */
{ 9, 19, 12, 0, 0, }, /* 25 */
- { 33, 9, 12, 75, 32, }, /* 26 */
+ { 33, 9, 12, 104, 32, }, /* 26 */
{ 33, 5, 12, 0, 7615, }, /* 27 */
- { 33, 5, 12, 75, -32, }, /* 28 */
+ { 33, 5, 12, 104, -32, }, /* 28 */
{ 33, 5, 12, 0, 121, }, /* 29 */
{ 33, 9, 12, 0, 1, }, /* 30 */
{ 33, 5, 12, 0, -1, }, /* 31 */
@@ -218,7 +240,7 @@ const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
{ 19, 9, 12, 55, 32, }, /* 132 */
{ 19, 9, 12, 30, 32, }, /* 133 */
{ 19, 9, 12, 43, 32, }, /* 134 */
- { 19, 9, 12, 67, 32, }, /* 135 */
+ { 19, 9, 12, 96, 32, }, /* 135 */
{ 19, 5, 12, 0, -38, }, /* 136 */
{ 19, 5, 12, 0, -37, }, /* 137 */
{ 19, 5, 12, 0, -32, }, /* 138 */
@@ -233,7 +255,7 @@ const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
{ 19, 5, 12, 30, 1, }, /* 147 */
{ 19, 5, 12, 30, -32, }, /* 148 */
{ 19, 5, 12, 43, -32, }, /* 149 */
- { 19, 5, 12, 67, -32, }, /* 150 */
+ { 19, 5, 12, 96, -32, }, /* 150 */
{ 19, 5, 12, 0, -64, }, /* 151 */
{ 19, 5, 12, 0, -63, }, /* 152 */
{ 19, 9, 12, 0, 8, }, /* 153 */
@@ -256,577 +278,654 @@ const ucd_record PRIV(ucd_records)[] = { /* 5952 bytes, record size 8 */
{ 19, 9, 12, 0, -130, }, /* 170 */
{ 12, 9, 12, 0, 80, }, /* 171 */
{ 12, 9, 12, 0, 32, }, /* 172 */
- { 12, 5, 12, 0, -32, }, /* 173 */
- { 12, 5, 12, 0, -80, }, /* 174 */
- { 12, 9, 12, 0, 1, }, /* 175 */
- { 12, 5, 12, 0, -1, }, /* 176 */
- { 12, 26, 12, 0, 0, }, /* 177 */
- { 12, 12, 3, 0, 0, }, /* 178 */
- { 12, 11, 3, 0, 0, }, /* 179 */
- { 12, 9, 12, 0, 15, }, /* 180 */
- { 12, 5, 12, 0, -15, }, /* 181 */
- { 1, 9, 12, 0, 48, }, /* 182 */
- { 1, 6, 12, 0, 0, }, /* 183 */
- { 1, 21, 12, 0, 0, }, /* 184 */
- { 1, 5, 12, 0, -48, }, /* 185 */
- { 1, 5, 12, 0, 0, }, /* 186 */
- { 1, 17, 12, 0, 0, }, /* 187 */
- { 1, 26, 12, 0, 0, }, /* 188 */
- { 1, 23, 12, 0, 0, }, /* 189 */
- { 25, 12, 3, 0, 0, }, /* 190 */
- { 25, 17, 12, 0, 0, }, /* 191 */
- { 25, 21, 12, 0, 0, }, /* 192 */
- { 25, 7, 12, 0, 0, }, /* 193 */
- { 0, 1, 2, 0, 0, }, /* 194 */
- { 0, 25, 12, 0, 0, }, /* 195 */
- { 0, 21, 12, 0, 0, }, /* 196 */
- { 0, 23, 12, 0, 0, }, /* 197 */
- { 0, 26, 12, 0, 0, }, /* 198 */
- { 0, 12, 3, 0, 0, }, /* 199 */
- { 0, 7, 12, 0, 0, }, /* 200 */
- { 0, 13, 12, 0, 0, }, /* 201 */
- { 0, 6, 12, 0, 0, }, /* 202 */
- { 49, 21, 12, 0, 0, }, /* 203 */
- { 49, 1, 2, 0, 0, }, /* 204 */
- { 49, 7, 12, 0, 0, }, /* 205 */
- { 49, 12, 3, 0, 0, }, /* 206 */
- { 55, 7, 12, 0, 0, }, /* 207 */
- { 55, 12, 3, 0, 0, }, /* 208 */
- { 63, 13, 12, 0, 0, }, /* 209 */
- { 63, 7, 12, 0, 0, }, /* 210 */
- { 63, 12, 3, 0, 0, }, /* 211 */
- { 63, 6, 12, 0, 0, }, /* 212 */
- { 63, 26, 12, 0, 0, }, /* 213 */
- { 63, 21, 12, 0, 0, }, /* 214 */
- { 89, 7, 12, 0, 0, }, /* 215 */
- { 89, 12, 3, 0, 0, }, /* 216 */
- { 89, 6, 12, 0, 0, }, /* 217 */
- { 89, 21, 12, 0, 0, }, /* 218 */
- { 94, 7, 12, 0, 0, }, /* 219 */
- { 94, 12, 3, 0, 0, }, /* 220 */
- { 94, 21, 12, 0, 0, }, /* 221 */
- { 14, 12, 3, 0, 0, }, /* 222 */
- { 14, 10, 5, 0, 0, }, /* 223 */
- { 14, 7, 12, 0, 0, }, /* 224 */
- { 14, 13, 12, 0, 0, }, /* 225 */
- { 14, 21, 12, 0, 0, }, /* 226 */
- { 14, 6, 12, 0, 0, }, /* 227 */
- { 2, 7, 12, 0, 0, }, /* 228 */
- { 2, 12, 3, 0, 0, }, /* 229 */
- { 2, 10, 5, 0, 0, }, /* 230 */
- { 2, 10, 3, 0, 0, }, /* 231 */
- { 2, 13, 12, 0, 0, }, /* 232 */
- { 2, 23, 12, 0, 0, }, /* 233 */
- { 2, 15, 12, 0, 0, }, /* 234 */
- { 2, 26, 12, 0, 0, }, /* 235 */
- { 21, 12, 3, 0, 0, }, /* 236 */
- { 21, 10, 5, 0, 0, }, /* 237 */
- { 21, 7, 12, 0, 0, }, /* 238 */
- { 21, 13, 12, 0, 0, }, /* 239 */
- { 20, 12, 3, 0, 0, }, /* 240 */
- { 20, 10, 5, 0, 0, }, /* 241 */
- { 20, 7, 12, 0, 0, }, /* 242 */
- { 20, 13, 12, 0, 0, }, /* 243 */
- { 20, 21, 12, 0, 0, }, /* 244 */
- { 20, 23, 12, 0, 0, }, /* 245 */
- { 43, 12, 3, 0, 0, }, /* 246 */
- { 43, 10, 5, 0, 0, }, /* 247 */
- { 43, 7, 12, 0, 0, }, /* 248 */
- { 43, 10, 3, 0, 0, }, /* 249 */
- { 43, 13, 12, 0, 0, }, /* 250 */
- { 43, 26, 12, 0, 0, }, /* 251 */
- { 43, 15, 12, 0, 0, }, /* 252 */
- { 53, 12, 3, 0, 0, }, /* 253 */
- { 53, 7, 12, 0, 0, }, /* 254 */
- { 53, 10, 3, 0, 0, }, /* 255 */
- { 53, 10, 5, 0, 0, }, /* 256 */
- { 53, 13, 12, 0, 0, }, /* 257 */
- { 53, 15, 12, 0, 0, }, /* 258 */
- { 53, 26, 12, 0, 0, }, /* 259 */
- { 53, 23, 12, 0, 0, }, /* 260 */
- { 54, 12, 3, 0, 0, }, /* 261 */
- { 54, 10, 5, 0, 0, }, /* 262 */
- { 54, 7, 12, 0, 0, }, /* 263 */
- { 54, 13, 12, 0, 0, }, /* 264 */
- { 54, 15, 12, 0, 0, }, /* 265 */
- { 54, 26, 12, 0, 0, }, /* 266 */
- { 28, 12, 3, 0, 0, }, /* 267 */
- { 28, 10, 5, 0, 0, }, /* 268 */
- { 28, 7, 12, 0, 0, }, /* 269 */
- { 28, 10, 3, 0, 0, }, /* 270 */
- { 28, 13, 12, 0, 0, }, /* 271 */
- { 36, 12, 3, 0, 0, }, /* 272 */
- { 36, 10, 5, 0, 0, }, /* 273 */
- { 36, 7, 12, 0, 0, }, /* 274 */
- { 36, 10, 3, 0, 0, }, /* 275 */
- { 36, 13, 12, 0, 0, }, /* 276 */
- { 36, 15, 12, 0, 0, }, /* 277 */
- { 36, 26, 12, 0, 0, }, /* 278 */
- { 47, 10, 5, 0, 0, }, /* 279 */
- { 47, 7, 12, 0, 0, }, /* 280 */
- { 47, 12, 3, 0, 0, }, /* 281 */
- { 47, 10, 3, 0, 0, }, /* 282 */
- { 47, 13, 12, 0, 0, }, /* 283 */
- { 47, 21, 12, 0, 0, }, /* 284 */
- { 56, 7, 12, 0, 0, }, /* 285 */
- { 56, 12, 3, 0, 0, }, /* 286 */
- { 56, 7, 5, 0, 0, }, /* 287 */
- { 56, 6, 12, 0, 0, }, /* 288 */
- { 56, 21, 12, 0, 0, }, /* 289 */
- { 56, 13, 12, 0, 0, }, /* 290 */
- { 32, 7, 12, 0, 0, }, /* 291 */
- { 32, 12, 3, 0, 0, }, /* 292 */
- { 32, 7, 5, 0, 0, }, /* 293 */
- { 32, 6, 12, 0, 0, }, /* 294 */
- { 32, 13, 12, 0, 0, }, /* 295 */
- { 57, 7, 12, 0, 0, }, /* 296 */
- { 57, 26, 12, 0, 0, }, /* 297 */
- { 57, 21, 12, 0, 0, }, /* 298 */
- { 57, 12, 3, 0, 0, }, /* 299 */
- { 57, 13, 12, 0, 0, }, /* 300 */
- { 57, 15, 12, 0, 0, }, /* 301 */
- { 57, 22, 12, 0, 0, }, /* 302 */
- { 57, 18, 12, 0, 0, }, /* 303 */
- { 57, 10, 5, 0, 0, }, /* 304 */
- { 38, 7, 12, 0, 0, }, /* 305 */
- { 38, 10, 12, 0, 0, }, /* 306 */
- { 38, 12, 3, 0, 0, }, /* 307 */
- { 38, 10, 5, 0, 0, }, /* 308 */
- { 38, 13, 12, 0, 0, }, /* 309 */
- { 38, 21, 12, 0, 0, }, /* 310 */
- { 38, 26, 12, 0, 0, }, /* 311 */
- { 16, 9, 12, 0, 7264, }, /* 312 */
- { 16, 7, 12, 0, 0, }, /* 313 */
- { 16, 6, 12, 0, 0, }, /* 314 */
- { 23, 7, 6, 0, 0, }, /* 315 */
- { 23, 7, 7, 0, 0, }, /* 316 */
- { 23, 7, 8, 0, 0, }, /* 317 */
- { 15, 7, 12, 0, 0, }, /* 318 */
- { 15, 12, 3, 0, 0, }, /* 319 */
- { 15, 21, 12, 0, 0, }, /* 320 */
- { 15, 15, 12, 0, 0, }, /* 321 */
- { 15, 26, 12, 0, 0, }, /* 322 */
- { 8, 9, 12, 0, 38864, }, /* 323 */
- { 8, 9, 12, 0, 8, }, /* 324 */
- { 8, 5, 12, 0, -8, }, /* 325 */
- { 7, 17, 12, 0, 0, }, /* 326 */
- { 7, 7, 12, 0, 0, }, /* 327 */
- { 7, 21, 12, 0, 0, }, /* 328 */
- { 40, 29, 12, 0, 0, }, /* 329 */
- { 40, 7, 12, 0, 0, }, /* 330 */
- { 40, 22, 12, 0, 0, }, /* 331 */
- { 40, 18, 12, 0, 0, }, /* 332 */
- { 45, 7, 12, 0, 0, }, /* 333 */
- { 45, 14, 12, 0, 0, }, /* 334 */
- { 50, 7, 12, 0, 0, }, /* 335 */
- { 50, 12, 3, 0, 0, }, /* 336 */
- { 24, 7, 12, 0, 0, }, /* 337 */
- { 24, 12, 3, 0, 0, }, /* 338 */
- { 6, 7, 12, 0, 0, }, /* 339 */
- { 6, 12, 3, 0, 0, }, /* 340 */
- { 51, 7, 12, 0, 0, }, /* 341 */
- { 51, 12, 3, 0, 0, }, /* 342 */
- { 31, 7, 12, 0, 0, }, /* 343 */
- { 31, 12, 3, 0, 0, }, /* 344 */
- { 31, 10, 5, 0, 0, }, /* 345 */
- { 31, 21, 12, 0, 0, }, /* 346 */
- { 31, 6, 12, 0, 0, }, /* 347 */
- { 31, 23, 12, 0, 0, }, /* 348 */
- { 31, 13, 12, 0, 0, }, /* 349 */
- { 31, 15, 12, 0, 0, }, /* 350 */
- { 37, 21, 12, 0, 0, }, /* 351 */
- { 37, 17, 12, 0, 0, }, /* 352 */
- { 37, 12, 3, 0, 0, }, /* 353 */
- { 37, 1, 2, 0, 0, }, /* 354 */
- { 37, 13, 12, 0, 0, }, /* 355 */
- { 37, 7, 12, 0, 0, }, /* 356 */
- { 37, 6, 12, 0, 0, }, /* 357 */
- { 34, 7, 12, 0, 0, }, /* 358 */
- { 34, 12, 3, 0, 0, }, /* 359 */
- { 34, 10, 5, 0, 0, }, /* 360 */
- { 34, 26, 12, 0, 0, }, /* 361 */
- { 34, 21, 12, 0, 0, }, /* 362 */
- { 34, 13, 12, 0, 0, }, /* 363 */
- { 52, 7, 12, 0, 0, }, /* 364 */
- { 39, 7, 12, 0, 0, }, /* 365 */
- { 39, 13, 12, 0, 0, }, /* 366 */
- { 39, 15, 12, 0, 0, }, /* 367 */
- { 39, 26, 12, 0, 0, }, /* 368 */
- { 31, 26, 12, 0, 0, }, /* 369 */
- { 5, 7, 12, 0, 0, }, /* 370 */
- { 5, 12, 3, 0, 0, }, /* 371 */
- { 5, 10, 5, 0, 0, }, /* 372 */
- { 5, 21, 12, 0, 0, }, /* 373 */
- { 90, 7, 12, 0, 0, }, /* 374 */
- { 90, 10, 5, 0, 0, }, /* 375 */
- { 90, 12, 3, 0, 0, }, /* 376 */
- { 90, 10, 12, 0, 0, }, /* 377 */
- { 90, 13, 12, 0, 0, }, /* 378 */
- { 90, 21, 12, 0, 0, }, /* 379 */
- { 90, 6, 12, 0, 0, }, /* 380 */
- { 27, 11, 3, 0, 0, }, /* 381 */
- { 61, 12, 3, 0, 0, }, /* 382 */
- { 61, 10, 5, 0, 0, }, /* 383 */
- { 61, 7, 12, 0, 0, }, /* 384 */
- { 61, 13, 12, 0, 0, }, /* 385 */
- { 61, 21, 12, 0, 0, }, /* 386 */
- { 61, 26, 12, 0, 0, }, /* 387 */
- { 75, 12, 3, 0, 0, }, /* 388 */
- { 75, 10, 5, 0, 0, }, /* 389 */
- { 75, 7, 12, 0, 0, }, /* 390 */
- { 75, 13, 12, 0, 0, }, /* 391 */
- { 92, 7, 12, 0, 0, }, /* 392 */
- { 92, 12, 3, 0, 0, }, /* 393 */
- { 92, 10, 5, 0, 0, }, /* 394 */
- { 92, 21, 12, 0, 0, }, /* 395 */
- { 69, 7, 12, 0, 0, }, /* 396 */
- { 69, 10, 5, 0, 0, }, /* 397 */
- { 69, 12, 3, 0, 0, }, /* 398 */
- { 69, 21, 12, 0, 0, }, /* 399 */
- { 69, 13, 12, 0, 0, }, /* 400 */
- { 72, 13, 12, 0, 0, }, /* 401 */
- { 72, 7, 12, 0, 0, }, /* 402 */
- { 72, 6, 12, 0, 0, }, /* 403 */
- { 72, 21, 12, 0, 0, }, /* 404 */
- { 75, 21, 12, 0, 0, }, /* 405 */
- { 9, 10, 5, 0, 0, }, /* 406 */
- { 9, 7, 12, 0, 0, }, /* 407 */
- { 12, 5, 12, 0, 0, }, /* 408 */
- { 12, 6, 12, 0, 0, }, /* 409 */
- { 33, 5, 12, 0, 35332, }, /* 410 */
- { 33, 5, 12, 0, 3814, }, /* 411 */
- { 33, 9, 12, 63, 1, }, /* 412 */
- { 33, 5, 12, 63, -1, }, /* 413 */
- { 33, 5, 12, 63, -58, }, /* 414 */
- { 33, 9, 12, 0, -7615, }, /* 415 */
- { 19, 5, 12, 0, 8, }, /* 416 */
- { 19, 9, 12, 0, -8, }, /* 417 */
- { 19, 5, 12, 0, 74, }, /* 418 */
- { 19, 5, 12, 0, 86, }, /* 419 */
- { 19, 5, 12, 0, 100, }, /* 420 */
- { 19, 5, 12, 0, 128, }, /* 421 */
- { 19, 5, 12, 0, 112, }, /* 422 */
- { 19, 5, 12, 0, 126, }, /* 423 */
- { 19, 8, 12, 0, -8, }, /* 424 */
- { 19, 5, 12, 0, 9, }, /* 425 */
- { 19, 9, 12, 0, -74, }, /* 426 */
- { 19, 8, 12, 0, -9, }, /* 427 */
- { 19, 5, 12, 21, -7173, }, /* 428 */
- { 19, 9, 12, 0, -86, }, /* 429 */
- { 19, 9, 12, 0, -100, }, /* 430 */
- { 19, 9, 12, 0, -112, }, /* 431 */
- { 19, 9, 12, 0, -128, }, /* 432 */
- { 19, 9, 12, 0, -126, }, /* 433 */
- { 27, 1, 3, 0, 0, }, /* 434 */
- { 9, 27, 2, 0, 0, }, /* 435 */
- { 9, 28, 2, 0, 0, }, /* 436 */
- { 9, 2, 2, 0, 0, }, /* 437 */
- { 9, 9, 12, 0, 0, }, /* 438 */
- { 9, 5, 12, 0, 0, }, /* 439 */
- { 19, 9, 12, 67, -7517, }, /* 440 */
- { 33, 9, 12, 71, -8383, }, /* 441 */
- { 33, 9, 12, 75, -8262, }, /* 442 */
- { 33, 9, 12, 0, 28, }, /* 443 */
- { 33, 5, 12, 0, -28, }, /* 444 */
- { 33, 14, 12, 0, 16, }, /* 445 */
- { 33, 14, 12, 0, -16, }, /* 446 */
- { 33, 14, 12, 0, 0, }, /* 447 */
- { 9, 26, 12, 0, 26, }, /* 448 */
- { 9, 26, 12, 0, -26, }, /* 449 */
- { 4, 26, 12, 0, 0, }, /* 450 */
- { 17, 9, 12, 0, 48, }, /* 451 */
- { 17, 5, 12, 0, -48, }, /* 452 */
- { 33, 9, 12, 0, -10743, }, /* 453 */
- { 33, 9, 12, 0, -3814, }, /* 454 */
- { 33, 9, 12, 0, -10727, }, /* 455 */
- { 33, 5, 12, 0, -10795, }, /* 456 */
- { 33, 5, 12, 0, -10792, }, /* 457 */
- { 33, 9, 12, 0, -10780, }, /* 458 */
- { 33, 9, 12, 0, -10749, }, /* 459 */
- { 33, 9, 12, 0, -10783, }, /* 460 */
- { 33, 9, 12, 0, -10782, }, /* 461 */
- { 33, 9, 12, 0, -10815, }, /* 462 */
- { 10, 5, 12, 0, 0, }, /* 463 */
- { 10, 26, 12, 0, 0, }, /* 464 */
- { 10, 12, 3, 0, 0, }, /* 465 */
- { 10, 21, 12, 0, 0, }, /* 466 */
- { 10, 15, 12, 0, 0, }, /* 467 */
- { 16, 5, 12, 0, -7264, }, /* 468 */
- { 58, 7, 12, 0, 0, }, /* 469 */
- { 58, 6, 12, 0, 0, }, /* 470 */
- { 58, 21, 12, 0, 0, }, /* 471 */
- { 58, 12, 3, 0, 0, }, /* 472 */
- { 22, 26, 12, 0, 0, }, /* 473 */
- { 22, 6, 12, 0, 0, }, /* 474 */
- { 22, 14, 12, 0, 0, }, /* 475 */
- { 23, 10, 3, 0, 0, }, /* 476 */
- { 26, 7, 12, 0, 0, }, /* 477 */
- { 26, 6, 12, 0, 0, }, /* 478 */
- { 29, 7, 12, 0, 0, }, /* 479 */
- { 29, 6, 12, 0, 0, }, /* 480 */
- { 3, 7, 12, 0, 0, }, /* 481 */
- { 23, 7, 12, 0, 0, }, /* 482 */
- { 23, 26, 12, 0, 0, }, /* 483 */
- { 29, 26, 12, 0, 0, }, /* 484 */
- { 22, 7, 12, 0, 0, }, /* 485 */
- { 60, 7, 12, 0, 0, }, /* 486 */
- { 60, 6, 12, 0, 0, }, /* 487 */
- { 60, 26, 12, 0, 0, }, /* 488 */
- { 85, 7, 12, 0, 0, }, /* 489 */
- { 85, 6, 12, 0, 0, }, /* 490 */
- { 85, 21, 12, 0, 0, }, /* 491 */
- { 76, 7, 12, 0, 0, }, /* 492 */
- { 76, 6, 12, 0, 0, }, /* 493 */
- { 76, 21, 12, 0, 0, }, /* 494 */
- { 76, 13, 12, 0, 0, }, /* 495 */
- { 12, 7, 12, 0, 0, }, /* 496 */
- { 12, 21, 12, 0, 0, }, /* 497 */
- { 78, 7, 12, 0, 0, }, /* 498 */
- { 78, 14, 12, 0, 0, }, /* 499 */
- { 78, 12, 3, 0, 0, }, /* 500 */
- { 78, 21, 12, 0, 0, }, /* 501 */
- { 33, 9, 12, 0, -35332, }, /* 502 */
- { 33, 9, 12, 0, -42280, }, /* 503 */
- { 33, 9, 12, 0, -42308, }, /* 504 */
- { 33, 9, 12, 0, -42319, }, /* 505 */
- { 33, 9, 12, 0, -42315, }, /* 506 */
- { 33, 9, 12, 0, -42305, }, /* 507 */
- { 33, 9, 12, 0, -42258, }, /* 508 */
- { 33, 9, 12, 0, -42282, }, /* 509 */
- { 33, 9, 12, 0, -42261, }, /* 510 */
- { 33, 9, 12, 0, 928, }, /* 511 */
- { 48, 7, 12, 0, 0, }, /* 512 */
- { 48, 12, 3, 0, 0, }, /* 513 */
- { 48, 10, 5, 0, 0, }, /* 514 */
- { 48, 26, 12, 0, 0, }, /* 515 */
- { 64, 7, 12, 0, 0, }, /* 516 */
- { 64, 21, 12, 0, 0, }, /* 517 */
- { 74, 10, 5, 0, 0, }, /* 518 */
- { 74, 7, 12, 0, 0, }, /* 519 */
- { 74, 12, 3, 0, 0, }, /* 520 */
- { 74, 21, 12, 0, 0, }, /* 521 */
- { 74, 13, 12, 0, 0, }, /* 522 */
- { 68, 13, 12, 0, 0, }, /* 523 */
- { 68, 7, 12, 0, 0, }, /* 524 */
- { 68, 12, 3, 0, 0, }, /* 525 */
- { 68, 21, 12, 0, 0, }, /* 526 */
- { 73, 7, 12, 0, 0, }, /* 527 */
- { 73, 12, 3, 0, 0, }, /* 528 */
- { 73, 10, 5, 0, 0, }, /* 529 */
- { 73, 21, 12, 0, 0, }, /* 530 */
- { 83, 12, 3, 0, 0, }, /* 531 */
- { 83, 10, 5, 0, 0, }, /* 532 */
- { 83, 7, 12, 0, 0, }, /* 533 */
- { 83, 21, 12, 0, 0, }, /* 534 */
- { 83, 13, 12, 0, 0, }, /* 535 */
- { 38, 6, 12, 0, 0, }, /* 536 */
- { 67, 7, 12, 0, 0, }, /* 537 */
- { 67, 12, 3, 0, 0, }, /* 538 */
- { 67, 10, 5, 0, 0, }, /* 539 */
- { 67, 13, 12, 0, 0, }, /* 540 */
- { 67, 21, 12, 0, 0, }, /* 541 */
- { 91, 7, 12, 0, 0, }, /* 542 */
- { 91, 12, 3, 0, 0, }, /* 543 */
- { 91, 6, 12, 0, 0, }, /* 544 */
- { 91, 21, 12, 0, 0, }, /* 545 */
- { 86, 7, 12, 0, 0, }, /* 546 */
- { 86, 10, 5, 0, 0, }, /* 547 */
- { 86, 12, 3, 0, 0, }, /* 548 */
- { 86, 21, 12, 0, 0, }, /* 549 */
- { 86, 6, 12, 0, 0, }, /* 550 */
- { 33, 5, 12, 0, -928, }, /* 551 */
- { 8, 5, 12, 0, -38864, }, /* 552 */
- { 86, 13, 12, 0, 0, }, /* 553 */
- { 23, 7, 9, 0, 0, }, /* 554 */
- { 23, 7, 10, 0, 0, }, /* 555 */
- { 9, 4, 2, 0, 0, }, /* 556 */
- { 9, 3, 12, 0, 0, }, /* 557 */
- { 25, 25, 12, 0, 0, }, /* 558 */
- { 0, 24, 12, 0, 0, }, /* 559 */
- { 9, 6, 3, 0, 0, }, /* 560 */
- { 35, 7, 12, 0, 0, }, /* 561 */
- { 19, 14, 12, 0, 0, }, /* 562 */
- { 19, 15, 12, 0, 0, }, /* 563 */
- { 19, 26, 12, 0, 0, }, /* 564 */
- { 70, 7, 12, 0, 0, }, /* 565 */
- { 66, 7, 12, 0, 0, }, /* 566 */
- { 41, 7, 12, 0, 0, }, /* 567 */
- { 41, 15, 12, 0, 0, }, /* 568 */
- { 18, 7, 12, 0, 0, }, /* 569 */
- { 18, 14, 12, 0, 0, }, /* 570 */
- { 117, 7, 12, 0, 0, }, /* 571 */
- { 117, 12, 3, 0, 0, }, /* 572 */
- { 59, 7, 12, 0, 0, }, /* 573 */
- { 59, 21, 12, 0, 0, }, /* 574 */
- { 42, 7, 12, 0, 0, }, /* 575 */
- { 42, 21, 12, 0, 0, }, /* 576 */
- { 42, 14, 12, 0, 0, }, /* 577 */
- { 13, 9, 12, 0, 40, }, /* 578 */
- { 13, 5, 12, 0, -40, }, /* 579 */
- { 46, 7, 12, 0, 0, }, /* 580 */
- { 44, 7, 12, 0, 0, }, /* 581 */
- { 44, 13, 12, 0, 0, }, /* 582 */
- { 105, 7, 12, 0, 0, }, /* 583 */
- { 103, 7, 12, 0, 0, }, /* 584 */
- { 103, 21, 12, 0, 0, }, /* 585 */
- { 109, 7, 12, 0, 0, }, /* 586 */
- { 11, 7, 12, 0, 0, }, /* 587 */
- { 80, 7, 12, 0, 0, }, /* 588 */
- { 80, 21, 12, 0, 0, }, /* 589 */
- { 80, 15, 12, 0, 0, }, /* 590 */
- { 119, 7, 12, 0, 0, }, /* 591 */
- { 119, 26, 12, 0, 0, }, /* 592 */
- { 119, 15, 12, 0, 0, }, /* 593 */
- { 115, 7, 12, 0, 0, }, /* 594 */
- { 115, 15, 12, 0, 0, }, /* 595 */
- { 127, 7, 12, 0, 0, }, /* 596 */
- { 127, 15, 12, 0, 0, }, /* 597 */
- { 65, 7, 12, 0, 0, }, /* 598 */
- { 65, 15, 12, 0, 0, }, /* 599 */
- { 65, 21, 12, 0, 0, }, /* 600 */
- { 71, 7, 12, 0, 0, }, /* 601 */
- { 71, 21, 12, 0, 0, }, /* 602 */
- { 97, 7, 12, 0, 0, }, /* 603 */
- { 96, 7, 12, 0, 0, }, /* 604 */
- { 96, 15, 12, 0, 0, }, /* 605 */
- { 30, 7, 12, 0, 0, }, /* 606 */
- { 30, 12, 3, 0, 0, }, /* 607 */
- { 30, 15, 12, 0, 0, }, /* 608 */
- { 30, 21, 12, 0, 0, }, /* 609 */
- { 87, 7, 12, 0, 0, }, /* 610 */
- { 87, 15, 12, 0, 0, }, /* 611 */
- { 87, 21, 12, 0, 0, }, /* 612 */
- { 116, 7, 12, 0, 0, }, /* 613 */
- { 116, 15, 12, 0, 0, }, /* 614 */
- { 111, 7, 12, 0, 0, }, /* 615 */
- { 111, 26, 12, 0, 0, }, /* 616 */
- { 111, 12, 3, 0, 0, }, /* 617 */
- { 111, 15, 12, 0, 0, }, /* 618 */
- { 111, 21, 12, 0, 0, }, /* 619 */
- { 77, 7, 12, 0, 0, }, /* 620 */
- { 77, 21, 12, 0, 0, }, /* 621 */
- { 82, 7, 12, 0, 0, }, /* 622 */
- { 82, 15, 12, 0, 0, }, /* 623 */
- { 81, 7, 12, 0, 0, }, /* 624 */
- { 81, 15, 12, 0, 0, }, /* 625 */
- { 120, 7, 12, 0, 0, }, /* 626 */
- { 120, 21, 12, 0, 0, }, /* 627 */
- { 120, 15, 12, 0, 0, }, /* 628 */
- { 88, 7, 12, 0, 0, }, /* 629 */
- { 129, 9, 12, 0, 64, }, /* 630 */
- { 129, 5, 12, 0, -64, }, /* 631 */
- { 129, 15, 12, 0, 0, }, /* 632 */
- { 0, 15, 12, 0, 0, }, /* 633 */
- { 93, 10, 5, 0, 0, }, /* 634 */
- { 93, 12, 3, 0, 0, }, /* 635 */
- { 93, 7, 12, 0, 0, }, /* 636 */
- { 93, 21, 12, 0, 0, }, /* 637 */
- { 93, 15, 12, 0, 0, }, /* 638 */
- { 93, 13, 12, 0, 0, }, /* 639 */
- { 84, 12, 3, 0, 0, }, /* 640 */
- { 84, 10, 5, 0, 0, }, /* 641 */
- { 84, 7, 12, 0, 0, }, /* 642 */
- { 84, 21, 12, 0, 0, }, /* 643 */
- { 84, 1, 2, 0, 0, }, /* 644 */
- { 100, 7, 12, 0, 0, }, /* 645 */
- { 100, 13, 12, 0, 0, }, /* 646 */
- { 95, 12, 3, 0, 0, }, /* 647 */
- { 95, 7, 12, 0, 0, }, /* 648 */
- { 95, 10, 5, 0, 0, }, /* 649 */
- { 95, 13, 12, 0, 0, }, /* 650 */
- { 95, 21, 12, 0, 0, }, /* 651 */
- { 110, 7, 12, 0, 0, }, /* 652 */
- { 110, 12, 3, 0, 0, }, /* 653 */
- { 110, 21, 12, 0, 0, }, /* 654 */
- { 99, 12, 3, 0, 0, }, /* 655 */
- { 99, 10, 5, 0, 0, }, /* 656 */
- { 99, 7, 12, 0, 0, }, /* 657 */
- { 99, 21, 12, 0, 0, }, /* 658 */
- { 99, 13, 12, 0, 0, }, /* 659 */
- { 47, 15, 12, 0, 0, }, /* 660 */
- { 107, 7, 12, 0, 0, }, /* 661 */
- { 107, 10, 5, 0, 0, }, /* 662 */
- { 107, 12, 3, 0, 0, }, /* 663 */
- { 107, 21, 12, 0, 0, }, /* 664 */
- { 128, 7, 12, 0, 0, }, /* 665 */
- { 128, 21, 12, 0, 0, }, /* 666 */
- { 108, 7, 12, 0, 0, }, /* 667 */
- { 108, 12, 3, 0, 0, }, /* 668 */
- { 108, 10, 5, 0, 0, }, /* 669 */
- { 108, 13, 12, 0, 0, }, /* 670 */
- { 106, 12, 3, 0, 0, }, /* 671 */
- { 106, 10, 5, 0, 0, }, /* 672 */
- { 106, 7, 12, 0, 0, }, /* 673 */
- { 106, 10, 3, 0, 0, }, /* 674 */
- { 123, 7, 12, 0, 0, }, /* 675 */
- { 123, 10, 3, 0, 0, }, /* 676 */
- { 123, 10, 5, 0, 0, }, /* 677 */
- { 123, 12, 3, 0, 0, }, /* 678 */
- { 123, 21, 12, 0, 0, }, /* 679 */
- { 123, 13, 12, 0, 0, }, /* 680 */
- { 122, 7, 12, 0, 0, }, /* 681 */
- { 122, 10, 3, 0, 0, }, /* 682 */
- { 122, 10, 5, 0, 0, }, /* 683 */
- { 122, 12, 3, 0, 0, }, /* 684 */
- { 122, 21, 12, 0, 0, }, /* 685 */
- { 113, 7, 12, 0, 0, }, /* 686 */
- { 113, 10, 5, 0, 0, }, /* 687 */
- { 113, 12, 3, 0, 0, }, /* 688 */
- { 113, 21, 12, 0, 0, }, /* 689 */
- { 113, 13, 12, 0, 0, }, /* 690 */
- { 101, 7, 12, 0, 0, }, /* 691 */
- { 101, 12, 3, 0, 0, }, /* 692 */
- { 101, 10, 5, 0, 0, }, /* 693 */
- { 101, 13, 12, 0, 0, }, /* 694 */
- { 125, 7, 12, 0, 0, }, /* 695 */
- { 125, 12, 3, 0, 0, }, /* 696 */
- { 125, 10, 5, 0, 0, }, /* 697 */
- { 125, 13, 12, 0, 0, }, /* 698 */
- { 125, 15, 12, 0, 0, }, /* 699 */
- { 125, 21, 12, 0, 0, }, /* 700 */
- { 125, 26, 12, 0, 0, }, /* 701 */
- { 124, 9, 12, 0, 32, }, /* 702 */
- { 124, 5, 12, 0, -32, }, /* 703 */
- { 124, 13, 12, 0, 0, }, /* 704 */
- { 124, 15, 12, 0, 0, }, /* 705 */
- { 124, 7, 12, 0, 0, }, /* 706 */
- { 121, 7, 12, 0, 0, }, /* 707 */
- { 62, 7, 12, 0, 0, }, /* 708 */
- { 62, 14, 12, 0, 0, }, /* 709 */
- { 62, 21, 12, 0, 0, }, /* 710 */
- { 79, 7, 12, 0, 0, }, /* 711 */
- { 126, 7, 12, 0, 0, }, /* 712 */
- { 114, 7, 12, 0, 0, }, /* 713 */
- { 114, 13, 12, 0, 0, }, /* 714 */
- { 114, 21, 12, 0, 0, }, /* 715 */
- { 102, 7, 12, 0, 0, }, /* 716 */
- { 102, 12, 3, 0, 0, }, /* 717 */
- { 102, 21, 12, 0, 0, }, /* 718 */
- { 118, 7, 12, 0, 0, }, /* 719 */
- { 118, 12, 3, 0, 0, }, /* 720 */
- { 118, 21, 12, 0, 0, }, /* 721 */
- { 118, 26, 12, 0, 0, }, /* 722 */
- { 118, 6, 12, 0, 0, }, /* 723 */
- { 118, 13, 12, 0, 0, }, /* 724 */
- { 118, 15, 12, 0, 0, }, /* 725 */
- { 98, 7, 12, 0, 0, }, /* 726 */
- { 98, 10, 5, 0, 0, }, /* 727 */
- { 98, 12, 3, 0, 0, }, /* 728 */
- { 98, 6, 12, 0, 0, }, /* 729 */
- { 104, 7, 12, 0, 0, }, /* 730 */
- { 104, 26, 12, 0, 0, }, /* 731 */
- { 104, 12, 3, 0, 0, }, /* 732 */
- { 104, 21, 12, 0, 0, }, /* 733 */
- { 9, 10, 3, 0, 0, }, /* 734 */
- { 19, 12, 3, 0, 0, }, /* 735 */
- { 130, 26, 12, 0, 0, }, /* 736 */
- { 130, 12, 3, 0, 0, }, /* 737 */
- { 130, 21, 12, 0, 0, }, /* 738 */
- { 112, 7, 12, 0, 0, }, /* 739 */
- { 112, 15, 12, 0, 0, }, /* 740 */
- { 112, 12, 3, 0, 0, }, /* 741 */
- { 9, 26, 11, 0, 0, }, /* 742 */
- { 26, 26, 12, 0, 0, }, /* 743 */
+ { 12, 9, 12, 63, 32, }, /* 173 */
+ { 12, 9, 12, 67, 32, }, /* 174 */
+ { 12, 9, 12, 71, 32, }, /* 175 */
+ { 12, 9, 12, 75, 32, }, /* 176 */
+ { 12, 9, 12, 79, 32, }, /* 177 */
+ { 12, 9, 12, 84, 32, }, /* 178 */
+ { 12, 5, 12, 0, -32, }, /* 179 */
+ { 12, 5, 12, 63, -32, }, /* 180 */
+ { 12, 5, 12, 67, -32, }, /* 181 */
+ { 12, 5, 12, 71, -32, }, /* 182 */
+ { 12, 5, 12, 75, -32, }, /* 183 */
+ { 12, 5, 12, 79, -32, }, /* 184 */
+ { 12, 5, 12, 84, -32, }, /* 185 */
+ { 12, 5, 12, 0, -80, }, /* 186 */
+ { 12, 9, 12, 0, 1, }, /* 187 */
+ { 12, 5, 12, 0, -1, }, /* 188 */
+ { 12, 9, 12, 88, 1, }, /* 189 */
+ { 12, 5, 12, 88, -1, }, /* 190 */
+ { 12, 26, 12, 0, 0, }, /* 191 */
+ { 12, 12, 3, 0, 0, }, /* 192 */
+ { 12, 11, 3, 0, 0, }, /* 193 */
+ { 12, 9, 12, 0, 15, }, /* 194 */
+ { 12, 5, 12, 0, -15, }, /* 195 */
+ { 1, 9, 12, 0, 48, }, /* 196 */
+ { 1, 6, 12, 0, 0, }, /* 197 */
+ { 1, 21, 12, 0, 0, }, /* 198 */
+ { 1, 5, 12, 0, -48, }, /* 199 */
+ { 1, 5, 12, 0, 0, }, /* 200 */
+ { 1, 17, 12, 0, 0, }, /* 201 */
+ { 1, 26, 12, 0, 0, }, /* 202 */
+ { 1, 23, 12, 0, 0, }, /* 203 */
+ { 25, 12, 3, 0, 0, }, /* 204 */
+ { 25, 17, 12, 0, 0, }, /* 205 */
+ { 25, 21, 12, 0, 0, }, /* 206 */
+ { 25, 7, 12, 0, 0, }, /* 207 */
+ { 0, 1, 4, 0, 0, }, /* 208 */
+ { 9, 1, 4, 0, 0, }, /* 209 */
+ { 0, 25, 12, 0, 0, }, /* 210 */
+ { 0, 21, 12, 0, 0, }, /* 211 */
+ { 0, 23, 12, 0, 0, }, /* 212 */
+ { 0, 26, 12, 0, 0, }, /* 213 */
+ { 0, 12, 3, 0, 0, }, /* 214 */
+ { 0, 1, 2, 0, 0, }, /* 215 */
+ { 0, 7, 12, 0, 0, }, /* 216 */
+ { 0, 13, 12, 0, 0, }, /* 217 */
+ { 0, 6, 12, 0, 0, }, /* 218 */
+ { 49, 21, 12, 0, 0, }, /* 219 */
+ { 49, 1, 4, 0, 0, }, /* 220 */
+ { 49, 7, 12, 0, 0, }, /* 221 */
+ { 49, 12, 3, 0, 0, }, /* 222 */
+ { 55, 7, 12, 0, 0, }, /* 223 */
+ { 55, 12, 3, 0, 0, }, /* 224 */
+ { 63, 13, 12, 0, 0, }, /* 225 */
+ { 63, 7, 12, 0, 0, }, /* 226 */
+ { 63, 12, 3, 0, 0, }, /* 227 */
+ { 63, 6, 12, 0, 0, }, /* 228 */
+ { 63, 26, 12, 0, 0, }, /* 229 */
+ { 63, 21, 12, 0, 0, }, /* 230 */
+ { 89, 7, 12, 0, 0, }, /* 231 */
+ { 89, 12, 3, 0, 0, }, /* 232 */
+ { 89, 6, 12, 0, 0, }, /* 233 */
+ { 89, 21, 12, 0, 0, }, /* 234 */
+ { 94, 7, 12, 0, 0, }, /* 235 */
+ { 94, 12, 3, 0, 0, }, /* 236 */
+ { 94, 21, 12, 0, 0, }, /* 237 */
+ { 14, 12, 3, 0, 0, }, /* 238 */
+ { 14, 10, 5, 0, 0, }, /* 239 */
+ { 14, 7, 12, 0, 0, }, /* 240 */
+ { 14, 13, 12, 0, 0, }, /* 241 */
+ { 14, 21, 12, 0, 0, }, /* 242 */
+ { 14, 6, 12, 0, 0, }, /* 243 */
+ { 2, 7, 12, 0, 0, }, /* 244 */
+ { 2, 12, 3, 0, 0, }, /* 245 */
+ { 2, 10, 5, 0, 0, }, /* 246 */
+ { 2, 10, 3, 0, 0, }, /* 247 */
+ { 2, 13, 12, 0, 0, }, /* 248 */
+ { 2, 23, 12, 0, 0, }, /* 249 */
+ { 2, 15, 12, 0, 0, }, /* 250 */
+ { 2, 26, 12, 0, 0, }, /* 251 */
+ { 2, 21, 12, 0, 0, }, /* 252 */
+ { 21, 12, 3, 0, 0, }, /* 253 */
+ { 21, 10, 5, 0, 0, }, /* 254 */
+ { 21, 7, 12, 0, 0, }, /* 255 */
+ { 21, 13, 12, 0, 0, }, /* 256 */
+ { 20, 12, 3, 0, 0, }, /* 257 */
+ { 20, 10, 5, 0, 0, }, /* 258 */
+ { 20, 7, 12, 0, 0, }, /* 259 */
+ { 20, 13, 12, 0, 0, }, /* 260 */
+ { 20, 21, 12, 0, 0, }, /* 261 */
+ { 20, 23, 12, 0, 0, }, /* 262 */
+ { 43, 12, 3, 0, 0, }, /* 263 */
+ { 43, 10, 5, 0, 0, }, /* 264 */
+ { 43, 7, 12, 0, 0, }, /* 265 */
+ { 43, 10, 3, 0, 0, }, /* 266 */
+ { 43, 13, 12, 0, 0, }, /* 267 */
+ { 43, 26, 12, 0, 0, }, /* 268 */
+ { 43, 15, 12, 0, 0, }, /* 269 */
+ { 53, 12, 3, 0, 0, }, /* 270 */
+ { 53, 7, 12, 0, 0, }, /* 271 */
+ { 53, 10, 3, 0, 0, }, /* 272 */
+ { 53, 10, 5, 0, 0, }, /* 273 */
+ { 53, 13, 12, 0, 0, }, /* 274 */
+ { 53, 15, 12, 0, 0, }, /* 275 */
+ { 53, 26, 12, 0, 0, }, /* 276 */
+ { 53, 23, 12, 0, 0, }, /* 277 */
+ { 54, 12, 3, 0, 0, }, /* 278 */
+ { 54, 10, 5, 0, 0, }, /* 279 */
+ { 54, 7, 12, 0, 0, }, /* 280 */
+ { 54, 13, 12, 0, 0, }, /* 281 */
+ { 54, 15, 12, 0, 0, }, /* 282 */
+ { 54, 26, 12, 0, 0, }, /* 283 */
+ { 28, 7, 12, 0, 0, }, /* 284 */
+ { 28, 12, 3, 0, 0, }, /* 285 */
+ { 28, 10, 5, 0, 0, }, /* 286 */
+ { 28, 10, 3, 0, 0, }, /* 287 */
+ { 28, 13, 12, 0, 0, }, /* 288 */
+ { 36, 12, 3, 0, 0, }, /* 289 */
+ { 36, 10, 5, 0, 0, }, /* 290 */
+ { 36, 7, 12, 0, 0, }, /* 291 */
+ { 36, 10, 3, 0, 0, }, /* 292 */
+ { 36, 7, 4, 0, 0, }, /* 293 */
+ { 36, 26, 12, 0, 0, }, /* 294 */
+ { 36, 15, 12, 0, 0, }, /* 295 */
+ { 36, 13, 12, 0, 0, }, /* 296 */
+ { 47, 10, 5, 0, 0, }, /* 297 */
+ { 47, 7, 12, 0, 0, }, /* 298 */
+ { 47, 12, 3, 0, 0, }, /* 299 */
+ { 47, 10, 3, 0, 0, }, /* 300 */
+ { 47, 13, 12, 0, 0, }, /* 301 */
+ { 47, 21, 12, 0, 0, }, /* 302 */
+ { 56, 7, 12, 0, 0, }, /* 303 */
+ { 56, 12, 3, 0, 0, }, /* 304 */
+ { 56, 7, 5, 0, 0, }, /* 305 */
+ { 56, 6, 12, 0, 0, }, /* 306 */
+ { 56, 21, 12, 0, 0, }, /* 307 */
+ { 56, 13, 12, 0, 0, }, /* 308 */
+ { 32, 7, 12, 0, 0, }, /* 309 */
+ { 32, 12, 3, 0, 0, }, /* 310 */
+ { 32, 7, 5, 0, 0, }, /* 311 */
+ { 32, 6, 12, 0, 0, }, /* 312 */
+ { 32, 13, 12, 0, 0, }, /* 313 */
+ { 57, 7, 12, 0, 0, }, /* 314 */
+ { 57, 26, 12, 0, 0, }, /* 315 */
+ { 57, 21, 12, 0, 0, }, /* 316 */
+ { 57, 12, 3, 0, 0, }, /* 317 */
+ { 57, 13, 12, 0, 0, }, /* 318 */
+ { 57, 15, 12, 0, 0, }, /* 319 */
+ { 57, 22, 12, 0, 0, }, /* 320 */
+ { 57, 18, 12, 0, 0, }, /* 321 */
+ { 57, 10, 5, 0, 0, }, /* 322 */
+ { 38, 7, 12, 0, 0, }, /* 323 */
+ { 38, 10, 12, 0, 0, }, /* 324 */
+ { 38, 12, 3, 0, 0, }, /* 325 */
+ { 38, 10, 5, 0, 0, }, /* 326 */
+ { 38, 13, 12, 0, 0, }, /* 327 */
+ { 38, 21, 12, 0, 0, }, /* 328 */
+ { 38, 26, 12, 0, 0, }, /* 329 */
+ { 16, 9, 12, 0, 7264, }, /* 330 */
+ { 16, 7, 12, 0, 0, }, /* 331 */
+ { 16, 6, 12, 0, 0, }, /* 332 */
+ { 23, 7, 6, 0, 0, }, /* 333 */
+ { 23, 7, 7, 0, 0, }, /* 334 */
+ { 23, 7, 8, 0, 0, }, /* 335 */
+ { 15, 7, 12, 0, 0, }, /* 336 */
+ { 15, 12, 3, 0, 0, }, /* 337 */
+ { 15, 21, 12, 0, 0, }, /* 338 */
+ { 15, 15, 12, 0, 0, }, /* 339 */
+ { 15, 26, 12, 0, 0, }, /* 340 */
+ { 8, 9, 12, 0, 38864, }, /* 341 */
+ { 8, 9, 12, 0, 8, }, /* 342 */
+ { 8, 5, 12, 0, -8, }, /* 343 */
+ { 7, 17, 12, 0, 0, }, /* 344 */
+ { 7, 7, 12, 0, 0, }, /* 345 */
+ { 7, 21, 12, 0, 0, }, /* 346 */
+ { 40, 29, 12, 0, 0, }, /* 347 */
+ { 40, 7, 12, 0, 0, }, /* 348 */
+ { 40, 22, 12, 0, 0, }, /* 349 */
+ { 40, 18, 12, 0, 0, }, /* 350 */
+ { 45, 7, 12, 0, 0, }, /* 351 */
+ { 45, 14, 12, 0, 0, }, /* 352 */
+ { 50, 7, 12, 0, 0, }, /* 353 */
+ { 50, 12, 3, 0, 0, }, /* 354 */
+ { 24, 7, 12, 0, 0, }, /* 355 */
+ { 24, 12, 3, 0, 0, }, /* 356 */
+ { 6, 7, 12, 0, 0, }, /* 357 */
+ { 6, 12, 3, 0, 0, }, /* 358 */
+ { 51, 7, 12, 0, 0, }, /* 359 */
+ { 51, 12, 3, 0, 0, }, /* 360 */
+ { 31, 7, 12, 0, 0, }, /* 361 */
+ { 31, 12, 3, 0, 0, }, /* 362 */
+ { 31, 10, 5, 0, 0, }, /* 363 */
+ { 31, 21, 12, 0, 0, }, /* 364 */
+ { 31, 6, 12, 0, 0, }, /* 365 */
+ { 31, 23, 12, 0, 0, }, /* 366 */
+ { 31, 13, 12, 0, 0, }, /* 367 */
+ { 31, 15, 12, 0, 0, }, /* 368 */
+ { 37, 21, 12, 0, 0, }, /* 369 */
+ { 37, 17, 12, 0, 0, }, /* 370 */
+ { 37, 12, 3, 0, 0, }, /* 371 */
+ { 37, 1, 2, 0, 0, }, /* 372 */
+ { 37, 13, 12, 0, 0, }, /* 373 */
+ { 37, 7, 12, 0, 0, }, /* 374 */
+ { 37, 6, 12, 0, 0, }, /* 375 */
+ { 34, 7, 12, 0, 0, }, /* 376 */
+ { 34, 12, 3, 0, 0, }, /* 377 */
+ { 34, 10, 5, 0, 0, }, /* 378 */
+ { 34, 26, 12, 0, 0, }, /* 379 */
+ { 34, 21, 12, 0, 0, }, /* 380 */
+ { 34, 13, 12, 0, 0, }, /* 381 */
+ { 52, 7, 12, 0, 0, }, /* 382 */
+ { 39, 7, 12, 0, 0, }, /* 383 */
+ { 39, 13, 12, 0, 0, }, /* 384 */
+ { 39, 15, 12, 0, 0, }, /* 385 */
+ { 39, 26, 12, 0, 0, }, /* 386 */
+ { 31, 26, 12, 0, 0, }, /* 387 */
+ { 5, 7, 12, 0, 0, }, /* 388 */
+ { 5, 12, 3, 0, 0, }, /* 389 */
+ { 5, 10, 5, 0, 0, }, /* 390 */
+ { 5, 21, 12, 0, 0, }, /* 391 */
+ { 90, 7, 12, 0, 0, }, /* 392 */
+ { 90, 10, 5, 0, 0, }, /* 393 */
+ { 90, 12, 3, 0, 0, }, /* 394 */
+ { 90, 10, 12, 0, 0, }, /* 395 */
+ { 90, 13, 12, 0, 0, }, /* 396 */
+ { 90, 21, 12, 0, 0, }, /* 397 */
+ { 90, 6, 12, 0, 0, }, /* 398 */
+ { 27, 11, 3, 0, 0, }, /* 399 */
+ { 61, 12, 3, 0, 0, }, /* 400 */
+ { 61, 10, 5, 0, 0, }, /* 401 */
+ { 61, 7, 12, 0, 0, }, /* 402 */
+ { 61, 13, 12, 0, 0, }, /* 403 */
+ { 61, 21, 12, 0, 0, }, /* 404 */
+ { 61, 26, 12, 0, 0, }, /* 405 */
+ { 75, 12, 3, 0, 0, }, /* 406 */
+ { 75, 10, 5, 0, 0, }, /* 407 */
+ { 75, 7, 12, 0, 0, }, /* 408 */
+ { 75, 13, 12, 0, 0, }, /* 409 */
+ { 92, 7, 12, 0, 0, }, /* 410 */
+ { 92, 12, 3, 0, 0, }, /* 411 */
+ { 92, 10, 5, 0, 0, }, /* 412 */
+ { 92, 21, 12, 0, 0, }, /* 413 */
+ { 69, 7, 12, 0, 0, }, /* 414 */
+ { 69, 10, 5, 0, 0, }, /* 415 */
+ { 69, 12, 3, 0, 0, }, /* 416 */
+ { 69, 21, 12, 0, 0, }, /* 417 */
+ { 69, 13, 12, 0, 0, }, /* 418 */
+ { 72, 13, 12, 0, 0, }, /* 419 */
+ { 72, 7, 12, 0, 0, }, /* 420 */
+ { 72, 6, 12, 0, 0, }, /* 421 */
+ { 72, 21, 12, 0, 0, }, /* 422 */
+ { 12, 5, 12, 63, -6222, }, /* 423 */
+ { 12, 5, 12, 67, -6221, }, /* 424 */
+ { 12, 5, 12, 71, -6212, }, /* 425 */
+ { 12, 5, 12, 75, -6210, }, /* 426 */
+ { 12, 5, 12, 79, -6210, }, /* 427 */
+ { 12, 5, 12, 79, -6211, }, /* 428 */
+ { 12, 5, 12, 84, -6204, }, /* 429 */
+ { 12, 5, 12, 88, -6180, }, /* 430 */
+ { 12, 5, 12, 108, 35267, }, /* 431 */
+ { 75, 21, 12, 0, 0, }, /* 432 */
+ { 9, 10, 5, 0, 0, }, /* 433 */
+ { 9, 7, 12, 0, 0, }, /* 434 */
+ { 12, 5, 12, 0, 0, }, /* 435 */
+ { 12, 6, 12, 0, 0, }, /* 436 */
+ { 33, 5, 12, 0, 35332, }, /* 437 */
+ { 33, 5, 12, 0, 3814, }, /* 438 */
+ { 33, 9, 12, 92, 1, }, /* 439 */
+ { 33, 5, 12, 92, -1, }, /* 440 */
+ { 33, 5, 12, 92, -58, }, /* 441 */
+ { 33, 9, 12, 0, -7615, }, /* 442 */
+ { 19, 5, 12, 0, 8, }, /* 443 */
+ { 19, 9, 12, 0, -8, }, /* 444 */
+ { 19, 5, 12, 0, 74, }, /* 445 */
+ { 19, 5, 12, 0, 86, }, /* 446 */
+ { 19, 5, 12, 0, 100, }, /* 447 */
+ { 19, 5, 12, 0, 128, }, /* 448 */
+ { 19, 5, 12, 0, 112, }, /* 449 */
+ { 19, 5, 12, 0, 126, }, /* 450 */
+ { 19, 8, 12, 0, -8, }, /* 451 */
+ { 19, 5, 12, 0, 9, }, /* 452 */
+ { 19, 9, 12, 0, -74, }, /* 453 */
+ { 19, 8, 12, 0, -9, }, /* 454 */
+ { 19, 5, 12, 21, -7173, }, /* 455 */
+ { 19, 9, 12, 0, -86, }, /* 456 */
+ { 19, 9, 12, 0, -100, }, /* 457 */
+ { 19, 9, 12, 0, -112, }, /* 458 */
+ { 19, 9, 12, 0, -128, }, /* 459 */
+ { 19, 9, 12, 0, -126, }, /* 460 */
+ { 27, 1, 3, 0, 0, }, /* 461 */
+ { 27, 1, 16, 0, 0, }, /* 462 */
+ { 9, 27, 2, 0, 0, }, /* 463 */
+ { 9, 28, 2, 0, 0, }, /* 464 */
+ { 9, 2, 2, 0, 0, }, /* 465 */
+ { 9, 9, 12, 0, 0, }, /* 466 */
+ { 9, 5, 12, 0, 0, }, /* 467 */
+ { 19, 9, 12, 96, -7517, }, /* 468 */
+ { 33, 9, 12, 100, -8383, }, /* 469 */
+ { 33, 9, 12, 104, -8262, }, /* 470 */
+ { 33, 9, 12, 0, 28, }, /* 471 */
+ { 33, 5, 12, 0, -28, }, /* 472 */
+ { 33, 14, 12, 0, 16, }, /* 473 */
+ { 33, 14, 12, 0, -16, }, /* 474 */
+ { 33, 14, 12, 0, 0, }, /* 475 */
+ { 9, 26, 12, 0, 26, }, /* 476 */
+ { 9, 26, 12, 0, -26, }, /* 477 */
+ { 9, 26, 13, 0, 0, }, /* 478 */
+ { 9, 26, 17, 0, 0, }, /* 479 */
+ { 4, 26, 12, 0, 0, }, /* 480 */
+ { 17, 9, 12, 0, 48, }, /* 481 */
+ { 17, 5, 12, 0, -48, }, /* 482 */
+ { 33, 9, 12, 0, -10743, }, /* 483 */
+ { 33, 9, 12, 0, -3814, }, /* 484 */
+ { 33, 9, 12, 0, -10727, }, /* 485 */
+ { 33, 5, 12, 0, -10795, }, /* 486 */
+ { 33, 5, 12, 0, -10792, }, /* 487 */
+ { 33, 9, 12, 0, -10780, }, /* 488 */
+ { 33, 9, 12, 0, -10749, }, /* 489 */
+ { 33, 9, 12, 0, -10783, }, /* 490 */
+ { 33, 9, 12, 0, -10782, }, /* 491 */
+ { 33, 9, 12, 0, -10815, }, /* 492 */
+ { 10, 5, 12, 0, 0, }, /* 493 */
+ { 10, 26, 12, 0, 0, }, /* 494 */
+ { 10, 12, 3, 0, 0, }, /* 495 */
+ { 10, 21, 12, 0, 0, }, /* 496 */
+ { 10, 15, 12, 0, 0, }, /* 497 */
+ { 16, 5, 12, 0, -7264, }, /* 498 */
+ { 58, 7, 12, 0, 0, }, /* 499 */
+ { 58, 6, 12, 0, 0, }, /* 500 */
+ { 58, 21, 12, 0, 0, }, /* 501 */
+ { 58, 12, 3, 0, 0, }, /* 502 */
+ { 22, 26, 12, 0, 0, }, /* 503 */
+ { 22, 6, 12, 0, 0, }, /* 504 */
+ { 22, 14, 12, 0, 0, }, /* 505 */
+ { 23, 10, 3, 0, 0, }, /* 506 */
+ { 26, 7, 12, 0, 0, }, /* 507 */
+ { 26, 6, 12, 0, 0, }, /* 508 */
+ { 29, 7, 12, 0, 0, }, /* 509 */
+ { 29, 6, 12, 0, 0, }, /* 510 */
+ { 3, 7, 12, 0, 0, }, /* 511 */
+ { 23, 7, 12, 0, 0, }, /* 512 */
+ { 23, 26, 12, 0, 0, }, /* 513 */
+ { 29, 26, 12, 0, 0, }, /* 514 */
+ { 22, 7, 12, 0, 0, }, /* 515 */
+ { 60, 7, 12, 0, 0, }, /* 516 */
+ { 60, 6, 12, 0, 0, }, /* 517 */
+ { 60, 26, 12, 0, 0, }, /* 518 */
+ { 85, 7, 12, 0, 0, }, /* 519 */
+ { 85, 6, 12, 0, 0, }, /* 520 */
+ { 85, 21, 12, 0, 0, }, /* 521 */
+ { 76, 7, 12, 0, 0, }, /* 522 */
+ { 76, 6, 12, 0, 0, }, /* 523 */
+ { 76, 21, 12, 0, 0, }, /* 524 */
+ { 76, 13, 12, 0, 0, }, /* 525 */
+ { 12, 9, 12, 108, 1, }, /* 526 */
+ { 12, 5, 12, 108, -35267, }, /* 527 */
+ { 12, 7, 12, 0, 0, }, /* 528 */
+ { 12, 21, 12, 0, 0, }, /* 529 */
+ { 78, 7, 12, 0, 0, }, /* 530 */
+ { 78, 14, 12, 0, 0, }, /* 531 */
+ { 78, 12, 3, 0, 0, }, /* 532 */
+ { 78, 21, 12, 0, 0, }, /* 533 */
+ { 33, 9, 12, 0, -35332, }, /* 534 */
+ { 33, 9, 12, 0, -42280, }, /* 535 */
+ { 33, 9, 12, 0, -42308, }, /* 536 */
+ { 33, 9, 12, 0, -42319, }, /* 537 */
+ { 33, 9, 12, 0, -42315, }, /* 538 */
+ { 33, 9, 12, 0, -42305, }, /* 539 */
+ { 33, 9, 12, 0, -42258, }, /* 540 */
+ { 33, 9, 12, 0, -42282, }, /* 541 */
+ { 33, 9, 12, 0, -42261, }, /* 542 */
+ { 33, 9, 12, 0, 928, }, /* 543 */
+ { 48, 7, 12, 0, 0, }, /* 544 */
+ { 48, 12, 3, 0, 0, }, /* 545 */
+ { 48, 10, 5, 0, 0, }, /* 546 */
+ { 48, 26, 12, 0, 0, }, /* 547 */
+ { 64, 7, 12, 0, 0, }, /* 548 */
+ { 64, 21, 12, 0, 0, }, /* 549 */
+ { 74, 10, 5, 0, 0, }, /* 550 */
+ { 74, 7, 12, 0, 0, }, /* 551 */
+ { 74, 12, 3, 0, 0, }, /* 552 */
+ { 74, 21, 12, 0, 0, }, /* 553 */
+ { 74, 13, 12, 0, 0, }, /* 554 */
+ { 68, 13, 12, 0, 0, }, /* 555 */
+ { 68, 7, 12, 0, 0, }, /* 556 */
+ { 68, 12, 3, 0, 0, }, /* 557 */
+ { 68, 21, 12, 0, 0, }, /* 558 */
+ { 73, 7, 12, 0, 0, }, /* 559 */
+ { 73, 12, 3, 0, 0, }, /* 560 */
+ { 73, 10, 5, 0, 0, }, /* 561 */
+ { 73, 21, 12, 0, 0, }, /* 562 */
+ { 83, 12, 3, 0, 0, }, /* 563 */
+ { 83, 10, 5, 0, 0, }, /* 564 */
+ { 83, 7, 12, 0, 0, }, /* 565 */
+ { 83, 21, 12, 0, 0, }, /* 566 */
+ { 83, 13, 12, 0, 0, }, /* 567 */
+ { 38, 6, 12, 0, 0, }, /* 568 */
+ { 67, 7, 12, 0, 0, }, /* 569 */
+ { 67, 12, 3, 0, 0, }, /* 570 */
+ { 67, 10, 5, 0, 0, }, /* 571 */
+ { 67, 13, 12, 0, 0, }, /* 572 */
+ { 67, 21, 12, 0, 0, }, /* 573 */
+ { 91, 7, 12, 0, 0, }, /* 574 */
+ { 91, 12, 3, 0, 0, }, /* 575 */
+ { 91, 6, 12, 0, 0, }, /* 576 */
+ { 91, 21, 12, 0, 0, }, /* 577 */
+ { 86, 7, 12, 0, 0, }, /* 578 */
+ { 86, 10, 5, 0, 0, }, /* 579 */
+ { 86, 12, 3, 0, 0, }, /* 580 */
+ { 86, 21, 12, 0, 0, }, /* 581 */
+ { 86, 6, 12, 0, 0, }, /* 582 */
+ { 33, 5, 12, 0, -928, }, /* 583 */
+ { 8, 5, 12, 0, -38864, }, /* 584 */
+ { 86, 13, 12, 0, 0, }, /* 585 */
+ { 23, 7, 9, 0, 0, }, /* 586 */
+ { 23, 7, 10, 0, 0, }, /* 587 */
+ { 9, 4, 2, 0, 0, }, /* 588 */
+ { 9, 3, 12, 0, 0, }, /* 589 */
+ { 25, 25, 12, 0, 0, }, /* 590 */
+ { 0, 24, 12, 0, 0, }, /* 591 */
+ { 9, 6, 3, 0, 0, }, /* 592 */
+ { 35, 7, 12, 0, 0, }, /* 593 */
+ { 19, 14, 12, 0, 0, }, /* 594 */
+ { 19, 15, 12, 0, 0, }, /* 595 */
+ { 19, 26, 12, 0, 0, }, /* 596 */
+ { 70, 7, 12, 0, 0, }, /* 597 */
+ { 66, 7, 12, 0, 0, }, /* 598 */
+ { 41, 7, 12, 0, 0, }, /* 599 */
+ { 41, 15, 12, 0, 0, }, /* 600 */
+ { 18, 7, 12, 0, 0, }, /* 601 */
+ { 18, 14, 12, 0, 0, }, /* 602 */
+ { 117, 7, 12, 0, 0, }, /* 603 */
+ { 117, 12, 3, 0, 0, }, /* 604 */
+ { 59, 7, 12, 0, 0, }, /* 605 */
+ { 59, 21, 12, 0, 0, }, /* 606 */
+ { 42, 7, 12, 0, 0, }, /* 607 */
+ { 42, 21, 12, 0, 0, }, /* 608 */
+ { 42, 14, 12, 0, 0, }, /* 609 */
+ { 13, 9, 12, 0, 40, }, /* 610 */
+ { 13, 5, 12, 0, -40, }, /* 611 */
+ { 46, 7, 12, 0, 0, }, /* 612 */
+ { 44, 7, 12, 0, 0, }, /* 613 */
+ { 44, 13, 12, 0, 0, }, /* 614 */
+ { 135, 9, 12, 0, 40, }, /* 615 */
+ { 135, 5, 12, 0, -40, }, /* 616 */
+ { 105, 7, 12, 0, 0, }, /* 617 */
+ { 103, 7, 12, 0, 0, }, /* 618 */
+ { 103, 21, 12, 0, 0, }, /* 619 */
+ { 109, 7, 12, 0, 0, }, /* 620 */
+ { 11, 7, 12, 0, 0, }, /* 621 */
+ { 80, 7, 12, 0, 0, }, /* 622 */
+ { 80, 21, 12, 0, 0, }, /* 623 */
+ { 80, 15, 12, 0, 0, }, /* 624 */
+ { 119, 7, 12, 0, 0, }, /* 625 */
+ { 119, 26, 12, 0, 0, }, /* 626 */
+ { 119, 15, 12, 0, 0, }, /* 627 */
+ { 115, 7, 12, 0, 0, }, /* 628 */
+ { 115, 15, 12, 0, 0, }, /* 629 */
+ { 127, 7, 12, 0, 0, }, /* 630 */
+ { 127, 15, 12, 0, 0, }, /* 631 */
+ { 65, 7, 12, 0, 0, }, /* 632 */
+ { 65, 15, 12, 0, 0, }, /* 633 */
+ { 65, 21, 12, 0, 0, }, /* 634 */
+ { 71, 7, 12, 0, 0, }, /* 635 */
+ { 71, 21, 12, 0, 0, }, /* 636 */
+ { 97, 7, 12, 0, 0, }, /* 637 */
+ { 96, 7, 12, 0, 0, }, /* 638 */
+ { 96, 15, 12, 0, 0, }, /* 639 */
+ { 30, 7, 12, 0, 0, }, /* 640 */
+ { 30, 12, 3, 0, 0, }, /* 641 */
+ { 30, 15, 12, 0, 0, }, /* 642 */
+ { 30, 21, 12, 0, 0, }, /* 643 */
+ { 87, 7, 12, 0, 0, }, /* 644 */
+ { 87, 15, 12, 0, 0, }, /* 645 */
+ { 87, 21, 12, 0, 0, }, /* 646 */
+ { 116, 7, 12, 0, 0, }, /* 647 */
+ { 116, 15, 12, 0, 0, }, /* 648 */
+ { 111, 7, 12, 0, 0, }, /* 649 */
+ { 111, 26, 12, 0, 0, }, /* 650 */
+ { 111, 12, 3, 0, 0, }, /* 651 */
+ { 111, 15, 12, 0, 0, }, /* 652 */
+ { 111, 21, 12, 0, 0, }, /* 653 */
+ { 77, 7, 12, 0, 0, }, /* 654 */
+ { 77, 21, 12, 0, 0, }, /* 655 */
+ { 82, 7, 12, 0, 0, }, /* 656 */
+ { 82, 15, 12, 0, 0, }, /* 657 */
+ { 81, 7, 12, 0, 0, }, /* 658 */
+ { 81, 15, 12, 0, 0, }, /* 659 */
+ { 120, 7, 12, 0, 0, }, /* 660 */
+ { 120, 21, 12, 0, 0, }, /* 661 */
+ { 120, 15, 12, 0, 0, }, /* 662 */
+ { 88, 7, 12, 0, 0, }, /* 663 */
+ { 129, 9, 12, 0, 64, }, /* 664 */
+ { 129, 5, 12, 0, -64, }, /* 665 */
+ { 129, 15, 12, 0, 0, }, /* 666 */
+ { 0, 15, 12, 0, 0, }, /* 667 */
+ { 93, 10, 5, 0, 0, }, /* 668 */
+ { 93, 12, 3, 0, 0, }, /* 669 */
+ { 93, 7, 12, 0, 0, }, /* 670 */
+ { 93, 21, 12, 0, 0, }, /* 671 */
+ { 93, 15, 12, 0, 0, }, /* 672 */
+ { 93, 13, 12, 0, 0, }, /* 673 */
+ { 84, 12, 3, 0, 0, }, /* 674 */
+ { 84, 10, 5, 0, 0, }, /* 675 */
+ { 84, 7, 12, 0, 0, }, /* 676 */
+ { 84, 21, 12, 0, 0, }, /* 677 */
+ { 84, 1, 4, 0, 0, }, /* 678 */
+ { 100, 7, 12, 0, 0, }, /* 679 */
+ { 100, 13, 12, 0, 0, }, /* 680 */
+ { 95, 12, 3, 0, 0, }, /* 681 */
+ { 95, 7, 12, 0, 0, }, /* 682 */
+ { 95, 10, 5, 0, 0, }, /* 683 */
+ { 95, 13, 12, 0, 0, }, /* 684 */
+ { 95, 21, 12, 0, 0, }, /* 685 */
+ { 110, 7, 12, 0, 0, }, /* 686 */
+ { 110, 12, 3, 0, 0, }, /* 687 */
+ { 110, 21, 12, 0, 0, }, /* 688 */
+ { 99, 12, 3, 0, 0, }, /* 689 */
+ { 99, 10, 5, 0, 0, }, /* 690 */
+ { 99, 7, 12, 0, 0, }, /* 691 */
+ { 99, 7, 4, 0, 0, }, /* 692 */
+ { 99, 21, 12, 0, 0, }, /* 693 */
+ { 99, 13, 12, 0, 0, }, /* 694 */
+ { 47, 15, 12, 0, 0, }, /* 695 */
+ { 107, 7, 12, 0, 0, }, /* 696 */
+ { 107, 10, 5, 0, 0, }, /* 697 */
+ { 107, 12, 3, 0, 0, }, /* 698 */
+ { 107, 21, 12, 0, 0, }, /* 699 */
+ { 128, 7, 12, 0, 0, }, /* 700 */
+ { 128, 21, 12, 0, 0, }, /* 701 */
+ { 108, 7, 12, 0, 0, }, /* 702 */
+ { 108, 12, 3, 0, 0, }, /* 703 */
+ { 108, 10, 5, 0, 0, }, /* 704 */
+ { 108, 13, 12, 0, 0, }, /* 705 */
+ { 106, 12, 3, 0, 0, }, /* 706 */
+ { 106, 10, 5, 0, 0, }, /* 707 */
+ { 106, 7, 12, 0, 0, }, /* 708 */
+ { 106, 10, 3, 0, 0, }, /* 709 */
+ { 134, 7, 12, 0, 0, }, /* 710 */
+ { 134, 10, 5, 0, 0, }, /* 711 */
+ { 134, 12, 3, 0, 0, }, /* 712 */
+ { 134, 21, 12, 0, 0, }, /* 713 */
+ { 134, 13, 12, 0, 0, }, /* 714 */
+ { 123, 7, 12, 0, 0, }, /* 715 */
+ { 123, 10, 3, 0, 0, }, /* 716 */
+ { 123, 10, 5, 0, 0, }, /* 717 */
+ { 123, 12, 3, 0, 0, }, /* 718 */
+ { 123, 21, 12, 0, 0, }, /* 719 */
+ { 123, 13, 12, 0, 0, }, /* 720 */
+ { 122, 7, 12, 0, 0, }, /* 721 */
+ { 122, 10, 3, 0, 0, }, /* 722 */
+ { 122, 10, 5, 0, 0, }, /* 723 */
+ { 122, 12, 3, 0, 0, }, /* 724 */
+ { 122, 21, 12, 0, 0, }, /* 725 */
+ { 113, 7, 12, 0, 0, }, /* 726 */
+ { 113, 10, 5, 0, 0, }, /* 727 */
+ { 113, 12, 3, 0, 0, }, /* 728 */
+ { 113, 21, 12, 0, 0, }, /* 729 */
+ { 113, 13, 12, 0, 0, }, /* 730 */
+ { 101, 7, 12, 0, 0, }, /* 731 */
+ { 101, 12, 3, 0, 0, }, /* 732 */
+ { 101, 10, 5, 0, 0, }, /* 733 */
+ { 101, 13, 12, 0, 0, }, /* 734 */
+ { 125, 7, 12, 0, 0, }, /* 735 */
+ { 125, 12, 3, 0, 0, }, /* 736 */
+ { 125, 10, 5, 0, 0, }, /* 737 */
+ { 125, 13, 12, 0, 0, }, /* 738 */
+ { 125, 15, 12, 0, 0, }, /* 739 */
+ { 125, 21, 12, 0, 0, }, /* 740 */
+ { 125, 26, 12, 0, 0, }, /* 741 */
+ { 124, 9, 12, 0, 32, }, /* 742 */
+ { 124, 5, 12, 0, -32, }, /* 743 */
+ { 124, 13, 12, 0, 0, }, /* 744 */
+ { 124, 15, 12, 0, 0, }, /* 745 */
+ { 124, 7, 12, 0, 0, }, /* 746 */
+ { 140, 7, 12, 0, 0, }, /* 747 */
+ { 140, 12, 3, 0, 0, }, /* 748 */
+ { 140, 10, 5, 0, 0, }, /* 749 */
+ { 140, 7, 4, 0, 0, }, /* 750 */
+ { 140, 21, 12, 0, 0, }, /* 751 */
+ { 139, 7, 12, 0, 0, }, /* 752 */
+ { 139, 12, 3, 0, 0, }, /* 753 */
+ { 139, 10, 5, 0, 0, }, /* 754 */
+ { 139, 7, 4, 0, 0, }, /* 755 */
+ { 139, 21, 12, 0, 0, }, /* 756 */
+ { 121, 7, 12, 0, 0, }, /* 757 */
+ { 132, 7, 12, 0, 0, }, /* 758 */
+ { 132, 10, 5, 0, 0, }, /* 759 */
+ { 132, 12, 3, 0, 0, }, /* 760 */
+ { 132, 21, 12, 0, 0, }, /* 761 */
+ { 132, 13, 12, 0, 0, }, /* 762 */
+ { 132, 15, 12, 0, 0, }, /* 763 */
+ { 133, 21, 12, 0, 0, }, /* 764 */
+ { 133, 7, 12, 0, 0, }, /* 765 */
+ { 133, 12, 3, 0, 0, }, /* 766 */
+ { 133, 10, 5, 0, 0, }, /* 767 */
+ { 137, 7, 12, 0, 0, }, /* 768 */
+ { 137, 12, 3, 0, 0, }, /* 769 */
+ { 137, 7, 4, 0, 0, }, /* 770 */
+ { 137, 13, 12, 0, 0, }, /* 771 */
+ { 62, 7, 12, 0, 0, }, /* 772 */
+ { 62, 14, 12, 0, 0, }, /* 773 */
+ { 62, 21, 12, 0, 0, }, /* 774 */
+ { 79, 7, 12, 0, 0, }, /* 775 */
+ { 126, 7, 12, 0, 0, }, /* 776 */
+ { 114, 7, 12, 0, 0, }, /* 777 */
+ { 114, 13, 12, 0, 0, }, /* 778 */
+ { 114, 21, 12, 0, 0, }, /* 779 */
+ { 102, 7, 12, 0, 0, }, /* 780 */
+ { 102, 12, 3, 0, 0, }, /* 781 */
+ { 102, 21, 12, 0, 0, }, /* 782 */
+ { 118, 7, 12, 0, 0, }, /* 783 */
+ { 118, 12, 3, 0, 0, }, /* 784 */
+ { 118, 21, 12, 0, 0, }, /* 785 */
+ { 118, 26, 12, 0, 0, }, /* 786 */
+ { 118, 6, 12, 0, 0, }, /* 787 */
+ { 118, 13, 12, 0, 0, }, /* 788 */
+ { 118, 15, 12, 0, 0, }, /* 789 */
+ { 98, 7, 12, 0, 0, }, /* 790 */
+ { 98, 10, 5, 0, 0, }, /* 791 */
+ { 98, 12, 3, 0, 0, }, /* 792 */
+ { 98, 6, 12, 0, 0, }, /* 793 */
+ { 136, 6, 12, 0, 0, }, /* 794 */
+ { 138, 6, 12, 0, 0, }, /* 795 */
+ { 136, 7, 12, 0, 0, }, /* 796 */
+ { 138, 7, 12, 0, 0, }, /* 797 */
+ { 104, 7, 12, 0, 0, }, /* 798 */
+ { 104, 26, 12, 0, 0, }, /* 799 */
+ { 104, 12, 3, 0, 0, }, /* 800 */
+ { 104, 21, 12, 0, 0, }, /* 801 */
+ { 9, 10, 3, 0, 0, }, /* 802 */
+ { 19, 12, 3, 0, 0, }, /* 803 */
+ { 130, 26, 12, 0, 0, }, /* 804 */
+ { 130, 12, 3, 0, 0, }, /* 805 */
+ { 130, 21, 12, 0, 0, }, /* 806 */
+ { 17, 12, 3, 0, 0, }, /* 807 */
+ { 112, 7, 12, 0, 0, }, /* 808 */
+ { 112, 15, 12, 0, 0, }, /* 809 */
+ { 112, 12, 3, 0, 0, }, /* 810 */
+ { 131, 9, 12, 0, 34, }, /* 811 */
+ { 131, 5, 12, 0, -34, }, /* 812 */
+ { 131, 12, 3, 0, 0, }, /* 813 */
+ { 131, 13, 12, 0, 0, }, /* 814 */
+ { 131, 21, 12, 0, 0, }, /* 815 */
+ { 9, 26, 11, 0, 0, }, /* 816 */
+ { 26, 26, 12, 0, 0, }, /* 817 */
+ { 9, 24, 14, 0, 0, }, /* 818 */
+ { 9, 26, 15, 0, 0, }, /* 819 */
+ { 9, 1, 3, 0, 0, }, /* 820 */
};
const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
@@ -834,549 +933,549 @@ const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* U+0800 */
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 41, 42, 43, 44, 45, /* U+1000 */
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, /* U+1800 */
- 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 71, 74, 75, /* U+2000 */
- 76, 76, 66, 77, 66, 66, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, /* U+2800 */
- 88, 89, 90, 91, 92, 93, 94, 71, 95, 95, 95, 95, 95, 95, 95, 95, /* U+3000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+3800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+4000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 95, 95, 95, 95, /* U+4800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+5000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+5800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+6000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+6800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+7000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+7800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+8000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+8800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+9000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 97, /* U+9800 */
- 98, 99, 99, 99, 99, 99, 99, 99, 99,100,101,101,102,103,104,105, /* U+A000 */
-106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,114, /* U+A800 */
-115,116,117,118,119,120,114,115,116,117,118,119,120,114,115,116, /* U+B000 */
-117,118,119,120,114,115,116,117,118,119,120,114,115,116,117,118, /* U+B800 */
-119,120,114,115,116,117,118,119,120,114,115,116,117,118,119,120, /* U+C000 */
-114,115,116,117,118,119,120,114,115,116,117,118,119,120,114,115, /* U+C800 */
-116,117,118,119,120,114,115,116,117,118,119,120,114,115,116,121, /* U+D000 */
-122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122, /* U+D800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+E000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+E800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F000 */
-123,123, 95, 95,124,125,126,127,128,128,129,130,131,132,133,134, /* U+F800 */
-135,136,137,138,139,140,141,142,143,144,145,139,146,146,147,139, /* U+10000 */
-148,149,150,151,152,153,154,155,156,157,139,139,158,139,139,139, /* U+10800 */
-159,160,161,162,163,164,165,139,139,166,139,167,168,169,170,139, /* U+11000 */
-139,171,139,139,139,172,139,139,139,139,139,139,139,139,139,139, /* U+11800 */
-173,173,173,173,173,173,173,174,175,173,176,139,139,139,139,139, /* U+12000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+12800 */
-177,177,177,177,177,177,177,177,178,139,139,139,139,139,139,139, /* U+13000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+13800 */
-139,139,139,139,139,139,139,139,179,179,179,179,180,139,139,139, /* U+14000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+14800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+15000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+15800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+16000 */
-181,181,181,181,182,183,184,185,139,139,139,139,139,139,186,187, /* U+16800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+17000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+17800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+18000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+18800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+19000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+19800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1A800 */
-188,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1B000 */
-139,139,139,139,139,139,139,139,189,190,139,139,139,139,139,139, /* U+1B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1C800 */
- 71,191,192,193,194,139,195,139,196,197,198,199,200,201,202,203, /* U+1D000 */
-204,204,204,204,205,206,139,139,139,139,139,139,139,139,139,139, /* U+1D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1E000 */
-207,208,139,139,139,139,139,139,139,139,139,139,209,210,139,139, /* U+1E800 */
-211,212,213,214,215,139, 71,216, 71, 71,217,218, 71,219,220,221, /* U+1F000 */
-222,223,224,225,139,139,139,139,139,139,139,139,139,139,139,139, /* U+1F800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+20000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+20800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+21000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+21800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+22000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+22800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+23000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+23800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+24000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+24800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+25000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+25800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+26000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+26800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+27000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+27800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+28000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+28800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+29000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+29800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,226, 95, 95, /* U+2A000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+2A800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,227, 95, /* U+2B000 */
-228, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+2B800 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, /* U+2C000 */
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,229,139,139, /* U+2C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+2F000 */
- 95, 95, 95, 95,230,139,139,139,139,139,139,139,139,139,139,139, /* U+2F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+30000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+30800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+31000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+31800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+32000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+32800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+33000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+33800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+34000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+34800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+35000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+35800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+36000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+36800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+37000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+37800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+38000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+38800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+39000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+39800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+3F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+40000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+40800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+41000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+41800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+42000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+42800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+43000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+43800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+44000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+44800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+45000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+45800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+46000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+46800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+47000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+47800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+48000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+48800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+49000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+49800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+4F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+50000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+50800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+51000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+51800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+52000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+52800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+53000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+53800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+54000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+54800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+55000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+55800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+56000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+56800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+57000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+57800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+58000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+58800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+59000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+59800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+5F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+60000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+60800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+61000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+61800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+62000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+62800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+63000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+63800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+64000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+64800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+65000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+65800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+66000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+66800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+67000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+67800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+68000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+68800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+69000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+69800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+6F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+70000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+70800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+71000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+71800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+72000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+72800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+73000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+73800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+74000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+74800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+75000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+75800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+76000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+76800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+77000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+77800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+78000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+78800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+79000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+79800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+7F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+80000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+80800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+81000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+81800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+82000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+82800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+83000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+83800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+84000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+84800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+85000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+85800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+86000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+86800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+87000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+87800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+88000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+88800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+89000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+89800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+8F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+90000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+90800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+91000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+91800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+92000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+92800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+93000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+93800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+94000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+94800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+95000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+95800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+96000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+96800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+97000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+97800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+98000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+98800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+99000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+99800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9A000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9A800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9B000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9B800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9C000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9C800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9D000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9D800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9E000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9E800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9F000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+9F800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A0000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A0800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A1000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A1800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A2000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A2800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A3000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A3800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A4000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A4800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A5000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A5800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A6000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A6800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A7000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A7800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A8000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A8800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A9000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+A9800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AA000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AA800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AB000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AB800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AC000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AC800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AD000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AD800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AE000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AE800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AF000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+AF800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B0000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B0800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B1000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B1800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B2000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B2800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B3000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B3800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B4000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B4800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B5000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B5800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B6000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B6800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B7000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B7800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B8000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B8800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B9000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+B9800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BA000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BA800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BB000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BB800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BC000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BC800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BD000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BD800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BE000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BE800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BF000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+BF800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C0000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C0800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C1000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C1800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C2000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C2800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C3000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C3800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C4000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C4800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C5000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C5800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C6000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C6800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C7000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C7800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C8000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C8800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C9000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+C9800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CA000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CA800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CB000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CB800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CC000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CC800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CD000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CD800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CE000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CE800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CF000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+CF800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D0000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D0800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D1000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D1800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D2000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D2800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D3000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D3800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D4000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D4800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D5000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D5800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D6000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D6800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D7000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D7800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D8000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D8800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D9000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+D9800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DA000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DA800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DB000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DB800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DC000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DC800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DD000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DD800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DE000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DE800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DF000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+DF800 */
-231,232,233,234,232,232,232,232,232,232,232,232,232,232,232,232, /* U+E0000 */
-232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232, /* U+E0800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E1000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E1800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E2000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E2800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E3000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E3800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E4000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E4800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E5000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E5800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E6000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E6800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E7000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E7800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E8000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E8800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E9000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+E9800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EA000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EA800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EB000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EB800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EC000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EC800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+ED000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+ED800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EE000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EE800 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EF000 */
-139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, /* U+EF800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F0000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F0800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F1000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F1800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F2000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F2800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F3000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F3800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F4000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F4800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F5000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F5800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F6000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F6800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F7000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F7800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F8000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F8800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F9000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+F9800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FA000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FA800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FB000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FB800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FC000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FC800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FD000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FD800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FE000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FE800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+FF000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,235, /* U+FF800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+100000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+100800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+101000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+101800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+102000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+102800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+103000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+103800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+104000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+104800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+105000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+105800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+106000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+106800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+107000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+107800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+108000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+108800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+109000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+109800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10A000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10A800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10B000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10B800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10C000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10C800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10D000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10D800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10E000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10E800 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+10F000 */
-123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,235, /* U+10F800 */
+ 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* U+2000 */
+ 77, 77, 66, 78, 66, 66, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* U+2800 */
+ 89, 90, 91, 92, 93, 94, 95, 71, 96, 96, 96, 96, 96, 96, 96, 96, /* U+3000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+3800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+4000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 96, 96, 96, 96, /* U+4800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+5000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+5800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+6000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+6800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+7000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+7800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+8000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+8800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+9000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 98, /* U+9800 */
+ 99,100,100,100,100,100,100,100,100,101,102,102,103,104,105,106, /* U+A000 */
+107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,115, /* U+A800 */
+116,117,118,119,120,121,115,116,117,118,119,120,121,115,116,117, /* U+B000 */
+118,119,120,121,115,116,117,118,119,120,121,115,116,117,118,119, /* U+B800 */
+120,121,115,116,117,118,119,120,121,115,116,117,118,119,120,121, /* U+C000 */
+115,116,117,118,119,120,121,115,116,117,118,119,120,121,115,116, /* U+C800 */
+117,118,119,120,121,115,116,117,118,119,120,121,115,116,117,122, /* U+D000 */
+123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+D800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+E000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+E800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F000 */
+124,124, 96, 96,125,126,127,128,129,129,130,131,132,133,134,135, /* U+F800 */
+136,137,138,139,140,141,142,143,144,145,146,140,147,147,148,140, /* U+10000 */
+149,150,151,152,153,154,155,156,157,158,140,140,159,140,140,140, /* U+10800 */
+160,161,162,163,164,165,166,140,167,168,140,169,170,171,172,140, /* U+11000 */
+140,173,140,140,174,175,140,140,176,177,178,140,140,140,140,140, /* U+11800 */
+179,179,179,179,179,179,179,180,181,179,182,140,140,140,140,140, /* U+12000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+12800 */
+183,183,183,183,183,183,183,183,184,140,140,140,140,140,140,140, /* U+13000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+13800 */
+140,140,140,140,140,140,140,140,185,185,185,185,186,140,140,140, /* U+14000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+14800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+15000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+15800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+16000 */
+187,187,187,187,188,189,190,191,140,140,140,140,140,140,192,193, /* U+16800 */
+194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194, /* U+17000 */
+194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194, /* U+17800 */
+194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195, /* U+18000 */
+194,194,194,194,194,196,140,140,140,140,140,140,140,140,140,140, /* U+18800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+19000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+19800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1A800 */
+197,198,199,200,200,201,140,140,140,140,140,140,140,140,140,140, /* U+1B000 */
+140,140,140,140,140,140,140,140,202,203,140,140,140,140,140,140, /* U+1B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1C800 */
+ 71,204,205,206,207,140,208,140,209,210,211,212,213,214,215,216, /* U+1D000 */
+217,217,217,217,218,219,140,140,140,140,140,140,140,140,140,140, /* U+1D800 */
+220,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1E000 */
+221,222,223,140,140,140,140,140,140,140,140,140,224,225,140,140, /* U+1E800 */
+226,227,228,229,230,140,231,232,233,234,235,236,237,238,239,240, /* U+1F000 */
+241,242,243,244,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1F800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+20000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+20800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+21000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+21800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+22000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+22800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+23000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+23800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+24000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+24800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+25000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+25800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+26000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+26800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+27000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+27800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+28000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+28800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+29000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+29800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,245, 96, 96, /* U+2A000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2A800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,246, 96, /* U+2B000 */
+247, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2B800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2C000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,248, 96, 96, /* U+2C800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2D000 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2D800 */
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2E000 */
+ 96, 96, 96, 96, 96, 96, 96,249,140,140,140,140,140,140,140,140, /* U+2E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+2F000 */
+ 96, 96, 96, 96,250,140,140,140,140,140,140,140,140,140,140,140, /* U+2F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+30000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+30800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+31000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+31800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+32000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+32800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+33000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+33800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+34000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+34800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+35000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+35800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+36000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+36800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+37000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+37800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+38000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+38800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+39000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+39800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+40000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+40800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+41000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+41800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+42000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+42800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+43000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+43800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+44000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+44800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+45000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+45800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+46000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+46800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+47000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+47800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+48000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+48800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+49000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+49800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+50000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+50800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+51000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+51800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+52000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+52800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+53000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+53800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+54000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+54800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+55000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+55800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+56000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+56800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+57000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+57800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+58000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+58800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+59000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+59800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+60000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+60800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+61000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+61800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+62000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+62800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+63000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+63800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+64000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+64800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+65000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+65800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+66000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+66800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+67000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+67800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+68000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+68800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+69000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+69800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+70000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+70800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+71000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+71800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+72000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+72800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+73000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+73800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+74000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+74800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+75000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+75800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+76000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+76800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+77000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+77800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+78000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+78800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+79000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+79800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+80000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+80800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+81000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+81800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+82000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+82800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+83000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+83800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+84000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+84800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+85000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+85800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+86000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+86800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+87000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+87800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+88000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+88800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+89000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+89800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+90000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+90800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+91000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+91800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+92000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+92800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+93000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+93800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+94000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+94800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+95000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+95800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+96000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+96800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+97000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+97800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+98000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+98800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+99000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+99800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9A000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9A800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9B000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9B800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9C000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9C800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9D000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9D800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9E000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9E800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9F000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9F800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A0000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A0800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A1000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A1800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A2000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A2800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A3000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A3800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A4000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A4800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A5000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A5800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A6000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A6800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A7000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A7800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A8000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A8800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A9000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A9800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AA000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AA800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AB000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AB800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AC000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AC800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AD000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AD800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AE000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AE800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AF000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AF800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B0000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B0800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B1000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B1800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B2000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B2800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B3000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B3800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B4000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B4800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B5000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B5800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B6000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B6800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B7000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B7800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B8000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B8800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B9000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B9800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BA000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BA800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BB000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BB800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BC000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BC800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BD000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BD800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BE000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BE800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BF000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BF800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C0000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C0800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C1000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C1800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C2000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C2800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C3000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C3800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C4000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C4800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C5000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C5800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C6000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C6800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C7000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C7800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C8000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C8800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C9000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C9800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CA000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CA800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CB000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CB800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CC000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CC800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CD000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CD800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CE000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CE800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CF000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CF800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D0000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D0800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D1000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D1800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D2000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D2800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D3000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D3800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D4000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D4800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D5000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D5800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D6000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D6800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D7000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D7800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D8000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D8800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D9000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D9800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DA000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DA800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DB000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DB800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DC000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DC800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DD000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DD800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DE000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DE800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DF000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DF800 */
+251,252,253,254,252,252,252,252,252,252,252,252,252,252,252,252, /* U+E0000 */
+252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252, /* U+E0800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E1000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E1800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E2000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E2800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E3000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E3800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E4000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E4800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E5000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E5800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E6000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E6800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E7000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E7800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E8000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E8800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E9000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E9800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EA000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EA800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EB000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EB800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EC000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EC800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+ED000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+ED800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EE000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EE800 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EF000 */
+140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EF800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F0000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F0800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F1000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F1800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F2000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F2800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F3000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F3800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F4000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F4800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F5000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F5800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F6000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F6800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F7000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F7800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F8000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F8800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F9000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F9800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FA000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FA800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FB000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FB800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FC000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FC800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FD000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FD800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FE000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FE800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FF000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,255, /* U+FF800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+100000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+100800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+101000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+101800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+102000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+102800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+103000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+103800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+104000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+104800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+105000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+105800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+106000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+106800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+107000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+107800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+108000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+108800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+109000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+109800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10A000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10A800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10B000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10B800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10C000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10C800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10D000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10D800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10E000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10E800 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10F000 */
+124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,255, /* U+10F800 */
};
-const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
+const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */
/* block 0 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1424,7 +1523,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
30, 31, 30, 31, 33, 33, 33, 33, 33, 33, 71, 30, 31, 72, 73, 74,
74, 30, 31, 75, 76, 77, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
78, 79, 80, 81, 82, 33, 83, 83, 33, 84, 33, 85, 86, 33, 33, 33,
- 83, 87, 33, 88, 33, 89, 90, 33, 91, 92, 33, 93, 94, 33, 33, 92,
+ 83, 87, 33, 88, 33, 89, 90, 33, 91, 92, 90, 93, 94, 33, 33, 92,
33, 95, 96, 33, 33, 97, 33, 33, 33, 33, 33, 33, 33, 98, 33, 33,
/* block 5 */
@@ -1459,493 +1558,493 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
/* block 8 */
171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
-172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
-172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
-173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
-173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
-174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+172,172,173,172,174,172,172,172,172,172,172,172,172,172,175,172,
+172,176,177,172,172,172,172,172,172,172,178,172,172,172,172,172,
+179,179,180,179,181,179,179,179,179,179,179,179,179,179,182,179,
+179,183,184,179,179,179,179,179,179,179,185,179,179,179,179,179,
+186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,
+187,188,189,190,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
/* block 9 */
-175,176,177,178,178,110,110,178,179,179,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-180,175,176,175,176,175,176,175,176,175,176,175,176,175,176,181,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
+187,188,191,192,192,110,110,192,193,193,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+194,187,188,187,188,187,188,187,188,187,188,187,188,187,188,195,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
/* block 10 */
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-115,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,
-182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,
-182,182,182,182,182,182,182,115,115,183,184,184,184,184,184,184,
-115,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
-185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+115,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,
+196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,
+196,196,196,196,196,196,196,115,115,197,198,198,198,198,198,198,
+115,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
/* block 11 */
-185,185,185,185,185,185,185,186,115, 4,187,115,115,188,188,189,
-115,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
-190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
-190,190,190,190,190,190,190,190,190,190,190,190,190,190,191,190,
-192,190,190,192,190,190,192,190,115,115,115,115,115,115,115,115,
-193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,
-193,193,193,193,193,193,193,193,193,193,193,115,115,115,115,115,
-193,193,193,192,192,115,115,115,115,115,115,115,115,115,115,115,
+199,199,199,199,199,199,199,200,115, 4,201,115,115,202,202,203,
+115,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
+204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
+204,204,204,204,204,204,204,204,204,204,204,204,204,204,205,204,
+206,204,204,206,204,204,206,204,115,115,115,115,115,115,115,115,
+207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,
+207,207,207,207,207,207,207,207,207,207,207,115,115,115,115,115,
+207,207,207,206,206,115,115,115,115,115,115,115,115,115,115,115,
/* block 12 */
-194,194,194,194,194, 22,195,195,195,196,196,197, 4,196,198,198,
-199,199,199,199,199,199,199,199,199,199,199, 4, 22,115,196, 4,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-108,200,200,200,200,200,200,200,200,200,200,110,110,110,110,110,
-110,110,110,110,110,110,199,199,199,199,199,199,199,199,199,199,
-201,201,201,201,201,201,201,201,201,201,196,196,196,196,200,200,
-110,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+208,208,208,208,208,209,210,210,210,211,211,212, 4,211,213,213,
+214,214,214,214,214,214,214,214,214,214,214, 4,215,115,211, 4,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+108,216,216,216,216,216,216,216,216,216,216,110,110,110,110,110,
+110,110,110,110,110,110,214,214,214,214,214,214,214,214,214,214,
+217,217,217,217,217,217,217,217,217,217,211,211,211,211,216,216,
+110,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
/* block 13 */
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,196,200,199,199,199,199,199,199,199, 22,198,199,
-199,199,199,199,199,202,202,199,199,198,199,199,199,199,200,200,
-201,201,201,201,201,201,201,201,201,201,200,200,200,198,198,200,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,211,216,214,214,214,214,214,214,214,209,213,214,
+214,214,214,214,214,218,218,214,214,213,214,214,214,214,216,216,
+217,217,217,217,217,217,217,217,217,217,216,216,216,213,213,216,
/* block 14 */
-203,203,203,203,203,203,203,203,203,203,203,203,203,203,115,204,
-205,206,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
-205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
-206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,
-206,206,206,206,206,206,206,206,206,206,206,115,115,205,205,205,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+219,219,219,219,219,219,219,219,219,219,219,219,219,219,115,220,
+221,222,221,221,221,221,221,221,221,221,221,221,221,221,221,221,
+221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,
+222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,
+222,222,222,222,222,222,222,222,222,222,222,115,115,221,221,221,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
/* block 15 */
-207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,
-207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,
-207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,208,
-208,207,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,
-210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,
-210,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,
-211,211,211,211,212,212,213,214,214,214,212,115,115,115,115,115,
+223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,
+223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,
+223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,
+224,223,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,
+226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,
+226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,
+227,227,227,227,228,228,229,230,230,230,228,115,115,115,115,115,
/* block 16 */
-215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
-215,215,215,215,215,215,216,216,216,216,217,216,216,216,216,216,
-216,216,216,216,217,216,216,216,217,216,216,216,216,216,115,115,
-218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,115,
-219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
-219,219,219,219,219,219,219,219,219,220,220,220,115,115,221,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,
+231,231,231,231,231,231,232,232,232,232,233,232,232,232,232,232,
+232,232,232,232,233,232,232,232,233,232,232,232,232,232,115,115,
+234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,115,
+235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
+235,235,235,235,235,235,235,235,235,236,236,236,115,115,237,115,
+221,221,221,221,221,221,221,221,221,221,221,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 17 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,115,115,115,115,115,115,115,115,115,115,115,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,115,216,216,216,216,216,216,216,216,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,199,199,199,199,199,199,199,199,199,199,199,199,199,
-199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
+115,115,115,115,214,214,214,214,214,214,214,214,214,214,214,214,
+214,214,209,214,214,214,214,214,214,214,214,214,214,214,214,214,
+214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,
/* block 18 */
-222,222,222,223,224,224,224,224,224,224,224,224,224,224,224,224,
-224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
-224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
-224,224,224,224,224,224,224,224,224,224,222,223,222,224,223,223,
-223,222,222,222,222,222,222,222,222,223,223,223,223,222,223,223,
-224,110,110,222,222,222,222,222,224,224,224,224,224,224,224,224,
-224,224,222,222, 4, 4,225,225,225,225,225,225,225,225,225,225,
-226,227,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
+238,238,238,239,240,240,240,240,240,240,240,240,240,240,240,240,
+240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
+240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
+240,240,240,240,240,240,240,240,240,240,238,239,238,240,239,239,
+239,238,238,238,238,238,238,238,238,239,239,239,239,238,239,239,
+240,110,110,238,238,238,238,238,240,240,240,240,240,240,240,240,
+240,240,238,238, 4, 4,241,241,241,241,241,241,241,241,241,241,
+242,243,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
/* block 19 */
-228,229,230,230,115,228,228,228,228,228,228,228,228,115,115,228,
-228,115,115,228,228,228,228,228,228,228,228,228,228,228,228,228,
-228,228,228,228,228,228,228,228,228,115,228,228,228,228,228,228,
-228,115,228,115,115,115,228,228,228,228,115,115,229,228,231,230,
-230,229,229,229,229,115,115,230,230,115,115,230,230,229,228,115,
-115,115,115,115,115,115,115,231,115,115,115,115,228,228,115,228,
-228,228,229,229,115,115,232,232,232,232,232,232,232,232,232,232,
-228,228,233,233,234,234,234,234,234,234,235,233,115,115,115,115,
+244,245,246,246,115,244,244,244,244,244,244,244,244,115,115,244,
+244,115,115,244,244,244,244,244,244,244,244,244,244,244,244,244,
+244,244,244,244,244,244,244,244,244,115,244,244,244,244,244,244,
+244,115,244,115,115,115,244,244,244,244,115,115,245,244,247,246,
+246,245,245,245,245,115,115,246,246,115,115,246,246,245,244,115,
+115,115,115,115,115,115,115,247,115,115,115,115,244,244,115,244,
+244,244,245,245,115,115,248,248,248,248,248,248,248,248,248,248,
+244,244,249,249,250,250,250,250,250,250,251,249,244,252,115,115,
/* block 20 */
-115,236,236,237,115,238,238,238,238,238,238,115,115,115,115,238,
-238,115,115,238,238,238,238,238,238,238,238,238,238,238,238,238,
-238,238,238,238,238,238,238,238,238,115,238,238,238,238,238,238,
-238,115,238,238,115,238,238,115,238,238,115,115,236,115,237,237,
-237,236,236,115,115,115,115,236,236,115,115,236,236,236,115,115,
-115,236,115,115,115,115,115,115,115,238,238,238,238,115,238,115,
-115,115,115,115,115,115,239,239,239,239,239,239,239,239,239,239,
-236,236,238,238,238,236,115,115,115,115,115,115,115,115,115,115,
+115,253,253,254,115,255,255,255,255,255,255,115,115,115,115,255,
+255,115,115,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,115,255,255,255,255,255,255,
+255,115,255,255,115,255,255,115,255,255,115,115,253,115,254,254,
+254,253,253,115,115,115,115,253,253,115,115,253,253,253,115,115,
+115,253,115,115,115,115,115,115,115,255,255,255,255,115,255,115,
+115,115,115,115,115,115,256,256,256,256,256,256,256,256,256,256,
+253,253,255,255,255,253,115,115,115,115,115,115,115,115,115,115,
/* block 21 */
-115,240,240,241,115,242,242,242,242,242,242,242,242,242,115,242,
-242,242,115,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,115,242,242,242,242,242,242,
-242,115,242,242,115,242,242,242,242,242,115,115,240,242,241,241,
-241,240,240,240,240,240,115,240,240,241,115,241,241,240,115,115,
-242,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-242,242,240,240,115,115,243,243,243,243,243,243,243,243,243,243,
-244,245,115,115,115,115,115,115,115,242,115,115,115,115,115,115,
+115,257,257,258,115,259,259,259,259,259,259,259,259,259,115,259,
+259,259,115,259,259,259,259,259,259,259,259,259,259,259,259,259,
+259,259,259,259,259,259,259,259,259,115,259,259,259,259,259,259,
+259,115,259,259,115,259,259,259,259,259,115,115,257,259,258,258,
+258,257,257,257,257,257,115,257,257,258,115,258,258,257,115,115,
+259,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+259,259,257,257,115,115,260,260,260,260,260,260,260,260,260,260,
+261,262,115,115,115,115,115,115,115,259,257,257,257,257,257,257,
/* block 22 */
-115,246,247,247,115,248,248,248,248,248,248,248,248,115,115,248,
-248,115,115,248,248,248,248,248,248,248,248,248,248,248,248,248,
-248,248,248,248,248,248,248,248,248,115,248,248,248,248,248,248,
-248,115,248,248,115,248,248,248,248,248,115,115,246,248,249,246,
-247,246,246,246,246,115,115,247,247,115,115,247,247,246,115,115,
-115,115,115,115,115,115,246,249,115,115,115,115,248,248,115,248,
-248,248,246,246,115,115,250,250,250,250,250,250,250,250,250,250,
-251,248,252,252,252,252,252,252,115,115,115,115,115,115,115,115,
+115,263,264,264,115,265,265,265,265,265,265,265,265,115,115,265,
+265,115,115,265,265,265,265,265,265,265,265,265,265,265,265,265,
+265,265,265,265,265,265,265,265,265,115,265,265,265,265,265,265,
+265,115,265,265,115,265,265,265,265,265,115,115,263,265,266,263,
+264,263,263,263,263,115,115,264,264,115,115,264,264,263,115,115,
+115,115,115,115,115,115,263,266,115,115,115,115,265,265,115,265,
+265,265,263,263,115,115,267,267,267,267,267,267,267,267,267,267,
+268,265,269,269,269,269,269,269,115,115,115,115,115,115,115,115,
/* block 23 */
-115,115,253,254,115,254,254,254,254,254,254,115,115,115,254,254,
-254,115,254,254,254,254,115,115,115,254,254,115,254,115,254,254,
-115,115,115,254,254,115,115,115,254,254,254,115,115,115,254,254,
-254,254,254,254,254,254,254,254,254,254,115,115,115,115,255,256,
-253,256,256,115,115,115,256,256,256,115,256,256,256,253,115,115,
-254,115,115,115,115,115,115,255,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,257,257,257,257,257,257,257,257,257,257,
-258,258,258,259,259,259,259,259,259,260,259,115,115,115,115,115,
+115,115,270,271,115,271,271,271,271,271,271,115,115,115,271,271,
+271,115,271,271,271,271,115,115,115,271,271,115,271,115,271,271,
+115,115,115,271,271,115,115,115,271,271,271,115,115,115,271,271,
+271,271,271,271,271,271,271,271,271,271,115,115,115,115,272,273,
+270,273,273,115,115,115,273,273,273,115,273,273,273,270,115,115,
+271,115,115,115,115,115,115,272,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,274,274,274,274,274,274,274,274,274,274,
+275,275,275,276,276,276,276,276,276,277,276,115,115,115,115,115,
/* block 24 */
-261,262,262,262,115,263,263,263,263,263,263,263,263,115,263,263,
-263,115,263,263,263,263,263,263,263,263,263,263,263,263,263,263,
-263,263,263,263,263,263,263,263,263,115,263,263,263,263,263,263,
-263,263,263,263,263,263,263,263,263,263,115,115,115,263,261,261,
-261,262,262,262,262,115,261,261,261,115,261,261,261,261,115,115,
-115,115,115,115,115,261,261,115,263,263,263,115,115,115,115,115,
-263,263,261,261,115,115,264,264,264,264,264,264,264,264,264,264,
-115,115,115,115,115,115,115,115,265,265,265,265,265,265,265,266,
+278,279,279,279,115,280,280,280,280,280,280,280,280,115,280,280,
+280,115,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
+280,280,280,280,280,280,280,280,280,115,280,280,280,280,280,280,
+280,280,280,280,280,280,280,280,280,280,115,115,115,280,278,278,
+278,279,279,279,279,115,278,278,278,115,278,278,278,278,115,115,
+115,115,115,115,115,278,278,115,280,280,280,115,115,115,115,115,
+280,280,278,278,115,115,281,281,281,281,281,281,281,281,281,281,
+115,115,115,115,115,115,115,115,282,282,282,282,282,282,282,283,
/* block 25 */
-115,267,268,268,115,269,269,269,269,269,269,269,269,115,269,269,
-269,115,269,269,269,269,269,269,269,269,269,269,269,269,269,269,
-269,269,269,269,269,269,269,269,269,115,269,269,269,269,269,269,
-269,269,269,269,115,269,269,269,269,269,115,115,267,269,268,267,
-268,268,270,268,268,115,267,268,268,115,268,268,267,267,115,115,
-115,115,115,115,115,270,270,115,115,115,115,115,115,115,269,115,
-269,269,267,267,115,115,271,271,271,271,271,271,271,271,271,271,
-115,269,269,115,115,115,115,115,115,115,115,115,115,115,115,115,
+284,285,286,286,115,284,284,284,284,284,284,284,284,115,284,284,
+284,115,284,284,284,284,284,284,284,284,284,284,284,284,284,284,
+284,284,284,284,284,284,284,284,284,115,284,284,284,284,284,284,
+284,284,284,284,115,284,284,284,284,284,115,115,285,284,286,285,
+286,286,287,286,286,115,285,286,286,115,286,286,285,285,115,115,
+115,115,115,115,115,287,287,115,115,115,115,115,115,115,284,115,
+284,284,285,285,115,115,288,288,288,288,288,288,288,288,288,288,
+115,284,284,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 26 */
-115,272,273,273,115,274,274,274,274,274,274,274,274,115,274,274,
-274,115,274,274,274,274,274,274,274,274,274,274,274,274,274,274,
-274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,274,
-274,274,274,274,274,274,274,274,274,274,274,115,115,274,275,273,
-273,272,272,272,272,115,273,273,273,115,273,273,273,272,274,115,
-115,115,115,115,115,115,115,275,115,115,115,115,115,115,115,274,
-274,274,272,272,115,115,276,276,276,276,276,276,276,276,276,276,
-277,277,277,277,277,277,115,115,115,278,274,274,274,274,274,274,
+289,289,290,290,115,291,291,291,291,291,291,291,291,115,291,291,
+291,115,291,291,291,291,291,291,291,291,291,291,291,291,291,291,
+291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,
+291,291,291,291,291,291,291,291,291,291,291,289,289,291,292,290,
+290,289,289,289,289,115,290,290,290,115,290,290,290,289,293,294,
+115,115,115,115,291,291,291,292,295,295,295,295,295,295,295,291,
+291,291,289,289,115,115,296,296,296,296,296,296,296,296,296,296,
+295,295,295,295,295,295,295,295,295,294,291,291,291,291,291,291,
/* block 27 */
-115,115,279,279,115,280,280,280,280,280,280,280,280,280,280,280,
-280,280,280,280,280,280,280,115,115,115,280,280,280,280,280,280,
-280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
-280,280,115,280,280,280,280,280,280,280,280,280,115,280,115,115,
-280,280,280,280,280,280,280,115,115,115,281,115,115,115,115,282,
-279,279,281,281,281,115,281,115,279,279,279,279,279,279,279,282,
-115,115,115,115,115,115,283,283,283,283,283,283,283,283,283,283,
-115,115,279,279,284,115,115,115,115,115,115,115,115,115,115,115,
+115,115,297,297,115,298,298,298,298,298,298,298,298,298,298,298,
+298,298,298,298,298,298,298,115,115,115,298,298,298,298,298,298,
+298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,
+298,298,115,298,298,298,298,298,298,298,298,298,115,298,115,115,
+298,298,298,298,298,298,298,115,115,115,299,115,115,115,115,300,
+297,297,299,299,299,115,299,115,297,297,297,297,297,297,297,300,
+115,115,115,115,115,115,301,301,301,301,301,301,301,301,301,301,
+115,115,297,297,302,115,115,115,115,115,115,115,115,115,115,115,
/* block 28 */
-115,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,
-285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,
-285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,
-285,286,285,287,286,286,286,286,286,286,286,115,115,115,115, 5,
-285,285,285,285,285,285,288,286,286,286,286,286,286,286,286,289,
-290,290,290,290,290,290,290,290,290,290,289,289,115,115,115,115,
+115,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,
+303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,
+303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,
+303,304,303,305,304,304,304,304,304,304,304,115,115,115,115, 5,
+303,303,303,303,303,303,306,304,304,304,304,304,304,304,304,307,
+308,308,308,308,308,308,308,308,308,308,307,307,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 29 */
-115,291,291,115,291,115,115,291,291,115,291,115,115,291,115,115,
-115,115,115,115,291,291,291,291,115,291,291,291,291,291,291,291,
-115,291,291,291,115,291,115,291,115,115,291,291,115,291,291,291,
-291,292,291,293,292,292,292,292,292,292,115,292,292,291,115,115,
-291,291,291,291,291,115,294,115,292,292,292,292,292,292,115,115,
-295,295,295,295,295,295,295,295,295,295,115,115,291,291,291,291,
+115,309,309,115,309,115,115,309,309,115,309,115,115,309,115,115,
+115,115,115,115,309,309,309,309,115,309,309,309,309,309,309,309,
+115,309,309,309,115,309,115,309,115,115,309,309,115,309,309,309,
+309,310,309,311,310,310,310,310,310,310,115,310,310,309,115,115,
+309,309,309,309,309,115,312,115,310,310,310,310,310,310,115,115,
+313,313,313,313,313,313,313,313,313,313,115,115,309,309,309,309,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 30 */
-296,297,297,297,298,298,298,298,298,298,298,298,298,298,298,298,
-298,298,298,297,298,297,297,297,299,299,297,297,297,297,297,297,
-300,300,300,300,300,300,300,300,300,300,301,301,301,301,301,301,
-301,301,301,301,297,299,297,299,297,299,302,303,302,303,304,304,
-296,296,296,296,296,296,296,296,115,296,296,296,296,296,296,296,
-296,296,296,296,296,296,296,296,296,296,296,296,296,296,296,296,
-296,296,296,296,296,296,296,296,296,296,296,296,296,115,115,115,
-115,299,299,299,299,299,299,299,299,299,299,299,299,299,299,304,
+314,315,315,315,316,316,316,316,316,316,316,316,316,316,316,316,
+316,316,316,315,316,315,315,315,317,317,315,315,315,315,315,315,
+318,318,318,318,318,318,318,318,318,318,319,319,319,319,319,319,
+319,319,319,319,315,317,315,317,315,317,320,321,320,321,322,322,
+314,314,314,314,314,314,314,314,115,314,314,314,314,314,314,314,
+314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,
+314,314,314,314,314,314,314,314,314,314,314,314,314,115,115,115,
+115,317,317,317,317,317,317,317,317,317,317,317,317,317,317,322,
/* block 31 */
-299,299,299,299,299,298,299,299,296,296,296,296,296,299,299,299,
-299,299,299,299,299,299,299,299,115,299,299,299,299,299,299,299,
-299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,
-299,299,299,299,299,299,299,299,299,299,299,299,299,115,297,297,
-297,297,297,297,297,297,299,297,297,297,297,297,297,115,297,297,
-298,298,298,298,298, 19, 19, 19, 19,298,298,115,115,115,115,115,
+317,317,317,317,317,316,317,317,314,314,314,314,314,317,317,317,
+317,317,317,317,317,317,317,317,115,317,317,317,317,317,317,317,
+317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
+317,317,317,317,317,317,317,317,317,317,317,317,317,115,315,315,
+315,315,315,315,315,315,317,315,315,315,315,315,315,115,315,315,
+316,316,316,316,316, 19, 19, 19, 19,316,316,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 32 */
-305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
-305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
-305,305,305,305,305,305,305,305,305,305,305,306,306,307,307,307,
-307,308,307,307,307,307,307,307,306,307,307,308,308,307,307,305,
-309,309,309,309,309,309,309,309,309,309,310,310,310,310,310,310,
-305,305,305,305,305,305,308,308,307,307,305,305,305,305,307,307,
-307,305,306,306,306,305,305,306,306,306,306,306,306,306,305,305,
-305,307,307,307,307,305,305,305,305,305,305,305,305,305,305,305,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+323,323,323,323,323,323,323,323,323,323,323,324,324,325,325,325,
+325,326,325,325,325,325,325,325,324,325,325,326,326,325,325,323,
+327,327,327,327,327,327,327,327,327,327,328,328,328,328,328,328,
+323,323,323,323,323,323,326,326,325,325,323,323,323,323,325,325,
+325,323,324,324,324,323,323,324,324,324,324,324,324,324,323,323,
+323,325,325,325,325,323,323,323,323,323,323,323,323,323,323,323,
/* block 33 */
-305,305,307,306,308,307,307,306,306,306,306,306,306,307,305,306,
-309,309,309,309,309,309,309,309,309,309,306,306,306,307,311,311,
-312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,
-312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,
-312,312,312,312,312,312,115,312,115,115,115,115,115,312,115,115,
-313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,
-313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,
-313,313,313,313,313,313,313,313,313,313,313, 4,314,313,313,313,
+323,323,325,324,326,325,325,324,324,324,324,324,324,325,323,324,
+327,327,327,327,327,327,327,327,327,327,324,324,324,325,329,329,
+330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
+330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
+330,330,330,330,330,330,115,330,115,115,115,115,115,330,115,115,
+331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,
+331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,
+331,331,331,331,331,331,331,331,331,331,331, 4,332,331,331,331,
/* block 34 */
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
+334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
/* block 35 */
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
-316,316,316,316,316,316,316,316,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
+334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
+334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
+334,334,334,334,334,334,334,334,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
/* block 36 */
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,115,318,318,318,318,115,115,
-318,318,318,318,318,318,318,115,318,115,318,318,318,318,115,115,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,115,336,336,336,336,115,115,
+336,336,336,336,336,336,336,115,336,115,336,336,336,336,115,115,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
/* block 37 */
-318,318,318,318,318,318,318,318,318,115,318,318,318,318,115,115,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,115,318,318,318,318,115,115,318,318,318,318,318,318,318,115,
-318,115,318,318,318,318,115,115,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
+336,336,336,336,336,336,336,336,336,115,336,336,336,336,115,115,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,115,336,336,336,336,115,115,336,336,336,336,336,336,336,115,
+336,115,336,336,336,336,115,115,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
/* block 38 */
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,115,318,318,318,318,115,115,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,318,318,318,318,115,115,319,319,319,
-320,320,320,320,320,320,320,320,320,321,321,321,321,321,321,321,
-321,321,321,321,321,321,321,321,321,321,321,321,321,115,115,115,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,115,336,336,336,336,115,115,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,115,115,337,337,337,
+338,338,338,338,338,338,338,338,338,339,339,339,339,339,339,339,
+339,339,339,339,339,339,339,339,339,339,339,339,339,115,115,115,
/* block 39 */
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-322,322,322,322,322,322,322,322,322,322,115,115,115,115,115,115,
-323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
-323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
-323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
-323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
-323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
-324,324,324,324,324,324,115,115,325,325,325,325,325,325,115,115,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+340,340,340,340,340,340,340,340,340,340,115,115,115,115,115,115,
+341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,
+341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,
+341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,
+341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,
+341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,
+342,342,342,342,342,342,115,115,343,343,343,343,343,343,115,115,
/* block 40 */
-326,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+344,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
/* block 41 */
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
/* block 42 */
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,328,328,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,346,346,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
/* block 43 */
-329,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,
-330,330,330,330,330,330,330,330,330,330,330,331,332,115,115,115,
-333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
-333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
-333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
-333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
-333,333,333,333,333,333,333,333,333,333,333, 4, 4, 4,334,334,
-334,333,333,333,333,333,333,333,333,115,115,115,115,115,115,115,
+347,348,348,348,348,348,348,348,348,348,348,348,348,348,348,348,
+348,348,348,348,348,348,348,348,348,348,348,349,350,115,115,115,
+351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,
+351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,
+351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,
+351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,
+351,351,351,351,351,351,351,351,351,351,351, 4, 4, 4,352,352,
+352,351,351,351,351,351,351,351,351,115,115,115,115,115,115,115,
/* block 44 */
-335,335,335,335,335,335,335,335,335,335,335,335,335,115,335,335,
-335,335,336,336,336,115,115,115,115,115,115,115,115,115,115,115,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,338,338,338, 4, 4,115,115,115,115,115,115,115,115,115,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,340,340,115,115,115,115,115,115,115,115,115,115,115,115,
-341,341,341,341,341,341,341,341,341,341,341,341,341,115,341,341,
-341,115,342,342,115,115,115,115,115,115,115,115,115,115,115,115,
+353,353,353,353,353,353,353,353,353,353,353,353,353,115,353,353,
+353,353,354,354,354,115,115,115,115,115,115,115,115,115,115,115,
+355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,
+355,355,356,356,356, 4, 4,115,115,115,115,115,115,115,115,115,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,358,358,115,115,115,115,115,115,115,115,115,115,115,115,
+359,359,359,359,359,359,359,359,359,359,359,359,359,115,359,359,
+359,115,360,360,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 45 */
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,
-343,343,343,343,344,344,345,344,344,344,344,344,344,344,345,345,
-345,345,345,345,345,345,344,345,345,344,344,344,344,344,344,344,
-344,344,344,344,346,346,346,347,346,346,346,348,343,344,115,115,
-349,349,349,349,349,349,349,349,349,349,115,115,115,115,115,115,
-350,350,350,350,350,350,350,350,350,350,115,115,115,115,115,115,
+361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
+361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
+361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
+361,361,361,361,362,362,363,362,362,362,362,362,362,362,363,363,
+363,363,363,363,363,363,362,363,363,362,362,362,362,362,362,362,
+362,362,362,362,364,364,364,365,364,364,364,366,361,362,115,115,
+367,367,367,367,367,367,367,367,367,367,115,115,115,115,115,115,
+368,368,368,368,368,368,368,368,368,368,115,115,115,115,115,115,
/* block 46 */
-351,351, 4, 4,351, 4,352,351,351,351,351,353,353,353,354,115,
-355,355,355,355,355,355,355,355,355,355,115,115,115,115,115,115,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,357,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,115,115,115,115,115,115,115,115,
+369,369, 4, 4,369, 4,370,369,369,369,369,371,371,371,372,115,
+373,373,373,373,373,373,373,373,373,373,115,115,115,115,115,115,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,375,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,115,115,115,115,115,115,115,115,
/* block 47 */
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,
-356,356,356,356,356,356,356,356,356,353,356,115,115,115,115,115,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,327,327,327,115,115,115,115,115,115,115,115,115,115,
+374,374,374,374,374,371,371,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
+374,374,374,374,374,374,374,374,374,371,374,115,115,115,115,115,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,115,115,115,115,115,115,115,115,115,115,
/* block 48 */
-358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,
-358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,115,
-359,359,359,360,360,360,360,359,359,360,360,360,115,115,115,115,
-360,360,359,360,360,360,360,360,360,359,359,359,115,115,115,115,
-361,115,115,115,362,362,363,363,363,363,363,363,363,363,363,363,
-364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,
-364,364,364,364,364,364,364,364,364,364,364,364,364,364,115,115,
-364,364,364,364,364,115,115,115,115,115,115,115,115,115,115,115,
+376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,
+376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,115,
+377,377,377,378,378,378,378,377,377,378,378,378,115,115,115,115,
+378,378,377,378,378,378,378,378,378,377,377,377,115,115,115,115,
+379,115,115,115,380,380,381,381,381,381,381,381,381,381,381,381,
+382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,
+382,382,382,382,382,382,382,382,382,382,382,382,382,382,115,115,
+382,382,382,382,382,115,115,115,115,115,115,115,115,115,115,115,
/* block 49 */
-365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,
-365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,
-365,365,365,365,365,365,365,365,365,365,365,365,115,115,115,115,
-365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,
-365,365,365,365,365,365,365,365,365,365,115,115,115,115,115,115,
-366,366,366,366,366,366,366,366,366,366,367,115,115,115,368,368,
-369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,
-369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,
+383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
+383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
+383,383,383,383,383,383,383,383,383,383,383,383,115,115,115,115,
+383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
+383,383,383,383,383,383,383,383,383,383,115,115,115,115,115,115,
+384,384,384,384,384,384,384,384,384,384,385,115,115,115,386,386,
+387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
+387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
/* block 50 */
-370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,
-370,370,370,370,370,370,370,371,371,372,372,371,115,115,373,373,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,
-374,374,374,374,374,375,376,375,376,376,376,376,376,376,376,115,
-376,377,376,377,377,376,376,376,376,376,376,376,376,375,375,375,
-375,375,375,376,376,376,376,376,376,376,376,376,376,115,115,376,
+388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,
+388,388,388,388,388,388,388,389,389,390,390,389,115,115,391,391,
+392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
+392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
+392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
+392,392,392,392,392,393,394,393,394,394,394,394,394,394,394,115,
+394,395,394,395,395,394,394,394,394,394,394,394,394,393,393,393,
+393,393,393,394,394,394,394,394,394,394,394,394,394,115,115,394,
/* block 51 */
-378,378,378,378,378,378,378,378,378,378,115,115,115,115,115,115,
-378,378,378,378,378,378,378,378,378,378,115,115,115,115,115,115,
-379,379,379,379,379,379,379,380,379,379,379,379,379,379,115,115,
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,381,115,
+396,396,396,396,396,396,396,396,396,396,115,115,115,115,115,115,
+396,396,396,396,396,396,396,396,396,396,115,115,115,115,115,115,
+397,397,397,397,397,397,397,398,397,397,397,397,397,397,115,115,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,399,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 52 */
-382,382,382,382,383,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,
-384,384,384,384,382,383,382,382,382,382,382,383,382,383,383,383,
-383,383,382,383,383,384,384,384,384,384,384,384,115,115,115,115,
-385,385,385,385,385,385,385,385,385,385,386,386,386,386,386,386,
-386,387,387,387,387,387,387,387,387,387,387,382,382,382,382,382,
-382,382,382,382,387,387,387,387,387,387,387,387,387,115,115,115,
+400,400,400,400,401,402,402,402,402,402,402,402,402,402,402,402,
+402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
+402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
+402,402,402,402,400,401,400,400,400,400,400,401,400,401,401,401,
+401,401,400,401,401,402,402,402,402,402,402,402,115,115,115,115,
+403,403,403,403,403,403,403,403,403,403,404,404,404,404,404,404,
+404,405,405,405,405,405,405,405,405,405,405,400,400,400,400,400,
+400,400,400,400,405,405,405,405,405,405,405,405,405,115,115,115,
/* block 53 */
-388,388,389,390,390,390,390,390,390,390,390,390,390,390,390,390,
-390,390,390,390,390,390,390,390,390,390,390,390,390,390,390,390,
-390,389,388,388,388,388,389,389,388,388,389,388,388,388,390,390,
-391,391,391,391,391,391,391,391,391,391,390,390,390,390,390,390,
-392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
-392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
-392,392,392,392,392,392,393,394,393,393,394,394,394,393,394,393,
-393,393,394,394,115,115,115,115,115,115,115,115,395,395,395,395,
+406,406,407,408,408,408,408,408,408,408,408,408,408,408,408,408,
+408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,
+408,407,406,406,406,406,407,407,406,406,407,406,406,406,408,408,
+409,409,409,409,409,409,409,409,409,409,408,408,408,408,408,408,
+410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,
+410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,
+410,410,410,410,410,410,411,412,411,411,412,412,412,411,412,411,
+411,411,412,412,115,115,115,115,115,115,115,115,413,413,413,413,
/* block 54 */
-396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,
-396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,
-396,396,396,396,397,397,397,397,397,397,397,397,398,398,398,398,
-398,398,398,398,397,397,398,398,115,115,115,399,399,399,399,399,
-400,400,400,400,400,400,400,400,400,400,115,115,115,396,396,396,
-401,401,401,401,401,401,401,401,401,401,402,402,402,402,402,402,
-402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,
-402,402,402,402,402,402,402,402,403,403,403,403,403,403,404,404,
+414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
+414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
+414,414,414,414,415,415,415,415,415,415,415,415,416,416,416,416,
+416,416,416,416,415,415,416,416,115,115,115,417,417,417,417,417,
+418,418,418,418,418,418,418,418,418,418,115,115,115,414,414,414,
+419,419,419,419,419,419,419,419,419,419,420,420,420,420,420,420,
+420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,
+420,420,420,420,420,420,420,420,421,421,421,421,421,421,422,422,
/* block 55 */
+423,424,425,426,427,428,429,430,431,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-405,405,405,405,405,405,405,405,115,115,115,115,115,115,115,115,
+432,432,432,432,432,432,432,432,115,115,115,115,115,115,115,115,
110,110,110, 4,110,110,110,110,110,110,110,110,110,110,110,110,
-110,406,110,110,110,110,110,110,110,407,407,407,407,110,407,407,
-407,407,406,406,110,407,407,115,110,110,115,115,115,115,115,115,
+110,433,110,110,110,110,110,110,110,434,434,434,434,110,434,434,
+434,434,433,433,110,434,434,433,110,110,115,115,115,115,115,115,
/* block 56 */
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33,123,123,123,123,123,408,107,107,107,107,
+ 33, 33, 33, 33, 33, 33,123,123,123,123,123,435,107,107,107,107,
107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,
107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,
107,107,107,107,107,107,107,107,107,107,107,107,107,116,116,116,
116,116,107,107,107,107,116,116,116,116,116, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33,409,410, 33, 33, 33,411, 33, 33,
+ 33, 33, 33, 33, 33, 33, 33, 33,436,437, 33, 33, 33,438, 33, 33,
/* block 57 */
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
@@ -1955,7 +2054,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
-110,110,110,110,110,110,115,115,115,115,115,115,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,115,110,110,110,110,110,
/* block 58 */
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
@@ -1964,12 +2063,12 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
-412,413, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
+439,440, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
/* block 59 */
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
- 30, 31, 30, 31, 30, 31, 33, 33, 33, 33, 33,414, 33, 33,415, 33,
+ 30, 31, 30, 31, 30, 31, 33, 33, 33, 33, 33,441, 33, 33,442, 33,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
@@ -1978,57 +2077,57 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
/* block 60 */
-416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
-416,416,416,416,416,416,115,115,417,417,417,417,417,417,115,115,
-416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
-416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
-416,416,416,416,416,416,115,115,417,417,417,417,417,417,115,115,
-123,416,123,416,123,416,123,416,115,417,115,417,115,417,115,417,
-416,416,416,416,416,416,416,416,417,417,417,417,417,417,417,417,
-418,418,419,419,419,419,420,420,421,421,422,422,423,423,115,115,
+443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444,
+443,443,443,443,443,443,115,115,444,444,444,444,444,444,115,115,
+443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444,
+443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444,
+443,443,443,443,443,443,115,115,444,444,444,444,444,444,115,115,
+123,443,123,443,123,443,123,443,115,444,115,444,115,444,115,444,
+443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444,
+445,445,446,446,446,446,447,447,448,448,449,449,450,450,115,115,
/* block 61 */
-416,416,416,416,416,416,416,416,424,424,424,424,424,424,424,424,
-416,416,416,416,416,416,416,416,424,424,424,424,424,424,424,424,
-416,416,416,416,416,416,416,416,424,424,424,424,424,424,424,424,
-416,416,123,425,123,115,123,123,417,417,426,426,427,114,428,114,
-114,114,123,425,123,115,123,123,429,429,429,429,427,114,114,114,
-416,416,123,123,115,115,123,123,417,417,430,430,115,114,114,114,
-416,416,123,123,123,164,123,123,417,417,431,431,169,114,114,114,
-115,115,123,425,123,115,123,123,432,432,433,433,427,114,114,115,
+443,443,443,443,443,443,443,443,451,451,451,451,451,451,451,451,
+443,443,443,443,443,443,443,443,451,451,451,451,451,451,451,451,
+443,443,443,443,443,443,443,443,451,451,451,451,451,451,451,451,
+443,443,123,452,123,115,123,123,444,444,453,453,454,114,455,114,
+114,114,123,452,123,115,123,123,456,456,456,456,454,114,114,114,
+443,443,123,123,115,115,123,123,444,444,457,457,115,114,114,114,
+443,443,123,123,123,164,123,123,444,444,458,458,169,114,114,114,
+115,115,123,452,123,115,123,123,459,459,460,460,454,114,114,115,
/* block 62 */
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 22,434,434, 22, 22,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 22,461,462, 22, 22,
9, 9, 9, 9, 9, 9, 4, 4, 21, 25, 6, 21, 21, 25, 6, 21,
- 4, 4, 4, 4, 4, 4, 4, 4,435,436, 22, 22, 22, 22, 22, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4,463,464, 22, 22, 22, 22, 22, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 21, 25, 4, 4, 4, 4, 15,
15, 4, 4, 4, 8, 6, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 8, 4, 15, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3,
- 22, 22, 22, 22, 22,437, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22,465, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
23,107,115,115, 23, 23, 23, 23, 23, 23, 8, 8, 8, 6, 7,107,
/* block 63 */
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 8, 8, 8, 6, 7,115,
107,107,107,107,107,107,107,107,107,107,107,107,107,115,115,115,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,115,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-110,110,110,110,110,110,110,110,110,110,110,110,110,381,381,381,
-381,110,381,381,381,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,399,399,399,
+399,110,399,399,399,110,110,110,110,110,110,110,110,110,110,110,
110,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 64 */
- 19, 19,438, 19, 19, 19, 19,438, 19, 19,439,438,438,438,439,439,
-438,438,438,439, 19,438, 19, 19, 8,438,438,438,438,438, 19, 19,
- 19, 19, 19, 19,438, 19,440, 19,438, 19,441,442,438,438, 19,439,
-438,438,443,438,439,407,407,407,407,439, 19, 19,439,439,438,438,
- 8, 8, 8, 8, 8,438,439,439,439,439, 19, 8, 19, 19,444, 19,
+ 19, 19,466, 19, 19, 19, 19,466, 19, 19,467,466,466,466,467,467,
+466,466,466,467, 19,466, 19, 19, 8,466,466,466,466,466, 19, 19,
+ 19, 19, 19, 19,466, 19,468, 19,466, 19,469,470,466,466, 19,467,
+466,466,471,466,467,434,434,434,434,467, 19, 19,467,467,466,466,
+ 8, 8, 8, 8, 8,466,467,467,467,467, 19, 8, 19, 19,472, 19,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,
-446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,
+473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,
/* block 65 */
-447,447,447, 30, 31,447,447,447,447, 23, 19, 19,115,115,115,115,
+475,475,475, 30, 31,475,475,475,475, 23, 19, 19,115,115,115,115,
8, 8, 8, 8, 8, 19, 19, 19, 19, 19, 8, 8, 19, 19, 19, 19,
8, 19, 19, 8, 19, 19, 8, 19, 19, 19, 19, 19, 19, 19, 8, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -2065,7 +2164,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8,
8, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
/* block 69 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -2081,10 +2180,10 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19,448,448,448,448,448,448,448,448,448,448,
-448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,
-449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,
-449,449,449,449,449,449,449,449,449,449, 23, 23, 23, 23, 23, 23,
+ 19, 19, 19, 19, 19, 19,476,476,476,476,476,476,476,476,476,476,
+476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,
+477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
+477,477,477,477,477,477,477,477,477,477, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* block 71 */
@@ -2109,25 +2208,35 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
/* block 73 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+479, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
/* block 74 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19,479,479, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7,
- 6, 7, 6, 7, 6, 7, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, 19,
/* block 75 */
+ 19, 19, 19, 19, 19, 19, 19, 19,479, 19,478,478,478,478, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,479, 19, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7,
+ 6, 7, 6, 7, 6, 7, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+
+/* block 76 */
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -2137,17 +2246,17 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
8, 8, 8, 8, 8, 8, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-/* block 76 */
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,
-
/* block 77 */
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
+
+/* block 78 */
8, 8, 8, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6,
7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
@@ -2157,7 +2266,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 8, 8,
-/* block 78 */
+/* block 79 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -2167,257 +2276,257 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 79 */
+/* block 80 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19,115, 19, 19, 19, 19, 19, 19,
- 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115, 19, 19, 19, 19,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 80 */
-451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,
-451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,
-451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,115,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,
-452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,115,
- 30, 31,453,454,455,456,457, 30, 31, 30, 31, 30, 31,458,459,460,
-461, 33, 30, 31, 33, 30, 31, 33, 33, 33, 33, 33,107,107,462,462,
-
/* block 81 */
+481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
+481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
+481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,115,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,115,
+ 30, 31,483,484,485,486,487, 30, 31, 30, 31, 30, 31,488,489,490,
+491, 33, 30, 31, 33, 30, 31, 33, 33, 33, 33, 33,107,107,492,492,
+
+/* block 82 */
160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161,
-160,161,160,161,463,464,464,464,464,464,464,160,161,160,161,465,
-465,465,160,161,115,115,115,115,115,466,466,466,466,467,466,466,
-
-/* block 82 */
-468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
-468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
-468,468,468,468,468,468,115,468,115,115,115,115,115,468,115,115,
-469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,
-469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,
-469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,
-469,469,469,469,469,469,469,469,115,115,115,115,115,115,115,470,
-471,115,115,115,115,115,115,115,115,115,115,115,115,115,115,472,
+160,161,160,161,493,494,494,494,494,494,494,160,161,160,161,495,
+495,495,160,161,115,115,115,115,115,496,496,496,496,497,496,496,
/* block 83 */
-318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,
-318,318,318,318,318,318,318,115,115,115,115,115,115,115,115,115,
-318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
-318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
-318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
-318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
-178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,
-178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+498,498,498,498,498,498,115,498,115,115,115,115,115,498,115,115,
+499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,
+499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,
+499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,
+499,499,499,499,499,499,499,499,115,115,115,115,115,115,115,500,
+501,115,115,115,115,115,115,115,115,115,115,115,115,115,115,502,
/* block 84 */
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,115,115,115,115,115,115,115,115,115,
+336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115,
+336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115,
+336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115,
+336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115,
+192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
+192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
+
+/* block 85 */
4, 4, 21, 25, 21, 25, 4, 4, 4, 21, 25, 4, 21, 25, 4, 4,
4, 4, 4, 4, 4, 4, 4, 9, 4, 4, 9, 4, 21, 25, 4, 4,
21, 25, 6, 7, 6, 7, 6, 7, 6, 7, 4, 4, 4, 4, 4,108,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 9, 4, 4, 4, 4,
- 9, 4, 6,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 9, 4, 6, 4, 4, 4, 4, 4, 4, 4,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 85 */
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,115,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,115,115,115,115,115,115,115,115,115,115,115,115,
-
/* block 86 */
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,115,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 87 */
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
/* block 88 */
- 3, 4, 4, 4, 19,474,407,475, 6, 7, 6, 7, 6, 7, 6, 7,
- 6, 7, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7, 9, 6, 7, 7,
- 19,475,475,475,475,475,475,475,475,475,110,110,110,110,476,476,
- 9,108,108,108,108,108, 19, 19,475,475,475,474,407, 4, 19, 19,
-115,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
-477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
-477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
-477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,
+503,503,503,503,503,503,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
/* block 89 */
-477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,
-477,477,477,477,477,477,477,115,115,110,110, 14, 14,478,478,477,
- 9,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
-479,479,479,479,479,479,479,479,479,479,479, 4,108,480,480,479,
+ 3, 4, 4, 4, 19,504,434,505, 6, 7, 6, 7, 6, 7, 6, 7,
+ 6, 7, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7, 9, 6, 7, 7,
+ 19,505,505,505,505,505,505,505,505,505,110,110,110,110,506,506,
+ 9,108,108,108,108,108, 19, 19,505,505,505,504,434, 4, 19, 19,
+115,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
/* block 90 */
-115,115,115,115,115,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,115,115,
-115,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,115,115,110,110, 14, 14,508,508,507,
+ 9,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
+509,509,509,509,509,509,509,509,509,509,509, 4,108,510,510,509,
/* block 91 */
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,115,
+115,115,115,115,115,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,115,
+115,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+
+/* block 92 */
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,115,
19, 19, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
-481,481,481,481,481,481,481,481,481,481,481,115,115,115,115,115,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
-/* block 92 */
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,115,
+/* block 93 */
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,115,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23,
19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,
-483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, 19,
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, 19,
-/* block 93 */
+/* block 94 */
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,115,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,115,
-/* block 94 */
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,
-484,484,484,484,484,484,484,484, 19, 19, 19, 19, 19, 19, 19, 19,
+/* block 95 */
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 95 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-
/* block 96 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,115,115,115,115,115,115,115,115,115,115,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+
+/* block 97 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,115,115,115,115,115,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 97 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-
/* block 98 */
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,487,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 99 */
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
-486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,517,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
/* block 100 */
-486,486,486,486,486,486,486,486,486,486,486,486,486,115,115,115,
-488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,
-488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,
-488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,
-488,488,488,488,488,488,488,115,115,115,115,115,115,115,115,115,
-489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,
-489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,
-489,489,489,489,489,489,489,489,490,490,490,490,490,490,491,491,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
+516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
/* block 101 */
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
+516,516,516,516,516,516,516,516,516,516,516,516,516,115,115,115,
+518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,
+518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,
+518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,
+518,518,518,518,518,518,518,115,115,115,115,115,115,115,115,115,
+519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
+519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
+519,519,519,519,519,519,519,519,520,520,520,520,520,520,521,521,
/* block 102 */
-492,492,492,492,492,492,492,492,492,492,492,492,493,494,494,494,
-492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,
-495,495,495,495,495,495,495,495,495,495,492,492,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,496,178,
-179,179,179,497,178,178,178,178,178,178,178,178,178,178,497,409,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
/* block 103 */
-175,176,175,176,175,176,175,176,175,176,175,176,175,176,175,176,
-175,176,175,176,175,176,175,176,175,176,175,176,409,409,178,178,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,499,499,499,499,499,499,499,499,499,499,
-500,500,501,501,501,501,501,501,115,115,115,115,115,115,115,115,
+522,522,522,522,522,522,522,522,522,522,522,522,523,524,524,524,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+525,525,525,525,525,525,525,525,525,525,522,522,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+187,188,187,188,187,188,187,188,187,188,526,527,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,528,192,
+193,193,193,529,192,192,192,192,192,192,192,192,192,192,529,436,
/* block 104 */
+187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188,
+187,188,187,188,187,188,187,188,187,188,187,188,436,436,192,192,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,531,531,531,531,531,531,531,531,531,531,
+532,532,533,533,533,533,533,533,115,115,115,115,115,115,115,115,
+
+/* block 105 */
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14,108,108,108,108,108,108,108,108,108,
14, 14, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
@@ -2425,349 +2534,349 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
-107, 33, 33, 33, 33, 33, 33, 33, 33, 30, 31, 30, 31,502, 30, 31,
+107, 33, 33, 33, 33, 33, 33, 33, 33, 30, 31, 30, 31,534, 30, 31,
-/* block 105 */
- 30, 31, 30, 31, 30, 31, 30, 31,108, 14, 14, 30, 31,503, 33, 20,
+/* block 106 */
+ 30, 31, 30, 31, 30, 31, 30, 31,108, 14, 14, 30, 31,535, 33, 20,
30, 31, 30, 31, 33, 33, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
- 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,504,505,506,507,115,115,
-508,509,510,511, 30, 31, 30, 31,115,115,115,115,115,115,115,115,
+ 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,536,537,538,539,536,115,
+540,541,542,543, 30, 31, 30, 31,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115, 20,107,107, 33, 20, 20, 20, 20, 20,
-/* block 106 */
-512,512,513,512,512,512,513,512,512,512,512,513,512,512,512,512,
-512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
-512,512,512,514,514,513,513,514,515,515,515,515,115,115,115,115,
- 23, 23, 23, 23, 23, 23, 19, 19, 5, 19,115,115,115,115,115,115,
-516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
-516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
-516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,
-516,516,516,516,517,517,517,517,115,115,115,115,115,115,115,115,
-
/* block 107 */
-518,518,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
-519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
-519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,
-519,519,519,519,518,518,518,518,518,518,518,518,518,518,518,518,
-518,518,518,518,520,115,115,115,115,115,115,115,115,115,521,521,
-522,522,522,522,522,522,522,522,522,522,115,115,115,115,115,115,
-222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,
-222,222,224,224,224,224,224,224,226,226,226,224,226,224,115,115,
+544,544,545,544,544,544,545,544,544,544,544,545,544,544,544,544,
+544,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544,
+544,544,544,546,546,545,545,546,547,547,547,547,115,115,115,115,
+ 23, 23, 23, 23, 23, 23, 19, 19, 5, 19,115,115,115,115,115,115,
+548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,
+548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,
+548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,
+548,548,548,548,549,549,549,549,115,115,115,115,115,115,115,115,
/* block 108 */
-523,523,523,523,523,523,523,523,523,523,524,524,524,524,524,524,
-524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,
-524,524,524,524,524,524,525,525,525,525,525,525,525,525, 4,526,
-527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,
-527,527,527,527,527,527,527,528,528,528,528,528,528,528,528,528,
-528,528,529,529,115,115,115,115,115,115,115,115,115,115,115,530,
-315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,315,
-315,315,315,315,315,315,315,315,315,315,315,315,315,115,115,115,
+550,550,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
+551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
+551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,
+551,551,551,551,550,550,550,550,550,550,550,550,550,550,550,550,
+550,550,550,550,552,552,115,115,115,115,115,115,115,115,553,553,
+554,554,554,554,554,554,554,554,554,554,115,115,115,115,115,115,
+238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,
+238,238,240,240,240,240,240,240,242,242,242,240,242,240,115,115,
/* block 109 */
-531,531,531,532,533,533,533,533,533,533,533,533,533,533,533,533,
-533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,
-533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,533,
-533,533,533,531,532,532,531,531,531,531,532,532,531,532,532,532,
-532,534,534,534,534,534,534,534,534,534,534,534,534,534,115,108,
-535,535,535,535,535,535,535,535,535,535,115,115,115,115,534,534,
-305,305,305,305,305,307,536,305,305,305,305,305,305,305,305,305,
-309,309,309,309,309,309,309,309,309,309,305,305,305,305,305,115,
+555,555,555,555,555,555,555,555,555,555,556,556,556,556,556,556,
+556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+556,556,556,556,556,556,557,557,557,557,557,557,557,557, 4,558,
+559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
+559,559,559,559,559,559,559,560,560,560,560,560,560,560,560,560,
+560,560,561,561,115,115,115,115,115,115,115,115,115,115,115,562,
+333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,
+333,333,333,333,333,333,333,333,333,333,333,333,333,115,115,115,
/* block 110 */
-537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,
-537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,537,
-537,537,537,537,537,537,537,537,537,538,538,538,538,538,538,539,
-539,538,538,539,539,538,538,115,115,115,115,115,115,115,115,115,
-537,537,537,538,537,537,537,537,537,537,537,537,538,539,115,115,
-540,540,540,540,540,540,540,540,540,540,115,115,541,541,541,541,
-305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
-536,305,305,305,305,305,305,311,311,311,305,306,307,306,305,305,
+563,563,563,564,565,565,565,565,565,565,565,565,565,565,565,565,
+565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,
+565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,
+565,565,565,563,564,564,563,563,563,563,564,564,563,564,564,564,
+564,566,566,566,566,566,566,566,566,566,566,566,566,566,115,108,
+567,567,567,567,567,567,567,567,567,567,115,115,115,115,566,566,
+323,323,323,323,323,325,568,323,323,323,323,323,323,323,323,323,
+327,327,327,327,327,327,327,327,327,327,323,323,323,323,323,115,
/* block 111 */
-542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,
-542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,
-542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,542,
-543,542,543,543,543,542,542,543,543,542,542,542,542,542,543,543,
-542,543,542,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,542,542,544,545,545,
-546,546,546,546,546,546,546,546,546,546,546,547,548,548,547,547,
-549,549,546,550,550,547,548,115,115,115,115,115,115,115,115,115,
+569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,
+569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,
+569,569,569,569,569,569,569,569,569,570,570,570,570,570,570,571,
+571,570,570,571,571,570,570,115,115,115,115,115,115,115,115,115,
+569,569,569,570,569,569,569,569,569,569,569,569,570,571,115,115,
+572,572,572,572,572,572,572,572,572,572,115,115,573,573,573,573,
+323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,
+568,323,323,323,323,323,323,329,329,329,323,324,325,324,323,323,
/* block 112 */
-115,318,318,318,318,318,318,115,115,318,318,318,318,318,318,115,
-115,318,318,318,318,318,318,115,115,115,115,115,115,115,115,115,
-318,318,318,318,318,318,318,115,318,318,318,318,318,318,318,115,
+574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,
+574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,
+574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,
+575,574,575,575,575,574,574,575,575,574,574,574,574,574,575,575,
+574,575,574,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,574,574,576,577,577,
+578,578,578,578,578,578,578,578,578,578,578,579,580,580,579,579,
+581,581,578,582,582,579,580,115,115,115,115,115,115,115,115,115,
+
+/* block 113 */
+115,336,336,336,336,336,336,115,115,336,336,336,336,336,336,115,
+115,336,336,336,336,336,336,115,115,115,115,115,115,115,115,115,
+336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33,551, 33, 33, 33, 33, 33, 33, 33, 14,107,107,107,107,
+ 33, 33, 33,583, 33, 33, 33, 33, 33, 33, 33, 14,107,107,107,107,
33, 33, 33, 33, 33,123,115,115,115,115,115,115,115,115,115,115,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-
-/* block 113 */
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,
-546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,
-546,546,546,547,547,548,547,547,548,547,547,549,547,548,115,115,
-553,553,553,553,553,553,553,553,553,553,115,115,115,115,115,115,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
/* block 114 */
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
+578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
+578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
+578,578,578,579,579,580,579,579,580,579,579,581,579,580,115,115,
+585,585,585,585,585,585,585,585,585,585,115,115,115,115,115,115,
/* block 115 */
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
/* block 116 */
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
/* block 117 */
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
/* block 118 */
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
/* block 119 */
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
/* block 120 */
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-554,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,554,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,554,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
/* block 121 */
-555,555,555,555,555,555,555,555,554,555,555,555,555,555,555,555,
-555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,555,
-555,555,555,555,115,115,115,115,115,115,115,115,115,115,115,115,
-316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,
-316,316,316,316,316,316,316,115,115,115,115,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
-317,317,317,317,317,317,317,317,317,317,317,317,115,115,115,115,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
/* block 122 */
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
-556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,
+587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,115,115,115,115,115,115,115,115,115,115,115,115,
+334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
+334,334,334,334,334,334,334,115,115,115,115,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
+335,335,335,335,335,335,335,335,335,335,335,335,115,115,115,115,
/* block 123 */
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
+588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
/* block 124 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,115,115,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
/* block 125 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,115,115,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
/* block 126 */
- 33, 33, 33, 33, 33, 33, 33,115,115,115,115,115,115,115,115,115,
-115,115,115,186,186,186,186,186,115,115,115,115,115,193,190,193,
-193,193,193,193,193,193,193,193,193,558,193,193,193,193,193,193,
-193,193,193,193,193,193,193,115,193,193,193,193,193,115,193,115,
-193,193,115,193,193,115,193,193,193,193,193,193,193,193,193,193,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 127 */
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,559,559,559,559,559,559,559,559,559,559,559,559,559,559,
-559,559,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+ 33, 33, 33, 33, 33, 33, 33,115,115,115,115,115,115,115,115,115,
+115,115,115,200,200,200,200,200,115,115,115,115,115,207,204,207,
+207,207,207,207,207,207,207,207,207,590,207,207,207,207,207,207,
+207,207,207,207,207,207,207,115,207,207,207,207,207,115,207,115,
+207,207,115,207,207,115,207,207,207,207,207,207,207,207,207,207,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
/* block 128 */
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,591,591,591,591,591,591,591,591,591,591,591,591,591,591,
+591,591,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
/* block 129 */
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200, 7, 6,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
/* block 130 */
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-115,115,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216, 7, 6,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-200,200,200,200,200,200,200,200,200,200,200,200,197,198,115,115,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
/* block 131 */
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+115,115,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+216,216,216,216,216,216,216,216,216,216,216,216,212,213,115,115,
+
+/* block 132 */
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
4, 4, 4, 4, 4, 4, 4, 6, 7, 4,115,115,115,115,115,115,
-110,110,110,110,110,110,110,110,110,110,110,110,110,110,178,178,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,192,192,
4, 9, 9, 15, 15, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6,
7, 6, 7, 6, 7, 4, 4, 6, 7, 4, 4, 4, 4, 15, 15, 15,
4, 4, 4,115, 4, 4, 4, 4, 9, 6, 7, 6, 7, 6, 7, 4,
4, 4, 8, 9, 8, 8, 8,115, 4, 5, 4, 4,115,115,115,115,
-200,200,200,200,200,115,200,200,200,200,200,200,200,200,200,200,
-
-/* block 132 */
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,115,115, 22,
+216,216,216,216,216,115,216,216,216,216,216,216,216,216,216,216,
/* block 133 */
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,115,115, 22,
+
+/* block 134 */
115, 4, 4, 4, 5, 4, 4, 4, 6, 7, 4, 8, 4, 9, 4, 4,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 8, 8, 8, 4,
4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 6, 4, 7, 14, 15,
14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6, 8, 7, 8, 6,
- 7, 4, 6, 7, 4, 4,479,479,479,479,479,479,479,479,479,479,
-108,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
+ 7, 4, 6, 7, 4, 4,509,509,509,509,509,509,509,509,509,509,
+108,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
-/* block 134 */
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,
-479,479,479,479,479,479,479,479,479,479,479,479,479,479,560,560,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,
-482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,115,
-115,115,482,482,482,482,482,482,115,115,482,482,482,482,482,482,
-115,115,482,482,482,482,482,482,115,115,482,482,482,115,115,115,
+/* block 135 */
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,
+509,509,509,509,509,509,509,509,509,509,509,509,509,509,592,592,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
+512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,115,
+115,115,512,512,512,512,512,512,115,115,512,512,512,512,512,512,
+115,115,512,512,512,512,512,512,115,115,512,512,512,115,115,115,
5, 5, 8, 14, 19, 5, 5,115, 19, 8, 8, 8, 8, 19, 19,115,
-437,437,437,437,437,437,437,437,437, 22, 22, 22, 19, 19,115,115,
+465,465,465,465,465,465,465,465,465, 22, 22, 22, 19, 19,115,115,
-/* block 135 */
-561,561,561,561,561,561,561,561,561,561,561,561,115,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,115,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,115,561,561,115,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,115,115,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,115,115,
+/* block 136 */
+593,593,593,593,593,593,593,593,593,593,593,593,115,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,115,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,115,593,593,115,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,115,115,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 136 */
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,
-561,561,561,561,561,561,561,561,561,561,561,115,115,115,115,115,
-
/* block 137 */
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,115,115,115,115,115,
+
+/* block 138 */
4, 4, 4,115,115,115,115, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23,115,115,115, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
-562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
-562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,
-562,562,562,562,562,563,563,563,563,564,564,564,564,564,564,564,
+594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,
+594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,
+594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,
+594,594,594,594,594,595,595,595,595,596,596,596,596,596,596,596,
-/* block 138 */
-564,564,564,564,564,564,564,564,564,564,563,563,564,115,115,115,
+/* block 139 */
+596,596,596,596,596,596,596,596,596,596,595,595,596,596,596,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
-564,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+596,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,110,115,115,
-/* block 139 */
+/* block 140 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
@@ -2777,479 +2886,509 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 140 */
-565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,
-565,565,565,565,565,565,565,565,565,565,565,565,565,115,115,115,
-566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,
-566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,
-566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,
-566,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+/* block 141 */
+597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
+597,597,597,597,597,597,597,597,597,597,597,597,597,115,115,115,
+598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,
+598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,
+598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,
+598,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
110, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,115,115,115,115,
-/* block 141 */
-567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,
-567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,
-568,568,568,568,115,115,115,115,115,115,115,115,115,115,115,115,
-569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,
-569,570,569,569,569,569,569,569,569,569,570,115,115,115,115,115,
-571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,
-571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,
-571,571,571,571,571,571,572,572,572,572,572,115,115,115,115,115,
-
/* block 142 */
-573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
-573,573,573,573,573,573,573,573,573,573,573,573,573,573,115,574,
-575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,
-575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,
-575,575,575,575,115,115,115,115,575,575,575,575,575,575,575,575,
-576,577,577,577,577,577,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+599,599,599,599,599,599,599,599,599,599,599,599,599,599,599,599,
+599,599,599,599,599,599,599,599,599,599,599,599,599,599,599,599,
+600,600,600,600,115,115,115,115,115,115,115,115,115,599,599,599,
+601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,
+601,602,601,601,601,601,601,601,601,601,602,115,115,115,115,115,
+603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,
+603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,
+603,603,603,603,603,603,604,604,604,604,604,115,115,115,115,115,
/* block 143 */
-578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
-578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
-578,578,578,578,578,578,578,578,579,579,579,579,579,579,579,579,
-579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,
-579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,
-580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,
-580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,
-580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,
-
-/* block 144 */
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,
-581,581,581,581,581,581,581,581,581,581,581,581,581,581,115,115,
-582,582,582,582,582,582,582,582,582,582,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
+605,605,605,605,605,605,605,605,605,605,605,605,605,605,115,606,
+607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,
+607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,
+607,607,607,607,115,115,115,115,607,607,607,607,607,607,607,607,
+608,609,609,609,609,609,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+/* block 144 */
+610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,
+610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,
+610,610,610,610,610,610,610,610,611,611,611,611,611,611,611,611,
+611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,
+611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,
+612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,
+612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,
+612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,
+
/* block 145 */
-583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,
-583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,583,
-583,583,583,583,583,583,583,583,115,115,115,115,115,115,115,115,
-584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
-584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
-584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,
-584,584,584,584,115,115,115,115,115,115,115,115,115,115,115,585,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,
+613,613,613,613,613,613,613,613,613,613,613,613,613,613,115,115,
+614,614,614,614,614,614,614,614,614,614,115,115,115,115,115,115,
+615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,
+615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,
+615,615,615,615,115,115,115,115,616,616,616,616,616,616,616,616,
+616,616,616,616,616,616,616,616,616,616,616,616,616,616,616,616,
+616,616,616,616,616,616,616,616,616,616,616,616,115,115,115,115,
/* block 146 */
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
+617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,
+617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,
+617,617,617,617,617,617,617,617,115,115,115,115,115,115,115,115,
+618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,
+618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,
+618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,
+618,618,618,618,115,115,115,115,115,115,115,115,115,115,115,619,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 147 */
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,586,115,115,115,115,115,115,115,115,115,
-586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
-586,586,586,586,586,586,115,115,115,115,115,115,115,115,115,115,
-586,586,586,586,586,586,586,586,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
/* block 148 */
-587,587,587,587,587,587,115,115,587,115,587,587,587,587,587,587,
-587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
-587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
-587,587,587,587,587,587,115,587,587,115,115,115,587,115,115,587,
-588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,
-588,588,588,588,588,588,115,589,590,590,590,590,590,590,590,590,
-591,591,591,591,591,591,591,591,591,591,591,591,591,591,591,591,
-591,591,591,591,591,591,591,592,592,593,593,593,593,593,593,593,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,620,115,115,115,115,115,115,115,115,115,
+620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
+620,620,620,620,620,620,115,115,115,115,115,115,115,115,115,115,
+620,620,620,620,620,620,620,620,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 149 */
-594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,
-594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,115,
-115,115,115,115,115,115,115,595,595,595,595,595,595,595,595,595,
+621,621,621,621,621,621,115,115,621,115,621,621,621,621,621,621,
+621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,
+621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,
+621,621,621,621,621,621,115,621,621,115,115,115,621,115,115,621,
+622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,
+622,622,622,622,622,622,115,623,624,624,624,624,624,624,624,624,
+625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,
+625,625,625,625,625,625,625,626,626,627,627,627,627,627,627,627,
+
+/* block 150 */
+628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
+628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,115,
+115,115,115,115,115,115,115,629,629,629,629,629,629,629,629,629,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
-596,596,596,115,596,596,115,115,115,115,115,597,597,597,597,597,
+630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
+630,630,630,115,630,630,115,115,115,115,115,631,631,631,631,631,
-/* block 150 */
-598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,
-598,598,598,598,598,598,599,599,599,599,599,599,115,115,115,600,
-601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,
-601,601,601,601,601,601,601,601,601,601,115,115,115,115,115,602,
+/* block 151 */
+632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,
+632,632,632,632,632,632,633,633,633,633,633,633,115,115,115,634,
+635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,
+635,635,635,635,635,635,635,635,635,635,115,115,115,115,115,636,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 151 */
-603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,
-603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,
-604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,
-604,604,604,604,604,604,604,604,115,115,115,115,605,605,604,604,
-605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
-115,115,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
-605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
-605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,
-
/* block 152 */
-606,607,607,607,115,607,607,115,115,115,115,115,607,607,607,607,
-606,606,606,606,115,606,606,606,115,606,606,606,606,606,606,606,
-606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,
-606,606,606,606,115,115,115,115,607,607,607,115,115,115,115,607,
-608,608,608,608,608,608,608,608,115,115,115,115,115,115,115,115,
-609,609,609,609,609,609,609,609,609,115,115,115,115,115,115,115,
-610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,
-610,610,610,610,610,610,610,610,610,610,610,610,610,611,611,612,
+637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,
+637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,
+638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,
+638,638,638,638,638,638,638,638,115,115,115,115,639,639,638,638,
+639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,
+115,115,639,639,639,639,639,639,639,639,639,639,639,639,639,639,
+639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,
+639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,
/* block 153 */
-613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,
-613,613,613,613,613,613,613,613,613,613,613,613,613,614,614,614,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-615,615,615,615,615,615,615,615,616,615,615,615,615,615,615,615,
-615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,
-615,615,615,615,615,617,617,115,115,115,115,618,618,618,618,618,
-619,619,619,619,619,619,619,115,115,115,115,115,115,115,115,115,
+640,641,641,641,115,641,641,115,115,115,115,115,641,641,641,641,
+640,640,640,640,115,640,640,640,115,640,640,640,640,640,640,640,
+640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,
+640,640,640,640,115,115,115,115,641,641,641,115,115,115,115,641,
+642,642,642,642,642,642,642,642,115,115,115,115,115,115,115,115,
+643,643,643,643,643,643,643,643,643,115,115,115,115,115,115,115,
+644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,
+644,644,644,644,644,644,644,644,644,644,644,644,644,645,645,646,
/* block 154 */
-620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
-620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
-620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,
-620,620,620,620,620,620,115,115,115,621,621,621,621,621,621,621,
-622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,
-622,622,622,622,622,622,115,115,623,623,623,623,623,623,623,623,
-624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,
-624,624,624,115,115,115,115,115,625,625,625,625,625,625,625,625,
+647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
+647,647,647,647,647,647,647,647,647,647,647,647,647,648,648,648,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+649,649,649,649,649,649,649,649,650,649,649,649,649,649,649,649,
+649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,
+649,649,649,649,649,651,651,115,115,115,115,652,652,652,652,652,
+653,653,653,653,653,653,653,115,115,115,115,115,115,115,115,115,
/* block 155 */
-626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,
-626,626,115,115,115,115,115,115,115,627,627,627,627,115,115,115,
-115,115,115,115,115,115,115,115,115,628,628,628,628,628,628,628,
+654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,
+654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,
+654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,
+654,654,654,654,654,654,115,115,115,655,655,655,655,655,655,655,
+656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,
+656,656,656,656,656,656,115,115,657,657,657,657,657,657,657,657,
+658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,
+658,658,658,115,115,115,115,115,659,659,659,659,659,659,659,659,
+
+/* block 156 */
+660,660,660,660,660,660,660,660,660,660,660,660,660,660,660,660,
+660,660,115,115,115,115,115,115,115,661,661,661,661,115,115,115,
+115,115,115,115,115,115,115,115,115,662,662,662,662,662,662,662,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 156 */
-629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
-629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
-629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
-629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,
-629,629,629,629,629,629,629,629,629,115,115,115,115,115,115,115,
+/* block 157 */
+663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,
+663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,
+663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,
+663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,
+663,663,663,663,663,663,663,663,663,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 157 */
-630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
-630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
-630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
-630,630,630,115,115,115,115,115,115,115,115,115,115,115,115,115,
-631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
-631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
-631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,631,
-631,631,631,115,115,115,115,115,115,115,632,632,632,632,632,632,
-
/* block 158 */
+664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,
+664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,
+664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,
+664,664,664,115,115,115,115,115,115,115,115,115,115,115,115,115,
+665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,
+665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,
+665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,
+665,665,665,115,115,115,115,115,115,115,666,666,666,666,666,666,
+
+/* block 159 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,
-633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,115,
-
-/* block 159 */
-634,635,634,636,636,636,636,636,636,636,636,636,636,636,636,636,
-636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,
-636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,
-636,636,636,636,636,636,636,636,635,635,635,635,635,635,635,635,
-635,635,635,635,635,635,635,637,637,637,637,637,637,637,115,115,
-115,115,638,638,638,638,638,638,638,638,638,638,638,638,638,638,
-638,638,638,638,638,638,639,639,639,639,639,639,639,639,639,639,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,635,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,115,
/* block 160 */
-640,640,641,642,642,642,642,642,642,642,642,642,642,642,642,642,
-642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,
-642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,642,
-641,641,641,640,640,640,640,641,641,640,640,643,643,644,643,643,
-643,643,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,
-645,645,645,645,645,645,645,645,645,115,115,115,115,115,115,115,
-646,646,646,646,646,646,646,646,646,646,115,115,115,115,115,115,
+668,669,668,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,669,669,669,669,669,669,669,
+669,669,669,669,669,669,669,671,671,671,671,671,671,671,115,115,
+115,115,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,673,673,673,673,673,673,673,673,673,673,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,669,
/* block 161 */
-647,647,647,648,648,648,648,648,648,648,648,648,648,648,648,648,
-648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,
-648,648,648,648,648,648,648,647,647,647,647,647,649,647,647,647,
-647,647,647,647,647,115,650,650,650,650,650,650,650,650,650,650,
-651,651,651,651,115,115,115,115,115,115,115,115,115,115,115,115,
-652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,
-652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,
-652,652,652,653,654,654,652,115,115,115,115,115,115,115,115,115,
+674,674,675,676,676,676,676,676,676,676,676,676,676,676,676,676,
+676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,
+676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,
+675,675,675,674,674,674,674,675,675,674,674,677,677,678,677,677,
+677,677,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,
+679,679,679,679,679,679,679,679,679,115,115,115,115,115,115,115,
+680,680,680,680,680,680,680,680,680,680,115,115,115,115,115,115,
/* block 162 */
-655,655,656,657,657,657,657,657,657,657,657,657,657,657,657,657,
-657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,
-657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,
-657,657,657,656,656,656,655,655,655,655,655,655,655,655,655,656,
-656,657,657,657,657,658,658,658,658,658,655,655,655,658,115,115,
-659,659,659,659,659,659,659,659,659,659,657,658,657,658,658,658,
-115,660,660,660,660,660,660,660,660,660,660,660,660,660,660,660,
-660,660,660,660,660,115,115,115,115,115,115,115,115,115,115,115,
+681,681,681,682,682,682,682,682,682,682,682,682,682,682,682,682,
+682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,
+682,682,682,682,682,682,682,681,681,681,681,681,683,681,681,681,
+681,681,681,681,681,115,684,684,684,684,684,684,684,684,684,684,
+685,685,685,685,115,115,115,115,115,115,115,115,115,115,115,115,
+686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
+686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
+686,686,686,687,688,688,686,115,115,115,115,115,115,115,115,115,
/* block 163 */
-661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,
-661,661,115,661,661,661,661,661,661,661,661,661,661,661,661,661,
-661,661,661,661,661,661,661,661,661,661,661,661,662,662,662,663,
-663,663,662,662,663,662,663,663,664,664,664,664,664,664,115,115,
+689,689,690,691,691,691,691,691,691,691,691,691,691,691,691,691,
+691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
+691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
+691,691,691,690,690,690,689,689,689,689,689,689,689,689,689,690,
+690,691,692,692,691,693,693,693,693,693,689,689,689,693,115,115,
+694,694,694,694,694,694,694,694,694,694,691,693,691,693,693,693,
+115,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,
+695,695,695,695,695,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 164 */
+696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,
+696,696,115,696,696,696,696,696,696,696,696,696,696,696,696,696,
+696,696,696,696,696,696,696,696,696,696,696,696,697,697,697,698,
+698,698,697,697,698,697,698,698,699,699,699,699,699,699,698,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 164 */
-665,665,665,665,665,665,665,115,665,115,665,665,665,665,115,665,
-665,665,665,665,665,665,665,665,665,665,665,665,665,665,115,665,
-665,665,665,665,665,665,665,665,665,666,115,115,115,115,115,115,
-667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
-667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
-667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,668,
-669,669,669,668,668,668,668,668,668,668,668,115,115,115,115,115,
-670,670,670,670,670,670,670,670,670,670,115,115,115,115,115,115,
-
/* block 165 */
-671,671,672,672,115,673,673,673,673,673,673,673,673,115,115,673,
-673,115,115,673,673,673,673,673,673,673,673,673,673,673,673,673,
-673,673,673,673,673,673,673,673,673,115,673,673,673,673,673,673,
-673,115,673,673,115,673,673,673,673,673,115,115,671,673,674,672,
-671,672,672,672,672,115,115,672,672,115,115,672,672,672,115,115,
-673,115,115,115,115,115,115,674,115,115,115,115,115,673,673,673,
-673,673,672,672,115,115,671,671,671,671,671,671,671,115,115,115,
-671,671,671,671,671,115,115,115,115,115,115,115,115,115,115,115,
+700,700,700,700,700,700,700,115,700,115,700,700,700,700,115,700,
+700,700,700,700,700,700,700,700,700,700,700,700,700,700,115,700,
+700,700,700,700,700,700,700,700,700,701,115,115,115,115,115,115,
+702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
+702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
+702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,703,
+704,704,704,703,703,703,703,703,703,703,703,115,115,115,115,115,
+705,705,705,705,705,705,705,705,705,705,115,115,115,115,115,115,
/* block 166 */
-675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,
-675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,
-675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,
-676,677,677,678,678,678,678,678,678,677,678,677,677,676,677,678,
-678,677,678,678,675,675,679,675,115,115,115,115,115,115,115,115,
-680,680,680,680,680,680,680,680,680,680,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+706,706,707,707,115,708,708,708,708,708,708,708,708,115,115,708,
+708,115,115,708,708,708,708,708,708,708,708,708,708,708,708,708,
+708,708,708,708,708,708,708,708,708,115,708,708,708,708,708,708,
+708,115,708,708,115,708,708,708,708,708,115,115,706,708,709,707,
+706,707,707,707,707,115,115,707,707,115,115,707,707,707,115,115,
+708,115,115,115,115,115,115,709,115,115,115,115,115,708,708,708,
+708,708,707,707,115,115,706,706,706,706,706,706,706,115,115,115,
+706,706,706,706,706,115,115,115,115,115,115,115,115,115,115,115,
/* block 167 */
-681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,
-681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,
-681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,682,
-683,683,684,684,684,684,115,115,683,683,683,683,684,684,683,684,
-684,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,
-685,685,685,685,685,685,685,685,681,681,681,681,684,684,115,115,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,711,711,711,712,712,712,712,712,712,712,712,
+711,711,712,712,712,711,712,710,710,710,710,713,713,713,713,713,
+714,714,714,714,714,714,714,714,714,714,115,713,115,713,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 168 */
-686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
-686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
-686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
-687,687,687,688,688,688,688,688,688,688,688,687,687,688,687,688,
-688,689,689,689,686,115,115,115,115,115,115,115,115,115,115,115,
-690,690,690,690,690,690,690,690,690,690,115,115,115,115,115,115,
+715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
+715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
+715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
+716,717,717,718,718,718,718,718,718,717,718,717,717,716,717,718,
+718,717,718,718,715,715,719,715,115,115,115,115,115,115,115,115,
+720,720,720,720,720,720,720,720,720,720,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 169 */
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
-691,691,691,691,691,691,691,691,691,691,691,692,693,692,693,693,
-692,692,692,692,692,692,693,692,115,115,115,115,115,115,115,115,
-694,694,694,694,694,694,694,694,694,694,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,
+721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,
+721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,722,
+723,723,724,724,724,724,115,115,723,723,723,723,724,724,723,724,
+724,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,
+725,725,725,725,725,725,725,725,721,721,721,721,724,724,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 170 */
-695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,
-695,695,695,695,695,695,695,695,695,695,115,115,115,696,696,696,
-697,697,696,696,696,696,697,696,696,696,696,696,115,115,115,115,
-698,698,698,698,698,698,698,698,698,698,699,699,700,700,700,701,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+727,727,727,728,728,728,728,728,728,728,728,727,727,728,727,728,
+728,729,729,729,726,115,115,115,115,115,115,115,115,115,115,115,
+730,730,730,730,730,730,730,730,730,730,115,115,115,115,115,115,
+369,369,369,369,369,369,369,369,369,369,369,369,369,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 171 */
+731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,
+731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,
+731,731,731,731,731,731,731,731,731,731,731,732,733,732,733,733,
+732,732,732,732,732,732,733,732,115,115,115,115,115,115,115,115,
+734,734,734,734,734,734,734,734,734,734,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
-702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
-703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,
-703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,
-704,704,704,704,704,704,704,704,704,704,705,705,705,705,705,705,
-705,705,705,115,115,115,115,115,115,115,115,115,115,115,115,706,
/* block 172 */
+735,735,735,735,735,735,735,735,735,735,735,735,735,735,735,735,
+735,735,735,735,735,735,735,735,735,735,115,115,115,736,736,736,
+737,737,736,736,736,736,737,736,736,736,736,736,115,115,115,115,
+738,738,738,738,738,738,738,738,738,738,739,739,740,740,740,741,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,
-707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,
-707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,
-707,707,707,707,707,707,707,707,707,115,115,115,115,115,115,115,
/* block 173 */
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-
-/* block 174 */
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,
+742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,
+743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,
+743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,
+744,744,744,744,744,744,744,744,744,744,745,745,745,745,745,745,
+745,745,745,115,115,115,115,115,115,115,115,115,115,115,115,746,
+
+/* block 174 */
+747,748,748,748,748,748,748,749,749,748,748,747,747,747,747,747,
+747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,
+747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,
+747,747,747,748,748,748,748,748,748,749,750,748,748,748,748,751,
+751,751,751,751,751,751,751,748,115,115,115,115,115,115,115,115,
+752,753,753,753,753,753,753,754,754,753,753,753,752,752,752,752,
+752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,
+752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,
/* block 175 */
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,
-709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,115,
-710,710,710,710,710,115,115,115,115,115,115,115,115,115,115,115,
+752,752,752,752,115,115,755,755,755,755,753,753,753,753,753,753,
+753,753,753,753,753,753,753,754,753,753,756,756,756,115,756,756,
+756,756,756,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,
+757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,
+757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,
+757,757,757,757,757,757,757,757,757,115,115,115,115,115,115,115,
/* block 176 */
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,
-708,708,708,708,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+758,758,758,758,758,758,758,758,758,115,758,758,758,758,758,758,
+758,758,758,758,758,758,758,758,758,758,758,758,758,758,758,758,
+758,758,758,758,758,758,758,758,758,758,758,758,758,758,758,759,
+760,760,760,760,760,760,760,115,760,760,760,760,760,760,759,760,
+758,761,761,761,761,761,115,115,115,115,115,115,115,115,115,115,
+762,762,762,762,762,762,762,762,762,762,763,763,763,763,763,763,
+763,763,763,763,763,763,763,763,763,763,763,763,763,115,115,115,
+764,764,765,765,765,765,765,765,765,765,765,765,765,765,765,765,
/* block 177 */
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-
-/* block 178 */
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,
-711,711,711,711,711,711,711,711,711,711,711,711,711,711,711,115,
+765,765,765,765,765,765,765,765,765,765,765,765,765,765,765,765,
+115,115,766,766,766,766,766,766,766,766,766,766,766,766,766,766,
+766,766,766,766,766,766,766,766,115,767,766,766,766,766,766,766,
+766,767,766,766,767,766,766,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 178 */
+768,768,768,768,768,768,768,115,768,768,115,768,768,768,768,768,
+768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,
+768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,
+768,769,769,769,769,769,769,115,115,115,769,115,769,769,115,769,
+769,769,769,769,769,769,770,769,115,115,115,115,115,115,115,115,
+771,771,771,771,771,771,771,771,771,771,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 179 */
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
/* block 180 */
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,712,712,115,115,115,115,115,115,115,115,115,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 181 */
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,115,
+774,774,774,774,774,115,115,115,115,115,115,115,115,115,115,115,
/* block 182 */
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,
-498,498,498,498,498,498,498,498,498,115,115,115,115,115,115,115,
-713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,
-713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,115,
-714,714,714,714,714,714,714,714,714,714,115,115,115,115,715,715,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
/* block 183 */
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+
+/* block 184 */
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,
-716,716,716,716,716,716,716,716,716,716,716,716,716,716,115,115,
-717,717,717,717,717,718,115,115,115,115,115,115,115,115,115,115,
-
-/* block 184 */
-719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
-719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
-719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
-720,720,720,720,720,720,720,721,721,721,721,721,722,722,722,722,
-723,723,723,723,721,722,115,115,115,115,115,115,115,115,115,115,
-724,724,724,724,724,724,724,724,724,724,115,725,725,725,725,725,
-725,725,115,719,719,719,719,719,719,719,719,719,719,719,719,719,
-719,719,719,719,719,719,719,719,115,115,115,115,115,719,719,719,
/* block 185 */
-719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+
+/* block 186 */
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 187 */
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+
+/* block 188 */
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
+530,530,530,530,530,530,530,530,530,115,115,115,115,115,115,115,
+777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,
+777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,115,
+778,778,778,778,778,778,778,778,778,778,115,115,115,115,779,779,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 189 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,
+780,780,780,780,780,780,780,780,780,780,780,780,780,780,115,115,
+781,781,781,781,781,782,115,115,115,115,115,115,115,115,115,115,
-/* block 186 */
-726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
-726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
-726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
-726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
-726,726,726,726,726,115,115,115,115,115,115,115,115,115,115,115,
-726,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,
-727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,
-727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,115,
+/* block 190 */
+783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,
+783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,
+783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,
+784,784,784,784,784,784,784,785,785,785,785,785,786,786,786,786,
+787,787,787,787,785,786,115,115,115,115,115,115,115,115,115,115,
+788,788,788,788,788,788,788,788,788,788,115,789,789,789,789,789,
+789,789,115,783,783,783,783,783,783,783,783,783,783,783,783,783,
+783,783,783,783,783,783,783,783,115,115,115,115,115,783,783,783,
-/* block 187 */
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,728,
-728,728,728,729,729,729,729,729,729,729,729,729,729,729,729,729,
+/* block 191 */
+783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
@@ -3257,29 +3396,119 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 188 */
-479,477,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+/* block 192 */
+790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,
+790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,
+790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,
+790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,
+790,790,790,790,790,115,115,115,115,115,115,115,115,115,115,115,
+790,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,
+791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,
+791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,115,
+
+/* block 193 */
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,792,
+792,792,792,793,793,793,793,793,793,793,793,793,793,793,793,793,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+794,795,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 194 */
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+
+/* block 195 */
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 196 */
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 197 */
+509,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+
+/* block 198 */
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+
+/* block 199 */
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,
+507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
-/* block 189 */
-730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
-730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
-730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
-730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
-730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
-730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,
-730,730,730,730,730,730,730,730,730,730,730,115,115,115,115,115,
-730,730,730,730,730,730,730,730,730,730,730,730,730,115,115,115,
+/* block 200 */
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
-/* block 190 */
-730,730,730,730,730,730,730,730,730,115,115,115,115,115,115,115,
-730,730,730,730,730,730,730,730,730,730,115,115,731,732,732,733,
+/* block 201 */
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
+797,797,797,797,797,797,797,797,797,797,797,797,115,115,115,115,
+
+/* block 202 */
+798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,
+798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,
+798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,
+798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,
+798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,
+798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,
+798,798,798,798,798,798,798,798,798,798,798,115,115,115,115,115,
+798,798,798,798,798,798,798,798,798,798,798,798,798,115,115,115,
+
+/* block 203 */
+798,798,798,798,798,798,798,798,798,115,115,115,115,115,115,115,
+798,798,798,798,798,798,798,798,798,798,115,115,799,800,800,801,
22, 22, 22, 22,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
@@ -3287,7 +3516,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 191 */
+/* block 204 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3297,17 +3526,17 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,
-/* block 192 */
+/* block 205 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19,734,406,110,110,110, 19, 19, 19,406,734,734,
-734,734,734, 22, 22, 22, 22, 22, 22, 22, 22,110,110,110,110,110,
+ 19, 19, 19, 19, 19,802,433,110,110,110, 19, 19, 19,433,802,802,
+802,802,802, 22, 22, 22, 22, 22, 22, 22, 22,110,110,110,110,110,
-/* block 193 */
+/* block 206 */
110,110,110, 19, 19,110,110,110,110,110,110,110, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,110,110,110,110, 19, 19,
@@ -3317,17 +3546,17 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 194 */
-564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
-564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
-564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
-564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,
-564,564,735,735,735,564,115,115,115,115,115,115,115,115,115,115,
+/* block 207 */
+596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
+596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
+596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
+596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,
+596,596,803,803,803,596,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 195 */
+/* block 208 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3337,157 +3566,177 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 196 */
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,439,439,
-439,439,439,439,439,115,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+/* block 209 */
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,467,467,
+467,467,467,467,467,115,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
-/* block 197 */
-438,438,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,438,115,438,438,
-115,115,438,115,115,438,438,115,115,438,438,438,438,115,438,438,
-438,438,438,438,438,438,439,439,439,439,115,439,115,439,439,439,
-439,439,439,439,115,439,439,439,439,439,439,439,439,439,439,439,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+/* block 210 */
+466,466,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,466,115,466,466,
+115,115,466,115,115,466,466,115,115,466,466,466,466,115,466,466,
+466,466,466,466,466,466,467,467,467,467,115,467,115,467,467,467,
+467,467,467,467,115,467,467,467,467,467,467,467,467,467,467,467,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
-/* block 198 */
-439,439,439,439,438,438,115,438,438,438,438,115,115,438,438,438,
-438,438,438,438,438,115,438,438,438,438,438,438,438,115,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,438,438,115,438,438,438,438,115,
-438,438,438,438,438,115,438,115,115,115,438,438,438,438,438,438,
-438,115,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+/* block 211 */
+467,467,467,467,466,466,115,466,466,466,466,115,115,466,466,466,
+466,466,466,466,466,115,466,466,466,466,466,466,466,115,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,466,466,115,466,466,466,466,115,
+466,466,466,466,466,115,466,115,115,115,466,466,466,466,466,466,
+466,115,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
-/* block 199 */
-438,438,438,438,438,438,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+/* block 212 */
+466,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
-/* block 200 */
-439,439,439,439,439,439,439,439,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
+/* block 213 */
+467,467,467,467,467,467,467,467,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
-/* block 201 */
-438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,115,115,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438, 8,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439, 8,439,439,439,439,
-439,439,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438, 8,439,439,439,439,
+/* block 214 */
+466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,115,115,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466, 8,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467, 8,467,467,467,467,
+467,467,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466, 8,467,467,467,467,
-/* block 202 */
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439, 8,439,439,439,439,439,439,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438, 8,439,439,439,439,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439, 8,
-439,439,439,439,439,439,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438, 8,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
+/* block 215 */
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467, 8,467,467,467,467,467,467,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466, 8,467,467,467,467,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, 8,
+467,467,467,467,467,467,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, 8,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
-/* block 203 */
-439,439,439,439,439,439,439,439,439, 8,439,439,439,439,439,439,
-438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,
-438,438,438,438,438,438,438,438,438, 8,439,439,439,439,439,439,
-439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,
-439,439,439, 8,439,439,439,439,439,439,438,439,115,115, 10, 10,
+/* block 216 */
+467,467,467,467,467,467,467,467,467, 8,467,467,467,467,467,467,
+466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,
+466,466,466,466,466,466,466,466,466, 8,467,467,467,467,467,467,
+467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,
+467,467,467, 8,467,467,467,467,467,467,466,467,115,115, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-/* block 204 */
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
-736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,
+/* block 217 */
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-/* block 205 */
-737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
-737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
-737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
-737,737,737,737,737,737,737,736,736,736,736,737,737,737,737,737,
-737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
-737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
-737,737,737,737,737,737,737,737,737,737,737,737,737,736,736,736,
-736,736,736,736,736,737,736,736,736,736,736,736,736,736,736,736,
+/* block 218 */
+805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
+805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
+805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
+805,805,805,805,805,805,805,804,804,804,804,805,805,805,805,805,
+805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
+805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
+805,805,805,805,805,805,805,805,805,805,805,805,805,804,804,804,
+804,804,804,804,804,805,804,804,804,804,804,804,804,804,804,804,
-/* block 206 */
-736,736,736,736,737,736,736,738,738,738,738,738,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,737,737,737,737,737,
-115,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,
+/* block 219 */
+804,804,804,804,805,804,804,806,806,806,806,806,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,805,805,805,805,805,
+115,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 207 */
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
+/* block 220 */
+807,807,807,807,807,807,807,115,807,807,807,807,807,807,807,807,
+807,807,807,807,807,807,807,807,807,115,115,807,807,807,807,807,
+807,807,115,807,807,115,807,807,807,807,807,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 208 */
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,
-739,739,739,739,739,115,115,740,740,740,740,740,740,740,740,740,
-741,741,741,741,741,741,741,115,115,115,115,115,115,115,115,115,
+/* block 221 */
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+
+/* block 222 */
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,
+808,808,808,808,808,115,115,809,809,809,809,809,809,809,809,809,
+810,810,810,810,810,810,810,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 209 */
-200,200,200,200,115,200,200,200,200,200,200,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
-115,200,200,115,200,115,115,200,115,200,200,200,200,200,200,200,
-200,200,200,115,200,200,200,200,115,200,115,200,115,115,115,115,
-115,115,200,115,115,115,115,200,115,200,115,200,115,200,200,200,
-115,200,200,115,200,115,115,200,115,200,115,200,115,200,115,200,
-115,200,200,115,200,115,115,200,200,200,200,115,200,200,200,200,
-200,200,200,115,200,200,200,200,115,200,200,200,200,115,200,115,
+/* block 223 */
+811,811,811,811,811,811,811,811,811,811,811,811,811,811,811,811,
+811,811,811,811,811,811,811,811,811,811,811,811,811,811,811,811,
+811,811,812,812,812,812,812,812,812,812,812,812,812,812,812,812,
+812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,
+812,812,812,812,813,813,813,813,813,813,813,115,115,115,115,115,
+814,814,814,814,814,814,814,814,814,814,115,115,115,115,815,815,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 210 */
-200,200,200,200,200,200,200,200,200,200,115,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,115,115,115,115,
-115,200,200,200,115,200,200,200,200,200,115,200,200,200,200,200,
-200,200,200,200,200,200,200,200,200,200,200,200,115,115,115,115,
+/* block 224 */
+216,216,216,216,115,216,216,216,216,216,216,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,
+115,216,216,115,216,115,115,216,115,216,216,216,216,216,216,216,
+216,216,216,115,216,216,216,216,115,216,115,216,115,115,115,115,
+115,115,216,115,115,115,115,216,115,216,115,216,115,216,216,216,
+115,216,216,115,216,115,115,216,115,216,115,216,115,216,115,216,
+115,216,216,115,216,115,115,216,216,216,216,115,216,216,216,216,
+216,216,216,115,216,216,216,216,115,216,216,216,216,115,216,115,
+
+/* block 225 */
+216,216,216,216,216,216,216,216,216,216,115,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,115,115,115,115,
+115,216,216,216,115,216,216,216,216,216,115,216,216,216,216,216,
+216,216,216,216,216,216,216,216,216,216,216,216,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-195,195,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+210,210,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 211 */
+/* block 226 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
@@ -3497,7 +3746,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 212 */
+/* block 227 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,
@@ -3507,7 +3756,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,
-/* block 213 */
+/* block 228 */
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,
@@ -3517,67 +3766,107 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 214 */
+/* block 229 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,742,742,742,742,742,742,742,742,742,742,
-742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,
+115,115,115,115,115,115,816,816,816,816,816,816,816,816,816,816,
+816,816,816,816,816,816,816,816,816,816,816,816,816,816,816,816,
-/* block 215 */
-743, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,
+/* block 230 */
+817, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 216 */
+/* block 231 */
+ 19, 19, 19, 19, 19, 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,479, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+
+/* block 232 */
+ 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,479, 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19,478,478,478, 19, 19,478, 19, 19,478,478,478, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 14, 14, 14, 14, 14,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,479, 19,479, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,818,818,818,818,818,
-/* block 217 */
+/* block 233 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19,478,478, 19, 19,478,478,478,478,478,478,478,478,478,478,
+478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19,819,819,819,819, 19, 19, 19, 19,478, 19,
+478,478,478,478,478,478,478,478,478, 19, 19, 19,478, 19, 19, 19,
+
+/* block 234 */
+ 19,478,478,478, 19,478,478,478, 19, 19, 19,479, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,479,479, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115, 19, 19, 19, 19, 19,
-/* block 218 */
+/* block 235 */
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19,479, 19, 19, 19, 19,479, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,478,478, 19, 19, 19, 19,478, 19, 19, 19, 19, 19,
+
+/* block 236 */
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+478, 19, 19, 19, 19,478,478, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 219 */
+/* block 237 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19,478,478,478, 19, 19, 19,478,478,478,478,478,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+
+/* block 238 */
+479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19,478,478,478, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, 19,
+ 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,
- 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
-/* block 220 */
+/* block 239 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3587,7 +3876,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 221 */
+/* block 240 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3597,7 +3886,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 222 */
+/* block 241 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@@ -3607,7 +3896,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-/* block 223 */
+/* block 242 */
19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,
@@ -3617,97 +3906,107 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 224 */
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
- 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+/* block 243 */
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19,478,478,478,478,478, 19,478,478,
+ 19, 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+478,478,478,478,478,478,478,478,478,478, 19, 19, 19,478,478,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-/* block 225 */
- 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+/* block 244 */
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+ 19,478,478,478,478,478,478,478,478,478,478,478,478,478, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-
-/* block 226 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-
-/* block 227 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,115,115,115,115,115,115,115,115,115,115,115,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-
-/* block 228 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,115,115,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-
-/* block 229 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-
-/* block 230 */
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,
-485,485,485,485,485,485,485,485,485,485,485,485,485,485,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
-
-/* block 231 */
-437, 22,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-
-/* block 232 */
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-/* block 233 */
+/* block 245 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 246 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,115,115,115,115,115,115,115,115,115,115,115,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+
+/* block 247 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,115,115,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+
+/* block 248 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+
+/* block 249 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 250 */
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+515,515,515,515,515,515,515,515,515,515,515,515,515,515,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
+
+/* block 251 */
+465, 22,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+
+/* block 252 */
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+
+/* block 253 */
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
@@ -3717,7 +4016,7 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
-/* block 234 */
+/* block 254 */
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
@@ -3725,17 +4024,17 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 60416 bytes, block = 128 */
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
-437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,
-
-/* block 235 */
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,
-557,557,557,557,557,557,557,557,557,557,557,557,557,557,115,115,
+465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,
+
+/* block 255 */
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,115,115,
};
diff --git a/src/3rdparty/pcre2/src/pcre2_ucp.h b/src/3rdparty/pcre2/src/pcre2_ucp.h
index 0b7553e5e0..defba4c10e 100644
--- a/src/3rdparty/pcre2/src/pcre2_ucp.h
+++ b/src/3rdparty/pcre2/src/pcre2_ucp.h
@@ -39,8 +39,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _PCRE2_UCP_H
-#define _PCRE2_UCP_H
+#ifndef PCRE2_UCP_H_IDEMPOTENT_GUARD
+#define PCRE2_UCP_H_IDEMPOTENT_GUARD
/* This file contains definitions of the property values that are returned by
the UCD access macros. New values that are added for new releases of Unicode
@@ -100,9 +100,7 @@ enum {
ucp_Zs /* Space separator */
};
-/* These are grapheme break properties. Note that the code for processing them
-assumes that the values are less than 16. If more values are added that take
-the number to 16 or more, the code will have to be rewritten. */
+/* These are grapheme break properties. */
enum {
ucp_gbCR, /* 0 */
@@ -117,7 +115,12 @@ enum {
ucp_gbLV, /* 9 Hangul syllable type LV */
ucp_gbLVT, /* 10 Hangul syllable type LVT */
ucp_gbRegionalIndicator, /* 11 */
- ucp_gbOther /* 12 */
+ ucp_gbOther, /* 12 */
+ ucp_gbE_Base, /* 13 */
+ ucp_gbE_Modifier, /* 14 */
+ ucp_gbE_Base_GAZ, /* 15 */
+ ucp_gbZWJ, /* 16 */
+ ucp_gbGlue_After_Zwj /* 17 */
};
/* These are the script identifications. */
@@ -184,13 +187,13 @@ enum {
ucp_Tifinagh,
ucp_Ugaritic,
ucp_Yi,
- /* New for Unicode 5.0: */
+ /* New for Unicode 5.0 */
ucp_Balinese,
ucp_Cuneiform,
ucp_Nko,
ucp_Phags_Pa,
ucp_Phoenician,
- /* New for Unicode 5.1: */
+ /* New for Unicode 5.1 */
ucp_Carian,
ucp_Cham,
ucp_Kayah_Li,
@@ -202,7 +205,7 @@ enum {
ucp_Saurashtra,
ucp_Sundanese,
ucp_Vai,
- /* New for Unicode 5.2: */
+ /* New for Unicode 5.2 */
ucp_Avestan,
ucp_Bamum,
ucp_Egyptian_Hieroglyphs,
@@ -218,11 +221,11 @@ enum {
ucp_Samaritan,
ucp_Tai_Tham,
ucp_Tai_Viet,
- /* New for Unicode 6.0.0: */
+ /* New for Unicode 6.0.0 */
ucp_Batak,
ucp_Brahmi,
ucp_Mandaic,
- /* New for Unicode 6.1.0: */
+ /* New for Unicode 6.1.0 */
ucp_Chakma,
ucp_Meroitic_Cursive,
ucp_Meroitic_Hieroglyphs,
@@ -230,7 +233,7 @@ enum {
ucp_Sharada,
ucp_Sora_Sompeng,
ucp_Takri,
- /* New for Unicode 7.0.0: */
+ /* New for Unicode 7.0.0 */
ucp_Bassa_Vah,
ucp_Caucasian_Albanian,
ucp_Duployan,
@@ -254,15 +257,26 @@ enum {
ucp_Siddham,
ucp_Tirhuta,
ucp_Warang_Citi,
- /* New for Unicode 8.0.0: */
+ /* New for Unicode 8.0.0 */
ucp_Ahom,
ucp_Anatolian_Hieroglyphs,
ucp_Hatran,
ucp_Multani,
ucp_Old_Hungarian,
- ucp_SignWriting
+ ucp_SignWriting,
+ /* New for Unicode 10.0.0 (no update since 8.0.0) */
+ ucp_Adlam,
+ ucp_Bhaiksuki,
+ ucp_Marchen,
+ ucp_Newa,
+ ucp_Osage,
+ ucp_Tangut,
+ ucp_Masaram_Gondi,
+ ucp_Nushu,
+ ucp_Soyombo,
+ ucp_Zanabazar_Square
};
-#endif
+#endif /* PCRE2_UCP_H_IDEMPOTENT_GUARD */
/* End of pcre2_ucp.h */
diff --git a/src/3rdparty/pcre2/src/pcre2_valid_utf.c b/src/3rdparty/pcre2/src/pcre2_valid_utf.c
index 2dfd8df34d..96e8bff993 100644
--- a/src/3rdparty/pcre2/src/pcre2_valid_utf.c
+++ b/src/3rdparty/pcre2/src/pcre2_valid_utf.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -93,8 +93,8 @@ Returns: == 0 if the string is a valid UTF string
int
PRIV(valid_utf)(PCRE2_SPTR string, PCRE2_SIZE length, PCRE2_SIZE *erroroffset)
{
-register PCRE2_SPTR p;
-register uint32_t c;
+PCRE2_SPTR p;
+uint32_t c;
/* ----------------- Check a UTF-8 string ----------------- */
@@ -133,7 +133,7 @@ PCRE2_ERROR_UTF8_ERR21 Byte with the illegal value 0xfe or 0xff
for (p = string; length > 0; p++)
{
- register uint32_t ab, d;
+ uint32_t ab, d;
c = *p;
length--;
@@ -142,20 +142,20 @@ for (p = string; length > 0; p++)
if (c < 0xc0) /* Isolated 10xx xxxx byte */
{
- *erroroffset = (int)(p - string);
+ *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF8_ERR20;
}
if (c >= 0xfe) /* Invalid 0xfe or 0xff bytes */
{
- *erroroffset = (int)(p - string);
+ *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF8_ERR21;
}
ab = PRIV(utf8_table4)[c & 0x3f]; /* Number of additional bytes (1-5) */
if (length < ab) /* Missing bytes */
{
- *erroroffset = (int)(p - string);
+ *erroroffset = (PCRE2_SIZE)(p - string);
switch(ab - length)
{
case 1: return PCRE2_ERROR_UTF8_ERR1;
diff --git a/src/3rdparty/pcre2/src/sljit/sljitConfig.h b/src/3rdparty/pcre2/src/sljit/sljitConfig.h
index a548c37ab6..b65584a4af 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitConfig.h
+++ b/src/3rdparty/pcre2/src/sljit/sljitConfig.h
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -90,10 +90,20 @@
/* Executable code allocation:
If SLJIT_EXECUTABLE_ALLOCATOR is not defined, the application should
- define both SLJIT_MALLOC_EXEC and SLJIT_FREE_EXEC. */
+ define SLJIT_MALLOC_EXEC, SLJIT_FREE_EXEC, and SLJIT_EXEC_OFFSET. */
#ifndef SLJIT_EXECUTABLE_ALLOCATOR
/* Enabled by default. */
#define SLJIT_EXECUTABLE_ALLOCATOR 1
+
+/* When SLJIT_PROT_EXECUTABLE_ALLOCATOR is enabled SLJIT uses
+ an allocator which does not set writable and executable
+ permission flags at the same time. The trade-of is increased
+ memory consumption and disabled dynamic code modifications. */
+#ifndef SLJIT_PROT_EXECUTABLE_ALLOCATOR
+/* Disabled by default. */
+#define SLJIT_PROT_EXECUTABLE_ALLOCATOR 0
+#endif
+
#endif
/* Force cdecl calling convention even if a better calling
diff --git a/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h b/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
index 566c368063..cc0810fbd7 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
+++ b/src/3rdparty/pcre2/src/sljit/sljitConfigInternal.h
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -187,14 +187,6 @@
/* External function definitions. */
/**********************************/
-#if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED)
-
-/* These libraries are needed for the macros below. */
-#include <stdlib.h>
-#include <string.h>
-
-#endif /* SLJIT_STD_MACROS_DEFINED */
-
/* General macros:
Note: SLJIT is designed to be independent from them as possible.
@@ -304,6 +296,13 @@
#define SLJIT_CACHE_FLUSH(from, to) \
sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
+#elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
+
+/* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */
+#define SLJIT_CACHE_FLUSH(from, to) \
+ ppc_cache_flush((from), (to))
+#define SLJIT_CACHE_FLUSH_OWN_IMPL 1
+
#elif (defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
#define SLJIT_CACHE_FLUSH(from, to) \
@@ -316,13 +315,6 @@
#define SLJIT_CACHE_FLUSH(from, to) \
cacheflush((long)(from), (long)(to), 0)
-#elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
-
-/* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */
-#define SLJIT_CACHE_FLUSH(from, to) \
- ppc_cache_flush((from), (to))
-#define SLJIT_CACHE_FLUSH_OWN_IMPL 1
-
#elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
/* The __clear_cache() implementation of GCC is a dummy function on Sparc. */
@@ -401,7 +393,9 @@ typedef double sljit_f64;
#ifndef SLJIT_W
/* Defining long constants. */
-#if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
+#if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
+#define SLJIT_W(w) (w##l)
+#elif (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
#define SLJIT_W(w) (w##ll)
#else
#define SLJIT_W(w) (w)
@@ -545,6 +539,14 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr);
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
#define SLJIT_MALLOC_EXEC(size) sljit_malloc_exec(size)
#define SLJIT_FREE_EXEC(ptr) sljit_free_exec(ptr)
+
+#if (defined SLJIT_PROT_EXECUTABLE_ALLOCATOR && SLJIT_PROT_EXECUTABLE_ALLOCATOR)
+SLJIT_API_FUNC_ATTRIBUTE sljit_sw sljit_exec_offset(void* ptr);
+#define SLJIT_EXEC_OFFSET(ptr) sljit_exec_offset(ptr)
+#else
+#define SLJIT_EXEC_OFFSET(ptr) 0
+#endif
+
#endif
/**********************************************/
@@ -553,37 +555,37 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-#define SLJIT_NUMBER_OF_REGISTERS 10
-#define SLJIT_NUMBER_OF_SAVED_REGISTERS 7
+#define SLJIT_NUMBER_OF_REGISTERS 12
+#define SLJIT_NUMBER_OF_SAVED_REGISTERS 9
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
-#define SLJIT_LOCALS_OFFSET_BASE ((2 + 4) * sizeof(sljit_sw))
+#define SLJIT_LOCALS_OFFSET_BASE (compiler->locals_offset)
#else
/* Maximum 3 arguments are passed on the stack, +1 for double alignment. */
-#define SLJIT_LOCALS_OFFSET_BASE ((3 + 1 + 4) * sizeof(sljit_sw))
+#define SLJIT_LOCALS_OFFSET_BASE (compiler->locals_offset)
#endif /* SLJIT_X86_32_FASTCALL */
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
#ifndef _WIN64
-#define SLJIT_NUMBER_OF_REGISTERS 12
+#define SLJIT_NUMBER_OF_REGISTERS 13
#define SLJIT_NUMBER_OF_SAVED_REGISTERS 6
-#define SLJIT_LOCALS_OFFSET_BASE (sizeof(sljit_sw))
+#define SLJIT_LOCALS_OFFSET_BASE 0
#else
-#define SLJIT_NUMBER_OF_REGISTERS 12
+#define SLJIT_NUMBER_OF_REGISTERS 13
#define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
-#define SLJIT_LOCALS_OFFSET_BASE ((4 + 2) * sizeof(sljit_sw))
+#define SLJIT_LOCALS_OFFSET_BASE (compiler->locals_offset)
#endif /* _WIN64 */
#elif (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
-#define SLJIT_NUMBER_OF_REGISTERS 11
+#define SLJIT_NUMBER_OF_REGISTERS 12
#define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
#define SLJIT_LOCALS_OFFSET_BASE 0
#elif (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)
-#define SLJIT_NUMBER_OF_REGISTERS 11
-#define SLJIT_NUMBER_OF_SAVED_REGISTERS 7
+#define SLJIT_NUMBER_OF_REGISTERS 12
+#define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
#define SLJIT_LOCALS_OFFSET_BASE 0
#elif (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
@@ -607,7 +609,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
#elif (defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS)
-#define SLJIT_NUMBER_OF_REGISTERS 17
+#define SLJIT_NUMBER_OF_REGISTERS 21
#define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
#define SLJIT_LOCALS_OFFSET_BASE (4 * sizeof(sljit_sw))
@@ -663,7 +665,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
#if (defined SLJIT_DEBUG && SLJIT_DEBUG)
-#if !defined(SLJIT_ASSERT) || !defined(SLJIT_ASSERT_STOP)
+#if !defined(SLJIT_ASSERT) || !defined(SLJIT_UNREACHABLE)
/* SLJIT_HALT_PROCESS must halt the process. */
#ifndef SLJIT_HALT_PROCESS
@@ -675,7 +677,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
#include <stdio.h>
-#endif /* !SLJIT_ASSERT || !SLJIT_ASSERT_STOP */
+#endif /* !SLJIT_ASSERT || !SLJIT_UNREACHABLE */
/* Feel free to redefine these two macros. */
#ifndef SLJIT_ASSERT
@@ -690,34 +692,33 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
#endif /* !SLJIT_ASSERT */
-#ifndef SLJIT_ASSERT_STOP
+#ifndef SLJIT_UNREACHABLE
-#define SLJIT_ASSERT_STOP() \
+#define SLJIT_UNREACHABLE() \
do { \
printf("Should never been reached " __FILE__ ":%d\n", __LINE__); \
SLJIT_HALT_PROCESS(); \
} while (0)
-#endif /* !SLJIT_ASSERT_STOP */
+#endif /* !SLJIT_UNREACHABLE */
#else /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */
/* Forcing empty, but valid statements. */
#undef SLJIT_ASSERT
-#undef SLJIT_ASSERT_STOP
+#undef SLJIT_UNREACHABLE
#define SLJIT_ASSERT(x) \
do { } while (0)
-#define SLJIT_ASSERT_STOP() \
+#define SLJIT_UNREACHABLE() \
do { } while (0)
#endif /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */
#ifndef SLJIT_COMPILE_ASSERT
-/* Should be improved eventually. */
#define SLJIT_COMPILE_ASSERT(x, description) \
- SLJIT_ASSERT(x)
+ switch(0) { case 0: case ((x) ? 1 : 0): break; }
#endif /* !SLJIT_COMPILE_ASSERT */
diff --git a/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c b/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c
index 54f05f5dd7..f5009788f6 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitExecAllocator.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -86,7 +86,7 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
}
-static SLJIT_INLINE void free_chunk(void* chunk, sljit_uw size)
+static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
{
SLJIT_UNUSED_ARG(size);
VirtualFree(chunk, 0, MEM_RELEASE);
@@ -96,7 +96,7 @@ static SLJIT_INLINE void free_chunk(void* chunk, sljit_uw size)
static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
{
- void* retval;
+ void *retval;
#ifdef MAP_ANON
retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
@@ -111,7 +111,7 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
return (retval != MAP_FAILED) ? retval : NULL;
}
-static SLJIT_INLINE void free_chunk(void* chunk, sljit_uw size)
+static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
{
munmap(chunk, size);
}
@@ -180,8 +180,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
sljit_uw chunk_size;
allocator_grab_lock();
- if (size < sizeof(struct free_block))
- size = sizeof(struct free_block);
+ if (size < (64 - sizeof(struct block_header)))
+ size = (64 - sizeof(struct block_header));
size = ALIGN_SIZE(size);
free_block = free_blocks;
diff --git a/src/3rdparty/pcre2/src/sljit/sljitLir.c b/src/3rdparty/pcre2/src/sljit/sljitLir.c
index ec1781e4c7..c0bbb5201a 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitLir.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitLir.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -26,6 +26,14 @@
#include "sljitLir.h"
+#if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED)
+
+/* These libraries are needed for the macros below. */
+#include <stdlib.h>
+#include <string.h>
+
+#endif /* SLJIT_STD_MACROS_DEFINED */
+
#define CHECK_ERROR() \
do { \
if (SLJIT_UNLIKELY(compiler->error)) \
@@ -76,14 +84,18 @@
#if !(defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
+#define VARIABLE_FLAG_SHIFT (10)
+#define VARIABLE_FLAG_MASK (0x3f << VARIABLE_FLAG_SHIFT)
+#define GET_FLAG_TYPE(op) ((op) >> VARIABLE_FLAG_SHIFT)
+
#define GET_OPCODE(op) \
- ((op) & ~(SLJIT_I32_OP | SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))
+ ((op) & ~(SLJIT_I32_OP | SLJIT_SET_Z | VARIABLE_FLAG_MASK))
-#define GET_FLAGS(op) \
- ((op) & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C))
+#define HAS_FLAGS(op) \
+ ((op) & (SLJIT_SET_Z | VARIABLE_FLAG_MASK))
#define GET_ALL_FLAGS(op) \
- ((op) & (SLJIT_I32_OP | SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))
+ ((op) & (SLJIT_I32_OP | SLJIT_SET_Z | VARIABLE_FLAG_MASK))
#define TYPE_CAST_NEEDED(op) \
(((op) >= SLJIT_MOV_U8 && (op) <= SLJIT_MOV_S16) || ((op) >= SLJIT_MOVU_U8 && (op) <= SLJIT_MOVU_S16))
@@ -112,10 +124,10 @@
/* SLJIT_REWRITABLE_JUMP is 0x1000. */
#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
-# define PATCH_MB 0x4
-# define PATCH_MW 0x8
+# define PATCH_MB 0x4
+# define PATCH_MW 0x8
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-# define PATCH_MD 0x10
+# define PATCH_MD 0x10
#endif
#endif
@@ -242,9 +254,21 @@
#if !(defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
#if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
+
+#if (defined SLJIT_PROT_EXECUTABLE_ALLOCATOR && SLJIT_PROT_EXECUTABLE_ALLOCATOR)
+#include "sljitProtExecAllocator.c"
+#else
#include "sljitExecAllocator.c"
#endif
+#endif
+
+#if (defined SLJIT_PROT_EXECUTABLE_ALLOCATOR && SLJIT_PROT_EXECUTABLE_ALLOCATOR)
+#define SLJIT_ADD_EXEC_OFFSET(ptr, exec_offset) ((sljit_u8 *)(ptr) + (exec_offset))
+#else
+#define SLJIT_ADD_EXEC_OFFSET(ptr, exec_offset) ((sljit_u8 *)(ptr))
+#endif
+
/* Argument checking features. */
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
@@ -318,7 +342,7 @@
/* Public functions */
/* --------------------------------------------------------------------- */
-#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
#define SLJIT_NEEDS_COMPILER_INIT 1
static sljit_s32 compiler_initialized = 0;
/* A thread safe initialization. */
@@ -345,6 +369,8 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_create_compiler(void *allo
int_op_and_single_op_must_be_the_same);
SLJIT_COMPILE_ASSERT(SLJIT_REWRITABLE_JUMP != SLJIT_F32_OP,
rewritable_jump_and_single_op_must_not_be_the_same);
+ SLJIT_COMPILE_ASSERT(!(SLJIT_EQUAL & 0x1) && !(SLJIT_LESS & 0x1) && !(SLJIT_EQUAL_F64 & 0x1) && !(SLJIT_JUMP & 0x1),
+ conditional_flags_must_be_even_numbers);
/* Only the non-zero members must be set. */
compiler->error = SLJIT_SUCCESS;
@@ -479,6 +505,18 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw
}
}
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_current_flags(struct sljit_compiler *compiler, sljit_s32 current_flags)
+{
+ SLJIT_UNUSED_ARG(compiler);
+ SLJIT_UNUSED_ARG(current_flags);
+
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ if ((current_flags & ~(VARIABLE_FLAG_MASK | SLJIT_I32_OP | SLJIT_SET_Z)) == 0) {
+ compiler->last_flags = GET_FLAG_TYPE(current_flags) | (current_flags & (SLJIT_I32_OP | SLJIT_SET_Z));
+ }
+#endif
+}
+
/* --------------------------------------------------------------------- */
/* Private functions */
/* --------------------------------------------------------------------- */
@@ -624,65 +662,6 @@ static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_comp
(((exp) & SLJIT_MEM) && (((exp) & REG_MASK) == reg || OFFS_REG(exp) == reg))
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
-#define FUNCTION_CHECK_OP() \
- CHECK_ARGUMENT(!GET_FLAGS(op) || !(op & SLJIT_KEEP_FLAGS)); \
- switch (GET_OPCODE(op)) { \
- case SLJIT_NOT: \
- case SLJIT_CLZ: \
- case SLJIT_AND: \
- case SLJIT_OR: \
- case SLJIT_XOR: \
- case SLJIT_SHL: \
- case SLJIT_LSHR: \
- case SLJIT_ASHR: \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C))); \
- break; \
- case SLJIT_NEG: \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_C))); \
- break; \
- case SLJIT_MUL: \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_C))); \
- break; \
- case SLJIT_ADD: \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_U | SLJIT_SET_S))); \
- break; \
- case SLJIT_SUB: \
- break; \
- case SLJIT_ADDC: \
- case SLJIT_SUBC: \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O))); \
- break; \
- case SLJIT_BREAKPOINT: \
- case SLJIT_NOP: \
- case SLJIT_LMUL_UW: \
- case SLJIT_LMUL_SW: \
- case SLJIT_MOV: \
- case SLJIT_MOV_U32: \
- case SLJIT_MOV_P: \
- case SLJIT_MOVU: \
- case SLJIT_MOVU_U32: \
- case SLJIT_MOVU_P: \
- /* Nothing allowed */ \
- CHECK_ARGUMENT(!(op & (SLJIT_I32_OP | SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
- break; \
- default: \
- /* Only SLJIT_I32_OP or SLJIT_F32_OP is allowed. */ \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
- break; \
- }
-
-#define FUNCTION_CHECK_FOP() \
- CHECK_ARGUMENT(!GET_FLAGS(op) || !(op & SLJIT_KEEP_FLAGS)); \
- switch (GET_OPCODE(op)) { \
- case SLJIT_CMP_F64: \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
- CHECK_ARGUMENT((op & (SLJIT_SET_E | SLJIT_SET_S))); \
- break; \
- default: \
- /* Only SLJIT_I32_OP or SLJIT_F32_OP is allowed. */ \
- CHECK_ARGUMENT(!(op & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
- break; \
- }
#define FUNCTION_CHECK_IS_REG(r) \
(((r) >= SLJIT_R0 && (r) < (SLJIT_R0 + compiler->scratches)) || \
@@ -718,12 +697,12 @@ static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_comp
CHECK_NOT_VIRTUAL_REGISTER(OFFS_REG(p)); \
CHECK_ARGUMENT(!((i) & ~0x3)); \
} \
- CHECK_ARGUMENT(!((p) & ~(SLJIT_MEM | SLJIT_IMM | REG_MASK | OFFS_REG_MASK))); \
+ CHECK_ARGUMENT(!((p) & ~(SLJIT_MEM | REG_MASK | OFFS_REG_MASK))); \
}
-#define FUNCTION_CHECK_DST(p, i) \
+#define FUNCTION_CHECK_DST(p, i, unused) \
CHECK_ARGUMENT(compiler->scratches != -1 && compiler->saveds != -1); \
- if (FUNCTION_CHECK_IS_REG_OR_UNUSED(p)) \
+ if (FUNCTION_CHECK_IS_REG(p) || ((unused) && (p) == SLJIT_UNUSED)) \
CHECK_ARGUMENT((i) == 0); \
else if ((p) == (SLJIT_MEM1(SLJIT_SP))) \
CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
@@ -737,7 +716,7 @@ static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_comp
CHECK_NOT_VIRTUAL_REGISTER(OFFS_REG(p)); \
CHECK_ARGUMENT(!((i) & ~0x3)); \
} \
- CHECK_ARGUMENT(!((p) & ~(SLJIT_MEM | SLJIT_IMM | REG_MASK | OFFS_REG_MASK))); \
+ CHECK_ARGUMENT(!((p) & ~(SLJIT_MEM | REG_MASK | OFFS_REG_MASK))); \
}
#define FUNCTION_FCHECK(p, i) \
@@ -757,15 +736,7 @@ static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_comp
CHECK_NOT_VIRTUAL_REGISTER(OFFS_REG(p)); \
CHECK_ARGUMENT(((p) & OFFS_REG_MASK) != TO_OFFS_REG(SLJIT_SP) && !(i & ~0x3)); \
} \
- CHECK_ARGUMENT(!((p) & ~(SLJIT_MEM | SLJIT_IMM | REG_MASK | OFFS_REG_MASK))); \
- }
-
-#define FUNCTION_CHECK_OP1() \
- if (GET_OPCODE(op) >= SLJIT_MOVU && GET_OPCODE(op) <= SLJIT_MOVU_P) { \
- CHECK_ARGUMENT(!(src & SLJIT_MEM) || (src & REG_MASK) != SLJIT_SP); \
- CHECK_ARGUMENT(!(dst & SLJIT_MEM) || (dst & REG_MASK) != SLJIT_SP); \
- if ((src & SLJIT_MEM) && (src & REG_MASK)) \
- CHECK_ARGUMENT((dst & REG_MASK) != (src & REG_MASK) && OFFS_REG(dst) != (src & REG_MASK)); \
+ CHECK_ARGUMENT(!((p) & ~(SLJIT_MEM | REG_MASK | OFFS_REG_MASK))); \
}
#endif /* SLJIT_ARGUMENT_CHECKS */
@@ -791,8 +762,10 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *comp
do { \
if ((r) < (SLJIT_R0 + compiler->scratches)) \
fprintf(compiler->verbose, "r%d", (r) - SLJIT_R0); \
- else \
+ else if ((r) != SLJIT_SP) \
fprintf(compiler->verbose, "s%d", SLJIT_NUMBER_OF_REGISTERS - (r)); \
+ else \
+ fprintf(compiler->verbose, "sp"); \
} while (0)
#define sljit_verbose_param(compiler, p, i) \
@@ -885,6 +858,7 @@ static char* jump_names[] = {
(char*)"sig_greater", (char*)"sig_less_equal",
(char*)"overflow", (char*)"not_overflow",
(char*)"mul_overflow", (char*)"mul_not_overflow",
+ (char*)"carry", (char*)"",
(char*)"equal", (char*)"not_equal",
(char*)"less", (char*)"greater_equal",
(char*)"greater", (char*)"less_equal",
@@ -929,7 +903,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_enter(struct sljit_compil
SLJIT_UNUSED_ARG(compiler);
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(!(options & ~SLJIT_DOUBLE_ALIGNMENT));
+ CHECK_ARGUMENT(!(options & ~SLJIT_F64_ALIGNMENT));
CHECK_ARGUMENT(args >= 0 && args <= 3);
CHECK_ARGUMENT(scratches >= 0 && scratches <= SLJIT_NUMBER_OF_REGISTERS);
CHECK_ARGUMENT(saveds >= 0 && saveds <= SLJIT_NUMBER_OF_REGISTERS);
@@ -939,6 +913,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_enter(struct sljit_compil
CHECK_ARGUMENT(fsaveds >= 0 && fsaveds <= SLJIT_NUMBER_OF_FLOAT_REGISTERS);
CHECK_ARGUMENT(fscratches + fsaveds <= SLJIT_NUMBER_OF_FLOAT_REGISTERS);
CHECK_ARGUMENT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose))
@@ -952,13 +927,8 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_set_context(struct sljit_compi
sljit_s32 options, sljit_s32 args, sljit_s32 scratches, sljit_s32 saveds,
sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size)
{
- if (SLJIT_UNLIKELY(compiler->skip_checks)) {
- compiler->skip_checks = 0;
- CHECK_RETURN_OK;
- }
-
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(!(options & ~SLJIT_DOUBLE_ALIGNMENT));
+ CHECK_ARGUMENT(!(options & ~SLJIT_F64_ALIGNMENT));
CHECK_ARGUMENT(args >= 0 && args <= 3);
CHECK_ARGUMENT(scratches >= 0 && scratches <= SLJIT_NUMBER_OF_REGISTERS);
CHECK_ARGUMENT(saveds >= 0 && saveds <= SLJIT_NUMBER_OF_REGISTERS);
@@ -968,6 +938,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_set_context(struct sljit_compi
CHECK_ARGUMENT(fsaveds >= 0 && fsaveds <= SLJIT_NUMBER_OF_FLOAT_REGISTERS);
CHECK_ARGUMENT(fscratches + fsaveds <= SLJIT_NUMBER_OF_FLOAT_REGISTERS);
CHECK_ARGUMENT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose))
@@ -987,6 +958,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_return(struct sljit_compi
}
else
CHECK_ARGUMENT(src == 0 && srcw == 0);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1005,7 +977,8 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_return(struct sljit_compi
static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
{
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- FUNCTION_CHECK_DST(dst, dstw);
+ FUNCTION_CHECK_DST(dst, dstw, 0);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1021,6 +994,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fast_return(struct sljit_
{
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
FUNCTION_CHECK_SRC(src, srcw);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1038,6 +1012,8 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op0(struct sljit_compiler
CHECK_ARGUMENT((op >= SLJIT_BREAKPOINT && op <= SLJIT_LMUL_SW)
|| ((op & ~SLJIT_I32_OP) >= SLJIT_DIVMOD_UW && (op & ~SLJIT_I32_OP) <= SLJIT_DIV_SW));
CHECK_ARGUMENT(op < SLJIT_LMUL_UW || compiler->scratches >= 2);
+ if (op >= SLJIT_LMUL_UW)
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose))
@@ -1063,10 +1039,49 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op1(struct sljit_compiler
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
CHECK_ARGUMENT(GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_CLZ);
- FUNCTION_CHECK_OP();
+
+ switch (GET_OPCODE(op)) {
+ case SLJIT_NOT:
+ /* Only SLJIT_I32_OP and SLJIT_SET_Z are allowed. */
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK));
+ break;
+ case SLJIT_NEG:
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK)
+ || GET_FLAG_TYPE(op) == SLJIT_OVERFLOW);
+ break;
+ case SLJIT_MOV:
+ case SLJIT_MOV_U32:
+ case SLJIT_MOV_P:
+ case SLJIT_MOVU:
+ case SLJIT_MOVU_U32:
+ case SLJIT_MOVU_P:
+ /* Nothing allowed */
+ CHECK_ARGUMENT(!(op & (SLJIT_I32_OP | SLJIT_SET_Z | VARIABLE_FLAG_MASK)));
+ break;
+ default:
+ /* Only SLJIT_I32_OP is allowed. */
+ CHECK_ARGUMENT(!(op & (SLJIT_SET_Z | VARIABLE_FLAG_MASK)));
+ break;
+ }
+
+ FUNCTION_CHECK_DST(dst, dstw, 1);
FUNCTION_CHECK_SRC(src, srcw);
- FUNCTION_CHECK_DST(dst, dstw);
- FUNCTION_CHECK_OP1();
+
+ if (GET_OPCODE(op) >= SLJIT_NOT)
+ compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z));
+ else if (GET_OPCODE(op) >= SLJIT_MOVU) {
+ CHECK_ARGUMENT(!(src & SLJIT_MEM) || (src & REG_MASK) != SLJIT_SP);
+ CHECK_ARGUMENT(!(dst & SLJIT_MEM) || (dst & REG_MASK) != SLJIT_SP);
+ if ((src & REG_MASK) != SLJIT_UNUSED) {
+ CHECK_ARGUMENT((src & REG_MASK) != (dst & REG_MASK) && (src & REG_MASK) != OFFS_REG(dst));
+ CHECK_ARGUMENT((src & OFFS_REG_MASK) == SLJIT_UNUSED || srcw == 0);
+ }
+ if ((dst & REG_MASK) != SLJIT_UNUSED) {
+ CHECK_ARGUMENT((dst & REG_MASK) != OFFS_REG(src));
+ CHECK_ARGUMENT((dst & OFFS_REG_MASK) == SLJIT_UNUSED || dstw == 0);
+ }
+ compiler->last_flags = 0;
+ }
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1077,9 +1092,9 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op1(struct sljit_compiler
}
else
{
- fprintf(compiler->verbose, " %s%s%s%s%s%s%s%s ", op1_names[GET_OPCODE(op) - SLJIT_OP1_BASE], !(op & SLJIT_I32_OP) ? "" : "32",
- !(op & SLJIT_SET_E) ? "" : ".e", !(op & SLJIT_SET_U) ? "" : ".u", !(op & SLJIT_SET_S) ? "" : ".s",
- !(op & SLJIT_SET_O) ? "" : ".o", !(op & SLJIT_SET_C) ? "" : ".c", !(op & SLJIT_KEEP_FLAGS) ? "" : ".k");
+ fprintf(compiler->verbose, " %s%s%s%s%s ", op1_names[GET_OPCODE(op) - SLJIT_OP1_BASE], !(op & SLJIT_I32_OP) ? "" : "32",
+ !(op & SLJIT_SET_Z) ? "" : ".z", !(op & VARIABLE_FLAG_MASK) ? "" : ".",
+ !(op & VARIABLE_FLAG_MASK) ? "" : jump_names[GET_FLAG_TYPE(op)]);
}
sljit_verbose_param(compiler, dst, dstw);
@@ -1103,16 +1118,53 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op2(struct sljit_compiler
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
CHECK_ARGUMENT(GET_OPCODE(op) >= SLJIT_ADD && GET_OPCODE(op) <= SLJIT_ASHR);
- FUNCTION_CHECK_OP();
+
+ switch (GET_OPCODE(op)) {
+ case SLJIT_AND:
+ case SLJIT_OR:
+ case SLJIT_XOR:
+ case SLJIT_SHL:
+ case SLJIT_LSHR:
+ case SLJIT_ASHR:
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK));
+ break;
+ case SLJIT_MUL:
+ CHECK_ARGUMENT(!(op & SLJIT_SET_Z));
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK)
+ || GET_FLAG_TYPE(op) == SLJIT_MUL_OVERFLOW);
+ break;
+ case SLJIT_ADD:
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK)
+ || GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY)
+ || GET_FLAG_TYPE(op) == SLJIT_OVERFLOW);
+ break;
+ case SLJIT_SUB:
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK)
+ || (GET_FLAG_TYPE(op) >= SLJIT_LESS && GET_FLAG_TYPE(op) <= SLJIT_OVERFLOW)
+ || GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY));
+ break;
+ case SLJIT_ADDC:
+ case SLJIT_SUBC:
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK)
+ || GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY));
+ CHECK_ARGUMENT((compiler->last_flags & 0xff) == GET_FLAG_TYPE(SLJIT_SET_CARRY));
+ CHECK_ARGUMENT((op & SLJIT_I32_OP) == (compiler->last_flags & SLJIT_I32_OP));
+ break;
+ default:
+ SLJIT_UNREACHABLE();
+ break;
+ }
+
+ FUNCTION_CHECK_DST(dst, dstw, 1);
FUNCTION_CHECK_SRC(src1, src1w);
FUNCTION_CHECK_SRC(src2, src2w);
- FUNCTION_CHECK_DST(dst, dstw);
+ compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z));
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
- fprintf(compiler->verbose, " %s%s%s%s%s%s%s%s ", op2_names[GET_OPCODE(op) - SLJIT_OP2_BASE], !(op & SLJIT_I32_OP) ? "" : "32",
- !(op & SLJIT_SET_E) ? "" : ".e", !(op & SLJIT_SET_U) ? "" : ".u", !(op & SLJIT_SET_S) ? "" : ".s",
- !(op & SLJIT_SET_O) ? "" : ".o", !(op & SLJIT_SET_C) ? "" : ".c", !(op & SLJIT_KEEP_FLAGS) ? "" : ".k");
+ fprintf(compiler->verbose, " %s%s%s%s%s ", op2_names[GET_OPCODE(op) - SLJIT_OP2_BASE], !(op & SLJIT_I32_OP) ? "" : "32",
+ !(op & SLJIT_SET_Z) ? "" : ".z", !(op & VARIABLE_FLAG_MASK) ? "" : ".",
+ !(op & VARIABLE_FLAG_MASK) ? "" : jump_names[GET_FLAG_TYPE(op)]);
sljit_verbose_param(compiler, dst, dstw);
fprintf(compiler->verbose, ", ");
sljit_verbose_param(compiler, src1, src1w);
@@ -1153,6 +1205,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_custom(struct sljit_co
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
CHECK_ARGUMENT(instruction);
+
#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
CHECK_ARGUMENT(size > 0 && size < 16);
#elif (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)
@@ -1162,6 +1215,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_custom(struct sljit_co
CHECK_ARGUMENT(size == 4 && (((sljit_sw)instruction) & 0x3) == 0);
#endif
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1184,9 +1238,9 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1(struct sljit_compile
}
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_is_fpu_available());
+ CHECK_ARGUMENT(sljit_has_cpu_feature(SLJIT_HAS_FPU));
CHECK_ARGUMENT(GET_OPCODE(op) >= SLJIT_MOV_F64 && GET_OPCODE(op) <= SLJIT_ABS_F64);
- FUNCTION_CHECK_FOP();
+ CHECK_ARGUMENT(!(op & (SLJIT_SET_Z | VARIABLE_FLAG_MASK)));
FUNCTION_FCHECK(src, srcw);
FUNCTION_FCHECK(dst, dstw);
#endif
@@ -1212,22 +1266,31 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1_cmp(struct sljit_com
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z));
+#endif
+
if (SLJIT_UNLIKELY(compiler->skip_checks)) {
compiler->skip_checks = 0;
CHECK_RETURN_OK;
}
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_is_fpu_available());
+ CHECK_ARGUMENT(sljit_has_cpu_feature(SLJIT_HAS_FPU));
CHECK_ARGUMENT(GET_OPCODE(op) == SLJIT_CMP_F64);
- FUNCTION_CHECK_FOP();
+ CHECK_ARGUMENT(!(op & SLJIT_SET_Z));
+ CHECK_ARGUMENT((op & VARIABLE_FLAG_MASK)
+ || (GET_FLAG_TYPE(op) >= SLJIT_EQUAL_F64 && GET_FLAG_TYPE(op) <= SLJIT_ORDERED_F64));
FUNCTION_FCHECK(src1, src1w);
FUNCTION_FCHECK(src2, src2w);
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
- fprintf(compiler->verbose, " %s%s%s%s ", fop1_names[SLJIT_CMP_F64 - SLJIT_FOP1_BASE], (op & SLJIT_F32_OP) ? ".f32" : ".f64",
- (op & SLJIT_SET_E) ? ".e" : "", (op & SLJIT_SET_S) ? ".s" : "");
+ fprintf(compiler->verbose, " %s%s", fop1_names[SLJIT_CMP_F64 - SLJIT_FOP1_BASE], (op & SLJIT_F32_OP) ? ".f32" : ".f64");
+ if (op & VARIABLE_FLAG_MASK) {
+ fprintf(compiler->verbose, ".%s_f", jump_names[GET_FLAG_TYPE(op)]);
+ }
+ fprintf(compiler->verbose, " ");
sljit_verbose_fparam(compiler, src1, src1w);
fprintf(compiler->verbose, ", ");
sljit_verbose_fparam(compiler, src2, src2w);
@@ -1247,11 +1310,11 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1_conv_sw_from_f64(str
}
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_is_fpu_available());
+ CHECK_ARGUMENT(sljit_has_cpu_feature(SLJIT_HAS_FPU));
CHECK_ARGUMENT(GET_OPCODE(op) >= SLJIT_CONV_SW_FROM_F64 && GET_OPCODE(op) <= SLJIT_CONV_S32_FROM_F64);
- FUNCTION_CHECK_FOP();
+ CHECK_ARGUMENT(!(op & (SLJIT_SET_Z | VARIABLE_FLAG_MASK)));
FUNCTION_FCHECK(src, srcw);
- FUNCTION_CHECK_DST(dst, dstw);
+ FUNCTION_CHECK_DST(dst, dstw, 0);
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1277,9 +1340,9 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1_conv_f64_from_sw(str
}
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_is_fpu_available());
+ CHECK_ARGUMENT(sljit_has_cpu_feature(SLJIT_HAS_FPU));
CHECK_ARGUMENT(GET_OPCODE(op) >= SLJIT_CONV_F64_FROM_SW && GET_OPCODE(op) <= SLJIT_CONV_F64_FROM_S32);
- FUNCTION_CHECK_FOP();
+ CHECK_ARGUMENT(!(op & (SLJIT_SET_Z | VARIABLE_FLAG_MASK)));
FUNCTION_CHECK_SRC(src, srcw);
FUNCTION_FCHECK(dst, dstw);
#endif
@@ -1303,9 +1366,9 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop2(struct sljit_compile
sljit_s32 src2, sljit_sw src2w)
{
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_is_fpu_available());
+ CHECK_ARGUMENT(sljit_has_cpu_feature(SLJIT_HAS_FPU));
CHECK_ARGUMENT(GET_OPCODE(op) >= SLJIT_ADD_F64 && GET_OPCODE(op) <= SLJIT_DIV_F64);
- FUNCTION_CHECK_FOP();
+ CHECK_ARGUMENT(!(op & (SLJIT_SET_Z | VARIABLE_FLAG_MASK)));
FUNCTION_FCHECK(src1, src1w);
FUNCTION_FCHECK(src2, src2w);
FUNCTION_FCHECK(dst, dstw);
@@ -1328,6 +1391,15 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_label(struct sljit_compil
{
SLJIT_UNUSED_ARG(compiler);
+ if (SLJIT_UNLIKELY(compiler->skip_checks)) {
+ compiler->skip_checks = 0;
+ CHECK_RETURN_OK;
+ }
+
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ compiler->last_flags = 0;
+#endif
+
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose))
fprintf(compiler->verbose, "label:\n");
@@ -1344,9 +1416,20 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_jump(struct sljit_compile
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_I32_OP)));
+ CHECK_ARGUMENT((type & 0xff) != GET_FLAG_TYPE(SLJIT_SET_CARRY) && (type & 0xff) != (GET_FLAG_TYPE(SLJIT_SET_CARRY) + 1));
CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_CALL3);
CHECK_ARGUMENT((type & 0xff) < SLJIT_JUMP || !(type & SLJIT_I32_OP));
CHECK_ARGUMENT((type & 0xff) <= SLJIT_CALL0 || ((type & 0xff) - SLJIT_CALL0) <= compiler->scratches);
+
+ if ((type & 0xff) < SLJIT_JUMP) {
+ if ((type & 0xff) <= SLJIT_NOT_ZERO)
+ CHECK_ARGUMENT(compiler->last_flags & SLJIT_SET_Z);
+ else
+ CHECK_ARGUMENT((type & 0xff) == (compiler->last_flags & 0xff)
+ || ((type & 0xff) == SLJIT_NOT_OVERFLOW && (compiler->last_flags & 0xff) == SLJIT_OVERFLOW)
+ || ((type & 0xff) == SLJIT_MUL_NOT_OVERFLOW && (compiler->last_flags & 0xff) == SLJIT_MUL_OVERFLOW));
+ CHECK_ARGUMENT((type & SLJIT_I32_OP) == (compiler->last_flags & SLJIT_I32_OP));
+ }
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose))
@@ -1365,6 +1448,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_cmp(struct sljit_compiler
CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_SIG_LESS_EQUAL);
FUNCTION_CHECK_SRC(src1, src1w);
FUNCTION_CHECK_SRC(src2, src2w);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1384,11 +1468,12 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fcmp(struct sljit_compile
sljit_s32 src2, sljit_sw src2w)
{
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_is_fpu_available());
+ CHECK_ARGUMENT(sljit_has_cpu_feature(SLJIT_HAS_FPU));
CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_F32_OP)));
CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL_F64 && (type & 0xff) <= SLJIT_ORDERED_F64);
FUNCTION_FCHECK(src1, src1w);
FUNCTION_FCHECK(src2, src2w);
+ compiler->last_flags = 0;
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1405,6 +1490,10 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fcmp(struct sljit_compile
static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 src, sljit_sw srcw)
{
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ compiler->last_flags = 0;
+#endif
+
if (SLJIT_UNLIKELY(compiler->skip_checks)) {
compiler->skip_checks = 0;
CHECK_RETURN_OK;
@@ -1427,46 +1516,82 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_ijump(struct sljit_compil
static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_I32_OP)));
CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_ORDERED_F64);
- CHECK_ARGUMENT(op == SLJIT_MOV || GET_OPCODE(op) == SLJIT_MOV_U32 || GET_OPCODE(op) == SLJIT_MOV_S32
+ CHECK_ARGUMENT((type & 0xff) != GET_FLAG_TYPE(SLJIT_SET_CARRY) && (type & 0xff) != (GET_FLAG_TYPE(SLJIT_SET_CARRY) + 1));
+ CHECK_ARGUMENT(op == SLJIT_MOV || op == SLJIT_MOV32
|| (GET_OPCODE(op) >= SLJIT_AND && GET_OPCODE(op) <= SLJIT_XOR));
- CHECK_ARGUMENT((op & (SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O | SLJIT_SET_C)) == 0);
- CHECK_ARGUMENT((op & (SLJIT_SET_E | SLJIT_KEEP_FLAGS)) != (SLJIT_SET_E | SLJIT_KEEP_FLAGS));
- if (GET_OPCODE(op) < SLJIT_ADD) {
- CHECK_ARGUMENT(src == SLJIT_UNUSED && srcw == 0);
- } else {
- CHECK_ARGUMENT(src == dst && srcw == dstw);
- }
- FUNCTION_CHECK_DST(dst, dstw);
+ CHECK_ARGUMENT(!(op & VARIABLE_FLAG_MASK));
+
+ if ((type & 0xff) <= SLJIT_NOT_ZERO)
+ CHECK_ARGUMENT(compiler->last_flags & SLJIT_SET_Z);
+ else
+ CHECK_ARGUMENT((type & 0xff) == (compiler->last_flags & 0xff)
+ || ((type & 0xff) == SLJIT_NOT_OVERFLOW && (compiler->last_flags & 0xff) == SLJIT_OVERFLOW)
+ || ((type & 0xff) == SLJIT_MUL_NOT_OVERFLOW && (compiler->last_flags & 0xff) == SLJIT_MUL_OVERFLOW));
+
+ FUNCTION_CHECK_DST(dst, dstw, 0);
+
+ if (GET_OPCODE(op) >= SLJIT_ADD)
+ compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z));
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
- fprintf(compiler->verbose, " flags %s%s%s%s, ",
- !(op & SLJIT_SET_E) ? "" : ".e", !(op & SLJIT_KEEP_FLAGS) ? "" : ".k",
+ fprintf(compiler->verbose, " flags%s %s%s, ",
+ !(op & SLJIT_SET_Z) ? "" : ".z",
GET_OPCODE(op) < SLJIT_OP2_BASE ? "mov" : op2_names[GET_OPCODE(op) - SLJIT_OP2_BASE],
GET_OPCODE(op) < SLJIT_OP2_BASE ? op1_names[GET_OPCODE(op) - SLJIT_OP1_BASE] : ((op & SLJIT_I32_OP) ? "32" : ""));
sljit_verbose_param(compiler, dst, dstw);
- if (src != SLJIT_UNUSED) {
- fprintf(compiler->verbose, ", ");
- sljit_verbose_param(compiler, src, srcw);
- }
fprintf(compiler->verbose, ", %s%s\n", jump_names[type & 0xff], JUMP_POSTFIX(type));
}
#endif
CHECK_RETURN_OK;
}
+static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_I32_OP)));
+ CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_ORDERED_F64);
+ CHECK_ARGUMENT(FUNCTION_CHECK_IS_REG(dst_reg & ~SLJIT_I32_OP));
+ if (src != SLJIT_IMM) {
+ CHECK_ARGUMENT(FUNCTION_CHECK_IS_REG(src));
+ CHECK_ARGUMENT(srcw == 0);
+ }
+
+ if ((type & 0xff) <= SLJIT_NOT_ZERO)
+ CHECK_ARGUMENT(compiler->last_flags & SLJIT_SET_Z);
+ else
+ CHECK_ARGUMENT((type & 0xff) == (compiler->last_flags & 0xff)
+ || ((type & 0xff) == SLJIT_NOT_OVERFLOW && (compiler->last_flags & 0xff) == SLJIT_OVERFLOW)
+ || ((type & 0xff) == SLJIT_MUL_NOT_OVERFLOW && (compiler->last_flags & 0xff) == SLJIT_MUL_OVERFLOW));
+#endif
+#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
+ if (SLJIT_UNLIKELY(!!compiler->verbose)) {
+ fprintf(compiler->verbose, " cmov%s %s%s, ",
+ !(dst_reg & SLJIT_I32_OP) ? "" : ".i",
+ jump_names[type & 0xff], JUMP_POSTFIX(type));
+ sljit_verbose_reg(compiler, dst_reg & ~SLJIT_I32_OP);
+ fprintf(compiler->verbose, ", ");
+ sljit_verbose_param(compiler, src, srcw);
+ fprintf(compiler->verbose, "\n");
+ }
+#endif
+ CHECK_RETURN_OK;
+}
+
static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset)
{
+ /* Any offset is allowed. */
SLJIT_UNUSED_ARG(offset);
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- FUNCTION_CHECK_DST(dst, dstw);
+ FUNCTION_CHECK_DST(dst, dstw, 0);
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1483,7 +1608,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_const(struct sljit_compil
SLJIT_UNUSED_ARG(init_value);
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- FUNCTION_CHECK_DST(dst, dstw);
+ FUNCTION_CHECK_DST(dst, dstw, 0);
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
@@ -1544,6 +1669,44 @@ static SLJIT_INLINE sljit_s32 emit_mov_before_return(struct sljit_compiler *comp
return sljit_emit_op1(compiler, op, SLJIT_RETURN_REG, 0, src, srcw);
}
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \
+ || (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) \
+ || (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) \
+ || ((defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS) && !(defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1))
+
+static SLJIT_INLINE sljit_s32 sljit_emit_cmov_generic(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ struct sljit_label *label;
+ struct sljit_jump *jump;
+ sljit_s32 op = (dst_reg & SLJIT_I32_OP) ? SLJIT_MOV32 : SLJIT_MOV;
+
+#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
+ || (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ compiler->skip_checks = 1;
+#endif
+ jump = sljit_emit_jump(compiler, type ^ 0x1);
+ FAIL_IF(!jump);
+
+#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
+ || (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ compiler->skip_checks = 1;
+#endif
+ FAIL_IF(sljit_emit_op1(compiler, op, dst_reg & ~SLJIT_I32_OP, 0, src, srcw));
+
+#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
+ || (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ compiler->skip_checks = 1;
+#endif
+ label = sljit_emit_label(compiler);
+ FAIL_IF(!label);
+ sljit_set_label(jump, label);
+ return SLJIT_SUCCESS;
+}
+
+#endif
+
/* CPU description section */
#if (defined SLJIT_32BIT_ARCHITECTURE && SLJIT_32BIT_ARCHITECTURE)
@@ -1645,6 +1808,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
condition = SLJIT_SIG_GREATER_EQUAL;
break;
}
+
type = condition | (type & (SLJIT_I32_OP | SLJIT_REWRITABLE_JUMP));
tmp_src = src1;
src1 = src2;
@@ -1655,11 +1819,9 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
}
if (condition <= SLJIT_NOT_ZERO)
- flags = SLJIT_SET_E;
- else if (condition <= SLJIT_LESS_EQUAL)
- flags = SLJIT_SET_U;
+ flags = SLJIT_SET_Z;
else
- flags = SLJIT_SET_S;
+ flags = condition << VARIABLE_FLAG_SHIFT;
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
|| (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
@@ -1671,38 +1833,31 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
|| (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
compiler->skip_checks = 1;
#endif
- return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
+ return sljit_emit_jump(compiler, condition | (type & (SLJIT_REWRITABLE_JUMP | SLJIT_I32_OP)));
}
+#endif
+
SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_s32 type,
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
- sljit_s32 flags, condition;
-
CHECK_ERROR_PTR();
CHECK_PTR(check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w));
- condition = type & 0xff;
- flags = (condition <= SLJIT_NOT_EQUAL_F64) ? SLJIT_SET_E : SLJIT_SET_S;
- if (type & SLJIT_F32_OP)
- flags |= SLJIT_F32_OP;
-
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
|| (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
compiler->skip_checks = 1;
#endif
- sljit_emit_fop1(compiler, SLJIT_CMP_F64 | flags, src1, src1w, src2, src2w);
+ sljit_emit_fop1(compiler, SLJIT_CMP_F64 | ((type & 0xff) << VARIABLE_FLAG_SHIFT) | (type & SLJIT_I32_OP), src1, src1w, src2, src2w);
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
|| (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
compiler->skip_checks = 1;
#endif
- return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
+ return sljit_emit_jump(compiler, type);
}
-#endif
-
#if !(defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset)
@@ -1716,7 +1871,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *c
compiler->skip_checks = 1;
#endif
if (offset != 0)
- return sljit_emit_op2(compiler, SLJIT_ADD | SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_SP, 0, SLJIT_IMM, offset);
+ return sljit_emit_op2(compiler, SLJIT_ADD, dst, dstw, SLJIT_SP, 0, SLJIT_IMM, offset);
return sljit_emit_op1(compiler, SLJIT_MOV, dst, dstw, SLJIT_SP, 0);
}
@@ -1731,23 +1886,30 @@ SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
return "unsupported";
}
-SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_create_compiler(void)
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_create_compiler(void *allocator_data)
{
- SLJIT_ASSERT_STOP();
+ SLJIT_UNUSED_ARG(allocator_data);
+ SLJIT_UNREACHABLE();
return NULL;
}
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler)
{
SLJIT_UNUSED_ARG(compiler);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
+}
+
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_compiler_memory_error(struct sljit_compiler *compiler)
+{
+ SLJIT_UNUSED_ARG(compiler);
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_s32 size)
{
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(size);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
@@ -1756,21 +1918,28 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *comp
{
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(verbose);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
#endif
SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
{
SLJIT_UNUSED_ARG(compiler);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ SLJIT_UNUSED_ARG(feature_type);
+ SLJIT_UNREACHABLE();
+ return 0;
+}
+
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code)
{
SLJIT_UNUSED_ARG(code);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler,
@@ -1785,7 +1954,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
SLJIT_UNUSED_ARG(fscratches);
SLJIT_UNUSED_ARG(fsaveds);
SLJIT_UNUSED_ARG(local_size);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1801,7 +1970,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
SLJIT_UNUSED_ARG(fscratches);
SLJIT_UNUSED_ARG(fsaveds);
SLJIT_UNUSED_ARG(local_size);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1811,7 +1980,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
SLJIT_UNUSED_ARG(op);
SLJIT_UNUSED_ARG(src);
SLJIT_UNUSED_ARG(srcw);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1820,7 +1989,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(dst);
SLJIT_UNUSED_ARG(dstw);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1829,7 +1998,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(src);
SLJIT_UNUSED_ARG(srcw);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1837,7 +2006,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
{
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(op);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1851,7 +2020,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
SLJIT_UNUSED_ARG(dstw);
SLJIT_UNUSED_ARG(src);
SLJIT_UNUSED_ARG(srcw);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1868,13 +2037,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
SLJIT_UNUSED_ARG(src1w);
SLJIT_UNUSED_ARG(src2);
SLJIT_UNUSED_ARG(src2w);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_register_index(sljit_s32 reg)
{
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return reg;
}
@@ -1884,14 +2053,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(instruction);
SLJIT_UNUSED_ARG(size);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_current_flags(struct sljit_compiler *compiler, sljit_s32 current_flags)
{
- SLJIT_ASSERT_STOP();
- return 0;
+ SLJIT_UNUSED_ARG(compiler);
+ SLJIT_UNUSED_ARG(current_flags);
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op,
@@ -1904,7 +2073,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compil
SLJIT_UNUSED_ARG(dstw);
SLJIT_UNUSED_ARG(src);
SLJIT_UNUSED_ARG(srcw);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -1921,14 +2090,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compil
SLJIT_UNUSED_ARG(src1w);
SLJIT_UNUSED_ARG(src2);
SLJIT_UNUSED_ARG(src2w);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler)
{
SLJIT_UNUSED_ARG(compiler);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
@@ -1936,7 +2105,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
{
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(type);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
@@ -1950,7 +2119,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
SLJIT_UNUSED_ARG(src1w);
SLJIT_UNUSED_ARG(src2);
SLJIT_UNUSED_ARG(src2w);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
@@ -1964,7 +2133,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compile
SLJIT_UNUSED_ARG(src1w);
SLJIT_UNUSED_ARG(src2);
SLJIT_UNUSED_ARG(src2w);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
@@ -1972,14 +2141,14 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_label(struct sljit_jump *jump, struct sl
{
SLJIT_UNUSED_ARG(jump);
SLJIT_UNUSED_ARG(label);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw target)
{
SLJIT_UNUSED_ARG(jump);
SLJIT_UNUSED_ARG(target);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 src, sljit_sw srcw)
@@ -1988,23 +2157,33 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_UNUSED_ARG(type);
SLJIT_UNUSED_ARG(src);
SLJIT_UNUSED_ARG(srcw);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
SLJIT_UNUSED_ARG(compiler);
SLJIT_UNUSED_ARG(op);
SLJIT_UNUSED_ARG(dst);
SLJIT_UNUSED_ARG(dstw);
+ SLJIT_UNUSED_ARG(type);
+ SLJIT_UNREACHABLE();
+ return SLJIT_ERR_UNSUPPORTED;
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ SLJIT_UNUSED_ARG(compiler);
+ SLJIT_UNUSED_ARG(type);
+ SLJIT_UNUSED_ARG(dst_reg);
SLJIT_UNUSED_ARG(src);
SLJIT_UNUSED_ARG(srcw);
- SLJIT_UNUSED_ARG(type);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -2014,7 +2193,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *c
SLJIT_UNUSED_ARG(dst);
SLJIT_UNUSED_ARG(dstw);
SLJIT_UNUSED_ARG(offset);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_ERR_UNSUPPORTED;
}
@@ -2024,22 +2203,24 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
SLJIT_UNUSED_ARG(dst);
SLJIT_UNUSED_ARG(dstw);
SLJIT_UNUSED_ARG(initval);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return NULL;
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
SLJIT_UNUSED_ARG(addr);
- SLJIT_UNUSED_ARG(new_addr);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNUSED_ARG(new_target);
+ SLJIT_UNUSED_ARG(executable_offset);
+ SLJIT_UNREACHABLE();
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
SLJIT_UNUSED_ARG(addr);
SLJIT_UNUSED_ARG(new_constant);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNUSED_ARG(executable_offset);
+ SLJIT_UNREACHABLE();
}
#endif
diff --git a/src/3rdparty/pcre2/src/sljit/sljitLir.h b/src/3rdparty/pcre2/src/sljit/sljitLir.h
index df69b8656f..470c84f592 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitLir.h
+++ b/src/3rdparty/pcre2/src/sljit/sljitLir.h
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -99,6 +99,8 @@ of sljitConfigInternal.h */
#define SLJIT_ERR_UNSUPPORTED 4
/* An ivalid argument is passed to any SLJIT function. */
#define SLJIT_ERR_BAD_ARGUMENT 5
+/* Dynamic code modification is not enabled. */
+#define SLJIT_ERR_DYN_CODE_MOD 6
/* --------------------------------------------------------------------- */
/* Registers */
@@ -118,8 +120,8 @@ of sljitConfigInternal.h */
If an architecture provides two scratch and three saved registers,
its scratch and saved register sets are the following:
- R0 | [S4] | R0 and S4 represent the same physical register
- R1 | [S3] | R1 and S3 represent the same physical register
+ R0 | | R0 is always a scratch register
+ R1 | | R1 is always a scratch register
[R2] | S2 | R2 and S2 represent the same physical register
[R3] | S1 | R3 and S1 represent the same physical register
[R4] | S0 | R4 and S0 represent the same physical register
@@ -127,38 +129,35 @@ of sljitConfigInternal.h */
Note: SLJIT_NUMBER_OF_SCRATCH_REGISTERS would be 2 and
SLJIT_NUMBER_OF_SAVED_REGISTERS would be 3 for this architecture.
- Note: On all supported architectures SLJIT_NUMBER_OF_REGISTERS >= 10
- and SLJIT_NUMBER_OF_SAVED_REGISTERS >= 5. However, 4 registers
+ Note: On all supported architectures SLJIT_NUMBER_OF_REGISTERS >= 12
+ and SLJIT_NUMBER_OF_SAVED_REGISTERS >= 6. However, 6 registers
are virtual on x86-32. See below.
- The purpose of this definition is convenience. Although a register
- is either scratch register or saved register, SLJIT allows accessing
- them from the other set. For example, four registers can be used as
- scratch registers and the fifth one as saved register on the architecture
- above. Of course the last two scratch registers (R2 and R3) from this
- four will be saved on the stack, because they are defined as saved
- registers in the application binary interface. Still R2 and R3 can be
- used for referencing to these registers instead of S2 and S1, which
- makes easier to write platform independent code. Scratch registers
- can be saved registers in a similar way, but these extra saved
- registers will not be preserved across function calls! Hence the
- application must save them on those platforms, where the number of
- saved registers is too low. This can be done by copy them onto
- the stack and restore them after a function call.
+ The purpose of this definition is convenience: saved registers can
+ be used as extra scratch registers. For example four registers can
+ be specified as scratch registers and the fifth one as saved register
+ on the CPU above and any user code which requires four scratch
+ registers can run unmodified. The SLJIT compiler automatically saves
+ the content of the two extra scrath register on the stack. Scratch
+ registers can also be preserved by saving their value on the stack
+ but this needs to be done manually.
Note: To emphasize that registers assigned to R2-R4 are saved
- registers, they are enclosed by square brackets. S3-S4
- are marked in a similar way.
+ registers, they are enclosed by square brackets.
Note: sljit_emit_enter and sljit_set_context defines whether a register
is S or R register. E.g: when 3 scratches and 1 saved is mapped
by sljit_emit_enter, the allowed register set will be: R0-R2 and
S0. Although S2 is mapped to the same position as R2, it does not
- available in the current configuration. Furthermore the R3 (S1)
- register does not available as well.
+ available in the current configuration. Furthermore the S1 register
+ is not available at all.
*/
-/* When SLJIT_UNUSED is specified as destination, the result is discarded. */
+/* When SLJIT_UNUSED is specified as the destination of sljit_emit_op1 and
+ and sljit_emit_op2 operations the result is discarded. If no status
+ flags are set, no instructions are emitted for these operations. Data
+ prefetch is a special exception, see SLJIT_MOV operation. Other SLJIT
+ operations do not support SLJIT_UNUSED as a destination operand. */
#define SLJIT_UNUSED 0
/* Scratch registers. */
@@ -323,19 +322,22 @@ struct sljit_compiler {
sljit_s32 local_size;
/* Code size. */
sljit_uw size;
- /* For statistical purposes. */
+ /* Relative offset of the executable mapping from the writable mapping. */
+ sljit_uw executable_offset;
+ /* Executable size for statistical purposes. */
sljit_uw executable_size;
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
sljit_s32 args;
+ sljit_s32 locals_offset;
+ sljit_s32 saveds_offset;
#endif
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
sljit_s32 mode32;
+#ifdef _WIN64
+ sljit_s32 locals_offset;
#endif
-
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
- sljit_s32 flags_saved;
#endif
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
@@ -352,13 +354,6 @@ struct sljit_compiler {
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
/* Temporary fields. */
sljit_uw shift_imm;
- sljit_s32 cache_arg;
- sljit_sw cache_argw;
-#endif
-
-#if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)
- sljit_s32 cache_arg;
- sljit_sw cache_argw;
#endif
#if (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
@@ -395,6 +390,9 @@ struct sljit_compiler {
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS) \
|| (defined SLJIT_DEBUG && SLJIT_DEBUG)
+ /* Flags specified by the last arithmetic instruction.
+ It contains the type of the variable flag. */
+ sljit_s32 last_flags;
/* Local size passed to the functions. */
sljit_s32 logical_local_size;
#endif
@@ -402,6 +400,7 @@ struct sljit_compiler {
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS) \
|| (defined SLJIT_DEBUG && SLJIT_DEBUG) \
|| (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
+ /* Trust arguments when the API function is called. */
sljit_s32 skip_checks;
#endif
};
@@ -455,19 +454,67 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compile
SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose);
#endif
+/*
+ Create executable code from the sljit instruction stream. This is the final step
+ of the code generation so no more instructions can be added after this call.
+*/
+
SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler);
+
+/* Free executable code. */
+
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code);
/*
- After the machine code generation is finished we can retrieve the allocated
- executable memory size, although this area may not be fully filled with
- instructions depending on some optimizations. This function is useful only
- for statistical purposes.
+ When the protected executable allocator is used the JIT code is mapped
+ twice. The first mapping has read/write and the second mapping has read/exec
+ permissions. This function returns with the relative offset of the executable
+ mapping using the writable mapping as the base after the machine code is
+ successfully generated. The returned value is always 0 for the normal executable
+ allocator, since it uses only one mapping with read/write/exec permissions.
+ Dynamic code modifications requires this value.
+
+ Before a successful code generation, this function returns with 0.
+*/
+static SLJIT_INLINE sljit_sw sljit_get_executable_offset(struct sljit_compiler *compiler) { return compiler->executable_offset; }
+
+/*
+ The executable memory consumption of the generated code can be retrieved by
+ this function. The returned value can be used for statistical purposes.
Before a successful code generation, this function returns with 0.
*/
static SLJIT_INLINE sljit_uw sljit_get_generated_code_size(struct sljit_compiler *compiler) { return compiler->executable_size; }
+/* Returns with non-zero if the feature or limitation type passed as its
+ argument is present on the current CPU.
+
+ Some features (e.g. floating point operations) require hardware (CPU)
+ support while others (e.g. move with update) are emulated if not available.
+ However even if a feature is emulated, specialized code paths can be faster
+ than the emulation. Some limitations are emulated as well so their general
+ case is supported but it has extra performance costs. */
+
+/* [Not emulated] Floating-point support is available. */
+#define SLJIT_HAS_FPU 0
+/* [Limitation] Some registers are virtual registers. */
+#define SLJIT_HAS_VIRTUAL_REGISTERS 1
+/* [Emulated] Some forms of move with pre update is supported. */
+#define SLJIT_HAS_PRE_UPDATE 2
+/* [Emulated] Count leading zero is supported. */
+#define SLJIT_HAS_CLZ 3
+/* [Emulated] Conditional move is supported. */
+#define SLJIT_HAS_CMOV 4
+/* [Limitation] [Emulated] Shifting with register is limited to SLJIT_PREF_SHIFT_REG. */
+#define SLJIT_HAS_PREF_SHIFT_REG 5
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+/* [Not emulated] SSE2 support is available on x86. */
+#define SLJIT_HAS_SSE2 100
+#endif
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type);
+
/* Instruction generation. Returns with any error code. If there is no
error, they return with SLJIT_SUCCESS. */
@@ -512,8 +559,8 @@ static SLJIT_INLINE sljit_uw sljit_get_generated_code_size(struct sljit_compiler
*/
/* The absolute address returned by sljit_get_local_base with
-offset 0 is aligned to sljit_d. Otherwise it is aligned to sljit_uw. */
-#define SLJIT_DOUBLE_ALIGNMENT 0x00000001
+offset 0 is aligned to sljit_f64. Otherwise it is aligned to sljit_sw. */
+#define SLJIT_F64_ALIGNMENT 0x00000001
/* The local_size must be >= 0 and <= SLJIT_MAX_LOCAL_SIZE. */
#define SLJIT_MAX_LOCAL_SIZE 65536
@@ -555,7 +602,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
and setting up a new stack frame would cost too much performance. However, it is still
possible to return to the address of the caller (or anywhere else). */
-/* Note: flags are not changed (unlike sljit_emit_enter / sljit_emit_return). */
+/* Note: may destroy flags. */
/* Note: although sljit_emit_fast_return could be replaced by an ijump, it is not suggested,
since many architectures do clever branch prediction on call / return instruction pairs. */
@@ -624,57 +671,97 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
#define SLJIT_MEM2(r1, r2) (SLJIT_MEM | (r1) | ((r2) << 8))
#define SLJIT_IMM 0x40
-/* Set 32 bit operation mode (I) on 64 bit CPUs. This flag is ignored on 32
- bit CPUs. When this flag is set for an arithmetic operation, only the
- lower 32 bit of the input register(s) are used, and the CPU status flags
- are set according to the 32 bit result. Although the higher 32 bit of
- the input and the result registers are not defined by SLJIT, it might be
- defined by the CPU architecture (e.g. MIPS). To satisfy these requirements
- all source registers must be computed by operations where this flag is
- also set. In other words 32 and 64 bit arithmetic operations cannot be
- mixed. The only exception is SLJIT_IMOV and SLJIT_IMOVU whose source
- register can hold any 32 or 64 bit value. This source register is
- converted to a 32 bit compatible format. SLJIT does not generate any
- instructions on certain CPUs (e.g. on x86 and ARM) if the source and
- destination operands are the same registers. Affects sljit_emit_op0,
- sljit_emit_op1 and sljit_emit_op2. */
+/* Set 32 bit operation mode (I) on 64 bit CPUs. This option is ignored on
+ 32 bit CPUs. When this option is set for an arithmetic operation, only
+ the lower 32 bit of the input registers are used, and the CPU status
+ flags are set according to the 32 bit result. Although the higher 32 bit
+ of the input and the result registers are not defined by SLJIT, it might
+ be defined by the CPU architecture (e.g. MIPS). To satisfy these CPU
+ requirements all source registers must be the result of those operations
+ where this option was also set. Memory loads read 32 bit values rather
+ than 64 bit ones. In other words 32 bit and 64 bit operations cannot
+ be mixed. The only exception is SLJIT_MOV32 and SLJIT_MOVU32 whose source
+ register can hold any 32 or 64 bit value, and it is converted to a 32 bit
+ compatible format first. This conversion is free (no instructions are
+ emitted) on most CPUs. A 32 bit value can also be coverted to a 64 bit
+ value by SLJIT_MOV_S32 (sign extension) or SLJIT_MOV_U32 (zero extension).
+
+ Note: memory addressing always uses 64 bit values on 64 bit systems so
+ the result of a 32 bit operation must not be used with SLJIT_MEMx
+ macros.
+
+ This option is part of the instruction name, so there is no need to
+ manually set it. E.g:
+
+ SLJIT_ADD32 == (SLJIT_ADD | SLJIT_I32_OP) */
#define SLJIT_I32_OP 0x100
-/* F32 precision mode (SP). This flag is similar to SLJIT_I32_OP, just
- it applies to floating point registers (it is even the same bit). When
- this flag is passed, the CPU performs 32 bit floating point operations.
- Similar to SLJIT_I32_OP, all register arguments must be computed by
- floating point operations where this flag is also set. Affects
- sljit_emit_fop1, sljit_emit_fop2 and sljit_emit_fcmp. */
-#define SLJIT_F32_OP 0x100
-
-/* Common CPU status flags for all architectures (x86, ARM, PPC)
- - carry flag
- - overflow flag
- - zero flag
- - negative/positive flag (depends on arc)
- On mips, these flags are emulated by software. */
-
-/* By default, the instructions may, or may not set the CPU status flags.
- Forcing to set or keep status flags can be done with the following flags: */
-
-/* Note: sljit tries to emit the minimum number of instructions. Using these
- flags can increase them, so use them wisely to avoid unnecessary code generation. */
-
-/* Set Equal (Zero) status flag (E). */
-#define SLJIT_SET_E 0x0200
-/* Set unsigned status flag (U). */
-#define SLJIT_SET_U 0x0400
-/* Set signed status flag (S). */
-#define SLJIT_SET_S 0x0800
-/* Set signed overflow flag (O). */
-#define SLJIT_SET_O 0x1000
-/* Set carry flag (C).
- Note: Kinda unsigned overflow, but behaves differently on various cpus. */
-#define SLJIT_SET_C 0x2000
-/* Do not modify the flags (K).
- Note: This flag cannot be combined with any other SLJIT_SET_* flag. */
-#define SLJIT_KEEP_FLAGS 0x4000
+/* Set F32 (single) precision mode for floating-point computation. This
+ option is similar to SLJIT_I32_OP, it just applies to floating point
+ registers. When this option is passed, the CPU performs 32 bit floating
+ point operations, rather than 64 bit one. Similar to SLJIT_I32_OP, all
+ register arguments must be the result of those operations where this
+ option was also set.
+
+ This option is part of the instruction name, so there is no need to
+ manually set it. E.g:
+
+ SLJIT_MOV_F32 = (SLJIT_MOV_F64 | SLJIT_F32_OP)
+ */
+#define SLJIT_F32_OP SLJIT_I32_OP
+
+/* Many CPUs (x86, ARM, PPC) has status flags which can be set according
+ to the result of an operation. Other CPUs (MIPS) does not have status
+ flags, and results must be stored in registers. To cover both architecture
+ types efficiently only two flags are defined by SLJIT:
+
+ * Zero (equal) flag: it is set if the result is zero
+ * Variable flag: its value is defined by the last arithmetic operation
+
+ SLJIT instructions can set any or both of these flags. The value of
+ these flags is undefined if the instruction does not specify their value.
+ The description of each instruction contains the list of allowed flag
+ types.
+
+ Example: SLJIT_ADD can set the Z, OVERFLOW, CARRY flags hence
+
+ sljit_op2(..., SLJIT_ADD, ...)
+ Both the zero and variable flags are undefined so they can
+ have any value after the operation is completed.
+
+ sljit_op2(..., SLJIT_ADD | SLJIT_SET_Z, ...)
+ Sets the zero flag if the result is zero, clears it otherwise.
+ The variable flag is undefined.
+
+ sljit_op2(..., SLJIT_ADD | SLJIT_SET_OVERFLOW, ...)
+ Sets the variable flag if an integer overflow occurs, clears
+ it otherwise. The zero flag is undefined.
+
+ sljit_op2(..., SLJIT_ADD | SLJIT_SET_Z | SLJIT_SET_CARRY, ...)
+ Sets the zero flag if the result is zero, clears it otherwise.
+ Sets the variable flag if unsigned overflow (carry) occurs,
+ clears it otherwise.
+
+ If an instruction (e.g. SLJIT_MOV) does not modify flags the flags are
+ unchanged.
+
+ Using these flags can reduce the number of emitted instructions. E.g. a
+ fast loop can be implemented by decreasing a counter register and set the
+ zero flag to jump back if the counter register is not reached zero.
+
+ Motivation: although CPUs can set a large number of flags, usually their
+ values are ignored or only one of them is used. Emulating a large number
+ of flags on systems without flag register is complicated so SLJIT
+ instructions must specify the flag they want to use and only that flag
+ will be emulated. The last arithmetic instruction can be repeated if
+ multiple flags needs to be checked.
+*/
+
+/* Set Zero status flag. */
+#define SLJIT_SET_Z 0x0200
+/* Set the variable status flag if condition is true.
+ See comparison types. */
+#define SLJIT_SET(condition) ((condition) << 10)
/* Notes:
- you cannot postpone conditional jump instructions except if noted that
@@ -684,11 +771,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
/* Starting index of opcodes for sljit_emit_op0. */
#define SLJIT_OP0_BASE 0
-/* Flags: - (never set any flags)
+/* Flags: - (does not modify flags)
Note: breakpoint instruction is not supported by all architectures (e.g. ppc)
It falls back to SLJIT_NOP in those cases. */
#define SLJIT_BREAKPOINT (SLJIT_OP0_BASE + 0)
-/* Flags: - (never set any flags)
+/* Flags: - (does not modify flags)
Note: may or may not cause an extra cycle wait
it can even decrease the runtime in a few cases. */
#define SLJIT_NOP (SLJIT_OP0_BASE + 1)
@@ -700,13 +787,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
Signed multiplication of SLJIT_R0 and SLJIT_R1.
Result is placed into SLJIT_R1:SLJIT_R0 (high:low) word */
#define SLJIT_LMUL_SW (SLJIT_OP0_BASE + 3)
-/* Flags: I - (may destroy flags)
+/* Flags: - (may destroy flags)
Unsigned divide of the value in SLJIT_R0 by the value in SLJIT_R1.
The result is placed into SLJIT_R0 and the remainder into SLJIT_R1.
Note: if SLJIT_R1 is 0, the behaviour is undefined. */
#define SLJIT_DIVMOD_UW (SLJIT_OP0_BASE + 4)
#define SLJIT_DIVMOD_U32 (SLJIT_DIVMOD_UW | SLJIT_I32_OP)
-/* Flags: I - (may destroy flags)
+/* Flags: - (may destroy flags)
Signed divide of the value in SLJIT_R0 by the value in SLJIT_R1.
The result is placed into SLJIT_R0 and the remainder into SLJIT_R1.
Note: if SLJIT_R1 is 0, the behaviour is undefined.
@@ -714,13 +801,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
the behaviour is undefined. */
#define SLJIT_DIVMOD_SW (SLJIT_OP0_BASE + 5)
#define SLJIT_DIVMOD_S32 (SLJIT_DIVMOD_SW | SLJIT_I32_OP)
-/* Flags: I - (may destroy flags)
+/* Flags: - (may destroy flags)
Unsigned divide of the value in SLJIT_R0 by the value in SLJIT_R1.
The result is placed into SLJIT_R0. SLJIT_R1 preserves its value.
Note: if SLJIT_R1 is 0, the behaviour is undefined. */
#define SLJIT_DIV_UW (SLJIT_OP0_BASE + 6)
#define SLJIT_DIV_U32 (SLJIT_DIV_UW | SLJIT_I32_OP)
-/* Flags: I - (may destroy flags)
+/* Flags: - (may destroy flags)
Signed divide of the value in SLJIT_R0 by the value in SLJIT_R1.
The result is placed into SLJIT_R0. SLJIT_R1 preserves its value.
Note: if SLJIT_R1 is 0, the behaviour is undefined.
@@ -734,75 +821,113 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
/* Starting index of opcodes for sljit_emit_op1. */
#define SLJIT_OP1_BASE 32
-/* Notes for MOV instructions:
- U = Mov with update (pre form). If source or destination defined as SLJIT_MEM1(r1)
- or SLJIT_MEM2(r1, r2), r1 is increased by the sum of r2 and the constant argument
- UB = unsigned byte (8 bit)
- SB = signed byte (8 bit)
- UH = unsigned half (16 bit)
- SH = signed half (16 bit)
- UI = unsigned int (32 bit)
- SI = signed int (32 bit)
- P = pointer (sljit_p) size */
-
-/* Flags: - (never set any flags) */
+/* The MOV instruction transfer data from source to destination.
+
+ MOV instruction suffixes:
+
+ U8 - unsigned 8 bit data transfer
+ S8 - signed 8 bit data transfer
+ U16 - unsigned 16 bit data transfer
+ S16 - signed 16 bit data transfer
+ U32 - unsigned int (32 bit) data transfer
+ S32 - signed int (32 bit) data transfer
+ P - pointer (sljit_p) data transfer
+
+ U = move with update (pre form). If source or destination defined as
+ SLJIT_MEM1(r1) or SLJIT_MEM2(r1, r2), r1 is increased by the
+ offset part of the address.
+
+ Register arguments and base registers can only be used once for move
+ with update instructions. The shift value of SLJIT_MEM2 addressing
+ mode must also be 0. Reason: SLJIT_MOVU instructions are expected to
+ be in high-performance loops where complex instruction emulation
+ would be too costly.
+
+ Examples for invalid move with update instructions:
+
+ sljit_emit_op1(..., SLJIT_MOVU_U8,
+ SLJIT_R0, 0, SLJIT_MEM1(SLJIT_R0), 8);
+ sljit_emit_op1(..., SLJIT_MOVU_U8,
+ SLJIT_MEM2(SLJIT_R1, SLJIT_R0), 0, SLJIT_R0, 0);
+ sljit_emit_op1(..., SLJIT_MOVU_U8,
+ SLJIT_MEM2(SLJIT_R0, SLJIT_R1), 0, SLJIT_MEM1(SLJIT_R0), 8);
+ sljit_emit_op1(..., SLJIT_MOVU_U8,
+ SLJIT_MEM2(SLJIT_R0, SLJIT_R1), 0, SLJIT_MEM2(SLJIT_R1, SLJIT_R0), 0);
+ sljit_emit_op1(..., SLJIT_MOVU_U8,
+ SLJIT_R2, 0, SLJIT_MEM2(SLJIT_R0, SLJIT_R1), 1);
+
+ The following example is valid, since only the offset register is
+ used multiple times:
+
+ sljit_emit_op1(..., SLJIT_MOVU_U8,
+ SLJIT_MEM2(SLJIT_R0, SLJIT_R2), 0, SLJIT_MEM2(SLJIT_R1, SLJIT_R2), 0);
+
+ If the destination of a MOV without update instruction is SLJIT_UNUSED
+ and the source operand is a memory address the compiler emits a prefetch
+ instruction if this instruction is supported by the current CPU.
+ Higher data sizes bring the data closer to the core: a MOV with word
+ size loads the data into a higher level cache than a byte size. Otherwise
+ the type does not affect the prefetch instruction. Furthermore a prefetch
+ instruction never fails, so it can be used to prefetch a data from an
+ address and check whether that address is NULL afterwards.
+*/
+
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV (SLJIT_OP1_BASE + 0)
-/* Flags: I - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV_U8 (SLJIT_OP1_BASE + 1)
#define SLJIT_MOV32_U8 (SLJIT_MOV_U8 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV_S8 (SLJIT_OP1_BASE + 2)
#define SLJIT_MOV32_S8 (SLJIT_MOV_S8 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV_U16 (SLJIT_OP1_BASE + 3)
#define SLJIT_MOV32_U16 (SLJIT_MOV_U16 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV_S16 (SLJIT_OP1_BASE + 4)
#define SLJIT_MOV32_S16 (SLJIT_MOV_S16 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags)
+/* Flags: - (does not modify flags)
Note: no SLJIT_MOV32_U32 form, since it is the same as SLJIT_MOV32 */
#define SLJIT_MOV_U32 (SLJIT_OP1_BASE + 5)
-/* Flags: I - (never set any flags)
+/* Flags: - (does not modify flags)
Note: no SLJIT_MOV32_S32 form, since it is the same as SLJIT_MOV32 */
#define SLJIT_MOV_S32 (SLJIT_OP1_BASE + 6)
-/* Flags: I - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV32 (SLJIT_MOV_S32 | SLJIT_I32_OP)
-/* Flags: - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV_P (SLJIT_OP1_BASE + 7)
-/* Flags: - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU (SLJIT_OP1_BASE + 8)
-/* Flags: I - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU_U8 (SLJIT_OP1_BASE + 9)
#define SLJIT_MOVU32_U8 (SLJIT_MOVU_U8 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU_S8 (SLJIT_OP1_BASE + 10)
#define SLJIT_MOVU32_S8 (SLJIT_MOVU_S8 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU_U16 (SLJIT_OP1_BASE + 11)
#define SLJIT_MOVU32_U16 (SLJIT_MOVU_U16 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU_S16 (SLJIT_OP1_BASE + 12)
#define SLJIT_MOVU32_S16 (SLJIT_MOVU_S16 | SLJIT_I32_OP)
-/* Flags: I - (never set any flags)
+/* Flags: - (may destroy flags)
Note: no SLJIT_MOVU32_U32 form, since it is the same as SLJIT_MOVU32 */
#define SLJIT_MOVU_U32 (SLJIT_OP1_BASE + 13)
-/* Flags: I - (never set any flags)
+/* Flags: - (may destroy flags)
Note: no SLJIT_MOVU32_S32 form, since it is the same as SLJIT_MOVU32 */
#define SLJIT_MOVU_S32 (SLJIT_OP1_BASE + 14)
-/* Flags: I - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU32 (SLJIT_MOVU_S32 | SLJIT_I32_OP)
-/* Flags: - (never set any flags) */
+/* Flags: - (may destroy flags) */
#define SLJIT_MOVU_P (SLJIT_OP1_BASE + 15)
-/* Flags: I | E | K */
+/* Flags: Z */
#define SLJIT_NOT (SLJIT_OP1_BASE + 16)
#define SLJIT_NOT32 (SLJIT_NOT | SLJIT_I32_OP)
-/* Flags: I | E | O | K */
+/* Flags: Z | OVERFLOW */
#define SLJIT_NEG (SLJIT_OP1_BASE + 17)
#define SLJIT_NEG32 (SLJIT_NEG | SLJIT_I32_OP)
/* Count leading zeroes
- Flags: I | E | K
- Important note! Sparc 32 does not support K flag, since
- the required popc instruction is introduced only in sparc 64. */
+ Flags: - (may destroy flags) */
#define SLJIT_CLZ (SLJIT_OP1_BASE + 18)
#define SLJIT_CLZ32 (SLJIT_CLZ | SLJIT_I32_OP)
@@ -813,46 +938,48 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
/* Starting index of opcodes for sljit_emit_op2. */
#define SLJIT_OP2_BASE 96
-/* Flags: I | E | O | C | K */
+/* Flags: Z | OVERFLOW | CARRY */
#define SLJIT_ADD (SLJIT_OP2_BASE + 0)
#define SLJIT_ADD32 (SLJIT_ADD | SLJIT_I32_OP)
-/* Flags: I | C | K */
+/* Flags: CARRY */
#define SLJIT_ADDC (SLJIT_OP2_BASE + 1)
#define SLJIT_ADDC32 (SLJIT_ADDC | SLJIT_I32_OP)
-/* Flags: I | E | U | S | O | C | K */
+/* Flags: Z | LESS | GREATER_EQUAL | GREATER | LESS_EQUAL
+ SIG_LESS | SIG_GREATER_EQUAL | SIG_GREATER
+ SIG_LESS_EQUAL | CARRY */
#define SLJIT_SUB (SLJIT_OP2_BASE + 2)
#define SLJIT_SUB32 (SLJIT_SUB | SLJIT_I32_OP)
-/* Flags: I | C | K */
+/* Flags: CARRY */
#define SLJIT_SUBC (SLJIT_OP2_BASE + 3)
#define SLJIT_SUBC32 (SLJIT_SUBC | SLJIT_I32_OP)
/* Note: integer mul
- Flags: I | O (see SLJIT_C_MUL_*) | K */
+ Flags: MUL_OVERFLOW */
#define SLJIT_MUL (SLJIT_OP2_BASE + 4)
#define SLJIT_MUL32 (SLJIT_MUL | SLJIT_I32_OP)
-/* Flags: I | E | K */
+/* Flags: Z */
#define SLJIT_AND (SLJIT_OP2_BASE + 5)
#define SLJIT_AND32 (SLJIT_AND | SLJIT_I32_OP)
-/* Flags: I | E | K */
+/* Flags: Z */
#define SLJIT_OR (SLJIT_OP2_BASE + 6)
#define SLJIT_OR32 (SLJIT_OR | SLJIT_I32_OP)
-/* Flags: I | E | K */
+/* Flags: Z */
#define SLJIT_XOR (SLJIT_OP2_BASE + 7)
#define SLJIT_XOR32 (SLJIT_XOR | SLJIT_I32_OP)
-/* Flags: I | E | K
+/* Flags: Z
Let bit_length be the length of the shift operation: 32 or 64.
If src2 is immediate, src2w is masked by (bit_length - 1).
Otherwise, if the content of src2 is outside the range from 0
to bit_length - 1, the result is undefined. */
#define SLJIT_SHL (SLJIT_OP2_BASE + 8)
#define SLJIT_SHL32 (SLJIT_SHL | SLJIT_I32_OP)
-/* Flags: I | E | K
+/* Flags: Z
Let bit_length be the length of the shift operation: 32 or 64.
If src2 is immediate, src2w is masked by (bit_length - 1).
Otherwise, if the content of src2 is outside the range from 0
to bit_length - 1, the result is undefined. */
#define SLJIT_LSHR (SLJIT_OP2_BASE + 9)
#define SLJIT_LSHR32 (SLJIT_LSHR | SLJIT_I32_OP)
-/* Flags: I | E | K
+/* Flags: Z
Let bit_length be the length of the shift operation: 32 or 64.
If src2 is immediate, src2w is masked by (bit_length - 1).
Otherwise, if the content of src2 is outside the range from 0
@@ -865,44 +992,38 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w);
-/* Returns with non-zero if fpu is available. */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void);
-
/* Starting index of opcodes for sljit_emit_fop1. */
#define SLJIT_FOP1_BASE 128
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MOV_F64 (SLJIT_FOP1_BASE + 0)
#define SLJIT_MOV_F32 (SLJIT_MOV_F64 | SLJIT_F32_OP)
/* Convert opcodes: CONV[DST_TYPE].FROM[SRC_TYPE]
SRC/DST TYPE can be: D - double, S - single, W - signed word, I - signed int
Rounding mode when the destination is W or I: round towards zero. */
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_CONV_F64_FROM_F32 (SLJIT_FOP1_BASE + 1)
#define SLJIT_CONV_F32_FROM_F64 (SLJIT_CONV_F64_FROM_F32 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_CONV_SW_FROM_F64 (SLJIT_FOP1_BASE + 2)
#define SLJIT_CONV_SW_FROM_F32 (SLJIT_CONV_SW_FROM_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_CONV_S32_FROM_F64 (SLJIT_FOP1_BASE + 3)
#define SLJIT_CONV_S32_FROM_F32 (SLJIT_CONV_S32_FROM_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_CONV_F64_FROM_SW (SLJIT_FOP1_BASE + 4)
#define SLJIT_CONV_F32_FROM_SW (SLJIT_CONV_F64_FROM_SW | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_CONV_F64_FROM_S32 (SLJIT_FOP1_BASE + 5)
#define SLJIT_CONV_F32_FROM_S32 (SLJIT_CONV_F64_FROM_S32 | SLJIT_F32_OP)
/* Note: dst is the left and src is the right operand for SLJIT_CMPD.
- Note: NaN check is always performed. If SLJIT_C_FLOAT_UNORDERED flag
- is set, the comparison result is unpredictable.
- Flags: SP | E | S (see SLJIT_C_FLOAT_*) */
+ Flags: EQUAL_F | LESS_F | GREATER_EQUAL_F | GREATER_F | LESS_EQUAL_F */
#define SLJIT_CMP_F64 (SLJIT_FOP1_BASE + 6)
#define SLJIT_CMP_F32 (SLJIT_CMP_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_NEG_F64 (SLJIT_FOP1_BASE + 7)
#define SLJIT_NEG_F32 (SLJIT_NEG_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_ABS_F64 (SLJIT_FOP1_BASE + 8)
#define SLJIT_ABS_F32 (SLJIT_ABS_F64 | SLJIT_F32_OP)
@@ -913,16 +1034,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compil
/* Starting index of opcodes for sljit_emit_fop2. */
#define SLJIT_FOP2_BASE 160
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_ADD_F64 (SLJIT_FOP2_BASE + 0)
#define SLJIT_ADD_F32 (SLJIT_ADD_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_SUB_F64 (SLJIT_FOP2_BASE + 1)
#define SLJIT_SUB_F32 (SLJIT_SUB_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_MUL_F64 (SLJIT_FOP2_BASE + 2)
#define SLJIT_MUL_F32 (SLJIT_MUL_F64 | SLJIT_F32_OP)
-/* Flags: SP - (never set any flags) */
+/* Flags: - (does not modify flags) */
#define SLJIT_DIV_F64 (SLJIT_FOP2_BASE + 3)
#define SLJIT_DIV_F32 (SLJIT_DIV_F64 | SLJIT_F32_OP)
@@ -949,56 +1070,77 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi
#define SLJIT_LESS 2
#define SLJIT_LESS32 (SLJIT_LESS | SLJIT_I32_OP)
+#define SLJIT_SET_LESS SLJIT_SET(SLJIT_LESS)
#define SLJIT_GREATER_EQUAL 3
#define SLJIT_GREATER_EQUAL32 (SLJIT_GREATER_EQUAL | SLJIT_I32_OP)
+#define SLJIT_SET_GREATER_EQUAL SLJIT_SET(SLJIT_GREATER_EQUAL)
#define SLJIT_GREATER 4
#define SLJIT_GREATER32 (SLJIT_GREATER | SLJIT_I32_OP)
+#define SLJIT_SET_GREATER SLJIT_SET(SLJIT_GREATER)
#define SLJIT_LESS_EQUAL 5
#define SLJIT_LESS_EQUAL32 (SLJIT_LESS_EQUAL | SLJIT_I32_OP)
+#define SLJIT_SET_LESS_EQUAL SLJIT_SET(SLJIT_LESS_EQUAL)
#define SLJIT_SIG_LESS 6
#define SLJIT_SIG_LESS32 (SLJIT_SIG_LESS | SLJIT_I32_OP)
+#define SLJIT_SET_SIG_LESS SLJIT_SET(SLJIT_SIG_LESS)
#define SLJIT_SIG_GREATER_EQUAL 7
#define SLJIT_SIG_GREATER_EQUAL32 (SLJIT_SIG_GREATER_EQUAL | SLJIT_I32_OP)
+#define SLJIT_SET_SIG_GREATER_EQUAL SLJIT_SET(SLJIT_SIG_GREATER_EQUAL)
#define SLJIT_SIG_GREATER 8
#define SLJIT_SIG_GREATER32 (SLJIT_SIG_GREATER | SLJIT_I32_OP)
+#define SLJIT_SET_SIG_GREATER SLJIT_SET(SLJIT_SIG_GREATER)
#define SLJIT_SIG_LESS_EQUAL 9
#define SLJIT_SIG_LESS_EQUAL32 (SLJIT_SIG_LESS_EQUAL | SLJIT_I32_OP)
+#define SLJIT_SET_SIG_LESS_EQUAL SLJIT_SET(SLJIT_SIG_LESS_EQUAL)
#define SLJIT_OVERFLOW 10
#define SLJIT_OVERFLOW32 (SLJIT_OVERFLOW | SLJIT_I32_OP)
+#define SLJIT_SET_OVERFLOW SLJIT_SET(SLJIT_OVERFLOW)
#define SLJIT_NOT_OVERFLOW 11
#define SLJIT_NOT_OVERFLOW32 (SLJIT_NOT_OVERFLOW | SLJIT_I32_OP)
#define SLJIT_MUL_OVERFLOW 12
#define SLJIT_MUL_OVERFLOW32 (SLJIT_MUL_OVERFLOW | SLJIT_I32_OP)
+#define SLJIT_SET_MUL_OVERFLOW SLJIT_SET(SLJIT_MUL_OVERFLOW)
#define SLJIT_MUL_NOT_OVERFLOW 13
#define SLJIT_MUL_NOT_OVERFLOW32 (SLJIT_MUL_NOT_OVERFLOW | SLJIT_I32_OP)
+/* There is no SLJIT_CARRY or SLJIT_NOT_CARRY. */
+#define SLJIT_SET_CARRY SLJIT_SET(14)
+
/* Floating point comparison types. */
-#define SLJIT_EQUAL_F64 14
+#define SLJIT_EQUAL_F64 16
#define SLJIT_EQUAL_F32 (SLJIT_EQUAL_F64 | SLJIT_F32_OP)
-#define SLJIT_NOT_EQUAL_F64 15
+#define SLJIT_SET_EQUAL_F SLJIT_SET(SLJIT_EQUAL_F64)
+#define SLJIT_NOT_EQUAL_F64 17
#define SLJIT_NOT_EQUAL_F32 (SLJIT_NOT_EQUAL_F64 | SLJIT_F32_OP)
-#define SLJIT_LESS_F64 16
+#define SLJIT_SET_NOT_EQUAL_F SLJIT_SET(SLJIT_NOT_EQUAL_F64)
+#define SLJIT_LESS_F64 18
#define SLJIT_LESS_F32 (SLJIT_LESS_F64 | SLJIT_F32_OP)
-#define SLJIT_GREATER_EQUAL_F64 17
+#define SLJIT_SET_LESS_F SLJIT_SET(SLJIT_LESS_F64)
+#define SLJIT_GREATER_EQUAL_F64 19
#define SLJIT_GREATER_EQUAL_F32 (SLJIT_GREATER_EQUAL_F64 | SLJIT_F32_OP)
-#define SLJIT_GREATER_F64 18
+#define SLJIT_SET_GREATER_EQUAL_F SLJIT_SET(SLJIT_GREATER_EQUAL_F64)
+#define SLJIT_GREATER_F64 20
#define SLJIT_GREATER_F32 (SLJIT_GREATER_F64 | SLJIT_F32_OP)
-#define SLJIT_LESS_EQUAL_F64 19
+#define SLJIT_SET_GREATER_F SLJIT_SET(SLJIT_GREATER_F64)
+#define SLJIT_LESS_EQUAL_F64 21
#define SLJIT_LESS_EQUAL_F32 (SLJIT_LESS_EQUAL_F64 | SLJIT_F32_OP)
-#define SLJIT_UNORDERED_F64 20
+#define SLJIT_SET_LESS_EQUAL_F SLJIT_SET(SLJIT_LESS_EQUAL_F64)
+#define SLJIT_UNORDERED_F64 22
#define SLJIT_UNORDERED_F32 (SLJIT_UNORDERED_F64 | SLJIT_F32_OP)
-#define SLJIT_ORDERED_F64 21
+#define SLJIT_SET_UNORDERED_F SLJIT_SET(SLJIT_UNORDERED_F64)
+#define SLJIT_ORDERED_F64 23
#define SLJIT_ORDERED_F32 (SLJIT_ORDERED_F64 | SLJIT_F32_OP)
+#define SLJIT_SET_ORDERED_F SLJIT_SET(SLJIT_ORDERED_F64)
/* Unconditional jump types. */
-#define SLJIT_JUMP 22
-#define SLJIT_FAST_CALL 23
-#define SLJIT_CALL0 24
-#define SLJIT_CALL1 25
-#define SLJIT_CALL2 26
-#define SLJIT_CALL3 27
+#define SLJIT_JUMP 24
+#define SLJIT_FAST_CALL 25
+#define SLJIT_CALL0 26
+#define SLJIT_CALL1 27
+#define SLJIT_CALL2 28
+#define SLJIT_CALL3 29
/* Fast calling method. See sljit_emit_fast_enter / sljit_emit_fast_return. */
@@ -1008,8 +1150,9 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi
/* Emit a jump instruction. The destination is not set, only the type of the jump.
type must be between SLJIT_EQUAL and SLJIT_CALL3
type can be combined (or'ed) with SLJIT_REWRITABLE_JUMP
- Flags: - (never set any flags) for both conditional and unconditional jumps.
- Flags: destroy all flags for calls. */
+
+ Flags: does not modify flags for conditional and unconditional
+ jumps but destroy all flags for calls. */
SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_s32 type);
/* Basic arithmetic comparison. In most architectures it is implemented as
@@ -1019,7 +1162,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
It is suggested to use this comparison form when appropriate.
type must be between SLJIT_EQUAL and SLJIT_I_SIG_LESS_EQUAL
type can be combined (or'ed) with SLJIT_REWRITABLE_JUMP
- Flags: destroy flags. */
+ Flags: may destroy flags. */
SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s32 type,
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w);
@@ -1047,36 +1190,55 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw
type must be between SLJIT_JUMP and SLJIT_CALL3
Direct form: set src to SLJIT_IMM() and srcw to the address
Indirect form: any other valid addressing mode
- Flags: - (never set any flags) for unconditional jumps.
- Flags: destroy all flags for calls. */
+
+ Flags: does not modify flags for unconditional jumps but
+ destroy all flags for calls. */
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 src, sljit_sw srcw);
/* Perform the operation using the conditional flags as the second argument.
- Type must always be between SLJIT_EQUAL and SLJIT_S_ORDERED. The value
+ Type must always be between SLJIT_EQUAL and SLJIT_ORDERED_F64. The value
represented by the type is 1, if the condition represented by the type
is fulfilled, and 0 otherwise.
- If op == SLJIT_MOV, SLJIT_MOV_S32, SLJIT_MOV_U32:
+ If op == SLJIT_MOV, SLJIT_MOV32:
Set dst to the value represented by the type (0 or 1).
- Src must be SLJIT_UNUSED, and srcw must be 0
- Flags: - (never set any flags)
+ Flags: - (does not modify flags)
If op == SLJIT_OR, op == SLJIT_AND, op == SLJIT_XOR
- Performs the binary operation using src as the first, and the value
- represented by type as the second argument.
- Important note: only dst=src and dstw=srcw is supported at the moment!
- Flags: I | E | K
- Note: sljit_emit_op_flags does nothing, if dst is SLJIT_UNUSED (regardless of op). */
+ Performs the binary operation using dst as the first, and the value
+ represented by type as the second argument. Result is written into dst.
+ Flags: Z (may destroy flags) */
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type);
-/* Copies the base address of SLJIT_SP + offset to dst.
- Flags: - (never set any flags) */
+/* Emit a conditional mov instruction which moves source to destination,
+ if the condition is satisfied. Unlike other arithmetic operations this
+ instruction does not support memory accesses.
+
+ type must be between SLJIT_EQUAL and SLJIT_ORDERED_F64
+ dst_reg must be a valid register and it can be combined
+ with SLJIT_I32_OP to perform a 32 bit arithmetic operation
+ src must be register or immediate (SLJIT_IMM)
+
+ Flags: - (does not modify flags) */
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw);
+
+/* Copies the base address of SLJIT_SP + offset to dst. The offset can be
+ anything to negate the effect of relative addressing. For example if an
+ array of sljit_sw values is stored on the stack from offset 0x40, and R0
+ contains the offset of an array item plus 0x120, this item can be
+ overwritten by two SLJIT instructions:
+
+ sljit_get_local_base(compiler, SLJIT_R1, 0, 0x40 - 0x120);
+ sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM2(SLJIT_R1, SLJIT_R0), 0, SLJIT_IMM, 0x5);
+
+ Flags: - (may destroy flags) */
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset);
/* The constant can be changed runtime (see: sljit_set_const)
- Flags: - (never set any flags) */
+ Flags: - (does not modify flags) */
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value);
/* After the code generation the address for label, jump and const instructions
@@ -1086,16 +1248,17 @@ static SLJIT_INLINE sljit_uw sljit_get_label_addr(struct sljit_label *label) { r
static SLJIT_INLINE sljit_uw sljit_get_jump_addr(struct sljit_jump *jump) { return jump->addr; }
static SLJIT_INLINE sljit_uw sljit_get_const_addr(struct sljit_const *const_) { return const_->addr; }
-/* Only the address is required to rewrite the code. */
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr);
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant);
+/* Only the address and executable offset are required to perform dynamic
+ code modifications. See sljit_get_executable_offset function. */
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset);
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset);
/* --------------------------------------------------------------------- */
/* Miscellaneous utility functions */
/* --------------------------------------------------------------------- */
#define SLJIT_MAJOR_VERSION 0
-#define SLJIT_MINOR_VERSION 93
+#define SLJIT_MINOR_VERSION 94
/* Get the human readable name of the platform. Can be useful on platforms
like ARM, where ARM and Thumb2 functions can be mixed, and
@@ -1113,19 +1276,23 @@ SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_release_lock(void);
#if (defined SLJIT_UTIL_STACK && SLJIT_UTIL_STACK)
-/* The sljit_stack is a utiliy feature of sljit, which allocates a
- writable memory region between base (inclusive) and limit (exclusive).
- Both base and limit is a pointer, and base is always <= than limit.
- This feature uses the "address space reserve" feature
- of modern operating systems. Basically we don't need to allocate a
- huge memory block in one step for the worst case, we can start with
- a smaller chunk and extend it later. Since the address space is
- reserved, the data never copied to other regions, thus it is safe
- to store pointers here. */
-
-/* Note: The base field is aligned to PAGE_SIZE bytes (usually 4k or more).
- Note: stack growing should not happen in small steps: 4k, 16k or even
- bigger growth is better.
+/* The sljit_stack is a utility extension of sljit, which provides
+ a top-down stack. The stack starts at base and goes down to
+ max_limit, so the memory region for this stack is between
+ max_limit (inclusive) and base (exclusive). However the
+ application can only use the region between limit (inclusive)
+ and base (exclusive). The sljit_stack_resize can be used to
+ extend this region up to max_limit.
+
+ This feature uses the "address space reserve" feature of modern
+ operating systems, so instead of allocating a huge memory block
+ applications can allocate a small region and extend it later
+ without moving the memory area. Hence pointers can be stored
+ in this area. */
+
+/* Note: base and max_limit fields are aligned to PAGE_SIZE bytes
+ (usually 4 Kbyte or more).
+ Note: stack should grow in larger steps, e.g. 4Kbyte, 16Kbyte or more.
Note: this structure may not be supported by all operating systems.
Some kind of fallback mechanism is suggested when SLJIT_UTIL_STACK
is not defined. */
@@ -1133,15 +1300,16 @@ SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_release_lock(void);
struct sljit_stack {
/* User data, anything can be stored here.
Starting with the same value as base. */
- sljit_uw top;
+ sljit_u8 *top;
/* These members are read only. */
- sljit_uw base;
- sljit_uw limit;
- sljit_uw max_limit;
+ sljit_u8 *base;
+ sljit_u8 *limit;
+ sljit_u8 *max_limit;
};
/* Returns NULL if unsuccessful.
- Note: limit and max_limit contains the size for stack allocation.
+ Note: max_limit contains the maximum stack size in bytes.
+ Note: limit contains the starting stack size in bytes.
Note: the top field is initialized to base.
Note: see sljit_create_compiler for the explanation of allocator_data. */
SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(sljit_uw limit, sljit_uw max_limit, void *allocator_data);
@@ -1153,7 +1321,7 @@ SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_free_stack(struct sljit_stack *st
since the growth ratio can be added to the current limit, and sljit_stack_resize
will do all the necessary checks. The fields of the stack are not changed if
sljit_stack_resize fails. */
-SLJIT_API_FUNC_ATTRIBUTE sljit_sw SLJIT_CALL sljit_stack_resize(struct sljit_stack *stack, sljit_uw new_limit);
+SLJIT_API_FUNC_ATTRIBUTE sljit_sw SLJIT_CALL sljit_stack_resize(struct sljit_stack *stack, sljit_u8 *new_limit);
#endif /* (defined SLJIT_UTIL_STACK && SLJIT_UTIL_STACK) */
@@ -1182,6 +1350,15 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr, struct
#endif /* !(defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) */
+#if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
+/* Free unused executable memory. The allocator keeps some free memory
+ around to reduce the number of OS executable memory allocations.
+ This improves performance since these calls are costly. However
+ it is sometimes desired to free all unused memory regions, e.g.
+ before the application terminates. */
+SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
+#endif
+
/* --------------------------------------------------------------------- */
/* CPU specific functions */
/* --------------------------------------------------------------------- */
@@ -1214,32 +1391,10 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_float_register_index(sljit_s32 reg)
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_s32 size);
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
-
-/* Returns with non-zero if sse2 is available. */
+/* Define the currently available CPU status flags. It is usually used after an
+ sljit_emit_op_custom call to define which flags are set. */
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_x86_is_sse2_available(void);
-
-/* Returns with non-zero if cmov instruction is available. */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_x86_is_cmov_available(void);
-
-/* Emit a conditional mov instruction on x86 CPUs. This instruction
- moves src to destination, if the condition is satisfied. Unlike
- other arithmetic instructions, destination must be a register.
- Before such instructions are emitted, cmov support should be
- checked by sljit_x86_is_cmov_available function.
- type must be between SLJIT_EQUAL and SLJIT_S_ORDERED
- dst_reg must be a valid register and it can be combined
- with SLJIT_I32_OP to perform 32 bit arithmetic
- Flags: I - (never set any flags)
- */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_x86_emit_cmov(struct sljit_compiler *compiler,
- sljit_s32 type,
- sljit_s32 dst_reg,
- sljit_s32 src, sljit_sw srcw);
-
-#endif
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_current_flags(struct sljit_compiler *compiler,
+ sljit_s32 current_flags);
#endif /* _SLJIT_LIR_H_ */
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeARM_32.c b/src/3rdparty/pcre2/src/sljit/sljitNativeARM_32.c
index b92808f526..745da99f61 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeARM_32.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeARM_32.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -38,8 +38,7 @@ SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
/* Last register + 1. */
#define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2)
#define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3)
-#define TMP_REG3 (SLJIT_NUMBER_OF_REGISTERS + 4)
-#define TMP_PC (SLJIT_NUMBER_OF_REGISTERS + 5)
+#define TMP_PC (SLJIT_NUMBER_OF_REGISTERS + 4)
#define TMP_FREG1 (0)
#define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1)
@@ -55,8 +54,8 @@ SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
(((max_diff) / (sljit_s32)sizeof(sljit_uw)) - (CONST_POOL_ALIGNMENT - 1))
/* See sljit_emit_enter and sljit_emit_op0 if you want to change them. */
-static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 6] = {
- 0, 0, 1, 2, 11, 10, 9, 8, 7, 6, 5, 4, 13, 3, 12, 14, 15
+static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
+ 0, 0, 1, 2, 3, 11, 10, 9, 8, 7, 6, 5, 4, 13, 14, 12, 15
};
#define RM(rm) (reg_map[rm])
@@ -83,6 +82,7 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 6] = {
#define BLX 0xe12fff30
#define BX 0xe12fff10
#define CLZ 0xe16f0f10
+#define CMN_DP 0xb
#define CMP_DP 0xa
#define BKPT 0xe1200070
#define EOR_DP 0x1
@@ -260,7 +260,7 @@ static SLJIT_INLINE sljit_s32 emit_blx(struct sljit_compiler *compiler)
{
/* Must follow tightly the previous instruction (to be able to convert it to bl instruction). */
SLJIT_ASSERT(compiler->cpool_diff == CONST_POOL_EMPTY || compiler->size - compiler->cpool_diff < MAX_DIFFERENCE(4092));
- return push_inst(compiler, BLX | RM(TMP_REG1));
+ return push_inst(compiler, BLX | RM(TMP_REG2));
}
static sljit_uw patch_pc_relative_loads(sljit_uw *last_pc_patch, sljit_uw *code_ptr, sljit_uw* const_pool, sljit_uw cpool_size)
@@ -389,7 +389,7 @@ static SLJIT_INLINE sljit_s32 emit_imm(struct sljit_compiler *compiler, sljit_s3
#endif
-static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_uw *code_ptr, sljit_uw *code)
+static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_uw *code_ptr, sljit_uw *code, sljit_sw executable_offset)
{
sljit_sw diff;
@@ -401,7 +401,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_uw
code_ptr--;
if (jump->flags & JUMP_ADDR)
- diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2));
+ diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2) - executable_offset);
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)(code_ptr + 2));
@@ -426,7 +426,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_uw
}
#else
if (jump->flags & JUMP_ADDR)
- diff = ((sljit_sw)jump->u.target - (sljit_sw)code_ptr);
+ diff = ((sljit_sw)jump->u.target - (sljit_sw)code_ptr - executable_offset);
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)code_ptr);
@@ -446,26 +446,28 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_uw
return 0;
}
-static SLJIT_INLINE void inline_set_jump_addr(sljit_uw addr, sljit_uw new_addr, sljit_s32 flush)
+static SLJIT_INLINE void inline_set_jump_addr(sljit_uw jump_ptr, sljit_sw executable_offset, sljit_uw new_addr, sljit_s32 flush_cache)
{
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
- sljit_uw *ptr = (sljit_uw*)addr;
- sljit_uw *inst = (sljit_uw*)ptr[0];
+ sljit_uw *ptr = (sljit_uw *)jump_ptr;
+ sljit_uw *inst = (sljit_uw *)ptr[0];
sljit_uw mov_pc = ptr[1];
sljit_s32 bl = (mov_pc & 0x0000f000) != RD(TMP_PC);
- sljit_sw diff = (sljit_sw)(((sljit_sw)new_addr - (sljit_sw)(inst + 2)) >> 2);
+ sljit_sw diff = (sljit_sw)(((sljit_sw)new_addr - (sljit_sw)(inst + 2) - executable_offset) >> 2);
if (diff <= 0x7fffff && diff >= -0x800000) {
/* Turn to branch. */
if (!bl) {
inst[0] = (mov_pc & COND_MASK) | (B - CONDITIONAL) | (diff & 0xffffff);
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 1);
}
} else {
inst[0] = (mov_pc & COND_MASK) | (BL - CONDITIONAL) | (diff & 0xffffff);
inst[1] = NOP;
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
}
@@ -479,12 +481,14 @@ static SLJIT_INLINE void inline_set_jump_addr(sljit_uw addr, sljit_uw new_addr,
if (*inst != mov_pc) {
inst[0] = mov_pc;
if (!bl) {
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 1);
}
} else {
inst[1] = BLX | RM(TMP_REG1);
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
}
@@ -492,11 +496,12 @@ static SLJIT_INLINE void inline_set_jump_addr(sljit_uw addr, sljit_uw new_addr,
*ptr = new_addr;
}
#else
- sljit_uw *inst = (sljit_uw*)addr;
+ sljit_uw *inst = (sljit_uw*)jump_ptr;
SLJIT_ASSERT((inst[0] & 0xfff00000) == MOVW && (inst[1] & 0xfff00000) == MOVT);
inst[0] = MOVW | (inst[0] & 0xf000) | ((new_addr << 4) & 0xf0000) | (new_addr & 0xfff);
inst[1] = MOVT | (inst[1] & 0xf000) | ((new_addr >> 12) & 0xf0000) | ((new_addr >> 16) & 0xfff);
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
#endif
@@ -504,7 +509,7 @@ static SLJIT_INLINE void inline_set_jump_addr(sljit_uw addr, sljit_uw new_addr,
static sljit_uw get_imm(sljit_uw imm);
-static SLJIT_INLINE void inline_set_const(sljit_uw addr, sljit_sw new_constant, sljit_s32 flush)
+static SLJIT_INLINE void inline_set_const(sljit_uw addr, sljit_sw executable_offset, sljit_sw new_constant, sljit_s32 flush_cache)
{
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
sljit_uw *ptr = (sljit_uw*)addr;
@@ -515,7 +520,8 @@ static SLJIT_INLINE void inline_set_const(sljit_uw addr, sljit_sw new_constant,
src2 = get_imm(new_constant);
if (src2) {
*inst = 0xe3a00000 | (ldr_literal & 0xf000) | src2;
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 1);
}
return;
@@ -524,7 +530,8 @@ static SLJIT_INLINE void inline_set_const(sljit_uw addr, sljit_sw new_constant,
src2 = get_imm(~new_constant);
if (src2) {
*inst = 0xe3e00000 | (ldr_literal & 0xf000) | src2;
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 1);
}
return;
@@ -537,7 +544,8 @@ static SLJIT_INLINE void inline_set_const(sljit_uw addr, sljit_sw new_constant,
if (*inst != ldr_literal) {
*inst = ldr_literal;
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 1);
}
}
@@ -547,7 +555,8 @@ static SLJIT_INLINE void inline_set_const(sljit_uw addr, sljit_sw new_constant,
SLJIT_ASSERT((inst[0] & 0xfff00000) == MOVW && (inst[1] & 0xfff00000) == MOVT);
inst[0] = MOVW | (inst[0] & 0xf000) | ((new_constant << 4) & 0xf0000) | (new_constant & 0xfff);
inst[1] = MOVT | (inst[1] & 0xf000) | ((new_constant >> 12) & 0xf0000) | ((new_constant >> 16) & 0xfff);
- if (flush) {
+ if (flush_cache) {
+ inst = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
#endif
@@ -562,6 +571,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_uw *buf_end;
sljit_uw size;
sljit_uw word_count;
+ sljit_sw executable_offset;
+ sljit_sw jump_addr;
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
sljit_uw cpool_size;
sljit_uw cpool_skip_alignment;
@@ -602,14 +613,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
code_ptr = code;
word_count = 0;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
if (label && label->size == 0) {
- label->addr = (sljit_uw)code;
- label->size = 0;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
label = label->next;
}
@@ -636,7 +647,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
cpool_size = 0;
if (label && label->size == word_count) {
/* Points after the current instruction. */
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -652,19 +663,19 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
SLJIT_ASSERT(!const_ || const_->addr >= word_count);
if (jump && jump->addr == word_count) {
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
- if (detect_jump_type(jump, code_ptr, code))
+ if (detect_jump_type(jump, code_ptr, code, executable_offset))
code_ptr--;
jump->addr = (sljit_uw)code_ptr;
#else
jump->addr = (sljit_uw)(code_ptr - 2);
- if (detect_jump_type(jump, code_ptr, code))
+ if (detect_jump_type(jump, code_ptr, code, executable_offset))
code_ptr -= 2;
#endif
jump = jump->next;
}
if (label && label->size == word_count) {
/* code_ptr can be affected above. */
- label->addr = (sljit_uw)(code_ptr + 1);
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr + 1, executable_offset);
label->size = (code_ptr + 1) - code;
label = label->next;
}
@@ -729,17 +740,18 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
jump = compiler->jumps;
while (jump) {
- buf_ptr = (sljit_uw*)jump->addr;
+ buf_ptr = (sljit_uw *)jump->addr;
if (jump->flags & PATCH_B) {
+ jump_addr = (sljit_sw)SLJIT_ADD_EXEC_OFFSET(buf_ptr + 2, executable_offset);
if (!(jump->flags & JUMP_ADDR)) {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
- SLJIT_ASSERT(((sljit_sw)jump->u.label->addr - (sljit_sw)(buf_ptr + 2)) <= 0x01ffffff && ((sljit_sw)jump->u.label->addr - (sljit_sw)(buf_ptr + 2)) >= -0x02000000);
- *buf_ptr |= (((sljit_sw)jump->u.label->addr - (sljit_sw)(buf_ptr + 2)) >> 2) & 0x00ffffff;
+ SLJIT_ASSERT(((sljit_sw)jump->u.label->addr - jump_addr) <= 0x01ffffff && ((sljit_sw)jump->u.label->addr - jump_addr) >= -0x02000000);
+ *buf_ptr |= (((sljit_sw)jump->u.label->addr - jump_addr) >> 2) & 0x00ffffff;
}
else {
- SLJIT_ASSERT(((sljit_sw)jump->u.target - (sljit_sw)(buf_ptr + 2)) <= 0x01ffffff && ((sljit_sw)jump->u.target - (sljit_sw)(buf_ptr + 2)) >= -0x02000000);
- *buf_ptr |= (((sljit_sw)jump->u.target - (sljit_sw)(buf_ptr + 2)) >> 2) & 0x00ffffff;
+ SLJIT_ASSERT(((sljit_sw)jump->u.target - jump_addr) <= 0x01ffffff && ((sljit_sw)jump->u.target - jump_addr) >= -0x02000000);
+ *buf_ptr |= (((sljit_sw)jump->u.target - jump_addr) >> 2) & 0x00ffffff;
}
}
else if (jump->flags & SLJIT_REWRITABLE_JUMP) {
@@ -747,10 +759,10 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
jump->addr = (sljit_uw)code_ptr;
code_ptr[0] = (sljit_uw)buf_ptr;
code_ptr[1] = *buf_ptr;
- inline_set_jump_addr((sljit_uw)code_ptr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
+ inline_set_jump_addr((sljit_uw)code_ptr, executable_offset, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
code_ptr += 2;
#else
- inline_set_jump_addr((sljit_uw)buf_ptr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
+ inline_set_jump_addr((sljit_uw)buf_ptr, executable_offset, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
#endif
}
else {
@@ -763,7 +775,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
buf_ptr += 1;
*buf_ptr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target;
#else
- inline_set_jump_addr((sljit_uw)buf_ptr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
+ inline_set_jump_addr((sljit_uw)buf_ptr, executable_offset, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
#endif
}
jump = jump->next;
@@ -782,7 +794,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
else
buf_ptr += 1;
/* Set the value again (can be a simple constant). */
- inline_set_const((sljit_uw)code_ptr, *buf_ptr, 0);
+ inline_set_const((sljit_uw)code_ptr, executable_offset, *buf_ptr, 0);
code_ptr += 2;
const_ = const_->next;
@@ -792,29 +804,90 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
SLJIT_ASSERT(code_ptr - code <= (sljit_s32)size);
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_uw);
+
+ code = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
+ code_ptr = (sljit_uw *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+
SLJIT_CACHE_FLUSH(code, code_ptr);
return code;
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+#else
+ /* Available by default. */
+ return 1;
+#endif
+
+ case SLJIT_HAS_PRE_UPDATE:
+ case SLJIT_HAS_CLZ:
+ case SLJIT_HAS_CMOV:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
/* --------------------------------------------------------------------- */
/* Entry, exit */
/* --------------------------------------------------------------------- */
+/* Creates an index in data_transfer_insts array. */
+#define WORD_DATA 0x00
+#define BYTE_DATA 0x01
+#define HALF_DATA 0x02
+#define PRELOAD_DATA 0x03
+#define SIGNED_DATA 0x04
+#define LOAD_DATA 0x08
+
/* emit_op inp_flags.
WRITE_BACK must be the first, since it is a flag. */
-#define WRITE_BACK 0x01
-#define ALLOW_IMM 0x02
-#define ALLOW_INV_IMM 0x04
+#define WRITE_BACK 0x10
+#define ALLOW_IMM 0x20
+#define ALLOW_INV_IMM 0x40
#define ALLOW_ANY_IMM (ALLOW_IMM | ALLOW_INV_IMM)
-#define ARG_TEST 0x08
-/* Creates an index in data_transfer_insts array. */
-#define WORD_DATA 0x00
-#define BYTE_DATA 0x10
-#define HALF_DATA 0x20
-#define SIGNED_DATA 0x40
-#define LOAD_DATA 0x80
+/* s/l - store/load (1 bit)
+ u/s - signed/unsigned (1 bit)
+ w/b/h/N - word/byte/half/NOT allowed (2 bit)
+ Storing signed and unsigned values are the same operations. */
+
+static const sljit_uw data_transfer_insts[16] = {
+/* s u w */ 0xe5000000 /* str */,
+/* s u b */ 0xe5400000 /* strb */,
+/* s u h */ 0xe10000b0 /* strh */,
+/* s u N */ 0x00000000 /* not allowed */,
+/* s s w */ 0xe5000000 /* str */,
+/* s s b */ 0xe5400000 /* strb */,
+/* s s h */ 0xe10000b0 /* strh */,
+/* s s N */ 0x00000000 /* not allowed */,
+
+/* l u w */ 0xe5100000 /* ldr */,
+/* l u b */ 0xe5500000 /* ldrb */,
+/* l u h */ 0xe11000b0 /* ldrh */,
+/* l u p */ 0xf5500000 /* preload data */,
+/* l s w */ 0xe5100000 /* ldr */,
+/* l s b */ 0xe11000d0 /* ldrsb */,
+/* l s h */ 0xe11000f0 /* ldrsh */,
+/* l s N */ 0x00000000 /* not allowed */,
+};
+
+#define EMIT_DATA_TRANSFER(type, add, wb, target_reg, base_reg, arg) \
+ (data_transfer_insts[(type) & 0xf] | ((add) << 23) | ((wb) << (21 - 4)) | RD(target_reg) | RN(base_reg) | (arg))
+
+/* Normal ldr/str instruction.
+ Type2: ldrsb, ldrh, ldrsh */
+#define IS_TYPE1_TRANSFER(type) \
+ (data_transfer_insts[(type) & 0xf] & 0x04000000)
+#define TYPE2_TRANSFER_IMM(imm) \
+ (((imm) & 0xf) | (((imm) & 0xf0) << 4) | (1 << 22))
/* Condition: AL. */
#define EMIT_DATA_PROCESS_INS(opcode, set_flags, dst, src1, src2) \
@@ -912,52 +985,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
/* Operators */
/* --------------------------------------------------------------------- */
-/* s/l - store/load (1 bit)
- u/s - signed/unsigned (1 bit)
- w/b/h/N - word/byte/half/NOT allowed (2 bit)
- It contans 16 items, but not all are different. */
-
-static sljit_sw data_transfer_insts[16] = {
-/* s u w */ 0xe5000000 /* str */,
-/* s u b */ 0xe5400000 /* strb */,
-/* s u h */ 0xe10000b0 /* strh */,
-/* s u N */ 0x00000000 /* not allowed */,
-/* s s w */ 0xe5000000 /* str */,
-/* s s b */ 0xe5400000 /* strb */,
-/* s s h */ 0xe10000b0 /* strh */,
-/* s s N */ 0x00000000 /* not allowed */,
-
-/* l u w */ 0xe5100000 /* ldr */,
-/* l u b */ 0xe5500000 /* ldrb */,
-/* l u h */ 0xe11000b0 /* ldrh */,
-/* l u N */ 0x00000000 /* not allowed */,
-/* l s w */ 0xe5100000 /* ldr */,
-/* l s b */ 0xe11000d0 /* ldrsb */,
-/* l s h */ 0xe11000f0 /* ldrsh */,
-/* l s N */ 0x00000000 /* not allowed */,
-};
-
-#define EMIT_DATA_TRANSFER(type, add, wb, target, base1, base2) \
- (data_transfer_insts[(type) >> 4] | ((add) << 23) | ((wb) << 21) | (reg_map[target] << 12) | (reg_map[base1] << 16) | (base2))
-/* Normal ldr/str instruction.
- Type2: ldrsb, ldrh, ldrsh */
-#define IS_TYPE1_TRANSFER(type) \
- (data_transfer_insts[(type) >> 4] & 0x04000000)
-#define TYPE2_TRANSFER_IMM(imm) \
- (((imm) & 0xf) | (((imm) & 0xf0) << 4) | (1 << 22))
-
/* flags: */
/* Arguments are swapped. */
#define ARGS_SWAPPED 0x01
/* Inverted immediate. */
#define INV_IMM 0x02
/* Source and destination is register. */
-#define REG_DEST 0x04
-#define REG_SOURCE 0x08
- /* One instruction is enough. */
-#define FAST_DEST 0x10
- /* Multiple instructions are required. */
-#define SLOW_DEST 0x20
+#define MOVE_REG_CONV 0x04
+ /* Unused return value. */
+#define UNUSED_RETURN 0x08
/* SET_FLAGS must be (1 << 20) as it is also the value of S bit (can be used for optimization). */
#define SET_FLAGS (1 << 20)
/* dst: reg
@@ -966,157 +1002,135 @@ static sljit_sw data_transfer_insts[16] = {
SRC2_IMM must be (1 << 25) as it is also the value of I bit (can be used for optimization). */
#define SRC2_IMM (1 << 25)
-#define EMIT_DATA_PROCESS_INS_AND_RETURN(opcode) \
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(opcode, flags & SET_FLAGS, dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)))
-
-#define EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(opcode, dst, src1, src2) \
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(opcode, flags & SET_FLAGS, dst, src1, src2))
-
#define EMIT_SHIFT_INS_AND_RETURN(opcode) \
SLJIT_ASSERT(!(flags & INV_IMM) && !(src2 & SRC2_IMM)); \
if (compiler->shift_imm != 0x20) { \
SLJIT_ASSERT(src1 == TMP_REG1); \
SLJIT_ASSERT(!(flags & ARGS_SWAPPED)); \
+ \
if (compiler->shift_imm != 0) \
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, flags & SET_FLAGS, dst, SLJIT_UNUSED, (compiler->shift_imm << 7) | (opcode << 5) | reg_map[src2])); \
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, flags & SET_FLAGS, dst, SLJIT_UNUSED, reg_map[src2])); \
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, flags & SET_FLAGS, \
+ dst, SLJIT_UNUSED, (compiler->shift_imm << 7) | (opcode << 5) | RM(src2))); \
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, flags & SET_FLAGS, dst, SLJIT_UNUSED, RM(src2))); \
} \
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, flags & SET_FLAGS, dst, SLJIT_UNUSED, (reg_map[(flags & ARGS_SWAPPED) ? src1 : src2] << 8) | (opcode << 5) | 0x10 | ((flags & ARGS_SWAPPED) ? reg_map[src2] : reg_map[src1])));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, flags & SET_FLAGS, \
+ dst, SLJIT_UNUSED, (reg_map[(flags & ARGS_SWAPPED) ? src1 : src2] << 8) | (opcode << 5) | 0x10 | RM((flags & ARGS_SWAPPED) ? src2 : src1)));
static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 flags,
sljit_s32 dst, sljit_s32 src1, sljit_s32 src2)
{
- sljit_sw mul_inst;
-
switch (GET_OPCODE(op)) {
case SLJIT_MOV:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & ARGS_SWAPPED));
if (dst != src2) {
if (src2 & SRC2_IMM) {
- if (flags & INV_IMM)
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MVN_DP, dst, SLJIT_UNUSED, src2);
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MOV_DP, dst, SLJIT_UNUSED, src2);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS((flags & INV_IMM) ? MVN_DP : MOV_DP, 0,
+ dst, SLJIT_UNUSED, src2));
}
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MOV_DP, dst, SLJIT_UNUSED, reg_map[src2]);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, RM(src2)));
}
return SLJIT_SUCCESS;
case SLJIT_MOV_U8:
case SLJIT_MOV_S8:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & ARGS_SWAPPED));
- if ((flags & (REG_DEST | REG_SOURCE)) == (REG_DEST | REG_SOURCE)) {
+ if (flags & MOVE_REG_CONV) {
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
if (op == SLJIT_MOV_U8)
return push_inst(compiler, EMIT_DATA_PROCESS_INS(AND_DP, 0, dst, src2, SRC2_IMM | 0xff));
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (24 << 7) | reg_map[src2])));
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (24 << 7) | (op == SLJIT_MOV_U8 ? 0x20 : 0x40) | reg_map[dst]));
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (24 << 7) | RM(src2))));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (24 << 7) | (op == SLJIT_MOV_U8 ? 0x20 : 0x40) | RM(dst)));
#else
return push_inst(compiler, (op == SLJIT_MOV_U8 ? UXTB : SXTB) | RD(dst) | RM(src2));
#endif
}
else if (dst != src2) {
SLJIT_ASSERT(src2 & SRC2_IMM);
- if (flags & INV_IMM)
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MVN_DP, dst, SLJIT_UNUSED, src2);
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MOV_DP, dst, SLJIT_UNUSED, src2);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS((flags & INV_IMM) ? MVN_DP : MOV_DP, 0,
+ dst, SLJIT_UNUSED, src2));
}
return SLJIT_SUCCESS;
case SLJIT_MOV_U16:
case SLJIT_MOV_S16:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & ARGS_SWAPPED));
- if ((flags & (REG_DEST | REG_SOURCE)) == (REG_DEST | REG_SOURCE)) {
+ if (flags & MOVE_REG_CONV) {
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (16 << 7) | reg_map[src2])));
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (16 << 7) | (op == SLJIT_MOV_U16 ? 0x20 : 0x40) | reg_map[dst]));
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (16 << 7) | RM(src2))));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, (16 << 7) | (op == SLJIT_MOV_U16 ? 0x20 : 0x40) | RM(dst)));
#else
return push_inst(compiler, (op == SLJIT_MOV_U16 ? UXTH : SXTH) | RD(dst) | RM(src2));
#endif
}
else if (dst != src2) {
SLJIT_ASSERT(src2 & SRC2_IMM);
- if (flags & INV_IMM)
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MVN_DP, dst, SLJIT_UNUSED, src2);
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MOV_DP, dst, SLJIT_UNUSED, src2);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS((flags & INV_IMM) ? MVN_DP : MOV_DP, 0,
+ dst, SLJIT_UNUSED, src2));
}
return SLJIT_SUCCESS;
case SLJIT_NOT:
if (src2 & SRC2_IMM) {
- if (flags & INV_IMM)
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MOV_DP, dst, SLJIT_UNUSED, src2);
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MVN_DP, dst, SLJIT_UNUSED, src2);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS((flags & INV_IMM) ? MOV_DP : MVN_DP, flags & SET_FLAGS,
+ dst, SLJIT_UNUSED, src2));
}
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(MVN_DP, dst, SLJIT_UNUSED, RM(src2));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MVN_DP, flags & SET_FLAGS, dst, SLJIT_UNUSED, RM(src2)));
case SLJIT_CLZ:
SLJIT_ASSERT(!(flags & INV_IMM));
SLJIT_ASSERT(!(src2 & SRC2_IMM));
FAIL_IF(push_inst(compiler, CLZ | RD(dst) | RM(src2)));
- if (flags & SET_FLAGS)
- EMIT_FULL_DATA_PROCESS_INS_AND_RETURN(CMP_DP, SLJIT_UNUSED, dst, SRC2_IMM);
return SLJIT_SUCCESS;
case SLJIT_ADD:
SLJIT_ASSERT(!(flags & INV_IMM));
- EMIT_DATA_PROCESS_INS_AND_RETURN(ADD_DP);
+ if ((flags & (UNUSED_RETURN | SET_FLAGS)) == (UNUSED_RETURN | SET_FLAGS) && !(flags & ARGS_SWAPPED))
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(CMN_DP, SET_FLAGS,
+ SLJIT_UNUSED, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, flags & SET_FLAGS,
+ dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_ADDC:
SLJIT_ASSERT(!(flags & INV_IMM));
- EMIT_DATA_PROCESS_INS_AND_RETURN(ADC_DP);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(ADC_DP, flags & SET_FLAGS,
+ dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_SUB:
SLJIT_ASSERT(!(flags & INV_IMM));
- if (!(flags & ARGS_SWAPPED))
- EMIT_DATA_PROCESS_INS_AND_RETURN(SUB_DP);
- EMIT_DATA_PROCESS_INS_AND_RETURN(RSB_DP);
+ if ((flags & (UNUSED_RETURN | SET_FLAGS)) == (UNUSED_RETURN | SET_FLAGS) && !(flags & ARGS_SWAPPED))
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(CMP_DP, SET_FLAGS,
+ SLJIT_UNUSED, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(!(flags & ARGS_SWAPPED) ? SUB_DP : RSB_DP, flags & SET_FLAGS,
+ dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_SUBC:
SLJIT_ASSERT(!(flags & INV_IMM));
- if (!(flags & ARGS_SWAPPED))
- EMIT_DATA_PROCESS_INS_AND_RETURN(SBC_DP);
- EMIT_DATA_PROCESS_INS_AND_RETURN(RSC_DP);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(!(flags & ARGS_SWAPPED) ? SBC_DP : RSC_DP, flags & SET_FLAGS,
+ dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_MUL:
SLJIT_ASSERT(!(flags & INV_IMM));
SLJIT_ASSERT(!(src2 & SRC2_IMM));
- if (SLJIT_UNLIKELY(op & SLJIT_SET_O))
- mul_inst = SMULL | (reg_map[TMP_REG3] << 16) | (reg_map[dst] << 12);
- else
- mul_inst = MUL | (reg_map[dst] << 16);
- if (dst != src2)
- FAIL_IF(push_inst(compiler, mul_inst | (reg_map[src1] << 8) | reg_map[src2]));
- else if (dst != src1)
- FAIL_IF(push_inst(compiler, mul_inst | (reg_map[src2] << 8) | reg_map[src1]));
- else {
- /* Rm and Rd must not be the same register. */
- SLJIT_ASSERT(dst != TMP_REG1);
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG1, SLJIT_UNUSED, reg_map[src2])));
- FAIL_IF(push_inst(compiler, mul_inst | (reg_map[src2] << 8) | reg_map[TMP_REG1]));
- }
+ if (!HAS_FLAGS(op))
+ return push_inst(compiler, MUL | (reg_map[dst] << 16) | (reg_map[src2] << 8) | reg_map[src1]);
- if (!(op & SLJIT_SET_O))
- return SLJIT_SUCCESS;
+ FAIL_IF(push_inst(compiler, SMULL | (reg_map[TMP_REG1] << 16) | (reg_map[dst] << 12) | (reg_map[src2] << 8) | reg_map[src1]));
- /* We need to use TMP_REG3. */
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- /* cmp TMP_REG2, dst asr #31. */
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(CMP_DP, SET_FLAGS, SLJIT_UNUSED, TMP_REG3, RM(dst) | 0xfc0));
+ /* cmp TMP_REG1, dst asr #31. */
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(CMP_DP, SET_FLAGS, SLJIT_UNUSED, TMP_REG1, RM(dst) | 0xfc0));
case SLJIT_AND:
- if (!(flags & INV_IMM))
- EMIT_DATA_PROCESS_INS_AND_RETURN(AND_DP);
- EMIT_DATA_PROCESS_INS_AND_RETURN(BIC_DP);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(!(flags & INV_IMM) ? AND_DP : BIC_DP, flags & SET_FLAGS,
+ dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_OR:
SLJIT_ASSERT(!(flags & INV_IMM));
- EMIT_DATA_PROCESS_INS_AND_RETURN(ORR_DP);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(ORR_DP, flags & SET_FLAGS, dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_XOR:
SLJIT_ASSERT(!(flags & INV_IMM));
- EMIT_DATA_PROCESS_INS_AND_RETURN(EOR_DP);
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(EOR_DP, flags & SET_FLAGS, dst, src1, (src2 & SRC2_IMM) ? src2 : RM(src2)));
case SLJIT_SHL:
EMIT_SHIFT_INS_AND_RETURN(0);
@@ -1127,12 +1141,11 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
case SLJIT_ASHR:
EMIT_SHIFT_INS_AND_RETURN(2);
}
- SLJIT_ASSERT_STOP();
+
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
-#undef EMIT_DATA_PROCESS_INS_AND_RETURN
-#undef EMIT_FULL_DATA_PROCESS_INS_AND_RETURN
#undef EMIT_SHIFT_INS_AND_RETURN
/* Tests whether the immediate can be stored in the 12 bit imm field.
@@ -1312,291 +1325,116 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 reg,
/* Load integer. */
return push_inst_with_literal(compiler, EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0, reg, TMP_PC, 0), imm);
#else
- return emit_imm(compiler, reg, imm);
+ FAIL_IF(push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | (imm & 0xfff)));
+ if (imm <= 0xffff)
+ return SLJIT_SUCCESS;
+ return push_inst(compiler, MOVT | RD(reg) | ((imm >> 12) & 0xf0000) | ((imm >> 16) & 0xfff));
#endif
}
-/* Helper function. Dst should be reg + value, using at most 1 instruction, flags does not set. */
-static sljit_s32 emit_set_delta(struct sljit_compiler *compiler, sljit_s32 dst, sljit_s32 reg, sljit_sw value)
+static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg,
+ sljit_s32 arg, sljit_sw argw, sljit_s32 tmp_reg)
{
- if (value >= 0) {
- value = get_imm(value);
- if (value)
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, dst, reg, value));
- }
- else {
- value = get_imm(-value);
- if (value)
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(SUB_DP, 0, dst, reg, value));
- }
- return SLJIT_ERR_UNSUPPORTED;
-}
+ sljit_uw offset_reg, imm;
+ sljit_uw is_type1_transfer = IS_TYPE1_TRANSFER(flags);
-/* Can perform an operation using at most 1 instruction. */
-static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_s32 inp_flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
-{
- sljit_uw imm;
+ SLJIT_ASSERT (arg & SLJIT_MEM);
+ SLJIT_ASSERT((arg & REG_MASK) != tmp_reg);
- if (arg & SLJIT_IMM) {
- imm = get_imm(argw);
- if (imm) {
- if (inp_flags & ARG_TEST)
- return 1;
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, reg, SLJIT_UNUSED, imm)));
- return -1;
+ SLJIT_COMPILE_ASSERT(WRITE_BACK == 0x10, optimized_for_emit_data_transfer);
+
+ if ((arg & REG_MASK) == SLJIT_UNUSED) {
+ /* Write back is not used. */
+ if (is_type1_transfer) {
+ FAIL_IF(load_immediate(compiler, tmp_reg, argw & ~0xfff));
+ argw &= 0xfff;
}
- imm = get_imm(~argw);
- if (imm) {
- if (inp_flags & ARG_TEST)
- return 1;
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MVN_DP, 0, reg, SLJIT_UNUSED, imm)));
- return -1;
+ else {
+ FAIL_IF(load_immediate(compiler, tmp_reg, argw & ~0xff));
+ argw &= 0xff;
}
- return 0;
+
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, 0, reg, tmp_reg, is_type1_transfer ? argw : TYPE2_TRANSFER_IMM(argw)));
}
- SLJIT_ASSERT(arg & SLJIT_MEM);
+ if (arg & OFFS_REG_MASK) {
+ offset_reg = OFFS_REG(arg);
+ arg &= REG_MASK;
+ argw &= 0x3;
- /* Fast loads/stores. */
- if (!(arg & REG_MASK))
- return 0;
+ if (argw != 0 && !is_type1_transfer) {
+ SLJIT_ASSERT(!(flags & WRITE_BACK));
- if (arg & OFFS_REG_MASK) {
- if ((argw & 0x3) != 0 && !IS_TYPE1_TRANSFER(inp_flags))
- return 0;
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, tmp_reg, arg, RM(offset_reg) | (argw << 7))));
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, 0, reg, tmp_reg, TYPE2_TRANSFER_IMM(0)));
+ }
- if (inp_flags & ARG_TEST)
- return 1;
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, inp_flags & WRITE_BACK, reg, arg & REG_MASK,
- RM(OFFS_REG(arg)) | (IS_TYPE1_TRANSFER(inp_flags) ? SRC2_IMM : 0) | ((argw & 0x3) << 7))));
- return -1;
+ /* Bit 25: RM is offset. */
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, flags & WRITE_BACK, reg, arg,
+ RM(offset_reg) | (is_type1_transfer ? (1 << 25) : 0) | (argw << 7)));
}
- if (IS_TYPE1_TRANSFER(inp_flags)) {
+ arg &= REG_MASK;
+
+ if (is_type1_transfer) {
+ if (argw > 0xfff) {
+ imm = get_imm(argw & ~0xfff);
+ if (imm) {
+ offset_reg = (flags & WRITE_BACK) ? arg : tmp_reg;
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, offset_reg, arg, imm)));
+ argw = argw & 0xfff;
+ arg = offset_reg;
+ }
+ }
+ else if (argw < -0xfff) {
+ imm = get_imm(-argw & ~0xfff);
+ if (imm) {
+ offset_reg = (flags & WRITE_BACK) ? arg : tmp_reg;
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(SUB_DP, 0, offset_reg, arg, imm)));
+ argw = -(-argw & 0xfff);
+ arg = offset_reg;
+ }
+ }
+
if (argw >= 0 && argw <= 0xfff) {
- if (inp_flags & ARG_TEST)
- return 1;
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, inp_flags & WRITE_BACK, reg, arg & REG_MASK, argw)));
- return -1;
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, flags & WRITE_BACK, reg, arg & REG_MASK, argw));
}
if (argw < 0 && argw >= -0xfff) {
- if (inp_flags & ARG_TEST)
- return 1;
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 0, inp_flags & WRITE_BACK, reg, arg & REG_MASK, -argw)));
- return -1;
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 0, flags & WRITE_BACK, reg, arg & REG_MASK, -argw));
}
}
else {
- if (argw >= 0 && argw <= 0xff) {
- if (inp_flags & ARG_TEST)
- return 1;
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, inp_flags & WRITE_BACK, reg, arg & REG_MASK, TYPE2_TRANSFER_IMM(argw))));
- return -1;
- }
- if (argw < 0 && argw >= -0xff) {
- if (inp_flags & ARG_TEST)
- return 1;
- argw = -argw;
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 0, inp_flags & WRITE_BACK, reg, arg & REG_MASK, TYPE2_TRANSFER_IMM(argw))));
- return -1;
- }
- }
-
- return 0;
-}
-
-/* See getput_arg below.
- Note: can_cache is called only for binary operators. Those
- operators always uses word arguments without write back. */
-static sljit_s32 can_cache(sljit_s32 arg, sljit_sw argw, sljit_s32 next_arg, sljit_sw next_argw)
-{
- /* Immediate caching is not supported as it would be an operation on constant arguments. */
- if (arg & SLJIT_IMM)
- return 0;
-
- /* Always a simple operation. */
- if (arg & OFFS_REG_MASK)
- return 0;
-
- if (!(arg & REG_MASK)) {
- /* Immediate access. */
- if ((next_arg & SLJIT_MEM) && ((sljit_uw)argw - (sljit_uw)next_argw <= 0xfff || (sljit_uw)next_argw - (sljit_uw)argw <= 0xfff))
- return 1;
- return 0;
- }
-
- if (argw <= 0xfffff && argw >= -0xfffff)
- return 0;
-
- if (argw == next_argw && (next_arg & SLJIT_MEM))
- return 1;
-
- if (arg == next_arg && ((sljit_uw)argw - (sljit_uw)next_argw <= 0xfff || (sljit_uw)next_argw - (sljit_uw)argw <= 0xfff))
- return 1;
-
- return 0;
-}
-
-#define GETPUT_ARG_DATA_TRANSFER(add, wb, target, base, imm) \
- if (max_delta & 0xf00) \
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, add, wb, target, base, imm))); \
- else \
- FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, add, wb, target, base, TYPE2_TRANSFER_IMM(imm))));
-
-#define TEST_WRITE_BACK() \
- if (inp_flags & WRITE_BACK) { \
- tmp_r = arg & REG_MASK; \
- if (reg == tmp_r) { \
- /* This can only happen for stores */ \
- /* since ldr reg, [reg, ...]! has no meaning */ \
- SLJIT_ASSERT(!(inp_flags & LOAD_DATA)); \
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG3, SLJIT_UNUSED, RM(reg)))); \
- reg = TMP_REG3; \
- } \
- }
-
-/* Emit the necessary instructions. See can_cache above. */
-static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 inp_flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw, sljit_s32 next_arg, sljit_sw next_argw)
-{
- sljit_s32 tmp_r;
- sljit_sw max_delta;
- sljit_sw sign;
- sljit_uw imm;
-
- if (arg & SLJIT_IMM) {
- SLJIT_ASSERT(inp_flags & LOAD_DATA);
- return load_immediate(compiler, reg, argw);
- }
-
- SLJIT_ASSERT(arg & SLJIT_MEM);
-
- tmp_r = (inp_flags & LOAD_DATA) ? reg : TMP_REG3;
- max_delta = IS_TYPE1_TRANSFER(inp_flags) ? 0xfff : 0xff;
-
- if ((arg & REG_MASK) == SLJIT_UNUSED) {
- /* Write back is not used. */
- imm = (sljit_uw)(argw - compiler->cache_argw);
- if ((compiler->cache_arg & SLJIT_IMM) && (imm <= (sljit_uw)max_delta || imm >= (sljit_uw)-max_delta)) {
- if (imm <= (sljit_uw)max_delta) {
- sign = 1;
- argw = argw - compiler->cache_argw;
+ if (argw > 0xff) {
+ imm = get_imm(argw & ~0xff);
+ if (imm) {
+ offset_reg = (flags & WRITE_BACK) ? arg : tmp_reg;
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, offset_reg, arg, imm)));
+ argw = argw & 0xff;
+ arg = offset_reg;
}
- else {
- sign = 0;
- argw = compiler->cache_argw - argw;
+ }
+ else if (argw < -0xff) {
+ imm = get_imm(-argw & ~0xff);
+ if (imm) {
+ offset_reg = (flags & WRITE_BACK) ? arg : tmp_reg;
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(SUB_DP, 0, offset_reg, arg, imm)));
+ argw = -(-argw & 0xff);
+ arg = offset_reg;
}
-
- GETPUT_ARG_DATA_TRANSFER(sign, 0, reg, TMP_REG3, argw);
- return SLJIT_SUCCESS;
}
- /* With write back, we can create some sophisticated loads, but
- it is hard to decide whether we should convert downward (0s) or upward (1s). */
- imm = (sljit_uw)(argw - next_argw);
- if ((next_arg & SLJIT_MEM) && (imm <= (sljit_uw)max_delta || imm >= (sljit_uw)-max_delta)) {
- SLJIT_ASSERT(inp_flags & LOAD_DATA);
-
- compiler->cache_arg = SLJIT_IMM;
- compiler->cache_argw = argw;
- tmp_r = TMP_REG3;
+ if (argw >= 0 && argw <= 0xff) {
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, flags & WRITE_BACK, reg, arg, TYPE2_TRANSFER_IMM(argw)));
+ }
+ if (argw < 0 && argw >= -0xff) {
+ argw = -argw;
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 0, flags & WRITE_BACK, reg, arg, TYPE2_TRANSFER_IMM(argw)));
}
-
- FAIL_IF(load_immediate(compiler, tmp_r, argw));
- GETPUT_ARG_DATA_TRANSFER(1, 0, reg, tmp_r, 0);
- return SLJIT_SUCCESS;
- }
-
- if (arg & OFFS_REG_MASK) {
- SLJIT_ASSERT((argw & 0x3) && !(max_delta & 0xf00));
- if (inp_flags & WRITE_BACK)
- tmp_r = arg & REG_MASK;
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, tmp_r, arg & REG_MASK, RM(OFFS_REG(arg)) | ((argw & 0x3) << 7))));
- return push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, 0, reg, tmp_r, TYPE2_TRANSFER_IMM(0)));
- }
-
- imm = (sljit_uw)(argw - compiler->cache_argw);
- if (compiler->cache_arg == arg && imm <= (sljit_uw)max_delta) {
- SLJIT_ASSERT(!(inp_flags & WRITE_BACK));
- GETPUT_ARG_DATA_TRANSFER(1, 0, reg, TMP_REG3, imm);
- return SLJIT_SUCCESS;
- }
- if (compiler->cache_arg == arg && imm >= (sljit_uw)-max_delta) {
- SLJIT_ASSERT(!(inp_flags & WRITE_BACK));
- imm = (sljit_uw)-(sljit_sw)imm;
- GETPUT_ARG_DATA_TRANSFER(0, 0, reg, TMP_REG3, imm);
- return SLJIT_SUCCESS;
- }
-
- imm = get_imm(argw & ~max_delta);
- if (imm) {
- TEST_WRITE_BACK();
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, tmp_r, arg & REG_MASK, imm)));
- GETPUT_ARG_DATA_TRANSFER(1, inp_flags & WRITE_BACK, reg, tmp_r, argw & max_delta);
- return SLJIT_SUCCESS;
- }
-
- imm = get_imm(-argw & ~max_delta);
- if (imm) {
- argw = -argw;
- TEST_WRITE_BACK();
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(SUB_DP, 0, tmp_r, arg & REG_MASK, imm)));
- GETPUT_ARG_DATA_TRANSFER(0, inp_flags & WRITE_BACK, reg, tmp_r, argw & max_delta);
- return SLJIT_SUCCESS;
- }
-
- if ((compiler->cache_arg & SLJIT_IMM) && compiler->cache_argw == argw) {
- TEST_WRITE_BACK();
- return push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, inp_flags & WRITE_BACK, reg, arg & REG_MASK, RM(TMP_REG3) | (max_delta & 0xf00 ? SRC2_IMM : 0)));
- }
-
- if (argw == next_argw && (next_arg & SLJIT_MEM)) {
- SLJIT_ASSERT(inp_flags & LOAD_DATA);
- FAIL_IF(load_immediate(compiler, TMP_REG3, argw));
-
- compiler->cache_arg = SLJIT_IMM;
- compiler->cache_argw = argw;
-
- TEST_WRITE_BACK();
- return push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, inp_flags & WRITE_BACK, reg, arg & REG_MASK, RM(TMP_REG3) | (max_delta & 0xf00 ? SRC2_IMM : 0)));
- }
-
- imm = (sljit_uw)(argw - next_argw);
- if (arg == next_arg && !(inp_flags & WRITE_BACK) && (imm <= (sljit_uw)max_delta || imm >= (sljit_uw)-max_delta)) {
- SLJIT_ASSERT(inp_flags & LOAD_DATA);
- FAIL_IF(load_immediate(compiler, TMP_REG3, argw));
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG3, TMP_REG3, reg_map[arg & REG_MASK])));
-
- compiler->cache_arg = arg;
- compiler->cache_argw = argw;
-
- GETPUT_ARG_DATA_TRANSFER(1, 0, reg, TMP_REG3, 0);
- return SLJIT_SUCCESS;
- }
-
- if ((arg & REG_MASK) == tmp_r) {
- compiler->cache_arg = SLJIT_IMM;
- compiler->cache_argw = argw;
- tmp_r = TMP_REG3;
}
- FAIL_IF(load_immediate(compiler, tmp_r, argw));
- return push_inst(compiler, EMIT_DATA_TRANSFER(inp_flags, 1, inp_flags & WRITE_BACK, reg, arg & REG_MASK, reg_map[tmp_r] | (max_delta & 0xf00 ? SRC2_IMM : 0)));
-}
-
-static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
-{
- if (getput_arg_fast(compiler, flags, reg, arg, argw))
- return compiler->error;
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- return getput_arg(compiler, flags, reg, arg, argw, 0, 0);
-}
-
-static SLJIT_INLINE sljit_s32 emit_op_mem2(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg1, sljit_sw arg1w, sljit_s32 arg2, sljit_sw arg2w)
-{
- if (getput_arg_fast(compiler, flags, reg, arg1, arg1w))
- return compiler->error;
- return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w);
+ FAIL_IF(load_immediate(compiler, tmp_reg, argw));
+ return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, flags & WRITE_BACK, reg, arg,
+ RM(tmp_reg) | (is_type1_transfer ? (1 << 25) : 0)));
}
static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 inp_flags,
@@ -1604,68 +1442,66 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
- /* arg1 goes to TMP_REG1 or src reg
- arg2 goes to TMP_REG2, imm or src reg
- TMP_REG3 can be used for caching
- result goes to TMP_REG2, so put result can use TMP_REG1 and TMP_REG3. */
+ /* src1 is reg or TMP_REG1
+ src2 is reg, TMP_REG2, or imm
+ result goes to TMP_REG2, so put result can use TMP_REG1. */
/* We prefers register and simple consts. */
- sljit_s32 dst_r;
- sljit_s32 src1_r;
- sljit_s32 src2_r = 0;
- sljit_s32 sugg_src2_r = TMP_REG2;
- sljit_s32 flags = GET_FLAGS(op) ? SET_FLAGS : 0;
-
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
+ sljit_s32 dst_reg;
+ sljit_s32 src1_reg;
+ sljit_s32 src2_reg;
+ sljit_s32 flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
/* Destination check. */
- if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED)) {
- if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32 && !(src2 & SLJIT_MEM))
- return SLJIT_SUCCESS;
- dst_r = TMP_REG2;
- }
- else if (FAST_IS_REG(dst)) {
- dst_r = dst;
- flags |= REG_DEST;
- if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32)
- sugg_src2_r = dst_r;
- }
- else {
- SLJIT_ASSERT(dst & SLJIT_MEM);
- if (getput_arg_fast(compiler, inp_flags | ARG_TEST, TMP_REG2, dst, dstw)) {
- flags |= FAST_DEST;
- dst_r = TMP_REG2;
- }
- else {
- flags |= SLOW_DEST;
- dst_r = 0;
+ if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED))
+ flags |= UNUSED_RETURN;
+
+ SLJIT_ASSERT(!(inp_flags & ALLOW_INV_IMM) || (inp_flags & ALLOW_IMM));
+
+ src2_reg = 0;
+
+ do {
+ if (!(inp_flags & ALLOW_IMM))
+ break;
+
+ if (src2 & SLJIT_IMM) {
+ src2_reg = get_imm(src2w);
+ if (src2_reg)
+ break;
+ if (inp_flags & ALLOW_INV_IMM) {
+ src2_reg = get_imm(~src2w);
+ if (src2_reg) {
+ flags |= INV_IMM;
+ break;
+ }
+ }
+ if (GET_OPCODE(op) == SLJIT_ADD) {
+ src2_reg = get_imm(-src2w);
+ if (src2_reg) {
+ op = SLJIT_SUB | GET_ALL_FLAGS(op);
+ break;
+ }
+ }
+ if (GET_OPCODE(op) == SLJIT_SUB) {
+ src2_reg = get_imm(-src2w);
+ if (src2_reg) {
+ op = SLJIT_ADD | GET_ALL_FLAGS(op);
+ break;
+ }
+ }
}
- }
- /* Source 1. */
- if (FAST_IS_REG(src1))
- src1_r = src1;
- else if (FAST_IS_REG(src2)) {
- flags |= ARGS_SWAPPED;
- src1_r = src2;
- src2 = src1;
- src2w = src1w;
- }
- else do { /* do { } while(0) is used because of breaks. */
- src1_r = 0;
- if ((inp_flags & ALLOW_ANY_IMM) && (src1 & SLJIT_IMM)) {
- /* The second check will generate a hit. */
- src2_r = get_imm(src1w);
- if (src2_r) {
+ if (src1 & SLJIT_IMM) {
+ src2_reg = get_imm(src1w);
+ if (src2_reg) {
flags |= ARGS_SWAPPED;
src1 = src2;
src1w = src2w;
break;
}
if (inp_flags & ALLOW_INV_IMM) {
- src2_r = get_imm(~src1w);
- if (src2_r) {
+ src2_reg = get_imm(~src1w);
+ if (src2_reg) {
flags |= ARGS_SWAPPED | INV_IMM;
src1 = src2;
src1w = src2w;
@@ -1673,9 +1509,9 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
}
}
if (GET_OPCODE(op) == SLJIT_ADD) {
- src2_r = get_imm(-src1w);
- if (src2_r) {
- /* Note: ARGS_SWAPPED is intentionally not applied! */
+ src2_reg = get_imm(-src1w);
+ if (src2_reg) {
+ /* Note: add is commutative operation. */
src1 = src2;
src1w = src2w;
op = SLJIT_SUB | GET_ALL_FLAGS(op);
@@ -1683,110 +1519,54 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
}
}
}
+ } while(0);
- if (getput_arg_fast(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w)) {
- FAIL_IF(compiler->error);
- src1_r = TMP_REG1;
- }
- } while (0);
+ /* Source 1. */
+ if (FAST_IS_REG(src1))
+ src1_reg = src1;
+ else if (src1 & SLJIT_MEM) {
+ FAIL_IF(emit_op_mem(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w, TMP_REG1));
+ src1_reg = TMP_REG1;
+ }
+ else {
+ FAIL_IF(load_immediate(compiler, TMP_REG1, src1w));
+ src1_reg = TMP_REG1;
+ }
- /* Source 2. */
- if (src2_r == 0) {
- if (FAST_IS_REG(src2)) {
- src2_r = src2;
- flags |= REG_SOURCE;
- if (!(flags & REG_DEST) && op >= SLJIT_MOV && op <= SLJIT_MOVU_S32)
- dst_r = src2_r;
- }
- else do { /* do { } while(0) is used because of breaks. */
- if ((inp_flags & ALLOW_ANY_IMM) && (src2 & SLJIT_IMM)) {
- src2_r = get_imm(src2w);
- if (src2_r)
- break;
- if (inp_flags & ALLOW_INV_IMM) {
- src2_r = get_imm(~src2w);
- if (src2_r) {
- flags |= INV_IMM;
- break;
- }
- }
- if (GET_OPCODE(op) == SLJIT_ADD) {
- src2_r = get_imm(-src2w);
- if (src2_r) {
- op = SLJIT_SUB | GET_ALL_FLAGS(op);
- flags &= ~ARGS_SWAPPED;
- break;
- }
- }
- if (GET_OPCODE(op) == SLJIT_SUB && !(flags & ARGS_SWAPPED)) {
- src2_r = get_imm(-src2w);
- if (src2_r) {
- op = SLJIT_ADD | GET_ALL_FLAGS(op);
- flags &= ~ARGS_SWAPPED;
- break;
- }
- }
- }
+ /* Destination. */
+ dst_reg = SLOW_IS_REG(dst) ? dst : TMP_REG2;
- /* src2_r is 0. */
- if (getput_arg_fast(compiler, inp_flags | LOAD_DATA, sugg_src2_r, src2, src2w)) {
- FAIL_IF(compiler->error);
- src2_r = sugg_src2_r;
- }
- } while (0);
- }
+ if (op <= SLJIT_MOVU_P) {
+ if (dst & SLJIT_MEM) {
+ if (inp_flags & BYTE_DATA)
+ inp_flags &= ~SIGNED_DATA;
- /* src1_r, src2_r and dst_r can be zero (=unprocessed) or non-zero.
- If they are zero, they must not be registers. */
- if (src1_r == 0 && src2_r == 0 && dst_r == 0) {
- if (!can_cache(src1, src1w, src2, src2w) && can_cache(src1, src1w, dst, dstw)) {
- SLJIT_ASSERT(!(flags & ARGS_SWAPPED));
- flags |= ARGS_SWAPPED;
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG1, src2, src2w, src1, src1w));
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG2, src1, src1w, dst, dstw));
+ if (FAST_IS_REG(src2))
+ return emit_op_mem(compiler, inp_flags, src2, dst, dstw, TMP_REG2);
}
- else {
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w, src2, src2w));
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG2, src2, src2w, dst, dstw));
- }
- src1_r = TMP_REG1;
- src2_r = TMP_REG2;
- }
- else if (src1_r == 0 && src2_r == 0) {
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w, src2, src2w));
- src1_r = TMP_REG1;
- }
- else if (src1_r == 0 && dst_r == 0) {
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w, dst, dstw));
- src1_r = TMP_REG1;
- }
- else if (src2_r == 0 && dst_r == 0) {
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, sugg_src2_r, src2, src2w, dst, dstw));
- src2_r = sugg_src2_r;
+
+ if (FAST_IS_REG(src2) && dst_reg != TMP_REG2)
+ flags |= MOVE_REG_CONV;
}
- if (dst_r == 0)
- dst_r = TMP_REG2;
+ /* Source 2. */
+ if (src2_reg == 0) {
+ src2_reg = (op <= SLJIT_MOVU_P) ? dst_reg : TMP_REG2;
- if (src1_r == 0) {
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w, 0, 0));
- src1_r = TMP_REG1;
+ if (FAST_IS_REG(src2))
+ src2_reg = src2;
+ else if (src2 & SLJIT_MEM)
+ FAIL_IF(emit_op_mem(compiler, inp_flags | LOAD_DATA, src2_reg, src2, src2w, TMP_REG2));
+ else
+ FAIL_IF(load_immediate(compiler, src2_reg, src2w));
}
- if (src2_r == 0) {
- FAIL_IF(getput_arg(compiler, inp_flags | LOAD_DATA, sugg_src2_r, src2, src2w, 0, 0));
- src2_r = sugg_src2_r;
- }
+ FAIL_IF(emit_single_op(compiler, op, flags, dst_reg, src1_reg, src2_reg));
- FAIL_IF(emit_single_op(compiler, op, flags, dst_r, src1_r, src2_r));
+ if (!(dst & SLJIT_MEM))
+ return SLJIT_SUCCESS;
- if (flags & (FAST_DEST | SLOW_DEST)) {
- if (flags & FAST_DEST)
- FAIL_IF(getput_arg_fast(compiler, inp_flags, dst_r, dst, dstw));
- else
- FAIL_IF(getput_arg(compiler, inp_flags, dst_r, dst, dstw, 0, 0));
- }
- return SLJIT_SUCCESS;
+ return emit_op_mem(compiler, inp_flags, dst_reg, dst, dstw, TMP_REG1);
}
#ifdef __cplusplus
@@ -1806,6 +1586,9 @@ extern int __aeabi_idivmod(int numerator, int denominator);
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op)
{
+ sljit_sw saved_reg_list[3];
+ sljit_sw saved_reg_count;
+
CHECK_ERROR();
CHECK(check_sljit_emit_op0(compiler, op));
@@ -1819,33 +1602,38 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
break;
case SLJIT_LMUL_UW:
case SLJIT_LMUL_SW:
-#if (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
return push_inst(compiler, (op == SLJIT_LMUL_UW ? UMULL : SMULL)
| (reg_map[SLJIT_R1] << 16)
| (reg_map[SLJIT_R0] << 12)
| (reg_map[SLJIT_R0] << 8)
| reg_map[SLJIT_R1]);
-#else
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG1, SLJIT_UNUSED, RM(SLJIT_R1))));
- return push_inst(compiler, (op == SLJIT_LMUL_UW ? UMULL : SMULL)
- | (reg_map[SLJIT_R1] << 16)
- | (reg_map[SLJIT_R0] << 12)
- | (reg_map[SLJIT_R0] << 8)
- | reg_map[TMP_REG1]);
-#endif
case SLJIT_DIVMOD_UW:
case SLJIT_DIVMOD_SW:
case SLJIT_DIV_UW:
case SLJIT_DIV_SW:
SLJIT_COMPILE_ASSERT((SLJIT_DIVMOD_UW & 0x2) == 0 && SLJIT_DIV_UW - 0x2 == SLJIT_DIVMOD_UW, bad_div_opcode_assignments);
- SLJIT_COMPILE_ASSERT(reg_map[2] == 1 && reg_map[3] == 2, bad_register_mapping);
-
- if ((op >= SLJIT_DIV_UW) && (compiler->scratches >= 3)) {
- FAIL_IF(push_inst(compiler, 0xe52d2008 /* str r2, [sp, #-8]! */));
- FAIL_IF(push_inst(compiler, 0xe58d1004 /* str r1, [sp, #4] */));
+ SLJIT_ASSERT(reg_map[2] == 1 && reg_map[3] == 2 && reg_map[4] == 3);
+
+ saved_reg_count = 0;
+ if (compiler->scratches >= 4)
+ saved_reg_list[saved_reg_count++] = 3;
+ if (compiler->scratches >= 3)
+ saved_reg_list[saved_reg_count++] = 2;
+ if (op >= SLJIT_DIV_UW)
+ saved_reg_list[saved_reg_count++] = 1;
+
+ if (saved_reg_count > 0) {
+ FAIL_IF(push_inst(compiler, 0xe52d0000 | (saved_reg_count >= 3 ? 16 : 8)
+ | (saved_reg_list[0] << 12) /* str rX, [sp, #-8/-16]! */));
+ if (saved_reg_count >= 2) {
+ SLJIT_ASSERT(saved_reg_list[1] < 8);
+ FAIL_IF(push_inst(compiler, 0xe58d0004 | (saved_reg_list[1] << 12) /* str rX, [sp, #4] */));
+ }
+ if (saved_reg_count >= 3) {
+ SLJIT_ASSERT(saved_reg_list[2] < 8);
+ FAIL_IF(push_inst(compiler, 0xe58d0008 | (saved_reg_list[2] << 12) /* str rX, [sp, #8] */));
+ }
}
- else if ((op >= SLJIT_DIV_UW) || (compiler->scratches >= 3))
- FAIL_IF(push_inst(compiler, 0xe52d0008 | (op >= SLJIT_DIV_UW ? 0x1000 : 0x2000) /* str r1/r2, [sp, #-8]! */));
#if defined(__GNUC__)
FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM,
@@ -1854,12 +1642,18 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
#error "Software divmod functions are needed"
#endif
- if ((op >= SLJIT_DIV_UW) && (compiler->scratches >= 3)) {
- FAIL_IF(push_inst(compiler, 0xe59d1004 /* ldr r1, [sp, #4] */));
- FAIL_IF(push_inst(compiler, 0xe49d2008 /* ldr r2, [sp], #8 */));
+ if (saved_reg_count > 0) {
+ if (saved_reg_count >= 3) {
+ SLJIT_ASSERT(saved_reg_list[2] < 8);
+ FAIL_IF(push_inst(compiler, 0xe59d0008 | (saved_reg_list[2] << 12) /* ldr rX, [sp, #8] */));
+ }
+ if (saved_reg_count >= 2) {
+ SLJIT_ASSERT(saved_reg_list[1] < 8);
+ FAIL_IF(push_inst(compiler, 0xe59d0004 | (saved_reg_list[1] << 12) /* ldr rX, [sp, #4] */));
+ }
+ return push_inst(compiler, 0xe49d0000 | (saved_reg_count >= 3 ? 16 : 8)
+ | (saved_reg_list[0] << 12) /* ldr rX, [sp], #8/16 */);
}
- else if ((op >= SLJIT_DIV_UW) || (compiler->scratches >= 3))
- return push_inst(compiler, 0xe49d0008 | (op >= SLJIT_DIV_UW ? 0x1000 : 0x2000) /* ldr r1/r2, [sp], #8 */);
return SLJIT_SUCCESS;
}
@@ -1875,6 +1669,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(dst, dstw);
ADJUST_LOCAL_OFFSET(src, srcw);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op)) {
+#if (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
+ if (op <= SLJIT_MOV_P && (src & SLJIT_MEM))
+ return emit_op_mem(compiler, PRELOAD_DATA | LOAD_DATA, TMP_PC, src, srcw, TMP_REG1);
+#endif
+ return SLJIT_SUCCESS;
+ }
+
switch (GET_OPCODE(op)) {
case SLJIT_MOV:
case SLJIT_MOV_U32:
@@ -1940,6 +1742,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
+
switch (GET_OPCODE(op)) {
case SLJIT_ADD:
case SLJIT_ADDC:
@@ -1996,43 +1801,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
-
-/* 0 - no fpu
- 1 - vfp */
-static sljit_s32 arm_fpu_type = -1;
-
-static void init_compiler(void)
-{
- if (arm_fpu_type != -1)
- return;
-
- /* TODO: Only the OS can help to determine the correct fpu type. */
- arm_fpu_type = 1;
-}
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#else
- if (arm_fpu_type == -1)
- init_compiler();
- return arm_fpu_type;
-#endif
-}
-
-#else
-
-#define arm_fpu_type 1
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
- /* Always available. */
- return 1;
-}
-
-#endif
#define FPU_LOAD (1 << 20)
#define EMIT_FPU_DATA_TRANSFER(inst, add, base, freg, offs) \
@@ -2042,72 +1810,54 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
{
- sljit_sw tmp;
sljit_uw imm;
sljit_sw inst = VSTR_F32 | (flags & (SLJIT_F32_OP | FPU_LOAD));
+
SLJIT_ASSERT(arg & SLJIT_MEM);
+ arg &= ~SLJIT_MEM;
if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) {
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG1, arg & REG_MASK, RM(OFFS_REG(arg)) | ((argw & 0x3) << 7))));
- arg = SLJIT_MEM | TMP_REG1;
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG2, arg & REG_MASK, RM(OFFS_REG(arg)) | ((argw & 0x3) << 7))));
+ arg = TMP_REG2;
argw = 0;
}
/* Fast loads and stores. */
- if ((arg & REG_MASK)) {
+ if (arg) {
if (!(argw & ~0x3fc))
return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, arg & REG_MASK, reg, argw >> 2));
if (!(-argw & ~0x3fc))
return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 0, arg & REG_MASK, reg, (-argw) >> 2));
- }
- if (compiler->cache_arg == arg) {
- tmp = argw - compiler->cache_argw;
- if (!(tmp & ~0x3fc))
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG3, reg, tmp >> 2));
- if (!(-tmp & ~0x3fc))
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 0, TMP_REG3, reg, -tmp >> 2));
- if (emit_set_delta(compiler, TMP_REG3, TMP_REG3, tmp) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- compiler->cache_argw = argw;
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG3, reg, 0));
- }
- }
-
- if (arg & REG_MASK) {
- if (emit_set_delta(compiler, TMP_REG1, arg & REG_MASK, argw) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG1, reg, 0));
- }
imm = get_imm(argw & ~0x3fc);
if (imm) {
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG1, arg & REG_MASK, imm)));
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG1, reg, (argw & 0x3fc) >> 2));
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG2, arg & REG_MASK, imm)));
+ return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG2, reg, (argw & 0x3fc) >> 2));
}
imm = get_imm(-argw & ~0x3fc);
if (imm) {
argw = -argw;
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(SUB_DP, 0, TMP_REG1, arg & REG_MASK, imm)));
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 0, TMP_REG1, reg, (argw & 0x3fc) >> 2));
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(SUB_DP, 0, TMP_REG2, arg & REG_MASK, imm)));
+ return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 0, TMP_REG2, reg, (argw & 0x3fc) >> 2));
}
}
- compiler->cache_arg = arg;
- compiler->cache_argw = argw;
- if (arg & REG_MASK) {
- FAIL_IF(load_immediate(compiler, TMP_REG1, argw));
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG3, arg & REG_MASK, reg_map[TMP_REG1])));
+ if (arg) {
+ FAIL_IF(load_immediate(compiler, TMP_REG2, argw));
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(ADD_DP, 0, TMP_REG2, arg & REG_MASK, RM(TMP_REG2))));
}
else
- FAIL_IF(load_immediate(compiler, TMP_REG3, argw));
+ FAIL_IF(load_immediate(compiler, TMP_REG2, argw));
- return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG3, reg, 0));
+ return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG2, reg, 0));
}
static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
+ op ^= SLJIT_F32_OP;
+
if (src & SLJIT_MEM) {
FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_F32_OP) | FPU_LOAD, TMP_FREG1, src, srcw));
src = TMP_FREG1;
@@ -2115,9 +1865,6 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VCVT_S32_F32, op & SLJIT_F32_OP, TMP_FREG1, src, 0)));
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst(compiler, VMOV | (1 << 20) | RD(dst) | (TMP_FREG1 << 16));
@@ -2131,6 +1878,8 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_comp
{
sljit_s32 dst_r = FAST_IS_REG(dst) ? dst : TMP_FREG1;
+ op ^= SLJIT_F32_OP;
+
if (FAST_IS_REG(src))
FAIL_IF(push_inst(compiler, VMOV | RD(src) | (TMP_FREG1 << 16)));
else if (src & SLJIT_MEM) {
@@ -2153,6 +1902,8 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
+ op ^= SLJIT_F32_OP;
+
if (src1 & SLJIT_MEM) {
FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_F32_OP) | FPU_LOAD, TMP_FREG1, src1, src1w));
src1 = TMP_FREG1;
@@ -2174,16 +1925,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compil
sljit_s32 dst_r;
CHECK_ERROR();
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- if (GET_OPCODE(op) != SLJIT_CONV_F64_FROM_F32)
- op ^= SLJIT_F32_OP;
SLJIT_COMPILE_ASSERT((SLJIT_F32_OP == 0x100), float_transfer_bit_error);
SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw);
dst_r = FAST_IS_REG(dst) ? dst : TMP_FREG1;
+ if (GET_OPCODE(op) != SLJIT_CONV_F64_FROM_F32)
+ op ^= SLJIT_F32_OP;
+
if (src & SLJIT_MEM) {
FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_F32_OP) | FPU_LOAD, dst_r, src, srcw));
src = dst_r;
@@ -2228,8 +1978,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compil
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
op ^= SLJIT_F32_OP;
dst_r = FAST_IS_REG(dst) ? dst : TMP_FREG1;
@@ -2282,21 +2030,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
- /* For UNUSED dst. Uncommon, but possible. */
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
+ SLJIT_ASSERT(reg_map[TMP_REG1] == 14);
if (FAST_IS_REG(dst))
- return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, RM(TMP_REG3)));
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst, SLJIT_UNUSED, RM(TMP_REG1)));
/* Memory. */
- if (getput_arg_fast(compiler, WORD_DATA, TMP_REG3, dst, dstw))
- return compiler->error;
- /* TMP_REG3 is used for caching. */
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG2, SLJIT_UNUSED, RM(TMP_REG3))));
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- return getput_arg(compiler, WORD_DATA, TMP_REG2, dst, dstw, 0, 0);
+ return emit_op_mem(compiler, WORD_DATA, TMP_REG1, dst, dstw, TMP_REG2);
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_s32 src, sljit_sw srcw)
@@ -2305,21 +2045,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
CHECK(check_sljit_emit_fast_return(compiler, src, srcw));
ADJUST_LOCAL_OFFSET(src, srcw);
+ SLJIT_ASSERT(reg_map[TMP_REG1] == 14);
+
if (FAST_IS_REG(src))
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG3, SLJIT_UNUSED, RM(src))));
- else if (src & SLJIT_MEM) {
- if (getput_arg_fast(compiler, WORD_DATA | LOAD_DATA, TMP_REG3, src, srcw))
- FAIL_IF(compiler->error);
- else {
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- FAIL_IF(getput_arg(compiler, WORD_DATA | LOAD_DATA, TMP_REG2, src, srcw, 0, 0));
- FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG3, SLJIT_UNUSED, RM(TMP_REG2))));
- }
- }
+ FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG1, 0, RM(src))));
+ else if (src & SLJIT_MEM)
+ FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, src, srcw, TMP_REG2));
else if (src & SLJIT_IMM)
- FAIL_IF(load_immediate(compiler, TMP_REG3, srcw));
- return push_inst(compiler, BLX | RM(TMP_REG3));
+ FAIL_IF(load_immediate(compiler, TMP_REG1, srcw));
+
+ return push_inst(compiler, BX | RM(TMP_REG1));
}
/* --------------------------------------------------------------------- */
@@ -2414,7 +2149,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
if (type >= SLJIT_FAST_CALL)
PTR_FAIL_IF(prepare_blx(compiler));
PTR_FAIL_IF(push_inst_with_unique_literal(compiler, ((EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0,
- type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0)) & ~COND_MASK) | get_cc(type), 0));
+ type <= SLJIT_JUMP ? TMP_PC : TMP_REG2, TMP_PC, 0)) & ~COND_MASK) | get_cc(type), 0));
if (jump->flags & SLJIT_REWRITABLE_JUMP) {
jump->addr = compiler->size;
@@ -2431,8 +2166,8 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
#else
if (type >= SLJIT_FAST_CALL)
jump->flags |= IS_BL;
- PTR_FAIL_IF(emit_imm(compiler, TMP_REG1, 0));
- PTR_FAIL_IF(push_inst(compiler, (((type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1)) & ~COND_MASK) | get_cc(type)));
+ PTR_FAIL_IF(emit_imm(compiler, TMP_REG2, 0));
+ PTR_FAIL_IF(push_inst(compiler, (((type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG2)) & ~COND_MASK) | get_cc(type)));
jump->addr = compiler->size;
#endif
return jump;
@@ -2452,7 +2187,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
return push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(src));
SLJIT_ASSERT(src & SLJIT_MEM);
- FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG2, src, srcw));
+ FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG2, src, srcw, TMP_REG2));
return push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG2));
}
@@ -2464,12 +2199,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
if (type >= SLJIT_FAST_CALL)
FAIL_IF(prepare_blx(compiler));
- FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0, type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0), 0));
+ FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0, type <= SLJIT_JUMP ? TMP_PC : TMP_REG2, TMP_PC, 0), 0));
if (type >= SLJIT_FAST_CALL)
FAIL_IF(emit_blx(compiler));
#else
- FAIL_IF(emit_imm(compiler, TMP_REG1, 0));
- FAIL_IF(push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1)));
+ FAIL_IF(emit_imm(compiler, TMP_REG2, 0));
+ FAIL_IF(push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG2)));
#endif
jump->addr = compiler->size;
return SLJIT_SUCCESS;
@@ -2477,55 +2212,80 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
sljit_s32 dst_r, flags = GET_ALL_FLAGS(op);
sljit_uw cc, ins;
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- ADJUST_LOCAL_OFFSET(src, srcw);
-
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
op = GET_OPCODE(op);
cc = get_cc(type & 0xff);
- dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+ dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
if (op < SLJIT_ADD) {
FAIL_IF(push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst_r, SLJIT_UNUSED, SRC2_IMM | 0)));
FAIL_IF(push_inst(compiler, (EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst_r, SLJIT_UNUSED, SRC2_IMM | 1) & ~COND_MASK) | cc));
- return (dst_r == TMP_REG2) ? emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw) : SLJIT_SUCCESS;
+ if (dst & SLJIT_MEM)
+ return emit_op_mem(compiler, WORD_DATA, TMP_REG1, dst, dstw, TMP_REG2);
+ return SLJIT_SUCCESS;
}
ins = (op == SLJIT_AND ? AND_DP : (op == SLJIT_OR ? ORR_DP : EOR_DP));
- if ((op == SLJIT_OR || op == SLJIT_XOR) && FAST_IS_REG(dst) && dst == src) {
- FAIL_IF(push_inst(compiler, (EMIT_DATA_PROCESS_INS(ins, 0, dst, dst, SRC2_IMM | 1) & ~COND_MASK) | cc));
- /* The condition must always be set, even if the ORR/EOR is not executed above. */
- return (flags & SLJIT_SET_E) ? push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, SET_FLAGS, TMP_REG1, SLJIT_UNUSED, RM(dst))) : SLJIT_SUCCESS;
- }
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- if (src & SLJIT_MEM) {
- FAIL_IF(emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, src, srcw, dst, dstw));
- src = TMP_REG1;
- srcw = 0;
- } else if (src & SLJIT_IMM) {
+ if (dst & SLJIT_MEM)
+ FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, dst, dstw, TMP_REG2));
+
+ FAIL_IF(push_inst(compiler, (EMIT_DATA_PROCESS_INS(ins, 0, dst_r, dst_r, SRC2_IMM | 1) & ~COND_MASK) | cc));
+
+ if (op == SLJIT_AND)
+ FAIL_IF(push_inst(compiler, (EMIT_DATA_PROCESS_INS(ins, 0, dst_r, dst_r, SRC2_IMM | 0) & ~COND_MASK) | (cc ^ 0x10000000)));
+
+ if (dst & SLJIT_MEM)
+ FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG1, dst, dstw, TMP_REG2));
+
+ if (flags & SLJIT_SET_Z)
+ return push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, SET_FLAGS, TMP_REG2, SLJIT_UNUSED, RM(dst_r)));
+ return SLJIT_SUCCESS;
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ sljit_uw cc, tmp;
+
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
+
+ dst_reg &= ~SLJIT_I32_OP;
+
+ cc = get_cc(type & 0xff);
+
+ if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
+ tmp = get_imm(srcw);
+ if (tmp)
+ return push_inst(compiler, (EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst_reg, SLJIT_UNUSED, tmp) & ~COND_MASK) | cc);
+
+ tmp = get_imm(~srcw);
+ if (tmp)
+ return push_inst(compiler, (EMIT_DATA_PROCESS_INS(MVN_DP, 0, dst_reg, SLJIT_UNUSED, tmp) & ~COND_MASK) | cc);
+
+#if (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
+ tmp = (sljit_uw) srcw;
+ FAIL_IF(push_inst(compiler, (MOVW & ~COND_MASK) | cc | RD(dst_reg) | ((tmp << 4) & 0xf0000) | (tmp & 0xfff)));
+ if (tmp <= 0xffff)
+ return SLJIT_SUCCESS;
+ return push_inst(compiler, (MOVT & ~COND_MASK) | cc | RD(dst_reg) | ((tmp >> 12) & 0xf0000) | ((tmp >> 16) & 0xfff));
+#else
FAIL_IF(load_immediate(compiler, TMP_REG1, srcw));
src = TMP_REG1;
- srcw = 0;
+#endif
}
- FAIL_IF(push_inst(compiler, (EMIT_DATA_PROCESS_INS(ins, 0, dst_r, src, SRC2_IMM | 1) & ~COND_MASK) | cc));
- FAIL_IF(push_inst(compiler, (EMIT_DATA_PROCESS_INS(ins, 0, dst_r, src, SRC2_IMM | 0) & ~COND_MASK) | (cc ^ 0x10000000)));
- if (dst_r == TMP_REG2)
- FAIL_IF(emit_op_mem2(compiler, WORD_DATA, TMP_REG2, dst, dstw, 0, 0));
-
- return (flags & SLJIT_SET_E) ? push_inst(compiler, EMIT_DATA_PROCESS_INS(MOV_DP, SET_FLAGS, TMP_REG1, SLJIT_UNUSED, RM(dst_r))) : SLJIT_SUCCESS;
+ return push_inst(compiler, (EMIT_DATA_PROCESS_INS(MOV_DP, 0, dst_reg, SLJIT_UNUSED, RM(src)) & ~COND_MASK) | cc);
}
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
@@ -2551,16 +2311,16 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
set_const(const_, compiler);
if (dst & SLJIT_MEM)
- PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw));
+ PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw, TMP_REG1));
return const_;
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
- inline_set_jump_addr(addr, new_addr, 1);
+ inline_set_jump_addr(addr, executable_offset, new_target, 1);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
- inline_set_const(addr, new_constant, 1);
+ inline_set_const(addr, executable_offset, new_constant, 1);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c b/src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c
index d9958512c8..fd67f50253 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -76,6 +76,7 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 8] = {
#define BRK 0xd4200000
#define CBZ 0xb4000000
#define CLZ 0xdac01000
+#define CSEL 0x9a800000
#define CSINC 0x9a800400
#define EOR 0xca000000
#define EORI 0xd2000000
@@ -151,7 +152,7 @@ static SLJIT_INLINE void modify_imm64_const(sljit_ins* inst, sljit_uw new_imm)
inst[3] = MOVK | dst | ((new_imm >> 48) << 5) | (3 << 21);
}
-static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code)
+static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
{
sljit_sw diff;
sljit_uw target_addr;
@@ -165,9 +166,10 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_in
target_addr = jump->u.target;
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
- target_addr = (sljit_uw)(code + jump->u.label->size);
+ target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset;
}
- diff = (sljit_sw)target_addr - (sljit_sw)(code_ptr + 4);
+
+ diff = (sljit_sw)target_addr - (sljit_sw)(code_ptr + 4) - executable_offset;
if (jump->flags & IS_COND) {
diff += sizeof(sljit_ins);
@@ -211,6 +213,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_ins *buf_ptr;
sljit_ins *buf_end;
sljit_uw word_count;
+ sljit_sw executable_offset;
sljit_uw addr;
sljit_s32 dst;
@@ -228,6 +231,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
code_ptr = code;
word_count = 0;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
+
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
@@ -242,13 +247,13 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
SLJIT_ASSERT(!jump || jump->addr >= word_count);
SLJIT_ASSERT(!const_ || const_->addr >= word_count);
if (label && label->size == word_count) {
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
if (jump && jump->addr == word_count) {
jump->addr = (sljit_uw)(code_ptr - 4);
- code_ptr -= detect_jump_type(jump, code_ptr, code);
+ code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset);
jump = jump->next;
}
if (const_ && const_->addr == word_count) {
@@ -263,7 +268,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
} while (buf);
if (label && label->size == word_count) {
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -277,9 +282,10 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
while (jump) {
do {
addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target;
- buf_ptr = (sljit_ins*)jump->addr;
+ buf_ptr = (sljit_ins *)jump->addr;
+
if (jump->flags & PATCH_B) {
- addr = (sljit_sw)(addr - jump->addr) >> 2;
+ addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset)) >> 2;
SLJIT_ASSERT((sljit_sw)addr <= 0x1ffffff && (sljit_sw)addr >= -0x2000000);
buf_ptr[0] = ((jump->flags & IS_BL) ? BL : B) | (addr & 0x3ffffff);
if (jump->flags & IS_COND)
@@ -287,7 +293,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
break;
}
if (jump->flags & PATCH_COND) {
- addr = (sljit_sw)(addr - jump->addr) >> 2;
+ addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset)) >> 2;
SLJIT_ASSERT((sljit_sw)addr <= 0x3ffff && (sljit_sw)addr >= -0x40000);
buf_ptr[0] = (buf_ptr[0] & ~0xffffe0) | ((addr & 0x7ffff) << 5);
break;
@@ -308,11 +314,37 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
}
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
+
+ code = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
+ code_ptr = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+
SLJIT_CACHE_FLUSH(code, code_ptr);
return code;
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+#else
+ /* Available by default. */
+ return 1;
+#endif
+
+ case SLJIT_HAS_PRE_UPDATE:
+ case SLJIT_HAS_CLZ:
+ case SLJIT_HAS_CMOV:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
/* --------------------------------------------------------------------- */
/* Core code generator functions. */
/* --------------------------------------------------------------------- */
@@ -365,7 +397,7 @@ static sljit_ins logical_imm(sljit_sw imm, sljit_s32 len)
uimm = (sljit_uw)imm;
while (1) {
if (len <= 0) {
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return 0;
}
mask = ((sljit_uw)1 << len) - 1;
@@ -635,7 +667,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
}
goto set_flags;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
@@ -702,7 +734,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
case SLJIT_NOT:
SLJIT_ASSERT(arg1 == TMP_REG1);
FAIL_IF(push_inst(compiler, (ORN ^ inv_bits) | RD(dst) | RN(TMP_ZERO) | RM(arg2)));
- goto set_flags;
+ break; /* Set flags. */
case SLJIT_NEG:
SLJIT_ASSERT(arg1 == TMP_REG1);
if (flags & SET_FLAGS)
@@ -710,8 +742,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
return push_inst(compiler, (SUB ^ inv_bits) | RD(dst) | RN(TMP_ZERO) | RM(arg2));
case SLJIT_CLZ:
SLJIT_ASSERT(arg1 == TMP_REG1);
- FAIL_IF(push_inst(compiler, (CLZ ^ inv_bits) | RD(dst) | RN(arg2)));
- goto set_flags;
+ return push_inst(compiler, (CLZ ^ inv_bits) | RD(dst) | RN(arg2));
case SLJIT_ADD:
CHECK_FLAGS(1 << 29);
return push_inst(compiler, (ADD ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2));
@@ -740,24 +771,24 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
return push_inst(compiler, (AND ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2));
case SLJIT_OR:
FAIL_IF(push_inst(compiler, (ORR ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)));
- goto set_flags;
+ break; /* Set flags. */
case SLJIT_XOR:
FAIL_IF(push_inst(compiler, (EOR ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)));
- goto set_flags;
+ break; /* Set flags. */
case SLJIT_SHL:
FAIL_IF(push_inst(compiler, (LSLV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)));
- goto set_flags;
+ break; /* Set flags. */
case SLJIT_LSHR:
FAIL_IF(push_inst(compiler, (LSRV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)));
- goto set_flags;
+ break; /* Set flags. */
case SLJIT_ASHR:
FAIL_IF(push_inst(compiler, (ASRV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)));
- goto set_flags;
+ break; /* Set flags. */
+ default:
+ SLJIT_UNREACHABLE();
+ return SLJIT_SUCCESS;
}
- SLJIT_ASSERT_STOP();
- return SLJIT_SUCCESS;
-
set_flags:
if (flags & SET_FLAGS)
return push_inst(compiler, (SUBS ^ inv_bits) | RD(TMP_ZERO) | RN(dst) | RM(TMP_ZERO));
@@ -859,6 +890,10 @@ static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_s32 flag
}
arg &= REG_MASK;
+
+ if (arg == SLJIT_UNUSED)
+ return 0;
+
if (argw >= 0 && (argw >> shift) <= 0xfff && (argw & ((1 << shift) - 1)) == 0) {
if (SLJIT_UNLIKELY(flags & ARG_TEST))
return 1;
@@ -919,21 +954,23 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl
next_argw = 0;
}
- tmp_r = (flags & STORE) ? TMP_REG3 : reg;
+ tmp_r = ((flags & STORE) || (flags == (WORD_SIZE | SIGNED))) ? TMP_REG3 : reg;
if (SLJIT_UNLIKELY((flags & UPDATE) && (arg & REG_MASK))) {
/* Update only applies if a base register exists. */
other_r = OFFS_REG(arg);
if (!other_r) {
other_r = arg & REG_MASK;
- if (other_r != reg && argw >= 0 && argw <= 0xffffff) {
+ SLJIT_ASSERT(other_r != reg);
+
+ if (argw >= 0 && argw <= 0xffffff) {
if ((argw & 0xfff) != 0)
FAIL_IF(push_inst(compiler, ADDI | RD(other_r) | RN(other_r) | ((argw & 0xfff) << 10)));
if (argw >> 12)
FAIL_IF(push_inst(compiler, ADDI | (1 << 22) | RD(other_r) | RN(other_r) | ((argw >> 12) << 10)));
return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(other_r));
}
- else if (other_r != reg && argw < 0 && argw >= -0xffffff) {
+ else if (argw < 0 && argw >= -0xffffff) {
argw = -argw;
if ((argw & 0xfff) != 0)
FAIL_IF(push_inst(compiler, SUBI | RD(other_r) | RN(other_r) | ((argw & 0xfff) << 10)));
@@ -966,18 +1003,8 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl
/* No caching here. */
arg &= REG_MASK;
- argw &= 0x3;
- if (!argw || argw == shift) {
- FAIL_IF(push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(other_r) | (argw ? (1 << 12) : 0)));
- return push_inst(compiler, ADD | RD(arg) | RN(arg) | RM(other_r) | (argw << 10));
- }
- if (arg != reg) {
- FAIL_IF(push_inst(compiler, ADD | RD(arg) | RN(arg) | RM(other_r) | (argw << 10)));
- return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg));
- }
- FAIL_IF(push_inst(compiler, ADD | RD(TMP_LR) | RN(arg) | RM(other_r) | (argw << 10)));
- FAIL_IF(push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(TMP_LR)));
- return push_inst(compiler, ORR | RD(arg) | RN(TMP_ZERO) | RM(TMP_LR));
+ FAIL_IF(push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(other_r)));
+ return push_inst(compiler, ADD | RD(arg) | RN(arg) | RM(other_r));
}
if (arg & OFFS_REG_MASK) {
@@ -998,16 +1025,16 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl
}
}
- if (argw >= 0 && argw <= 0xffffff && (argw & ((1 << shift) - 1)) == 0) {
- FAIL_IF(push_inst(compiler, ADDI | (1 << 22) | RD(tmp_r) | RN(arg & REG_MASK) | ((argw >> 12) << 10)));
- return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30)
- | RT(reg) | RN(tmp_r) | ((argw & 0xfff) << (10 - shift)));
- }
-
diff = argw - next_argw;
next_arg = (arg & REG_MASK) && (arg == next_arg) && diff <= 0xfff && diff >= -0xfff && diff != 0;
arg &= REG_MASK;
+ if (arg != SLJIT_UNUSED && argw >= 0 && argw <= 0xffffff && (argw & ((1 << shift) - 1)) == 0) {
+ FAIL_IF(push_inst(compiler, ADDI | (1 << 22) | RD(tmp_r) | RN(arg) | ((argw >> 12) << 10)));
+ return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30)
+ | RT(reg) | RN(tmp_r) | ((argw & 0xfff) << (10 - shift)));
+ }
+
if (arg && compiler->cache_arg == SLJIT_MEM) {
if (compiler->cache_argw == argw)
return push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(TMP_REG3));
@@ -1290,6 +1317,23 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
compiler->cache_arg = 0;
compiler->cache_argw = 0;
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op)) {
+ if (op <= SLJIT_MOV_P && (src & SLJIT_MEM)) {
+ SLJIT_ASSERT(reg_map[1] == 0 && reg_map[3] == 2 && reg_map[5] == 4);
+
+ if (op >= SLJIT_MOV_U8 && op <= SLJIT_MOV_S8)
+ dst = 5;
+ else if (op >= SLJIT_MOV_U16 && op <= SLJIT_MOV_S16)
+ dst = 3;
+ else
+ dst = 1;
+
+ /* Signed word sized load is the prefetch instruction. */
+ return emit_op_mem(compiler, WORD_SIZE | SIGNED, dst, src, srcw);
+ }
+ return SLJIT_SUCCESS;
+ }
+
dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
op = GET_OPCODE(op);
@@ -1364,7 +1408,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
srcw = (sljit_s32)srcw;
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
flags = 0;
break;
}
@@ -1391,7 +1435,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
return SLJIT_SUCCESS;
}
- flags = GET_FLAGS(op_flags) ? SET_FLAGS : 0;
+ flags = HAS_FLAGS(op_flags) ? SET_FLAGS : 0;
mem_flags = WORD_SIZE;
if (op_flags & SLJIT_I32_OP) {
flags |= INT_OP;
@@ -1443,8 +1487,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
compiler->cache_arg = 0;
compiler->cache_argw = 0;
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
+
dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
- flags = GET_FLAGS(op) ? SET_FLAGS : 0;
+ flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
mem_flags = WORD_SIZE;
if (op & SLJIT_I32_OP) {
flags |= INT_OP;
@@ -1537,16 +1584,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#else
- /* Available by default. */
- return 1;
-#endif
-}
-
static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
{
sljit_u32 shift = MEM_SIZE_SHIFT(flags);
@@ -1604,7 +1641,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
- sljit_s32 dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
+ sljit_s32 dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0;
if (GET_OPCODE(op) == SLJIT_CONV_S32_FROM_F64)
@@ -1617,7 +1654,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
FAIL_IF(push_inst(compiler, (FCVTZS ^ inv_bits) | RD(dst_r) | VN(src)));
- if (dst_r == TMP_REG1 && dst != SLJIT_UNUSED)
+ if (dst & SLJIT_MEM)
return emit_op_mem(compiler, ((GET_OPCODE(op) == SLJIT_CONV_S32_FROM_F64) ? INT_SIZE : WORD_SIZE) | STORE, TMP_REG1, dst, dstw);
return SLJIT_SUCCESS;
}
@@ -1775,10 +1812,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
- /* For UNUSED dst. Uncommon, but possible. */
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst(compiler, ORR | RD(dst) | RN(TMP_ZERO) | RM(TMP_LR));
@@ -1856,7 +1889,7 @@ static sljit_uw get_cc(sljit_s32 type)
return 0x6;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return 0xe;
}
}
@@ -1966,19 +1999,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
- sljit_s32 dst_r, flags, mem_flags;
+ sljit_s32 dst_r, src_r, flags, mem_flags;
sljit_ins cc;
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- ADJUST_LOCAL_OFFSET(src, srcw);
-
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
cc = get_cc(type & 0xff);
dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
@@ -1992,26 +2020,50 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
compiler->cache_arg = 0;
compiler->cache_argw = 0;
- flags = GET_FLAGS(op) ? SET_FLAGS : 0;
+ flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
mem_flags = WORD_SIZE;
if (op & SLJIT_I32_OP) {
flags |= INT_OP;
mem_flags = INT_SIZE;
}
- if (src & SLJIT_MEM) {
- FAIL_IF(emit_op_mem2(compiler, mem_flags, TMP_REG1, src, srcw, dst, dstw));
+ src_r = dst;
+
+ if (dst & SLJIT_MEM) {
+ FAIL_IF(emit_op_mem2(compiler, mem_flags, TMP_REG1, dst, dstw, dst, dstw));
+ src_r = TMP_REG1;
+ }
+
+ FAIL_IF(push_inst(compiler, CSINC | (cc << 12) | RD(TMP_REG2) | RN(TMP_ZERO) | RM(TMP_ZERO)));
+ emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src_r, TMP_REG2);
+
+ if (dst & SLJIT_MEM)
+ return emit_op_mem2(compiler, mem_flags | STORE, TMP_REG1, dst, dstw, 0, 0);
+ return SLJIT_SUCCESS;
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? (1 << 31) : 0;
+ sljit_ins cc;
+
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
+
+ if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
+ if (dst_reg & SLJIT_I32_OP)
+ srcw = (sljit_s32)srcw;
+ FAIL_IF(load_immediate(compiler, TMP_REG1, srcw));
src = TMP_REG1;
srcw = 0;
- } else if (src & SLJIT_IMM)
- flags |= ARG1_IMM;
+ }
- FAIL_IF(push_inst(compiler, CSINC | (cc << 12) | RD(TMP_REG2) | RN(TMP_ZERO) | RM(TMP_ZERO)));
- emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src, TMP_REG2);
+ cc = get_cc(type & 0xff);
+ dst_reg &= ~SLJIT_I32_OP;
- if (dst_r != TMP_REG1)
- return SLJIT_SUCCESS;
- return emit_op_mem2(compiler, mem_flags | STORE, TMP_REG1, dst, dstw, 0, 0);
+ return push_inst(compiler, (CSEL ^ inv_bits) | (cc << 12) | RD(dst_reg) | RN(dst_reg) | RM(src));
}
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
@@ -2027,7 +2079,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
PTR_FAIL_IF(!const_);
set_const(const_, compiler);
- dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
+ dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
PTR_FAIL_IF(emit_imm64_const(compiler, dst_r, init_value));
if (dst & SLJIT_MEM)
@@ -2035,16 +2087,18 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
return const_;
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
sljit_ins* inst = (sljit_ins*)addr;
- modify_imm64_const(inst, new_addr);
+ modify_imm64_const(inst, new_target);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 4);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
sljit_ins* inst = (sljit_ins*)addr;
modify_imm64_const(inst, new_constant);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 4);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c b/src/3rdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c
index 1ed44a8130..29e5566a82 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -35,15 +35,14 @@ typedef sljit_u32 sljit_ins;
/* Last register + 1. */
#define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2)
#define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3)
-#define TMP_REG3 (SLJIT_NUMBER_OF_REGISTERS + 4)
-#define TMP_PC (SLJIT_NUMBER_OF_REGISTERS + 5)
+#define TMP_PC (SLJIT_NUMBER_OF_REGISTERS + 4)
#define TMP_FREG1 (0)
#define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1)
/* See sljit_emit_enter and sljit_emit_op0 if you want to change them. */
-static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 6] = {
- 0, 0, 1, 2, 12, 11, 10, 9, 8, 7, 6, 5, 13, 3, 4, 14, 15
+static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
+ 0, 0, 1, 2, 12, 11, 10, 9, 8, 7, 6, 5, 4, 13, 3, 14, 15
};
#define COPY_BITS(src, from, to, bits) \
@@ -108,7 +107,11 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 6] = {
#define BLX 0x4780
#define BX 0x4700
#define CLZ 0xfab0f080
+#define CMNI_W 0xf1100f00
+#define CMP 0x4280
#define CMPI 0x2800
+#define CMPI_W 0xf1b00f00
+#define CMP_X 0x4500
#define CMP_W 0xebb00f00
#define EORI 0xf0800000
#define EORS 0x4040
@@ -221,7 +224,7 @@ static SLJIT_INLINE void modify_imm32_const(sljit_u16 *inst, sljit_uw new_imm)
inst[3] = dst | COPY_BITS(new_imm, 8 + 16, 12, 3) | ((new_imm & 0xff0000) >> 16);
}
-static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u16 *code_ptr, sljit_u16 *code)
+static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u16 *code_ptr, sljit_u16 *code, sljit_sw executable_offset)
{
sljit_sw diff;
@@ -232,7 +235,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u1
/* Branch to ARM code is not optimized yet. */
if (!(jump->u.target & 0x1))
return 0;
- diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2)) >> 1;
+ diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2) - executable_offset) >> 1;
}
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
@@ -276,7 +279,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u1
return 0;
}
-static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump)
+static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump, sljit_sw executable_offset)
{
sljit_s32 type = (jump->flags >> 4) & 0xf;
sljit_sw diff;
@@ -290,10 +293,12 @@ static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump)
if (jump->flags & JUMP_ADDR) {
SLJIT_ASSERT(jump->u.target & 0x1);
- diff = ((sljit_sw)jump->u.target - (sljit_sw)(jump->addr + 4)) >> 1;
+ diff = ((sljit_sw)jump->u.target - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_offset) >> 1;
+ }
+ else {
+ SLJIT_ASSERT(jump->u.label->addr & 0x1);
+ diff = ((sljit_sw)(jump->u.label->addr) - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_offset) >> 1;
}
- else
- diff = ((sljit_sw)(jump->u.label->addr) - (sljit_sw)(jump->addr + 4)) >> 1;
jump_inst = (sljit_u16*)jump->addr;
switch (type) {
@@ -336,7 +341,7 @@ static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump)
else if (type == 6) /* Encoding T1 of 'BL' instruction */
jump_inst[1] |= 0xd000;
else
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
@@ -347,6 +352,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_u16 *buf_ptr;
sljit_u16 *buf_end;
sljit_uw half_count;
+ sljit_sw executable_offset;
struct sljit_label *label;
struct sljit_jump *jump;
@@ -362,6 +368,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
code_ptr = code;
half_count = 0;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
+
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
@@ -376,13 +384,13 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
SLJIT_ASSERT(!jump || jump->addr >= half_count);
SLJIT_ASSERT(!const_ || const_->addr >= half_count);
if (label && label->size == half_count) {
- label->addr = ((sljit_uw)code_ptr) | 0x1;
+ label->addr = ((sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset)) | 0x1;
label->size = code_ptr - code;
label = label->next;
}
if (jump && jump->addr == half_count) {
jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8);
- code_ptr -= detect_jump_type(jump, code_ptr, code);
+ code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset);
jump = jump->next;
}
if (const_ && const_->addr == half_count) {
@@ -397,7 +405,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
} while (buf);
if (label && label->size == half_count) {
- label->addr = ((sljit_uw)code_ptr) | 0x1;
+ label->addr = ((sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset)) | 0x1;
label->size = code_ptr - code;
label = label->next;
}
@@ -409,17 +417,43 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
jump = compiler->jumps;
while (jump) {
- set_jump_instruction(jump);
+ set_jump_instruction(jump, executable_offset);
jump = jump->next;
}
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_u16);
+
+ code = (sljit_u16 *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
+ code_ptr = (sljit_u16 *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+
SLJIT_CACHE_FLUSH(code, code_ptr);
/* Set thumb mode flag. */
return (void*)((sljit_uw)code | 0x1);
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+#else
+ /* Available by default. */
+ return 1;
+#endif
+
+ case SLJIT_HAS_PRE_UPDATE:
+ case SLJIT_HAS_CLZ:
+ case SLJIT_HAS_CMOV:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
/* --------------------------------------------------------------------- */
/* Core code generator functions. */
/* --------------------------------------------------------------------- */
@@ -500,24 +534,20 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst,
#define ARG1_IMM 0x0010000
#define ARG2_IMM 0x0020000
-#define KEEP_FLAGS 0x0040000
/* SET_FLAGS must be 0x100000 as it is also the value of S bit (can be used for optimization). */
#define SET_FLAGS 0x0100000
#define UNUSED_RETURN 0x0200000
-#define SLOW_DEST 0x0400000
-#define SLOW_SRC1 0x0800000
-#define SLOW_SRC2 0x1000000
static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 dst, sljit_uw arg1, sljit_uw arg2)
{
/* dst must be register, TMP_REG1
- arg1 must be register, TMP_REG1, imm
- arg2 must be register, TMP_REG2, imm */
+ arg1 must be register, imm
+ arg2 must be register, imm */
sljit_s32 reg;
sljit_uw imm, nimm;
if (SLJIT_UNLIKELY((flags & (ARG1_IMM | ARG2_IMM)) == (ARG1_IMM | ARG2_IMM))) {
- /* Both are immediates. */
+ /* Both are immediates, no temporaries are used. */
flags &= ~ARG1_IMM;
FAIL_IF(load_immediate(compiler, TMP_REG1, arg1));
arg1 = TMP_REG1;
@@ -533,7 +563,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
/* No form with immediate operand. */
break;
case SLJIT_MOV:
- SLJIT_ASSERT(!(flags & SET_FLAGS) && (flags & ARG2_IMM) && arg1 == TMP_REG1);
+ SLJIT_ASSERT(!(flags & SET_FLAGS) && (flags & ARG2_IMM) && arg1 == TMP_REG2);
return load_immediate(compiler, dst, imm);
case SLJIT_NOT:
if (!(flags & SET_FLAGS))
@@ -543,7 +573,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
break;
case SLJIT_ADD:
nimm = -imm;
- if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(reg, dst)) {
+ if (IS_2_LO_REGS(reg, dst)) {
if (imm <= 0x7)
return push_inst16(compiler, ADDSI3 | IMM3(imm) | RD3(dst) | RN3(reg));
if (nimm <= 0x7)
@@ -561,9 +591,12 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
if (nimm <= 0xfff)
return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(nimm));
}
- imm = get_imm(imm);
- if (imm != INVALID_IMM)
- return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm);
+ nimm = get_imm(imm);
+ if (nimm != INVALID_IMM)
+ return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm);
+ nimm = get_imm(-imm);
+ if (nimm != INVALID_IMM)
+ return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm);
break;
case SLJIT_ADDC:
imm = get_imm(imm);
@@ -571,16 +604,27 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm);
break;
case SLJIT_SUB:
+ /* SUB operation can be replaced by ADD because of the negative carry flag. */
if (flags & ARG1_IMM) {
- if (!(flags & KEEP_FLAGS) && imm == 0 && IS_2_LO_REGS(reg, dst))
+ if (imm == 0 && IS_2_LO_REGS(reg, dst))
return push_inst16(compiler, RSBSI | RD3(dst) | RN3(reg));
imm = get_imm(imm);
if (imm != INVALID_IMM)
return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm);
break;
}
+ if (flags & UNUSED_RETURN) {
+ if (imm <= 0xff && reg_map[reg] <= 7)
+ return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg));
+ nimm = get_imm(imm);
+ if (nimm != INVALID_IMM)
+ return push_inst32(compiler, CMPI_W | RN4(reg) | nimm);
+ nimm = get_imm(-imm);
+ if (nimm != INVALID_IMM)
+ return push_inst32(compiler, CMNI_W | RN4(reg) | nimm);
+ }
nimm = -imm;
- if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(reg, dst)) {
+ if (IS_2_LO_REGS(reg, dst)) {
if (imm <= 0x7)
return push_inst16(compiler, SUBSI3 | IMM3(imm) | RD3(dst) | RN3(reg));
if (nimm <= 0x7)
@@ -591,8 +635,6 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
if (nimm <= 0xff)
return push_inst16(compiler, ADDSI8 | IMM8(nimm) | RDN3(dst));
}
- if (imm <= 0xff && (flags & UNUSED_RETURN))
- return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg));
}
if (!(flags & SET_FLAGS)) {
if (imm <= 0xfff)
@@ -600,9 +642,12 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
if (nimm <= 0xfff)
return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(nimm));
}
- imm = get_imm(imm);
- if (imm != INVALID_IMM)
- return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm);
+ nimm = get_imm(imm);
+ if (nimm != INVALID_IMM)
+ return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm);
+ nimm = get_imm(-imm);
+ if (nimm != INVALID_IMM)
+ return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm);
break;
case SLJIT_SUBC:
if (flags & ARG1_IMM)
@@ -647,31 +692,35 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
}
switch (flags & 0xffff) {
case SLJIT_SHL:
- if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, reg))
+ if (IS_2_LO_REGS(dst, reg))
return push_inst16(compiler, LSLSI | RD3(dst) | RN3(reg) | (imm << 6));
return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm));
case SLJIT_LSHR:
- if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, reg))
+ if (IS_2_LO_REGS(dst, reg))
return push_inst16(compiler, LSRSI | RD3(dst) | RN3(reg) | (imm << 6));
return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm));
default: /* SLJIT_ASHR */
- if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, reg))
+ if (IS_2_LO_REGS(dst, reg))
return push_inst16(compiler, ASRSI | RD3(dst) | RN3(reg) | (imm << 6));
return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm));
}
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
if (flags & ARG2_IMM) {
- FAIL_IF(load_immediate(compiler, TMP_REG2, arg2));
- arg2 = TMP_REG2;
+ imm = arg2;
+ arg2 = (arg1 == TMP_REG1) ? TMP_REG2 : TMP_REG1;
+ FAIL_IF(load_immediate(compiler, arg2, imm));
}
else {
- FAIL_IF(load_immediate(compiler, TMP_REG1, arg1));
- arg1 = TMP_REG1;
+ imm = arg1;
+ arg1 = (arg2 == TMP_REG1) ? TMP_REG2 : TMP_REG1;
+ FAIL_IF(load_immediate(compiler, arg1, imm));
}
+
+ SLJIT_ASSERT(arg1 != arg2);
}
/* Both arguments are registers. */
@@ -684,104 +733,102 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
case SLJIT_MOVU_U32:
case SLJIT_MOVU_S32:
case SLJIT_MOVU_P:
- SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
+ SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2);
if (dst == arg2)
return SLJIT_SUCCESS;
return push_inst16(compiler, MOV | SET_REGS44(dst, arg2));
case SLJIT_MOV_U8:
case SLJIT_MOVU_U8:
- SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
+ SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2);
if (IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, UXTB | RD3(dst) | RN3(arg2));
return push_inst32(compiler, UXTB_W | RD4(dst) | RM4(arg2));
case SLJIT_MOV_S8:
case SLJIT_MOVU_S8:
- SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
+ SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2);
if (IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, SXTB | RD3(dst) | RN3(arg2));
return push_inst32(compiler, SXTB_W | RD4(dst) | RM4(arg2));
case SLJIT_MOV_U16:
case SLJIT_MOVU_U16:
- SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
+ SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2);
if (IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, UXTH | RD3(dst) | RN3(arg2));
return push_inst32(compiler, UXTH_W | RD4(dst) | RM4(arg2));
case SLJIT_MOV_S16:
case SLJIT_MOVU_S16:
- SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
+ SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2);
if (IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, SXTH | RD3(dst) | RN3(arg2));
return push_inst32(compiler, SXTH_W | RD4(dst) | RM4(arg2));
case SLJIT_NOT:
- SLJIT_ASSERT(arg1 == TMP_REG1);
- if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ SLJIT_ASSERT(arg1 == TMP_REG2);
+ if (IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, MVNS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, MVN_W | (flags & SET_FLAGS) | RD4(dst) | RM4(arg2));
case SLJIT_CLZ:
- SLJIT_ASSERT(arg1 == TMP_REG1);
+ SLJIT_ASSERT(arg1 == TMP_REG2);
FAIL_IF(push_inst32(compiler, CLZ | RN4(arg2) | RD4(dst) | RM4(arg2)));
- if (flags & SET_FLAGS) {
- if (reg_map[dst] <= 7)
- return push_inst16(compiler, CMPI | RDN3(dst));
- return push_inst32(compiler, ADD_WI | SET_FLAGS | RN4(dst) | RD4(dst));
- }
return SLJIT_SUCCESS;
case SLJIT_ADD:
- if (!(flags & KEEP_FLAGS) && IS_3_LO_REGS(dst, arg1, arg2))
+ if (IS_3_LO_REGS(dst, arg1, arg2))
return push_inst16(compiler, ADDS | RD3(dst) | RN3(arg1) | RM3(arg2));
if (dst == arg1 && !(flags & SET_FLAGS))
return push_inst16(compiler, ADD | SET_REGS44(dst, arg2));
return push_inst32(compiler, ADD_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_ADDC:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, ADCS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, ADC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_SUB:
- if (!(flags & KEEP_FLAGS) && IS_3_LO_REGS(dst, arg1, arg2))
+ if (flags & UNUSED_RETURN) {
+ if (IS_2_LO_REGS(arg1, arg2))
+ return push_inst16(compiler, CMP | RD3(arg1) | RN3(arg2));
+ return push_inst16(compiler, CMP_X | SET_REGS44(arg1, arg2));
+ }
+ if (IS_3_LO_REGS(dst, arg1, arg2))
return push_inst16(compiler, SUBS | RD3(dst) | RN3(arg1) | RM3(arg2));
return push_inst32(compiler, SUB_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_SUBC:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, SBCS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, SBC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_MUL:
if (!(flags & SET_FLAGS))
return push_inst32(compiler, MUL | RD4(dst) | RN4(arg1) | RM4(arg2));
- SLJIT_ASSERT(reg_map[TMP_REG2] <= 7 && dst != TMP_REG2);
+ SLJIT_ASSERT(dst != TMP_REG2);
FAIL_IF(push_inst32(compiler, SMULL | RT4(dst) | RD4(TMP_REG2) | RN4(arg1) | RM4(arg2)));
/* cmp TMP_REG2, dst asr #31. */
return push_inst32(compiler, CMP_W | RN4(TMP_REG2) | 0x70e0 | RM4(dst));
case SLJIT_AND:
- if (!(flags & KEEP_FLAGS)) {
- if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
- return push_inst16(compiler, ANDS | RD3(dst) | RN3(arg2));
- if ((flags & UNUSED_RETURN) && IS_2_LO_REGS(arg1, arg2))
- return push_inst16(compiler, TST | RD3(arg1) | RN3(arg2));
- }
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
+ return push_inst16(compiler, ANDS | RD3(dst) | RN3(arg2));
+ if ((flags & UNUSED_RETURN) && IS_2_LO_REGS(arg1, arg2))
+ return push_inst16(compiler, TST | RD3(arg1) | RN3(arg2));
return push_inst32(compiler, AND_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_OR:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, ORRS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, ORR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_XOR:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, EORS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, EOR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_SHL:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, LSLS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, LSL_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_LSHR:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, LSRS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, LSR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
case SLJIT_ASHR:
- if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2))
+ if (dst == arg1 && IS_2_LO_REGS(dst, arg2))
return push_inst16(compiler, ASRS | RD3(dst) | RN3(arg2));
return push_inst32(compiler, ASR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2));
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -791,9 +838,9 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
#define WORD_SIZE 0x00
#define BYTE_SIZE 0x04
#define HALF_SIZE 0x08
+#define PRELOAD 0x0c
#define UPDATE 0x10
-#define ARG_TEST 0x20
#define IS_WORD_SIZE(flags) (!(flags & (BYTE_SIZE | HALF_SIZE)))
#define OFFSET_CHECK(imm, shift) (!(argw & ~(imm << shift)))
@@ -849,7 +896,7 @@ static const sljit_ins sljit_mem16_imm5[12] = {
#define MEM_IMM8 0xc00
#define MEM_IMM12 0x800000
-static const sljit_ins sljit_mem32[12] = {
+static const sljit_ins sljit_mem32[13] = {
/* w u l */ 0xf8500000 /* ldr.w */,
/* w u s */ 0xf8400000 /* str.w */,
/* w s l */ 0xf8500000 /* ldr.w */,
@@ -864,6 +911,8 @@ static const sljit_ins sljit_mem32[12] = {
/* h u s */ 0xf8200000 /* strsh.w */,
/* h s l */ 0xf9300000 /* ldrsh.w */,
/* h s s */ 0xf8200000 /* strsh.w */,
+
+/* p u l */ 0xf8100000 /* pld */,
};
/* Helper function. Dst should be reg + value, using at most 1 instruction, flags does not set. */
@@ -887,20 +936,67 @@ static sljit_s32 emit_set_delta(struct sljit_compiler *compiler, sljit_s32 dst,
return SLJIT_ERR_UNSUPPORTED;
}
-/* Can perform an operation using at most 1 instruction. */
-static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
+static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg,
+ sljit_s32 arg, sljit_sw argw, sljit_s32 tmp_reg)
{
- sljit_s32 other_r, shift;
+ sljit_s32 other_r;
+ sljit_s32 update = flags & UPDATE;
+ sljit_uw tmp;
SLJIT_ASSERT(arg & SLJIT_MEM);
+ SLJIT_ASSERT((arg & REG_MASK) != tmp_reg);
+ flags &= ~UPDATE;
+ arg &= ~SLJIT_MEM;
+
+ if (SLJIT_UNLIKELY(!(arg & REG_MASK))) {
+ tmp = get_imm(argw & ~0xfff);
+ if (tmp != INVALID_IMM) {
+ FAIL_IF(push_inst32(compiler, MOV_WI | RD4(tmp_reg) | tmp));
+ return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg) | (argw & 0xfff));
+ }
- if (SLJIT_UNLIKELY(flags & UPDATE)) {
- if ((arg & REG_MASK) && !(arg & OFFS_REG_MASK) && argw <= 0xff && argw >= -0xff) {
- if (SLJIT_UNLIKELY(flags & ARG_TEST))
- return 1;
+ FAIL_IF(load_immediate(compiler, tmp_reg, argw));
+ if (IS_2_LO_REGS(reg, tmp_reg) && sljit_mem16_imm5[flags])
+ return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(tmp_reg));
+ return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg));
+ }
+
+ if (SLJIT_UNLIKELY(update)) {
+ SLJIT_ASSERT(reg != arg);
- flags &= ~UPDATE;
+ if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) {
+ other_r = OFFS_REG(arg);
arg &= 0xf;
+
+ if (IS_3_LO_REGS(reg, arg, other_r))
+ FAIL_IF(push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)));
+ else
+ FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r)));
+ return push_inst16(compiler, ADD | SET_REGS44(arg, other_r));
+ }
+
+ if (argw > 0xff) {
+ tmp = get_imm(argw & ~0xff);
+ if (tmp != INVALID_IMM) {
+ push_inst32(compiler, ADD_WI | RD4(arg) | RN4(arg) | tmp);
+ argw = argw & 0xff;
+ }
+ }
+ else if (argw < -0xff) {
+ tmp = get_imm(-argw & ~0xff);
+ if (tmp != INVALID_IMM) {
+ push_inst32(compiler, SUB_WI | RD4(arg) | RN4(arg) | tmp);
+ argw = -(-argw & 0xff);
+ }
+ }
+
+ if (argw == 0) {
+ if (IS_2_LO_REGS(reg, arg) && sljit_mem16_imm5[flags])
+ return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg));
+ return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg));
+ }
+
+ if (argw <= 0xff && argw >= -0xff) {
if (argw >= 0)
argw |= 0x200;
else {
@@ -908,219 +1004,83 @@ static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_s32 flag
}
SLJIT_ASSERT(argw >= 0 && (argw & 0xff) <= 0xff);
- FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | 0x100 | argw));
- return -1;
+ return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | 0x100 | argw);
}
- return 0;
+
+ FAIL_IF(load_immediate(compiler, tmp_reg, argw));
+
+ SLJIT_ASSERT(reg != tmp_reg);
+
+ if (IS_3_LO_REGS(reg, arg, tmp_reg))
+ FAIL_IF(push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(tmp_reg)));
+ else
+ FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(tmp_reg)));
+ return push_inst16(compiler, ADD | SET_REGS44(arg, tmp_reg));
}
if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) {
- if (SLJIT_UNLIKELY(flags & ARG_TEST))
- return 1;
-
argw &= 0x3;
other_r = OFFS_REG(arg);
arg &= 0xf;
if (!argw && IS_3_LO_REGS(reg, arg, other_r))
- FAIL_IF(push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)));
- else
- FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4)));
- return -1;
+ return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r));
+ return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4));
}
- if (!(arg & REG_MASK) || argw > 0xfff || argw < -0xff)
- return 0;
-
- if (SLJIT_UNLIKELY(flags & ARG_TEST))
- return 1;
+ if (argw > 0xfff) {
+ tmp = get_imm(argw & ~0xfff);
+ if (tmp != INVALID_IMM) {
+ push_inst32(compiler, ADD_WI | RD4(tmp_reg) | RN4(arg) | tmp);
+ arg = tmp_reg;
+ argw = argw & 0xfff;
+ }
+ }
+ else if (argw < -0xff) {
+ tmp = get_imm(-argw & ~0xff);
+ if (tmp != INVALID_IMM) {
+ push_inst32(compiler, SUB_WI | RD4(tmp_reg) | RN4(arg) | tmp);
+ arg = tmp_reg;
+ argw = -(-argw & 0xff);
+ }
+ }
- arg &= 0xf;
if (IS_2_LO_REGS(reg, arg) && sljit_mem16_imm5[flags]) {
- shift = 3;
+ tmp = 3;
if (IS_WORD_SIZE(flags)) {
if (OFFSET_CHECK(0x1f, 2))
- shift = 2;
+ tmp = 2;
}
else if (flags & BYTE_SIZE)
{
if (OFFSET_CHECK(0x1f, 0))
- shift = 0;
+ tmp = 0;
}
else {
SLJIT_ASSERT(flags & HALF_SIZE);
if (OFFSET_CHECK(0x1f, 1))
- shift = 1;
+ tmp = 1;
}
- if (shift != 3) {
- FAIL_IF(push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | (argw << (6 - shift))));
- return -1;
- }
- }
-
- /* SP based immediate. */
- if (SLJIT_UNLIKELY(arg == SLJIT_SP) && OFFSET_CHECK(0xff, 2) && IS_WORD_SIZE(flags) && reg_map[reg] <= 7) {
- FAIL_IF(push_inst16(compiler, STR_SP | ((flags & STORE) ? 0 : 0x800) | RDN3(reg) | (argw >> 2)));
- return -1;
+ if (tmp < 3)
+ return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | (argw << (6 - tmp)));
}
-
- if (argw >= 0)
- FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw));
- else
- FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | -argw));
- return -1;
-}
-
-/* see getput_arg below.
- Note: can_cache is called only for binary operators. Those
- operators always uses word arguments without write back. */
-static sljit_s32 can_cache(sljit_s32 arg, sljit_sw argw, sljit_s32 next_arg, sljit_sw next_argw)
-{
- sljit_sw diff;
- if ((arg & OFFS_REG_MASK) || !(next_arg & SLJIT_MEM))
- return 0;
-
- if (!(arg & REG_MASK)) {
- diff = argw - next_argw;
- if (diff <= 0xfff && diff >= -0xfff)
- return 1;
- return 0;
+ else if (SLJIT_UNLIKELY(arg == SLJIT_SP) && IS_WORD_SIZE(flags) && OFFSET_CHECK(0xff, 2) && reg_map[reg] <= 7) {
+ /* SP based immediate. */
+ return push_inst16(compiler, STR_SP | ((flags & STORE) ? 0 : 0x800) | RDN3(reg) | (argw >> 2));
}
- if (argw == next_argw)
- return 1;
+ if (argw >= 0 && argw <= 0xfff)
+ return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw);
+ else if (argw < 0 && argw >= -0xff)
+ return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | -argw);
- diff = argw - next_argw;
- if (arg == next_arg && diff <= 0xfff && diff >= -0xfff)
- return 1;
+ SLJIT_ASSERT(arg != tmp_reg);
- return 0;
-}
-
-/* Emit the necessary instructions. See can_cache above. */
-static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg,
- sljit_s32 arg, sljit_sw argw, sljit_s32 next_arg, sljit_sw next_argw)
-{
- sljit_s32 tmp_r, other_r;
- sljit_sw diff;
-
- SLJIT_ASSERT(arg & SLJIT_MEM);
- if (!(next_arg & SLJIT_MEM)) {
- next_arg = 0;
- next_argw = 0;
- }
-
- tmp_r = (flags & STORE) ? TMP_REG3 : reg;
-
- if (SLJIT_UNLIKELY((flags & UPDATE) && (arg & REG_MASK))) {
- /* Update only applies if a base register exists. */
- /* There is no caching here. */
- other_r = OFFS_REG(arg);
- arg &= 0xf;
- flags &= ~UPDATE;
-
- if (!other_r) {
- if (!(argw & ~0xfff)) {
- FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw));
- return push_inst32(compiler, ADDWI | RD4(arg) | RN4(arg) | IMM12(argw));
- }
-
- if (compiler->cache_arg == SLJIT_MEM) {
- if (argw == compiler->cache_argw) {
- other_r = TMP_REG3;
- argw = 0;
- }
- else if (emit_set_delta(compiler, TMP_REG3, TMP_REG3, argw - compiler->cache_argw) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- compiler->cache_argw = argw;
- other_r = TMP_REG3;
- argw = 0;
- }
- }
-
- if (argw) {
- FAIL_IF(load_immediate(compiler, TMP_REG3, argw));
- compiler->cache_arg = SLJIT_MEM;
- compiler->cache_argw = argw;
- other_r = TMP_REG3;
- argw = 0;
- }
- }
-
- argw &= 0x3;
- if (!argw && IS_3_LO_REGS(reg, arg, other_r)) {
- FAIL_IF(push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)));
- return push_inst16(compiler, ADD | SET_REGS44(arg, other_r));
- }
- FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4)));
- return push_inst32(compiler, ADD_W | RD4(arg) | RN4(arg) | RM4(other_r) | (argw << 6));
- }
- flags &= ~UPDATE;
-
- SLJIT_ASSERT(!(arg & OFFS_REG_MASK));
-
- if (compiler->cache_arg == arg) {
- diff = argw - compiler->cache_argw;
- if (!(diff & ~0xfff))
- return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(TMP_REG3) | diff);
- if (!((compiler->cache_argw - argw) & ~0xff))
- return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(TMP_REG3) | (compiler->cache_argw - argw));
- if (emit_set_delta(compiler, TMP_REG3, TMP_REG3, diff) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(TMP_REG3) | 0);
- }
- }
-
- next_arg = (arg & REG_MASK) && (arg == next_arg) && (argw != next_argw);
- arg &= 0xf;
- if (arg && compiler->cache_arg == SLJIT_MEM) {
- if (compiler->cache_argw == argw)
- return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(TMP_REG3));
- if (emit_set_delta(compiler, TMP_REG3, TMP_REG3, argw - compiler->cache_argw) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- compiler->cache_argw = argw;
- return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(TMP_REG3));
- }
- }
-
- compiler->cache_argw = argw;
- if (next_arg && emit_set_delta(compiler, TMP_REG3, arg, argw) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- compiler->cache_arg = SLJIT_MEM | arg;
- arg = 0;
- }
- else {
- FAIL_IF(load_immediate(compiler, TMP_REG3, argw));
- compiler->cache_arg = SLJIT_MEM;
-
- diff = argw - next_argw;
- if (next_arg && diff <= 0xfff && diff >= -0xfff) {
- FAIL_IF(push_inst16(compiler, ADD | SET_REGS44(TMP_REG3, arg)));
- compiler->cache_arg = SLJIT_MEM | arg;
- arg = 0;
- }
- }
-
- if (arg)
- return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(TMP_REG3));
- return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(TMP_REG3) | 0);
-}
-
-static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
-{
- if (getput_arg_fast(compiler, flags, reg, arg, argw))
- return compiler->error;
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- return getput_arg(compiler, flags, reg, arg, argw, 0, 0);
-}
-
-static SLJIT_INLINE sljit_s32 emit_op_mem2(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg1, sljit_sw arg1w, sljit_s32 arg2, sljit_sw arg2w)
-{
- if (getput_arg_fast(compiler, flags, reg, arg1, arg1w))
- return compiler->error;
- return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w);
+ FAIL_IF(load_immediate(compiler, tmp_reg, argw));
+ if (IS_3_LO_REGS(reg, arg, tmp_reg))
+ return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(tmp_reg));
+ return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(tmp_reg));
}
/* --------------------------------------------------------------------- */
@@ -1132,14 +1092,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size)
{
sljit_s32 size, i, tmp;
- sljit_ins push;
+ sljit_ins push = 0;
CHECK_ERROR();
CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
- push = (1 << 4);
-
tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG;
for (i = SLJIT_S0; i >= tmp; i--)
push |= 1 << reg_map[i];
@@ -1152,7 +1110,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
: push_inst16(compiler, PUSH | (1 << 8) | push));
/* Stack must be aligned to 8 bytes: (LR, R4) */
- size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 2);
+ size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
local_size = ((size + local_size + 7) & ~7) - size;
compiler->local_size = local_size;
if (local_size > 0) {
@@ -1182,7 +1140,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
- size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 2);
+ size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
compiler->local_size = ((size + local_size + 7) & ~7) - size;
return SLJIT_SUCCESS;
}
@@ -1190,7 +1148,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 src, sljit_sw srcw)
{
sljit_s32 i, tmp;
- sljit_ins pop;
+ sljit_ins pop = 0;
CHECK_ERROR();
CHECK(check_sljit_emit_return(compiler, op, src, srcw));
@@ -1204,8 +1162,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
FAIL_IF(emit_op_imm(compiler, SLJIT_ADD | ARG2_IMM, SLJIT_SP, SLJIT_SP, compiler->local_size));
}
- pop = (1 << 4);
-
tmp = compiler->saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - compiler->saveds) : SLJIT_FIRST_SAVED_REG;
for (i = SLJIT_S0; i >= tmp; i--)
pop |= 1 << reg_map[i];
@@ -1263,7 +1219,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
case SLJIT_DIV_UW:
case SLJIT_DIV_SW:
SLJIT_COMPILE_ASSERT((SLJIT_DIVMOD_UW & 0x2) == 0 && SLJIT_DIV_UW - 0x2 == SLJIT_DIVMOD_UW, bad_div_opcode_assignments);
- SLJIT_COMPILE_ASSERT(reg_map[2] == 1 && reg_map[3] == 2 && reg_map[4] == 12, bad_register_mapping);
+ SLJIT_ASSERT(reg_map[2] == 1 && reg_map[3] == 2 && reg_map[4] == 12);
saved_reg_count = 0;
if (compiler->scratches >= 4)
@@ -1323,8 +1279,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(dst, dstw);
ADJUST_LOCAL_OFFSET(src, srcw);
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op)) {
+ /* Since TMP_PC has index 15, IS_2_LO_REGS and IS_3_LO_REGS checks always fail. */
+ if (op <= SLJIT_MOV_P && (src & SLJIT_MEM))
+ return emit_op_mem(compiler, PRELOAD, TMP_PC, src, srcw, TMP_REG1);
+ return SLJIT_SUCCESS;
+ }
dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
@@ -1384,31 +1344,25 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
srcw = (sljit_s16)srcw;
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
flags = 0;
break;
}
if (src & SLJIT_IMM)
- FAIL_IF(emit_op_imm(compiler, SLJIT_MOV | ARG2_IMM, dst_r, TMP_REG1, srcw));
+ FAIL_IF(emit_op_imm(compiler, SLJIT_MOV | ARG2_IMM, dst_r, TMP_REG2, srcw));
else if (src & SLJIT_MEM) {
- if (getput_arg_fast(compiler, flags, dst_r, src, srcw))
- FAIL_IF(compiler->error);
- else
- FAIL_IF(getput_arg(compiler, flags, dst_r, src, srcw, dst, dstw));
+ FAIL_IF(emit_op_mem(compiler, flags, dst_r, src, srcw, ((flags & UPDATE) && dst_r == TMP_REG1) ? TMP_REG2 : TMP_REG1));
} else {
if (dst_r != TMP_REG1)
- return emit_op_imm(compiler, op, dst_r, TMP_REG1, src);
+ return emit_op_imm(compiler, op, dst_r, TMP_REG2, src);
dst_r = src;
}
- if (dst & SLJIT_MEM) {
- if (getput_arg_fast(compiler, flags | STORE, dst_r, dst, dstw))
- return compiler->error;
- else
- return getput_arg(compiler, flags | STORE, dst_r, dst, dstw, 0, 0);
- }
- return SLJIT_SUCCESS;
+ if (!(dst & SLJIT_MEM))
+ return SLJIT_SUCCESS;
+
+ return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, (dst_r == TMP_REG1) ? TMP_REG2 : TMP_REG1);
}
if (op == SLJIT_NEG) {
@@ -1419,29 +1373,22 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
return sljit_emit_op2(compiler, SLJIT_SUB | op_flags, dst, dstw, SLJIT_IMM, 0, src, srcw);
}
- flags = (GET_FLAGS(op_flags) ? SET_FLAGS : 0) | ((op_flags & SLJIT_KEEP_FLAGS) ? KEEP_FLAGS : 0);
- if (src & SLJIT_MEM) {
- if (getput_arg_fast(compiler, WORD_SIZE, TMP_REG2, src, srcw))
- FAIL_IF(compiler->error);
- else
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG2, src, srcw, dst, dstw));
- src = TMP_REG2;
- }
+ flags = HAS_FLAGS(op_flags) ? SET_FLAGS : 0;
if (src & SLJIT_IMM)
flags |= ARG2_IMM;
+ else if (src & SLJIT_MEM) {
+ FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1));
+ srcw = TMP_REG1;
+ }
else
srcw = src;
- emit_op_imm(compiler, flags | op, dst_r, TMP_REG1, srcw);
+ emit_op_imm(compiler, flags | op, dst_r, TMP_REG2, srcw);
- if (dst & SLJIT_MEM) {
- if (getput_arg_fast(compiler, flags | STORE, dst_r, dst, dstw))
- return compiler->error;
- else
- return getput_arg(compiler, flags | STORE, dst_r, dst, dstw, 0, 0);
- }
- return SLJIT_SUCCESS;
+ if (!(dst & SLJIT_MEM))
+ return SLJIT_SUCCESS;
+ return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2);
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op,
@@ -1449,7 +1396,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
- sljit_s32 dst_r, flags;
+ sljit_s32 dst_reg, flags, src2_reg;
CHECK_ERROR();
CHECK(check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w));
@@ -1457,70 +1404,39 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
-
- dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
- flags = (GET_FLAGS(op) ? SET_FLAGS : 0) | ((op & SLJIT_KEEP_FLAGS) ? KEEP_FLAGS : 0);
-
- if ((dst & SLJIT_MEM) && !getput_arg_fast(compiler, WORD_SIZE | STORE | ARG_TEST, TMP_REG1, dst, dstw))
- flags |= SLOW_DEST;
-
- if (src1 & SLJIT_MEM) {
- if (getput_arg_fast(compiler, WORD_SIZE, TMP_REG1, src1, src1w))
- FAIL_IF(compiler->error);
- else
- flags |= SLOW_SRC1;
- }
- if (src2 & SLJIT_MEM) {
- if (getput_arg_fast(compiler, WORD_SIZE, TMP_REG2, src2, src2w))
- FAIL_IF(compiler->error);
- else
- flags |= SLOW_SRC2;
- }
-
- if ((flags & (SLOW_SRC1 | SLOW_SRC2)) == (SLOW_SRC1 | SLOW_SRC2)) {
- if (!can_cache(src1, src1w, src2, src2w) && can_cache(src1, src1w, dst, dstw)) {
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG2, src2, src2w, src1, src1w));
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG1, src1, src1w, dst, dstw));
- }
- else {
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG1, src1, src1w, src2, src2w));
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG2, src2, src2w, dst, dstw));
- }
- }
- else if (flags & SLOW_SRC1)
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG1, src1, src1w, dst, dstw));
- else if (flags & SLOW_SRC2)
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG2, src2, src2w, dst, dstw));
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
- if (src1 & SLJIT_MEM)
- src1 = TMP_REG1;
- if (src2 & SLJIT_MEM)
- src2 = TMP_REG2;
+ dst_reg = SLOW_IS_REG(dst) ? dst : TMP_REG1;
+ flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
if (src1 & SLJIT_IMM)
flags |= ARG1_IMM;
+ else if (src1 & SLJIT_MEM) {
+ emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src1, src1w, TMP_REG1);
+ src1w = TMP_REG1;
+ }
else
src1w = src1;
+
if (src2 & SLJIT_IMM)
flags |= ARG2_IMM;
+ else if (src2 & SLJIT_MEM) {
+ src2_reg = (!(flags & ARG1_IMM) && (src1w == TMP_REG1)) ? TMP_REG2 : TMP_REG1;
+ emit_op_mem(compiler, WORD_SIZE, src2_reg, src2, src2w, src2_reg);
+ src2w = src2_reg;
+ }
else
src2w = src2;
if (dst == SLJIT_UNUSED)
flags |= UNUSED_RETURN;
- emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src1w, src2w);
+ emit_op_imm(compiler, flags | GET_OPCODE(op), dst_reg, src1w, src2w);
- if (dst & SLJIT_MEM) {
- if (!(flags & SLOW_DEST)) {
- getput_arg_fast(compiler, WORD_SIZE | STORE, dst_r, dst, dstw);
- return compiler->error;
- }
- return getput_arg(compiler, WORD_SIZE | STORE, TMP_REG1, dst, dstw, 0, 0);
- }
- return SLJIT_SUCCESS;
+ if (!(dst & SLJIT_MEM))
+ return SLJIT_SUCCESS;
+ return emit_op_mem(compiler, WORD_SIZE | STORE, dst_reg, dst, dstw, TMP_REG2);
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_register_index(sljit_s32 reg)
@@ -1550,21 +1466,10 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#else
- /* Available by default. */
- return 1;
-#endif
-}
-
#define FPU_LOAD (1 << 20)
static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg, sljit_sw argw)
{
- sljit_sw tmp;
sljit_uw imm;
sljit_sw inst = VSTR_F32 | (flags & (SLJIT_F32_OP | FPU_LOAD));
@@ -1572,8 +1477,8 @@ static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags,
/* Fast loads and stores. */
if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) {
- FAIL_IF(push_inst32(compiler, ADD_W | RD4(TMP_REG2) | RN4(arg & REG_MASK) | RM4(OFFS_REG(arg)) | ((argw & 0x3) << 6)));
- arg = SLJIT_MEM | TMP_REG2;
+ FAIL_IF(push_inst32(compiler, ADD_W | RD4(TMP_REG1) | RN4(arg & REG_MASK) | RM4(OFFS_REG(arg)) | ((argw & 0x3) << 6)));
+ arg = SLJIT_MEM | TMP_REG1;
argw = 0;
}
@@ -1584,21 +1489,6 @@ static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags,
return push_inst32(compiler, inst | RN4(arg & REG_MASK) | DD4(reg) | (-argw >> 2));
}
- /* Slow cases */
- SLJIT_ASSERT(!(arg & OFFS_REG_MASK));
- if (compiler->cache_arg == arg) {
- tmp = argw - compiler->cache_argw;
- if (!(tmp & ~0x3fc))
- return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG3) | DD4(reg) | (tmp >> 2));
- if (!(-tmp & ~0x3fc))
- return push_inst32(compiler, inst | RN4(TMP_REG3) | DD4(reg) | (-tmp >> 2));
- if (emit_set_delta(compiler, TMP_REG3, TMP_REG3, tmp) != SLJIT_ERR_UNSUPPORTED) {
- FAIL_IF(compiler->error);
- compiler->cache_argw = argw;
- return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG3) | DD4(reg));
- }
- }
-
if (arg & REG_MASK) {
if (emit_set_delta(compiler, TMP_REG1, arg & REG_MASK, argw) != SLJIT_ERR_UNSUPPORTED) {
FAIL_IF(compiler->error);
@@ -1617,19 +1507,18 @@ static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags,
}
}
- compiler->cache_arg = arg;
- compiler->cache_argw = argw;
-
- FAIL_IF(load_immediate(compiler, TMP_REG3, argw));
+ FAIL_IF(load_immediate(compiler, TMP_REG1, argw));
if (arg & REG_MASK)
- FAIL_IF(push_inst16(compiler, ADD | SET_REGS44(TMP_REG3, (arg & REG_MASK))));
- return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG3) | DD4(reg));
+ FAIL_IF(push_inst16(compiler, ADD | SET_REGS44(TMP_REG1, (arg & REG_MASK))));
+ return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | DD4(reg));
}
static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
+ op ^= SLJIT_F32_OP;
+
if (src & SLJIT_MEM) {
FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_F32_OP) | FPU_LOAD, TMP_FREG1, src, srcw));
src = TMP_FREG1;
@@ -1637,9 +1526,6 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
FAIL_IF(push_inst32(compiler, VCVT_S32_F32 | (op & SLJIT_F32_OP) | DD4(TMP_FREG1) | DM4(src)));
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst32(compiler, VMOV | (1 << 20) | RT4(dst) | DN4(TMP_FREG1));
@@ -1653,6 +1539,8 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_comp
{
sljit_s32 dst_r = FAST_IS_REG(dst) ? dst : TMP_FREG1;
+ op ^= SLJIT_F32_OP;
+
if (FAST_IS_REG(src))
FAIL_IF(push_inst32(compiler, VMOV | RT4(src) | DN4(TMP_FREG1)));
else if (src & SLJIT_MEM) {
@@ -1675,6 +1563,8 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
+ op ^= SLJIT_F32_OP;
+
if (src1 & SLJIT_MEM) {
emit_fop_mem(compiler, (op & SLJIT_F32_OP) | FPU_LOAD, TMP_FREG1, src1, src1w);
src1 = TMP_FREG1;
@@ -1696,16 +1586,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compil
sljit_s32 dst_r;
CHECK_ERROR();
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- if (GET_OPCODE(op) != SLJIT_CONV_F64_FROM_F32)
- op ^= SLJIT_F32_OP;
SLJIT_COMPILE_ASSERT((SLJIT_F32_OP == 0x100), float_transfer_bit_error);
SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw);
dst_r = FAST_IS_REG(dst) ? dst : TMP_FREG1;
+ if (GET_OPCODE(op) != SLJIT_CONV_F64_FROM_F32)
+ op ^= SLJIT_F32_OP;
+
if (src & SLJIT_MEM) {
emit_fop_mem(compiler, (op & SLJIT_F32_OP) | FPU_LOAD, dst_r, src, srcw);
src = dst_r;
@@ -1750,8 +1639,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compil
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
op ^= SLJIT_F32_OP;
dst_r = FAST_IS_REG(dst) ? dst : TMP_FREG1;
@@ -1796,21 +1683,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
- /* For UNUSED dst. Uncommon, but possible. */
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
+ SLJIT_ASSERT(reg_map[TMP_REG2] == 14);
if (FAST_IS_REG(dst))
- return push_inst16(compiler, MOV | SET_REGS44(dst, TMP_REG3));
+ return push_inst16(compiler, MOV | SET_REGS44(dst, TMP_REG2));
/* Memory. */
- if (getput_arg_fast(compiler, WORD_SIZE | STORE, TMP_REG3, dst, dstw))
- return compiler->error;
- /* TMP_REG3 is used for caching. */
- FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG2, TMP_REG3)));
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- return getput_arg(compiler, WORD_SIZE | STORE, TMP_REG2, dst, dstw, 0, 0);
+ return emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG2, dst, dstw, TMP_REG1);
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_s32 src, sljit_sw srcw)
@@ -1819,21 +1698,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler
CHECK(check_sljit_emit_fast_return(compiler, src, srcw));
ADJUST_LOCAL_OFFSET(src, srcw);
+ SLJIT_ASSERT(reg_map[TMP_REG2] == 14);
+
if (FAST_IS_REG(src))
- FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG3, src)));
+ FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG2, src)));
else if (src & SLJIT_MEM) {
- if (getput_arg_fast(compiler, WORD_SIZE, TMP_REG3, src, srcw))
- FAIL_IF(compiler->error);
- else {
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- FAIL_IF(getput_arg(compiler, WORD_SIZE, TMP_REG2, src, srcw, 0, 0));
- FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG3, TMP_REG2)));
- }
+ FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, src, srcw, TMP_REG2));
}
else if (src & SLJIT_IMM)
- FAIL_IF(load_immediate(compiler, TMP_REG3, srcw));
- return push_inst16(compiler, BLX | RN3(TMP_REG3));
+ FAIL_IF(load_immediate(compiler, TMP_REG2, srcw));
+ return push_inst16(compiler, BX | RN3(TMP_REG2));
}
/* --------------------------------------------------------------------- */
@@ -1890,7 +1764,7 @@ static sljit_uw get_cc(sljit_s32 type)
return 0x7;
default: /* SLJIT_JUMP */
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return 0xe;
}
}
@@ -1957,7 +1831,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
if (FAST_IS_REG(src))
return push_inst16(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RN3(src));
- FAIL_IF(emit_op_mem(compiler, WORD_SIZE, type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, src, srcw));
+ FAIL_IF(emit_op_mem(compiler, WORD_SIZE, type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, src, srcw, TMP_REG1));
if (type >= SLJIT_FAST_CALL)
return push_inst16(compiler, BLX | RN3(TMP_REG1));
}
@@ -1974,23 +1848,18 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
sljit_s32 dst_r, flags = GET_ALL_FLAGS(op);
- sljit_ins cc, ins;
+ sljit_ins cc;
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- ADJUST_LOCAL_OFFSET(src, srcw);
-
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
op = GET_OPCODE(op);
cc = get_cc(type & 0xff);
- dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+ dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
if (op < SLJIT_ADD) {
FAIL_IF(push_inst16(compiler, IT | (cc << 4) | (((cc & 0x1) ^ 0x1) << 3) | 0x4));
@@ -1998,60 +1867,86 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
FAIL_IF(push_inst32(compiler, MOV_WI | RD4(dst_r) | 1));
FAIL_IF(push_inst32(compiler, MOV_WI | RD4(dst_r) | 0));
} else {
+ /* The movsi (immediate) instruction does not set flags in IT block. */
FAIL_IF(push_inst16(compiler, MOVSI | RDN3(dst_r) | 1));
FAIL_IF(push_inst16(compiler, MOVSI | RDN3(dst_r) | 0));
}
- if (dst_r != TMP_REG2)
+ if (!(dst & SLJIT_MEM))
return SLJIT_SUCCESS;
- return emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG2, dst, dstw);
+ return emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG1, dst, dstw, TMP_REG2);
}
- ins = (op == SLJIT_AND ? ANDI : (op == SLJIT_OR ? ORRI : EORI));
- if ((op == SLJIT_OR || op == SLJIT_XOR) && FAST_IS_REG(dst) && dst == src) {
- /* Does not change the other bits. */
+ if (dst & SLJIT_MEM)
+ FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, dst, dstw, TMP_REG2));
+
+ if (op == SLJIT_AND) {
+ FAIL_IF(push_inst16(compiler, IT | (cc << 4) | (((cc & 0x1) ^ 0x1) << 3) | 0x4));
+ FAIL_IF(push_inst32(compiler, ANDI | RN4(dst_r) | RD4(dst_r) | 1));
+ FAIL_IF(push_inst32(compiler, ANDI | RN4(dst_r) | RD4(dst_r) | 0));
+ }
+ else {
FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8));
- FAIL_IF(push_inst32(compiler, ins | RN4(src) | RD4(dst) | 1));
- if (flags & SLJIT_SET_E) {
- /* The condition must always be set, even if the ORRI/EORI is not executed above. */
- if (reg_map[dst] <= 7)
- return push_inst16(compiler, MOVS | RD3(TMP_REG1) | RN3(dst));
- return push_inst32(compiler, MOV_W | SET_FLAGS | RD4(TMP_REG1) | RM4(dst));
- }
+ FAIL_IF(push_inst32(compiler, ((op == SLJIT_OR) ? ORRI : EORI) | RN4(dst_r) | RD4(dst_r) | 1));
+ }
+
+ if (dst & SLJIT_MEM)
+ FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG1, dst, dstw, TMP_REG2));
+
+ if (!(flags & SLJIT_SET_Z))
return SLJIT_SUCCESS;
+
+ /* The condition must always be set, even if the ORR/EORI is not executed above. */
+ if (reg_map[dst_r] <= 7)
+ return push_inst16(compiler, MOVS | RD3(TMP_REG1) | RN3(dst_r));
+ return push_inst32(compiler, MOV_W | SET_FLAGS | RD4(TMP_REG1) | RM4(dst_r));
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ sljit_uw cc, tmp;
+
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
+
+ dst_reg &= ~SLJIT_I32_OP;
+
+ cc = get_cc(type & 0xff);
+
+ if (!(src & SLJIT_IMM)) {
+ FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8));
+ return push_inst16(compiler, MOV | SET_REGS44(dst_reg, src));
}
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
- if (src & SLJIT_MEM) {
- FAIL_IF(emit_op_mem2(compiler, WORD_SIZE, TMP_REG2, src, srcw, dst, dstw));
- src = TMP_REG2;
- srcw = 0;
- } else if (src & SLJIT_IMM) {
- FAIL_IF(load_immediate(compiler, TMP_REG2, srcw));
- src = TMP_REG2;
- srcw = 0;
+ tmp = (sljit_uw) srcw;
+
+ if (tmp < 0x10000) {
+ /* set low 16 bits, set hi 16 bits to 0. */
+ FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8));
+ return push_inst32(compiler, MOVW | RD4(dst_reg) |
+ COPY_BITS(tmp, 12, 16, 4) | COPY_BITS(tmp, 11, 26, 1) | COPY_BITS(tmp, 8, 12, 3) | (tmp & 0xff));
}
- if (op == SLJIT_AND || src != dst_r) {
- FAIL_IF(push_inst16(compiler, IT | (cc << 4) | (((cc & 0x1) ^ 0x1) << 3) | 0x4));
- FAIL_IF(push_inst32(compiler, ins | RN4(src) | RD4(dst_r) | 1));
- FAIL_IF(push_inst32(compiler, ins | RN4(src) | RD4(dst_r) | 0));
+ tmp = get_imm(srcw);
+ if (tmp != INVALID_IMM) {
+ FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8));
+ return push_inst32(compiler, MOV_WI | RD4(dst_reg) | tmp);
}
- else {
+
+ tmp = get_imm(~srcw);
+ if (tmp != INVALID_IMM) {
FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8));
- FAIL_IF(push_inst32(compiler, ins | RN4(src) | RD4(dst_r) | 1));
+ return push_inst32(compiler, MVN_WI | RD4(dst_reg) | tmp);
}
- if (dst_r == TMP_REG2)
- FAIL_IF(emit_op_mem2(compiler, WORD_SIZE | STORE, TMP_REG2, dst, dstw, 0, 0));
+ FAIL_IF(push_inst16(compiler, IT | (cc << 4) | ((cc & 0x1) << 3) | 0x4));
- if (flags & SLJIT_SET_E) {
- /* The condition must always be set, even if the ORR/EORI is not executed above. */
- if (reg_map[dst_r] <= 7)
- return push_inst16(compiler, MOVS | RD3(TMP_REG1) | RN3(dst_r));
- return push_inst32(compiler, MOV_W | SET_FLAGS | RD4(TMP_REG1) | RM4(dst_r));
- }
- return SLJIT_SUCCESS;
+ tmp = (sljit_uw) srcw;
+ FAIL_IF(push_inst32(compiler, MOVW | RD4(dst_reg) |
+ COPY_BITS(tmp, 12, 16, 4) | COPY_BITS(tmp, 11, 26, 1) | COPY_BITS(tmp, 8, 12, 3) | (tmp & 0xff)));
+ return push_inst32(compiler, MOVT | RD4(dst_reg) |
+ COPY_BITS(tmp, 12 + 16, 16, 4) | COPY_BITS(tmp, 11 + 16, 26, 1) | COPY_BITS(tmp, 8 + 16, 12, 3) | ((tmp & 0xff0000) >> 16));
}
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
@@ -2067,24 +1962,26 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
PTR_FAIL_IF(!const_);
set_const(const_, compiler);
- dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
+ dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
PTR_FAIL_IF(emit_imm32_const(compiler, dst_r, init_value));
if (dst & SLJIT_MEM)
- PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw));
+ PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2));
return const_;
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
sljit_u16 *inst = (sljit_u16*)addr;
- modify_imm32_const(inst, new_addr);
+ modify_imm32_const(inst, new_target);
+ inst = (sljit_u16 *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 4);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
sljit_u16 *inst = (sljit_u16*)addr;
modify_imm32_const(inst, new_constant);
+ inst = (sljit_u16 *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 4);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_32.c b/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_32.c
index 5096e4f55e..62e16106b1 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_32.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_32.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -40,35 +40,37 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst_a
#define EMIT_LOGICAL(op_imm, op_norm) \
if (flags & SRC2_IMM) { \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, op_imm | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, op_imm | S(src1) | T(dst) | IMM(src2), DR(dst))); \
} \
else { \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, op_norm | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, op_norm | S(src1) | T(src2) | D(dst), DR(dst))); \
}
#define EMIT_SHIFT(op_imm, op_v) \
if (flags & SRC2_IMM) { \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, op_imm | T(src1) | DA(EQUAL_FLAG) | SH_IMM(src2), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, op_imm | T(src1) | D(dst) | SH_IMM(src2), DR(dst))); \
} \
else { \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, op_v | S(src2) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, op_v | S(src2) | T(src1) | D(dst), DR(dst))); \
}
static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 flags,
sljit_s32 dst, sljit_s32 src1, sljit_sw src2)
{
+ sljit_s32 is_overflow, is_carry, is_handled;
+
switch (GET_OPCODE(op)) {
case SLJIT_MOV:
case SLJIT_MOV_U32:
@@ -93,8 +95,9 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
}
return push_inst(compiler, ANDI | S(src2) | T(dst) | IMM(0xff), DR(dst));
}
- else if (dst != src2)
- SLJIT_ASSERT_STOP();
+ else {
+ SLJIT_ASSERT(dst == src2);
+ }
return SLJIT_SUCCESS;
case SLJIT_MOV_U16:
@@ -111,24 +114,25 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
}
return push_inst(compiler, ANDI | S(src2) | T(dst) | IMM(0xffff), DR(dst));
}
- else if (dst != src2)
- SLJIT_ASSERT_STOP();
+ else {
+ SLJIT_ASSERT(dst == src2);
+ }
return SLJIT_SUCCESS;
case SLJIT_NOT:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & SRC2_IMM));
- if (op & SLJIT_SET_E)
+ if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, NOR | S(src2) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST))
FAIL_IF(push_inst(compiler, NOR | S(src2) | T(src2) | D(dst), DR(dst)));
return SLJIT_SUCCESS;
case SLJIT_CLZ:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & SRC2_IMM));
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
- if (op & SLJIT_SET_E)
+ if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, CLZ | S(src2) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST))
FAIL_IF(push_inst(compiler, CLZ | S(src2) | T(dst) | D(dst), DR(dst)));
#else
if (SLJIT_UNLIKELY(flags & UNUSED_DEST)) {
@@ -145,130 +149,192 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
FAIL_IF(push_inst(compiler, ADDIU | S(dst) | T(dst) | IMM(1), DR(dst)));
FAIL_IF(push_inst(compiler, BGEZ | S(TMP_REG1) | IMM(-2), UNMOVABLE_INS));
FAIL_IF(push_inst(compiler, SLL | T(TMP_REG1) | D(TMP_REG1) | SH_IMM(1), UNMOVABLE_INS));
- if (op & SLJIT_SET_E)
- return push_inst(compiler, ADDU | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG);
#endif
return SLJIT_SUCCESS;
case SLJIT_ADD:
+ is_overflow = GET_FLAG_TYPE(op) == SLJIT_OVERFLOW;
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_O) {
+ if (is_overflow) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
else
- FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
}
- if (op & SLJIT_SET_E)
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, ADDIU | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
- if (op & (SLJIT_SET_C | SLJIT_SET_O)) {
+
+ if (is_overflow || is_carry) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(ULESS_FLAG) | IMM(src2), ULESS_FLAG));
+ FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
else {
- FAIL_IF(push_inst(compiler, ADDIU | SA(0) | TA(ULESS_FLAG) | IMM(src2), ULESS_FLAG));
- FAIL_IF(push_inst(compiler, OR | S(src1) | TA(ULESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG));
+ FAIL_IF(push_inst(compiler, ADDIU | SA(0) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
}
}
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, ADDIU | S(src1) | T(dst) | IMM(src2), DR(dst)));
}
else {
- if (op & SLJIT_SET_O)
- FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- if (op & SLJIT_SET_E)
+ if (is_overflow)
+ FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, ADDU | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (op & (SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(ULESS_FLAG), ULESS_FLAG));
+
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, ADDU | S(src1) | T(src2) | D(dst), DR(dst)));
}
/* a + b >= a | b (otherwise, the carry should be set to 1). */
- if (op & (SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(ULESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG));
- if (!(op & SLJIT_SET_O))
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
+ if (!is_overflow)
return SLJIT_SUCCESS;
- FAIL_IF(push_inst(compiler, SLL | TA(ULESS_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
- FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- return push_inst(compiler, SLL | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG) | SH_IMM(31), OVERFLOW_FLAG);
+ FAIL_IF(push_inst(compiler, SLL | TA(OTHER_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
+ FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, ADDU | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ return push_inst(compiler, SRL | TA(OTHER_FLAG) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG);
case SLJIT_ADDC:
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_C) {
+ if (is_carry) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(OVERFLOW_FLAG) | IMM(src2), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
else {
- FAIL_IF(push_inst(compiler, ADDIU | SA(0) | TA(OVERFLOW_FLAG) | IMM(src2), OVERFLOW_FLAG));
- FAIL_IF(push_inst(compiler, OR | S(src1) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, ADDIU | SA(0) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
}
}
FAIL_IF(push_inst(compiler, ADDIU | S(src1) | T(dst) | IMM(src2), DR(dst)));
} else {
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
/* dst may be the same as src1 or src2. */
FAIL_IF(push_inst(compiler, ADDU | S(src1) | T(src2) | D(dst), DR(dst)));
}
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
- FAIL_IF(push_inst(compiler, ADDU | S(dst) | TA(ULESS_FLAG) | D(dst), DR(dst)));
- if (!(op & SLJIT_SET_C))
+ FAIL_IF(push_inst(compiler, ADDU | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)));
+ if (!is_carry)
return SLJIT_SUCCESS;
- /* Set ULESS_FLAG (dst == 0) && (ULESS_FLAG == 1). */
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(ULESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG));
+ /* Set ULESS_FLAG (dst == 0) && (OTHER_FLAG == 1). */
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
/* Set carry flag. */
- return push_inst(compiler, OR | SA(ULESS_FLAG) | TA(OVERFLOW_FLAG) | DA(ULESS_FLAG), ULESS_FLAG);
+ return push_inst(compiler, OR | SA(OTHER_FLAG) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
case SLJIT_SUB:
- if ((flags & SRC2_IMM) && ((op & (SLJIT_SET_U | SLJIT_SET_S)) || src2 == SIMM_MIN)) {
+ if ((flags & SRC2_IMM) && src2 == SIMM_MIN) {
FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2)));
src2 = TMP_REG2;
flags &= ~SRC2_IMM;
}
+ is_handled = 0;
+
+ if (flags & SRC2_IMM) {
+ if (GET_FLAG_TYPE(op) == SLJIT_LESS || GET_FLAG_TYPE(op) == SLJIT_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
+ is_handled = 1;
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_SIG_LESS || GET_FLAG_TYPE(op) == SLJIT_SIG_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLTI | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
+ is_handled = 1;
+ }
+ }
+
+ if (!is_handled && GET_FLAG_TYPE(op) >= SLJIT_LESS && GET_FLAG_TYPE(op) <= SLJIT_SIG_LESS_EQUAL) {
+ is_handled = 1;
+
+ if (flags & SRC2_IMM) {
+ FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2)));
+ src2 = TMP_REG2;
+ flags &= ~SRC2_IMM;
+ }
+
+ if (GET_FLAG_TYPE(op) == SLJIT_LESS || GET_FLAG_TYPE(op) == SLJIT_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_GREATER || GET_FLAG_TYPE(op) == SLJIT_LESS_EQUAL)
+ {
+ FAIL_IF(push_inst(compiler, SLTU | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_SIG_LESS || GET_FLAG_TYPE(op) == SLJIT_SIG_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLT | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_SIG_GREATER || GET_FLAG_TYPE(op) == SLJIT_SIG_LESS_EQUAL)
+ {
+ FAIL_IF(push_inst(compiler, SLT | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ }
+
+ if (is_handled) {
+ if (flags & SRC2_IMM) {
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, ADDIU | S(src1) | TA(EQUAL_FLAG) | IMM(-src2), EQUAL_FLAG));
+ if (!(flags & UNUSED_DEST))
+ return push_inst(compiler, ADDIU | S(src1) | T(dst) | IMM(-src2), DR(dst));
+ }
+ else {
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, SUBU | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ if (!(flags & UNUSED_DEST))
+ return push_inst(compiler, SUBU | S(src1) | T(src2) | D(dst), DR(dst));
+ }
+ return SLJIT_SUCCESS;
+ }
+
+ is_overflow = GET_FLAG_TYPE(op) == SLJIT_OVERFLOW;
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_O) {
+ if (is_overflow) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
else
- FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
}
- if (op & SLJIT_SET_E)
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, ADDIU | S(src1) | TA(EQUAL_FLAG) | IMM(-src2), EQUAL_FLAG));
- if (op & (SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(ULESS_FLAG) | IMM(src2), ULESS_FLAG));
+
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, ADDIU | S(src1) | T(dst) | IMM(-src2), DR(dst)));
}
else {
- if (op & SLJIT_SET_O)
- FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- if (op & SLJIT_SET_E)
+ if (is_overflow)
+ FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, SUBU | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (op & (SLJIT_SET_U | SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(ULESS_FLAG), ULESS_FLAG));
- if (op & SLJIT_SET_U)
- FAIL_IF(push_inst(compiler, SLTU | S(src2) | T(src1) | DA(UGREATER_FLAG), UGREATER_FLAG));
- if (op & SLJIT_SET_S) {
- FAIL_IF(push_inst(compiler, SLT | S(src1) | T(src2) | DA(LESS_FLAG), LESS_FLAG));
- FAIL_IF(push_inst(compiler, SLT | S(src2) | T(src1) | DA(GREATER_FLAG), GREATER_FLAG));
- }
+
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_C))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, SUBU | S(src1) | T(src2) | D(dst), DR(dst)));
}
- if (!(op & SLJIT_SET_O))
+ if (!is_overflow)
return SLJIT_SUCCESS;
- FAIL_IF(push_inst(compiler, SLL | TA(ULESS_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
- FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- return push_inst(compiler, SRL | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG) | SH_IMM(31), OVERFLOW_FLAG);
+ FAIL_IF(push_inst(compiler, SLL | TA(OTHER_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
+ FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, ADDU | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ return push_inst(compiler, SRL | TA(OTHER_FLAG) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG);
case SLJIT_SUBC:
if ((flags & SRC2_IMM) && src2 == SIMM_MIN) {
@@ -277,28 +343,31 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
flags &= ~SRC2_IMM;
}
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OVERFLOW_FLAG) | IMM(src2), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
/* dst may be the same as src1 or src2. */
FAIL_IF(push_inst(compiler, ADDIU | S(src1) | T(dst) | IMM(-src2), DR(dst)));
}
else {
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
/* dst may be the same as src1 or src2. */
FAIL_IF(push_inst(compiler, SUBU | S(src1) | T(src2) | D(dst), DR(dst)));
}
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(ULESS_FLAG) | DA(LESS_FLAG), LESS_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | D(TMP_REG1), DR(TMP_REG1)));
- FAIL_IF(push_inst(compiler, SUBU | S(dst) | TA(ULESS_FLAG) | D(dst), DR(dst)));
- return (op & SLJIT_SET_C) ? push_inst(compiler, OR | SA(OVERFLOW_FLAG) | TA(LESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG) : SLJIT_SUCCESS;
+ FAIL_IF(push_inst(compiler, SUBU | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)));
+ return (is_carry) ? push_inst(compiler, OR | SA(EQUAL_FLAG) | T(TMP_REG1) | DA(OTHER_FLAG), OTHER_FLAG) : SLJIT_SUCCESS;
case SLJIT_MUL:
SLJIT_ASSERT(!(flags & SRC2_IMM));
- if (!(op & SLJIT_SET_O)) {
+
+ if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) {
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst));
#else
@@ -307,10 +376,10 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
#endif
}
FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS));
- FAIL_IF(push_inst(compiler, MFHI | DA(ULESS_FLAG), ULESS_FLAG));
+ FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG));
FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst)));
- FAIL_IF(push_inst(compiler, SRA | T(dst) | DA(UGREATER_FLAG) | SH_IMM(31), UGREATER_FLAG));
- return push_inst(compiler, SUBU | SA(ULESS_FLAG) | TA(UGREATER_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG);
+ FAIL_IF(push_inst(compiler, SRA | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG));
+ return push_inst(compiler, SUBU | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
case SLJIT_AND:
EMIT_LOGICAL(ANDI, AND);
@@ -337,7 +406,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return SLJIT_SUCCESS;
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -347,20 +416,22 @@ static SLJIT_INLINE sljit_s32 emit_const(struct sljit_compiler *compiler, sljit_
return push_inst(compiler, ORI | S(dst) | T(dst) | IMM(init_value), DR(dst));
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
- inst[0] = (inst[0] & 0xffff0000) | ((new_addr >> 16) & 0xffff);
- inst[1] = (inst[1] & 0xffff0000) | (new_addr & 0xffff);
+ inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 16) & 0xffff);
+ inst[1] = (inst[1] & 0xffff0000) | (new_target & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
inst[0] = (inst[0] & 0xffff0000) | ((new_constant >> 16) & 0xffff);
inst[1] = (inst[1] & 0xffff0000) | (new_constant & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_64.c b/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_64.c
index c7ee8c9c2e..dd114bb27a 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_64.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_64.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -123,15 +123,15 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst_a
#define EMIT_LOGICAL(op_imm, op_norm) \
if (flags & SRC2_IMM) { \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, op_imm | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, op_imm | S(src1) | T(dst) | IMM(src2), DR(dst))); \
} \
else { \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, op_norm | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, op_norm | S(src1) | T(src2) | D(dst), DR(dst))); \
}
@@ -144,16 +144,16 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst_a
} \
else \
ins = (op & SLJIT_I32_OP) ? op_imm : op_dimm; \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, ins | T(src1) | DA(EQUAL_FLAG) | SH_IMM(src2), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, ins | T(src1) | D(dst) | SH_IMM(src2), DR(dst))); \
} \
else { \
ins = (op & SLJIT_I32_OP) ? op_v : op_dv; \
- if (op & SLJIT_SET_E) \
+ if (op & SLJIT_SET_Z) \
FAIL_IF(push_inst(compiler, ins | S(src2) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); \
- if (CHECK_FLAGS(SLJIT_SET_E)) \
+ if (!(flags & UNUSED_DEST)) \
FAIL_IF(push_inst(compiler, ins | S(src2) | T(src1) | D(dst), DR(dst))); \
}
@@ -161,6 +161,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
sljit_s32 dst, sljit_s32 src1, sljit_sw src2)
{
sljit_ins ins;
+ sljit_s32 is_overflow, is_carry, is_handled;
switch (GET_OPCODE(op)) {
case SLJIT_MOV:
@@ -180,8 +181,9 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
}
return push_inst(compiler, ANDI | S(src2) | T(dst) | IMM(0xff), DR(dst));
}
- else if (dst != src2)
- SLJIT_ASSERT_STOP();
+ else {
+ SLJIT_ASSERT(dst == src2);
+ }
return SLJIT_SUCCESS;
case SLJIT_MOV_U16:
@@ -194,8 +196,9 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
}
return push_inst(compiler, ANDI | S(src2) | T(dst) | IMM(0xffff), DR(dst));
}
- else if (dst != src2)
- SLJIT_ASSERT_STOP();
+ else {
+ SLJIT_ASSERT(dst == src2);
+ }
return SLJIT_SUCCESS;
case SLJIT_MOV_U32:
@@ -209,18 +212,18 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
case SLJIT_NOT:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & SRC2_IMM));
- if (op & SLJIT_SET_E)
+ if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, NOR | S(src2) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST))
FAIL_IF(push_inst(compiler, NOR | S(src2) | T(src2) | D(dst), DR(dst)));
return SLJIT_SUCCESS;
case SLJIT_CLZ:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & SRC2_IMM));
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
- if (op & SLJIT_SET_E)
+ if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, SELECT_OP(DCLZ, CLZ) | S(src2) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST))
FAIL_IF(push_inst(compiler, SELECT_OP(DCLZ, CLZ) | S(src2) | T(dst) | D(dst), DR(dst)));
#else
if (SLJIT_UNLIKELY(flags & UNUSED_DEST)) {
@@ -237,130 +240,192 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(dst) | T(dst) | IMM(1), DR(dst)));
FAIL_IF(push_inst(compiler, BGEZ | S(TMP_REG1) | IMM(-2), UNMOVABLE_INS));
FAIL_IF(push_inst(compiler, SELECT_OP(DSLL, SLL) | T(TMP_REG1) | D(TMP_REG1) | SH_IMM(1), UNMOVABLE_INS));
- if (op & SLJIT_SET_E)
- return push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG);
#endif
return SLJIT_SUCCESS;
case SLJIT_ADD:
+ is_overflow = GET_FLAG_TYPE(op) == SLJIT_OVERFLOW;
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_O) {
+ if (is_overflow) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
else
- FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
}
- if (op & SLJIT_SET_E)
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
- if (op & (SLJIT_SET_C | SLJIT_SET_O)) {
+
+ if (is_overflow || is_carry) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(ULESS_FLAG) | IMM(src2), ULESS_FLAG));
+ FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
else {
- FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | TA(ULESS_FLAG) | IMM(src2), ULESS_FLAG));
- FAIL_IF(push_inst(compiler, OR | S(src1) | TA(ULESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG));
+ FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
}
}
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(src2), DR(dst)));
}
else {
- if (op & SLJIT_SET_O)
- FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- if (op & SLJIT_SET_E)
+ if (is_overflow)
+ FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (op & (SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(ULESS_FLAG), ULESS_FLAG));
+
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | T(src2) | D(dst), DR(dst)));
}
/* a + b >= a | b (otherwise, the carry should be set to 1). */
- if (op & (SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(ULESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG));
- if (!(op & SLJIT_SET_O))
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
+ if (!is_overflow)
return SLJIT_SUCCESS;
- FAIL_IF(push_inst(compiler, SELECT_OP(DSLL32, SLL) | TA(ULESS_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
- FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- return push_inst(compiler, SELECT_OP(DSRL32, SLL) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG) | SH_IMM(31), OVERFLOW_FLAG);
+ FAIL_IF(push_inst(compiler, SELECT_OP(DSLL32, SLL) | TA(OTHER_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
+ FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ return push_inst(compiler, SELECT_OP(DSRL32, SRL) | TA(OTHER_FLAG) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG);
case SLJIT_ADDC:
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_C) {
+ if (is_carry) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(OVERFLOW_FLAG) | IMM(src2), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, ORI | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
else {
- FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | TA(OVERFLOW_FLAG) | IMM(src2), OVERFLOW_FLAG));
- FAIL_IF(push_inst(compiler, OR | S(src1) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
}
}
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(src2), DR(dst)));
} else {
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
/* dst may be the same as src1 or src2. */
FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | T(src2) | D(dst), DR(dst)));
}
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
- FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(ULESS_FLAG) | D(dst), DR(dst)));
- if (!(op & SLJIT_SET_C))
+ FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)));
+ if (!is_carry)
return SLJIT_SUCCESS;
- /* Set ULESS_FLAG (dst == 0) && (ULESS_FLAG == 1). */
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(ULESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG));
+ /* Set ULESS_FLAG (dst == 0) && (OTHER_FLAG == 1). */
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
/* Set carry flag. */
- return push_inst(compiler, OR | SA(ULESS_FLAG) | TA(OVERFLOW_FLAG) | DA(ULESS_FLAG), ULESS_FLAG);
+ return push_inst(compiler, OR | SA(OTHER_FLAG) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
case SLJIT_SUB:
- if ((flags & SRC2_IMM) && ((op & (SLJIT_SET_U | SLJIT_SET_S)) || src2 == SIMM_MIN)) {
+ if ((flags & SRC2_IMM) && src2 == SIMM_MIN) {
FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2)));
src2 = TMP_REG2;
flags &= ~SRC2_IMM;
}
+ is_handled = 0;
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_O) {
+ if (GET_FLAG_TYPE(op) == SLJIT_LESS || GET_FLAG_TYPE(op) == SLJIT_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
+ is_handled = 1;
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_SIG_LESS || GET_FLAG_TYPE(op) == SLJIT_SIG_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLTI | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
+ is_handled = 1;
+ }
+ }
+
+ if (!is_handled && GET_FLAG_TYPE(op) >= SLJIT_LESS && GET_FLAG_TYPE(op) <= SLJIT_SIG_LESS_EQUAL) {
+ is_handled = 1;
+
+ if (flags & SRC2_IMM) {
+ FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2)));
+ src2 = TMP_REG2;
+ flags &= ~SRC2_IMM;
+ }
+
+ if (GET_FLAG_TYPE(op) == SLJIT_LESS || GET_FLAG_TYPE(op) == SLJIT_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_GREATER || GET_FLAG_TYPE(op) == SLJIT_LESS_EQUAL)
+ {
+ FAIL_IF(push_inst(compiler, SLTU | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_SIG_LESS || GET_FLAG_TYPE(op) == SLJIT_SIG_GREATER_EQUAL) {
+ FAIL_IF(push_inst(compiler, SLT | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ else if (GET_FLAG_TYPE(op) == SLJIT_SIG_GREATER || GET_FLAG_TYPE(op) == SLJIT_SIG_LESS_EQUAL)
+ {
+ FAIL_IF(push_inst(compiler, SLT | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG));
+ }
+ }
+
+ if (is_handled) {
+ if (flags & SRC2_IMM) {
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | TA(EQUAL_FLAG) | IMM(-src2), EQUAL_FLAG));
+ if (!(flags & UNUSED_DEST))
+ return push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(-src2), DR(dst));
+ }
+ else {
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ if (!(flags & UNUSED_DEST))
+ return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | D(dst), DR(dst));
+ }
+ return SLJIT_SUCCESS;
+ }
+
+ is_overflow = GET_FLAG_TYPE(op) == SLJIT_OVERFLOW;
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
+ if (flags & SRC2_IMM) {
+ if (is_overflow) {
if (src2 >= 0)
- FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
else
- FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG));
}
- if (op & SLJIT_SET_E)
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | TA(EQUAL_FLAG) | IMM(-src2), EQUAL_FLAG));
- if (op & (SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(ULESS_FLAG) | IMM(src2), ULESS_FLAG));
+
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG));
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(-src2), DR(dst)));
}
else {
- if (op & SLJIT_SET_O)
- FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- if (op & SLJIT_SET_E)
+ if (is_overflow)
+ FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ else if (op & SLJIT_SET_Z)
FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
- if (op & (SLJIT_SET_U | SLJIT_SET_C | SLJIT_SET_O))
- FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(ULESS_FLAG), ULESS_FLAG));
- if (op & SLJIT_SET_U)
- FAIL_IF(push_inst(compiler, SLTU | S(src2) | T(src1) | DA(UGREATER_FLAG), UGREATER_FLAG));
- if (op & SLJIT_SET_S) {
- FAIL_IF(push_inst(compiler, SLT | S(src1) | T(src2) | DA(LESS_FLAG), LESS_FLAG));
- FAIL_IF(push_inst(compiler, SLT | S(src2) | T(src1) | DA(GREATER_FLAG), GREATER_FLAG));
- }
+
+ if (is_overflow || is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG));
/* dst may be the same as src1 or src2. */
- if (CHECK_FLAGS(SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_C))
+ if (!(flags & UNUSED_DEST) || (op & VARIABLE_FLAG_MASK))
FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | D(dst), DR(dst)));
}
- if (!(op & SLJIT_SET_O))
+ if (!is_overflow)
return SLJIT_SUCCESS;
- FAIL_IF(push_inst(compiler, SELECT_OP(DSLL32, SLL) | TA(ULESS_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
- FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
- return push_inst(compiler, SELECT_OP(DSRL32, SRL) | TA(OVERFLOW_FLAG) | DA(OVERFLOW_FLAG) | SH_IMM(31), OVERFLOW_FLAG);
+ FAIL_IF(push_inst(compiler, SELECT_OP(DSLL32, SLL) | TA(OTHER_FLAG) | D(TMP_REG1) | SH_IMM(31), DR(TMP_REG1)));
+ FAIL_IF(push_inst(compiler, XOR | S(TMP_REG1) | TA(EQUAL_FLAG) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG));
+ if (op & SLJIT_SET_Z)
+ FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG));
+ return push_inst(compiler, SELECT_OP(DSRL32, SRL) | TA(OTHER_FLAG) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG);
case SLJIT_SUBC:
if ((flags & SRC2_IMM) && src2 == SIMM_MIN) {
@@ -369,28 +434,31 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
flags &= ~SRC2_IMM;
}
+ is_carry = GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY);
+
if (flags & SRC2_IMM) {
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OVERFLOW_FLAG) | IMM(src2), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG));
/* dst may be the same as src1 or src2. */
FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(-src2), DR(dst)));
}
else {
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
/* dst may be the same as src1 or src2. */
FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | D(dst), DR(dst)));
}
- if (op & SLJIT_SET_C)
- FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(ULESS_FLAG) | DA(LESS_FLAG), LESS_FLAG));
+ if (is_carry)
+ FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | D(TMP_REG1), DR(TMP_REG1)));
- FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(dst) | TA(ULESS_FLAG) | D(dst), DR(dst)));
- return (op & SLJIT_SET_C) ? push_inst(compiler, OR | SA(OVERFLOW_FLAG) | TA(LESS_FLAG) | DA(ULESS_FLAG), ULESS_FLAG) : SLJIT_SUCCESS;
+ FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)));
+ return (is_carry) ? push_inst(compiler, OR | SA(EQUAL_FLAG) | T(TMP_REG1) | DA(OTHER_FLAG), OTHER_FLAG) : SLJIT_SUCCESS;
case SLJIT_MUL:
SLJIT_ASSERT(!(flags & SRC2_IMM));
- if (!(op & SLJIT_SET_O)) {
+
+ if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) {
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
if (op & SLJIT_I32_OP)
return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst));
@@ -402,10 +470,10 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
#endif
}
FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS));
- FAIL_IF(push_inst(compiler, MFHI | DA(ULESS_FLAG), ULESS_FLAG));
+ FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG));
FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst)));
- FAIL_IF(push_inst(compiler, SELECT_OP(DSRA32, SRA) | T(dst) | DA(UGREATER_FLAG) | SH_IMM(31), UGREATER_FLAG));
- return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(ULESS_FLAG) | TA(UGREATER_FLAG) | DA(OVERFLOW_FLAG), OVERFLOW_FLAG);
+ FAIL_IF(push_inst(compiler, SELECT_OP(DSRA32, SRA) | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG));
+ return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
case SLJIT_AND:
EMIT_LOGICAL(ANDI, AND);
@@ -432,7 +500,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return SLJIT_SUCCESS;
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -446,24 +514,26 @@ static SLJIT_INLINE sljit_s32 emit_const(struct sljit_compiler *compiler, sljit_
return push_inst(compiler, ORI | S(dst) | T(dst) | IMM(init_value), DR(dst));
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
- inst[0] = (inst[0] & 0xffff0000) | ((new_addr >> 48) & 0xffff);
- inst[1] = (inst[1] & 0xffff0000) | ((new_addr >> 32) & 0xffff);
- inst[3] = (inst[3] & 0xffff0000) | ((new_addr >> 16) & 0xffff);
- inst[5] = (inst[5] & 0xffff0000) | (new_addr & 0xffff);
+ inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 48) & 0xffff);
+ inst[1] = (inst[1] & 0xffff0000) | ((new_target >> 32) & 0xffff);
+ inst[3] = (inst[3] & 0xffff0000) | ((new_target >> 16) & 0xffff);
+ inst[5] = (inst[5] & 0xffff0000) | (new_target & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 6);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
inst[0] = (inst[0] & 0xffff0000) | ((new_constant >> 48) & 0xffff);
inst[1] = (inst[1] & 0xffff0000) | ((new_constant >> 32) & 0xffff);
inst[3] = (inst[3] & 0xffff0000) | ((new_constant >> 16) & 0xffff);
inst[5] = (inst[5] & 0xffff0000) | (new_constant & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 6);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_common.c b/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_common.c
index c2c251b1ff..00e8303090 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_common.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeMIPS_common.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -57,19 +57,14 @@ typedef sljit_u32 sljit_ins;
#define RETURN_ADDR_REG 31
/* Flags are kept in volatile registers. */
-#define EQUAL_FLAG 12
-/* And carry flag as well. */
-#define ULESS_FLAG 13
-#define UGREATER_FLAG 14
-#define LESS_FLAG 15
-#define GREATER_FLAG 31
-#define OVERFLOW_FLAG 1
+#define EQUAL_FLAG 31
+#define OTHER_FLAG 1
#define TMP_FREG1 (0)
#define TMP_FREG2 ((SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1) << 1)
static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
- 0, 2, 5, 6, 7, 8, 9, 10, 11, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 3, 25, 4
+ 0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 3, 25, 4
};
/* --------------------------------------------------------------------- */
@@ -178,7 +173,13 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
#define CLZ (HI(28) | LO(32))
#define DCLZ (HI(28) | LO(36))
+#define MOVF (HI(0) | (0 << 16) | LO(1))
+#define MOVN (HI(0) | LO(11))
+#define MOVT (HI(0) | (1 << 16) | LO(1))
+#define MOVZ (HI(0) | LO(10))
#define MUL (HI(28) | LO(2))
+#define PREF (HI(51))
+#define PREFX (HI(19) | LO(15))
#define SEB (HI(31) | (16 << 6) | LO(32))
#define SEH (HI(31) | (24 << 6) | LO(32))
#endif
@@ -218,7 +219,7 @@ static SLJIT_INLINE sljit_ins invert_branch(sljit_s32 flags)
return (flags & IS_BIT26_COND) ? (1 << 26) : (1 << 16);
}
-static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code)
+static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
{
sljit_sw diff;
sljit_uw target_addr;
@@ -237,9 +238,10 @@ static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_i
target_addr = jump->u.target;
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
- target_addr = (sljit_uw)(code + jump->u.label->size);
+ target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset;
}
- inst = (sljit_ins*)jump->addr;
+
+ inst = (sljit_ins *)jump->addr;
if (jump->flags & IS_COND)
inst--;
@@ -250,7 +252,7 @@ static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_i
/* B instructions. */
if (jump->flags & IS_MOVABLE) {
- diff = ((sljit_sw)target_addr - (sljit_sw)(inst)) >> 2;
+ diff = ((sljit_sw)target_addr - (sljit_sw)inst - executable_offset) >> 2;
if (diff <= SIMM_MAX && diff >= SIMM_MIN) {
jump->flags |= PATCH_B;
@@ -268,7 +270,7 @@ static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_i
}
}
else {
- diff = ((sljit_sw)target_addr - (sljit_sw)(inst + 1)) >> 2;
+ diff = ((sljit_sw)target_addr - (sljit_sw)(inst + 1) - executable_offset) >> 2;
if (diff <= SIMM_MAX && diff >= SIMM_MIN) {
jump->flags |= PATCH_B;
@@ -364,6 +366,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_ins *buf_ptr;
sljit_ins *buf_end;
sljit_uw word_count;
+ sljit_sw executable_offset;
sljit_uw addr;
struct sljit_label *label;
@@ -380,9 +383,12 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
code_ptr = code;
word_count = 0;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
+
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
+
do {
buf_ptr = (sljit_ins*)buf->memory;
buf_end = buf_ptr + (buf->used_size >> 2);
@@ -393,8 +399,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
SLJIT_ASSERT(!const_ || const_->addr >= word_count);
/* These structures are ordered by their address. */
if (label && label->size == word_count) {
- /* Just recording the address. */
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -404,7 +409,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
#else
jump->addr = (sljit_uw)(code_ptr - 7);
#endif
- code_ptr = detect_jump_type(jump, code_ptr, code);
+ code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset);
jump = jump->next;
}
if (const_ && const_->addr == word_count) {
@@ -434,16 +439,16 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
while (jump) {
do {
addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target;
- buf_ptr = (sljit_ins*)jump->addr;
+ buf_ptr = (sljit_ins *)jump->addr;
if (jump->flags & PATCH_B) {
- addr = (sljit_sw)(addr - (jump->addr + sizeof(sljit_ins))) >> 2;
+ addr = (sljit_sw)(addr - ((sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset) + sizeof(sljit_ins))) >> 2;
SLJIT_ASSERT((sljit_sw)addr <= SIMM_MAX && (sljit_sw)addr >= SIMM_MIN);
buf_ptr[0] = (buf_ptr[0] & 0xffff0000) | (addr & 0xffff);
break;
}
if (jump->flags & PATCH_J) {
- SLJIT_ASSERT((addr & ~0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~0xfffffff));
+ SLJIT_ASSERT((addr & ~0xfffffff) == (((sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset) + sizeof(sljit_ins)) & ~0xfffffff));
buf_ptr[0] |= (addr >> 2) & 0x03ffffff;
break;
}
@@ -476,7 +481,12 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
}
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
+
+ code = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
+ code_ptr = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+
#ifndef __GNUC__
SLJIT_CACHE_FLUSH(code, code_ptr);
#else
@@ -486,6 +496,32 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
return code;
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ sljit_sw fir = 0;
+
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+#elif defined(__GNUC__)
+ asm ("cfc1 %0, $0" : "=r"(fir));
+ return (fir >> 22) & 0x1;
+#else
+#error "FIR check is not implemented for this architecture"
+#endif
+
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+ case SLJIT_HAS_CLZ:
+ case SLJIT_HAS_CMOV:
+ return 1;
+#endif
+
+ default:
+ return fir;
+ }
+}
+
/* --------------------------------------------------------------------- */
/* Entry, exit */
/* --------------------------------------------------------------------- */
@@ -520,10 +556,6 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
#define SLOW_SRC2 0x20000
#define SLOW_DEST 0x40000
-/* Only these flags are set. UNUSED_DEST is not set when no flags should be set. */
-#define CHECK_FLAGS(list) \
- (!(flags & UNUSED_DEST) || (op & GET_FLAGS(~(list))))
-
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
#define STACK_STORE SW
#define STACK_LOAD LW
@@ -759,34 +791,28 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl
base = arg & REG_MASK;
if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) {
- argw &= 0x3;
- if ((flags & WRITE_BACK) && reg_ar == DR(base)) {
- SLJIT_ASSERT(!(flags & LOAD_DATA) && DR(TMP_REG1) != reg_ar);
- FAIL_IF(push_inst(compiler, ADDU_W | SA(reg_ar) | TA(0) | D(TMP_REG1), DR(TMP_REG1)));
- reg_ar = DR(TMP_REG1);
+ if (SLJIT_UNLIKELY(flags & WRITE_BACK)) {
+ SLJIT_ASSERT(argw == 0);
+ FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(OFFS_REG(arg)) | D(base), DR(base)));
+ return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar), delay_slot);
}
+ argw &= 0x3;
+
/* Using the cache. */
if (argw == compiler->cache_argw) {
- if (!(flags & WRITE_BACK)) {
- if (arg == compiler->cache_arg)
+ if (arg == compiler->cache_arg)
+ return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay_slot);
+
+ if ((SLJIT_MEM | (arg & OFFS_REG_MASK)) == compiler->cache_arg) {
+ if (arg == next_arg && argw == (next_argw & 0x3)) {
+ compiler->cache_arg = arg;
+ compiler->cache_argw = argw;
+ FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | D(TMP_REG3), DR(TMP_REG3)));
return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay_slot);
- if ((SLJIT_MEM | (arg & OFFS_REG_MASK)) == compiler->cache_arg) {
- if (arg == next_arg && argw == (next_argw & 0x3)) {
- compiler->cache_arg = arg;
- compiler->cache_argw = argw;
- FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | D(TMP_REG3), DR(TMP_REG3)));
- return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay_slot);
- }
- FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | DA(tmp_ar), tmp_ar));
- return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot);
- }
- }
- else {
- if ((SLJIT_MEM | (arg & OFFS_REG_MASK)) == compiler->cache_arg) {
- FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | D(base), DR(base)));
- return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar), delay_slot);
}
+ FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | DA(tmp_ar), tmp_ar));
+ return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot);
}
}
@@ -796,35 +822,18 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl
FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(arg)) | D(TMP_REG3) | SH_IMM(argw), DR(TMP_REG3)));
}
- if (!(flags & WRITE_BACK)) {
- if (arg == next_arg && argw == (next_argw & 0x3)) {
- compiler->cache_arg = arg;
- compiler->cache_argw = argw;
- FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | D(TMP_REG3), DR(TMP_REG3)));
- tmp_ar = DR(TMP_REG3);
- }
- else
- FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | DA(tmp_ar), tmp_ar));
- return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot);
+ if (arg == next_arg && argw == (next_argw & 0x3)) {
+ compiler->cache_arg = arg;
+ compiler->cache_argw = argw;
+ FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | D(TMP_REG3), DR(TMP_REG3)));
+ tmp_ar = DR(TMP_REG3);
}
- FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | D(base), DR(base)));
- return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar), delay_slot);
+ else
+ FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | DA(tmp_ar), tmp_ar));
+ return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot);
}
if (SLJIT_UNLIKELY(flags & WRITE_BACK) && base) {
- /* Update only applies if a base register exists. */
- if (reg_ar == DR(base)) {
- SLJIT_ASSERT(!(flags & LOAD_DATA) && DR(TMP_REG1) != reg_ar);
- if (argw <= SIMM_MAX && argw >= SIMM_MIN) {
- FAIL_IF(push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar) | IMM(argw), MOVABLE_INS));
- if (argw)
- return push_inst(compiler, ADDIU_W | S(base) | T(base) | IMM(argw), DR(base));
- return SLJIT_SUCCESS;
- }
- FAIL_IF(push_inst(compiler, ADDU_W | SA(reg_ar) | TA(0) | D(TMP_REG1), DR(TMP_REG1)));
- reg_ar = DR(TMP_REG1);
- }
-
if (argw <= SIMM_MAX && argw >= SIMM_MIN) {
if (argw)
FAIL_IF(push_inst(compiler, ADDIU_W | S(base) | T(base) | IMM(argw), DR(base)));
@@ -914,10 +923,8 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
}
if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED)) {
- if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32 && !(src2 & SLJIT_MEM))
- return SLJIT_SUCCESS;
- if (GET_FLAGS(op))
- flags |= UNUSED_DEST;
+ SLJIT_ASSERT(HAS_FLAGS(op));
+ flags |= UNUSED_DEST;
}
else if (FAST_IS_REG(dst)) {
dst_r = dst;
@@ -1079,6 +1086,29 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
return SLJIT_SUCCESS;
}
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+static sljit_s32 emit_prefetch(struct sljit_compiler *compiler,
+ sljit_s32 src, sljit_sw srcw)
+{
+ if (!(src & OFFS_REG_MASK)) {
+ if (srcw <= SIMM_MAX && srcw >= SIMM_MIN)
+ return push_inst(compiler, PREF | S(src & REG_MASK) | IMM(srcw), MOVABLE_INS);
+
+ FAIL_IF(load_immediate(compiler, DR(TMP_REG1), srcw));
+ return push_inst(compiler, PREFX | S(src & REG_MASK) | T(TMP_REG1), MOVABLE_INS);
+ }
+
+ srcw &= 0x3;
+
+ if (SLJIT_UNLIKELY(srcw != 0)) {
+ FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(src)) | D(TMP_REG1) | SH_IMM(srcw), DR(TMP_REG1)));
+ return push_inst(compiler, PREFX | S(src & REG_MASK) | T(TMP_REG1), MOVABLE_INS);
+ }
+
+ return push_inst(compiler, PREFX | S(src & REG_MASK) | T(OFFS_REG(src)), MOVABLE_INS);
+}
+#endif
+
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
@@ -1094,6 +1124,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(dst, dstw);
ADJUST_LOCAL_OFFSET(src, srcw);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op)) {
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+ if (op <= SLJIT_MOV_P && (src & SLJIT_MEM))
+ return emit_prefetch(compiler, src, srcw);
+#endif
+ return SLJIT_SUCCESS;
+ }
+
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
if ((op & SLJIT_I32_OP) && GET_OPCODE(op) >= SLJIT_NOT) {
flags |= INT_DATA | SIGNED_DATA;
@@ -1197,6 +1235,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
+
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
if (op & SLJIT_I32_OP) {
flags |= INT_DATA | SIGNED_DATA;
@@ -1273,19 +1314,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#elif defined(__GNUC__)
- sljit_sw fir;
- asm ("cfc1 %0, $0" : "=r"(fir));
- return (fir >> 22) & 0x1;
-#else
-#error "FIR check is not implemented for this architecture"
-#endif
-}
-
#define FLOAT_DATA(op) (DOUBLE_DATA | ((op & SLJIT_F32_OP) >> 7))
#define FMT(op) (((op & SLJIT_F32_OP) ^ SLJIT_F32_OP) << (21 - 8))
@@ -1308,9 +1336,6 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
FAIL_IF(push_inst(compiler, (TRUNC_W_S ^ (flags >> 19)) | FMT(op) | FS(src) | FD(TMP_FREG1), MOVABLE_INS));
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst(compiler, MFC1 | flags | T(dst) | FS(TMP_FREG1), MOVABLE_INS);
@@ -1364,6 +1389,8 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
+ sljit_ins inst;
+
if (src1 & SLJIT_MEM) {
FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, src2, src2w));
src1 = TMP_FREG1;
@@ -1378,25 +1405,26 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
else
src2 <<= 1;
- /* src2 and src1 are swapped. */
- if (op & SLJIT_SET_E) {
- FAIL_IF(push_inst(compiler, C_UEQ_S | FMT(op) | FT(src2) | FS(src1), UNMOVABLE_INS));
- FAIL_IF(push_inst(compiler, CFC1 | TA(EQUAL_FLAG) | DA(FCSR_REG), EQUAL_FLAG));
- FAIL_IF(push_inst(compiler, SRL | TA(EQUAL_FLAG) | DA(EQUAL_FLAG) | SH_IMM(23), EQUAL_FLAG));
- FAIL_IF(push_inst(compiler, ANDI | SA(EQUAL_FLAG) | TA(EQUAL_FLAG) | IMM(1), EQUAL_FLAG));
- }
- if (op & SLJIT_SET_S) {
- /* Mixing the instructions for the two checks. */
- FAIL_IF(push_inst(compiler, C_ULT_S | FMT(op) | FT(src2) | FS(src1), UNMOVABLE_INS));
- FAIL_IF(push_inst(compiler, CFC1 | TA(ULESS_FLAG) | DA(FCSR_REG), ULESS_FLAG));
- FAIL_IF(push_inst(compiler, C_ULT_S | FMT(op) | FT(src1) | FS(src2), UNMOVABLE_INS));
- FAIL_IF(push_inst(compiler, SRL | TA(ULESS_FLAG) | DA(ULESS_FLAG) | SH_IMM(23), ULESS_FLAG));
- FAIL_IF(push_inst(compiler, ANDI | SA(ULESS_FLAG) | TA(ULESS_FLAG) | IMM(1), ULESS_FLAG));
- FAIL_IF(push_inst(compiler, CFC1 | TA(UGREATER_FLAG) | DA(FCSR_REG), UGREATER_FLAG));
- FAIL_IF(push_inst(compiler, SRL | TA(UGREATER_FLAG) | DA(UGREATER_FLAG) | SH_IMM(23), UGREATER_FLAG));
- FAIL_IF(push_inst(compiler, ANDI | SA(UGREATER_FLAG) | TA(UGREATER_FLAG) | IMM(1), UGREATER_FLAG));
- }
- return push_inst(compiler, C_UN_S | FMT(op) | FT(src2) | FS(src1), FCSR_FCC);
+ switch (GET_FLAG_TYPE(op)) {
+ case SLJIT_EQUAL_F64:
+ case SLJIT_NOT_EQUAL_F64:
+ inst = C_UEQ_S;
+ break;
+ case SLJIT_LESS_F64:
+ case SLJIT_GREATER_EQUAL_F64:
+ inst = C_ULT_S;
+ break;
+ case SLJIT_GREATER_F64:
+ case SLJIT_LESS_EQUAL_F64:
+ inst = C_ULE_S;
+ break;
+ default:
+ SLJIT_ASSERT(GET_FLAG_TYPE(op) == SLJIT_UNORDERED_F64 || GET_FLAG_TYPE(op) == SLJIT_ORDERED_F64);
+ inst = C_UN_S;
+ break;
+ }
+
+ return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1), UNMOVABLE_INS);
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op,
@@ -1542,10 +1570,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
- /* For UNUSED dst. Uncommon, but possible. */
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst(compiler, ADDU_W | SA(RETURN_ADDR_REG) | TA(0) | D(dst), DR(dst));
@@ -1634,55 +1658,39 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
switch (type) {
case SLJIT_EQUAL:
- case SLJIT_NOT_EQUAL_F64:
BR_NZ(EQUAL_FLAG);
break;
case SLJIT_NOT_EQUAL:
- case SLJIT_EQUAL_F64:
BR_Z(EQUAL_FLAG);
break;
case SLJIT_LESS:
- case SLJIT_LESS_F64:
- BR_Z(ULESS_FLAG);
- break;
- case SLJIT_GREATER_EQUAL:
- case SLJIT_GREATER_EQUAL_F64:
- BR_NZ(ULESS_FLAG);
- break;
case SLJIT_GREATER:
- case SLJIT_GREATER_F64:
- BR_Z(UGREATER_FLAG);
- break;
- case SLJIT_LESS_EQUAL:
- case SLJIT_LESS_EQUAL_F64:
- BR_NZ(UGREATER_FLAG);
- break;
case SLJIT_SIG_LESS:
- BR_Z(LESS_FLAG);
- break;
- case SLJIT_SIG_GREATER_EQUAL:
- BR_NZ(LESS_FLAG);
- break;
case SLJIT_SIG_GREATER:
- BR_Z(GREATER_FLAG);
- break;
- case SLJIT_SIG_LESS_EQUAL:
- BR_NZ(GREATER_FLAG);
- break;
case SLJIT_OVERFLOW:
case SLJIT_MUL_OVERFLOW:
- BR_Z(OVERFLOW_FLAG);
+ BR_Z(OTHER_FLAG);
break;
+ case SLJIT_GREATER_EQUAL:
+ case SLJIT_LESS_EQUAL:
+ case SLJIT_SIG_GREATER_EQUAL:
+ case SLJIT_SIG_LESS_EQUAL:
case SLJIT_NOT_OVERFLOW:
case SLJIT_MUL_NOT_OVERFLOW:
- BR_NZ(OVERFLOW_FLAG);
- break;
- case SLJIT_UNORDERED_F64:
- BR_F();
+ BR_NZ(OTHER_FLAG);
break;
+ case SLJIT_NOT_EQUAL_F64:
+ case SLJIT_GREATER_EQUAL_F64:
+ case SLJIT_GREATER_F64:
case SLJIT_ORDERED_F64:
BR_T();
break;
+ case SLJIT_EQUAL_F64:
+ case SLJIT_LESS_F64:
+ case SLJIT_LESS_EQUAL_F64:
+ case SLJIT_UNORDERED_F64:
+ BR_F();
+ break;
default:
/* Not conditional branch. */
inst = 0;
@@ -1854,86 +1862,6 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler
#undef RESOLVE_IMM1
#undef RESOLVE_IMM2
-SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_s32 type,
- sljit_s32 src1, sljit_sw src1w,
- sljit_s32 src2, sljit_sw src2w)
-{
- struct sljit_jump *jump;
- sljit_ins inst;
- sljit_s32 if_true;
-
- CHECK_ERROR_PTR();
- CHECK_PTR(check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w));
-
- compiler->cache_arg = 0;
- compiler->cache_argw = 0;
-
- if (src1 & SLJIT_MEM) {
- PTR_FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(type) | LOAD_DATA, TMP_FREG1, src1, src1w, src2, src2w));
- src1 = TMP_FREG1;
- }
- else
- src1 <<= 1;
-
- if (src2 & SLJIT_MEM) {
- PTR_FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(type) | LOAD_DATA, TMP_FREG2, src2, src2w, 0, 0));
- src2 = TMP_FREG2;
- }
- else
- src2 <<= 1;
-
- jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
- PTR_FAIL_IF(!jump);
- set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP);
- jump->flags |= IS_BIT16_COND;
-
- switch (type & 0xff) {
- case SLJIT_EQUAL_F64:
- inst = C_UEQ_S;
- if_true = 1;
- break;
- case SLJIT_NOT_EQUAL_F64:
- inst = C_UEQ_S;
- if_true = 0;
- break;
- case SLJIT_LESS_F64:
- inst = C_ULT_S;
- if_true = 1;
- break;
- case SLJIT_GREATER_EQUAL_F64:
- inst = C_ULT_S;
- if_true = 0;
- break;
- case SLJIT_GREATER_F64:
- inst = C_ULE_S;
- if_true = 0;
- break;
- case SLJIT_LESS_EQUAL_F64:
- inst = C_ULE_S;
- if_true = 1;
- break;
- case SLJIT_UNORDERED_F64:
- inst = C_UN_S;
- if_true = 1;
- break;
- default: /* Make compilers happy. */
- SLJIT_ASSERT_STOP();
- case SLJIT_ORDERED_F64:
- inst = C_UN_S;
- if_true = 0;
- break;
- }
-
- PTR_FAIL_IF(push_inst(compiler, inst | FMT(type) | FT(src2) | FS(src1), UNMOVABLE_INS));
- /* Intentionally the other opcode. */
- PTR_FAIL_IF(push_inst(compiler, (if_true ? BC1F : BC1T) | JUMP_LENGTH, UNMOVABLE_INS));
- PTR_FAIL_IF(emit_const(compiler, TMP_REG2, 0));
- PTR_FAIL_IF(push_inst(compiler, JR | S(TMP_REG2), UNMOVABLE_INS));
- jump->addr = compiler->size;
- PTR_FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS));
- return jump;
-}
-
#undef JUMP_LENGTH
#undef BR_Z
#undef BR_NZ
@@ -2003,115 +1931,160 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
- sljit_s32 sugg_dst_ar, dst_ar;
- sljit_s32 flags = GET_ALL_FLAGS(op);
+ sljit_s32 src_ar, dst_ar;
+ sljit_s32 saved_op = op;
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
-# define mem_type WORD_DATA
+ sljit_s32 mem_type = WORD_DATA;
#else
sljit_s32 mem_type = (op & SLJIT_I32_OP) ? (INT_DATA | SIGNED_DATA) : WORD_DATA;
#endif
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
op = GET_OPCODE(op);
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
- if (op == SLJIT_MOV_S32 || op == SLJIT_MOV_U32)
+ if (op == SLJIT_MOV_S32)
mem_type = INT_DATA | SIGNED_DATA;
#endif
- sugg_dst_ar = DR((op < SLJIT_ADD && FAST_IS_REG(dst)) ? dst : TMP_REG2);
+ dst_ar = DR((op < SLJIT_ADD && FAST_IS_REG(dst)) ? dst : TMP_REG2);
compiler->cache_arg = 0;
compiler->cache_argw = 0;
- if (op >= SLJIT_ADD && (src & SLJIT_MEM)) {
- ADJUST_LOCAL_OFFSET(src, srcw);
- FAIL_IF(emit_op_mem2(compiler, mem_type | LOAD_DATA, DR(TMP_REG1), src, srcw, dst, dstw));
- src = TMP_REG1;
- srcw = 0;
- }
+
+ if (op >= SLJIT_ADD && (dst & SLJIT_MEM))
+ FAIL_IF(emit_op_mem2(compiler, mem_type | LOAD_DATA, DR(TMP_REG1), dst, dstw, dst, dstw));
switch (type & 0xff) {
case SLJIT_EQUAL:
case SLJIT_NOT_EQUAL:
- FAIL_IF(push_inst(compiler, SLTIU | SA(EQUAL_FLAG) | TA(sugg_dst_ar) | IMM(1), sugg_dst_ar));
- dst_ar = sugg_dst_ar;
- break;
- case SLJIT_LESS:
- case SLJIT_GREATER_EQUAL:
- case SLJIT_LESS_F64:
- case SLJIT_GREATER_EQUAL_F64:
- dst_ar = ULESS_FLAG;
- break;
- case SLJIT_GREATER:
- case SLJIT_LESS_EQUAL:
- case SLJIT_GREATER_F64:
- case SLJIT_LESS_EQUAL_F64:
- dst_ar = UGREATER_FLAG;
- break;
- case SLJIT_SIG_LESS:
- case SLJIT_SIG_GREATER_EQUAL:
- dst_ar = LESS_FLAG;
- break;
- case SLJIT_SIG_GREATER:
- case SLJIT_SIG_LESS_EQUAL:
- dst_ar = GREATER_FLAG;
- break;
- case SLJIT_OVERFLOW:
- case SLJIT_NOT_OVERFLOW:
- dst_ar = OVERFLOW_FLAG;
+ FAIL_IF(push_inst(compiler, SLTIU | SA(EQUAL_FLAG) | TA(dst_ar) | IMM(1), dst_ar));
+ src_ar = dst_ar;
break;
case SLJIT_MUL_OVERFLOW:
case SLJIT_MUL_NOT_OVERFLOW:
- FAIL_IF(push_inst(compiler, SLTIU | SA(OVERFLOW_FLAG) | TA(sugg_dst_ar) | IMM(1), sugg_dst_ar));
- dst_ar = sugg_dst_ar;
+ FAIL_IF(push_inst(compiler, SLTIU | SA(OTHER_FLAG) | TA(dst_ar) | IMM(1), dst_ar));
+ src_ar = dst_ar;
type ^= 0x1; /* Flip type bit for the XORI below. */
break;
+ case SLJIT_GREATER_F64:
+ case SLJIT_LESS_EQUAL_F64:
+ type ^= 0x1; /* Flip type bit for the XORI below. */
case SLJIT_EQUAL_F64:
case SLJIT_NOT_EQUAL_F64:
- dst_ar = EQUAL_FLAG;
- break;
-
+ case SLJIT_LESS_F64:
+ case SLJIT_GREATER_EQUAL_F64:
case SLJIT_UNORDERED_F64:
case SLJIT_ORDERED_F64:
- FAIL_IF(push_inst(compiler, CFC1 | TA(sugg_dst_ar) | DA(FCSR_REG), sugg_dst_ar));
- FAIL_IF(push_inst(compiler, SRL | TA(sugg_dst_ar) | DA(sugg_dst_ar) | SH_IMM(23), sugg_dst_ar));
- FAIL_IF(push_inst(compiler, ANDI | SA(sugg_dst_ar) | TA(sugg_dst_ar) | IMM(1), sugg_dst_ar));
- dst_ar = sugg_dst_ar;
+ FAIL_IF(push_inst(compiler, CFC1 | TA(dst_ar) | DA(FCSR_REG), dst_ar));
+ FAIL_IF(push_inst(compiler, SRL | TA(dst_ar) | DA(dst_ar) | SH_IMM(23), dst_ar));
+ FAIL_IF(push_inst(compiler, ANDI | SA(dst_ar) | TA(dst_ar) | IMM(1), dst_ar));
+ src_ar = dst_ar;
break;
default:
- SLJIT_ASSERT_STOP();
- dst_ar = sugg_dst_ar;
+ src_ar = OTHER_FLAG;
break;
}
if (type & 0x1) {
- FAIL_IF(push_inst(compiler, XORI | SA(dst_ar) | TA(sugg_dst_ar) | IMM(1), sugg_dst_ar));
- dst_ar = sugg_dst_ar;
+ FAIL_IF(push_inst(compiler, XORI | SA(src_ar) | TA(dst_ar) | IMM(1), dst_ar));
+ src_ar = dst_ar;
}
- if (op >= SLJIT_ADD) {
- if (DR(TMP_REG2) != dst_ar)
- FAIL_IF(push_inst(compiler, ADDU_W | SA(dst_ar) | TA(0) | D(TMP_REG2), DR(TMP_REG2)));
- return emit_op(compiler, op | flags, mem_type | CUMULATIVE_OP | LOGICAL_OP | IMM_OP | ALT_KEEP_CACHE, dst, dstw, src, srcw, TMP_REG2, 0);
+ if (op < SLJIT_ADD) {
+ if (dst & SLJIT_MEM)
+ return emit_op_mem(compiler, mem_type, src_ar, dst, dstw);
+
+ if (src_ar != dst_ar)
+ return push_inst(compiler, ADDU_W | SA(src_ar) | TA(0) | DA(dst_ar), dst_ar);
+ return SLJIT_SUCCESS;
}
+ /* OTHER_FLAG cannot be specified as src2 argument at the moment. */
+ if (DR(TMP_REG2) != src_ar)
+ FAIL_IF(push_inst(compiler, ADDU_W | SA(src_ar) | TA(0) | D(TMP_REG2), DR(TMP_REG2)));
+
+ mem_type |= CUMULATIVE_OP | LOGICAL_OP | IMM_OP | ALT_KEEP_CACHE;
+
if (dst & SLJIT_MEM)
- return emit_op_mem(compiler, mem_type, dst_ar, dst, dstw);
+ return emit_op(compiler, saved_op, mem_type, dst, dstw, TMP_REG1, 0, TMP_REG2, 0);
+ return emit_op(compiler, saved_op, mem_type, dst, dstw, dst, dstw, TMP_REG2, 0);
+}
- if (sugg_dst_ar != dst_ar)
- return push_inst(compiler, ADDU_W | SA(dst_ar) | TA(0) | DA(sugg_dst_ar), sugg_dst_ar);
- return SLJIT_SUCCESS;
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+ sljit_ins ins;
+#endif
-#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
-# undef mem_type
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
+
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+
+ if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
+#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
+ if (dst_reg & SLJIT_I32_OP)
+ srcw = (sljit_s32)srcw;
+#endif
+ FAIL_IF(load_immediate(compiler, DR(TMP_REG1), srcw));
+ src = TMP_REG1;
+ srcw = 0;
+ }
+
+ dst_reg &= ~SLJIT_I32_OP;
+
+ switch (type & 0xff) {
+ case SLJIT_EQUAL:
+ ins = MOVZ | TA(EQUAL_FLAG);
+ break;
+ case SLJIT_NOT_EQUAL:
+ ins = MOVN | TA(EQUAL_FLAG);
+ break;
+ case SLJIT_LESS:
+ case SLJIT_GREATER:
+ case SLJIT_SIG_LESS:
+ case SLJIT_SIG_GREATER:
+ case SLJIT_OVERFLOW:
+ case SLJIT_MUL_OVERFLOW:
+ ins = MOVN | TA(OTHER_FLAG);
+ break;
+ case SLJIT_GREATER_EQUAL:
+ case SLJIT_LESS_EQUAL:
+ case SLJIT_SIG_GREATER_EQUAL:
+ case SLJIT_SIG_LESS_EQUAL:
+ case SLJIT_NOT_OVERFLOW:
+ case SLJIT_MUL_NOT_OVERFLOW:
+ ins = MOVZ | TA(OTHER_FLAG);
+ break;
+ case SLJIT_EQUAL_F64:
+ case SLJIT_LESS_F64:
+ case SLJIT_LESS_EQUAL_F64:
+ case SLJIT_UNORDERED_F64:
+ ins = MOVT;
+ break;
+ case SLJIT_NOT_EQUAL_F64:
+ case SLJIT_GREATER_EQUAL_F64:
+ case SLJIT_GREATER_F64:
+ case SLJIT_ORDERED_F64:
+ ins = MOVF;
+ break;
+ default:
+ ins = MOVZ | TA(OTHER_FLAG);
+ SLJIT_UNREACHABLE();
+ break;
+ }
+
+ return push_inst(compiler, ins | S(src) | D(dst_reg), DR(dst_reg));
+
+#else
+ return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);
#endif
}
@@ -2128,7 +2101,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
PTR_FAIL_IF(!const_);
set_const(const_, compiler);
- reg = SLOW_IS_REG(dst) ? dst : TMP_REG2;
+ reg = FAST_IS_REG(dst) ? dst : TMP_REG2;
PTR_FAIL_IF(emit_const(compiler, reg, init_value));
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativePPC_32.c b/src/3rdparty/pcre2/src/sljit/sljitNativePPC_32.c
index 0f23cf86dd..fc185f7847 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativePPC_32.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativePPC_32.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -88,77 +88,86 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
case SLJIT_NEG:
SLJIT_ASSERT(src1 == TMP_REG1);
- return push_inst(compiler, NEG | OERC(flags) | D(dst) | A(src2));
+ /* Setting XER SO is not enough, CR SO is also needed. */
+ return push_inst(compiler, NEG | OE((flags & ALT_FORM1) ? ALT_SET_FLAGS : 0) | RC(flags) | D(dst) | A(src2));
case SLJIT_CLZ:
SLJIT_ASSERT(src1 == TMP_REG1);
- return push_inst(compiler, CNTLZW | RC(flags) | S(src2) | A(dst));
+ return push_inst(compiler, CNTLZW | S(src2) | A(dst));
case SLJIT_ADD:
if (flags & ALT_FORM1) {
- /* Flags does not set: BIN_IMM_EXTS unnecessary. */
- SLJIT_ASSERT(src2 == TMP_REG2);
- return push_inst(compiler, ADDI | D(dst) | A(src1) | compiler->imm);
+ /* Setting XER SO is not enough, CR SO is also needed. */
+ return push_inst(compiler, ADD | OE(ALT_SET_FLAGS) | RC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
}
+
if (flags & ALT_FORM2) {
/* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
- return push_inst(compiler, ADDIS | D(dst) | A(src1) | compiler->imm);
+
+ if (flags & ALT_FORM3)
+ return push_inst(compiler, ADDIS | D(dst) | A(src1) | compiler->imm);
+
+ if (flags & ALT_FORM4) {
+ FAIL_IF(push_inst(compiler, ADDIS | D(dst) | A(src1) | (((compiler->imm >> 16) & 0xffff) + ((compiler->imm >> 15) & 0x1))));
+ src1 = dst;
+ }
+
+ return push_inst(compiler, ADDI | D(dst) | A(src1) | (compiler->imm & 0xffff));
}
if (flags & ALT_FORM3) {
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, ADDIC | D(dst) | A(src1) | compiler->imm);
}
- if (flags & ALT_FORM4) {
- /* Flags does not set: BIN_IMM_EXTS unnecessary. */
- FAIL_IF(push_inst(compiler, ADDI | D(dst) | A(src1) | (compiler->imm & 0xffff)));
- return push_inst(compiler, ADDIS | D(dst) | A(dst) | (((compiler->imm >> 16) & 0xffff) + ((compiler->imm >> 15) & 0x1)));
- }
if (!(flags & ALT_SET_FLAGS))
return push_inst(compiler, ADD | D(dst) | A(src1) | B(src2));
- return push_inst(compiler, ADDC | OERC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
+ if (flags & ALT_FORM4)
+ return push_inst(compiler, ADDC | RC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
+ return push_inst(compiler, ADD | RC(flags) | D(dst) | A(src1) | B(src2));
case SLJIT_ADDC:
- if (flags & ALT_FORM1) {
- FAIL_IF(push_inst(compiler, MFXER | D(0)));
- FAIL_IF(push_inst(compiler, ADDE | D(dst) | A(src1) | B(src2)));
- return push_inst(compiler, MTXER | S(0));
- }
return push_inst(compiler, ADDE | D(dst) | A(src1) | B(src2));
case SLJIT_SUB:
if (flags & ALT_FORM1) {
+ if (flags & ALT_FORM2) {
+ FAIL_IF(push_inst(compiler, CMPLI | CRD(0) | A(src1) | compiler->imm));
+ if (!(flags & ALT_FORM3))
+ return SLJIT_SUCCESS;
+ return push_inst(compiler, ADDI | D(dst) | A(src1) | (-compiler->imm & 0xffff));
+ }
+ FAIL_IF(push_inst(compiler, CMPL | CRD(0) | A(src1) | B(src2)));
+ if (!(flags & ALT_FORM3))
+ return SLJIT_SUCCESS;
+ return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
+ }
+
+ if (flags & ALT_FORM2) {
+ /* Setting XER SO is not enough, CR SO is also needed. */
+ return push_inst(compiler, SUBF | OE(ALT_SET_FLAGS) | RC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));
+ }
+
+ if (flags & ALT_FORM3) {
/* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, SUBFIC | D(dst) | A(src1) | compiler->imm);
}
- if (flags & (ALT_FORM2 | ALT_FORM3)) {
- SLJIT_ASSERT(src2 == TMP_REG2);
- if (flags & ALT_FORM2)
- FAIL_IF(push_inst(compiler, CMPI | CRD(0) | A(src1) | compiler->imm));
- if (flags & ALT_FORM3)
- return push_inst(compiler, CMPLI | CRD(4) | A(src1) | compiler->imm);
- return SLJIT_SUCCESS;
- }
- if (flags & (ALT_FORM4 | ALT_FORM5)) {
- if (flags & ALT_FORM4)
- FAIL_IF(push_inst(compiler, CMPL | CRD(4) | A(src1) | B(src2)));
- if (flags & ALT_FORM5)
- FAIL_IF(push_inst(compiler, CMP | CRD(0) | A(src1) | B(src2)));
- return SLJIT_SUCCESS;
+
+ if (flags & ALT_FORM4) {
+ if (flags & ALT_FORM5) {
+ SLJIT_ASSERT(src2 == TMP_REG2);
+ return push_inst(compiler, CMPI | CRD(0) | A(src1) | compiler->imm);
+ }
+ return push_inst(compiler, CMP | CRD(0) | A(src1) | B(src2));
}
+
if (!(flags & ALT_SET_FLAGS))
return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
- if (flags & ALT_FORM6)
- FAIL_IF(push_inst(compiler, CMPL | CRD(4) | A(src1) | B(src2)));
- return push_inst(compiler, SUBFC | OERC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));
+ if (flags & ALT_FORM5)
+ return push_inst(compiler, SUBFC | RC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));
+ return push_inst(compiler, SUBF | RC(flags) | D(dst) | A(src2) | B(src1));
case SLJIT_SUBC:
- if (flags & ALT_FORM1) {
- FAIL_IF(push_inst(compiler, MFXER | D(0)));
- FAIL_IF(push_inst(compiler, SUBFE | D(dst) | A(src2) | B(src1)));
- return push_inst(compiler, MTXER | S(0));
- }
return push_inst(compiler, SUBFE | D(dst) | A(src2) | B(src1));
case SLJIT_MUL:
@@ -166,7 +175,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, MULLI | D(dst) | A(src1) | compiler->imm);
}
- return push_inst(compiler, MULLW | OERC(flags) | D(dst) | A(src2) | B(src1));
+ return push_inst(compiler, MULLW | OE(flags) | RC(flags) | D(dst) | A(src2) | B(src1));
case SLJIT_AND:
if (flags & ALT_FORM1) {
@@ -228,19 +237,15 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return push_inst(compiler, SRW | RC(flags) | S(src1) | A(dst) | B(src2));
case SLJIT_ASHR:
- if (flags & ALT_FORM3)
- FAIL_IF(push_inst(compiler, MFXER | D(0)));
if (flags & ALT_FORM1) {
SLJIT_ASSERT(src2 == TMP_REG2);
compiler->imm &= 0x1f;
- FAIL_IF(push_inst(compiler, SRAWI | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11)));
+ return push_inst(compiler, SRAWI | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11));
}
- else
- FAIL_IF(push_inst(compiler, SRAW | RC(flags) | S(src1) | A(dst) | B(src2)));
- return (flags & ALT_FORM3) ? push_inst(compiler, MTXER | S(0)) : SLJIT_SUCCESS;
+ return push_inst(compiler, SRAW | RC(flags) | S(src1) | A(dst) | B(src2));
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -250,20 +255,22 @@ static SLJIT_INLINE sljit_s32 emit_const(struct sljit_compiler *compiler, sljit_
return push_inst(compiler, ORI | S(reg) | A(reg) | IMM(init_value));
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
- inst[0] = (inst[0] & 0xffff0000) | ((new_addr >> 16) & 0xffff);
- inst[1] = (inst[1] & 0xffff0000) | (new_addr & 0xffff);
+ inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 16) & 0xffff);
+ inst[1] = (inst[1] & 0xffff0000) | (new_target & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
inst[0] = (inst[0] & 0xffff0000) | ((new_constant >> 16) & 0xffff);
inst[1] = (inst[1] & 0xffff0000) | (new_constant & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativePPC_64.c b/src/3rdparty/pcre2/src/sljit/sljitNativePPC_64.c
index 8e3223f725..5366c30d90 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativePPC_64.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativePPC_64.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -204,84 +204,118 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
case SLJIT_NEG:
SLJIT_ASSERT(src1 == TMP_REG1);
+
+ if ((flags & (ALT_FORM1 | ALT_SIGN_EXT)) == (ALT_FORM1 | ALT_SIGN_EXT)) {
+ FAIL_IF(push_inst(compiler, RLDI(TMP_REG2, src2, 32, 31, 1)));
+ FAIL_IF(push_inst(compiler, NEG | OE(ALT_SET_FLAGS) | RC(ALT_SET_FLAGS) | D(dst) | A(TMP_REG2)));
+ return push_inst(compiler, RLDI(dst, dst, 32, 32, 0));
+ }
+
UN_EXTS();
- return push_inst(compiler, NEG | OERC(flags) | D(dst) | A(src2));
+ /* Setting XER SO is not enough, CR SO is also needed. */
+ return push_inst(compiler, NEG | OE((flags & ALT_FORM1) ? ALT_SET_FLAGS : 0) | RC(flags) | D(dst) | A(src2));
case SLJIT_CLZ:
SLJIT_ASSERT(src1 == TMP_REG1);
if (flags & ALT_FORM1)
- return push_inst(compiler, CNTLZW | RC(flags) | S(src2) | A(dst));
- return push_inst(compiler, CNTLZD | RC(flags) | S(src2) | A(dst));
+ return push_inst(compiler, CNTLZW | S(src2) | A(dst));
+ return push_inst(compiler, CNTLZD | S(src2) | A(dst));
case SLJIT_ADD:
if (flags & ALT_FORM1) {
- /* Flags does not set: BIN_IMM_EXTS unnecessary. */
- SLJIT_ASSERT(src2 == TMP_REG2);
- return push_inst(compiler, ADDI | D(dst) | A(src1) | compiler->imm);
+ if (flags & ALT_SIGN_EXT) {
+ FAIL_IF(push_inst(compiler, RLDI(TMP_REG1, src1, 32, 31, 1)));
+ src1 = TMP_REG1;
+ FAIL_IF(push_inst(compiler, RLDI(TMP_REG2, src2, 32, 31, 1)));
+ src2 = TMP_REG2;
+ }
+ /* Setting XER SO is not enough, CR SO is also needed. */
+ FAIL_IF(push_inst(compiler, ADD | OE(ALT_SET_FLAGS) | RC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2)));
+ if (flags & ALT_SIGN_EXT)
+ return push_inst(compiler, RLDI(dst, dst, 32, 32, 0));
+ return SLJIT_SUCCESS;
}
+
if (flags & ALT_FORM2) {
/* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
- return push_inst(compiler, ADDIS | D(dst) | A(src1) | compiler->imm);
+
+ if (flags & ALT_FORM3)
+ return push_inst(compiler, ADDIS | D(dst) | A(src1) | compiler->imm);
+
+ if (flags & ALT_FORM4) {
+ FAIL_IF(push_inst(compiler, ADDIS | D(dst) | A(src1) | (((compiler->imm >> 16) & 0xffff) + ((compiler->imm >> 15) & 0x1))));
+ src1 = dst;
+ }
+
+ return push_inst(compiler, ADDI | D(dst) | A(src1) | (compiler->imm & 0xffff));
}
if (flags & ALT_FORM3) {
SLJIT_ASSERT(src2 == TMP_REG2);
BIN_IMM_EXTS();
return push_inst(compiler, ADDIC | D(dst) | A(src1) | compiler->imm);
}
- if (flags & ALT_FORM4) {
- /* Flags does not set: BIN_IMM_EXTS unnecessary. */
- FAIL_IF(push_inst(compiler, ADDI | D(dst) | A(src1) | (compiler->imm & 0xffff)));
- return push_inst(compiler, ADDIS | D(dst) | A(dst) | (((compiler->imm >> 16) & 0xffff) + ((compiler->imm >> 15) & 0x1)));
- }
if (!(flags & ALT_SET_FLAGS))
return push_inst(compiler, ADD | D(dst) | A(src1) | B(src2));
BIN_EXTS();
- return push_inst(compiler, ADDC | OERC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
+ if (flags & ALT_FORM4)
+ return push_inst(compiler, ADDC | RC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
+ return push_inst(compiler, ADD | RC(flags) | D(dst) | A(src1) | B(src2));
case SLJIT_ADDC:
- if (flags & ALT_FORM1) {
- FAIL_IF(push_inst(compiler, MFXER | D(0)));
- FAIL_IF(push_inst(compiler, ADDE | D(dst) | A(src1) | B(src2)));
- return push_inst(compiler, MTXER | S(0));
- }
BIN_EXTS();
return push_inst(compiler, ADDE | D(dst) | A(src1) | B(src2));
case SLJIT_SUB:
if (flags & ALT_FORM1) {
+ if (flags & ALT_FORM2) {
+ FAIL_IF(push_inst(compiler, CMPLI | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | compiler->imm));
+ if (!(flags & ALT_FORM3))
+ return SLJIT_SUCCESS;
+ return push_inst(compiler, ADDI | D(dst) | A(src1) | (-compiler->imm & 0xffff));
+ }
+ FAIL_IF(push_inst(compiler, CMPL | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2)));
+ if (!(flags & ALT_FORM3))
+ return SLJIT_SUCCESS;
+ return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
+ }
+
+ if (flags & ALT_FORM2) {
+ if (flags & ALT_SIGN_EXT) {
+ FAIL_IF(push_inst(compiler, RLDI(TMP_REG1, src1, 32, 31, 1)));
+ src1 = TMP_REG1;
+ FAIL_IF(push_inst(compiler, RLDI(TMP_REG2, src2, 32, 31, 1)));
+ src2 = TMP_REG2;
+ }
+ /* Setting XER SO is not enough, CR SO is also needed. */
+ FAIL_IF(push_inst(compiler, SUBF | OE(ALT_SET_FLAGS) | RC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1)));
+ if (flags & ALT_SIGN_EXT)
+ return push_inst(compiler, RLDI(dst, dst, 32, 32, 0));
+ return SLJIT_SUCCESS;
+ }
+
+ if (flags & ALT_FORM3) {
/* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, SUBFIC | D(dst) | A(src1) | compiler->imm);
}
- if (flags & (ALT_FORM2 | ALT_FORM3)) {
- SLJIT_ASSERT(src2 == TMP_REG2);
- if (flags & ALT_FORM2)
- FAIL_IF(push_inst(compiler, CMPI | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | compiler->imm));
- if (flags & ALT_FORM3)
- return push_inst(compiler, CMPLI | CRD(4 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | compiler->imm);
- return SLJIT_SUCCESS;
- }
- if (flags & (ALT_FORM4 | ALT_FORM5)) {
- if (flags & ALT_FORM4)
- FAIL_IF(push_inst(compiler, CMPL | CRD(4 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2)));
- if (flags & ALT_FORM5)
- return push_inst(compiler, CMP | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2));
- return SLJIT_SUCCESS;
+
+ if (flags & ALT_FORM4) {
+ if (flags & ALT_FORM5) {
+ SLJIT_ASSERT(src2 == TMP_REG2);
+ return push_inst(compiler, CMPI | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | compiler->imm);
+ }
+ return push_inst(compiler, CMP | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2));
}
+
if (!(flags & ALT_SET_FLAGS))
return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
BIN_EXTS();
- if (flags & ALT_FORM6)
- FAIL_IF(push_inst(compiler, CMPL | CRD(4 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2)));
- return push_inst(compiler, SUBFC | OERC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));
+ if (flags & ALT_FORM5)
+ return push_inst(compiler, SUBFC | RC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));
+ return push_inst(compiler, SUBF | RC(flags) | D(dst) | A(src2) | B(src1));
case SLJIT_SUBC:
- if (flags & ALT_FORM1) {
- FAIL_IF(push_inst(compiler, MFXER | D(0)));
- FAIL_IF(push_inst(compiler, SUBFE | D(dst) | A(src2) | B(src1)));
- return push_inst(compiler, MTXER | S(0));
- }
BIN_EXTS();
return push_inst(compiler, SUBFE | D(dst) | A(src2) | B(src1));
@@ -292,8 +326,8 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
}
BIN_EXTS();
if (flags & ALT_FORM2)
- return push_inst(compiler, MULLW | OERC(flags) | D(dst) | A(src2) | B(src1));
- return push_inst(compiler, MULLD | OERC(flags) | D(dst) | A(src2) | B(src1));
+ return push_inst(compiler, MULLW | OE(flags) | RC(flags) | D(dst) | A(src2) | B(src1));
+ return push_inst(compiler, MULLD | OE(flags) | RC(flags) | D(dst) | A(src2) | B(src1));
case SLJIT_AND:
if (flags & ALT_FORM1) {
@@ -345,10 +379,8 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
compiler->imm &= 0x1f;
return push_inst(compiler, RLWINM | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11) | ((31 - compiler->imm) << 1));
}
- else {
- compiler->imm &= 0x3f;
- return push_inst(compiler, RLDI(dst, src1, compiler->imm, 63 - compiler->imm, 1) | RC(flags));
- }
+ compiler->imm &= 0x3f;
+ return push_inst(compiler, RLDI(dst, src1, compiler->imm, 63 - compiler->imm, 1) | RC(flags));
}
return push_inst(compiler, ((flags & ALT_FORM2) ? SLW : SLD) | RC(flags) | S(src1) | A(dst) | B(src2));
@@ -359,33 +391,25 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
compiler->imm &= 0x1f;
return push_inst(compiler, RLWINM | RC(flags) | S(src1) | A(dst) | (((32 - compiler->imm) & 0x1f) << 11) | (compiler->imm << 6) | (31 << 1));
}
- else {
- compiler->imm &= 0x3f;
- return push_inst(compiler, RLDI(dst, src1, 64 - compiler->imm, compiler->imm, 0) | RC(flags));
- }
+ compiler->imm &= 0x3f;
+ return push_inst(compiler, RLDI(dst, src1, 64 - compiler->imm, compiler->imm, 0) | RC(flags));
}
return push_inst(compiler, ((flags & ALT_FORM2) ? SRW : SRD) | RC(flags) | S(src1) | A(dst) | B(src2));
case SLJIT_ASHR:
- if (flags & ALT_FORM3)
- FAIL_IF(push_inst(compiler, MFXER | D(0)));
if (flags & ALT_FORM1) {
SLJIT_ASSERT(src2 == TMP_REG2);
if (flags & ALT_FORM2) {
compiler->imm &= 0x1f;
- FAIL_IF(push_inst(compiler, SRAWI | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11)));
- }
- else {
- compiler->imm &= 0x3f;
- FAIL_IF(push_inst(compiler, SRADI | RC(flags) | S(src1) | A(dst) | ((compiler->imm & 0x1f) << 11) | ((compiler->imm & 0x20) >> 4)));
+ return push_inst(compiler, SRAWI | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11));
}
+ compiler->imm &= 0x3f;
+ return push_inst(compiler, SRADI | RC(flags) | S(src1) | A(dst) | ((compiler->imm & 0x1f) << 11) | ((compiler->imm & 0x20) >> 4));
}
- else
- FAIL_IF(push_inst(compiler, ((flags & ALT_FORM2) ? SRAW : SRAD) | RC(flags) | S(src1) | A(dst) | B(src2)));
- return (flags & ALT_FORM3) ? push_inst(compiler, MTXER | S(0)) : SLJIT_SUCCESS;
+ return push_inst(compiler, ((flags & ALT_FORM2) ? SRAW : SRAD) | RC(flags) | S(src1) | A(dst) | B(src2));
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -398,18 +422,19 @@ static SLJIT_INLINE sljit_s32 emit_const(struct sljit_compiler *compiler, sljit_
return push_inst(compiler, ORI | S(reg) | A(reg) | IMM(init_value));
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
sljit_ins *inst = (sljit_ins*)addr;
- inst[0] = (inst[0] & 0xffff0000) | ((new_addr >> 48) & 0xffff);
- inst[1] = (inst[1] & 0xffff0000) | ((new_addr >> 32) & 0xffff);
- inst[3] = (inst[3] & 0xffff0000) | ((new_addr >> 16) & 0xffff);
- inst[4] = (inst[4] & 0xffff0000) | (new_addr & 0xffff);
+ inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 48) & 0xffff);
+ inst[1] = (inst[1] & 0xffff0000) | ((new_target >> 32) & 0xffff);
+ inst[3] = (inst[3] & 0xffff0000) | ((new_target >> 16) & 0xffff);
+ inst[4] = (inst[4] & 0xffff0000) | (new_target & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 5);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
sljit_ins *inst = (sljit_ins*)addr;
@@ -417,5 +442,6 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
inst[1] = (inst[1] & 0xffff0000) | ((new_constant >> 32) & 0xffff);
inst[3] = (inst[3] & 0xffff0000) | ((new_constant >> 16) & 0xffff);
inst[4] = (inst[4] & 0xffff0000) | (new_constant & 0xffff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 5);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativePPC_common.c b/src/3rdparty/pcre2/src/sljit/sljitNativePPC_common.c
index a3647327bf..2bf855c6bc 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativePPC_common.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativePPC_common.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -127,9 +127,9 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 7] = {
/* Instruction bit sections.
OE and Rc flag (see ALT_SET_FLAGS). */
-#define OERC(flags) (((flags & ALT_SET_FLAGS) >> 10) | (flags & ALT_SET_FLAGS))
+#define OE(flags) ((flags) & ALT_SET_FLAGS)
/* Rc flag (see ALT_SET_FLAGS). */
-#define RC(flags) ((flags & ALT_SET_FLAGS) >> 10)
+#define RC(flags) (((flags) & ALT_SET_FLAGS) >> 10)
#define HI(opcode) ((opcode) << 26)
#define LO(opcode) ((opcode) << 1)
@@ -154,6 +154,7 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 7] = {
#define CMPL (HI(31) | LO(32))
#define CMPLI (HI(10))
#define CROR (HI(19) | LO(449))
+#define DCBT (HI(31) | LO(278))
#define DIVD (HI(31) | LO(489))
#define DIVDU (HI(31) | LO(457))
#define DIVW (HI(31) | LO(491))
@@ -249,7 +250,7 @@ static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins)
return SLJIT_SUCCESS;
}
-static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code)
+static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
{
sljit_sw diff;
sljit_uw target_addr;
@@ -267,7 +268,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_in
target_addr = jump->u.target;
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
- target_addr = (sljit_uw)(code + jump->u.label->size);
+ target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset;
}
#if (defined SLJIT_PASS_ENTRY_ADDR_TO_CALL && SLJIT_PASS_ENTRY_ADDR_TO_CALL) && (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
@@ -275,7 +276,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_in
goto keep_address;
#endif
- diff = ((sljit_sw)target_addr - (sljit_sw)(code_ptr)) & ~0x3l;
+ diff = ((sljit_sw)target_addr - (sljit_sw)(code_ptr) - executable_offset) & ~0x3l;
extra_jump_flags = 0;
if (jump->flags & IS_COND) {
@@ -296,6 +297,7 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_in
jump->flags |= PATCH_B | extra_jump_flags;
return 1;
}
+
if (target_addr <= 0x03ffffff) {
jump->flags |= PATCH_B | PATCH_ABS_B | extra_jump_flags;
return 1;
@@ -309,6 +311,7 @@ keep_address:
jump->flags |= PATCH_ABS32;
return 1;
}
+
if (target_addr <= 0x7fffffffffffl) {
jump->flags |= PATCH_ABS48;
return 1;
@@ -326,6 +329,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_ins *buf_ptr;
sljit_ins *buf_end;
sljit_uw word_count;
+ sljit_sw executable_offset;
sljit_uw addr;
struct sljit_label *label;
@@ -349,9 +353,12 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
code_ptr = code;
word_count = 0;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
+
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
+
do {
buf_ptr = (sljit_ins*)buf->memory;
buf_end = buf_ptr + (buf->used_size >> 2);
@@ -363,7 +370,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
/* These structures are ordered by their address. */
if (label && label->size == word_count) {
/* Just recording the address. */
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -373,7 +380,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
#else
jump->addr = (sljit_uw)(code_ptr - 6);
#endif
- if (detect_jump_type(jump, code_ptr, code)) {
+ if (detect_jump_type(jump, code_ptr, code, executable_offset)) {
#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
code_ptr[-3] = code_ptr[0];
code_ptr -= 3;
@@ -420,7 +427,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
} while (buf);
if (label && label->size == word_count) {
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -438,11 +445,12 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
while (jump) {
do {
addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target;
- buf_ptr = (sljit_ins*)jump->addr;
+ buf_ptr = (sljit_ins *)jump->addr;
+
if (jump->flags & PATCH_B) {
if (jump->flags & IS_COND) {
if (!(jump->flags & PATCH_ABS_B)) {
- addr = addr - jump->addr;
+ addr -= (sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset);
SLJIT_ASSERT((sljit_sw)addr <= 0x7fff && (sljit_sw)addr >= -0x8000);
*buf_ptr = BCx | (addr & 0xfffc) | ((*buf_ptr) & 0x03ff0001);
}
@@ -453,7 +461,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
}
else {
if (!(jump->flags & PATCH_ABS_B)) {
- addr = addr - jump->addr;
+ addr -= (sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset);
SLJIT_ASSERT((sljit_sw)addr <= 0x01ffffff && (sljit_sw)addr >= -0x02000000);
*buf_ptr = Bx | (addr & 0x03fffffc) | ((*buf_ptr) & 0x1);
}
@@ -464,6 +472,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
}
break;
}
+
/* Set the fields of immediate loads. */
#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
buf_ptr[0] = (buf_ptr[0] & 0xffff0000) | ((addr >> 16) & 0xffff);
@@ -492,22 +501,48 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
}
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
- SLJIT_CACHE_FLUSH(code, code_ptr);
+
+ code = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
#if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
if (((sljit_sw)code_ptr) & 0x4)
code_ptr++;
+#endif
sljit_set_function_context(NULL, (struct sljit_function_context*)code_ptr, (sljit_sw)code, (void*)sljit_generate_code);
+#endif
+
+ code_ptr = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+
+ SLJIT_CACHE_FLUSH(code, code_ptr);
+
+#if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
return code_ptr;
#else
- sljit_set_function_context(NULL, (struct sljit_function_context*)code_ptr, (sljit_sw)code, (void*)sljit_generate_code);
- return code_ptr;
+ return code;
#endif
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
#else
- return code;
+ /* Available by default. */
+ return 1;
#endif
+
+ case SLJIT_HAS_PRE_UPDATE:
+ case SLJIT_HAS_CLZ:
+ return 1;
+
+ default:
+ return 0;
+ }
}
/* --------------------------------------------------------------------- */
@@ -544,7 +579,6 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
#define ALT_FORM3 0x040000
#define ALT_FORM4 0x080000
#define ALT_FORM5 0x100000
-#define ALT_FORM6 0x200000
/* Source and destination is register. */
#define REG_DEST 0x000001
@@ -559,7 +593,7 @@ ALT_SIGN_EXT 0x000200
ALT_SET_FLAGS 0x000400
ALT_FORM1 0x010000
...
-ALT_FORM6 0x200000 */
+ALT_FORM5 0x100000 */
#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
#include "sljitNativePPC_32.c"
@@ -726,7 +760,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
(((inst) & ~(INT_ALIGNED | UPDATE_REQ)) | (((flags) & MEM_MASK) <= GPR_REG ? D(reg) : FD(reg)))
#endif
-static const sljit_ins data_transfer_insts[64 + 8] = {
+static const sljit_ins data_transfer_insts[64 + 16] = {
/* -------- Unsigned -------- */
@@ -835,11 +869,20 @@ static const sljit_ins data_transfer_insts[64 + 8] = {
/* d n x s */ HI(31) | LO(727) /* stfdx */,
/* d n x l */ HI(31) | LO(599) /* lfdx */,
+/* d w i s */ HI(55) /* stfdu */,
+/* d w i l */ HI(51) /* lfdu */,
+/* d w x s */ HI(31) | LO(759) /* stfdux */,
+/* d w x l */ HI(31) | LO(631) /* lfdux */,
+
/* s n i s */ HI(52) /* stfs */,
/* s n i l */ HI(48) /* lfs */,
/* s n x s */ HI(31) | LO(663) /* stfsx */,
/* s n x l */ HI(31) | LO(535) /* lfsx */,
+/* s w i s */ HI(53) /* stfsu */,
+/* s w i l */ HI(49) /* lfsu */,
+/* s w x s */ HI(31) | LO(695) /* stfsux */,
+/* s w x l */ HI(31) | LO(567) /* lfsux */,
};
#undef ARCH_32_64
@@ -850,7 +893,7 @@ static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_s32 inp_
sljit_ins inst;
/* Should work when (arg & REG_MASK) == 0. */
- SLJIT_COMPILE_ASSERT(A(0) == 0, a0_must_be_0);
+ SLJIT_ASSERT(A(0) == 0);
SLJIT_ASSERT(arg & SLJIT_MEM);
if (arg & OFFS_REG_MASK) {
@@ -1005,10 +1048,6 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 inp_flags
#endif
if (inp_flags & WRITE_BACK) {
- if (arg == reg) {
- FAIL_IF(push_inst(compiler, OR | S(reg) | A(tmp_r) | B(reg)));
- reg = tmp_r;
- }
tmp_r = arg;
FAIL_IF(push_inst(compiler, ADDIS | D(arg) | A(arg) | IMM(high_short >> 16)));
}
@@ -1131,7 +1170,7 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
sljit_s32 src1_r;
sljit_s32 src2_r;
sljit_s32 sugg_src2_r = TMP_REG2;
- sljit_s32 flags = input_flags & (ALT_FORM1 | ALT_FORM2 | ALT_FORM3 | ALT_FORM4 | ALT_FORM5 | ALT_FORM6 | ALT_SIGN_EXT | ALT_SET_FLAGS);
+ sljit_s32 flags = input_flags & (ALT_FORM1 | ALT_FORM2 | ALT_FORM3 | ALT_FORM4 | ALT_FORM5 | ALT_SIGN_EXT | ALT_SET_FLAGS);
if (!(input_flags & ALT_KEEP_CACHE)) {
compiler->cache_arg = 0;
@@ -1140,8 +1179,6 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
/* Destination check. */
if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED)) {
- if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32 && !(src2 & SLJIT_MEM))
- return SLJIT_SUCCESS;
dst_r = TMP_REG2;
}
else if (FAST_IS_REG(dst)) {
@@ -1294,6 +1331,31 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
return SLJIT_SUCCESS;
}
+static sljit_s32 emit_prefetch(struct sljit_compiler *compiler,
+ sljit_s32 src, sljit_sw srcw)
+{
+ if (!(src & OFFS_REG_MASK)) {
+ if (srcw == 0 && (src & REG_MASK) != SLJIT_UNUSED)
+ return push_inst(compiler, DCBT | A(0) | B(src & REG_MASK));
+
+ FAIL_IF(load_immediate(compiler, TMP_REG1, srcw));
+ /* Works with SLJIT_MEM0() case as well. */
+ return push_inst(compiler, DCBT | A(src & REG_MASK) | B(TMP_REG1));
+ }
+
+ srcw &= 0x3;
+
+ if (srcw == 0)
+ return push_inst(compiler, DCBT | A(src & REG_MASK) | B(OFFS_REG(src)));
+
+#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
+ FAIL_IF(push_inst(compiler, RLWINM | S(OFFS_REG(src)) | A(TMP_REG1) | (srcw << 11) | ((31 - srcw) << 1)));
+#else
+ FAIL_IF(push_inst(compiler, RLDI(TMP_REG1, OFFS_REG(src), srcw, 63 - srcw, 1)));
+#endif
+ return push_inst(compiler, DCBT | A(src & REG_MASK) | B(TMP_REG1));
+}
+
#define EMIT_MOV(type, type_flags, type_cast) \
emit_op(compiler, (src & SLJIT_IMM) ? SLJIT_MOV : type, flags | (type_flags), dst, dstw, TMP_REG1, 0, src, (src & SLJIT_IMM) ? type_cast srcw : srcw)
@@ -1301,7 +1363,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
- sljit_s32 flags = GET_FLAGS(op) ? ALT_SET_FLAGS : 0;
+ sljit_s32 flags = HAS_FLAGS(op) ? ALT_SET_FLAGS : 0;
sljit_s32 op_flags = GET_ALL_FLAGS(op);
CHECK_ERROR();
@@ -1309,11 +1371,18 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(dst, dstw);
ADJUST_LOCAL_OFFSET(src, srcw);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op)) {
+ if (op <= SLJIT_MOV_P && (src & SLJIT_MEM))
+ return emit_prefetch(compiler, src, srcw);
+
+ return SLJIT_SUCCESS;
+ }
+
op = GET_OPCODE(op);
if ((src & SLJIT_IMM) && srcw == 0)
src = TMP_ZERO;
- if (op_flags & SLJIT_SET_O)
+ if (GET_FLAG_TYPE(op_flags) == SLJIT_OVERFLOW)
FAIL_IF(push_inst(compiler, MTXER | S(TMP_ZERO)));
if (op_flags & SLJIT_I32_OP) {
@@ -1339,6 +1408,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
flags |= INT_DATA | SIGNED_DATA;
if (src & SLJIT_IMM)
srcw = (sljit_s32)srcw;
+ if (HAS_FLAGS(op_flags))
+ flags |= ALT_SIGN_EXT;
}
#endif
}
@@ -1404,7 +1475,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
return emit_op(compiler, SLJIT_NOT, flags, dst, dstw, TMP_REG1, 0, src, srcw);
case SLJIT_NEG:
- return emit_op(compiler, SLJIT_NEG, flags, dst, dstw, TMP_REG1, 0, src, srcw);
+ return emit_op(compiler, SLJIT_NEG, flags | (GET_FLAG_TYPE(op_flags) ? ALT_FORM1 : 0), dst, dstw, TMP_REG1, 0, src, srcw);
case SLJIT_CLZ:
#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
@@ -1457,7 +1528,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
- sljit_s32 flags = GET_FLAGS(op) ? ALT_SET_FLAGS : 0;
+ sljit_s32 flags = HAS_FLAGS(op) ? ALT_SET_FLAGS : 0;
CHECK_ERROR();
CHECK(check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w));
@@ -1465,6 +1536,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
+
if ((src1 & SLJIT_IMM) && src1w == 0)
src1 = TMP_ZERO;
if ((src2 & SLJIT_IMM) && src2w == 0)
@@ -1478,45 +1552,48 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
src1w = (sljit_s32)(src1w);
if (src2 & SLJIT_IMM)
src2w = (sljit_s32)(src2w);
- if (GET_FLAGS(op))
+ if (HAS_FLAGS(op))
flags |= ALT_SIGN_EXT;
}
#endif
- if (op & SLJIT_SET_O)
+ if (GET_FLAG_TYPE(op) == SLJIT_OVERFLOW)
FAIL_IF(push_inst(compiler, MTXER | S(TMP_ZERO)));
if (src2 == TMP_REG2)
flags |= ALT_KEEP_CACHE;
switch (GET_OPCODE(op)) {
case SLJIT_ADD:
- if (!GET_FLAGS(op) && ((src1 | src2) & SLJIT_IMM)) {
+ if (GET_FLAG_TYPE(op) == SLJIT_OVERFLOW)
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM1, dst, dstw, src1, src1w, src2, src2w);
+
+ if (!HAS_FLAGS(op) && ((src1 | src2) & SLJIT_IMM)) {
if (TEST_SL_IMM(src2, src2w)) {
compiler->imm = src2w & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0);
}
if (TEST_SL_IMM(src1, src1w)) {
compiler->imm = src1w & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM1, dst, dstw, src2, src2w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src2, src2w, TMP_REG2, 0);
}
if (TEST_SH_IMM(src2, src2w)) {
compiler->imm = (src2w >> 16) & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
}
if (TEST_SH_IMM(src1, src1w)) {
compiler->imm = (src1w >> 16) & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src2, src2w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src2, src2w, TMP_REG2, 0);
}
/* Range between -1 and -32768 is covered above. */
if (TEST_ADD_IMM(src2, src2w)) {
compiler->imm = src2w & 0xffffffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM4, dst, dstw, src1, src1w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src1, src1w, TMP_REG2, 0);
}
if (TEST_ADD_IMM(src1, src1w)) {
compiler->imm = src1w & 0xffffffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM4, dst, dstw, src2, src2w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src2, src2w, TMP_REG2, 0);
}
}
- if (!(GET_FLAGS(op) & (SLJIT_SET_E | SLJIT_SET_O))) {
+ if (HAS_FLAGS(op)) {
if (TEST_SL_IMM(src2, src2w)) {
compiler->imm = src2w & 0xffff;
return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
@@ -1526,75 +1603,75 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM3, dst, dstw, src2, src2w, TMP_REG2, 0);
}
}
- return emit_op(compiler, SLJIT_ADD, flags, dst, dstw, src1, src1w, src2, src2w);
+ return emit_op(compiler, SLJIT_ADD, flags | ((GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY)) ? ALT_FORM4 : 0), dst, dstw, src1, src1w, src2, src2w);
case SLJIT_ADDC:
- return emit_op(compiler, SLJIT_ADDC, flags | (!(op & SLJIT_KEEP_FLAGS) ? 0 : ALT_FORM1), dst, dstw, src1, src1w, src2, src2w);
+ return emit_op(compiler, SLJIT_ADDC, flags, dst, dstw, src1, src1w, src2, src2w);
case SLJIT_SUB:
- if (!GET_FLAGS(op) && ((src1 | src2) & SLJIT_IMM)) {
+ if (GET_FLAG_TYPE(op) >= SLJIT_LESS && GET_FLAG_TYPE(op) <= SLJIT_LESS_EQUAL) {
+ if (dst == SLJIT_UNUSED) {
+ if (TEST_UL_IMM(src2, src2w)) {
+ compiler->imm = src2w & 0xffff;
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1 | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0);
+ }
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1, dst, dstw, src1, src1w, src2, src2w);
+ }
+
+ if ((src2 & SLJIT_IMM) && src2w >= 0 && src2w <= (SIMM_MAX + 1)) {
+ compiler->imm = src2w;
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1 | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
+ }
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1 | ALT_FORM3, dst, dstw, src1, src1w, src2, src2w);
+ }
+
+ if (GET_FLAG_TYPE(op) == SLJIT_OVERFLOW)
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2, dst, dstw, src1, src1w, src2, src2w);
+
+ if (!HAS_FLAGS(op) && ((src1 | src2) & SLJIT_IMM)) {
if (TEST_SL_IMM(src2, -src2w)) {
compiler->imm = (-src2w) & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0);
}
if (TEST_SL_IMM(src1, src1w)) {
compiler->imm = src1w & 0xffff;
- return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1, dst, dstw, src2, src2w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM3, dst, dstw, src2, src2w, TMP_REG2, 0);
}
if (TEST_SH_IMM(src2, -src2w)) {
compiler->imm = ((-src2w) >> 16) & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
}
/* Range between -1 and -32768 is covered above. */
if (TEST_ADD_IMM(src2, -src2w)) {
compiler->imm = -src2w & 0xffffffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM4, dst, dstw, src1, src1w, TMP_REG2, 0);
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src1, src1w, TMP_REG2, 0);
}
}
- if (dst == SLJIT_UNUSED && (op & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S)) && !(op & (SLJIT_SET_O | SLJIT_SET_C))) {
- if (!(op & SLJIT_SET_U)) {
- /* We know ALT_SIGN_EXT is set if it is an SLJIT_I32_OP on 64 bit systems. */
- if (TEST_SL_IMM(src2, src2w)) {
- compiler->imm = src2w & 0xffff;
- return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0);
- }
- if (GET_FLAGS(op) == SLJIT_SET_E && TEST_SL_IMM(src1, src1w)) {
- compiler->imm = src1w & 0xffff;
- return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2, dst, dstw, src2, src2w, TMP_REG2, 0);
- }
- }
- if (!(op & (SLJIT_SET_E | SLJIT_SET_S))) {
- /* We know ALT_SIGN_EXT is set if it is an SLJIT_I32_OP on 64 bit systems. */
- if (TEST_UL_IMM(src2, src2w)) {
- compiler->imm = src2w & 0xffff;
- return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
- }
- return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM4, dst, dstw, src1, src1w, src2, src2w);
- }
- if ((src2 & SLJIT_IMM) && src2w >= 0 && src2w <= 0x7fff) {
- compiler->imm = src2w;
- return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
+
+ if (dst == SLJIT_UNUSED && GET_FLAG_TYPE(op) != GET_FLAG_TYPE(SLJIT_SET_CARRY)) {
+ if (TEST_SL_IMM(src2, src2w)) {
+ compiler->imm = src2w & 0xffff;
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM4 | ALT_FORM5, dst, dstw, src1, src1w, TMP_REG2, 0);
}
- return emit_op(compiler, SLJIT_SUB, flags | ((op & SLJIT_SET_U) ? ALT_FORM4 : 0) | ((op & (SLJIT_SET_E | SLJIT_SET_S)) ? ALT_FORM5 : 0), dst, dstw, src1, src1w, src2, src2w);
+ return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM4, dst, dstw, src1, src1w, src2, src2w);
}
- if (!(op & (SLJIT_SET_E | SLJIT_SET_U | SLJIT_SET_S | SLJIT_SET_O))) {
- if (TEST_SL_IMM(src2, -src2w)) {
- compiler->imm = (-src2w) & 0xffff;
- return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
- }
+
+ if (TEST_SL_IMM(src2, -src2w)) {
+ compiler->imm = (-src2w) & 0xffff;
+ return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
}
/* We know ALT_SIGN_EXT is set if it is an SLJIT_I32_OP on 64 bit systems. */
- return emit_op(compiler, SLJIT_SUB, flags | (!(op & SLJIT_SET_U) ? 0 : ALT_FORM6), dst, dstw, src1, src1w, src2, src2w);
+ return emit_op(compiler, SLJIT_SUB, flags | ((GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY)) ? ALT_FORM5 : 0), dst, dstw, src1, src1w, src2, src2w);
case SLJIT_SUBC:
- return emit_op(compiler, SLJIT_SUBC, flags | (!(op & SLJIT_KEEP_FLAGS) ? 0 : ALT_FORM1), dst, dstw, src1, src1w, src2, src2w);
+ return emit_op(compiler, SLJIT_SUBC, flags, dst, dstw, src1, src1w, src2, src2w);
case SLJIT_MUL:
#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
if (op & SLJIT_I32_OP)
flags |= ALT_FORM2;
#endif
- if (!GET_FLAGS(op)) {
+ if (!HAS_FLAGS(op)) {
if (TEST_SL_IMM(src2, src2w)) {
compiler->imm = src2w & 0xffff;
return emit_op(compiler, SLJIT_MUL, flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0);
@@ -1604,13 +1681,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
return emit_op(compiler, SLJIT_MUL, flags | ALT_FORM1, dst, dstw, src2, src2w, TMP_REG2, 0);
}
}
+ else
+ FAIL_IF(push_inst(compiler, MTXER | S(TMP_ZERO)));
return emit_op(compiler, SLJIT_MUL, flags, dst, dstw, src1, src1w, src2, src2w);
case SLJIT_AND:
case SLJIT_OR:
case SLJIT_XOR:
/* Commutative unsigned operations. */
- if (!GET_FLAGS(op) || GET_OPCODE(op) == SLJIT_AND) {
+ if (!HAS_FLAGS(op) || GET_OPCODE(op) == SLJIT_AND) {
if (TEST_UL_IMM(src2, src2w)) {
compiler->imm = src2w;
return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0);
@@ -1628,7 +1707,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM2, dst, dstw, src2, src2w, TMP_REG2, 0);
}
}
- if (!GET_FLAGS(op) && GET_OPCODE(op) != SLJIT_AND) {
+ if (GET_OPCODE(op) != SLJIT_AND && GET_OPCODE(op) != SLJIT_AND) {
+ /* Unlike or and xor, and resets unwanted bits as well. */
if (TEST_UI_IMM(src2, src2w)) {
compiler->imm = src2w;
return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0);
@@ -1640,12 +1720,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
}
return emit_op(compiler, GET_OPCODE(op), flags, dst, dstw, src1, src1w, src2, src2w);
- case SLJIT_ASHR:
- if (op & SLJIT_KEEP_FLAGS)
- flags |= ALT_FORM3;
- /* Fall through. */
case SLJIT_SHL:
case SLJIT_LSHR:
+ case SLJIT_ASHR:
#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
if (op & SLJIT_I32_OP)
flags |= ALT_FORM2;
@@ -1685,17 +1762,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#else
- /* Available by default. */
- return 1;
-#endif
-}
-
-#define FLOAT_DATA(op) (DOUBLE_DATA | ((op & SLJIT_F32_OP) >> 6))
+#define FLOAT_DATA(op) (DOUBLE_DATA | ((op & SLJIT_F32_OP) >> 5))
#define SELECT_FOP(op, single, double) ((op & SLJIT_F32_OP) ? single : double)
#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
@@ -1727,9 +1794,6 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
op = GET_OPCODE(op);
FAIL_IF(push_inst(compiler, (op == SLJIT_CONV_S32_FROM_F64 ? FCTIWZ : FCTIDZ) | FD(TMP_FREG1) | FB(src)));
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (op == SLJIT_CONV_SW_FROM_F64) {
if (FAST_IS_REG(dst)) {
FAIL_IF(emit_op_mem2(compiler, DOUBLE_DATA, TMP_FREG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET, 0, 0));
@@ -1737,12 +1801,8 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
}
return emit_op_mem2(compiler, DOUBLE_DATA, TMP_FREG1, dst, dstw, 0, 0);
}
-
#else
FAIL_IF(push_inst(compiler, FCTIWZ | FD(TMP_FREG1) | FB(src)));
-
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
#endif
if (FAST_IS_REG(dst)) {
@@ -2019,10 +2079,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
- /* For UNUSED dst. Uncommon, but possible. */
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst(compiler, MFLR | D(dst));
@@ -2079,33 +2135,33 @@ static sljit_ins get_bo_bi_flags(sljit_s32 type)
return (4 << 21) | (2 << 16);
case SLJIT_LESS:
- case SLJIT_LESS_F64:
- return (12 << 21) | ((4 + 0) << 16);
-
- case SLJIT_GREATER_EQUAL:
- case SLJIT_GREATER_EQUAL_F64:
- return (4 << 21) | ((4 + 0) << 16);
-
- case SLJIT_GREATER:
- case SLJIT_GREATER_F64:
- return (12 << 21) | ((4 + 1) << 16);
-
- case SLJIT_LESS_EQUAL:
- case SLJIT_LESS_EQUAL_F64:
- return (4 << 21) | ((4 + 1) << 16);
-
case SLJIT_SIG_LESS:
return (12 << 21) | (0 << 16);
+ case SLJIT_GREATER_EQUAL:
case SLJIT_SIG_GREATER_EQUAL:
return (4 << 21) | (0 << 16);
+ case SLJIT_GREATER:
case SLJIT_SIG_GREATER:
return (12 << 21) | (1 << 16);
+ case SLJIT_LESS_EQUAL:
case SLJIT_SIG_LESS_EQUAL:
return (4 << 21) | (1 << 16);
+ case SLJIT_LESS_F64:
+ return (12 << 21) | ((4 + 0) << 16);
+
+ case SLJIT_GREATER_EQUAL_F64:
+ return (4 << 21) | ((4 + 0) << 16);
+
+ case SLJIT_GREATER_F64:
+ return (12 << 21) | ((4 + 1) << 16);
+
+ case SLJIT_LESS_EQUAL_F64:
+ return (4 << 21) | ((4 + 1) << 16);
+
case SLJIT_OVERFLOW:
case SLJIT_MUL_OVERFLOW:
return (12 << 21) | (3 << 16);
@@ -2207,153 +2263,147 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
return push_inst(compiler, BCCTR | (20 << 21) | (type >= SLJIT_FAST_CALL ? 1 : 0));
}
-/* Get a bit from CR, all other bits are zeroed. */
-#define GET_CR_BIT(bit, dst) \
- FAIL_IF(push_inst(compiler, MFCR | D(dst))); \
- FAIL_IF(push_inst(compiler, RLWINM | S(dst) | A(dst) | ((1 + (bit)) << 11) | (31 << 6) | (31 << 1)));
-
-#define INVERT_BIT(dst) \
- FAIL_IF(push_inst(compiler, XORI | S(dst) | A(dst) | 0x1));
-
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
- sljit_s32 reg, input_flags;
- sljit_s32 flags = GET_ALL_FLAGS(op);
- sljit_sw original_dstw = dstw;
+ sljit_s32 reg, input_flags, cr_bit, invert;
+ sljit_s32 saved_op = op;
+ sljit_sw saved_dstw = dstw;
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
+#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
+ input_flags = (op & SLJIT_I32_OP) ? INT_DATA : WORD_DATA;
+#else
+ input_flags = WORD_DATA;
+#endif
op = GET_OPCODE(op);
reg = (op < SLJIT_ADD && FAST_IS_REG(dst)) ? dst : TMP_REG2;
compiler->cache_arg = 0;
compiler->cache_argw = 0;
- if (op >= SLJIT_ADD && (src & SLJIT_MEM)) {
- ADJUST_LOCAL_OFFSET(src, srcw);
-#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
- input_flags = (flags & SLJIT_I32_OP) ? INT_DATA : WORD_DATA;
-#else
- input_flags = WORD_DATA;
-#endif
- FAIL_IF(emit_op_mem2(compiler, input_flags | LOAD_DATA, TMP_REG1, src, srcw, dst, dstw));
- src = TMP_REG1;
- srcw = 0;
- }
- switch (type & 0xff) {
- case SLJIT_EQUAL:
- GET_CR_BIT(2, reg);
- break;
+ if (op >= SLJIT_ADD && (dst & SLJIT_MEM))
+ FAIL_IF(emit_op_mem2(compiler, input_flags | LOAD_DATA, TMP_REG1, dst, dstw, dst, dstw));
- case SLJIT_NOT_EQUAL:
- GET_CR_BIT(2, reg);
- INVERT_BIT(reg);
- break;
+ invert = 0;
+ cr_bit = 0;
+ switch (type & 0xff) {
case SLJIT_LESS:
- case SLJIT_LESS_F64:
- GET_CR_BIT(4 + 0, reg);
+ case SLJIT_SIG_LESS:
break;
case SLJIT_GREATER_EQUAL:
- case SLJIT_GREATER_EQUAL_F64:
- GET_CR_BIT(4 + 0, reg);
- INVERT_BIT(reg);
+ case SLJIT_SIG_GREATER_EQUAL:
+ invert = 1;
break;
case SLJIT_GREATER:
- case SLJIT_GREATER_F64:
- GET_CR_BIT(4 + 1, reg);
+ case SLJIT_SIG_GREATER:
+ cr_bit = 1;
break;
case SLJIT_LESS_EQUAL:
- case SLJIT_LESS_EQUAL_F64:
- GET_CR_BIT(4 + 1, reg);
- INVERT_BIT(reg);
- break;
-
- case SLJIT_SIG_LESS:
- GET_CR_BIT(0, reg);
- break;
-
- case SLJIT_SIG_GREATER_EQUAL:
- GET_CR_BIT(0, reg);
- INVERT_BIT(reg);
+ case SLJIT_SIG_LESS_EQUAL:
+ cr_bit = 1;
+ invert = 1;
break;
- case SLJIT_SIG_GREATER:
- GET_CR_BIT(1, reg);
+ case SLJIT_EQUAL:
+ cr_bit = 2;
break;
- case SLJIT_SIG_LESS_EQUAL:
- GET_CR_BIT(1, reg);
- INVERT_BIT(reg);
+ case SLJIT_NOT_EQUAL:
+ cr_bit = 2;
+ invert = 1;
break;
case SLJIT_OVERFLOW:
case SLJIT_MUL_OVERFLOW:
- GET_CR_BIT(3, reg);
+ cr_bit = 3;
break;
case SLJIT_NOT_OVERFLOW:
case SLJIT_MUL_NOT_OVERFLOW:
- GET_CR_BIT(3, reg);
- INVERT_BIT(reg);
+ cr_bit = 3;
+ invert = 1;
+ break;
+
+ case SLJIT_LESS_F64:
+ cr_bit = 4 + 0;
+ break;
+
+ case SLJIT_GREATER_EQUAL_F64:
+ cr_bit = 4 + 0;
+ invert = 1;
+ break;
+
+ case SLJIT_GREATER_F64:
+ cr_bit = 4 + 1;
+ break;
+
+ case SLJIT_LESS_EQUAL_F64:
+ cr_bit = 4 + 1;
+ invert = 1;
break;
case SLJIT_EQUAL_F64:
- GET_CR_BIT(4 + 2, reg);
+ cr_bit = 4 + 2;
break;
case SLJIT_NOT_EQUAL_F64:
- GET_CR_BIT(4 + 2, reg);
- INVERT_BIT(reg);
+ cr_bit = 4 + 2;
+ invert = 1;
break;
case SLJIT_UNORDERED_F64:
- GET_CR_BIT(4 + 3, reg);
+ cr_bit = 4 + 3;
break;
case SLJIT_ORDERED_F64:
- GET_CR_BIT(4 + 3, reg);
- INVERT_BIT(reg);
+ cr_bit = 4 + 3;
+ invert = 1;
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
break;
}
+ FAIL_IF(push_inst(compiler, MFCR | D(reg)));
+ FAIL_IF(push_inst(compiler, RLWINM | S(reg) | A(reg) | ((1 + (cr_bit)) << 11) | (31 << 6) | (31 << 1)));
+
+ if (invert)
+ FAIL_IF(push_inst(compiler, XORI | S(reg) | A(reg) | 0x1));
+
if (op < SLJIT_ADD) {
-#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
- if (op == SLJIT_MOV)
- input_flags = WORD_DATA;
- else {
- op = SLJIT_MOV_U32;
- input_flags = INT_DATA;
- }
-#else
- op = SLJIT_MOV;
- input_flags = WORD_DATA;
-#endif
- if (reg != TMP_REG2)
+ if (!(dst & SLJIT_MEM))
return SLJIT_SUCCESS;
- return emit_op(compiler, op, input_flags, dst, dstw, TMP_REG1, 0, TMP_REG2, 0);
+ return emit_op_mem2(compiler, input_flags, reg, dst, dstw, reg, 0);
}
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
|| (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
compiler->skip_checks = 1;
#endif
- return sljit_emit_op2(compiler, op | flags, dst, original_dstw, src, srcw, TMP_REG2, 0);
+ if (dst & SLJIT_MEM)
+ return sljit_emit_op2(compiler, saved_op, dst, saved_dstw, TMP_REG1, 0, TMP_REG2, 0);
+ return sljit_emit_op2(compiler, saved_op, dst, 0, dst, 0, TMP_REG2, 0);
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
+
+ return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);;
}
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
@@ -2369,7 +2419,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
PTR_FAIL_IF(!const_);
set_const(const_, compiler);
- reg = SLOW_IS_REG(dst) ? dst : TMP_REG2;
+ reg = FAST_IS_REG(dst) ? dst : TMP_REG2;
PTR_FAIL_IF(emit_const(compiler, reg, init_value));
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_32.c b/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_32.c
index 7e589a17c2..ee42130e87 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_32.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_32.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -60,7 +60,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return push_inst(compiler, SRA | D(dst) | S1(dst) | IMM(24), DR(dst));
}
else if (dst != src2)
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
case SLJIT_MOV_U16:
@@ -71,7 +71,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return push_inst(compiler, (op == SLJIT_MOV_S16 ? SRA : SRL) | D(dst) | S1(dst) | IMM(16), DR(dst));
}
else if (dst != src2)
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
case SLJIT_NOT:
@@ -80,18 +80,17 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
case SLJIT_CLZ:
SLJIT_ASSERT(src1 == TMP_REG1 && !(flags & SRC2_IMM));
- /* sparc 32 does not support SLJIT_KEEP_FLAGS. Not sure I can fix this. */
FAIL_IF(push_inst(compiler, SUB | SET_FLAGS | D(0) | S1(src2) | S2(0), SET_FLAGS));
FAIL_IF(push_inst(compiler, OR | D(TMP_REG1) | S1(0) | S2(src2), DR(TMP_REG1)));
FAIL_IF(push_inst(compiler, BICC | DA(0x1) | (7 & DISP_MASK), UNMOVABLE_INS));
- FAIL_IF(push_inst(compiler, OR | (flags & SET_FLAGS) | D(dst) | S1(0) | IMM(32), UNMOVABLE_INS | (flags & SET_FLAGS)));
+ FAIL_IF(push_inst(compiler, OR | D(dst) | S1(0) | IMM(32), UNMOVABLE_INS));
FAIL_IF(push_inst(compiler, OR | D(dst) | S1(0) | IMM(-1), DR(dst)));
/* Loop. */
FAIL_IF(push_inst(compiler, SUB | SET_FLAGS | D(0) | S1(TMP_REG1) | S2(0), SET_FLAGS));
FAIL_IF(push_inst(compiler, SLL | D(TMP_REG1) | S1(TMP_REG1) | IMM(1), DR(TMP_REG1)));
FAIL_IF(push_inst(compiler, BICC | DA(0xe) | (-2 & DISP_MASK), UNMOVABLE_INS));
- return push_inst(compiler, ADD | (flags & SET_FLAGS) | D(dst) | S1(dst) | IMM(1), UNMOVABLE_INS | (flags & SET_FLAGS));
+ return push_inst(compiler, ADD | D(dst) | S1(dst) | IMM(1), UNMOVABLE_INS);
case SLJIT_ADD:
return push_inst(compiler, ADD | (flags & SET_FLAGS) | D(dst) | S1(src1) | ARG2(flags, src2), DR(dst) | (flags & SET_FLAGS));
@@ -135,7 +134,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return !(flags & SET_FLAGS) ? SLJIT_SUCCESS : push_inst(compiler, SUB | SET_FLAGS | D(0) | S1(dst) | S2(0), SET_FLAGS);
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -145,20 +144,22 @@ static SLJIT_INLINE sljit_s32 emit_const(struct sljit_compiler *compiler, sljit_
return push_inst(compiler, OR | D(dst) | S1(dst) | IMM_ARG | (init_value & 0x3ff), DR(dst));
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
- inst[0] = (inst[0] & 0xffc00000) | ((new_addr >> 10) & 0x3fffff);
- inst[1] = (inst[1] & 0xfffffc00) | (new_addr & 0x3ff);
+ inst[0] = (inst[0] & 0xffc00000) | ((new_target >> 10) & 0x3fffff);
+ inst[1] = (inst[1] & 0xfffffc00) | (new_target & 0x3ff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
- sljit_ins *inst = (sljit_ins*)addr;
+ sljit_ins *inst = (sljit_ins *)addr;
inst[0] = (inst[0] & 0xffc00000) | ((new_constant >> 10) & 0x3fffff);
inst[1] = (inst[1] & 0xfffffc00) | (new_constant & 0x3ff);
+ inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
SLJIT_CACHE_FLUSH(inst, inst + 2);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_common.c b/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_common.c
index f3a33a1097..9831bd83d7 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_common.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeSPARC_common.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -199,7 +199,7 @@ static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins, sljit
return SLJIT_SUCCESS;
}
-static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code)
+static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
{
sljit_sw diff;
sljit_uw target_addr;
@@ -213,7 +213,7 @@ static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_i
target_addr = jump->u.target;
else {
SLJIT_ASSERT(jump->flags & JUMP_LABEL);
- target_addr = (sljit_uw)(code + jump->u.label->size);
+ target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset;
}
inst = (sljit_ins*)jump->addr;
@@ -239,8 +239,9 @@ static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_i
if (jump->flags & IS_COND)
inst--;
+ diff = ((sljit_sw)target_addr - (sljit_sw)(inst - 1) - executable_offset) >> 2;
+
if (jump->flags & IS_MOVABLE) {
- diff = ((sljit_sw)target_addr - (sljit_sw)(inst - 1)) >> 2;
if (diff <= MAX_DISP && diff >= MIN_DISP) {
jump->flags |= PATCH_B;
inst--;
@@ -257,7 +258,8 @@ static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_i
}
}
- diff = ((sljit_sw)target_addr - (sljit_sw)(inst)) >> 2;
+ diff += sizeof(sljit_ins);
+
if (diff <= MAX_DISP && diff >= MIN_DISP) {
jump->flags |= PATCH_B;
if (jump->flags & IS_COND)
@@ -280,6 +282,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_ins *buf_ptr;
sljit_ins *buf_end;
sljit_uw word_count;
+ sljit_sw executable_offset;
sljit_uw addr;
struct sljit_label *label;
@@ -296,9 +299,12 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
code_ptr = code;
word_count = 0;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
+
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
+
do {
buf_ptr = (sljit_ins*)buf->memory;
buf_end = buf_ptr + (buf->used_size >> 2);
@@ -310,7 +316,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
/* These structures are ordered by their address. */
if (label && label->size == word_count) {
/* Just recording the address. */
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -320,7 +326,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
#else
jump->addr = (sljit_uw)(code_ptr - 6);
#endif
- code_ptr = detect_jump_type(jump, code_ptr, code);
+ code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset);
jump = jump->next;
}
if (const_ && const_->addr == word_count) {
@@ -336,7 +342,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
} while (buf);
if (label && label->size == word_count) {
- label->addr = (sljit_uw)code_ptr;
+ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
label->size = code_ptr - code;
label = label->next;
}
@@ -350,16 +356,16 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
while (jump) {
do {
addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target;
- buf_ptr = (sljit_ins*)jump->addr;
+ buf_ptr = (sljit_ins *)jump->addr;
if (jump->flags & PATCH_CALL) {
- addr = (sljit_sw)(addr - jump->addr) >> 2;
+ addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset)) >> 2;
SLJIT_ASSERT((sljit_sw)addr <= 0x1fffffff && (sljit_sw)addr >= -0x20000000);
buf_ptr[0] = CALL | (addr & 0x3fffffff);
break;
}
if (jump->flags & PATCH_B) {
- addr = (sljit_sw)(addr - jump->addr) >> 2;
+ addr = (sljit_sw)(addr - (sljit_uw)SLJIT_ADD_EXEC_OFFSET(buf_ptr, executable_offset)) >> 2;
SLJIT_ASSERT((sljit_sw)addr <= MAX_DISP && (sljit_sw)addr >= MIN_DISP);
buf_ptr[0] = (buf_ptr[0] & ~DISP_MASK) | (addr & DISP_MASK);
break;
@@ -378,11 +384,37 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
+
+ code = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
+ code_ptr = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+
SLJIT_CACHE_FLUSH(code, code_ptr);
return code;
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+#else
+ /* Available by default. */
+ return 1;
+#endif
+
+#if (defined SLJIT_CONFIG_SPARC_64 && SLJIT_CONFIG_SPARC_64)
+ case SLJIT_HAS_CMOV:
+ return 1;
+#endif
+
+ default:
+ return 0;
+ }
+}
+
/* --------------------------------------------------------------------- */
/* Entry, exit */
/* --------------------------------------------------------------------- */
@@ -567,7 +599,6 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl
base = arg & REG_MASK;
if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) {
argw &= 0x3;
- SLJIT_ASSERT(argw != 0);
/* Using the cache. */
if (((SLJIT_MEM | (arg & OFFS_REG_MASK)) == compiler->cache_arg) && (argw == compiler->cache_argw))
@@ -652,18 +683,16 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
compiler->cache_argw = 0;
}
- if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED)) {
- if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32 && !(src2 & SLJIT_MEM))
- return SLJIT_SUCCESS;
- }
- else if (FAST_IS_REG(dst)) {
- dst_r = dst;
- flags |= REG_DEST;
- if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32)
- sugg_src2_r = dst_r;
+ if (dst != SLJIT_UNUSED) {
+ if (FAST_IS_REG(dst)) {
+ dst_r = dst;
+ flags |= REG_DEST;
+ if (op >= SLJIT_MOV && op <= SLJIT_MOVU_S32)
+ sugg_src2_r = dst_r;
+ }
+ else if ((dst & SLJIT_MEM) && !getput_arg_fast(compiler, flags | ARG_TEST, TMP_REG1, dst, dstw))
+ flags |= SLOW_DEST;
}
- else if ((dst & SLJIT_MEM) && !getput_arg_fast(compiler, flags | ARG_TEST, TMP_REG1, dst, dstw))
- flags |= SLOW_DEST;
if (flags & IMM_OP) {
if ((src2 & SLJIT_IMM) && src2w) {
@@ -812,13 +841,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
- sljit_s32 flags = GET_FLAGS(op) ? SET_FLAGS : 0;
+ sljit_s32 flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
CHECK_ERROR();
CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw));
ADJUST_LOCAL_OFFSET(dst, dstw);
ADJUST_LOCAL_OFFSET(src, srcw);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
+
op = GET_OPCODE(op);
switch (op) {
case SLJIT_MOV:
@@ -881,7 +913,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
- sljit_s32 flags = GET_FLAGS(op) ? SET_FLAGS : 0;
+ sljit_s32 flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
CHECK_ERROR();
CHECK(check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w));
@@ -889,6 +921,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
ADJUST_LOCAL_OFFSET(src1, src1w);
ADJUST_LOCAL_OFFSET(src2, src2w);
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
+
op = GET_OPCODE(op);
switch (op) {
case SLJIT_ADD:
@@ -910,7 +945,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
if (src2 & SLJIT_IMM)
src2w &= 0x1f;
#else
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
#endif
return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w);
}
@@ -943,16 +978,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#else
- /* Available by default. */
- return 1;
-#endif
-}
-
#define FLOAT_DATA(op) (DOUBLE_DATA | ((op & SLJIT_F32_OP) >> 7))
#define SELECT_FOP(op, single, double) ((op & SLJIT_F32_OP) ? single : double)
#define FLOAT_TMP_MEM_OFFSET (22 * sizeof(sljit_sw))
@@ -970,9 +995,6 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
FAIL_IF(push_inst(compiler, SELECT_FOP(op, FSTOI, FDTOI) | DA(TMP_FREG1) | S2A(src), MOVABLE_INS));
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst)) {
FAIL_IF(emit_op_mem2(compiler, SINGLE_DATA, TMP_FREG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET));
return emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, dst, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET);
@@ -1186,10 +1208,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *
CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
ADJUST_LOCAL_OFFSET(dst, dstw);
- /* For UNUSED dst. Uncommon, but possible. */
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
if (FAST_IS_REG(dst))
return push_inst(compiler, OR | D(dst) | S1(0) | S2(TMP_LINK), DR(dst));
@@ -1285,7 +1303,7 @@ static sljit_ins get_cc(sljit_s32 type)
return DA(0xf);
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return DA(0x8);
}
}
@@ -1373,30 +1391,23 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
- sljit_s32 reg, flags = (GET_FLAGS(op) ? SET_FLAGS : 0);
+ sljit_s32 reg, flags = HAS_FLAGS(op) ? SET_FLAGS : 0;
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
op = GET_OPCODE(op);
reg = (op < SLJIT_ADD && FAST_IS_REG(dst)) ? dst : TMP_REG2;
compiler->cache_arg = 0;
compiler->cache_argw = 0;
- if (op >= SLJIT_ADD && (src & SLJIT_MEM)) {
- ADJUST_LOCAL_OFFSET(src, srcw);
- FAIL_IF(emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, src, srcw, dst, dstw));
- src = TMP_REG1;
- srcw = 0;
- }
+
+ if (op >= SLJIT_ADD && (dst & SLJIT_MEM))
+ FAIL_IF(emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, dst, dstw, dst, dstw));
type &= 0xff;
if (type < SLJIT_EQUAL_F64)
@@ -1407,10 +1418,31 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
FAIL_IF(push_inst(compiler, OR | D(reg) | S1(0) | IMM(1), UNMOVABLE_INS));
FAIL_IF(push_inst(compiler, OR | D(reg) | S1(0) | IMM(0), UNMOVABLE_INS));
- if (op >= SLJIT_ADD)
- return emit_op(compiler, op, flags | CUMULATIVE_OP | IMM_OP | ALT_KEEP_CACHE, dst, dstw, src, srcw, TMP_REG2, 0);
+ if (op >= SLJIT_ADD) {
+ flags |= CUMULATIVE_OP | IMM_OP | ALT_KEEP_CACHE;
+ if (dst & SLJIT_MEM)
+ return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, TMP_REG2, 0);
+ return emit_op(compiler, op, flags, dst, 0, dst, 0, TMP_REG2, 0);
+ }
+
+ if (!(dst & SLJIT_MEM))
+ return SLJIT_SUCCESS;
+
+ return emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw);
+#else
+#error "Implementation required"
+#endif
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
- return (reg == TMP_REG2) ? emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw) : SLJIT_SUCCESS;
+#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
+ return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);;
#else
#error "Implementation required"
#endif
@@ -1429,7 +1461,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
PTR_FAIL_IF(!const_);
set_const(const_, compiler);
- reg = SLOW_IS_REG(dst) ? dst : TMP_REG2;
+ reg = FAST_IS_REG(dst) ? dst : TMP_REG2;
PTR_FAIL_IF(emit_const(compiler, reg, init_value));
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX-encoder.c b/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX-encoder.c
index 719632908c..dd82ebae6a 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX-encoder.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX-encoder.c
@@ -2,7 +2,7 @@
* Stack-less Just-In-Time compiler
*
* Copyright 2013-2013 Tilera Corporation(jiwang@tilera.com). All rights reserved.
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX_64.c b/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX_64.c
index 462a8b9cd9..003f43a790 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX_64.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeTILEGX_64.c
@@ -2,7 +2,7 @@
* Stack-less Just-In-Time compiler
*
* Copyright 2013-2013 Tilera Corporation(jiwang@tilera.com). All rights reserved.
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -687,7 +687,7 @@ static sljit_s32 update_buffer(struct sljit_compiler *compiler)
inst_buf[0] = inst1;
inst_buf_index = 1;
} else
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
#ifdef TILEGX_JIT_DEBUG
return push_inst_nodebug(compiler, bits);
@@ -727,10 +727,10 @@ static sljit_s32 update_buffer(struct sljit_compiler *compiler)
return push_inst(compiler, bits);
#endif
} else
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
static sljit_s32 flush_buffer(struct sljit_compiler *compiler)
@@ -814,7 +814,7 @@ static sljit_s32 push_3_buffer(struct sljit_compiler *compiler, tilegx_mnemonic
break;
default:
printf("unrecoginzed opc: %s\n", opcode->name);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
inst_buf_index++;
@@ -859,7 +859,7 @@ static sljit_s32 push_2_buffer(struct sljit_compiler *compiler, tilegx_mnemonic
break;
default:
printf("unrecoginzed opc: %s\n", opcode->name);
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
inst_buf_index++;
@@ -1952,7 +1952,7 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
return SLJIT_SUCCESS;
}
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
return SLJIT_SUCCESS;
}
@@ -2092,9 +2092,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
-
op = GET_OPCODE(op);
if (op == SLJIT_MOV_S32 || op == SLJIT_MOV_U32)
mem_type = INT_DATA | SIGNED_DATA;
@@ -2143,7 +2140,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
break;
default:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
dst_ar = sugg_dst_ar;
break;
}
@@ -2186,7 +2183,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
case SLJIT_DIVMOD_SW:
case SLJIT_DIV_UW:
case SLJIT_DIV_SW:
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
return SLJIT_SUCCESS;
@@ -2487,19 +2484,14 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump * sljit_emit_jump(struct sljit_compil
return jump;
}
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
- return 0;
-}
-
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 dst, sljit_sw dstw, sljit_s32 src, sljit_sw srcw)
{
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 dst, sljit_sw dstw, sljit_s32 src1, sljit_sw src1w, sljit_s32 src2, sljit_sw src2w)
{
- SLJIT_ASSERT_STOP();
+ SLJIT_UNREACHABLE();
}
SLJIT_API_FUNC_ATTRIBUTE struct sljit_const * sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
@@ -2526,13 +2518,13 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const * sljit_emit_const(struct sljit_comp
return const_;
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target)
{
sljit_ins *inst = (sljit_ins *)addr;
- inst[0] = (inst[0] & ~(0xFFFFL << 43)) | (((new_addr >> 32) & 0xffff) << 43);
- inst[1] = (inst[1] & ~(0xFFFFL << 43)) | (((new_addr >> 16) & 0xffff) << 43);
- inst[2] = (inst[2] & ~(0xFFFFL << 43)) | ((new_addr & 0xffff) << 43);
+ inst[0] = (inst[0] & ~(0xFFFFL << 43)) | (((new_target >> 32) & 0xffff) << 43);
+ inst[1] = (inst[1] & ~(0xFFFFL << 43)) | (((new_target >> 16) & 0xffff) << 43);
+ inst[2] = (inst[2] & ~(0xFFFFL << 43)) | ((new_target & 0xffff) << 43);
SLJIT_CACHE_FLUSH(inst, inst + 3);
}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeX86_32.c b/src/3rdparty/pcre2/src/sljit/sljitNativeX86_32.c
index 78f3dcb06f..f5cf8834b0 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeX86_32.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeX86_32.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -38,7 +38,7 @@ static sljit_s32 emit_do_imm(struct sljit_compiler *compiler, sljit_u8 opcode, s
return SLJIT_SUCCESS;
}
-static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type)
+static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type, sljit_sw executable_offset)
{
if (type == SLJIT_JUMP) {
*code_ptr++ = JMP_i32;
@@ -57,7 +57,7 @@ static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_
if (jump->flags & JUMP_LABEL)
jump->flags |= PATCH_MW;
else
- sljit_unaligned_store_sw(code_ptr, jump->u.target - (jump->addr + 4));
+ sljit_unaligned_store_sw(code_ptr, jump->u.target - (jump->addr + 4) - (sljit_uw)executable_offset);
code_ptr += 4;
return code_ptr;
@@ -75,9 +75,30 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
compiler->args = args;
- compiler->flags_saved = 0;
- size = 1 + (scratches > 7 ? (scratches - 7) : 0) + (saveds <= 3 ? saveds : 3);
+#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
+ /* [esp+0] for saving temporaries and third argument for calls. */
+ compiler->saveds_offset = 1 * sizeof(sljit_sw);
+#else
+ /* [esp+0] for saving temporaries and space for maximum three arguments. */
+ if (scratches <= 1)
+ compiler->saveds_offset = 1 * sizeof(sljit_sw);
+ else
+ compiler->saveds_offset = ((scratches == 2) ? 2 : 3) * sizeof(sljit_sw);
+#endif
+
+ if (scratches > 3)
+ compiler->saveds_offset += ((scratches > (3 + 6)) ? 6 : (scratches - 3)) * sizeof(sljit_sw);
+
+ compiler->locals_offset = compiler->saveds_offset;
+
+ if (saveds > 3)
+ compiler->locals_offset += (saveds - 3) * sizeof(sljit_sw);
+
+ if (options & SLJIT_F64_ALIGNMENT)
+ compiler->locals_offset = (compiler->locals_offset + sizeof(sljit_f64) - 1) & ~(sizeof(sljit_f64) - 1);
+
+ size = 1 + (scratches > 9 ? (scratches - 9) : 0) + (saveds <= 3 ? saveds : 3);
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
size += (args > 0 ? (args * 2) : 0) + (args > 2 ? 2 : 0);
#else
@@ -94,11 +115,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
*inst++ = MOD_REG | (reg_map[TMP_REG1] << 3) | 0x4 /* esp */;
}
#endif
- if (saveds > 2 || scratches > 7)
+ if (saveds > 2 || scratches > 9)
PUSH_REG(reg_map[SLJIT_S2]);
- if (saveds > 1 || scratches > 8)
+ if (saveds > 1 || scratches > 10)
PUSH_REG(reg_map[SLJIT_S1]);
- if (saveds > 0 || scratches > 9)
+ if (saveds > 0 || scratches > 11)
PUSH_REG(reg_map[SLJIT_S0]);
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
@@ -134,51 +155,64 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
}
#endif
- SLJIT_COMPILE_ASSERT(SLJIT_LOCALS_OFFSET >= (2 + 4) * sizeof(sljit_uw), require_at_least_two_words);
+ SLJIT_ASSERT(SLJIT_LOCALS_OFFSET > 0);
+
#if defined(__APPLE__)
/* Ignore pushed registers and SLJIT_LOCALS_OFFSET when computing the aligned local size. */
- saveds = (2 + (scratches > 7 ? (scratches - 7) : 0) + (saveds <= 3 ? saveds : 3)) * sizeof(sljit_uw);
+ saveds = (2 + (scratches > 9 ? (scratches - 9) : 0) + (saveds <= 3 ? saveds : 3)) * sizeof(sljit_uw);
local_size = ((SLJIT_LOCALS_OFFSET + saveds + local_size + 15) & ~15) - saveds;
#else
- if (options & SLJIT_DOUBLE_ALIGNMENT) {
- local_size = SLJIT_LOCALS_OFFSET + ((local_size + 7) & ~7);
-
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 17);
- FAIL_IF(!inst);
-
- INC_SIZE(17);
- inst[0] = MOV_r_rm;
- inst[1] = MOD_REG | (reg_map[TMP_REG1] << 3) | reg_map[SLJIT_SP];
- inst[2] = GROUP_F7;
- inst[3] = MOD_REG | (0 << 3) | reg_map[SLJIT_SP];
- sljit_unaligned_store_sw(inst + 4, 0x4);
- inst[8] = JNE_i8;
- inst[9] = 6;
- inst[10] = GROUP_BINARY_81;
- inst[11] = MOD_REG | (5 << 3) | reg_map[SLJIT_SP];
- sljit_unaligned_store_sw(inst + 12, 0x4);
- inst[16] = PUSH_r + reg_map[TMP_REG1];
- }
+ if (options & SLJIT_F64_ALIGNMENT)
+ local_size = SLJIT_LOCALS_OFFSET + ((local_size + sizeof(sljit_f64) - 1) & ~(sizeof(sljit_f64) - 1));
else
- local_size = SLJIT_LOCALS_OFFSET + ((local_size + 3) & ~3);
+ local_size = SLJIT_LOCALS_OFFSET + ((local_size + sizeof(sljit_sw) - 1) & ~(sizeof(sljit_sw) - 1));
#endif
compiler->local_size = local_size;
+
#ifdef _WIN32
if (local_size > 1024) {
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size));
#else
- local_size -= SLJIT_LOCALS_OFFSET;
+ /* Space for a single argument. This amount is excluded when the stack is allocated below. */
+ local_size -= sizeof(sljit_sw);
FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size));
FAIL_IF(emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
- SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, SLJIT_LOCALS_OFFSET));
+ SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, sizeof(sljit_sw)));
#endif
FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack)));
}
#endif
SLJIT_ASSERT(local_size > 0);
+
+#if !defined(__APPLE__)
+ if (options & SLJIT_F64_ALIGNMENT) {
+ EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_SP, 0);
+
+ /* Some space might allocated during sljit_grow_stack() above on WIN32. */
+ FAIL_IF(emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
+ SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, local_size + sizeof(sljit_sw)));
+
+#if defined _WIN32 && !(defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
+ if (compiler->local_size > 1024)
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ TMP_REG1, 0, TMP_REG1, 0, SLJIT_IMM, sizeof(sljit_sw)));
+#endif
+
+ inst = (sljit_u8*)ensure_buf(compiler, 1 + 6);
+ FAIL_IF(!inst);
+
+ INC_SIZE(6);
+ inst[0] = GROUP_BINARY_81;
+ inst[1] = MOD_REG | AND | reg_map[SLJIT_SP];
+ sljit_unaligned_store_sw(inst + 2, ~(sizeof(sljit_f64) - 1));
+
+ /* The real local size must be used. */
+ return emit_mov(compiler, SLJIT_MEM1(SLJIT_SP), compiler->local_size, TMP_REG1, 0);
+ }
+#endif
return emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, local_size);
}
@@ -193,14 +227,36 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
compiler->args = args;
+#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
+ /* [esp+0] for saving temporaries and third argument for calls. */
+ compiler->saveds_offset = 1 * sizeof(sljit_sw);
+#else
+ /* [esp+0] for saving temporaries and space for maximum three arguments. */
+ if (scratches <= 1)
+ compiler->saveds_offset = 1 * sizeof(sljit_sw);
+ else
+ compiler->saveds_offset = ((scratches == 2) ? 2 : 3) * sizeof(sljit_sw);
+#endif
+
+ if (scratches > 3)
+ compiler->saveds_offset += ((scratches > (3 + 6)) ? 6 : (scratches - 3)) * sizeof(sljit_sw);
+
+ compiler->locals_offset = compiler->saveds_offset;
+
+ if (saveds > 3)
+ compiler->locals_offset += (saveds - 3) * sizeof(sljit_sw);
+
+ if (options & SLJIT_F64_ALIGNMENT)
+ compiler->locals_offset = (compiler->locals_offset + sizeof(sljit_f64) - 1) & ~(sizeof(sljit_f64) - 1);
+
#if defined(__APPLE__)
- saveds = (2 + (scratches > 7 ? (scratches - 7) : 0) + (saveds <= 3 ? saveds : 3)) * sizeof(sljit_uw);
+ saveds = (2 + (scratches > 9 ? (scratches - 9) : 0) + (saveds <= 3 ? saveds : 3)) * sizeof(sljit_uw);
compiler->local_size = ((SLJIT_LOCALS_OFFSET + saveds + local_size + 15) & ~15) - saveds;
#else
- if (options & SLJIT_DOUBLE_ALIGNMENT)
- compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + 7) & ~7);
+ if (options & SLJIT_F64_ALIGNMENT)
+ compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + sizeof(sljit_f64) - 1) & ~(sizeof(sljit_f64) - 1));
else
- compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + 3) & ~3);
+ compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + sizeof(sljit_sw) - 1) & ~(sizeof(sljit_sw) - 1));
#endif
return SLJIT_SUCCESS;
}
@@ -214,23 +270,19 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
CHECK(check_sljit_emit_return(compiler, op, src, srcw));
SLJIT_ASSERT(compiler->args >= 0);
- compiler->flags_saved = 0;
FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
SLJIT_ASSERT(compiler->local_size > 0);
- FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
- SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, compiler->local_size));
#if !defined(__APPLE__)
- if (compiler->options & SLJIT_DOUBLE_ALIGNMENT) {
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 3);
- FAIL_IF(!inst);
-
- INC_SIZE(3);
- inst[0] = MOV_r_rm;
- inst[1] = (reg_map[SLJIT_SP] << 3) | 0x4 /* SIB */;
- inst[2] = (4 << 3) | reg_map[SLJIT_SP];
- }
+ if (compiler->options & SLJIT_F64_ALIGNMENT)
+ EMIT_MOV(compiler, SLJIT_SP, 0, SLJIT_MEM1(SLJIT_SP), compiler->local_size)
+ else
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, compiler->local_size));
+#else
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, compiler->local_size));
#endif
size = 2 + (compiler->scratches > 7 ? (compiler->scratches - 7) : 0) +
@@ -247,11 +299,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
INC_SIZE(size);
- if (compiler->saveds > 0 || compiler->scratches > 9)
+ if (compiler->saveds > 0 || compiler->scratches > 11)
POP_REG(reg_map[SLJIT_S0]);
- if (compiler->saveds > 1 || compiler->scratches > 8)
+ if (compiler->saveds > 1 || compiler->scratches > 10)
POP_REG(reg_map[SLJIT_S1]);
- if (compiler->saveds > 2 || compiler->scratches > 7)
+ if (compiler->saveds > 2 || compiler->scratches > 9)
POP_REG(reg_map[SLJIT_S2]);
POP_REG(reg_map[TMP_REG1]);
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeX86_64.c b/src/3rdparty/pcre2/src/sljit/sljitNativeX86_64.c
index e88ddedcd1..039b68c45a 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeX86_64.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeX86_64.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -47,9 +47,8 @@ static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_
*code_ptr++ = 10 + 3;
}
- SLJIT_COMPILE_ASSERT(reg_map[TMP_REG3] == 9, tmp3_is_9_first);
- *code_ptr++ = REX_W | REX_B;
- *code_ptr++ = MOV_r_i32 + 1;
+ *code_ptr++ = REX_W | ((reg_map[TMP_REG2] <= 7) ? 0 : REX_B);
+ *code_ptr++ = MOV_r_i32 | reg_lmap[TMP_REG2];
jump->addr = (sljit_uw)code_ptr;
if (jump->flags & JUMP_LABEL)
@@ -58,31 +57,10 @@ static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_
sljit_unaligned_store_sw(code_ptr, jump->u.target);
code_ptr += sizeof(sljit_sw);
- *code_ptr++ = REX_B;
- *code_ptr++ = GROUP_FF;
- *code_ptr++ = (type >= SLJIT_FAST_CALL) ? (MOD_REG | CALL_rm | 1) : (MOD_REG | JMP_rm | 1);
-
- return code_ptr;
-}
-
-static sljit_u8* generate_fixed_jump(sljit_u8 *code_ptr, sljit_sw addr, sljit_s32 type)
-{
- sljit_sw delta = addr - ((sljit_sw)code_ptr + 1 + sizeof(sljit_s32));
-
- if (delta <= HALFWORD_MAX && delta >= HALFWORD_MIN) {
- *code_ptr++ = (type == 2) ? CALL_i32 : JMP_i32;
- sljit_unaligned_store_sw(code_ptr, delta);
- }
- else {
- SLJIT_COMPILE_ASSERT(reg_map[TMP_REG3] == 9, tmp3_is_9_second);
- *code_ptr++ = REX_W | REX_B;
- *code_ptr++ = MOV_r_i32 + 1;
- sljit_unaligned_store_sw(code_ptr, addr);
- code_ptr += sizeof(sljit_sw);
+ if (reg_map[TMP_REG2] >= 8)
*code_ptr++ = REX_B;
- *code_ptr++ = GROUP_FF;
- *code_ptr++ = (type == 2) ? (MOD_REG | CALL_rm | 1) : (MOD_REG | JMP_rm | 1);
- }
+ *code_ptr++ = GROUP_FF;
+ *code_ptr++ = MOD_REG | (type >= SLJIT_FAST_CALL ? CALL_rm : JMP_rm) | reg_lmap[TMP_REG2];
return code_ptr;
}
@@ -98,7 +76,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
- compiler->flags_saved = 0;
+#ifdef _WIN64
+ /* Two/four register slots for parameters plus space for xmm6 register if needed. */
+ if (fscratches >= 6 || fsaveds >= 1)
+ compiler->locals_offset = 6 * sizeof(sljit_sw);
+ else
+ compiler->locals_offset = ((scratches > 2) ? 4 : 2) * sizeof(sljit_sw);
+#endif
/* Including the return address saved by the call instruction. */
saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
@@ -177,7 +161,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
INC_SIZE(4 + (3 + sizeof(sljit_s32)));
*inst++ = REX_W;
*inst++ = GROUP_BINARY_83;
- *inst++ = MOD_REG | SUB | 4;
+ *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP];
/* Allocated size for registers must be divisible by 8. */
SLJIT_ASSERT(!(saved_register_size & 0x7));
/* Aligned to 16 byte. */
@@ -189,7 +173,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
local_size -= 4 * sizeof(sljit_sw);
}
/* Second instruction */
- SLJIT_COMPILE_ASSERT(reg_map[SLJIT_R0] < 8, temporary_reg1_is_loreg);
+ SLJIT_ASSERT(reg_map[SLJIT_R0] < 8);
*inst++ = REX_W;
*inst++ = MOV_rm_i32;
*inst++ = MOD_REG | reg_lmap[SLJIT_R0];
@@ -202,25 +186,26 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
}
#endif
- SLJIT_ASSERT(local_size > 0);
- if (local_size <= 127) {
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
- FAIL_IF(!inst);
- INC_SIZE(4);
- *inst++ = REX_W;
- *inst++ = GROUP_BINARY_83;
- *inst++ = MOD_REG | SUB | 4;
- *inst++ = local_size;
- }
- else {
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 7);
- FAIL_IF(!inst);
- INC_SIZE(7);
- *inst++ = REX_W;
- *inst++ = GROUP_BINARY_81;
- *inst++ = MOD_REG | SUB | 4;
- sljit_unaligned_store_s32(inst, local_size);
- inst += sizeof(sljit_s32);
+ if (local_size > 0) {
+ if (local_size <= 127) {
+ inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
+ FAIL_IF(!inst);
+ INC_SIZE(4);
+ *inst++ = REX_W;
+ *inst++ = GROUP_BINARY_83;
+ *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP];
+ *inst++ = local_size;
+ }
+ else {
+ inst = (sljit_u8*)ensure_buf(compiler, 1 + 7);
+ FAIL_IF(!inst);
+ INC_SIZE(7);
+ *inst++ = REX_W;
+ *inst++ = GROUP_BINARY_81;
+ *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP];
+ sljit_unaligned_store_s32(inst, local_size);
+ inst += sizeof(sljit_s32);
+ }
}
#ifdef _WIN64
@@ -247,6 +232,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
+#ifdef _WIN64
+ /* Two/four register slots for parameters plus space for xmm6 register if needed. */
+ if (fscratches >= 6 || fsaveds >= 1)
+ compiler->locals_offset = 6 * sizeof(sljit_sw);
+ else
+ compiler->locals_offset = ((scratches > 2) ? 4 : 2) * sizeof(sljit_sw);
+#endif
+
/* Including the return address saved by the call instruction. */
saved_register_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1);
compiler->local_size = ((local_size + SLJIT_LOCALS_OFFSET + saved_register_size + 15) & ~15) - saved_register_size;
@@ -261,7 +254,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
CHECK_ERROR();
CHECK(check_sljit_emit_return(compiler, op, src, srcw));
- compiler->flags_saved = 0;
FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
#ifdef _WIN64
@@ -275,24 +267,25 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
}
#endif
- SLJIT_ASSERT(compiler->local_size > 0);
- if (compiler->local_size <= 127) {
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
- FAIL_IF(!inst);
- INC_SIZE(4);
- *inst++ = REX_W;
- *inst++ = GROUP_BINARY_83;
- *inst++ = MOD_REG | ADD | 4;
- *inst = compiler->local_size;
- }
- else {
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 7);
- FAIL_IF(!inst);
- INC_SIZE(7);
- *inst++ = REX_W;
- *inst++ = GROUP_BINARY_81;
- *inst++ = MOD_REG | ADD | 4;
- sljit_unaligned_store_s32(inst, compiler->local_size);
+ if (compiler->local_size > 0) {
+ if (compiler->local_size <= 127) {
+ inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
+ FAIL_IF(!inst);
+ INC_SIZE(4);
+ *inst++ = REX_W;
+ *inst++ = GROUP_BINARY_83;
+ *inst++ = MOD_REG | ADD | 4;
+ *inst = compiler->local_size;
+ }
+ else {
+ inst = (sljit_u8*)ensure_buf(compiler, 1 + 7);
+ FAIL_IF(!inst);
+ INC_SIZE(7);
+ *inst++ = REX_W;
+ *inst++ = GROUP_BINARY_81;
+ *inst++ = MOD_REG | ADD | 4;
+ sljit_unaligned_store_s32(inst, compiler->local_size);
+ }
}
tmp = compiler->scratches;
@@ -387,13 +380,12 @@ static sljit_u8* emit_x86_instruction(struct sljit_compiler *compiler, sljit_s32
if (b & SLJIT_MEM) {
if (!(b & OFFS_REG_MASK)) {
if (NOT_HALFWORD(immb)) {
- if (emit_load_imm64(compiler, TMP_REG3, immb))
- return NULL;
+ PTR_FAIL_IF(emit_load_imm64(compiler, TMP_REG2, immb));
immb = 0;
if (b & REG_MASK)
- b |= TO_OFFS_REG(TMP_REG3);
+ b |= TO_OFFS_REG(TMP_REG2);
else
- b |= TMP_REG3;
+ b |= TMP_REG2;
}
else if (reg_lmap[b & REG_MASK] == 4)
b |= TO_OFFS_REG(SLJIT_SP);
@@ -553,17 +545,19 @@ static sljit_u8* emit_x86_instruction(struct sljit_compiler *compiler, sljit_s32
/* Call / return instructions */
/* --------------------------------------------------------------------- */
-static SLJIT_INLINE sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 type)
+static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 type)
{
sljit_u8 *inst;
+ /* After any change update IS_REG_CHANGED_BY_CALL as well. */
#ifndef _WIN64
- SLJIT_COMPILE_ASSERT(reg_map[SLJIT_R1] == 6 && reg_map[SLJIT_R0] < 8 && reg_map[SLJIT_R2] < 8, args_registers);
+ SLJIT_ASSERT(reg_map[SLJIT_R1] == 6 && reg_map[SLJIT_R0] < 8 && reg_map[SLJIT_R2] < 8 && reg_map[TMP_REG1] == 2);
inst = (sljit_u8*)ensure_buf(compiler, 1 + ((type < SLJIT_CALL3) ? 3 : 6));
FAIL_IF(!inst);
INC_SIZE((type < SLJIT_CALL3) ? 3 : 6);
if (type >= SLJIT_CALL3) {
+ /* Move third argument to TMP_REG1. */
*inst++ = REX_W;
*inst++ = MOV_r_rm;
*inst++ = MOD_REG | (0x2 /* rdx */ << 3) | reg_lmap[SLJIT_R2];
@@ -572,12 +566,13 @@ static SLJIT_INLINE sljit_s32 call_with_args(struct sljit_compiler *compiler, sl
*inst++ = MOV_r_rm;
*inst++ = MOD_REG | (0x7 /* rdi */ << 3) | reg_lmap[SLJIT_R0];
#else
- SLJIT_COMPILE_ASSERT(reg_map[SLJIT_R1] == 2 && reg_map[SLJIT_R0] < 8 && reg_map[SLJIT_R2] < 8, args_registers);
+ SLJIT_ASSERT(reg_map[SLJIT_R1] == 2 && reg_map[SLJIT_R0] < 8 && reg_map[SLJIT_R2] < 8 && reg_map[TMP_REG1] == 8);
inst = (sljit_u8*)ensure_buf(compiler, 1 + ((type < SLJIT_CALL3) ? 3 : 6));
FAIL_IF(!inst);
INC_SIZE((type < SLJIT_CALL3) ? 3 : 6);
if (type >= SLJIT_CALL3) {
+ /* Move third argument to TMP_REG1. */
*inst++ = REX_W | REX_R;
*inst++ = MOV_r_rm;
*inst++ = MOD_REG | (0x0 /* r8 */ << 3) | reg_lmap[SLJIT_R2];
diff --git a/src/3rdparty/pcre2/src/sljit/sljitNativeX86_common.c b/src/3rdparty/pcre2/src/sljit/sljitNativeX86_common.c
index aa5ba089d2..eb0886d671 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitNativeX86_common.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitNativeX86_common.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -67,12 +67,15 @@ SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
#define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2)
static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 3] = {
- 0, 0, 2, 1, 0, 0, 0, 0, 7, 6, 3, 4, 5
+ 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 7, 6, 3, 4, 5
};
#define CHECK_EXTRA_REGS(p, w, do) \
- if (p >= SLJIT_R3 && p <= SLJIT_R6) { \
- w = SLJIT_LOCALS_OFFSET + ((p) - (SLJIT_R3 + 4)) * sizeof(sljit_sw); \
+ if (p >= SLJIT_R3 && p <= SLJIT_S3) { \
+ if (p <= compiler->scratches) \
+ w = compiler->saveds_offset - ((p) - SLJIT_R2) * (sljit_sw)sizeof(sljit_sw); \
+ else \
+ w = compiler->locals_offset + ((p) - SLJIT_S2) * (sljit_sw)sizeof(sljit_sw); \
p = SLJIT_MEM1(SLJIT_SP); \
do; \
}
@@ -82,28 +85,27 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 3] = {
/* Last register + 1. */
#define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2)
#define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3)
-#define TMP_REG3 (SLJIT_NUMBER_OF_REGISTERS + 4)
/* Note: r12 & 0x7 == 0b100, which decoded as SIB byte present
Note: avoid to use r12 and r13 for memory addessing
- therefore r12 is better for SAVED_EREG than SAVED_REG. */
+ therefore r12 is better to be a higher saved register. */
#ifndef _WIN64
-/* 1st passed in rdi, 2nd argument passed in rsi, 3rd in rdx. */
-static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
- 0, 0, 6, 1, 8, 11, 10, 12, 5, 13, 14, 15, 3, 4, 2, 7, 9
+/* Args: rdi(=7), rsi(=6), rdx(=2), rcx(=1), r8, r9. Scratches: rax(=0), r10, r11 */
+static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 4] = {
+ 0, 0, 6, 1, 7, 8, 11, 10, 12, 5, 13, 14, 15, 3, 4, 2, 9
};
/* low-map. reg_map & 0x7. */
-static const sljit_u8 reg_lmap[SLJIT_NUMBER_OF_REGISTERS + 5] = {
- 0, 0, 6, 1, 0, 3, 2, 4, 5, 5, 6, 7, 3, 4, 2, 7, 1
+static const sljit_u8 reg_lmap[SLJIT_NUMBER_OF_REGISTERS + 4] = {
+ 0, 0, 6, 1, 7, 0, 3, 2, 4, 5, 5, 6, 7, 3, 4, 2, 1
};
#else
-/* 1st passed in rcx, 2nd argument passed in rdx, 3rd in r8. */
-static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
- 0, 0, 2, 1, 11, 12, 5, 13, 14, 15, 7, 6, 3, 4, 10, 8, 9
+/* Args: rcx(=1), rdx(=2), r8, r9. Scratches: rax(=0), r10, r11 */
+static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 4] = {
+ 0, 0, 2, 1, 10, 11, 12, 5, 13, 14, 15, 7, 6, 3, 4, 8, 9
};
/* low-map. reg_map & 0x7. */
-static const sljit_u8 reg_lmap[SLJIT_NUMBER_OF_REGISTERS + 5] = {
- 0, 0, 2, 1, 3, 4, 5, 5, 6, 7, 7, 6, 3, 4, 2, 0, 1
+static const sljit_u8 reg_lmap[SLJIT_NUMBER_OF_REGISTERS + 4] = {
+ 0, 0, 2, 1, 2, 3, 4, 5, 5, 6, 7, 7, 6, 3, 4, 0, 1
};
#endif
@@ -166,7 +168,7 @@ static const sljit_u8 reg_lmap[SLJIT_NUMBER_OF_REGISTERS + 5] = {
#define CALL_i32 0xe8
#define CALL_rm (/* GROUP_FF */ 2 << 3)
#define CDQ 0x99
-#define CMOVNE_r_rm (/* GROUP_0F */ 0x45)
+#define CMOVE_r_rm (/* GROUP_0F */ 0x44)
#define CMP (/* BINARY */ 7 << 3)
#define CMP_EAX_i32 0x3d
#define CMP_r_rm 0x3b
@@ -214,6 +216,7 @@ static const sljit_u8 reg_lmap[SLJIT_NUMBER_OF_REGISTERS + 5] = {
#define POP_r 0x58
#define POP_rm 0x8f
#define POPF 0x9d
+#define PREFETCH 0x18
#define PUSH_i32 0x68
#define PUSH_r 0x50
#define PUSH_rm (/* GROUP_FF */ 6 << 3)
@@ -409,13 +412,13 @@ static sljit_u8 get_jump_code(sljit_s32 type)
return 0;
}
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type, sljit_sw executable_offset);
+#else
static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type);
-
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-static sljit_u8* generate_fixed_jump(sljit_u8 *code_ptr, sljit_sw addr, sljit_s32 type);
#endif
-static sljit_u8* generate_near_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_u8 *code, sljit_s32 type)
+static sljit_u8* generate_near_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_u8 *code, sljit_s32 type, sljit_sw executable_offset)
{
sljit_s32 short_jump;
sljit_uw label_addr;
@@ -423,7 +426,8 @@ static sljit_u8* generate_near_jump_code(struct sljit_jump *jump, sljit_u8 *code
if (jump->flags & JUMP_LABEL)
label_addr = (sljit_uw)(code + jump->u.label->size);
else
- label_addr = jump->u.target;
+ label_addr = jump->u.target - executable_offset;
+
short_jump = (sljit_sw)(label_addr - (jump->addr + 2)) >= -128 && (sljit_sw)(label_addr - (jump->addr + 2)) <= 127;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
@@ -476,6 +480,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
sljit_u8 *buf_ptr;
sljit_u8 *buf_end;
sljit_u8 len;
+ sljit_sw executable_offset;
+ sljit_sw jump_addr;
struct sljit_label *label;
struct sljit_jump *jump;
@@ -494,6 +500,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
label = compiler->labels;
jump = compiler->jumps;
const_ = compiler->consts;
+ executable_offset = SLJIT_EXEC_OFFSET(code);
+
do {
buf_ptr = buf->memory;
buf_end = buf_ptr + buf->used_size;
@@ -506,35 +514,28 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
buf_ptr += len;
}
else {
- if (*buf_ptr >= 4) {
+ if (*buf_ptr >= 2) {
jump->addr = (sljit_uw)code_ptr;
if (!(jump->flags & SLJIT_REWRITABLE_JUMP))
- code_ptr = generate_near_jump_code(jump, code_ptr, code, *buf_ptr - 4);
- else
- code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 4);
+ code_ptr = generate_near_jump_code(jump, code_ptr, code, *buf_ptr - 2, executable_offset);
+ else {
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+ code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 2, executable_offset);
+#else
+ code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 2);
+#endif
+ }
jump = jump->next;
}
else if (*buf_ptr == 0) {
- label->addr = (sljit_uw)code_ptr;
+ label->addr = ((sljit_uw)code_ptr) + executable_offset;
label->size = code_ptr - code;
label = label->next;
}
- else if (*buf_ptr == 1) {
+ else { /* *buf_ptr is 1 */
const_->addr = ((sljit_uw)code_ptr) - sizeof(sljit_sw);
const_ = const_->next;
}
- else {
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- *code_ptr++ = (*buf_ptr == 2) ? CALL_i32 : JMP_i32;
- buf_ptr++;
- sljit_unaligned_store_sw(code_ptr, *(sljit_sw*)buf_ptr - ((sljit_sw)code_ptr + sizeof(sljit_sw)));
- code_ptr += sizeof(sljit_sw);
- buf_ptr += sizeof(sljit_sw) - 1;
-#else
- code_ptr = generate_fixed_jump(code_ptr, *(sljit_sw*)(buf_ptr + 1), *buf_ptr);
- buf_ptr += sizeof(sljit_sw);
-#endif
- }
buf_ptr++;
}
} while (buf_ptr < buf_end);
@@ -548,24 +549,26 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
jump = compiler->jumps;
while (jump) {
+ jump_addr = jump->addr + executable_offset;
+
if (jump->flags & PATCH_MB) {
- SLJIT_ASSERT((sljit_sw)(jump->u.label->addr - (jump->addr + sizeof(sljit_s8))) >= -128 && (sljit_sw)(jump->u.label->addr - (jump->addr + sizeof(sljit_s8))) <= 127);
- *(sljit_u8*)jump->addr = (sljit_u8)(jump->u.label->addr - (jump->addr + sizeof(sljit_s8)));
+ SLJIT_ASSERT((sljit_sw)(jump->u.label->addr - (jump_addr + sizeof(sljit_s8))) >= -128 && (sljit_sw)(jump->u.label->addr - (jump_addr + sizeof(sljit_s8))) <= 127);
+ *(sljit_u8*)jump->addr = (sljit_u8)(jump->u.label->addr - (jump_addr + sizeof(sljit_s8)));
} else if (jump->flags & PATCH_MW) {
if (jump->flags & JUMP_LABEL) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- sljit_unaligned_store_sw((void*)jump->addr, (sljit_sw)(jump->u.label->addr - (jump->addr + sizeof(sljit_sw))));
+ sljit_unaligned_store_sw((void*)jump->addr, (sljit_sw)(jump->u.label->addr - (jump_addr + sizeof(sljit_sw))));
#else
- SLJIT_ASSERT((sljit_sw)(jump->u.label->addr - (jump->addr + sizeof(sljit_s32))) >= HALFWORD_MIN && (sljit_sw)(jump->u.label->addr - (jump->addr + sizeof(sljit_s32))) <= HALFWORD_MAX);
- sljit_unaligned_store_s32((void*)jump->addr, (sljit_s32)(jump->u.label->addr - (jump->addr + sizeof(sljit_s32))));
+ SLJIT_ASSERT((sljit_sw)(jump->u.label->addr - (jump_addr + sizeof(sljit_s32))) >= HALFWORD_MIN && (sljit_sw)(jump->u.label->addr - (jump_addr + sizeof(sljit_s32))) <= HALFWORD_MAX);
+ sljit_unaligned_store_s32((void*)jump->addr, (sljit_s32)(jump->u.label->addr - (jump_addr + sizeof(sljit_s32))));
#endif
}
else {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- sljit_unaligned_store_sw((void*)jump->addr, (sljit_sw)(jump->u.target - (jump->addr + sizeof(sljit_sw))));
+ sljit_unaligned_store_sw((void*)jump->addr, (sljit_sw)(jump->u.target - (jump_addr + sizeof(sljit_sw))));
#else
- SLJIT_ASSERT((sljit_sw)(jump->u.target - (jump->addr + sizeof(sljit_s32))) >= HALFWORD_MIN && (sljit_sw)(jump->u.target - (jump->addr + sizeof(sljit_s32))) <= HALFWORD_MAX);
- sljit_unaligned_store_s32((void*)jump->addr, (sljit_s32)(jump->u.target - (jump->addr + sizeof(sljit_s32))));
+ SLJIT_ASSERT((sljit_sw)(jump->u.target - (jump_addr + sizeof(sljit_s32))) >= HALFWORD_MIN && (sljit_sw)(jump->u.target - (jump_addr + sizeof(sljit_s32))) <= HALFWORD_MAX);
+ sljit_unaligned_store_s32((void*)jump->addr, (sljit_s32)(jump->u.target - (jump_addr + sizeof(sljit_s32))));
#endif
}
}
@@ -577,11 +580,54 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
jump = jump->next;
}
- /* Maybe we waste some space because of short jumps. */
+ /* Some space may be wasted because of short jumps. */
SLJIT_ASSERT(code_ptr <= code + compiler->size);
compiler->error = SLJIT_ERR_COMPILED;
+ compiler->executable_offset = executable_offset;
compiler->executable_size = code_ptr - code;
- return (void*)code;
+ return (void*)(code + executable_offset);
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+{
+ switch (feature_type) {
+ case SLJIT_HAS_FPU:
+#ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+#elif (defined SLJIT_DETECT_SSE2 && SLJIT_DETECT_SSE2)
+ if (cpu_has_sse2 == -1)
+ get_cpu_features();
+ return cpu_has_sse2;
+#else /* SLJIT_DETECT_SSE2 */
+ return 1;
+#endif /* SLJIT_DETECT_SSE2 */
+
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+ case SLJIT_HAS_VIRTUAL_REGISTERS:
+ return 1;
+#endif
+
+ case SLJIT_HAS_CLZ:
+ case SLJIT_HAS_CMOV:
+ if (cpu_has_cmov == -1)
+ get_cpu_features();
+ return cpu_has_cmov;
+
+ case SLJIT_HAS_PREF_SHIFT_REG:
+ return 1;
+
+ case SLJIT_HAS_SSE2:
+#if (defined SLJIT_DETECT_SSE2 && SLJIT_DETECT_SSE2)
+ if (cpu_has_sse2 == -1)
+ get_cpu_features();
+ return cpu_has_sse2;
+#else
+ return 1;
+#endif
+
+ default:
+ return 0;
+ }
}
/* --------------------------------------------------------------------- */
@@ -604,52 +650,8 @@ static sljit_s32 emit_mov(struct sljit_compiler *compiler,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw);
-static SLJIT_INLINE sljit_s32 emit_save_flags(struct sljit_compiler *compiler)
-{
- sljit_u8 *inst;
-
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 5);
- FAIL_IF(!inst);
- INC_SIZE(5);
-#else
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 6);
- FAIL_IF(!inst);
- INC_SIZE(6);
- *inst++ = REX_W;
-#endif
- *inst++ = LEA_r_m; /* lea esp/rsp, [esp/rsp + sizeof(sljit_sw)] */
- *inst++ = 0x64;
- *inst++ = 0x24;
- *inst++ = (sljit_u8)sizeof(sljit_sw);
- *inst++ = PUSHF;
- compiler->flags_saved = 1;
- return SLJIT_SUCCESS;
-}
-
-static SLJIT_INLINE sljit_s32 emit_restore_flags(struct sljit_compiler *compiler, sljit_s32 keep_flags)
-{
- sljit_u8 *inst;
-
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 5);
- FAIL_IF(!inst);
- INC_SIZE(5);
- *inst++ = POPF;
-#else
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 6);
- FAIL_IF(!inst);
- INC_SIZE(6);
- *inst++ = POPF;
- *inst++ = REX_W;
-#endif
- *inst++ = LEA_r_m; /* lea esp/rsp, [esp/rsp - sizeof(sljit_sw)] */
- *inst++ = 0x64;
- *inst++ = 0x24;
- *inst++ = (sljit_u8)(-(sljit_s8)sizeof(sljit_sw));
- compiler->flags_saved = keep_flags;
- return SLJIT_SUCCESS;
-}
+#define EMIT_MOV(compiler, dst, dstw, src, srcw) \
+ FAIL_IF(emit_mov(compiler, dst, dstw, src, srcw));
#ifdef _WIN32
#include <malloc.h>
@@ -680,15 +682,8 @@ static sljit_s32 emit_mov(struct sljit_compiler *compiler,
{
sljit_u8* inst;
- if (dst == SLJIT_UNUSED) {
- /* No destination, doesn't need to setup flags. */
- if (src & SLJIT_MEM) {
- inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, src, srcw);
- FAIL_IF(!inst);
- *inst = MOV_r_rm;
- }
- return SLJIT_SUCCESS;
- }
+ SLJIT_ASSERT(dst != SLJIT_UNUSED);
+
if (FAST_IS_REG(src)) {
inst = emit_x86_instruction(compiler, 1, src, 0, dst, dstw);
FAIL_IF(!inst);
@@ -710,8 +705,10 @@ static sljit_s32 emit_mov(struct sljit_compiler *compiler,
}
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
if (!compiler->mode32 && NOT_HALFWORD(srcw)) {
- FAIL_IF(emit_load_imm64(compiler, TMP_REG2, srcw));
- inst = emit_x86_instruction(compiler, 1, TMP_REG2, 0, dst, dstw);
+ /* Immediate to memory move. Only SLJIT_MOV operation copies
+ an immediate directly into memory so TMP_REG1 can be used. */
+ FAIL_IF(emit_load_imm64(compiler, TMP_REG1, srcw));
+ inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, dst, dstw);
FAIL_IF(!inst);
*inst = MOV_rm_r;
return SLJIT_SUCCESS;
@@ -729,7 +726,8 @@ static sljit_s32 emit_mov(struct sljit_compiler *compiler,
return SLJIT_SUCCESS;
}
- /* Memory to memory move. Requires two instruction. */
+ /* Memory to memory move. Only SLJIT_MOV operation copies
+ data from memory to memory so TMP_REG1 can be used. */
inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, src, srcw);
FAIL_IF(!inst);
*inst = MOV_r_rm;
@@ -739,9 +737,6 @@ static sljit_s32 emit_mov(struct sljit_compiler *compiler,
return SLJIT_SUCCESS;
}
-#define EMIT_MOV(compiler, dst, dstw, src, srcw) \
- FAIL_IF(emit_mov(compiler, dst, dstw, src, srcw));
-
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op)
{
sljit_u8 *inst;
@@ -771,20 +766,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
case SLJIT_DIVMOD_SW:
case SLJIT_DIV_UW:
case SLJIT_DIV_SW:
- compiler->flags_saved = 0;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
#ifdef _WIN64
- SLJIT_COMPILE_ASSERT(
+ SLJIT_ASSERT(
reg_map[SLJIT_R0] == 0
&& reg_map[SLJIT_R1] == 2
- && reg_map[TMP_REG1] > 7,
- invalid_register_assignment_for_div_mul);
+ && reg_map[TMP_REG1] > 7);
#else
- SLJIT_COMPILE_ASSERT(
+ SLJIT_ASSERT(
reg_map[SLJIT_R0] == 0
&& reg_map[SLJIT_R1] < 7
- && reg_map[TMP_REG1] == 2,
- invalid_register_assignment_for_div_mul);
+ && reg_map[TMP_REG1] == 2);
#endif
compiler->mode32 = op & SLJIT_I32_OP;
#endif
@@ -908,9 +900,6 @@ static sljit_s32 emit_mov_byte(struct sljit_compiler *compiler, sljit_s32 sign,
compiler->mode32 = 0;
#endif
- if (dst == SLJIT_UNUSED && !(src & SLJIT_MEM))
- return SLJIT_SUCCESS; /* Empty instruction. */
-
if (src & SLJIT_IMM) {
if (FAST_IS_REG(dst)) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
@@ -1039,6 +1028,30 @@ static sljit_s32 emit_mov_byte(struct sljit_compiler *compiler, sljit_s32 sign,
return SLJIT_SUCCESS;
}
+static sljit_s32 emit_prefetch(struct sljit_compiler *compiler, sljit_s32 op,
+ sljit_s32 src, sljit_sw srcw)
+{
+ sljit_u8* inst;
+
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+ compiler->mode32 = 1;
+#endif
+
+ inst = emit_x86_instruction(compiler, 2, 0, 0, src, srcw);
+ FAIL_IF(!inst);
+ *inst++ = GROUP_0F;
+ *inst++ = PREFETCH;
+
+ if (op >= SLJIT_MOV_U8 && op <= SLJIT_MOV_S8)
+ *inst |= (3 << 3);
+ else if (op >= SLJIT_MOV_U16 && op <= SLJIT_MOV_S16)
+ *inst |= (2 << 3);
+ else
+ *inst |= (1 << 3);
+
+ return SLJIT_SUCCESS;
+}
+
static sljit_s32 emit_mov_half(struct sljit_compiler *compiler, sljit_s32 sign,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
@@ -1050,9 +1063,6 @@ static sljit_s32 emit_mov_half(struct sljit_compiler *compiler, sljit_s32 sign,
compiler->mode32 = 0;
#endif
- if (dst == SLJIT_UNUSED && !(src & SLJIT_MEM))
- return SLJIT_SUCCESS; /* Empty instruction. */
-
if (src & SLJIT_IMM) {
if (FAST_IS_REG(dst)) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
@@ -1096,14 +1106,6 @@ static sljit_s32 emit_unary(struct sljit_compiler *compiler, sljit_u8 opcode,
{
sljit_u8* inst;
- if (dst == SLJIT_UNUSED) {
- EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
- inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
- FAIL_IF(!inst);
- *inst++ = GROUP_F7;
- *inst |= opcode;
- return SLJIT_SUCCESS;
- }
if (dst == src && dstw == srcw) {
/* Same input and output */
inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
@@ -1112,14 +1114,19 @@ static sljit_s32 emit_unary(struct sljit_compiler *compiler, sljit_u8 opcode,
*inst |= opcode;
return SLJIT_SUCCESS;
}
+
+ if (dst == SLJIT_UNUSED)
+ dst = TMP_REG1;
+
if (FAST_IS_REG(dst)) {
EMIT_MOV(compiler, dst, 0, src, srcw);
- inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
+ inst = emit_x86_instruction(compiler, 1, 0, 0, dst, 0);
FAIL_IF(!inst);
*inst++ = GROUP_F7;
*inst |= opcode;
return SLJIT_SUCCESS;
}
+
EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
FAIL_IF(!inst);
@@ -1135,20 +1142,12 @@ static sljit_s32 emit_not_with_flags(struct sljit_compiler *compiler,
{
sljit_u8* inst;
- if (dst == SLJIT_UNUSED) {
- EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
- inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
- FAIL_IF(!inst);
- *inst++ = GROUP_F7;
- *inst |= NOT_rm;
- inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, TMP_REG1, 0);
- FAIL_IF(!inst);
- *inst = OR_r_rm;
- return SLJIT_SUCCESS;
- }
+ if (dst == SLJIT_UNUSED)
+ dst = TMP_REG1;
+
if (FAST_IS_REG(dst)) {
EMIT_MOV(compiler, dst, 0, src, srcw);
- inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
+ inst = emit_x86_instruction(compiler, 1, 0, 0, dst, 0);
FAIL_IF(!inst);
*inst++ = GROUP_F7;
*inst |= NOT_rm;
@@ -1157,6 +1156,7 @@ static sljit_s32 emit_not_with_flags(struct sljit_compiler *compiler,
*inst = OR_r_rm;
return SLJIT_SUCCESS;
}
+
EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
FAIL_IF(!inst);
@@ -1169,6 +1169,10 @@ static sljit_s32 emit_not_with_flags(struct sljit_compiler *compiler,
return SLJIT_SUCCESS;
}
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+static const sljit_sw emit_clz_arg = 32 + 31;
+#endif
+
static sljit_s32 emit_clz(struct sljit_compiler *compiler, sljit_s32 op_flags,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
@@ -1177,22 +1181,6 @@ static sljit_s32 emit_clz(struct sljit_compiler *compiler, sljit_s32 op_flags,
sljit_s32 dst_r;
SLJIT_UNUSED_ARG(op_flags);
- if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED)) {
- /* Just set the zero flag. */
- EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
- inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
- FAIL_IF(!inst);
- *inst++ = GROUP_F7;
- *inst |= NOT_rm;
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_IMM, 31, TMP_REG1, 0);
-#else
- inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_IMM, !(op_flags & SLJIT_I32_OP) ? 63 : 31, TMP_REG1, 0);
-#endif
- FAIL_IF(!inst);
- *inst |= SHR;
- return SLJIT_SUCCESS;
- }
if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, srcw);
@@ -1200,81 +1188,53 @@ static sljit_s32 emit_clz(struct sljit_compiler *compiler, sljit_s32 op_flags,
srcw = 0;
}
- inst = emit_x86_instruction(compiler, 2, TMP_REG1, 0, src, srcw);
+ if (cpu_has_cmov == -1)
+ get_cpu_features();
+
+ dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
+
+ inst = emit_x86_instruction(compiler, 2, dst_r, 0, src, srcw);
FAIL_IF(!inst);
*inst++ = GROUP_0F;
*inst = BSR_r_rm;
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- if (FAST_IS_REG(dst))
- dst_r = dst;
- else {
- /* Find an unused temporary register. */
- if ((dst & REG_MASK) != SLJIT_R0 && (dst & OFFS_REG_MASK) != TO_OFFS_REG(SLJIT_R0))
- dst_r = SLJIT_R0;
- else if ((dst & REG_MASK) != SLJIT_R1 && (dst & OFFS_REG_MASK) != TO_OFFS_REG(SLJIT_R1))
- dst_r = SLJIT_R1;
+ if (cpu_has_cmov) {
+ if (dst_r != TMP_REG1) {
+ EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, 32 + 31);
+ inst = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG1, 0);
+ }
else
- dst_r = SLJIT_R2;
- EMIT_MOV(compiler, dst, dstw, dst_r, 0);
- }
- EMIT_MOV(compiler, dst_r, 0, SLJIT_IMM, 32 + 31);
-#else
- dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
- compiler->mode32 = 0;
- EMIT_MOV(compiler, dst_r, 0, SLJIT_IMM, !(op_flags & SLJIT_I32_OP) ? 64 + 63 : 32 + 31);
- compiler->mode32 = op_flags & SLJIT_I32_OP;
-#endif
+ inst = emit_x86_instruction(compiler, 2, dst_r, 0, SLJIT_MEM0(), (sljit_sw)&emit_clz_arg);
- if (cpu_has_cmov == -1)
- get_cpu_features();
-
- if (cpu_has_cmov) {
- inst = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG1, 0);
FAIL_IF(!inst);
*inst++ = GROUP_0F;
- *inst = CMOVNE_r_rm;
- } else {
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
- FAIL_IF(!inst);
- INC_SIZE(4);
+ *inst = CMOVE_r_rm;
+ }
+ else
+ FAIL_IF(sljit_emit_cmov_generic(compiler, SLJIT_EQUAL, dst_r, SLJIT_IMM, 32 + 31));
- *inst++ = JE_i8;
- *inst++ = 2;
- *inst++ = MOV_r_rm;
- *inst++ = MOD_REG | (reg_map[dst_r] << 3) | reg_map[TMP_REG1];
+ inst = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, 31, dst_r, 0);
#else
- inst = (sljit_u8*)ensure_buf(compiler, 1 + 5);
- FAIL_IF(!inst);
- INC_SIZE(5);
+ if (cpu_has_cmov) {
+ EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, !(op_flags & SLJIT_I32_OP) ? (64 + 63) : (32 + 31));
- *inst++ = JE_i8;
- *inst++ = 3;
- *inst++ = REX_W | (reg_map[dst_r] >= 8 ? REX_R : 0) | (reg_map[TMP_REG1] >= 8 ? REX_B : 0);
- *inst++ = MOV_r_rm;
- *inst++ = MOD_REG | (reg_lmap[dst_r] << 3) | reg_lmap[TMP_REG1];
-#endif
+ inst = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG2, 0);
+ FAIL_IF(!inst);
+ *inst++ = GROUP_0F;
+ *inst = CMOVE_r_rm;
}
+ else
+ FAIL_IF(sljit_emit_cmov_generic(compiler, SLJIT_EQUAL, dst_r, SLJIT_IMM, !(op_flags & SLJIT_I32_OP) ? (64 + 63) : (32 + 31)));
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- inst = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, 31, dst_r, 0);
-#else
inst = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, !(op_flags & SLJIT_I32_OP) ? 63 : 31, dst_r, 0);
#endif
+
FAIL_IF(!inst);
*(inst + 1) |= XOR;
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- if (dst & SLJIT_MEM) {
- inst = emit_x86_instruction(compiler, 1, dst_r, 0, dst, dstw);
- FAIL_IF(!inst);
- *inst = XCHG_r_rm;
- }
-#else
if (dst & SLJIT_MEM)
- EMIT_MOV(compiler, dst, dstw, TMP_REG2, 0);
-#endif
+ EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
return SLJIT_SUCCESS;
}
@@ -1282,7 +1242,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
- sljit_u8* inst;
sljit_s32 update = 0;
sljit_s32 op_flags = GET_ALL_FLAGS(op);
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
@@ -1303,7 +1262,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
compiler->mode32 = op_flags & SLJIT_I32_OP;
#endif
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op)) {
+ if (op <= SLJIT_MOV_P && (src & SLJIT_MEM))
+ return emit_prefetch(compiler, op, src, srcw);
+ return SLJIT_SUCCESS;
+ }
+
op = GET_OPCODE(op);
+
if (op >= SLJIT_MOV && op <= SLJIT_MOVU_P) {
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
compiler->mode32 = 0;
@@ -1361,14 +1327,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
#endif
}
- if (SLJIT_UNLIKELY(update) && (src & SLJIT_MEM) && !src_is_ereg && (src & REG_MASK) && (srcw != 0 || (src & OFFS_REG_MASK) != 0)) {
- inst = emit_x86_instruction(compiler, 1, src & REG_MASK, 0, src, srcw);
- FAIL_IF(!inst);
- *inst = LEA_r_m;
- src &= SLJIT_MEM | 0xf;
- srcw = 0;
- }
-
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
if (SLJIT_UNLIKELY(dst_is_ereg) && (!(op == SLJIT_MOV || op == SLJIT_MOV_U32 || op == SLJIT_MOV_S32 || op == SLJIT_MOV_P) || (src & SLJIT_MEM))) {
SLJIT_ASSERT(dst == SLJIT_MEM1(SLJIT_SP));
@@ -1412,31 +1370,40 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
return emit_mov(compiler, SLJIT_MEM1(SLJIT_SP), dstw, TMP_REG1, 0);
#endif
- if (SLJIT_UNLIKELY(update) && (dst & SLJIT_MEM) && (dst & REG_MASK) && (dstw != 0 || (dst & OFFS_REG_MASK) != 0)) {
- inst = emit_x86_instruction(compiler, 1, dst & REG_MASK, 0, dst, dstw);
- FAIL_IF(!inst);
- *inst = LEA_r_m;
+ if (SLJIT_UNLIKELY(update) && (src & SLJIT_MEM) && !src_is_ereg && (src & REG_MASK)) {
+ if ((src & OFFS_REG_MASK) != 0) {
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ (src & REG_MASK), 0, (src & REG_MASK), 0, OFFS_REG(dst), 0));
+ }
+ else if (srcw != 0) {
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ (src & REG_MASK), 0, (src & REG_MASK), 0, SLJIT_IMM, srcw));
+ }
+ }
+
+ if (SLJIT_UNLIKELY(update) && (dst & SLJIT_MEM) && (dst & REG_MASK)) {
+ if ((dst & OFFS_REG_MASK) != 0) {
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ (dst & REG_MASK), 0, (dst & REG_MASK), 0, OFFS_REG(dst), 0));
+ }
+ else if (dstw != 0) {
+ FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
+ (dst & REG_MASK), 0, (dst & REG_MASK), 0, SLJIT_IMM, dstw));
+ }
}
return SLJIT_SUCCESS;
}
- if (SLJIT_UNLIKELY(GET_FLAGS(op_flags)))
- compiler->flags_saved = 0;
-
switch (op) {
case SLJIT_NOT:
- if (SLJIT_UNLIKELY(op_flags & SLJIT_SET_E))
+ if (SLJIT_UNLIKELY(op_flags & SLJIT_SET_Z))
return emit_not_with_flags(compiler, dst, dstw, src, srcw);
return emit_unary(compiler, NOT_rm, dst, dstw, src, srcw);
case SLJIT_NEG:
- if (SLJIT_UNLIKELY(op_flags & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
- FAIL_IF(emit_save_flags(compiler));
return emit_unary(compiler, NEG_rm, dst, dstw, src, srcw);
case SLJIT_CLZ:
- if (SLJIT_UNLIKELY(op_flags & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
- FAIL_IF(emit_save_flags(compiler));
return emit_clz(compiler, op_flags, dst, dstw, src, srcw);
}
@@ -1456,8 +1423,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compile
*(inst + 1) |= (op_imm); \
} \
else { \
- FAIL_IF(emit_load_imm64(compiler, TMP_REG2, immw)); \
- inst = emit_x86_instruction(compiler, 1, TMP_REG2, 0, arg, argw); \
+ FAIL_IF(emit_load_imm64(compiler, (arg == TMP_REG1) ? TMP_REG2 : TMP_REG1, immw)); \
+ inst = emit_x86_instruction(compiler, 1, (arg == TMP_REG1) ? TMP_REG2 : TMP_REG1, 0, arg, argw); \
FAIL_IF(!inst); \
*inst = (op_mr); \
}
@@ -1683,7 +1650,7 @@ static sljit_s32 emit_mul(struct sljit_compiler *compiler,
sljit_u8* inst;
sljit_s32 dst_r;
- dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
+ dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
/* Register destination. */
if (dst_r == src1 && !(src2 & SLJIT_IMM)) {
@@ -1735,9 +1702,9 @@ static sljit_s32 emit_mul(struct sljit_compiler *compiler,
sljit_unaligned_store_s32(inst, (sljit_s32)src1w);
}
else {
- EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);
if (dst_r != src2)
EMIT_MOV(compiler, dst_r, 0, src2, src2w);
+ FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src1w));
inst = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG2, 0);
FAIL_IF(!inst);
*inst++ = GROUP_0F;
@@ -1778,9 +1745,9 @@ static sljit_s32 emit_mul(struct sljit_compiler *compiler,
sljit_unaligned_store_s32(inst, (sljit_s32)src2w);
}
else {
- EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src2w);
if (dst_r != src1)
EMIT_MOV(compiler, dst_r, 0, src1, src1w);
+ FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src2w));
inst = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG2, 0);
FAIL_IF(!inst);
*inst++ = GROUP_0F;
@@ -1799,13 +1766,13 @@ static sljit_s32 emit_mul(struct sljit_compiler *compiler,
*inst = IMUL_r_rm;
}
- if (dst_r == TMP_REG1)
+ if (dst & SLJIT_MEM)
EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
return SLJIT_SUCCESS;
}
-static sljit_s32 emit_lea_binary(struct sljit_compiler *compiler, sljit_s32 keep_flags,
+static sljit_s32 emit_lea_binary(struct sljit_compiler *compiler,
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
@@ -1814,12 +1781,10 @@ static sljit_s32 emit_lea_binary(struct sljit_compiler *compiler, sljit_s32 keep
sljit_s32 dst_r, done = 0;
/* These cases better be left to handled by normal way. */
- if (!keep_flags) {
- if (dst == src1 && dstw == src1w)
- return SLJIT_ERR_UNSUPPORTED;
- if (dst == src2 && dstw == src2w)
- return SLJIT_ERR_UNSUPPORTED;
- }
+ if (dst == src1 && dstw == src1w)
+ return SLJIT_ERR_UNSUPPORTED;
+ if (dst == src2 && dstw == src2w)
+ return SLJIT_ERR_UNSUPPORTED;
dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
@@ -1931,7 +1896,7 @@ static sljit_s32 emit_test_binary(struct sljit_compiler *compiler,
}
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
- if (src2 == SLJIT_R0 && (src2 & SLJIT_IMM) && (src1w > 127 || src1w < -128) && (compiler->mode32 || IS_HALFWORD(src1w))) {
+ if (src2 == SLJIT_R0 && (src1 & SLJIT_IMM) && (src1w > 127 || src1w < -128) && (compiler->mode32 || IS_HALFWORD(src1w))) {
#else
if (src2 == SLJIT_R0 && (src1 & SLJIT_IMM) && (src1w > 127 || src1w < -128)) {
#endif
@@ -1948,8 +1913,8 @@ static sljit_s32 emit_test_binary(struct sljit_compiler *compiler,
*inst = GROUP_F7;
}
else {
- FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src2w));
- inst = emit_x86_instruction(compiler, 1, TMP_REG2, 0, src1, src1w);
+ FAIL_IF(emit_load_imm64(compiler, TMP_REG1, src2w));
+ inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, src1, src1w);
FAIL_IF(!inst);
*inst = TEST_rm_r;
}
@@ -1977,8 +1942,8 @@ static sljit_s32 emit_test_binary(struct sljit_compiler *compiler,
*inst = GROUP_F7;
}
else {
- FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src1w));
- inst = emit_x86_instruction(compiler, 1, TMP_REG2, 0, src2, src2w);
+ FAIL_IF(emit_load_imm64(compiler, TMP_REG1, src1w));
+ inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, src2, src2w);
FAIL_IF(!inst);
*inst = TEST_rm_r;
}
@@ -2090,25 +2055,29 @@ static sljit_s32 emit_shift(struct sljit_compiler *compiler,
EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
}
else {
- /* This case is really difficult, since ecx itself may used for
- addressing, and we must ensure to work even in that case. */
+ /* This case is complex since ecx itself may be used for
+ addressing, and this case must be supported as well. */
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
- EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_PREF_SHIFT_REG, 0);
-#else
- /* [esp+0] contains the flags. */
- EMIT_MOV(compiler, SLJIT_MEM1(SLJIT_SP), sizeof(sljit_sw), SLJIT_PREF_SHIFT_REG, 0);
-#endif
+ EMIT_MOV(compiler, SLJIT_MEM1(SLJIT_SP), 0, SLJIT_PREF_SHIFT_REG, 0);
EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
FAIL_IF(!inst);
*inst |= mode;
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
- EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG2, 0);
+ EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, SLJIT_MEM1(SLJIT_SP), 0);
+ EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
#else
- EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, SLJIT_MEM1(SLJIT_SP), sizeof(sljit_sw));
-#endif
+ EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
+ EMIT_MOV(compiler, TMP_REG2, 0, src2, src2w);
+ inst = emit_x86_instruction(compiler, 1, TMP_REG2, 0, SLJIT_PREF_SHIFT_REG, 0);
+ FAIL_IF(!inst);
+ *inst = XCHG_r_rm;
+ inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
+ FAIL_IF(!inst);
+ *inst |= mode;
+ EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG2, 0);
EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
+#endif
}
return SLJIT_SUCCESS;
@@ -2167,54 +2136,31 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
compiler->mode32 = op & SLJIT_I32_OP;
#endif
- if (GET_OPCODE(op) >= SLJIT_MUL) {
- if (SLJIT_UNLIKELY(GET_FLAGS(op)))
- compiler->flags_saved = 0;
- else if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
- FAIL_IF(emit_save_flags(compiler));
- }
+ if (dst == SLJIT_UNUSED && !HAS_FLAGS(op))
+ return SLJIT_SUCCESS;
switch (GET_OPCODE(op)) {
case SLJIT_ADD:
- if (!GET_FLAGS(op)) {
- if (emit_lea_binary(compiler, op & SLJIT_KEEP_FLAGS, dst, dstw, src1, src1w, src2, src2w) != SLJIT_ERR_UNSUPPORTED)
+ if (!HAS_FLAGS(op)) {
+ if (emit_lea_binary(compiler, dst, dstw, src1, src1w, src2, src2w) != SLJIT_ERR_UNSUPPORTED)
return compiler->error;
}
- else
- compiler->flags_saved = 0;
- if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
- FAIL_IF(emit_save_flags(compiler));
return emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_ADDC:
- if (SLJIT_UNLIKELY(compiler->flags_saved)) /* C flag must be restored. */
- FAIL_IF(emit_restore_flags(compiler, 1));
- else if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS))
- FAIL_IF(emit_save_flags(compiler));
- if (SLJIT_UNLIKELY(GET_FLAGS(op)))
- compiler->flags_saved = 0;
return emit_cum_binary(compiler, ADC_r_rm, ADC_rm_r, ADC, ADC_EAX_i32,
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_SUB:
- if (!GET_FLAGS(op)) {
- if ((src2 & SLJIT_IMM) && emit_lea_binary(compiler, op & SLJIT_KEEP_FLAGS, dst, dstw, src1, src1w, SLJIT_IMM, -src2w) != SLJIT_ERR_UNSUPPORTED)
+ if (!HAS_FLAGS(op)) {
+ if ((src2 & SLJIT_IMM) && emit_lea_binary(compiler, dst, dstw, src1, src1w, SLJIT_IMM, -src2w) != SLJIT_ERR_UNSUPPORTED)
return compiler->error;
}
- else
- compiler->flags_saved = 0;
- if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
- FAIL_IF(emit_save_flags(compiler));
+
if (dst == SLJIT_UNUSED)
return emit_cmp_binary(compiler, src1, src1w, src2, src2w);
return emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_SUBC:
- if (SLJIT_UNLIKELY(compiler->flags_saved)) /* C flag must be restored. */
- FAIL_IF(emit_restore_flags(compiler, 1));
- else if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS))
- FAIL_IF(emit_save_flags(compiler));
- if (SLJIT_UNLIKELY(GET_FLAGS(op)))
- compiler->flags_saved = 0;
return emit_non_cum_binary(compiler, SBB_r_rm, SBB_rm_r, SBB, SBB_EAX_i32,
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_MUL:
@@ -2231,13 +2177,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compile
return emit_cum_binary(compiler, XOR_r_rm, XOR_rm_r, XOR, XOR_EAX_i32,
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_SHL:
- return emit_shift_with_flags(compiler, SHL, GET_FLAGS(op),
+ return emit_shift_with_flags(compiler, SHL, HAS_FLAGS(op),
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_LSHR:
- return emit_shift_with_flags(compiler, SHR, GET_FLAGS(op),
+ return emit_shift_with_flags(compiler, SHR, HAS_FLAGS(op),
dst, dstw, src1, src1w, src2, src2w);
case SLJIT_ASHR:
- return emit_shift_with_flags(compiler, SAR, GET_FLAGS(op),
+ return emit_shift_with_flags(compiler, SAR, HAS_FLAGS(op),
dst, dstw, src1, src1w, src2, src2w);
}
@@ -2248,7 +2194,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_register_index(sljit_s32 reg)
{
CHECK_REG_INDEX(check_sljit_get_register_index(reg));
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- if (reg >= SLJIT_R3 && reg <= SLJIT_R6)
+ if (reg >= SLJIT_R3 && reg <= SLJIT_R8)
return -1;
#endif
return reg_map[reg];
@@ -2279,36 +2225,25 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *c
/* Floating point operators */
/* --------------------------------------------------------------------- */
-/* Alignment + 2 * 16 bytes. */
-static sljit_s32 sse2_data[3 + (4 + 4) * 2];
+/* Alignment(3) + 4 * 16 bytes. */
+static sljit_s32 sse2_data[3 + (4 * 4)];
static sljit_s32 *sse2_buffer;
static void init_compiler(void)
{
+ /* Align to 16 bytes. */
sse2_buffer = (sljit_s32*)(((sljit_uw)sse2_data + 15) & ~0xf);
- /* Single precision constants. */
+
+ /* Single precision constants (each constant is 16 byte long). */
sse2_buffer[0] = 0x80000000;
sse2_buffer[4] = 0x7fffffff;
- /* Double precision constants. */
+ /* Double precision constants (each constant is 16 byte long). */
sse2_buffer[8] = 0;
sse2_buffer[9] = 0x80000000;
sse2_buffer[12] = 0xffffffff;
sse2_buffer[13] = 0x7fffffff;
}
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_is_fpu_available(void)
-{
-#ifdef SLJIT_IS_FPU_AVAILABLE
- return SLJIT_IS_FPU_AVAILABLE;
-#elif (defined SLJIT_DETECT_SSE2 && SLJIT_DETECT_SSE2)
- if (cpu_has_sse2 == -1)
- get_cpu_features();
- return cpu_has_sse2;
-#else /* SLJIT_DETECT_SSE2 */
- return 1;
-#endif /* SLJIT_DETECT_SSE2 */
-}
-
static sljit_s32 emit_sse2(struct sljit_compiler *compiler, sljit_u8 opcode,
sljit_s32 single, sljit_s32 xmm1, sljit_s32 xmm2, sljit_sw xmm2w)
{
@@ -2349,7 +2284,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
sljit_s32 dst, sljit_sw dstw,
sljit_s32 src, sljit_sw srcw)
{
- sljit_s32 dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG1;
+ sljit_s32 dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
sljit_u8 *inst;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
@@ -2362,7 +2297,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
*inst++ = GROUP_0F;
*inst = CVTTSD2SI_r_xm;
- if (dst_r == TMP_REG1 && dst != SLJIT_UNUSED)
+ if (dst & SLJIT_MEM)
return emit_mov(compiler, dst, dstw, TMP_REG1, 0);
return SLJIT_SUCCESS;
}
@@ -2406,7 +2341,6 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
sljit_s32 src1, sljit_sw src1w,
sljit_s32 src2, sljit_sw src2w)
{
- compiler->flags_saved = 0;
if (!FAST_IS_REG(src1)) {
FAIL_IF(emit_sse2_load(compiler, op & SLJIT_F32_OP, TMP_FREG, src1, src1w));
src1 = TMP_FREG;
@@ -2455,7 +2389,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compil
return SLJIT_SUCCESS;
}
- if (SLOW_IS_REG(dst)) {
+ if (FAST_IS_REG(dst)) {
dst_r = dst;
if (dst != src)
FAIL_IF(emit_sse2_load(compiler, op & SLJIT_F32_OP, dst_r, src, srcw));
@@ -2553,11 +2487,6 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi
CHECK_ERROR_PTR();
CHECK_PTR(check_sljit_emit_label(compiler));
- /* We should restore the flags before the label,
- since other taken jumps has their own flags as well. */
- if (SLJIT_UNLIKELY(compiler->flags_saved))
- PTR_FAIL_IF(emit_restore_flags(compiler, 0));
-
if (compiler->last_label && compiler->last_label->size == compiler->size)
return compiler->last_label;
@@ -2582,12 +2511,6 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
CHECK_ERROR_PTR();
CHECK_PTR(check_sljit_emit_jump(compiler, type));
- if (SLJIT_UNLIKELY(compiler->flags_saved)) {
- if ((type & 0xff) <= SLJIT_JUMP)
- PTR_FAIL_IF(emit_restore_flags(compiler, 0));
- compiler->flags_saved = 0;
- }
-
jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
PTR_FAIL_IF_NULL(jump);
set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP);
@@ -2607,10 +2530,18 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
PTR_FAIL_IF_NULL(inst);
*inst++ = 0;
- *inst++ = type + 4;
+ *inst++ = type + 2;
return jump;
}
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+#ifndef _WIN64
+#define IS_REG_CHANGED_BY_CALL(src, type) ((src) == SLJIT_R3)
+#else
+#define IS_REG_CHANGED_BY_CALL(src, type) ((src) == SLJIT_R2)
+#endif
+#endif
+
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 src, sljit_sw srcw)
{
sljit_u8 *inst;
@@ -2622,12 +2553,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
CHECK_EXTRA_REGS(src, srcw, (void)0);
- if (SLJIT_UNLIKELY(compiler->flags_saved)) {
- if (type <= SLJIT_JUMP)
- FAIL_IF(emit_restore_flags(compiler, 0));
- compiler->flags_saved = 0;
- }
-
if (type >= SLJIT_CALL1) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
@@ -2638,11 +2563,10 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
if (src == SLJIT_MEM1(SLJIT_SP) && type >= SLJIT_CALL3)
srcw += sizeof(sljit_sw);
#endif
-#endif
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && defined(_WIN64)
- if (src == SLJIT_R2) {
- EMIT_MOV(compiler, TMP_REG1, 0, src, 0);
- src = TMP_REG1;
+#else
+ if ((src & SLJIT_MEM) || IS_REG_CHANGED_BY_CALL(src, type)) {
+ EMIT_MOV(compiler, TMP_REG2, 0, src, srcw);
+ src = TMP_REG2;
}
#endif
FAIL_IF(call_with_args(compiler, type));
@@ -2665,7 +2589,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
FAIL_IF_NULL(inst);
*inst++ = 0;
- *inst++ = type + 4;
+ *inst++ = type + 2;
}
else {
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
@@ -2682,37 +2606,29 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 op,
sljit_s32 dst, sljit_sw dstw,
- sljit_s32 src, sljit_sw srcw,
sljit_s32 type)
{
sljit_u8 *inst;
sljit_u8 cond_set = 0;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
sljit_s32 reg;
-#else
- /* CHECK_EXTRA_REGS migh overwrite these values. */
+#endif
+ /* ADJUST_LOCAL_OFFSET and CHECK_EXTRA_REGS might overwrite these values. */
sljit_s32 dst_save = dst;
sljit_sw dstw_save = dstw;
-#endif
CHECK_ERROR();
- CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, src, srcw, type));
- SLJIT_UNUSED_ARG(srcw);
-
- if (dst == SLJIT_UNUSED)
- return SLJIT_SUCCESS;
+ CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type));
ADJUST_LOCAL_OFFSET(dst, dstw);
CHECK_EXTRA_REGS(dst, dstw, (void)0);
- if (SLJIT_UNLIKELY(compiler->flags_saved))
- FAIL_IF(emit_restore_flags(compiler, op & SLJIT_KEEP_FLAGS));
type &= 0xff;
/* setcc = jcc + 0x10. */
cond_set = get_jump_code(type) + 0x10;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
- if (GET_OPCODE(op) == SLJIT_OR && !GET_ALL_FLAGS(op) && FAST_IS_REG(dst) && dst == src) {
+ if (GET_OPCODE(op) == SLJIT_OR && !GET_ALL_FLAGS(op) && FAST_IS_REG(dst)) {
inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 + 3);
FAIL_IF(!inst);
INC_SIZE(4 + 3);
@@ -2727,7 +2643,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
return SLJIT_SUCCESS;
}
- reg = (op == SLJIT_MOV && FAST_IS_REG(dst)) ? dst : TMP_REG1;
+ reg = (GET_OPCODE(op) < SLJIT_ADD && FAST_IS_REG(dst)) ? dst : TMP_REG1;
inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 + 4);
FAIL_IF(!inst);
@@ -2738,6 +2654,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
*inst++ = cond_set;
*inst++ = MOD_REG | reg_lmap[reg];
*inst++ = REX_W | (reg_map[reg] <= 7 ? 0 : (REX_B | REX_R));
+ /* The movzx instruction does not affect flags. */
*inst++ = GROUP_0F;
*inst++ = MOVZX_r_rm8;
*inst = MOD_REG | (reg_lmap[reg] << 3) | reg_lmap[reg];
@@ -2749,12 +2666,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
compiler->mode32 = GET_OPCODE(op) != SLJIT_MOV;
return emit_mov(compiler, dst, dstw, TMP_REG1, 0);
}
+
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
|| (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
compiler->skip_checks = 1;
#endif
- return sljit_emit_op2(compiler, op, dst, dstw, dst, dstw, TMP_REG1, 0);
-#else /* SLJIT_CONFIG_X86_64 */
+ return sljit_emit_op2(compiler, op, dst_save, dstw_save, dst_save, dstw_save, TMP_REG1, 0);
+
+#else
+ /* The SLJIT_CONFIG_X86_32 code path starts here. */
if (GET_OPCODE(op) < SLJIT_ADD && FAST_IS_REG(dst)) {
if (reg_map[dst] <= 4) {
/* Low byte is accessible. */
@@ -2808,8 +2728,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
return SLJIT_SUCCESS;
}
- if (GET_OPCODE(op) == SLJIT_OR && !GET_ALL_FLAGS(op) && FAST_IS_REG(dst) && dst == src && reg_map[dst] <= 4) {
- SLJIT_COMPILE_ASSERT(reg_map[SLJIT_R0] == 0, scratch_reg1_must_be_eax);
+ if (GET_OPCODE(op) == SLJIT_OR && !GET_ALL_FLAGS(op) && FAST_IS_REG(dst) && reg_map[dst] <= 4) {
+ SLJIT_ASSERT(reg_map[SLJIT_R0] == 0);
+
if (dst != SLJIT_R0) {
inst = (sljit_u8*)ensure_buf(compiler, 1 + 1 + 3 + 2 + 1);
FAIL_IF(!inst);
@@ -2868,6 +2789,46 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
#endif /* SLJIT_CONFIG_X86_64 */
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type,
+ sljit_s32 dst_reg,
+ sljit_s32 src, sljit_sw srcw)
+{
+ sljit_u8* inst;
+
+ CHECK_ERROR();
+ CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw));
+
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+ dst_reg &= ~SLJIT_I32_OP;
+
+ if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV) || (dst_reg >= SLJIT_R3 && dst_reg <= SLJIT_S3))
+ return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);
+#else
+ if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV))
+ return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);
+#endif
+
+ /* ADJUST_LOCAL_OFFSET is not needed. */
+ CHECK_EXTRA_REGS(src, srcw, (void)0);
+
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+ compiler->mode32 = dst_reg & SLJIT_I32_OP;
+ dst_reg &= ~SLJIT_I32_OP;
+#endif
+
+ if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
+ EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, srcw);
+ src = TMP_REG1;
+ srcw = 0;
+ }
+
+ inst = emit_x86_instruction(compiler, 2, dst_reg, 0, src, srcw);
+ FAIL_IF(!inst);
+ *inst++ = GROUP_0F;
+ *inst = get_jump_code(type & 0xff) - 0x40;
+ return SLJIT_SUCCESS;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset)
{
CHECK_ERROR();
@@ -2886,16 +2847,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *c
if (NOT_HALFWORD(offset)) {
FAIL_IF(emit_load_imm64(compiler, TMP_REG1, offset));
#if (defined SLJIT_DEBUG && SLJIT_DEBUG)
- SLJIT_ASSERT(emit_lea_binary(compiler, SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_SP, 0, TMP_REG1, 0) != SLJIT_ERR_UNSUPPORTED);
+ SLJIT_ASSERT(emit_lea_binary(compiler, dst, dstw, SLJIT_SP, 0, TMP_REG1, 0) != SLJIT_ERR_UNSUPPORTED);
return compiler->error;
#else
- return emit_lea_binary(compiler, SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_SP, 0, TMP_REG1, 0);
+ return emit_lea_binary(compiler, dst, dstw, SLJIT_SP, 0, TMP_REG1, 0);
#endif
}
#endif
if (offset != 0)
- return emit_lea_binary(compiler, SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_SP, 0, SLJIT_IMM, offset);
+ return emit_lea_binary(compiler, dst, dstw, SLJIT_SP, 0, SLJIT_IMM, offset);
return emit_mov(compiler, dst, dstw, SLJIT_SP, 0);
}
@@ -2919,14 +2880,11 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
compiler->mode32 = 0;
- reg = SLOW_IS_REG(dst) ? dst : TMP_REG1;
+ reg = FAST_IS_REG(dst) ? dst : TMP_REG1;
if (emit_load_imm64(compiler, reg, init_value))
return NULL;
#else
- if (dst == SLJIT_UNUSED)
- dst = TMP_REG1;
-
if (emit_mov(compiler, dst, dstw, SLJIT_IMM, init_value))
return NULL;
#endif
@@ -2946,82 +2904,18 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
return const_;
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
{
+ SLJIT_UNUSED_ARG(executable_offset);
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- sljit_unaligned_store_sw((void*)addr, new_addr - (addr + 4));
+ sljit_unaligned_store_sw((void*)addr, new_target - (addr + 4) - (sljit_uw)executable_offset);
#else
- sljit_unaligned_store_sw((void*)addr, (sljit_sw) new_addr);
+ sljit_unaligned_store_sw((void*)addr, (sljit_sw) new_target);
#endif
}
-SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
{
+ SLJIT_UNUSED_ARG(executable_offset);
sljit_unaligned_store_sw((void*)addr, new_constant);
}
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_x86_is_sse2_available(void)
-{
-#if (defined SLJIT_DETECT_SSE2 && SLJIT_DETECT_SSE2)
- if (cpu_has_sse2 == -1)
- get_cpu_features();
- return cpu_has_sse2;
-#else
- return 1;
-#endif
-}
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_x86_is_cmov_available(void)
-{
- if (cpu_has_cmov == -1)
- get_cpu_features();
- return cpu_has_cmov;
-}
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_x86_emit_cmov(struct sljit_compiler *compiler,
- sljit_s32 type,
- sljit_s32 dst_reg,
- sljit_s32 src, sljit_sw srcw)
-{
- sljit_u8* inst;
-
- CHECK_ERROR();
-#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
- CHECK_ARGUMENT(sljit_x86_is_cmov_available());
- CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_I32_OP)));
- CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_ORDERED_F64);
- CHECK_ARGUMENT(FUNCTION_CHECK_IS_REG(dst_reg & ~SLJIT_I32_OP));
- FUNCTION_CHECK_SRC(src, srcw);
-#endif
-#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
- if (SLJIT_UNLIKELY(!!compiler->verbose)) {
- fprintf(compiler->verbose, " x86_cmov%s %s%s, ",
- !(dst_reg & SLJIT_I32_OP) ? "" : ".i",
- jump_names[type & 0xff], JUMP_POSTFIX(type));
- sljit_verbose_reg(compiler, dst_reg & ~SLJIT_I32_OP);
- fprintf(compiler->verbose, ", ");
- sljit_verbose_param(compiler, src, srcw);
- fprintf(compiler->verbose, "\n");
- }
-#endif
-
- ADJUST_LOCAL_OFFSET(src, srcw);
- CHECK_EXTRA_REGS(src, srcw, (void)0);
-
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
- compiler->mode32 = dst_reg & SLJIT_I32_OP;
-#endif
- dst_reg &= ~SLJIT_I32_OP;
-
- if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
- EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, srcw);
- src = TMP_REG1;
- srcw = 0;
- }
-
- inst = emit_x86_instruction(compiler, 2, dst_reg, 0, src, srcw);
- FAIL_IF(!inst);
- *inst++ = GROUP_0F;
- *inst = get_jump_code(type & 0xff) - 0x40;
- return SLJIT_SUCCESS;
-}
diff --git a/src/3rdparty/pcre2/src/sljit/sljitUtils.c b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
index ec5c321194..9029db292c 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitUtils.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
@@ -1,7 +1,7 @@
/*
* Stack-less Just-In-Time compiler
*
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
+ * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -206,10 +206,7 @@ static sljit_sw sljit_page_align = 0;
SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(sljit_uw limit, sljit_uw max_limit, void *allocator_data)
{
struct sljit_stack *stack;
- union {
- void *ptr;
- sljit_uw uw;
- } base;
+ void *ptr;
#ifdef _WIN32
SYSTEM_INFO si;
#endif
@@ -233,29 +230,29 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj
}
#endif
- /* Align limit and max_limit. */
- max_limit = (max_limit + sljit_page_align) & ~sljit_page_align;
-
stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data);
if (!stack)
return NULL;
+ /* Align max_limit. */
+ max_limit = (max_limit + sljit_page_align) & ~sljit_page_align;
+
#ifdef _WIN32
- base.ptr = VirtualAlloc(NULL, max_limit, MEM_RESERVE, PAGE_READWRITE);
- if (!base.ptr) {
+ ptr = VirtualAlloc(NULL, max_limit, MEM_RESERVE, PAGE_READWRITE);
+ if (!ptr) {
SLJIT_FREE(stack, allocator_data);
return NULL;
}
- stack->base = base.uw;
+ stack->max_limit = (sljit_u8 *)ptr;
+ stack->base = stack->max_limit + max_limit;
stack->limit = stack->base;
- stack->max_limit = stack->base + max_limit;
- if (sljit_stack_resize(stack, stack->base + limit)) {
+ if (sljit_stack_resize(stack, stack->base - limit)) {
sljit_free_stack(stack, allocator_data);
return NULL;
}
#else
#ifdef MAP_ANON
- base.ptr = mmap(NULL, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ ptr = mmap(NULL, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
#else
if (dev_zero < 0) {
if (open_dev_zero()) {
@@ -263,15 +260,15 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj
return NULL;
}
}
- base.ptr = mmap(NULL, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE, dev_zero, 0);
+ ptr = mmap(NULL, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE, dev_zero, 0);
#endif
- if (base.ptr == MAP_FAILED) {
+ if (ptr == MAP_FAILED) {
SLJIT_FREE(stack, allocator_data);
return NULL;
}
- stack->base = base.uw;
- stack->limit = stack->base + limit;
- stack->max_limit = stack->base + max_limit;
+ stack->max_limit = (sljit_u8 *)ptr;
+ stack->base = stack->max_limit + max_limit;
+ stack->limit = stack->base - limit;
#endif
stack->top = stack->base;
return stack;
@@ -279,53 +276,53 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj
#undef PAGE_ALIGN
-SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_free_stack(struct sljit_stack* stack, void *allocator_data)
+SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_free_stack(struct sljit_stack *stack, void *allocator_data)
{
SLJIT_UNUSED_ARG(allocator_data);
#ifdef _WIN32
- VirtualFree((void*)stack->base, 0, MEM_RELEASE);
+ VirtualFree((void*)stack->max_limit, 0, MEM_RELEASE);
#else
- munmap((void*)stack->base, stack->max_limit - stack->base);
+ munmap((void*)stack->max_limit, stack->base - stack->max_limit);
#endif
SLJIT_FREE(stack, allocator_data);
}
-SLJIT_API_FUNC_ATTRIBUTE sljit_sw SLJIT_CALL sljit_stack_resize(struct sljit_stack* stack, sljit_uw new_limit)
+SLJIT_API_FUNC_ATTRIBUTE sljit_sw SLJIT_CALL sljit_stack_resize(struct sljit_stack *stack, sljit_u8 *new_limit)
{
sljit_uw aligned_old_limit;
sljit_uw aligned_new_limit;
- if ((new_limit > stack->max_limit) || (new_limit < stack->base))
+ if ((new_limit < stack->max_limit) || (new_limit >= stack->base))
return -1;
#ifdef _WIN32
- aligned_new_limit = (new_limit + sljit_page_align) & ~sljit_page_align;
- aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
+ aligned_new_limit = (sljit_uw)new_limit & ~sljit_page_align;
+ aligned_old_limit = ((sljit_uw)stack->limit) & ~sljit_page_align;
if (aligned_new_limit != aligned_old_limit) {
- if (aligned_new_limit > aligned_old_limit) {
- if (!VirtualAlloc((void*)aligned_old_limit, aligned_new_limit - aligned_old_limit, MEM_COMMIT, PAGE_READWRITE))
+ if (aligned_new_limit < aligned_old_limit) {
+ if (!VirtualAlloc((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, MEM_COMMIT, PAGE_READWRITE))
return -1;
}
else {
- if (!VirtualFree((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, MEM_DECOMMIT))
+ if (!VirtualFree((void*)aligned_old_limit, aligned_new_limit - aligned_old_limit, MEM_DECOMMIT))
return -1;
}
}
stack->limit = new_limit;
return 0;
#else
- if (new_limit >= stack->limit) {
+ if (new_limit <= stack->limit) {
stack->limit = new_limit;
return 0;
}
- aligned_new_limit = (new_limit + sljit_page_align) & ~sljit_page_align;
- aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
+ aligned_new_limit = (sljit_uw)new_limit & ~sljit_page_align;
+ aligned_old_limit = ((sljit_uw)stack->limit) & ~sljit_page_align;
/* If madvise is available, we release the unnecessary space. */
#if defined(MADV_DONTNEED)
- if (aligned_new_limit < aligned_old_limit)
- madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, MADV_DONTNEED);
+ if (aligned_new_limit > aligned_old_limit)
+ madvise((void*)aligned_old_limit, aligned_new_limit - aligned_old_limit, MADV_DONTNEED);
#elif defined(POSIX_MADV_DONTNEED)
- if (aligned_new_limit < aligned_old_limit)
- posix_madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, POSIX_MADV_DONTNEED);
+ if (aligned_new_limit > aligned_old_limit)
+ posix_madvise((void*)aligned_old_limit, aligned_new_limit - aligned_old_limit, POSIX_MADV_DONTNEED);
#endif
stack->limit = new_limit;
return 0;
diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri
index 79179daaf4..91083f84c4 100644
--- a/src/3rdparty/sqlite.pri
+++ b/src/3rdparty/sqlite.pri
@@ -1,5 +1,5 @@
CONFIG(release, debug|release):DEFINES *= NDEBUG
-DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_FTS5 SQLITE_ENABLE_RTREE
+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
!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS
qtConfig(posix_fallocate): DEFINES += HAVE_POSIX_FALLOCATE=1
winrt: DEFINES += SQLITE_OS_WINRT
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index 32d4abf43a..720a35902b 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -63,6 +63,9 @@ import android.util.Base64;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.AlphaAnimation;
+import android.view.animation.Animation;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyCharacterMap;
@@ -997,10 +1000,36 @@ public class QtActivityDelegate
public void hideSplashScreen()
{
+ hideSplashScreen(0);
+ }
+
+ public void hideSplashScreen(final int duration)
+ {
if (m_splashScreen == null)
return;
- m_layout.removeView(m_splashScreen);
- m_splashScreen = null;
+
+ if (duration <= 0) {
+ m_layout.removeView(m_splashScreen);
+ m_splashScreen = null;
+ return;
+ }
+
+ final Animation fadeOut = new AlphaAnimation(1, 0);
+ fadeOut.setInterpolator(new AccelerateInterpolator());
+ fadeOut.setDuration(duration);
+
+ fadeOut.setAnimationListener(new Animation.AnimationListener() {
+ @Override
+ public void onAnimationEnd(Animation animation) { hideSplashScreen(0); }
+
+ @Override
+ public void onAnimationRepeat(Animation animation) {}
+
+ @Override
+ public void onAnimationStart(Animation animation) {}
+ });
+
+ m_splashScreen.startAnimation(fadeOut);
}
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 902e2f68e7..f15c7f3a97 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -49,12 +49,14 @@ import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.content.pm.ActivityInfo;
import android.net.Uri;
+import android.os.Build;
import android.os.Handler;
+import android.os.IBinder;
import android.os.Looper;
import android.content.ClipboardManager;
import android.content.ClipboardManager.OnPrimaryClipChangedListener;
-import android.os.Build;
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
@@ -188,7 +190,21 @@ public class QtNative
for (String libName : libraries) {
try {
- File f = new File(nativeLibraryDir+"lib"+libName+".so");
+ String libNameTemplate = "lib" + libName + ".so";
+ File f = new File(nativeLibraryDir + libNameTemplate);
+ if (!f.exists()) {
+ Log.i(QtTAG, "Can't find '" + f.getAbsolutePath());
+ try {
+ ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(),
+ PackageManager.GET_META_DATA);
+ String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir;
+ if (info.metaData.containsKey("android.app.system_libs_prefix"))
+ systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix");
+ f = new File(systemLibraryDir + libNameTemplate);
+ } catch (Exception e) {
+
+ }
+ }
if (f.exists())
System.load(f.getAbsolutePath());
else
@@ -281,7 +297,20 @@ public class QtNative
String mainLibrary,
String nativeLibraryDir) throws Exception
{
- File f = new File(nativeLibraryDir + "lib" + mainLibrary + ".so");
+ String mainLibNameTemplate = "lib" + mainLibrary + ".so";
+ File f = new File(nativeLibraryDir + mainLibNameTemplate);
+ if (!f.exists()) {
+ try {
+ ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(),
+ PackageManager.GET_META_DATA);
+ String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir;
+ if (info.metaData.containsKey("android.app.system_libs_prefix"))
+ systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix");
+ f = new File(systemLibraryDir + mainLibNameTemplate);
+ } catch (Exception e) {
+
+ }
+ }
if (!f.exists())
throw new Exception("Can't find main library '" + mainLibrary + "'");
@@ -786,13 +815,13 @@ public class QtNative
});
}
- private static void hideSplashScreen()
+ private static void hideSplashScreen(final int duration)
{
runAction(new Runnable() {
@Override
public void run() {
if (m_activityDelegate != null)
- m_activityDelegate.hideSplashScreen();
+ m_activityDelegate.hideSplashScreen(duration);
}
});
}
@@ -880,4 +909,9 @@ public class QtNative
private static native void setNativeActivity(Activity activity);
private static native void setNativeService(Service service);
+ // activity methods
+
+ // service methods
+ public static native IBinder onBind(Intent intent);
+ // service methods
}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java b/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java
index ff3bf19383..4a732f7f7f 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNativeLibrariesDir.java
@@ -45,6 +45,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager.NameNotFoundException;
public class QtNativeLibrariesDir {
+ public static final String systemLibrariesDir = "/system/lib/";
public static String nativeLibrariesDir(Context context)
{
String m_nativeLibraryDir = null;
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
index 035a65a84c..195ec376c9 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
@@ -53,6 +53,7 @@ import android.net.LocalSocket;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
+import android.os.IBinder;
import android.os.ResultReceiver;
import android.text.method.MetaKeyKeyListener;
import android.util.Base64;
@@ -187,4 +188,11 @@ public class QtServiceDelegate
{
QtNative.quitQtCoreApplication();
}
+
+ public IBinder onBind(Intent intent)
+ {
+ synchronized (this) {
+ return QtNative.onBind(intent);
+ }
+ }
}
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 69f351033d..99c4ecca07 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
@@ -84,6 +84,7 @@ 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";
@@ -92,6 +93,10 @@ public abstract class QtLoader {
public static final String EXTRACT_STYLE_KEY = "extract.android.style";
private static final String EXTRACT_STYLE_MINIMAL_KEY = "extract.android.style.option";
+ // These parameters matter in case of deploying application as system (embedded into firmware)
+ public static final String SYSTEM_LIB_PATH = "/system/lib/";
+ public String[] SYSTEM_APP_PATHS = {"/system/priv-app/", "/system/app/"};
+
/// Ministro server parameter keys
public static final String REQUIRED_MODULES_KEY = "required.modules";
public static final String APPLICATION_TITLE_KEY = "application.title";
@@ -106,7 +111,6 @@ public abstract class QtLoader {
public static final String REPOSITORY_KEY = "repository"; // use this key to overwrite the default ministro repsitory
public static final String ANDROID_THEMES_KEY = "android.themes"; // themes that your application uses
-
public String APPLICATION_PARAMETERS = null; // use this variable to pass any parameters to your application,
// the parameters must not contain any white spaces
// and must be separated with "\t"
@@ -210,11 +214,11 @@ 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") )
+ 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"))));
String libName = null;
- if ( m_contextInfo.metaData.containsKey("android.app.lib_name") ) {
+ if (m_contextInfo.metaData.containsKey("android.app.lib_name")) {
libName = m_contextInfo.metaData.getString("android.app.lib_name");
loaderParams.putString(MAIN_LIBRARY_KEY, libName); //main library contains main() function
}
@@ -408,13 +412,9 @@ public abstract class QtLoader {
}
}
- private void extractBundledPluginsAndImports(String pluginsPrefix)
+ private void extractBundledPluginsAndImports(String pluginsPrefix, String libsDir)
throws IOException
{
- ArrayList<String> libs = new ArrayList<String>();
-
- String libsDir = m_context.getApplicationInfo().nativeLibraryDir + "/";
-
long packageVersion = -1;
try {
PackageInfo packageInfo = m_context.getPackageManager().getPackageInfo(m_context.getPackageName(), 0);
@@ -530,6 +530,35 @@ public abstract class QtLoader {
&& m_contextInfo.metaData.getInt("android.app.use_local_qt_libs") == 1) {
ArrayList<String> libraryList = new ArrayList<String>();
+ boolean apkDeployFromSystem = false;
+ String apkPath = m_context.getApplicationInfo().publicSourceDir;
+ File apkFile = new File(apkPath);
+ if (apkFile.exists() && Arrays.asList(SYSTEM_APP_PATHS).contains(apkFile.getParentFile().getAbsolutePath() + "/"))
+ apkDeployFromSystem = true;
+
+ String libsDir = null;
+ if (apkDeployFromSystem) {
+ String systemLibsPrefix = SYSTEM_LIB_PATH;
+ if (m_contextInfo.metaData.containsKey("android.app.system_libs_prefix")) {
+ systemLibsPrefix = m_contextInfo.metaData.getString("android.app.system_libs_prefix");
+ } else {
+ Log.e(QtApplication.QtTAG, "It looks like app deployed as system app. "
+ + "It may be necessary to specify path to system lib directory using "
+ + "android.app.system_libs_prefix metadata variable in your AndroidManifest.xml");
+ Log.e(QtApplication.QtTAG, "Using " + SYSTEM_LIB_PATH + " as default path");
+ }
+ File systemLibraryDir = new File(systemLibsPrefix);
+ if (systemLibraryDir.exists() && systemLibraryDir.isDirectory() && systemLibraryDir.list().length > 0)
+ libsDir = systemLibsPrefix;
+ } else {
+ String nativeLibraryPrefix = m_context.getApplicationInfo().nativeLibraryDir + "/";
+ File nativeLibraryDir = new File(nativeLibraryPrefix);
+ if (nativeLibraryDir.exists() && nativeLibraryDir.isDirectory() && nativeLibraryDir.list().length > 0)
+ libsDir = nativeLibraryPrefix;
+ }
+
+ if (apkDeployFromSystem && libsDir == null)
+ throw new Exception("");
String localPrefix = "/data/local/tmp/qt/";
if (m_contextInfo.metaData.containsKey("android.app.libs_prefix"))
@@ -542,33 +571,30 @@ public abstract class QtLoader {
&& m_contextInfo.metaData.getInt("android.app.bundle_local_qt_libs") == 1) {
localPrefix = m_context.getApplicationInfo().dataDir + "/";
pluginsPrefix = localPrefix + "qt-reserved-files/";
+
+ if (libsDir == null)
+ throw new Exception("");
+
cleanOldCacheIfNecessary(localPrefix, pluginsPrefix);
- extractBundledPluginsAndImports(pluginsPrefix);
+ extractBundledPluginsAndImports(pluginsPrefix, libsDir);
+
bundlingQtLibs = true;
}
if (m_qtLibs != null) {
- for (int i=0;i<m_qtLibs.length;i++) {
- libraryList.add(localPrefix
- + "lib/lib"
- + m_qtLibs[i]
- + ".so");
- }
+ String libPrefix = apkDeployFromSystem ? libsDir + "lib" : localPrefix + "lib/lib";
+ for (int i = 0; i < m_qtLibs.length; i++)
+ libraryList.add(libPrefix + m_qtLibs[i] + ".so");
}
if (m_contextInfo.metaData.containsKey("android.app.load_local_libs")) {
String[] extraLibs = m_contextInfo.metaData.getString("android.app.load_local_libs").split(":");
for (String lib : extraLibs) {
- if (lib.length() > 0) {
- if (lib.startsWith("lib/"))
- libraryList.add(localPrefix + lib);
- else
- libraryList.add(pluginsPrefix + lib);
- }
- }
+ if (lib.length() > 0)
+ libraryList.add((lib.startsWith("lib/") ? localPrefix : pluginsPrefix) + lib);
+ }
}
-
String dexPaths = new String();
String pathSeparator = System.getProperty("path.separator", ":");
if (!bundlingQtLibs && m_contextInfo.metaData.containsKey("android.app.load_local_jars")) {
diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index 066ec0a63c..62e9d0f11c 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -30,6 +30,8 @@
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_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 -->
+ <!-- <meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> -->
<!-- Messages maps -->
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index aed3532024..4f0cd914ca 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -43,6 +43,7 @@
#ifndef QT_NO_TEXTCODEC
+#include "qbytearraymatcher.h"
#include "qlist.h"
#include "qfile.h"
#include "qstringlist.h"
@@ -803,6 +804,7 @@ QTextEncoder* QTextCodec::makeEncoder(QTextCodec::ConversionFlags flags) const
The \a state of the convertor used is updated.
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Converts \a str from Unicode to the encoding of this codec, and
returns the result in a QByteArray.
@@ -811,6 +813,19 @@ QByteArray QTextCodec::fromUnicode(const QString& str) const
{
return convertFromUnicode(str.constData(), str.length(), 0);
}
+#endif
+
+/*!
+ \overload
+ \since 5.10
+
+ Converts \a str from Unicode to the encoding of this codec, and
+ returns the result in a QByteArray.
+*/
+QByteArray QTextCodec::fromUnicode(QStringView str) const
+{
+ return convertFromUnicode(str.data(), str.length(), nullptr);
+}
/*!
\fn QString QTextCodec::toUnicode(const char *input, int size,
@@ -844,6 +859,7 @@ bool QTextCodec::canEncode(QChar ch) const
return (state.invalidChars == 0);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\overload
@@ -856,7 +872,22 @@ bool QTextCodec::canEncode(const QString& s) const
convertFromUnicode(s.constData(), s.length(), &state);
return (state.invalidChars == 0);
}
+#endif
+
+/*!
+ \overload
+ \since 5.10
+ Returns \c true if the Unicode string \a s can be fully encoded
+ with this codec; otherwise returns \c false.
+*/
+bool QTextCodec::canEncode(QStringView s) const
+{
+ ConverterState state;
+ state.flags = ConvertInvalidToNull;
+ convertFromUnicode(s.data(), s.length(), &state);
+ return !state.invalidChars;
+}
/*!
\overload
@@ -921,6 +952,7 @@ bool QTextEncoder::hasFailure() const
return state.invalidChars != 0;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Converts the Unicode string \a str into an encoded QByteArray.
*/
@@ -929,6 +961,17 @@ QByteArray QTextEncoder::fromUnicode(const QString& str)
QByteArray result = c->fromUnicode(str.constData(), str.length(), &state);
return result;
}
+#endif
+
+/*!
+ \overload
+ \since 5.10
+ Converts the Unicode string \a str into an encoded QByteArray.
+*/
+QByteArray QTextEncoder::fromUnicode(QStringView str)
+{
+ return c->fromUnicode(str.data(), str.length(), &state);
+}
/*!
\overload
@@ -1050,10 +1093,12 @@ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba, QTextCodec *defaultCo
// determine charset
QTextCodec *c = QTextCodec::codecForUtfText(ba, 0);
if (!c) {
+ static Q_RELAXED_CONSTEXPR auto matcher = qMakeStaticByteArrayMatcher("meta ");
QByteArray header = ba.left(1024).toLower();
- int pos = header.indexOf("meta ");
+ int pos = matcher.indexIn(header);
if (pos != -1) {
- pos = header.indexOf("charset=", pos);
+ static Q_RELAXED_CONSTEXPR auto matcher = qMakeStaticByteArrayMatcher("charset=");
+ pos = matcher.indexIn(header, pos);
if (pos != -1) {
pos += qstrlen("charset=");
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 47b2fe6eed..5163d37238 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -79,11 +79,17 @@ public:
static QTextCodec *codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec);
bool canEncode(QChar) const;
+#if QT_STRINGVIEW_LEVEL < 2
bool canEncode(const QString&) const;
+#endif
+ bool canEncode(QStringView) const;
QString toUnicode(const QByteArray&) const;
QString toUnicode(const char* chars) const;
+#if QT_STRINGVIEW_LEVEL < 2
QByteArray fromUnicode(const QString& uc) const;
+#endif
+ QByteArray fromUnicode(QStringView uc) const;
enum ConversionFlag {
DefaultConversion,
ConvertInvalidToNull = 0x80000000,
@@ -133,9 +139,12 @@ class Q_CORE_EXPORT QTextEncoder {
Q_DISABLE_COPY(QTextEncoder)
public:
explicit QTextEncoder(const QTextCodec *codec) : c(codec), state() {}
- QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags);
+ explicit QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags);
~QTextEncoder();
+#if QT_STRINGVIEW_LEVEL < 2
QByteArray fromUnicode(const QString& str);
+#endif
+ QByteArray fromUnicode(QStringView str);
QByteArray fromUnicode(const QChar *uc, int len);
bool hasFailure() const;
private:
@@ -147,7 +156,7 @@ class Q_CORE_EXPORT QTextDecoder {
Q_DISABLE_COPY(QTextDecoder)
public:
explicit QTextDecoder(const QTextCodec *codec) : c(codec), state() {}
- QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags);
+ explicit QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags);
~QTextDecoder();
QString toUnicode(const char* chars, int len);
QString toUnicode(const QByteArray &ba);
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 91f7bb4fd6..8b503233a0 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -251,6 +251,11 @@
]
}
},
+ "cxx11_random": {
+ "label": "C++11 <random>",
+ "type": "compile",
+ "test": "unix/cxx11_random"
+ },
"eventfd": {
"label": "eventfd",
"type": "compile",
@@ -264,6 +269,26 @@
]
}
},
+ "futimens": {
+ "label": "futimens()",
+ "type": "compile",
+ "test": "unix/futimens"
+ },
+ "futimes": {
+ "label": "futimes()",
+ "type": "compile",
+ "test": "unix/futimes"
+ },
+ "getauxval": {
+ "label": "getauxval()",
+ "type": "compile",
+ "test": "unix/getauxval"
+ },
+ "getentropy": {
+ "label": "getentropy()",
+ "type": "compile",
+ "test": "unix/getentropy"
+ },
"posix-iconv": {
"label": "POSIX iconv",
"type": "compile",
@@ -349,6 +374,28 @@
]
}
},
+ "renameat2": {
+ "label": "renameat2()",
+ "type": "compile",
+ "test": {
+ "head": "#define _ATFILE_SOURCE 1",
+ "include": [ "fcntl.h", "stdio.h" ],
+ "main": "renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT);"
+ }
+ },
+ "statx": {
+ "label": "statx() in libc",
+ "type": "compile",
+ "test": {
+ "head": "#define _ATFILE_SOURCE 1",
+ "include": [ "sys/types.h", "sys/stat.h", "unistd.h", "fcntl.h" ],
+ "main": [
+ "struct statx statxbuf;",
+ "unsigned int mask = STATX_BASIC_STATS;",
+ "return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf);"
+ ]
+ }
+ },
"syslog": {
"label": "syslog",
"type": "compile",
@@ -395,11 +442,36 @@
"condition": "features.doubleconversion && libs.doubleconversion",
"output": [ "privateFeature" ]
},
+ "cxx11_random": {
+ "label": "C++11 <random>",
+ "condition": "tests.cxx11_random",
+ "output": [ "privateFeature" ]
+ },
"eventfd": {
"label": "eventfd",
"condition": "tests.eventfd",
"output": [ "feature" ]
},
+ "futimens": {
+ "label": "futimens()",
+ "condition": "!config.win32 && tests.futimens",
+ "output": [ "privateFeature" ]
+ },
+ "futimes": {
+ "label": "futimes()",
+ "condition": "!config.win32 && !features.futimens && tests.futimes",
+ "output": [ "privateFeature" ]
+ },
+ "getauxval": {
+ "label": "getauxval()",
+ "condition": "config.linux && tests.getauxval",
+ "output": [ "privateFeature" ]
+ },
+ "getentropy": {
+ "label": "getentropy()",
+ "condition": "config.unix && tests.getentropy",
+ "output": [ "privateFeature" ]
+ },
"glib": {
"label": "GLib",
"autoDetect": "!config.win32",
@@ -516,11 +588,21 @@
"condition": "features.statemachine",
"output": [ "publicFeature" ]
},
+ "renameat2": {
+ "label": "renameat2()",
+ "condition": "config.linux && tests.renameat2",
+ "output": [ "privateFeature" ]
+ },
"slog2": {
"label": "slog2",
"condition": "libs.slog2",
"output": [ "privateFeature" ]
},
+ "statx": {
+ "label": "statx() in libc",
+ "condition": "config.linux && tests.statx",
+ "output": [ "privateFeature" ]
+ },
"syslog": {
"label": "syslog",
"autoDetect": false,
@@ -764,6 +846,11 @@ ensure that the IDEs they use either set QT_LOGGING_TO_CONSOLE to 1
or are able to read the logged output from journald, syslog or slog2."
},
{
+ "type": "warning",
+ "condition": "!config.win32 && !config.darwin && !config.bsd && !features.cxx11_random",
+ "message": "No high-quality PRNG available for QRandomGenerator fallback.\nIf the HW or OS RNG fails, Qt will abort execution."
+ },
+ {
"type": "error",
"condition": "input.doubleconversion == 'no' && !tests.xlocalescanprint",
"message": "Your C library does not provide sscanf_l or snprintf_l.
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 32f9992b6b..7f018bdb94 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -156,3 +156,5 @@ ctest_qt5_module_files.files += $$ctest_macros_file.output $$cmake_extras_mkspec
ctest_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5Core
INSTALLS += ctest_qt5_module_files cmake_qt5_umbrella_module_files
+
+QMAKE_DSYM_DEBUG_SCRIPT = $$PWD/debug_script.py
diff --git a/src/corelib/debug_script.py b/src/corelib/debug_script.py
new file mode 100644
index 0000000000..9111213ef7
--- /dev/null
+++ b/src/corelib/debug_script.py
@@ -0,0 +1,98 @@
+#############################################################################
+##
+## Copyright (C) 2017 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$
+##
+#############################################################################
+
+import os
+import sys
+import imp
+
+from distutils.version import LooseVersion
+
+MODULE_NAME = 'qt'
+
+def import_bridge(path, debugger, session_dict, reload_module = False):
+ if not reload_module and MODULE_NAME in sys.modules:
+ del sys.modules[MODULE_NAME]
+
+ bridge = imp.load_source(MODULE_NAME, path)
+
+ if not hasattr(bridge, '__lldb_init_module'):
+ return None
+
+ # Make available for the current LLDB session, so that LLDB
+ # can find the functions when initializing the module.
+ session_dict[MODULE_NAME] = bridge
+
+ # Initialize the module now that it's available globally
+ bridge.__lldb_init_module(debugger, session_dict)
+
+ if not debugger.GetCategory('Qt'):
+ # Summary provider failed for some reason
+ del session_dict[MODULE_NAME]
+ return None
+
+ return bridge
+
+def report_success(bridge):
+ print "Using Qt summary providers from Creator %s in '%s'" \
+ % (bridge.CREATOR_VERSION, bridge.CREATOR_PATH)
+
+def __lldb_init_module(debugger, session_dict):
+ # Check if the module has already been imported globally. This ensures
+ # that the Qt Creator application search is only performed once per
+ # LLDB process invocation, while still reloading for each session.
+ if MODULE_NAME in sys.modules:
+ module = sys.modules[MODULE_NAME]
+ # Reload module for this sessions
+ bridge = import_bridge(module.__file__, debugger, session_dict,
+ reload_module = True)
+ if bridge:
+ report_success(bridge)
+ return
+
+ versions = {}
+ for install in os.popen(
+ 'mdfind kMDItemCFBundleIdentifier=org.qt-project.qtcreator'
+ '| while read p;'
+ 'do echo $p=$(mdls "$p" -name kMDItemVersion -raw);'
+ 'done'):
+ install = install.strip()
+ (p, v) = install.split('=')
+ versions[v] = p
+
+ for version in sorted(versions, key=LooseVersion, reverse=True):
+ path = versions[version]
+
+ bridge_path = path + '/Contents/Resources/debugger/lldbbridge.py'
+ bridge = import_bridge(bridge_path, debugger, session_dict)
+ if bridge:
+ bridge.CREATOR_VERSION = version
+ bridge.CREATOR_PATH = path
+ report_success(bridge)
+ return
+
+ print "Could not find Qt Creator installation, no Qt summary providers installed"
diff --git a/src/corelib/doc/snippets/code/doc_src_qpair.cpp b/src/corelib/doc/snippets/code/doc_src_qpair.cpp
index f94e3b0d37..e62f91830c 100644
--- a/src/corelib/doc/snippets/code/doc_src_qpair.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_qpair.cpp
@@ -47,6 +47,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <qmath.h>
//! [0]
QPair<QString, double> pair;
@@ -55,7 +56,7 @@ QPair<QString, double> pair;
//! [1]
pair.first = "pi";
-pair.second = 3.14159265358979323846;
+pair.second = M_PI;
//! [1]
//! [struct]
@@ -65,10 +66,10 @@ struct Variable {
};
Variable v;
v.name = "pi";
-v.value = 3.14159265358979323846;
+v.value = M_PI;
//! [struct]
//! [2]
QList<QPair<int, double> > list;
-list.append(qMakePair(66, 3.14159));
+list.append(qMakePair(66, M_PI));
//! [2]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp
index 3794049f97..aed14c379f 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp
@@ -103,3 +103,20 @@ d = german.toDouble( "1234.56", &ok ); // ok == false
d = german.toDouble( "1.234", &ok ); // ok == true, d == 1234.0
//! [3]
+
+//! [3-qstringview]
+bool ok;
+double d;
+
+QLocale c(QLocale::C);
+d = c.toDouble(u"1234.56", &ok); // ok == true, d == 1234.56
+d = c.toDouble(u"1,234.56", &ok); // ok == true, d == 1234.56
+d = c.toDouble(u"1234,56", &ok); // ok == false
+
+QLocale german(QLocale::German);
+d = german.toDouble(u"1234,56", &ok); // ok == true, d == 1234.56
+d = german.toDouble(u"1.234,56", &ok); // ok == true, d == 1234.56
+d = german.toDouble(u"1234.56", &ok); // ok == false
+
+d = german.toDouble(u"1.234", &ok); // ok == true, d == 1234.0
+//! [3-qstringview]
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 1fcb7b9945..7a2b4812ef 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp
@@ -58,7 +58,7 @@ int main()
{
//! [0]
QString string(QStringLiteral("a string"));
-QStringIterator i(string);
+QStringIterator i(string); // implicitly converted to QStringView
//! [0]
//! [1]
@@ -71,8 +71,7 @@ while (i.hasNext())
{
//! [2]
-QString string(QStringLiteral("𝄞 is the G clef"));
-QStringIterator i(string);
+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)
diff --git a/src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp b/src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp
index 39b03f5ff3..e91c41b305 100644
--- a/src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp
+++ b/src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp
@@ -49,6 +49,7 @@
****************************************************************************/
#include <QtGui>
+#include <QtWidgets>
#include "buttonwidget.h"
@@ -74,3 +75,18 @@ ButtonWidget::ButtonWidget(const QStringList &texts, QWidget *parent)
setLayout(gridLayout);
}
//! [2]
+
+//! [3]
+ButtonWidget::ButtonWidget(const QStringList &texts, QWidget *parent)
+ : QWidget(parent)
+{
+ QGridLayout *gridLayout = new QGridLayout;
+ for (int i = 0; i < texts.size(); ++i) {
+ QString text = texts[i];
+ QPushButton *button = new QPushButton(text);
+ connect(button, &QPushButton::clicked, [=] { clicked(text); });
+ gridLayout->addWidget(button, i / 3, i % 3);
+ }
+ setLayout(gridLayout);
+}
+//! [3]
diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp
index 41ee5a9cef..3a6f6483fb 100644
--- a/src/corelib/doc/snippets/qstring/main.cpp
+++ b/src/corelib/doc/snippets/qstring/main.cpp
@@ -262,6 +262,17 @@ void Widget::argFunction()
.arg(i).arg(total).arg(fileName);
//! [11]
+ {
+ //! [11]
+ int i; // current file's number
+ int total; // number of files to process
+ QStringView fileName; // current file's name
+
+ QString status = QString("Processing file %1 of %2: %3")
+ .arg(i).arg(total).arg(fileName);
+ //! [11]
+ }
+
//! [12] //! [13]
QString str;
//! [12]
@@ -321,6 +332,12 @@ void Widget::compareSensitiveFunction()
int y = QString::compare("auto", "Car", Qt::CaseSensitive); // y > 0
int z = QString::compare("auto", "Car", Qt::CaseInsensitive); // z < 0
//! [16]
+
+ //! [qCompareStrings-QSV-QSV]
+ int x = qCompareStrings(u"aUtO", u"AuTo", Qt::CaseInsensitive); // x == 0
+ int y = qCompareStrings(u"auto", u"Car", Qt::CaseSensitive); // y > 0
+ int z = qCompareStrings(u"auto", u"Car", Qt::CaseInsensitive); // z < 0
+ //! [qCompareStrings-QSV-QSV]
}
void Widget::containsFunction()
diff --git a/src/corelib/doc/snippets/qversionnumber/main.cpp b/src/corelib/doc/snippets/qversionnumber/main.cpp
index 0e9997b6dc..27b7b1a7ef 100644
--- a/src/corelib/doc/snippets/qversionnumber/main.cpp
+++ b/src/corelib/doc/snippets/qversionnumber/main.cpp
@@ -95,6 +95,14 @@ void QObject::parse()
// version is 5.4.0
// suffixIndex is 5
//! [3]
+
+ //! [3-latin1-1]
+ QLatin1String string("5.4.0-alpha");
+ int suffixIndex;
+ auto version = QVersionNumber::fromString(string, &suffixIndex);
+ // version is 5.4.0
+ // suffixIndex is 5
+ //! [3-latin1-1]
}
void Object::equivalent()
diff --git a/src/corelib/doc/snippets/signalmapper/filereader.cpp b/src/corelib/doc/snippets/signalmapper/filereader.cpp
deleted file mode 100644
index 674f73d671..0000000000
--- a/src/corelib/doc/snippets/signalmapper/filereader.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests 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 <QtGui>
-#include "filereader.h"
-
-
-FileReader::FileReader(QWidget *parent)
- : QWidget(parent)
-{
- textEdit = new QTextEdit;
-
- taxFileButton = new QPushButton("Tax File");
- accountFileButton = new QPushButton("Accounts File");
- reportFileButton = new QPushButton("Report File");
-
-//! [0]
- signalMapper = new QSignalMapper(this);
- signalMapper->setMapping(taxFileButton, QString("taxfile.txt"));
- signalMapper->setMapping(accountFileButton, QString("accountsfile.txt"));
- signalMapper->setMapping(reportFileButton, QString("reportfile.txt"));
-
- connect(taxFileButton, &QPushButton::clicked,
- signalMapper, &QSignalMapper::map);
- connect(accountFileButton, &QPushButton::clicked,
- signalMapper, &QSignalMapper::map);
- connect(reportFileButton, &QPushButton::clicked,
- signalMapper, &QSignalMapper::map);
-//! [0]
-
-//! [1]
- connect(signalMapper, SIGNAL(mapped(QString)),
- this, SLOT(readFile(QString)));
-//! [1]
-
-/*
-//! [2]
- //slower due to signature normalization at runtime
-
- connect(signalMapper, SIGNAL(mapped(QString)),
- this, SLOT(readFile(QString)));
-//! [2]
-*/
- QHBoxLayout *buttonLayout = new QHBoxLayout;
- buttonLayout->addWidget(taxFileButton);
- buttonLayout->addWidget(accountFileButton);
- buttonLayout->addWidget(reportFileButton);
-
- QVBoxLayout *mainLayout = new QVBoxLayout;
- mainLayout->addWidget(textEdit);
- mainLayout->addLayout(buttonLayout);
-
- setLayout(mainLayout);
-}
-
-void FileReader::readFile(const QString &filename)
-{
- QFile file(filename);
-
- if (!file.open(QIODevice::ReadOnly)) {
- QMessageBox::information(this, tr("Unable to open file"),
- file.errorString());
- return;
- }
-
-
- QTextStream in(&file);
- textEdit->setPlainText(in.readAll());
-}
-
diff --git a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
index ed61511c62..6d3064d217 100644
--- a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
+++ b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
@@ -395,24 +395,12 @@
signal, Qt provides the QObject::sender() function, which returns
a pointer to the object that sent the signal.
- The QSignalMapper class is provided for situations where many
- signals are connected to the same slot and the slot needs to
- handle each signal differently.
+ Lambda expressions are a convenient way to pass custom arguments to a slot:
- Suppose you have three push buttons that determine which file you
- will open: "Tax File", "Accounts File", or "Report File".
-
- In order to open the correct file, you use QSignalMapper::setMapping() to
- map all the QPushButton::clicked() signals to a QSignalMapper object. Then you connect
- the file's QPushButton::clicked() signal to the QSignalMapper::map() slot.
-
- \snippet signalmapper/filereader.cpp 0
-
- Then, you connect the \l{QSignalMapper::}{mapped()} signal to
- \c{readFile()} where a different file will be opened, depending on
- which push button is pressed.
-
- \snippet signalmapper/filereader.cpp 1
+ \code
+ connect(action, &QAction::triggered, engine,
+ [=]() { engine->processAction(action->text()); });
+ \endcode
\sa {Meta-Object System}, {Qt's Property System}
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index b76d1ef43c..78b37755a4 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -9,6 +9,7 @@ HEADERS += \
global/qprocessordetection.h \
global/qnamespace.h \
global/qendian.h \
+ global/qendian_p.h \
global/qnumeric_p.h \
global/qnumeric.h \
global/qfloat16_p.h \
@@ -21,6 +22,8 @@ HEADERS += \
global/qisenum.h \
global/qtypetraits.h \
global/qflags.h \
+ global/qrandom.h \
+ global/qrandom_p.h \
global/qhooks_p.h \
global/qversiontagging.h
@@ -33,6 +36,7 @@ SOURCES += \
global/qfloat16.cpp \
global/qoperatingsystemversion.cpp \
global/qlogging.cpp \
+ global/qrandom.cpp \
global/qhooks.cpp
VERSIONTAGGING_SOURCES = global/qversiontagging.cpp
@@ -55,6 +59,22 @@ if(linux*|hurd*):!cross_compile:!static:!*-armcc* {
DEFINES += ELF_INTERPRETER=\\\"$$system(LC_ALL=C readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
}
+linux:!static {
+ precompile_header {
+ # we'll get an error if we just use SOURCES +=
+ no_pch_assembler.commands = $$QMAKE_CC -c $(CFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+ no_pch_assembler.dependency_type = TYPE_C
+ no_pch_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ no_pch_assembler.input = NO_PCH_ASM
+ no_pch_assembler.name = compiling[no_pch] ${QMAKE_FILE_IN}
+ silent: no_pch_assembler.commands = @echo compiling[no_pch] ${QMAKE_FILE_IN} && $$no_pch_assembler.commands
+ QMAKE_EXTRA_COMPILERS += no_pch_assembler
+ NO_PCH_ASM += global/minimum-linux.S
+ } else {
+ SOURCES += global/minimum-linux.S
+ }
+}
+
qtConfig(slog2): \
LIBS_PRIVATE += -lslog2
diff --git a/src/corelib/global/minimum-linux.S b/src/corelib/global/minimum-linux.S
new file mode 100644
index 0000000000..6b7fb4f63b
--- /dev/null
+++ b/src/corelib/global/minimum-linux.S
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Intel Corporation.
+** 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 "private/qglobal_p.h"
+
+/* Copied from #include <elf.h>:
+ */
+#define ELF_NOTE_GNU "GNU"
+#define NT_GNU_ABI_TAG 1
+#define ELF_NOTE_OS_LINUX 0
+
+#ifdef __arm__
+# define progbits %progbits
+# define note %note
+#else
+# define progbits @progbits
+# define note @note
+#endif
+
+/* Add information for the ELF dynamic linker what the minimum Linux version
+ * required for Qt is.
+ *
+ * The .note.ABI-tag note section is defined at
+ * https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/noteabitag.html
+ */
+
+ .section ".note.GNU-stack", "", progbits
+ .section ".note.ABI-tag", "a", note
+ .align 4 /* we have 32-bit data */
+
+/* * For the format of the note section's contents, see Elf32_Nhdr / Elf64_Nhdr */
+ .long .Lnameend-.Lname /* n_namesz */
+ .long 16 /* n_descsz(16 bytes, normative) */
+ .long NT_GNU_ABI_TAG /* n_type */
+
+.Lname:
+ .asciz ELF_NOTE_GNU
+.Lnameend:
+
+/* Operating systems: */
+ .long ELF_NOTE_OS_LINUX
+
+/* Minimum Linux kernel version:
+ * We require the following features in Qt (unconditional, no fallback):
+ * Feature Added in version Macro
+ * - inotify_init1 before 2.6.12-rc12
+ * - futex(2) before 2.6.12-rc12
+ * - linkat(2) 2.6.17 O_TMPFILE
+ * - FUTEX_PRIVATE_FLAG 2.6.22
+ * - O_CLOEXEC 2.6.23
+ * - eventfd 2.6.23
+ * - pipe2 & dup3 2.6.27
+ * - accept4 2.6.28
+ * - renameat2 3.16 QT_CONFIG(renameat2)
+ * - getrandom 3.17 QT_CONFIG(getentropy)
+ */
+
+#if QT_CONFIG(getentropy)
+ .long 3
+ .long 17
+ .long 0
+#elif QT_CONFIG(renameat2)
+ .long 3
+ .long 16
+ .long 0
+#else
+ .long 2
+ .long 6
+ .long 28
+#endif
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 0b02ecc8ec..95095f4b76 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -75,14 +75,21 @@
#else
# define QT_FEATURE_alloca_malloc_h -1
#endif
+#define QT_FEATURE_cxx11_random (QT_HAS_INCLUDE(<random>) ? 1 : -1)
+#define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1)
+#define QT_FEATURE_getentropy -1
#define QT_FEATURE_iconv -1
#define QT_FEATURE_icu -1
#define QT_FEATURE_journald -1
+#define QT_FEATURE_futimens -1
+#define QT_FEATURE_futimes -1
#define QT_FEATURE_library -1
#define QT_NO_QOBJECT
#define QT_FEATURE_process -1
#define QT_NO_SYSTEMLOCALE
+#define QT_FEATURE_renameat2 -1
#define QT_FEATURE_slog2 -1
+#define QT_FEATURE_statx -1
#define QT_FEATURE_syslog -1
#define QT_FEATURE_temporaryfile 1
#define QT_NO_THREAD
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index 4e9cd2e6e3..3337829de0 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -52,22 +52,6 @@ QT_BEGIN_NAMESPACE
/*
* ENDIAN FUNCTIONS
*/
-inline void qbswap_helper(const void *src, void *dest, int size)
-{
- for (int i = 0; i < size ; ++i)
- static_cast<uchar *>(dest)[i] = static_cast<const uchar *>(src)[size - 1 - i];
-}
-
-/*
- * qbswap(const T src, const void *dest);
- * Changes the byte order of \a src from big endian to little endian or vice versa
- * and stores the result in \a dest.
- * There is no alignment requirements for \a dest.
-*/
-template <typename T> inline void qbswap(const T src, void *dest)
-{
- qbswap_helper(&src, dest, sizeof(T));
-}
// Used to implement a type-safe and alignment-safe copy operation
// If you want to avoid the memcpy, you must write specializations for these functions
@@ -103,30 +87,11 @@ template <typename T> Q_ALWAYS_INLINE T qFromUnaligned(const void *src)
* This function can be used if you are not concerned about alignment issues,
* and it is therefore a bit more convenient and in most cases more efficient.
*/
-template <typename T> T qbswap(T source);
-
-// GCC 4.3 implemented all the intrinsics, but the 16-bit one only got implemented in 4.8;
-// Clang 2.6 implemented the 32- and 64-bit but waited until 3.2 to implement the 16-bit one
-#if (defined(Q_CC_GNU) && Q_CC_GNU >= 403) || QT_HAS_BUILTIN(__builtin_bswap32)
-template <> inline quint64 qbswap<quint64>(quint64 source)
-{
- return __builtin_bswap64(source);
-}
-template <> inline quint32 qbswap<quint32>(quint32 source)
-{
- return __builtin_bswap32(source);
-}
+template <typename T> Q_DECL_CONSTEXPR T qbswap(T source);
-template <> inline void qbswap<quint64>(quint64 source, void *dest)
-{
- qToUnaligned<quint64>(__builtin_bswap64(source), dest);
-}
-template <> inline void qbswap<quint32>(quint32 source, void *dest)
-{
- qToUnaligned<quint32>(__builtin_bswap32(source), dest);
-}
-#else
-template <> inline quint64 qbswap<quint64>(quint64 source)
+// These definitions are written so that they are recognized by most compilers
+// as bswap and replaced with single instruction builtins if available.
+template <> inline Q_DECL_CONSTEXPR quint64 qbswap<quint64>(quint64 source)
{
return 0
| ((source & Q_UINT64_C(0x00000000000000ff)) << 56)
@@ -139,7 +104,7 @@ template <> inline quint64 qbswap<quint64>(quint64 source)
| ((source & Q_UINT64_C(0xff00000000000000)) >> 56);
}
-template <> inline quint32 qbswap<quint32>(quint32 source)
+template <> inline Q_DECL_CONSTEXPR quint32 qbswap<quint32>(quint32 source)
{
return 0
| ((source & 0x000000ff) << 24)
@@ -147,65 +112,61 @@ template <> inline quint32 qbswap<quint32>(quint32 source)
| ((source & 0x00ff0000) >> 8)
| ((source & 0xff000000) >> 24);
}
-#endif // GCC & Clang intrinsics
-#if (defined(Q_CC_GNU) && Q_CC_GNU >= 408) || QT_HAS_BUILTIN(__builtin_bswap16)
-template <> inline quint16 qbswap<quint16>(quint16 source)
-{
- return __builtin_bswap16(source);
-}
-template <> inline void qbswap<quint16>(quint16 source, void *dest)
-{
- qToUnaligned<quint16>(__builtin_bswap16(source), dest);
-}
-#else
-template <> inline quint16 qbswap<quint16>(quint16 source)
+
+template <> inline Q_DECL_CONSTEXPR quint16 qbswap<quint16>(quint16 source)
{
return quint16( 0
| ((source & 0x00ff) << 8)
| ((source & 0xff00) >> 8) );
}
-#endif // GCC & Clang intrinsics
+
+template <> inline Q_DECL_CONSTEXPR quint8 qbswap<quint8>(quint8 source)
+{
+ return source;
+}
// signed specializations
-template <> inline qint64 qbswap<qint64>(qint64 source)
+template <> inline Q_DECL_CONSTEXPR qint64 qbswap<qint64>(qint64 source)
{
return qbswap<quint64>(quint64(source));
}
-template <> inline qint32 qbswap<qint32>(qint32 source)
+template <> inline Q_DECL_CONSTEXPR qint32 qbswap<qint32>(qint32 source)
{
return qbswap<quint32>(quint32(source));
}
-template <> inline qint16 qbswap<qint16>(qint16 source)
+template <> inline Q_DECL_CONSTEXPR qint16 qbswap<qint16>(qint16 source)
{
return qbswap<quint16>(quint16(source));
}
-template <> inline void qbswap<qint64>(qint64 source, void *dest)
+template <> inline Q_DECL_CONSTEXPR qint8 qbswap<qint8>(qint8 source)
{
- qbswap<quint64>(quint64(source), dest);
+ return source;
}
-template <> inline void qbswap<qint32>(qint32 source, void *dest)
+/*
+ * qbswap(const T src, const void *dest);
+ * Changes the byte order of \a src from big endian to little endian or vice versa
+ * and stores the result in \a dest.
+ * There is no alignment requirements for \a dest.
+*/
+template <typename T> inline void qbswap(const T src, void *dest)
{
- qbswap<quint32>(quint32(source), dest);
+ qToUnaligned<T>(qbswap<T>(src), dest);
}
-template <> inline void qbswap<qint16>(qint16 source, void *dest)
-{
- qbswap<quint16>(quint16(source), dest);
-}
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
-template <typename T> inline T qToBigEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qToBigEndian(T source)
{ return source; }
-template <typename T> inline T qFromBigEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qFromBigEndian(T source)
{ return source; }
-template <typename T> inline T qToLittleEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qToLittleEndian(T source)
{ return qbswap<T>(source); }
-template <typename T> inline T qFromLittleEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qFromLittleEndian(T source)
{ return qbswap<T>(source); }
template <typename T> inline void qToBigEndian(T src, void *dest)
{ qToUnaligned<T>(src, dest); }
@@ -213,13 +174,13 @@ template <typename T> inline void qToLittleEndian(T src, void *dest)
{ qbswap<T>(src, dest); }
#else // Q_LITTLE_ENDIAN
-template <typename T> inline T qToBigEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qToBigEndian(T source)
{ return qbswap<T>(source); }
-template <typename T> inline T qFromBigEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qFromBigEndian(T source)
{ return qbswap<T>(source); }
-template <typename T> inline T qToLittleEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qToLittleEndian(T source)
{ return source; }
-template <typename T> inline T qFromLittleEndian(T source)
+template <typename T> inline Q_DECL_CONSTEXPR T qFromLittleEndian(T source)
{ return source; }
template <typename T> inline void qToBigEndian(T src, void *dest)
{ qbswap<T>(src, dest); }
@@ -228,15 +189,6 @@ template <typename T> inline void qToLittleEndian(T src, void *dest)
#endif // Q_BYTE_ORDER == Q_BIG_ENDIAN
-template <> inline quint8 qbswap<quint8>(quint8 source)
-{
- return source;
-}
-
-template <> inline qint8 qbswap<qint8>(qint8 source)
-{
- return source;
-}
/* T qFromLittleEndian(const void *src)
* This function will read a little-endian encoded value from \a src
@@ -267,6 +219,127 @@ template <> inline quint8 qFromBigEndian<quint8>(const void *src)
template <> inline qint8 qFromBigEndian<qint8>(const void *src)
{ return static_cast<const qint8 *>(src)[0]; }
+template<class S>
+class QSpecialInteger
+{
+ typedef typename S::StorageType T;
+ T val;
+public:
+ QSpecialInteger() = default;
+ explicit Q_DECL_CONSTEXPR QSpecialInteger(T i) : val(S::toSpecial(i)) {}
+
+ QSpecialInteger &operator =(T i) { val = S::toSpecial(i); return *this; }
+ operator T() const { return S::fromSpecial(val); }
+
+ bool operator ==(QSpecialInteger<S> i) const { return val == i.val; }
+ bool operator !=(QSpecialInteger<S> i) const { return val != i.val; }
+
+ QSpecialInteger &operator +=(T i)
+ { return (*this = S::fromSpecial(val) + i); }
+ QSpecialInteger &operator -=(T i)
+ { return (*this = S::fromSpecial(val) - i); }
+ QSpecialInteger &operator *=(T i)
+ { return (*this = S::fromSpecial(val) * i); }
+ QSpecialInteger &operator >>=(T i)
+ { return (*this = S::fromSpecial(val) >> i); }
+ QSpecialInteger &operator <<=(T i)
+ { return (*this = S::fromSpecial(val) << i); }
+ QSpecialInteger &operator /=(T i)
+ { return (*this = S::fromSpecial(val) / i); }
+ QSpecialInteger &operator %=(T i)
+ { return (*this = S::fromSpecial(val) % i); }
+ QSpecialInteger &operator |=(T i)
+ { return (*this = S::fromSpecial(val) | i); }
+ QSpecialInteger &operator &=(T i)
+ { return (*this = S::fromSpecial(val) & i); }
+ QSpecialInteger &operator ^=(T i)
+ { return (*this = S::fromSpecial(val) ^ i); }
+};
+
+template<typename T>
+class QLittleEndianStorageType {
+public:
+ typedef T StorageType;
+ static Q_DECL_CONSTEXPR T toSpecial(T source) { return qToLittleEndian(source); }
+ static Q_DECL_CONSTEXPR T fromSpecial(T source) { return qFromLittleEndian(source); }
+};
+
+template<typename T>
+class QBigEndianStorageType {
+public:
+ typedef T StorageType;
+ static Q_DECL_CONSTEXPR T toSpecial(T source) { return qToBigEndian(source); }
+ static Q_DECL_CONSTEXPR T fromSpecial(T source) { return qFromBigEndian(source); }
+};
+
+#ifdef Q_QDOC
+class QLEInteger {
+public:
+ explicit Q_DECL_CONSTEXPR QLEInteger(T i);
+ QLEInteger &operator =(T i);
+ operator T() const;
+ bool operator ==(QLEInteger i) const;
+ bool operator !=(QLEInteger i) const;
+ QLEInteger &operator +=(T i);
+ QLEInteger &operator -=(T i);
+ QLEInteger &operator *=(T i);
+ QLEInteger &operator >>=(T i);
+ QLEInteger &operator <<=(T i);
+ QLEInteger &operator /=(T i);
+ QLEInteger &operator %=(T i);
+ QLEInteger &operator |=(T i);
+ QLEInteger &operator &=(T i);
+ QLEInteger &operator ^=(T i);
+};
+
+class QBEInteger {
+public:
+ explicit Q_DECL_CONSTEXPR QBEInteger(T i);
+ QBEInteger &operator =(T i);
+ operator T() const;
+ bool operator ==(QBEInteger i) const;
+ bool operator !=(QBEInteger i) const;
+ QBEInteger &operator +=(T i);
+ QBEInteger &operator -=(T i);
+ QBEInteger &operator *=(T i);
+ QBEInteger &operator >>=(T i);
+ QBEInteger &operator <<=(T i);
+ QBEInteger &operator /=(T i);
+ QBEInteger &operator %=(T i);
+ QBEInteger &operator |=(T i);
+ QBEInteger &operator &=(T i);
+ QBEInteger &operator ^=(T i);
+};
+#else
+
+template<typename T>
+using QLEInteger = QSpecialInteger<QLittleEndianStorageType<T>>;
+
+template<typename T>
+using QBEInteger = QSpecialInteger<QBigEndianStorageType<T>>;
+#endif
+template <typename T>
+class QTypeInfo<QLEInteger<T> >
+ : public QTypeInfoMerger<QLEInteger<T>, T> {};
+
+template <typename T>
+class QTypeInfo<QBEInteger<T> >
+ : public QTypeInfoMerger<QBEInteger<T>, T> {};
+
+typedef QLEInteger<qint16> qint16_le;
+typedef QLEInteger<qint32> qint32_le;
+typedef QLEInteger<qint64> qint64_le;
+typedef QLEInteger<quint16> quint16_le;
+typedef QLEInteger<quint32> quint32_le;
+typedef QLEInteger<quint64> quint64_le;
+
+typedef QBEInteger<qint16> qint16_be;
+typedef QBEInteger<qint32> qint32_be;
+typedef QBEInteger<qint64> qint64_be;
+typedef QBEInteger<quint16> quint16_be;
+typedef QBEInteger<quint32> quint32_be;
+typedef QBEInteger<quint64> quint64_be;
+
QT_END_NAMESPACE
#endif // QENDIAN_H
diff --git a/src/corelib/global/qendian.qdoc b/src/corelib/global/qendian.qdoc
index 9ce9dbdb0e..2ccdea5979 100644
--- a/src/corelib/global/qendian.qdoc
+++ b/src/corelib/global/qendian.qdoc
@@ -183,3 +183,372 @@
unmodified.
*/
+/*!
+ \class QLEInteger
+ \inmodule QtCore
+ \brief The QLEInteger class provides platform-independent little-endian integers.
+ \since 5.10
+
+ The template parameter \c T must be a C++ integer type:
+ \list
+ \li 8-bit: char, signed char, unsigned char, qint8, quint8
+ \li 16-bit: short, unsigned short, qint16, quint16, char16_t
+ \li 32-bit: int, unsigned int, qint32, quint32, char32_t
+ \li 64-bit: long long, unsigned long long, qint64, quint64
+ \li platform-specific size: long, unsigned long
+ \li pointer size: qintptr, quintptr, qptrdiff
+ \endlist
+
+ \note Using this class may be slower than using native integers, so only use it when
+ an exact endian is needed.
+*/
+
+/*! \fn QLEInteger::QLEInteger(T value)
+
+ Constructs a QLEInteger with the given \a value.
+*/
+
+/*! \fn QLEInteger &QLEInteger::operator=(T value)
+
+ Assigns \a value to this QLEInteger and returns a reference to
+ this QLEInteger.
+*/
+
+/*!
+ \fn QLEInteger::operator T() const
+
+ Returns the value of this QLEInteger as a native integer.
+*/
+
+/*!
+ \fn bool QLEInteger::operator==(QLEInteger other) const
+
+ Returns \c true if the value of this QLEInteger is equal to the value of \a other.
+*/
+
+/*!
+ \fn bool QLEInteger::operator!=(QLEInteger other) const
+
+ Returns \c true if the value of this QLEInteger is not equal to the value of \a other.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator+=(T i)
+
+ Adds \a i to this QLEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator-=(T i)
+
+ Subtracts \a i from this QLEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator*=(T i)
+
+ Multiplies \a i with this QLEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator/=(T i)
+
+ Divides this QLEInteger with \a i and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator%=(T i)
+
+ Sets this QLEInteger to the remainder of a division by \a i and
+ returns a reference to this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator>>=(T i)
+
+ Performs a left-shift by \a i on this QLEInteger and returns a
+ reference to this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator<<=(T i)
+
+ Performs a right-shift by \a i on this QLEInteger and returns a
+ reference to this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator|=(T i)
+
+ Performs a bitwise OR with \a i onto this QLEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator&=(T i)
+
+ Performs a bitwise AND with \a i onto this QLEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QLEInteger &QLEInteger::operator^=(T i)
+
+ Performs a bitwise XOR with \a i onto this QLEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \class QBEInteger
+ \inmodule QtCore
+ \brief The QBEInteger class provides platform-independent big-endian integers.
+ \since 5.10
+
+ The template parameter \c T must be a C++ integer type:
+ \list
+ \li 8-bit: char, signed char, unsigned char, qint8, quint8
+ \li 16-bit: short, unsigned short, qint16, quint16, char16_t (C++11)
+ \li 32-bit: int, unsigned int, qint32, quint32, char32_t (C++11)
+ \li 64-bit: long long, unsigned long long, qint64, quint64
+ \li platform-specific size: long, unsigned long
+ \li pointer size: qintptr, quintptr, qptrdiff
+ \endlist
+
+ \note Using this class may be slower than using native integers, so only use it when
+ an exact endian is needed.
+*/
+
+/*! \fn QBEInteger::QBEInteger(T value)
+
+ Constructs a QBEInteger with the given \a value.
+*/
+
+/*! \fn QBEInteger &QBEInteger::operator=(T value)
+
+ Assigns \a value to this QBEInteger and returns a reference to
+ this QBEInteger.
+*/
+
+/*!
+ \fn QBEInteger::operator T() const
+
+ Returns the value of this QBEInteger as a native integer.
+*/
+
+/*!
+ \fn bool QBEInteger::operator==(QBEInteger other) const
+
+ Returns \c true if the value of this QBEInteger is equal to the value of \a other.
+*/
+
+/*!
+ \fn bool QBEInteger::operator!=(QBEInteger other) const
+
+ Returns \c true if the value of this QBEInteger is not equal to the value of \a other.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator+=(T i)
+
+ Adds \a i to this QBEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator-=(T i)
+
+ Subtracts \a i from this QBEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator*=(T i)
+
+ Multiplies \a i with this QBEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator/=(T i)
+
+ Divides this QBEInteger with \a i and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator%=(T i)
+
+ Sets this QBEInteger to the remainder of a division by \a i and
+ returns a reference to this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator>>=(T i)
+
+ Performs a left-shift by \a i on this QBEInteger and returns a
+ reference to this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator<<=(T i)
+
+ Performs a right-shift by \a i on this QBEInteger and returns a
+ reference to this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator|=(T i)
+
+ Performs a bitwise OR with \a i onto this QBEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator&=(T i)
+
+ Performs a bitwise AND with \a i onto this QBEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \fn QBEInteger &QBEInteger::operator^=(T i)
+
+ Performs a bitwise XOR with \a i onto this QBEInteger and returns a reference to
+ this object.
+*/
+
+/*!
+ \typedef quint16_le
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QLEInteger<quint16>. This type is guaranteed to be stored in memory as
+ a 16-bit little-endian unsigned integer on all platforms supported by Qt.
+
+ \sa quint16
+*/
+
+/*!
+ \typedef quint32_le
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QLEInteger<quint32>. This type is guaranteed to be stored in memory as
+ a 32-bit little-endian unsigned integer on all platforms supported by Qt.
+
+ \sa quint32
+*/
+
+/*!
+ \typedef quint64_le
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QLEInteger<quint64>. This type is guaranteed to be stored in memory as
+ a 64-bit little-endian unsigned integer on all platforms supported by Qt.
+
+ \sa quint64
+*/
+
+/*!
+ \typedef quint16_be
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QBEInteger<quint16>. This type is guaranteed to be stored in memory as
+ a 16-bit big-endian unsigned integer on all platforms supported by Qt.
+
+ \sa quint16
+*/
+
+/*!
+ \typedef quint32_be
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QBEInteger<quint32>. This type is guaranteed to be stored in memory as
+ a 32-bit big-endian unsigned integer on all platforms supported by Qt.
+
+ \sa quint32
+*/
+
+/*!
+ \typedef quint64_be
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QBEInteger<quint64>. This type is guaranteed to be stored in memory as
+ a 64-bit big-endian unsigned integer on all platforms supported by Qt.
+
+ \sa quint64
+*/
+
+/*!
+ \typedef qint16_le
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QLEInteger<qint16>. This type is guaranteed to be stored in memory as
+ a 16-bit little-endian signed integer on all platforms supported by Qt.
+
+ \sa qint16
+*/
+
+/*!
+ \typedef qint32_le
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QLEInteger<qint32>. This type is guaranteed to be stored in memory as
+ a 32-bit little-endian signed integer on all platforms supported by Qt.
+
+ \sa qint32
+*/
+
+/*!
+ \typedef qint64_le
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QLEInteger<qint64>. This type is guaranteed to be stored in memory as
+ a 64-bit little-endian signed integer on all platforms supported by Qt.
+
+ \sa qint64
+*/
+
+/*!
+ \typedef qint16_be
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QBEInteger<qint16>. This type is guaranteed to be stored in memory as
+ a 16-bit big-endian signed integer on all platforms supported by Qt.
+
+ \sa qint16
+*/
+
+/*!
+ \typedef qint32_be
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QBEInteger<qint32>. This type is guaranteed to be stored in memory as
+ a 32-bit big-endian signed integer on all platforms supported by Qt.
+
+ \sa qint32
+*/
+
+/*!
+ \typedef qint64_be
+ \relates <QtEndian>
+ \since 5.10
+
+ Typedef for QBEInteger<qint64>. This type is guaranteed to be stored in memory as
+ a 64-bit big-endian signed integer on all platforms supported by Qt.
+
+ \sa qint64
+*/
diff --git a/src/corelib/global/qendian_p.h b/src/corelib/global/qendian_p.h
new file mode 100644
index 0000000000..c830e65b54
--- /dev/null
+++ b/src/corelib/global/qendian_p.h
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QENDIAN_P_H
+#define QENDIAN_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qendian.h>
+
+QT_BEGIN_NAMESPACE
+
+// Note if using multiple of these bitfields in a union; the underlying storage type must
+// match. Since we always use an unsigned storage type, unsigned and signed versions may
+// be used together, but different bit-widths may not.
+template<class S, int pos, int width>
+class QSpecialIntegerBitfield
+{
+protected:
+ typedef typename S::StorageType T;
+ typedef typename std::make_unsigned<T>::type UT;
+
+ static Q_DECL_CONSTEXPR UT mask()
+ {
+ return ((UT(1) << width) - 1) << pos;
+ }
+public:
+ // FIXME: val is public until qtdeclarative is fixed to not access it directly.
+ UT val;
+
+ QSpecialIntegerBitfield &operator =(T t)
+ {
+ UT i = S::fromSpecial(val);
+ i &= ~mask();
+ i |= (UT(t) << pos) & mask();
+ val = S::toSpecial(i);
+ return *this;
+ }
+ operator T() const
+ {
+ if (std::is_signed<T>::value) {
+ UT i = S::fromSpecial(val);
+ i <<= (sizeof(T) * 8) - width - pos;
+ T t = T(i);
+ t >>= (sizeof(T) * 8) - width;
+ return t;
+ }
+ return (S::fromSpecial(val) & mask()) >> pos;
+ }
+
+ bool operator !() const { return !(val & S::toSpecial(mask())); }
+ bool operator ==(QSpecialIntegerBitfield<S, pos, width> i) const
+ { return ((val ^ i.val) & S::toSpecial(mask())) == 0; }
+ bool operator !=(QSpecialIntegerBitfield<S, pos, width> i) const
+ { return ((val ^ i.val) & S::toSpecial(mask())) != 0; }
+
+ QSpecialIntegerBitfield &operator +=(T i)
+ { return (*this = (T(*this) + i)); }
+ QSpecialIntegerBitfield &operator -=(T i)
+ { return (*this = (T(*this) - i)); }
+ QSpecialIntegerBitfield &operator *=(T i)
+ { return (*this = (T(*this) * i)); }
+ QSpecialIntegerBitfield &operator /=(T i)
+ { return (*this = (T(*this) / i)); }
+ QSpecialIntegerBitfield &operator %=(T i)
+ { return (*this = (T(*this) % i)); }
+ QSpecialIntegerBitfield &operator |=(T i)
+ { return (*this = (T(*this) | i)); }
+ QSpecialIntegerBitfield &operator &=(T i)
+ { return (*this = (T(*this) & i)); }
+ QSpecialIntegerBitfield &operator ^=(T i)
+ { return (*this = (T(*this) ^ i)); }
+ QSpecialIntegerBitfield &operator >>=(T i)
+ { return (*this = (T(*this) >> i)); }
+ QSpecialIntegerBitfield &operator <<=(T i)
+ { return (*this = (T(*this) << i)); }
+};
+
+template<typename T, int pos, int width>
+using QLEIntegerBitfield = QSpecialIntegerBitfield<QLittleEndianStorageType<T>, pos, width>;
+
+template<typename T, int pos, int width>
+using QBEIntegerBitfield = QSpecialIntegerBitfield<QBigEndianStorageType<T>, pos, width>;
+
+template<int pos, int width>
+using qint32_le_bitfield = QLEIntegerBitfield<int, pos, width>;
+template<int pos, int width>
+using quint32_le_bitfield = QLEIntegerBitfield<uint, pos, width>;
+template<int pos, int width>
+using qint32_be_bitfield = QBEIntegerBitfield<int, pos, width>;
+template<int pos, int width>
+using quint32_be_bitfield = QBEIntegerBitfield<uint, pos, width>;
+
+
+QT_END_NAMESPACE
+
+#endif // QENDIAN_P_H
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 1de1ae65fb..89edfc8787 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -41,7 +41,11 @@
QT_BEGIN_NAMESPACE
-/*! \headerfile <QFloat16>
+/*!
+ \headerfile <QFloat16>
+ \title 16-bit Floating Point Support
+ \ingroup funclists
+ \brief The <QFloat16> header file provides 16-bit floating point support.
This header file provides support for half-precision (16-bit) floating
point data with the class \c qfloat16. It is fully compliant with IEEE
@@ -59,24 +63,6 @@ QT_BEGIN_NAMESPACE
\since 5.9
*/
-Q_STATIC_ASSERT_X(sizeof(float) == sizeof(quint32),
- "qfloat16 assumes that floats are 32 bits wide");
-
-// There are a few corner cases regarding denormals where GHS compiler is relying
-// hardware behavior that is not IEC 559 compliant. Therefore the compiler
-// reports std::numeric_limits<float>::is_iec559 as false. This is all right
-// according to our needs.
-
-#if !defined(Q_CC_GHS)
-Q_STATIC_ASSERT_X(std::numeric_limits<float>::is_iec559,
- "Only works with IEEE 754 floating point");
-#endif
-
-Q_STATIC_ASSERT_X(std::numeric_limits<float>::has_infinity &&
- std::numeric_limits<float>::has_quiet_NaN &&
- std::numeric_limits<float>::has_signaling_NaN,
- "Only works with IEEE 754 floating point");
-
/*!
Returns true if the \c qfloat16 \a {f} is equivalent to infinity.
\relates <QFloat16>
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index b5cc88534e..f2f807e1d9 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -42,7 +42,6 @@
#include "qstring.h"
#include "qvector.h"
#include "qlist.h"
-#include "qthreadstorage.h"
#include "qdir.h"
#include "qdatetime.h"
#include "qoperatingsystemversion.h"
@@ -131,6 +130,38 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
Q_STATIC_ASSERT_X(sizeof(int) == 4, "Qt assumes that int is 32 bits");
Q_STATIC_ASSERT_X(UCHAR_MAX == 255, "Qt assumes that char is 8 bits");
Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined incorrectly");
+Q_STATIC_ASSERT_X(sizeof(float) == 4, "Qt assumes that float is 32 bits");
+
+// While we'd like to check for __STDC_IEC_559__, as per ISO/IEC 9899:2011
+// Annex F (C11, normative for C++11), there are a few corner cases regarding
+// denormals where GHS compiler is relying hardware behavior that is not IEC
+// 559 compliant. So split the check in several subchecks.
+
+// On GHC the compiler reports std::numeric_limits<float>::is_iec559 as false.
+// This is all right according to our needs.
+#if !defined(Q_CC_GHS)
+Q_STATIC_ASSERT_X(std::numeric_limits<float>::is_iec559,
+ "Qt assumes IEEE 754 floating point");
+#endif
+
+// Technically, presence of NaN and infinities are implied from the above check,
+// but double checking our environment doesn't hurt...
+Q_STATIC_ASSERT_X(std::numeric_limits<float>::has_infinity &&
+ std::numeric_limits<float>::has_quiet_NaN &&
+ std::numeric_limits<float>::has_signaling_NaN,
+ "Qt assumes IEEE 754 floating point");
+
+// is_iec559 checks for ISO/IEC/IEEE 60559:2011 (aka IEEE 754-2008) compliance,
+// but that allows for a non-binary radix. We need to recheck that.
+// Note how __STDC_IEC_559__ would instead check for IEC 60559:1989, aka
+// ANSI/IEEE 754−1985, which specifically implies binary floating point numbers.
+Q_STATIC_ASSERT_X(std::numeric_limits<float>::radix == 2,
+ "Qt assumes binary IEEE 754 floating point");
+
+// not required by the definition of size_t, but we depend on this
+Q_STATIC_ASSERT_X(sizeof(size_t) == sizeof(void *), "size_t and a pointer don't have the same size");
+Q_STATIC_ASSERT(sizeof(size_t) == sizeof(qssize_t)); // implied by the definition
+Q_STATIC_ASSERT((std::is_same<qssize_t, qptrdiff>::value));
/*!
\class QFlag
@@ -793,6 +824,21 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in
*/
/*!
+ \typedef qssize_t
+ \relates <QtGlobal>
+ \since 5.10
+
+ Integral type providing Posix' \c ssize_t for all platforms.
+
+ This type is guaranteed to be the same size as a \c size_t on all
+ platforms supported by Qt.
+
+ Note that qssize_t is signed. Use \c size_t for unsigned values.
+
+ \sa qptrdiff
+*/
+
+/*!
\enum QtMsgType
\relates <QtGlobal>
@@ -3091,7 +3137,7 @@ void qt_assert_x(const char *where, const char *what, const char *file, int line
Deliberately not exported as part of the Qt API, but used in both
qsimplerichtext.cpp and qgfxraster_qws.cpp
*/
-Q_CORE_EXPORT unsigned int qt_int_sqrt(unsigned int n)
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION unsigned int qt_int_sqrt(unsigned int n)
{
// n must be in the range 0...UINT_MAX/2-1
if (n >= (UINT_MAX>>2)) {
@@ -3121,24 +3167,27 @@ void *qMemSet(void *dest, int c, size_t n) { return memset(dest, c, n); }
// add thread-safety for the Qt wrappers.
static QBasicMutex environmentMutex;
-// getenv is declared as deprecated in VS2005. This function
-// makes use of the new secure getenv function.
/*!
\relates <QtGlobal>
+ \threadsafe
- Returns the value of the environment variable with name \a
- varName. To get the variable string, use QByteArray::constData().
- To convert the data to a QString use QString::fromLocal8Bit().
+ Returns the value of the environment variable with name \a varName as a
+ QByteArray. If no variable by that name is found in the environment, this
+ function returns a default-constructed QByteArray.
- \note qgetenv() was introduced because getenv() from the standard
- C library was deprecated in VC2005 (and later versions). qgetenv()
- uses the new replacement function in VC, and calls the standard C
- library's implementation on all other platforms.
+ The Qt environment manipulation functions are thread-safe, but this
+ requires that the C library equivalent functions like getenv and putenv are
+ not directly called.
- \warning Don't use qgetenv on Windows if the content may contain
- non-US-ASCII characters, like file paths.
+ To convert the data to a QString use QString::fromLocal8Bit().
+
+ \note on desktop Windows, qgetenv() may produce data loss if the
+ original string contains Unicode characters not representable in the
+ ANSI encoding. Use qEnvironmentVariable() instead.
+ On Unix systems, this function is lossless.
- \sa qputenv(), qEnvironmentVariableIsSet(), qEnvironmentVariableIsEmpty()
+ \sa qputenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet(),
+ qEnvironmentVariableIsEmpty()
*/
QByteArray qgetenv(const char *varName)
{
@@ -3160,6 +3209,87 @@ QByteArray qgetenv(const char *varName)
#endif
}
+
+/*!
+ \relates <QtGlobal>
+ \since 5.10
+
+ Returns the value of the environment variable with name \a varName as a
+ QString. If no variable by that name is found in the environment, this
+ function returns \a defaultValue.
+
+ The Qt environment manipulation functions are thread-safe, but this
+ requires that the C library equivalent functions like getenv and putenv are
+ not directly called.
+
+ The following table describes how to choose between qgetenv() and
+ qEnvironmentVariable():
+ \table
+ \header \li Condition \li Recommendation
+ \row
+ \li Variable contains file paths or user text
+ \li qEnvironmentVariable()
+ \row
+ \li Windows-specific code
+ \li qEnvironmentVariable()
+ \row
+ \li Unix-specific code, destination variable is not QString and/or is
+ used to interface with non-Qt APIs
+ \li qgetenv()
+ \row
+ \li Destination variable is a QString
+ \li qEnvironmentVariable()
+ \row
+ \li Destination variable is a QByteArray or std::string
+ \li qgetenv()
+ \endtable
+
+ \note on Unix systems, this function may produce data loss if the original
+ string contains arbitrary binary data that cannot be decoded by the locale
+ codec. Use qgetenv() instead for that case. On Windows, this function is
+ lossless.
+
+ \note the variable name \a varName must contain only US-ASCII characters.
+
+ \sa qputenv(), qgetenv(), qEnvironmentVariableIsSet(), qEnvironmentVariableIsEmpty()
+*/
+QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
+{
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ QMutexLocker locker(&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]);
+ size_t requiredSize = 0;
+ QString buffer;
+ _wgetenv_s(&requiredSize, 0, 0, wname.data());
+ if (requiredSize == 0)
+ return defaultValue;
+ buffer.resize(int(requiredSize));
+ _wgetenv_s(&requiredSize, reinterpret_cast<wchar_t *>(buffer.data()), requiredSize,
+ wname.data());
+ // requiredSize includes the terminating null, which we don't want.
+ Q_ASSERT(buffer.endsWith(QLatin1Char('\0')));
+ buffer.chop(1);
+ return buffer;
+#else
+ QByteArray value = qgetenv(varName);
+ if (value.isNull())
+ return defaultValue;
+// duplicated in qfile.h (QFile::decodeName)
+#if defined(Q_OS_DARWIN)
+ return QString::fromUtf8(value).normalized(QString::NormalizationForm_C);
+#else // other Unix
+ return QString::fromLocal8Bit(value);
+#endif
+#endif
+}
+
+QString qEnvironmentVariable(const char *varName)
+{
+ return qEnvironmentVariable(varName, QString());
+}
+
/*!
\relates <QtGlobal>
\since 5.1
@@ -3172,7 +3302,7 @@ QByteArray qgetenv(const char *varName)
\endcode
except that it's potentially much faster, and can't throw exceptions.
- \sa qgetenv(), qEnvironmentVariableIsSet()
+ \sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet()
*/
bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
{
@@ -3209,7 +3339,7 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
are too long will either be truncated or this function will set \a ok to \c
false.
- \sa qgetenv(), qEnvironmentVariableIsSet()
+ \sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet()
*/
int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
{
@@ -3260,7 +3390,7 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
\endcode
except that it's potentially much faster, and can't throw exceptions.
- \sa qgetenv(), qEnvironmentVariableIsEmpty()
+ \sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsEmpty()
*/
bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
{
@@ -3290,7 +3420,7 @@ bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
uses the replacement function in VC, and calls the standard C
library's implementation on all other platforms.
- \sa qgetenv()
+ \sa qgetenv(), qEnvironmentVariable()
*/
bool qputenv(const char *varName, const QByteArray& value)
{
@@ -3321,7 +3451,7 @@ bool qputenv(const char *varName, const QByteArray& value)
\since 5.1
- \sa qputenv(), qgetenv()
+ \sa qputenv(), qgetenv(), qEnvironmentVariable()
*/
bool qunsetenv(const char *varName)
{
@@ -3346,138 +3476,6 @@ bool qunsetenv(const char *varName)
#endif
}
-#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
-typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
-Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
-
-#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
-
-# if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500)
-// older versions of INTEGRITY used a long instead of a uint for the seed.
-typedef long SeedStorageType;
-# else
-typedef uint SeedStorageType;
-# endif
-
-typedef QThreadStorage<SeedStorageType *> SeedStorage;
-Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
-#endif
-
-/*!
- \relates <QtGlobal>
- \since 4.2
-
- Thread-safe version of the standard C++ \c srand() function.
-
- Sets the argument \a seed to be used to generate a new random number sequence of
- pseudo random integers to be returned by qrand().
-
- The sequence of random numbers generated is deterministic per thread. For example,
- if two threads call qsrand(1) and subsequently call qrand(), the threads will get
- the same random number sequence.
-
- \sa qrand()
-*/
-void qsrand(uint seed)
-{
-#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
- if (randomTLS->hasLocalData()) {
- randomTLS->localData().callMethod<void>("setSeed", "(J)V", jlong(seed));
- return;
- }
-
- QJNIObjectPrivate random("java/util/Random",
- "(J)V",
- jlong(seed));
- if (!random.isValid()) {
- srand(seed);
- return;
- }
-
- randomTLS->setLocalData(random);
-#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (!pseed)
- seedStorage->setLocalData(pseed = new SeedStorageType);
- *pseed = seed;
- } else {
- //global static seed storage should always exist,
- //except after being deleted by QGlobalStaticDeleter.
- //But since it still can be called from destructor of another
- //global static object, fallback to srand(seed)
- srand(seed);
- }
-#else
- // On Windows srand() and rand() already use Thread-Local-Storage
- // to store the seed between calls
- // this is also valid for QT_NO_THREAD
- srand(seed);
-#endif
-}
-
-/*!
- \relates <QtGlobal>
- \since 4.2
-
- Thread-safe version of the standard C++ \c rand() function.
-
- Returns a value between 0 and \c RAND_MAX (defined in \c <cstdlib> and
- \c <stdlib.h>), the next number in the current sequence of pseudo-random
- integers.
-
- Use \c qsrand() to initialize the pseudo-random number generator with
- a seed value.
-
- \sa qsrand()
-*/
-int qrand()
-{
-#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
- AndroidRandomStorage *randomStorage = randomTLS();
- if (!randomStorage)
- return rand();
-
- if (randomStorage->hasLocalData()) {
- return randomStorage->localData().callMethod<jint>("nextInt",
- "(I)I",
- RAND_MAX);
- }
-
- QJNIObjectPrivate random("java/util/Random",
- "(J)V",
- jlong(1));
-
- if (!random.isValid())
- return rand();
-
- randomStorage->setLocalData(random);
- return random.callMethod<jint>("nextInt", "(I)I", RAND_MAX);
-#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (!pseed) {
- seedStorage->setLocalData(pseed = new SeedStorageType);
- *pseed = 1;
- }
- return rand_r(pseed);
- } else {
- //global static seed storage should always exist,
- //except after being deleted by QGlobalStaticDeleter.
- //But since it still can be called from destructor of another
- //global static object, fallback to rand()
- return rand();
- }
-#else
- // On Windows srand() and rand() already use Thread-Local-Storage
- // to store the seed between calls
- // this is also valid for QT_NO_THREAD
- return rand();
-#endif
-}
-
/*!
\macro forever
\relates <QtGlobal>
@@ -4377,8 +4375,11 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
stderr. Under Windows, the message is sent to the debugger.
On QNX the message is sent to slogger2. This
function does nothing if \c QT_NO_WARNING_OUTPUT was defined
- during compilation; it exits if the environment variable \c
- QT_FATAL_WARNINGS is not empty.
+ during compilation; it exits if at the nth warning corresponding to the
+ counter in environment variable \c QT_FATAL_WARNINGS. That is, if the
+ environment variable contains the value 1, it will exit on the 1st message;
+ if it contains the value 10, it will exit on the 10th message. Any
+ non-numeric value is equivalent to 1.
This function takes a format string and a list of arguments,
similar to the C printf() function. The format should be a Latin-1
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 6023cc8564..ff388770f5 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -46,8 +46,9 @@
# include <cstddef>
# include <utility>
#endif
-
-#include <stddef.h>
+#ifndef __ASSEMBLER__
+# include <stddef.h>
+#endif
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
@@ -188,6 +189,7 @@ namespace QT_NAMESPACE {}
# define QT_LARGEFILE_SUPPORT 64
#endif
+#ifndef __ASSEMBLER__
QT_BEGIN_NAMESPACE
/*
@@ -355,7 +357,7 @@ typedef double qreal;
#if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC)
extern "C"
#endif
-Q_CORE_EXPORT const char *qVersion() Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion() Q_DECL_NOTHROW;
#if defined(__cplusplus)
@@ -436,6 +438,9 @@ namespace QtPrivate {
sizeof(void *) == sizeof(quintptr)
&& sizeof(void *) == sizeof(qptrdiff)
+
+ size_t and qssize_t are not guaranteed to be the same size as a pointer, but
+ they usually are.
*/
template <int> struct QIntegerForSize;
template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; };
@@ -451,6 +456,7 @@ typedef QIntegerForSize<Q_PROCESSOR_WORDSIZE>::Unsigned qregisteruint;
typedef QIntegerForSizeof<void*>::Unsigned quintptr;
typedef QIntegerForSizeof<void*>::Signed qptrdiff;
typedef qptrdiff qintptr;
+using qssize_t = QIntegerForSizeof<std::size_t>::Signed;
/* moc compats (signals/slots) */
#ifndef QT_MOC_COMPAT
@@ -612,6 +618,18 @@ private:
void *pool;
};
+#else
+
+#define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) (0)
+#define QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios) (0)
+#define QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos) (0)
+#define QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(ios) (0)
+#define QT_TVOS_PLATFORM_SDK_EQUAL_OR_ABOVE(tvos) (0)
+#define QT_WATCHOS_PLATFORM_SDK_EQUAL_OR_ABOVE(watchos) (0)
+
+#define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) (0)
+#define QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(osx) (0)
+
#endif // Q_OS_DARWIN
/*
@@ -660,7 +678,7 @@ Q_NORETURN Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW;
# endif
#endif
-Q_CORE_EXPORT bool qSharedBuild() Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() Q_DECL_NOTHROW;
#ifndef Q_OUTOFLINE_TEMPLATE
# define Q_OUTOFLINE_TEMPLATE
@@ -709,9 +727,9 @@ Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line)
#if !defined(Q_ASSERT)
# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
-# define Q_ASSERT(cond) do { } while ((false) && (cond))
+# define Q_ASSERT(cond) static_cast<void>(false && (cond))
# else
-# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
+# define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
# endif
#endif
@@ -726,9 +744,9 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *
#if !defined(Q_ASSERT_X)
# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
-# define Q_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
+# define Q_ASSERT_X(cond, where, what) static_cast<void>(false && (cond))
# else
-# define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
+# define Q_ASSERT_X(cond, where, what) ((cond) ? static_cast<void>(0) : qt_assert_x(where, what, __FILE__, __LINE__))
# endif
#endif
@@ -915,13 +933,9 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
# endif
#endif
-namespace QtPrivate {
-template <typename T> struct QAddConst { typedef const T Type; };
-}
-
// this adds const to non-const objects (like std::as_const)
template <typename T>
-Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
// prevent rvalue arguments:
template <typename T>
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
@@ -1112,6 +1126,13 @@ template <typename... Args> Q_CONSTEXPR Q_DECL_UNUSED QNonConstOverload<Args...>
class QByteArray;
Q_CORE_EXPORT QByteArray qgetenv(const char *varName);
+#ifdef Q_QDOC
+Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName,
+ const QString &defaultValue = QString());
+#else // need it as two functions because QString is only forward-declared here
+Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName);
+Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName, const QString &defaultValue);
+#endif
Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
Q_CORE_EXPORT bool qunsetenv(const char *varName);
@@ -1161,5 +1182,6 @@ QT_END_NAMESPACE
#include <QtCore/qversiontagging.h>
#endif /* __cplusplus */
+#endif /* !__ASSEMBLER__ */
#endif /* QGLOBAL_H */
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index b5ba935194..6602d53b08 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -153,19 +153,39 @@ Q_NORETURN
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message);
static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message);
+static int checked_var_value(const char *varname)
+{
+ // qEnvironmentVariableIntValue returns 0 on both parsing failure and on
+ // empty, but we need to distinguish between the two for backwards
+ // compatibility reasons.
+ QByteArray str = qgetenv(varname);
+ if (str.isEmpty())
+ return 0;
+
+ bool ok;
+ int value = str.toInt(&ok, 0);
+ return ok ? value : 1;
+}
+
static bool isFatal(QtMsgType msgType)
{
if (msgType == QtFatalMsg)
return true;
if (msgType == QtCriticalMsg) {
- static bool fatalCriticals = !qEnvironmentVariableIsEmpty("QT_FATAL_CRITICALS");
- return fatalCriticals;
+ static QAtomicInt fatalCriticals = checked_var_value("QT_FATAL_CRITICALS");
+
+ // it's fatal if the current value is exactly 1,
+ // otherwise decrement if it's non-zero
+ return fatalCriticals.load() && fatalCriticals.fetchAndAddRelaxed(-1) == 1;
}
if (msgType == QtWarningMsg || msgType == QtCriticalMsg) {
- static bool fatalWarnings = !qEnvironmentVariableIsEmpty("QT_FATAL_WARNINGS");
- return fatalWarnings;
+ static QAtomicInt fatalWarnings = checked_var_value("QT_FATAL_WARNINGS");
+
+ // 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 false;
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index da44c01594..ab83730caa 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -241,8 +241,11 @@ public:
TextForceRightToLeft = 0x40000,
// Ensures that the longest variant is always used when computing the
// size of a multi-variant string.
- TextLongestVariant = 0x80000,
- TextBypassShaping = 0x100000
+ TextLongestVariant = 0x80000
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ , TextBypassShaping = 0x100000
+#endif
};
enum TextElideMode {
@@ -508,6 +511,9 @@ public:
AA_CompressHighFrequencyEvents = 25,
AA_DontCheckOpenGLContextThreadAffinity = 26,
AA_DisableShaderDiskCache = 27,
+ AA_DontShowShortcutsInContextMenus = 28,
+ AA_CompressTabletEvents = 29,
+ AA_DisableWindowContextHelpButton = 30, // ### Qt 6: remove me
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index efa8e26938..e74ba4026a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -114,6 +114,11 @@
\macos menubar \e{may not} pick up a change in this attribute. Changes
in the QAction::iconVisibleInMenu property will always be picked up.
+ \value AA_DontShowShortcutsInContextMenus Actions with the Shortcut property
+ won't be shown in any shortcut menus unless specifically set by the
+ QAction::shortcutVisibleInContextMenu property. This value has
+ been added in Qt 5.10.
+
\value AA_NativeWindows Ensures that widgets have native windows.
\value AA_DontCreateNativeWidgetSiblings Ensures that siblings of native
@@ -244,7 +249,14 @@
(In the future, the compression feature may be implemented across platforms.)
You can test the attribute to see whether compression is enabled.
If your application needs to handle all events with no compression,
- you can unset this attribute. This value has been added in Qt 5.7.
+ you can unset this attribute. Notice that input events from tablet devices
+ will not be compressed. See AA_CompressTabletEvents if you want these to be
+ compressed as well. This value has been added in Qt 5.7.
+
+ \value AA_CompressTabletEvents Enables compression of input events from tablet devices.
+ Notice that AA_CompressHighFrequencyEvents must be true for events compression
+ to be enabled, and that this flag extends the former to tablet events. Its default
+ value is false. This value has been added in Qt 5.10.
\value AA_DontCheckOpenGLContextThreadAffinity When making a context
current using QOpenGLContext, do not check that the
@@ -262,6 +274,12 @@
\e glProgramBinary(). In the unlikely event of this being problematic,
set this attribute to disable all disk-based caching of shaders.
+ \value AA_DisableWindowContextHelpButton Disables the WindowContextHelpButtonHint
+ by default on Qt::Sheet and Qt::Dialog widgets. This hides the \gui ? button
+ on Windows, which only makes sense if you use \l QWhatsThis functionality.
+ This value has been added in Qt 5.10. For Qt 6, WindowContextHelpButtonHint
+ will not be set by default.
+
The following values are deprecated or obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
@@ -664,8 +682,9 @@
be short, localized names. This is basically equivalent to using the date format
string, "ddd MMM d yyyy". See QDate::toString() for more information.
- \value ISODate \l{ISO 8601} extended format: either \c{YYYY-MM-DD} for dates or
- \c{YYYY-MM-DDTHH:mm:ss}, \c{YYYY-MM-DDTHH:mm:ssTZD} (e.g., 1997-07-16T19:20:30+01:00)
+ \value ISODate \l{ISO 8601} extended format: either \c{yyyy-MM-dd} for dates or
+ \c{yyyy-MM-ddTHH:mm:ss} (e.g. 2017-07-24T15:46:29), or with a time-zone
+ suffix (Z for UTC otherwise an offset as [+|-]HH:mm) where appropriate
for combined dates and times.
\value ISODateWithMs \l{ISO 8601} extended format, including milliseconds if applicable.
diff --git a/src/corelib/global/qnumeric.h b/src/corelib/global/qnumeric.h
index 80be984bef..535a96aaec 100644
--- a/src/corelib/global/qnumeric.h
+++ b/src/corelib/global/qnumeric.h
@@ -45,15 +45,15 @@
QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT bool qIsInf(double d);
-Q_CORE_EXPORT bool qIsNaN(double d);
-Q_CORE_EXPORT bool qIsFinite(double d);
-Q_CORE_EXPORT bool qIsInf(float f);
-Q_CORE_EXPORT bool qIsNaN(float f);
-Q_CORE_EXPORT bool qIsFinite(float f);
-Q_CORE_EXPORT double qSNaN();
-Q_CORE_EXPORT double qQNaN();
-Q_CORE_EXPORT double qInf();
+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 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 double qSNaN();
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qQNaN();
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qInf();
Q_CORE_EXPORT quint32 qFloatDistance(float a, float b);
Q_CORE_EXPORT quint64 qFloatDistance(double a, double b);
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 2291675501..37eddfa9b5 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -73,12 +73,12 @@
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
// the 'using namespace std' below is cases where the stdlib already put the math.h functions in the std namespace and undefined the macros.
-static inline bool math_h_isnan(double d) { using namespace std; return isnan(d); }
-static inline bool math_h_isinf(double d) { using namespace std; return isinf(d); }
-static inline bool math_h_isfinite(double d) { using namespace std; return isfinite(d); }
-static inline bool math_h_isnan(float f) { using namespace std; return isnan(f); }
-static inline bool math_h_isinf(float f) { using namespace std; return isinf(f); }
-static inline bool math_h_isfinite(float f) { using namespace std; return isfinite(f); }
+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 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); }
}
QT_END_NAMESPACE
// These macros from math.h conflict with the real functions in the std namespace.
@@ -94,23 +94,23 @@ QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
#if defined(QT_MATH_H_DEFINES_MACROS)
# undef QT_MATH_H_DEFINES_MACROS
-static inline bool isnan(double d) { return math_h_isnan(d); }
-static inline bool isinf(double d) { return math_h_isinf(d); }
-static inline bool isfinite(double d) { return math_h_isfinite(d); }
-static inline bool isnan(float f) { return math_h_isnan(f); }
-static inline bool isinf(float f) { return math_h_isinf(f); }
-static inline bool isfinite(float f) { return math_h_isfinite(f); }
+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 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); }
#else
-static inline bool isnan(double d) { return std::isnan(d); }
-static inline bool isinf(double d) { return std::isinf(d); }
-static inline bool isfinite(double d) { return std::isfinite(d); }
-static inline bool isnan(float f) { return std::isnan(f); }
-static inline bool isinf(float f) { return std::isinf(f); }
-static inline bool isfinite(float f) { return std::isfinite(f); }
+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 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); }
#endif
}
-Q_DECL_CONSTEXPR static inline double qt_inf() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_inf() Q_DECL_NOEXCEPT
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_infinity,
"platform has no definition for infinity for type double");
@@ -118,7 +118,7 @@ Q_DECL_CONSTEXPR static inline double qt_inf() Q_DECL_NOEXCEPT
}
// Signaling NaN
-Q_DECL_CONSTEXPR static inline double qt_snan() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_snan() Q_DECL_NOEXCEPT
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_signaling_NaN,
"platform has no definition for signaling NaN for type double");
@@ -126,39 +126,39 @@ Q_DECL_CONSTEXPR static inline double qt_snan() Q_DECL_NOEXCEPT
}
// Quiet NaN
-Q_DECL_CONSTEXPR static inline double qt_qnan() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_qnan() Q_DECL_NOEXCEPT
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_quiet_NaN,
"platform has no definition for quiet NaN for type double");
return std::numeric_limits<double>::quiet_NaN();
}
-static inline bool qt_is_inf(double d)
+Q_DECL_CONST_FUNCTION static inline bool qt_is_inf(double d)
{
return qnumeric_std_wrapper::isinf(d);
}
-static inline bool qt_is_nan(double d)
+Q_DECL_CONST_FUNCTION static inline bool qt_is_nan(double d)
{
return qnumeric_std_wrapper::isnan(d);
}
-static inline bool qt_is_finite(double d)
+Q_DECL_CONST_FUNCTION static inline bool qt_is_finite(double d)
{
return qnumeric_std_wrapper::isfinite(d);
}
-static inline bool qt_is_inf(float f)
+Q_DECL_CONST_FUNCTION static inline bool qt_is_inf(float f)
{
return qnumeric_std_wrapper::isinf(f);
}
-static inline bool qt_is_nan(float f)
+Q_DECL_CONST_FUNCTION static inline bool qt_is_nan(float f)
{
return qnumeric_std_wrapper::isnan(f);
}
-static inline bool qt_is_finite(float f)
+Q_DECL_CONST_FUNCTION static inline bool qt_is_finite(float f)
{
return qnumeric_std_wrapper::isfinite(f);
}
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
new file mode 100644
index 0000000000..395bf0b0cb
--- /dev/null
+++ b/src/corelib/global/qrandom.cpp
@@ -0,0 +1,1050 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Intel Corporation.
+** 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$
+**
+****************************************************************************/
+
+// for rand_s
+#define _CRT_RAND_S
+
+#include "qrandom.h"
+#include "qrandom_p.h"
+#include <qobjectdefs.h>
+#include <qthreadstorage.h>
+#include <private/qsimd_p.h>
+
+#include <errno.h>
+
+#if QT_CONFIG(getentropy)
+# include <sys/random.h>
+#else
+# if QT_CONFIG(cxx11_random)
+# include <random>
+# include "qdeadlinetimer.h"
+# include "qhashfunctions.h"
+# endif
+
+# if QT_CONFIG(getauxval)
+# include <sys/auxv.h>
+# endif
+#endif // !QT_CONFIG(getentropy)
+
+#ifdef Q_OS_UNIX
+# include <fcntl.h>
+# include <private/qcore_unix_p.h>
+#else
+# include <qt_windows.h>
+
+// RtlGenRandom is not exported by its name in advapi32.dll, but as SystemFunction036
+// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa387694(v=vs.85).aspx
+// Implementation inspired on https://hg.mozilla.org/mozilla-central/file/722fdbff1efc/security/nss/lib/freebl/win_rand.c#l146
+// Argument why this is safe to use: https://bugzilla.mozilla.org/show_bug.cgi?id=504270
+extern "C" {
+DECLSPEC_IMPORT BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG RandomBufferLength);
+}
+#endif
+
+#if defined(Q_OS_ANDROID)
+# include <private/qjni_p.h>
+#endif
+
+// This file is too low-level for regular Q_ASSERT (the logging framework may
+// recurse back), so use regular assert()
+#undef NDEBUG
+#undef Q_ASSERT_X
+#undef Q_ASSERT
+#define Q_ASSERT(cond) assert(cond)
+#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
+# define NDEBUG 1
+#endif
+#include <assert.h>
+
+QT_BEGIN_NAMESPACE
+
+#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
+static qssize_t qt_random_cpu(void *buffer, qssize_t count);
+
+# ifdef Q_PROCESSOR_X86_64
+# define _rdrandXX_step _rdrand64_step
+# else
+# define _rdrandXX_step _rdrand32_step
+# endif
+
+static QT_FUNCTION_TARGET(RDRND) qssize_t qt_random_cpu(void *buffer, qssize_t count)
+{
+ unsigned *ptr = reinterpret_cast<unsigned *>(buffer);
+ unsigned *end = ptr + count;
+
+ while (ptr + sizeof(qregisteruint)/sizeof(*ptr) <= end) {
+ if (_rdrandXX_step(reinterpret_cast<qregisteruint *>(ptr)) == 0)
+ goto out;
+ ptr += sizeof(qregisteruint)/sizeof(*ptr);
+ }
+
+ if (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) {
+ if (_rdrand32_step(ptr))
+ goto out;
+ ++ptr;
+ }
+
+out:
+ return ptr - reinterpret_cast<unsigned *>(buffer);
+}
+#endif
+
+namespace {
+#if QT_CONFIG(getentropy)
+class SystemRandom
+{
+public:
+ enum { EfficientBufferFill = true };
+ static qssize_t fillBuffer(void *buffer, qssize_t count) Q_DECL_NOTHROW
+ {
+ // getentropy can read at most 256 bytes, so break the reading
+ qssize_t read = 0;
+ while (count - read > 256) {
+ // getentropy can't fail under normal circumstances
+ int ret = getentropy(reinterpret_cast<uchar *>(buffer) + read, 256);
+ Q_ASSERT(ret == 0);
+ read += 256;
+ }
+
+ int ret = getentropy(reinterpret_cast<uchar *>(buffer) + read, count - read);
+ Q_ASSERT(ret == 0);
+ return count;
+ }
+};
+
+#elif defined(Q_OS_UNIX)
+class SystemRandom
+{
+ static QBasicAtomicInt s_fdp1; // "file descriptor plus 1"
+ static int openDevice();
+ SystemRandom() {}
+ ~SystemRandom();
+public:
+ enum { EfficientBufferFill = true };
+ static qssize_t fillBuffer(void *buffer, qssize_t count);
+};
+QBasicAtomicInt SystemRandom::s_fdp1 = Q_BASIC_ATOMIC_INITIALIZER(0);
+
+SystemRandom::~SystemRandom()
+{
+ int fd = s_fdp1.loadAcquire() - 1;
+ if (fd >= 0)
+ qt_safe_close(fd);
+}
+
+int SystemRandom::openDevice()
+{
+ int fd = s_fdp1.loadAcquire() - 1;
+ if (fd != -1)
+ return fd;
+
+ fd = qt_safe_open("/dev/urandom", O_RDONLY);
+ if (fd == -1)
+ fd = qt_safe_open("/dev/random", O_RDONLY | O_NONBLOCK);
+ if (fd == -1) {
+ // failed on both, set to -2 so we won't try again
+ fd = -2;
+ }
+
+ int opened_fdp1;
+ if (s_fdp1.testAndSetOrdered(0, fd + 1, opened_fdp1)) {
+ if (fd >= 0) {
+ static const SystemRandom closer;
+ Q_UNUSED(closer);
+ }
+ return fd;
+ }
+
+ // failed, another thread has opened the file descriptor
+ if (fd >= 0)
+ qt_safe_close(fd);
+ return opened_fdp1 - 1;
+}
+
+qssize_t SystemRandom::fillBuffer(void *buffer, qssize_t count)
+{
+ int fd = openDevice();
+ if (Q_UNLIKELY(fd < 0))
+ return 0;
+
+ qint64 n = qt_safe_read(fd, buffer, count);
+ return qMax<qssize_t>(n, 0); // ignore any errors
+}
+#endif // Q_OS_UNIX
+
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+class SystemRandom
+{
+public:
+ enum { EfficientBufferFill = true };
+ static qssize_t fillBuffer(void *buffer, qssize_t count)
+ {
+ auto RtlGenRandom = SystemFunction036;
+ return RtlGenRandom(buffer, ULONG(count)) ? count: 0;
+ }
+};
+#elif defined(Q_OS_WINRT)
+class SystemRandom
+{
+public:
+ enum { EfficientBufferFill = false };
+ static qssize_t fillBuffer(void *, qssize_t)
+ {
+ // always use the fallback
+ return 0;
+ }
+};
+#endif // Q_OS_WINRT
+} // unnamed namespace
+
+#if defined(Q_OS_WIN)
+static void fallback_update_seed(unsigned) {}
+static void fallback_fill(quint32 *ptr, qssize_t left) Q_DECL_NOTHROW
+{
+ // on Windows, rand_s is a high-quality random number generator
+ // and it requires no seeding
+ std::generate(ptr, ptr + left, []() {
+ unsigned value;
+ rand_s(&value);
+ return value;
+ });
+}
+#elif QT_CONFIG(getentropy)
+static void fallback_update_seed(unsigned) {}
+static void fallback_fill(quint32 *, qssize_t) Q_DECL_NOTHROW
+{
+ // no fallback necessary, getentropy cannot fail under normal circumstances
+}
+#elif defined(Q_OS_BSD4)
+static void fallback_update_seed(unsigned) {}
+static void fallback_fill(quint32 *ptr, qssize_t left) Q_DECL_NOTHROW
+{
+ // BSDs have arc4random(4) and these work even in chroot(2)
+ arc4random_buf(ptr, left * sizeof(*ptr));
+}
+#elif QT_CONFIG(cxx11_random)
+static QBasicAtomicInteger<unsigned> seed = Q_BASIC_ATOMIC_INITIALIZER(0U);
+static void fallback_update_seed(unsigned value)
+{
+ // Update the seed to be used for the fallback mechansim, if we need to.
+ // We can't use QtPrivate::QHashCombine here because that is not an atomic
+ // operation. A simple XOR will have to do then.
+ seed.fetchAndXorRelaxed(value);
+}
+
+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, qssize_t left) Q_DECL_NOTHROW
+{
+ quint32 scratch[12]; // see element count below
+ quint32 *end = scratch;
+
+ auto foldPointer = [](quintptr v) {
+ if (sizeof(quintptr) == sizeof(quint32)) {
+ // For 32-bit systems, we simply return the pointer.
+ return quint32(v);
+ } else {
+ // For 64-bit systems, we try to return the variable part of the
+ // pointer. On current x86-64 and AArch64, the top 17 bits are
+ // architecturally required to be the same, but in reality the top
+ // 24 bits on Linux are likely to be the same for all processes.
+ return quint32(v >> (32 - 24));
+ }
+ };
+
+ Q_ASSERT(left);
+
+ *end++ = foldPointer(quintptr(&seed)); // 1: variable in this library/executable's .data
+ *end++ = foldPointer(quintptr(&scratch)); // 2: variable in the stack
+ *end++ = foldPointer(quintptr(&errno)); // 3: veriable either in libc or thread-specific
+ *end++ = foldPointer(quintptr(reinterpret_cast<void*>(strerror))); // 4: function in libc (and unlikely to be a macro)
+
+#ifndef QT_BOOTSTRAPPED
+ quint64 nsecs = QDeadlineTimer::current(Qt::PreciseTimer).deadline();
+ *end++ = quint32(nsecs); // 5
+#endif
+
+ if (quint32 v = seed.load())
+ *end++ = v; // 6
+
+#if QT_CONFIG(getauxval)
+ // works on Linux -- all modern libc have getauxval
+# ifdef AT_RANDOM
+ // ELF's auxv AT_RANDOM has 16 random bytes
+ // (other ELF-based systems don't seem to have AT_RANDOM)
+ ulong auxvSeed = getauxval(AT_RANDOM);
+ if (auxvSeed) {
+ memcpy(scratch, reinterpret_cast<void *>(auxvSeed), 16);
+ end += 4; // 7 to 10
+ }
+# endif
+
+ // Both AT_BASE and AT_SYSINFO_EHDR have some randomness in them due to the
+ // system's ASLR, even if many bits are the same. They also have randomness
+ // between them.
+# ifdef AT_BASE
+ // present at least on the BSDs too, indicates the address of the loader
+ ulong base = getauxval(AT_BASE);
+ if (base)
+ *end++ = foldPointer(base); // 11
+# endif
+# ifdef AT_SYSINFO_EHDR
+ // seems to be Linux-only, indicates the global page of the sysinfo
+ ulong sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
+ if (sysinfo_ehdr)
+ *end++ = foldPointer(sysinfo_ehdr); // 12
+# endif
+#endif
+
+ Q_ASSERT(end <= std::end(scratch));
+
+ // this is highly inefficient, we should save the generator across calls...
+ std::seed_seq sseq(scratch, end);
+ std::mt19937 generator(sseq);
+ std::generate(ptr, ptr + left, generator);
+
+ fallback_update_seed(*ptr);
+}
+#else
+static void fallback_update_seed(unsigned) {}
+static Q_NORETURN void fallback_fill(quint32 *, qssize_t)
+{
+ qFatal("Random number generator failed and no high-quality backup available");
+}
+#endif
+
+static qssize_t fill_cpu(quint32 *buffer, qssize_t count)
+{
+#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
+ if (qCpuHasFeature(RDRND) && (uint(qt_randomdevice_control) & SkipHWRNG) == 0)
+ return qt_random_cpu(buffer, count);
+#else
+ Q_UNUSED(buffer);
+ Q_UNUSED(count);
+#endif
+ return 0;
+}
+
+static void fill_internal(quint32 *buffer, qssize_t count)
+{
+ if (Q_UNLIKELY(uint(qt_randomdevice_control) & SetRandomData)) {
+ uint value = uint(qt_randomdevice_control) & RandomDataMask;
+ std::fill_n(buffer, count, value);
+ return;
+ }
+
+ qssize_t filled = fill_cpu(buffer, count);
+ if (filled != count && (uint(qt_randomdevice_control) & SkipSystemRNG) == 0) {
+ qssize_t bytesFilled =
+ SystemRandom::fillBuffer(buffer + filled, (count - filled) * qssize_t(sizeof(*buffer)));
+ filled += bytesFilled / qssize_t(sizeof(*buffer));
+ }
+ if (filled)
+ fallback_update_seed(*buffer);
+
+ if (Q_UNLIKELY(filled != count)) {
+ // failed to fill the entire buffer, try the faillback mechanism
+ fallback_fill(buffer + filled, count - filled);
+ }
+}
+
+static Q_NEVER_INLINE void fill(void *buffer, void *bufferEnd)
+{
+ struct ThreadState {
+ enum {
+ DesiredBufferByteSize = 32,
+ BufferCount = DesiredBufferByteSize / sizeof(quint32)
+ };
+ quint32 buffer[BufferCount];
+ int idx = BufferCount;
+ };
+
+ // Verify that the pointers are properly aligned for 32-bit
+ Q_ASSERT(quintptr(buffer) % sizeof(quint32) == 0);
+ Q_ASSERT(quintptr(bufferEnd) % sizeof(quint32) == 0);
+
+ quint32 *ptr = reinterpret_cast<quint32 *>(buffer);
+ quint32 * const end = reinterpret_cast<quint32 *>(bufferEnd);
+
+#if defined(Q_COMPILER_THREAD_LOCAL) && !defined(QT_BOOTSTRAPPED)
+ if (SystemRandom::EfficientBufferFill && (end - ptr) < ThreadState::BufferCount
+ && uint(qt_randomdevice_control) == 0) {
+ thread_local ThreadState state;
+ qssize_t itemsAvailable = ThreadState::BufferCount - state.idx;
+
+ // copy as much as we already have
+ qssize_t itemsToCopy = qMin(qssize_t(end - ptr), itemsAvailable);
+ memcpy(ptr, state.buffer + state.idx, size_t(itemsToCopy) * sizeof(*ptr));
+ ptr += itemsToCopy;
+
+ if (ptr != end) {
+ // refill the buffer and try again
+ fill_internal(state.buffer, ThreadState::BufferCount);
+ state.idx = 0;
+
+ itemsToCopy = end - ptr;
+ memcpy(ptr, state.buffer + state.idx, size_t(itemsToCopy) * sizeof(*ptr));
+ ptr = end;
+ }
+
+ // erase what we copied and advance
+# ifdef Q_OS_WIN
+ // Microsoft recommends this
+ SecureZeroMemory(state.buffer + state.idx, size_t(itemsToCopy) * sizeof(*ptr));
+# else
+ // We're quite confident the compiler will not optimize this out because
+ // we're writing to a thread-local buffer
+ memset(state.buffer + state.idx, 0, size_t(itemsToCopy) * sizeof(*ptr));
+# endif
+ state.idx += itemsToCopy;
+ }
+#endif // Q_COMPILER_THREAD_LOCAL && !QT_BOOTSTRAPPED
+
+ if (ptr != end) {
+ // fill directly in the user buffer
+ fill_internal(ptr, end - ptr);
+ }
+}
+
+/*!
+ \class QRandomGenerator
+ \inmodule QtCore
+ \since 5.10
+
+ \brief The QRandomGenerator class allows one to obtain random values from a
+ high-quality, seed-less Random Number Generator.
+
+ QRandomGenerator may be used to generate random values from a high-quality
+ random number generator. Unlike qrand(), QRandomGenerator does not need to be
+ seeded. That also means it is not possible to force it to produce a
+ reliable sequence, which may be needed for debugging.
+
+ The class can generate 32-bit or 64-bit quantities, or fill an array of
+ those. The most common way of generating new values is to call the get32(),
+ get64() or fillRange() functions. One would use it as:
+
+ \code
+ quint32 value = QRandomGenerator::get32();
+ \endcode
+
+ Additionally, it provides a floating-point function getReal() that returns
+ a number in the range [0, 1) (that is, inclusive of zero and exclusive of
+ 1). There's also a set of convenience functions that facilitate obtaining a
+ random number in a bounded, integral range.
+
+ \warning This class is not suitable for bulk data creation. See below for the
+ technical reasons.
+
+ \section1 Frequency and entropy exhaustion
+
+ QRandomGenerator does not need to be seeded and instead uses operating system
+ or hardware facilities to generate random numbers. On some systems and with
+ certain hardware, those facilities are true Random Number Generators.
+ However, if they are true RNGs, those facilities have finite entropy source
+ and thus may fail to produce any results if the entropy pool is exhausted.
+
+ If that happens, first the operating system then QRandomGenerator will fall
+ back to Pseudo Random Number Generators of decreasing qualities (Qt's
+ fallback generator being the simplest). Therefore, QRandomGenerator should
+ not be used for high-frequency random number generation, lest the entropy
+ pool become empty. As a rule of thumb, this class should not be called upon
+ to generate more than a kilobyte per second of random data (note: this may
+ vary from system to system).
+
+ If an application needs true RNG data in bulk, it should use the operating
+ system facilities (such as \c{/dev/random} on Unix systems) directly and
+ wait for entropy to become available. If true RNG is not required,
+ applications should instead use a PRNG engines and can use QRandomGenerator to
+ seed those.
+
+ \section1 Standard C++ Library compatibility
+
+ QRandomGenerator is modeled after
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/random_device}{std::random_device}}
+ and may be used in almost all contexts that the Standard Library can.
+ QRandomGenerator attempts to use either the same engine that backs
+ \c{std::random_device} or a better one. Note that \c{std::random_device} is
+ also allowed to fail if the source entropy pool becomes exhausted, in which
+ case it will throw an exception. QRandomGenerator never throws, but may abort
+ program execution instead.
+
+ Like the Standard Library class, QRandomGenerator can be used to seed Standard
+ Library deterministic random engines from \c{<random>}, such as the
+ Mersenne Twister. Unlike \c{std::random_device}, QRandomGenerator also
+ implements the API of
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/seed_seq}{std::seed_seq}},
+ allowing it to seed the deterministic engines directly.
+
+ The following code can be used to create and seed the
+ implementation-defined default deterministic PRNG, then use it to fill a
+ block range:
+
+ \code
+ QRandomGenerator rd;
+ std::default_random_engine rng(rd);
+ std::generate(block.begin(), block.end(), rng);
+
+ // equivalent to:
+ for (auto &v : block)
+ v = rng();
+ \endcode
+
+ QRandomGenerator is also compatible with the uniform distribution classes
+ \c{std::uniform_int_distribution} and \c{std:uniform_real_distribution}, as
+ well as the free function \c{std::generate_canonical}. For example, the
+ following code may be used to generate a floating-point number in the range
+ [1, 2.5):
+
+ \code
+ QRandomGenerator64 rd;
+ std::uniform_real_distribution dist(1, 2.5);
+ return dist(rd);
+ \endcode
+
+ Note the use of the QRandomGenerator64 class instead of QRandomGenerator to
+ obtain 64 bits of random data in a single call, though it is not required
+ to make the algorithm work (the Standard Library functions will make as
+ many calls as required to obtain enough bits of random data for the desired
+ range).
+
+ \sa QRandomGenerator64, qrand()
+ */
+
+/*!
+ \fn QRandomGenerator::QRandomGenerator()
+ \internal
+ Defaulted constructor, does nothing.
+ */
+
+/*!
+ \typedef QRandomGenerator::result_type
+
+ A typedef to the type that operator()() returns. That is, quint32.
+
+ \sa operator()()
+ */
+
+/*!
+ \fn result_type QRandomGenerator::operator()()
+
+ Generates a 32-bit random quantity and returns it.
+
+ \sa QRandomGenerator::get32(), QRandomGenerator::get64()
+ */
+
+/*!
+ \fn double QRandomGenerator::entropy() const
+
+ Returns the estimate of the entropy in the random generator source.
+
+ This function exists to comply with the Standard Library requirements for
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/random_device}{std::random_device}}
+ but it does not and cannot ever work. It is not possible to obtain a
+ reliable entropy value in a shared entropy pool in a multi-tasking system,
+ as other processes or threads may use that entropy. Any value non-zero
+ value that this function could return would be obsolete by the time the
+ user code reached it.
+
+ Since QRandomGenerator attempts to use a hardware Random Number Generator,
+ this function always returns 0.0.
+ */
+
+/*!
+ \fn result_type QRandomGenerator::min()
+
+ Returns the minimum value that QRandomGenerator may ever generate. That is, 0.
+
+ \sa max(), QRandomGenerator64::max()
+ */
+
+/*!
+ \fn result_type QRandomGenerator::max()
+
+ Returns the maximum value that QRandomGenerator may ever generate. That is,
+ \c {std::numeric_limits<result_type>::max()}.
+
+ \sa min(), QRandomGenerator64::max()
+ */
+
+/*!
+ \fn void QRandomGenerator::generate(ForwardIterator begin, ForwardIterator end)
+
+ Generates 32-bit quantities and stores them in the range between \a begin
+ and \a end. This function is equivalent to (and is implemented as):
+
+ \code
+ std::generate(begin, end, []() { return get32(); });
+ \endcode
+
+ This function complies with the requirements for the function
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/seed_seq/generate}{std::seed_seq::generate}},
+ which requires unsigned 32-bit integer values.
+
+ Note that if the [begin, end) range refers to an area that can store more
+ than 32 bits per element, the elements will still be initialized with only
+ 32 bits of data. Any other bits will be zero. To fill the range with 64 bit
+ quantities, one can write:
+
+ \code
+ std::generate(begin, end, []() { return get64(); });
+ \endcode
+
+ If the range refers to contiguous memory (such as an array or the data from
+ a QVector), the fillRange() function may be used too.
+
+ \sa fillRange()
+ */
+
+/*!
+ \fn void QRandomGenerator::generate(quint32 *begin, quint32 *end)
+ \overload
+ \internal
+
+ Same as the other overload, but more efficiently fills \a begin to \a end.
+ */
+
+/*!
+ \fn void QRandomGenerator::fillRange(UInt *buffer, qssize_t count)
+
+ Generates \a count 32- or 64-bit quantities (depending on the type \c UInt)
+ and stores them in the buffer pointed by \a buffer. This is the most
+ efficient way to obtain more than one quantity at a time, as it reduces the
+ number of calls into the Random Number Generator source.
+
+ For example, to fill a vector of 16 entries with random values, one may
+ write:
+
+ \code
+ QVector<quint32> vector;
+ vector.resize(16);
+ QRandomGenerator::fillRange(vector.data(), vector.size());
+ \endcode
+
+ \sa generate()
+ */
+
+/*!
+ \fn void QRandomGenerator::fillRange(UInt (&buffer)[N})
+
+ Generates \c N 32- or 64-bit quantities (depending on the type \c UInt) and
+ stores them in the \a buffer array. This is the most efficient way to
+ obtain more than one quantity at a time, as it reduces the number of calls
+ into the Random Number Generator source.
+
+ For example, to fill generate two 32-bit quantities, one may write:
+
+ \code
+ quint32 array[2];
+ QRandomGenerator::fillRange(array);
+ \endcode
+
+ It would have also been possible to make one call to get64() and then split
+ the two halves of the 64-bit value.
+
+ \sa generate()
+ */
+
+/*!
+ \fn qreal QRandomGenerator::getReal()
+
+ Generates one random qreal in the canonical range [0, 1) (that is,
+ inclusive of zero and exclusive of 1).
+
+ This function is equivalent to:
+ \code
+ QRandomGenerator64 rd;
+ return std::generate_canonical<qreal, std::numeric_limits<qreal>::digits>(rd);
+ \endcode
+
+ The same may also be obtained by using
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution}{std::uniform_real_distribution}}
+ with parameters 0 and 1.
+
+ \sa get32(), get64(), bounded()
+ */
+
+/*!
+ \fn qreal QRandomGenerator::bounded(qreal sup)
+
+ Generates one random qreal in the range between 0 (inclusive) and \a
+ sup (exclusive). This function is equivalent to and is implemented as:
+
+ \code
+ return getReal() * sup;
+ \endcode
+
+ \sa getReal(), bounded()
+ */
+
+/*!
+ \fn quint32 QRandomGenerator::bounded(quint32 sup)
+ \overload
+
+ Generates one random 32-bit quantity in the range between 0 (inclusive) and
+ \a sup (exclusive). The same result may also be obtained by using
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution}{std::uniform_int_distribution}}
+ with parameters 0 and \c{sup - 1}. That class can also be used to obtain
+ quantities larger than 32 bits.
+
+ For example, to obtain a value between 0 and 255 (inclusive), one would write:
+
+ \code
+ quint32 v = QRandomGenerator::bounded(256);
+ \endcode
+
+ Naturally, the same could also be obtained by masking the result of get32()
+ to only the lower 8 bits. Either solution is as efficient.
+
+ Note that this function cannot be used to obtain values in the full 32-bit
+ range of quint32. Instead, use get32().
+
+ \sa get32(), get64(), getReal()
+ */
+
+/*!
+ \fn quint32 QRandomGenerator::bounded(int sup)
+ \overload
+
+ Generates one random 32-bit quantity in the range between 0 (inclusive) and
+ \a sup (exclusive). \a sup must not be negative.
+
+ Note that this function cannot be used to obtain values in the full 32-bit
+ range of int. Instead, use get32() and cast to int.
+
+ \sa get32(), get64(), getReal()
+ */
+
+/*!
+ \fn quint32 QRandomGenerator::bounded(quint32 min, quint32 sup)
+ \overload
+
+ Generates one random 32-bit quantity in the range between \a min (inclusive)
+ and \a sup (exclusive). The same result may also be obtained by using
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution}{std::uniform_int_distribution}}
+ with parameters \a min and \c{\a sup - 1}. That class can also be used to
+ obtain quantities larger than 32 bits.
+
+ For example, to obtain a value between 1000 (incl.) and 2000 (excl.), one
+ would write:
+
+ \code
+ quint32 v = QRandomGenerator::bounded(1000, 2000);
+ \endcode
+
+
+ Note that this function cannot be used to obtain values in the full 32-bit
+ range of quint32. Instead, use get32().
+
+ \sa get32(), get64(), getReal()
+ */
+
+/*!
+ \fn quint32 QRandomGenerator::bounded(int min, int sup)
+ \overload
+
+ Generates one random 32-bit quantity in the range between \a min
+ (inclusive) and \a sup (exclusive), both of which may be negative.
+
+ Note that this function cannot be used to obtain values in the full 32-bit
+ range of int. Instead, use get32() and cast to int.
+
+ \sa get32(), get64(), getReal()
+ */
+
+/*!
+ \class QRandomGenerator64
+ \inmodule QtCore
+ \since 5.10
+
+ \brief The QRandomGenerator64 class allows one to obtain 64-bit random values
+ from a high-quality, seed-less Random Number Generator.
+
+ QRandomGenerator64 is a simple adaptor class around QRandomGenerator, making the
+ QRandomGenerator::get64() function the default for operator()(), instead of the
+ function that returns 32-bit quantities. This class is intended to be used
+ in conjunction with Standard Library algorithms that need 64-bit quantities
+ instead of 32-bit ones.
+
+ In all other aspects, the class is the same. Please refer to
+ QRandomGenerator's documentation for more information.
+
+ \sa QRandomGenerator
+*/
+
+/*!
+ \fn QRandomGenerator64::QRandomGenerator64()
+ \internal
+ Defaulted constructor, does nothing.
+ */
+
+/*!
+ \typedef QRandomGenerator64::result_type
+
+ A typedef to the type that operator()() returns. That is, quint64.
+
+ \sa operator()()
+ */
+
+/*!
+ \fn result_type QRandomGenerator64::operator()()
+
+ Generates a 64-bit random quantity and returns it.
+
+ \sa QRandomGenerator::get32(), QRandomGenerator::get64()
+ */
+
+/*!
+ \fn double QRandomGenerator64::entropy() const
+
+ Returns the estimate of the entropy in the random generator source.
+
+ This function exists to comply with the Standard Library requirements for
+ \c{\l{http://en.cppreference.com/w/cpp/numeric/random/random_device}{std::random_device}}
+ but it does not and cannot ever work. It is not possible to obtain a
+ reliable entropy value in a shared entropy pool in a multi-tasking system,
+ as other processes or threads may use that entropy. Any value non-zero
+ value that this function could return would be obsolete by the time the
+ user code reached it.
+
+ Since QRandomGenerator64 attempts to use a hardware Random Number Generator,
+ this function always returns 0.0.
+ */
+
+/*!
+ \fn result_type QRandomGenerator64::min()
+
+ Returns the minimum value that QRandomGenerator64 may ever generate. That is, 0.
+
+ \sa max(), QRandomGenerator::max()
+ */
+
+/*!
+ \fn result_type QRandomGenerator64::max()
+
+ Returns the maximum value that QRandomGenerator64 may ever generate. That is,
+ \c {std::numeric_limits<result_type>::max()}.
+
+ \sa min(), QRandomGenerator::max()
+ */
+
+/*!
+ Generates one 32-bit random value and returns it.
+
+ Note about casting to a signed integer: all bits returned by this function
+ are random, so there's a 50% chance that the most significant bit will be
+ set. If you wish to cast the returned value to int and keep it positive,
+ you should mask the sign bit off:
+
+ \code
+ int value = QRandomGenerator::get32() & std::numeric_limits<int>::max();
+ \endcode
+
+ \sa get64(), getReal()
+ */
+quint32 QRandomGenerator::get32()
+{
+ quint32 ret;
+ fill(&ret, &ret + 1);
+ return ret;
+}
+
+/*!
+ Generates one 64-bit random value and returns it.
+
+ Note about casting to a signed integer: all bits returned by this function
+ are random, so there's a 50% chance that the most significant bit will be
+ set. If you wish to cast the returned value to qint64 and keep it positive,
+ you should mask the sign bit off:
+
+ \code
+ qint64 value = QRandomGenerator::get64() & std::numeric_limits<qint64>::max();
+ \endcode
+
+ \sa get32(), getReal(), QRandomGenerator64
+ */
+quint64 QRandomGenerator::get64()
+{
+ quint64 ret;
+ fill(&ret, &ret + 1);
+ return ret;
+}
+
+/*!
+ \internal
+
+ Fills the range pointed by \a buffer and \a bufferEnd with 32-bit random
+ values. The buffer must be correctly aligned.
+ */
+void QRandomGenerator::fillRange_helper(void *buffer, void *bufferEnd)
+{
+ fill(buffer, bufferEnd);
+}
+
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
+Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
+
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+using SeedStorageType = QtPrivate::FunctionPointer<decltype(&srand)>::Arguments::Car;
+
+typedef QThreadStorage<SeedStorageType *> SeedStorage;
+Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
+
+#endif
+
+/*!
+ \relates <QtGlobal>
+ \since 4.2
+
+ Thread-safe version of the standard C++ \c srand() function.
+
+ Sets the argument \a seed to be used to generate a new random number sequence of
+ pseudo random integers to be returned by qrand().
+
+ The sequence of random numbers generated is deterministic per thread. For example,
+ if two threads call qsrand(1) and subsequently call qrand(), the threads will get
+ the same random number sequence.
+
+ \sa qrand(), QRandomGenerator
+*/
+void qsrand(uint seed)
+{
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+ if (randomTLS->hasLocalData()) {
+ randomTLS->localData().callMethod<void>("setSeed", "(J)V", jlong(seed));
+ return;
+ }
+
+ QJNIObjectPrivate random("java/util/Random",
+ "(J)V",
+ jlong(seed));
+ if (!random.isValid()) {
+ srand(seed);
+ return;
+ }
+
+ randomTLS->setLocalData(random);
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ SeedStorage *seedStorage = randTLS();
+ if (seedStorage) {
+ SeedStorageType *pseed = seedStorage->localData();
+ if (!pseed)
+ seedStorage->setLocalData(pseed = new SeedStorageType);
+ *pseed = seed;
+ } else {
+ //global static seed storage should always exist,
+ //except after being deleted by QGlobalStaticDeleter.
+ //But since it still can be called from destructor of another
+ //global static object, fallback to srand(seed)
+ srand(seed);
+ }
+#else
+ // On Windows srand() and rand() already use Thread-Local-Storage
+ // to store the seed between calls
+ // this is also valid for QT_NO_THREAD
+ srand(seed);
+#endif
+}
+
+/*!
+ \relates <QtGlobal>
+ \since 4.2
+
+ Thread-safe version of the standard C++ \c rand() function.
+
+ Returns a value between 0 and \c RAND_MAX (defined in \c <cstdlib> and
+ \c <stdlib.h>), the next number in the current sequence of pseudo-random
+ integers.
+
+ Use \c qsrand() to initialize the pseudo-random number generator with a
+ seed value. Seeding must be performed at least once on each thread. If that
+ step is skipped, then the sequence will be pre-seeded with a constant
+ value.
+
+ \sa qsrand(), QRandomGenerator
+*/
+int qrand()
+{
+#if defined(Q_OS_ANDROID) && (__ANDROID_API__ < 21)
+ AndroidRandomStorage *randomStorage = randomTLS();
+ if (!randomStorage)
+ return rand();
+
+ if (randomStorage->hasLocalData()) {
+ return randomStorage->localData().callMethod<jint>("nextInt",
+ "(I)I",
+ RAND_MAX);
+ }
+
+ QJNIObjectPrivate random("java/util/Random",
+ "(J)V",
+ jlong(1));
+
+ if (!random.isValid())
+ return rand();
+
+ randomStorage->setLocalData(random);
+ return random.callMethod<jint>("nextInt", "(I)I", RAND_MAX);
+#elif defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ SeedStorage *seedStorage = randTLS();
+ if (seedStorage) {
+ SeedStorageType *pseed = seedStorage->localData();
+ if (!pseed) {
+ seedStorage->setLocalData(pseed = new SeedStorageType);
+ *pseed = 1;
+ }
+ return rand_r(pseed);
+ } else {
+ //global static seed storage should always exist,
+ //except after being deleted by QGlobalStaticDeleter.
+ //But since it still can be called from destructor of another
+ //global static object, fallback to rand()
+ return rand();
+ }
+#else
+ // On Windows srand() and rand() already use Thread-Local-Storage
+ // to store the seed between calls
+ // this is also valid for QT_NO_THREAD
+ return rand();
+#endif
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h
new file mode 100644
index 0000000000..3bede87fa6
--- /dev/null
+++ b/src/corelib/global/qrandom.h
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Intel Corporation.
+** 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 QRANDOM_H
+#define QRANDOM_H
+
+#include <QtCore/qglobal.h>
+#include <algorithm> // for std::generate
+
+QT_BEGIN_NAMESPACE
+
+class QRandomGenerator
+{
+ // restrict the template parameters to unsigned integers 32 bits wide or larger
+ template <typename UInt> using IfValidUInt =
+ typename std::enable_if<std::is_unsigned<UInt>::value && sizeof(UInt) >= sizeof(uint), bool>::type;
+public:
+ QRandomGenerator() = default;
+
+ static Q_CORE_EXPORT quint32 get32();
+ static Q_CORE_EXPORT quint64 get64();
+ static qreal getReal()
+ {
+ const int digits = std::numeric_limits<qreal>::digits;
+ if (digits < std::numeric_limits<quint32>::digits) {
+ // use get32()
+ return qreal(get32()) / ((max)() + qreal(1.0));
+ } else {
+ // use get64()
+ // we won't have enough bits for a __float128 though
+ return qreal(get64()) / ((std::numeric_limits<quint64>::max)() + qreal(1.0));
+ }
+ }
+
+ static qreal bounded(qreal sup)
+ {
+ return getReal() * sup;
+ }
+
+ static quint32 bounded(quint32 sup)
+ {
+ quint64 value = get32();
+ value *= sup;
+ value /= (max)() + quint64(1);
+ return quint32(value);
+ }
+
+ static int bounded(int sup)
+ {
+ return int(bounded(quint32(sup)));
+ }
+
+ static quint32 bounded(quint32 min, quint32 sup)
+ {
+ return bounded(sup - min) + min;
+ }
+
+ static int bounded(int min, int sup)
+ {
+ return bounded(sup - min) + min;
+ }
+
+ template <typename UInt, IfValidUInt<UInt> = true>
+ static void fillRange(UInt *buffer, qssize_t count)
+ {
+ fillRange_helper(buffer, buffer + count);
+ }
+
+ template <typename UInt, size_t N, IfValidUInt<UInt> = true>
+ static void fillRange(UInt (&buffer)[N])
+ {
+ fillRange_helper(buffer, buffer + N);
+ }
+
+ // API like std::seed_seq
+ template <typename ForwardIterator>
+ void generate(ForwardIterator begin, ForwardIterator end)
+ {
+ std::generate(begin, end, &QRandomGenerator::get32);
+ }
+
+ void generate(quint32 *begin, quint32 *end)
+ {
+ fillRange_helper(begin, end);
+ }
+
+ // API like std::random_device
+ typedef quint32 result_type;
+ result_type operator()() { return get32(); }
+ double entropy() const Q_DECL_NOTHROW { return 0.0; }
+ 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)(); }
+
+private:
+ Q_DISABLE_COPY(QRandomGenerator)
+ static Q_CORE_EXPORT void fillRange_helper(void *buffer, void *bufferEnd);
+};
+
+class QRandomGenerator64
+{
+public:
+ QRandomGenerator64() = default;
+
+ // API like std::random_device
+ typedef quint64 result_type;
+ result_type operator()() { return QRandomGenerator::get64(); }
+ double entropy() const Q_DECL_NOTHROW { return 0.0; }
+ 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)(); }
+
+private:
+ Q_DISABLE_COPY(QRandomGenerator64)
+};
+
+
+QT_END_NAMESPACE
+
+#endif // QRANDOM_H
diff --git a/src/corelib/tools/qpodlist_p.h b/src/corelib/global/qrandom_p.h
index 95990e0bb6..6ac2904e1b 100644
--- a/src/corelib/tools/qpodlist_p.h
+++ b/src/corelib/global/qrandom_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QPODLIST_P_H
-#define QPODLIST_P_H
+#ifndef QRANDOM_P_H
+#define QRANDOM_P_H
//
// W A R N I N G
@@ -51,59 +51,28 @@
// We mean it.
//
-#include <QtCore/private/qglobal_p.h>
-#include <QtCore/qvarlengtharray.h>
+#include "qglobal_p.h"
QT_BEGIN_NAMESPACE
+enum QRandomGeneratorControl {
+ SkipMemfill = 1,
+ SkipSystemRNG = 2,
+ SkipHWRNG = 4,
+ SetRandomData = 8,
-template <typename T, int Prealloc>
-class QPodList : public QVarLengthArray<T, Prealloc>
-{
- using QVarLengthArray<T, Prealloc>::s;
- using QVarLengthArray<T, Prealloc>::a;
- using QVarLengthArray<T, Prealloc>::ptr;
- using QVarLengthArray<T, Prealloc>::realloc;
-public:
- inline explicit QPodList(int size = 0)
- : QVarLengthArray<T, Prealloc>(size)
- {}
-
- inline void insert(int idx, const T &t)
- {
- const int sz = s++;
- if (s == a)
- realloc(s, s << 1);
- ::memmove(ptr + idx + 1, ptr + idx, (sz - idx) * sizeof(T));
- ptr[idx] = t;
- }
-
- inline void removeAll(const T &t)
- {
- int i = 0;
- for (int j = 0; j < s; ++j) {
- if (ptr[j] != t)
- ptr[i++] = ptr[j];
- }
- s = i;
- }
-
- inline void removeAt(int idx)
- {
- Q_ASSERT(idx >= 0 && idx < s);
- ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T));
- --s;
- }
-
- inline T takeFirst()
- {
- Q_ASSERT(s > 0);
- T tmp = ptr[0];
- removeAt(0);
- return tmp;
- }
+ // 28 bits
+ RandomDataMask = 0xfffffff0
};
+#if defined(QT_BUILD_INTERNAL) && defined(QT_BUILD_CORE_LIB)
+Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control = Q_BASIC_ATOMIC_INITIALIZER(0U);
+#elif defined(QT_BUILD_INTERNAL)
+extern Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control;
+#else
+enum { qt_randomdevice_control = 0 };
+#endif
+
QT_END_NAMESPACE
-#endif // QPODLIST_P_H
+#endif // QRANDOM_P_H
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index 7031021e16..4f79c48c51 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -311,14 +311,11 @@ Q_DECLARE_TYPEINFO(qint64, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(quint64, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE);
-#ifndef Q_OS_DARWIN
-Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
-#endif
-
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
// ### Qt 6: remove the other branch
// This was required so that QList<T> for these types allocates out of the array storage
+Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
# ifdef Q_COMPILER_UNICODE_STRINGS
Q_DECLARE_TYPEINFO(char16_t, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(char32_t, Q_PRIMITIVE_TYPE);
@@ -327,6 +324,11 @@ Q_DECLARE_TYPEINFO(char32_t, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(wchar_t, Q_PRIMITIVE_TYPE);
# endif
#else
+# ifndef Q_OS_DARWIN
+Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
+# else
+Q_DECLARE_TYPEINFO(long double, Q_RELOCATABLE_TYPE);
+# endif
# ifdef Q_COMPILER_UNICODE_STRINGS
Q_DECLARE_TYPEINFO(char16_t, Q_RELOCATABLE_TYPE);
Q_DECLARE_TYPEINFO(char32_t, Q_RELOCATABLE_TYPE);
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index d24c290508..4614fe2a6b 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -121,18 +121,16 @@ win32 {
!winrt {
HEADERS += \
io/qwindowspipereader_p.h \
- io/qwindowspipewriter_p.h \
- io/qwinoverlappedionotifier_p.h
+ io/qwindowspipewriter_p.h
SOURCES += \
io/qsettings_win.cpp \
io/qstandardpaths_win.cpp \
io/qstorageinfo_win.cpp \
io/qwindowspipereader.cpp \
- io/qwindowspipewriter.cpp \
- io/qwinoverlappedionotifier.cpp
+ io/qwindowspipewriter.cpp
- LIBS += -lmpr
+ LIBS += -lmpr -lnetapi32 -luserenv
} else {
SOURCES += \
io/qstandardpaths_winrt.cpp \
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 89727673d3..f2a895bbb8 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -328,7 +328,8 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName)
These are used by the fileTime() function.
- \value CreationTime When the file was created.
+ \value BirthTime When the file was born (created).
+ \value MetadataChangeTime When the file's metadata was last changed.
\value ModificationTime When the file was most recently modified.
\value AccessTime When the file was most recently accessed (e.g.
read or written to).
@@ -737,13 +738,31 @@ QString QAbstractFileEngine::owner(FileOwner owner) const
return QString();
}
+
+/*!
+ \since 5.10
+
+ Sets the file \a time to \a newDate, returning true if successful;
+ otherwise returns false.
+
+ This virtual function must be reimplemented by all subclasses.
+
+ \sa fileTime()
+*/
+bool QAbstractFileEngine::setFileTime(const QDateTime &newDate, FileTime time)
+{
+ Q_UNUSED(newDate);
+ Q_UNUSED(time);
+ return false;
+}
+
/*!
- If \a time is \c CreationTime, return when the file was created.
- If \a time is \c ModificationTime, return when the file was most
- recently modified. If \a time is \c AccessTime, return when the
- file was most recently accessed (e.g. read or written).
- If the time cannot be determined return QDateTime() (an invalid
- date time).
+ If \a time is \c BirthTime, return when the file was born (created). If \a
+ time is \c MetadataChangeTime, return when the file's metadata was last
+ changed. If \a time is \c ModificationTime, return when the file was most
+ recently modified. If \a time is \c AccessTime, return when the file was
+ most recently accessed (e.g. read or written). If the time cannot be
+ determined return QDateTime() (an invalid date time).
This virtual function must be reimplemented by all subclasses.
@@ -843,6 +862,20 @@ bool QAbstractFileEngine::unmap(uchar *address)
}
/*!
+ \since 5.10
+
+ Duplicates the contents of this file (starting from the current position)
+ to the file specified by the engine \a target.
+
+ Returns \c true on success; otherwise, \c false is returned.
+ */
+bool QAbstractFileEngine::cloneTo(QAbstractFileEngine *target)
+{
+ Q_UNUSED(target);
+ return false;
+}
+
+/*!
\since 4.3
\class QAbstractFileEngineIterator
\inmodule QtCore
diff --git a/src/corelib/io/qabstractfileengine_p.h b/src/corelib/io/qabstractfileengine_p.h
index 58fa776e49..00c415b521 100644
--- a/src/corelib/io/qabstractfileengine_p.h
+++ b/src/corelib/io/qabstractfileengine_p.h
@@ -113,9 +113,10 @@ public:
OwnerGroup
};
enum FileTime {
- CreationTime,
- ModificationTime,
- AccessTime
+ AccessTime,
+ BirthTime,
+ MetadataChangeTime,
+ ModificationTime
};
virtual ~QAbstractFileEngine();
@@ -145,9 +146,11 @@ public:
virtual QString fileName(FileName file=DefaultName) const;
virtual uint ownerId(FileOwner) const;
virtual QString owner(FileOwner) const;
+ virtual bool setFileTime(const QDateTime &newDate, FileTime time);
virtual QDateTime fileTime(FileTime time) const;
virtual void setFileName(const QString &file);
virtual int handle() const;
+ virtual bool cloneTo(QAbstractFileEngine *target);
bool atEnd() const;
uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
bool unmap(uchar *ptr);
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 9a42fb4a37..1486d3630c 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -562,6 +562,7 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_5_7 Same as Qt_5_6
\value Qt_5_8 Same as Qt_5_6
\value Qt_5_9 Same as Qt_5_6
+ \value Qt_5_10 Same as Qt_5_6
\omitvalue Qt_DefaultCompiledVersion
\sa setVersion(), version()
@@ -1384,32 +1385,13 @@ int QDataStream::writeRawData(const char *s, int len)
int QDataStream::skipRawData(int len)
{
CHECK_STREAM_PRECOND(-1)
+ if (q_status != Ok && dev->isTransactionStarted())
+ return -1;
- if (dev->isSequential()) {
- char buf[4096];
- int sumRead = 0;
-
- while (len > 0) {
- int blockSize = qMin(len, (int)sizeof(buf));
- int n = readBlock(buf, blockSize);
- if (n == -1)
- return -1;
- if (n == 0)
- return sumRead;
-
- sumRead += n;
- len -= blockSize;
- }
- return sumRead;
- } else {
- qint64 pos = dev->pos();
- qint64 size = dev->size();
- if (pos + len > size)
- len = size - pos;
- if (!dev->seek(pos + len))
- return -1;
- return len;
- }
+ const int skipResult = dev->skip(len);
+ if (skipResult != len)
+ setStatus(ReadPastEnd);
+ return skipResult;
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index 575607e147..0a429d091a 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -96,10 +96,11 @@ public:
Qt_5_7 = Qt_5_6,
Qt_5_8 = Qt_5_7,
Qt_5_9 = Qt_5_8,
-#if QT_VERSION >= 0x050a00
+ Qt_5_10 = Qt_5_9,
+#if QT_VERSION >= 0x050b00
#error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion
#endif
- Qt_DefaultCompiledVersion = Qt_5_9
+ Qt_DefaultCompiledVersion = Qt_5_10
};
enum ByteOrder {
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index be33ec2d23..341400fd93 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -648,6 +648,21 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \since 5.10
+ \fn QDebug &QDebug::operator<<(QStringView s)
+
+ Writes the string view, \a s, to the stream and returns a reference to the
+ stream. Normally, QDebug prints the string inside quotes and transforms
+ non-printable characters to their Unicode values (\\u1234).
+
+ To print non-printable characters without transformation, enable the
+ noquote() functionality. Note that some QDebug backends might not be 8-bit
+ clean.
+
+ See the QString overload for examples.
+*/
+
+/*!
\fn QDebug &QDebug::operator<<(QLatin1String s)
Writes the string, \a s, to the stream and returns a reference to the
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 186722b69b..ee8ef679a9 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -151,8 +151,11 @@ public:
inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(const char* t) { stream->ts << QString::fromUtf8(t); return maybeSpace(); }
+#if QT_STRINGVIEW_LEVEL < 2
inline QDebug &operator<<(const QString & t) { putString(t.constData(), uint(t.length())); return maybeSpace(); }
inline QDebug &operator<<(const QStringRef & t) { putString(t.constData(), uint(t.length())); return maybeSpace(); }
+#endif
+ inline QDebug &operator<<(QStringView s) { putString(s.data(), size_t(s.size())); return maybeSpace(); }
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(); }
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 64d34aec59..bac995ff25 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -42,12 +43,14 @@
#include "qfile.h"
#include "qfsfileengine_p.h"
#include "qtemporaryfile.h"
+#include "qtemporaryfile_p.h"
#include "qlist.h"
#include "qfileinfo.h"
#include "private/qiodevice_p.h"
#include "private/qfile_p.h"
#include "private/qfilesystemengine_p.h"
#include "private/qsystemerror_p.h"
+#include "private/qtemporaryfile_p.h"
#if defined(QT_BUILD_CORE_LIB)
# include "qcoreapplication.h"
#endif
@@ -420,7 +423,7 @@ QFile::exists() const
Q_D(const QFile);
// 0x1000000 = QAbstractFileEngine::Refresh, forcing an update
return (d->engine()->fileFlags(QAbstractFileEngine::FlagsMask
- | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag);
+ | QAbstractFileEngine::Refresh) & QAbstractFileEngine::ExistsFlag);
}
/*!
@@ -553,7 +556,9 @@ bool
QFile::rename(const QString &newName)
{
Q_D(QFile);
- if (d->fileName.isEmpty()) {
+
+ // if this is a QTemporaryFile, the virtual fileName() call here may do something
+ if (fileName().isEmpty()) {
qWarning("QFile::rename: Empty or null file name");
return false;
}
@@ -565,57 +570,64 @@ QFile::rename(const QString &newName)
d->setError(QFile::RenameError, tr("Source file does not exist."));
return false;
}
+
// If the file exists and it is a case-changing rename ("foo" -> "Foo"),
// compare Ids to make sure it really is a different file.
// Note: this does not take file engines into account.
+ bool changingCase = false;
QByteArray targetId = QFileSystemEngine::id(QFileSystemEntry(newName));
if (!targetId.isNull()) {
QByteArray fileId = d->fileEngine ?
d->fileEngine->id() :
QFileSystemEngine::id(QFileSystemEntry(d->fileName));
- if (fileId != targetId || d->fileName.compare(newName, Qt::CaseInsensitive)) {
- // ### Race condition. If a file is moved in after this, it /will/ be
- // overwritten. On Unix, the proper solution is to use hardlinks:
- // return ::link(old, new) && ::remove(old);
+ changingCase = (fileId == targetId && d->fileName.compare(newName, Qt::CaseInsensitive) == 0);
+ if (!changingCase) {
d->setError(QFile::RenameError, tr("Destination file exists"));
return false;
}
-#ifndef QT_NO_TEMPORARYFILE
- // This #ifndef disables the workaround it encloses. Therefore, this configuration is not recommended.
+
#ifdef Q_OS_LINUX
// rename() on Linux simply does nothing when renaming "foo" to "Foo" on a case-insensitive
// FS, such as FAT32. Move the file away and rename in 2 steps to work around.
- QTemporaryFile tempFile(d->fileName + QLatin1String(".XXXXXX"));
- tempFile.setAutoRemove(false);
- if (!tempFile.open(QIODevice::ReadWrite)) {
- d->setError(QFile::RenameError, tempFile.errorString());
- return false;
- }
- tempFile.close();
- if (!d->engine()->rename(tempFile.fileName())) {
- d->setError(QFile::RenameError, tr("Error while renaming."));
- return false;
- }
- if (tempFile.rename(newName)) {
- d->fileEngine->setFileName(newName);
- d->fileName = newName;
- return true;
- }
- d->setError(QFile::RenameError, tempFile.errorString());
- // We need to restore the original file.
- if (!tempFile.rename(d->fileName)) {
- d->setError(QFile::RenameError, errorString() + QLatin1Char('\n')
+ QTemporaryFileName tfn(d->fileName);
+ QFileSystemEntry src(d->fileName);
+ QSystemError error;
+ for (int attempt = 0; attempt < 16; ++attempt) {
+ QFileSystemEntry tmp(tfn.generateNext(), QFileSystemEntry::FromNativePath());
+
+ // rename to temporary name
+ if (!QFileSystemEngine::renameFile(src, tmp, error))
+ continue;
+
+ // rename to final name
+ if (QFileSystemEngine::renameFile(tmp, QFileSystemEntry(newName), error)) {
+ d->fileEngine->setFileName(newName);
+ d->fileName = newName;
+ return true;
+ }
+
+ // We need to restore the original file.
+ QSystemError error2;
+ if (QFileSystemEngine::renameFile(tmp, src, error2))
+ break; // report the original error, below
+
+ // report both errors
+ d->setError(QFile::RenameError,
+ tr("Error while renaming: %1").arg(error.toString())
+ + QLatin1Char('\n')
+ tr("Unable to restore from %1: %2").
- arg(QDir::toNativeSeparators(tempFile.fileName()), tempFile.errorString()));
+ arg(QDir::toNativeSeparators(tmp.filePath()), error2.toString()));
+ return false;
}
+ d->setError(QFile::RenameError,
+ tr("Error while renaming: %1").arg(error.toString()));
return false;
#endif // Q_OS_LINUX
-#endif // QT_NO_TEMPORARYFILE
}
unsetError();
close();
if(error() == QFile::NoError) {
- if (d->engine()->rename(newName)) {
+ if (changingCase ? d->engine()->renameOverwrite(newName) : d->engine()->rename(newName)) {
unsetError();
// engine was able to handle the new name so we just reset it
d->fileEngine->setFileName(newName);
@@ -707,7 +719,7 @@ bool
QFile::link(const QString &linkName)
{
Q_D(QFile);
- if (d->fileName.isEmpty()) {
+ if (fileName().isEmpty()) {
qWarning("QFile::link: Empty or null file name");
return false;
}
@@ -753,7 +765,7 @@ bool
QFile::copy(const QString &newName)
{
Q_D(QFile);
- if (d->fileName.isEmpty()) {
+ if (fileName().isEmpty()) {
qWarning("QFile::copy: Empty or null file name");
return false;
}
@@ -794,25 +806,27 @@ QFile::copy(const QString &newName)
close();
d->setError(QFile::CopyError, tr("Cannot open for output"));
} else {
- char block[4096];
- qint64 totalRead = 0;
- while(!atEnd()) {
- qint64 in = read(block, sizeof(block));
- if (in <= 0)
- break;
- totalRead += in;
- if(in != out.write(block, in)) {
- close();
- d->setError(QFile::CopyError, tr("Failure to write block"));
- error = true;
- break;
+ if (!d->engine()->cloneTo(out.d_func()->engine())) {
+ char block[4096];
+ qint64 totalRead = 0;
+ while (!atEnd()) {
+ qint64 in = read(block, sizeof(block));
+ if (in <= 0)
+ break;
+ totalRead += in;
+ if (in != out.write(block, in)) {
+ close();
+ d->setError(QFile::CopyError, tr("Failure to write block"));
+ error = true;
+ break;
+ }
}
- }
- if (totalRead != size()) {
- // Unable to read from the source. The error string is
- // already set from read().
- error = true;
+ if (totalRead != size()) {
+ // Unable to read from the source. The error string is
+ // already set from read().
+ error = true;
+ }
}
if (!error && !out.rename(newName)) {
error = true;
@@ -957,7 +971,9 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
qWarning("QFile::open: File access not specified");
return false;
}
- if (d->openExternalFile(mode, fh, handleFlags)) {
+
+ // QIODevice provides the buffering, so request unbuffered file engines
+ if (d->openExternalFile(mode | Unbuffered, fh, handleFlags)) {
QIODevice::open(mode);
if (!(mode & Append) && !isSequential()) {
qint64 pos = (qint64)QT_FTELL(fh);
@@ -1013,7 +1029,9 @@ bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags)
qWarning("QFile::open: File access not specified");
return false;
}
- if (d->openExternalFile(mode, fd, handleFlags)) {
+
+ // QIODevice provides the buffering, so request unbuffered file engines
+ if (d->openExternalFile(mode | Unbuffered, fd, handleFlags)) {
QIODevice::open(mode);
if (!(mode & Append) && !isSequential()) {
qint64 pos = (qint64)QT_LSEEK(fd, QT_OFF_T(0), SEEK_CUR);
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index a2a1b25248..c5819e8076 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -81,6 +81,7 @@ public:
}
static QString decodeName(const QByteArray &localFileName)
{
+ // note: duplicated in qglobal.cpp (qEnvironmentVariable)
return QString::fromUtf8(localFileName).normalized(QString::NormalizationForm_C);
}
#else
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index f50949e6c1..2f99775c65 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -740,6 +740,76 @@ bool QFileDevice::unmap(uchar *address)
return false;
}
+/*!
+ \enum QFileDevice::FileTime
+ \since 5.10
+
+ This enum is used by the fileTime() and setFileTime() functions.
+
+ \value FileAccessTime When the file was most recently accessed
+ (e.g. read or written to).
+ \value FileBirthTime When the file was created (may not be not
+ supported on UNIX).
+ \value FileMetadataChangeTime When the file's metadata was last changed.
+ \value FileModificationTime When the file was most recently modified.
+
+ \sa setFileTime(), fileTime(), QFileInfo::fileTime()
+*/
+
+static inline QAbstractFileEngine::FileTime FileDeviceTimeToAbstractFileEngineTime(QFileDevice::FileTime time)
+{
+ Q_STATIC_ASSERT(int(QFileDevice::FileAccessTime) == int(QAbstractFileEngine::AccessTime));
+ Q_STATIC_ASSERT(int(QFileDevice::FileBirthTime) == int(QAbstractFileEngine::BirthTime));
+ Q_STATIC_ASSERT(int(QFileDevice::FileMetadataChangeTime) == int(QAbstractFileEngine::MetadataChangeTime));
+ Q_STATIC_ASSERT(int(QFileDevice::FileModificationTime) == int(QAbstractFileEngine::ModificationTime));
+ return QAbstractFileEngine::FileTime(time);
+}
+
+/*!
+ \since 5.10
+ Returns the file time specified by \a time.
+ If the time cannot be determined return QDateTime() (an invalid
+ date time).
+
+ \sa setFileTime(), FileTime, QDateTime::isValid()
+*/
+QDateTime QFileDevice::fileTime(QFileDevice::FileTime time) const
+{
+ Q_D(const QFileDevice);
+
+ if (d->engine())
+ return d->engine()->fileTime(FileDeviceTimeToAbstractFileEngineTime(time));
+
+ return QDateTime();
+}
+
+/*!
+ \since 5.10
+ Sets the file time specified by \a fileTime to \a newDate, returning true
+ if successful; otherwise returns false.
+
+ \note The file must be open to use this function.
+
+ \sa fileTime(), FileTime
+*/
+bool QFileDevice::setFileTime(const QDateTime &newDate, QFileDevice::FileTime fileTime)
+{
+ Q_D(QFileDevice);
+
+ if (!d->engine()) {
+ d->setError(QFileDevice::UnspecifiedError, tr("No file engine available"));
+ return false;
+ }
+
+ if (!d->fileEngine->setFileTime(newDate, FileDeviceTimeToAbstractFileEngineTime(fileTime))) {
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
+ return false;
+ }
+
+ unsetError();
+ return true;
+}
+
QT_END_NAMESPACE
#ifndef QT_NO_QOBJECT
diff --git a/src/corelib/io/qfiledevice.h b/src/corelib/io/qfiledevice.h
index 4cfda1b044..e941781c25 100644
--- a/src/corelib/io/qfiledevice.h
+++ b/src/corelib/io/qfiledevice.h
@@ -45,6 +45,7 @@
QT_BEGIN_NAMESPACE
+class QDateTime;
class QFileDevicePrivate;
class Q_CORE_EXPORT QFileDevice : public QIODevice
@@ -73,6 +74,13 @@ public:
CopyError = 14
};
+ enum FileTime {
+ FileAccessTime,
+ FileBirthTime,
+ FileMetadataChangeTime,
+ FileModificationTime
+ };
+
enum Permission {
ReadOwner = 0x4000, WriteOwner = 0x2000, ExeOwner = 0x1000,
ReadUser = 0x0400, WriteUser = 0x0200, ExeUser = 0x0100,
@@ -119,6 +127,9 @@ public:
uchar *map(qint64 offset, qint64 size, MemoryMapFlags flags = NoOptions);
bool unmap(uchar *address);
+ QDateTime fileTime(QFileDevice::FileTime time) const;
+ bool setFileTime(const QDateTime &newDate, QFileDevice::FileTime fileTime);
+
protected:
QFileDevice();
#ifdef QT_NO_QOBJECT
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 907574b6dd..26078a6c71 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -42,6 +42,7 @@
#include "qglobal.h"
#include "qdir.h"
#include "qfileinfo_p.h"
+#include "qdebug.h"
QT_BEGIN_NAMESPACE
@@ -185,17 +186,25 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const
{
Q_ASSERT(fileEngine); // should never be called when using the native FS
- if (fileTimes.size() != 3)
- fileTimes.resize(3);
if (!cache_enabled)
clearFlags();
- uint cf;
- if (request == QAbstractFileEngine::CreationTime)
- cf = CachedCTime;
- else if (request == QAbstractFileEngine::ModificationTime)
- cf = CachedMTime;
- else
+
+ uint cf = 0;
+ switch (request) {
+ case QAbstractFileEngine::AccessTime:
cf = CachedATime;
+ break;
+ case QAbstractFileEngine::BirthTime:
+ cf = CachedBTime;
+ break;
+ case QAbstractFileEngine::MetadataChangeTime:
+ cf = CachedMCTime;
+ break;
+ case QAbstractFileEngine::ModificationTime:
+ cf = CachedMTime;
+ break;
+ }
+
if (!getCachedFlag(cf)) {
fileTimes[request] = fileEngine->fileTime(request);
setCachedFlag(cf);
@@ -262,8 +271,8 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
info objects, just append one to the file name given to the constructors
or setFile().
- The file's dates are returned by created(), lastModified() and
- lastRead(). Information about the file's access permissions is
+ The file's dates are returned by created(), lastModified(), lastRead() and
+ fileTime(). Information about the file's access permissions is
obtained with isReadable(), isWritable() and isExecutable(). The
file's ownership is available from owner(), ownerId(), group() and
groupId(). You can examine a file's permissions and ownership in a
@@ -582,9 +591,6 @@ QString QFileInfo::absolutePath() const
if (d->isDefaultConstructed) {
return QLatin1String("");
- } else if (d->fileEntry.isEmpty()) {
- qWarning("QFileInfo::absolutePath: Constructed with empty filename");
- return QLatin1String("");
}
return d->getFileName(QAbstractFileEngine::AbsolutePathName);
}
@@ -904,14 +910,10 @@ QDir QFileInfo::absoluteDir() const
bool QFileInfo::isReadable() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserReadPermission))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserReadPermission);
- return (d->metaData.permissions() & QFile::ReadUser) != 0;
- }
- return d->getFileFlags(QAbstractFileEngine::ReadUserPerm);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::UserReadPermission,
+ [d]() { return (d->metaData.permissions() & QFile::ReadUser) != 0; },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::ReadUserPerm); });
}
/*!
@@ -925,14 +927,10 @@ bool QFileInfo::isReadable() const
bool QFileInfo::isWritable() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserWritePermission))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserWritePermission);
- return (d->metaData.permissions() & QFile::WriteUser) != 0;
- }
- return d->getFileFlags(QAbstractFileEngine::WriteUserPerm);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::UserWritePermission,
+ [d]() { return (d->metaData.permissions() & QFile::WriteUser) != 0; },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::WriteUserPerm); });
}
/*!
@@ -943,14 +941,10 @@ bool QFileInfo::isWritable() const
bool QFileInfo::isExecutable() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserExecutePermission))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserExecutePermission);
- return (d->metaData.permissions() & QFile::ExeUser) != 0;
- }
- return d->getFileFlags(QAbstractFileEngine::ExeUserPerm);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::UserExecutePermission,
+ [d]() { return (d->metaData.permissions() & QFile::ExeUser) != 0; },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::ExeUserPerm); });
}
/*!
@@ -962,14 +956,10 @@ bool QFileInfo::isExecutable() const
bool QFileInfo::isHidden() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::HiddenAttribute))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::HiddenAttribute);
- return d->metaData.isHidden();
- }
- return d->getFileFlags(QAbstractFileEngine::HiddenFlag);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::HiddenAttribute,
+ [d]() { return d->metaData.isHidden(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::HiddenFlag); });
}
/*!
@@ -1005,14 +995,10 @@ bool QFileInfo::isNativePath() const
bool QFileInfo::isFile() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::FileType))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::FileType);
- return d->metaData.isFile();
- }
- return d->getFileFlags(QAbstractFileEngine::FileType);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::FileType,
+ [d]() { return d->metaData.isFile(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::FileType); });
}
/*!
@@ -1024,14 +1010,10 @@ bool QFileInfo::isFile() const
bool QFileInfo::isDir() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::DirectoryType))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::DirectoryType);
- return d->metaData.isDirectory();
- }
- return d->getFileFlags(QAbstractFileEngine::DirectoryType);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::DirectoryType,
+ [d]() { return d->metaData.isDirectory(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::DirectoryType); });
}
@@ -1045,14 +1027,10 @@ bool QFileInfo::isDir() const
bool QFileInfo::isBundle() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::BundleType))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::BundleType);
- return d->metaData.isBundle();
- }
- return d->getFileFlags(QAbstractFileEngine::BundleType);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::BundleType,
+ [d]() { return d->metaData.isBundle(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::BundleType); });
}
/*!
@@ -1079,14 +1057,10 @@ bool QFileInfo::isBundle() const
bool QFileInfo::isSymLink() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::LegacyLinkType))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::LegacyLinkType);
- return d->metaData.isLegacyLink();
- }
- return d->getFileFlags(QAbstractFileEngine::LinkType);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::LegacyLinkType,
+ [d]() { return d->metaData.isLegacyLink(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
}
/*!
@@ -1098,7 +1072,7 @@ bool QFileInfo::isRoot() const
{
Q_D(const QFileInfo);
if (d->isDefaultConstructed)
- return true;
+ return false;
if (d->fileEngine == 0) {
if (d->fileEntry.isRoot()) {
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
@@ -1174,14 +1148,10 @@ QString QFileInfo::owner() const
uint QFileInfo::ownerId() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return 0;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserId))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserId);
- return d->metaData.userId();
- }
- return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
+ return d->checkAttribute(uint(-2),
+ QFileSystemMetaData::UserId,
+ [d]() { return d->metaData.userId(); },
+ [d]() { return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser); });
}
/*!
@@ -1213,14 +1183,10 @@ QString QFileInfo::group() const
uint QFileInfo::groupId() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return 0;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::GroupId))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::GroupId);
- return d->metaData.groupId();
- }
- return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
+ return d->checkAttribute(uint(-2),
+ QFileSystemMetaData::GroupId,
+ [d]() { return d->metaData.groupId(); },
+ [d]() { return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup); });
}
/*!
@@ -1242,16 +1208,15 @@ uint QFileInfo::groupId() const
bool QFileInfo::permission(QFile::Permissions permissions) const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return false;
- if (d->fileEngine == 0) {
- // the QFileSystemMetaData::MetaDataFlag and QFile::Permissions overlap, so just static cast.
- QFileSystemMetaData::MetaDataFlag permissionFlags = static_cast<QFileSystemMetaData::MetaDataFlag>((int)permissions);
- if (!d->cache_enabled || !d->metaData.hasFlags(permissionFlags))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, permissionFlags);
- return (d->metaData.permissions() & permissions) == permissions;
- }
- return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions;
+ // the QFileSystemMetaData::MetaDataFlag and QFile::Permissions overlap, so just cast.
+ auto fseFlags = QFileSystemMetaData::MetaDataFlag(int(permissions));
+ auto feFlags = QAbstractFileEngine::FileFlags(int(permissions));
+ return d->checkAttribute<bool>(
+ fseFlags,
+ [=]() { return (d->metaData.permissions() & permissions) == permissions; },
+ [=]() {
+ return d->getFileFlags(feFlags) == uint(permissions);
+ });
}
/*!
@@ -1264,14 +1229,12 @@ bool QFileInfo::permission(QFile::Permissions permissions) const
QFile::Permissions QFileInfo::permissions() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return 0;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::Permissions))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::Permissions);
- return d->metaData.permissions();
- }
- return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
+ return d->checkAttribute<QFile::Permissions>(
+ QFileSystemMetaData::Permissions,
+ [d]() { return d->metaData.permissions(); },
+ [d]() {
+ return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
+ });
}
@@ -1284,64 +1247,77 @@ QFile::Permissions QFileInfo::permissions() const
qint64 QFileInfo::size() const
{
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return 0;
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::SizeAttribute))
- QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::SizeAttribute);
- return d->metaData.size();
- }
- if (!d->getCachedFlag(QFileInfoPrivate::CachedSize)) {
- d->setCachedFlag(QFileInfoPrivate::CachedSize);
- d->fileSize = d->fileEngine->size();
- }
- return d->fileSize;
+ return d->checkAttribute<qint64>(
+ QFileSystemMetaData::SizeAttribute,
+ [d]() { return d->metaData.size(); },
+ [d]() {
+ if (!d->getCachedFlag(QFileInfoPrivate::CachedSize)) {
+ d->setCachedFlag(QFileInfoPrivate::CachedSize);
+ d->fileSize = d->fileEngine->size();
+ }
+ return d->fileSize;
+ });
}
+#if QT_DEPRECATED_SINCE(5, 10)
/*!
- Returns the date and local time when the file was created.
+ \deprecated
- On most Unix systems, this function returns the time of the last
- status change. A status change occurs when the file is created,
- but it also occurs whenever the user writes or sets inode
- information (for example, changing the file permissions).
+ Returns the date and time when the file was created, the time its metadata
+ was last changed or the time of last modification, whichever one of the
+ three is available (in that order).
- If neither creation time nor "last status change" time are not
- available, returns the same as lastModified().
+ This function is deprecated. Instead, use the birthTime() function to get
+ the time the file was created, metadataChangeTime() to get the time its
+ metadata was last changed, or lastModified() to get the time it was last modified.
- \sa lastModified(), lastRead()
+ \sa birthTime(), metadataChangeTime(), lastModified(), lastRead()
*/
QDateTime QFileInfo::created() const
{
- Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return QDateTime();
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::CreationTime))
- if (!QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::CreationTime))
- return QDateTime();
- return d->metaData.creationTime().toLocalTime();
- }
- return d->getFileTime(QAbstractFileEngine::CreationTime).toLocalTime();
+ QDateTime d = fileTime(QFile::FileBirthTime);
+ if (d.isValid())
+ return d;
+ return fileTime(QFile::FileMetadataChangeTime);
+}
+#endif
+
+/*!
+ \since 5.10
+ Returns the date and time when the file was created / born.
+
+ If the file birth time is not available, this function returns an invalid
+ QDateTime.
+
+ \sa lastModified(), lastRead(), metadataChangeTime()
+*/
+QDateTime QFileInfo::birthTime() const
+{
+ return fileTime(QFile::FileBirthTime);
+}
+
+/*!
+ \since 5.10
+ Returns the date and time when the file metadata was changed. A metadata
+ change occurs when the file is created, but it also occurs whenever the
+ user writes or sets inode information (for example, changing the file
+ permissions).
+
+ \sa lastModified(), lastRead()
+*/
+QDateTime QFileInfo::metadataChangeTime() const
+{
+ return fileTime(QFile::FileMetadataChangeTime);
}
/*!
Returns the date and local time when the file was last modified.
- \sa created(), lastRead()
+ \sa birthTime(), lastRead(), metadataChangeTime(), fileTime()
*/
QDateTime QFileInfo::lastModified() const
{
- Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return QDateTime();
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ModificationTime))
- if (!QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ModificationTime))
- return QDateTime();
- return d->metaData.modificationTime().toLocalTime();
- }
- return d->getFileTime(QAbstractFileEngine::ModificationTime).toLocalTime();
+ return fileTime(QFile::FileModificationTime);
}
/*!
@@ -1350,20 +1326,50 @@ QDateTime QFileInfo::lastModified() const
On platforms where this information is not available, returns the
same as lastModified().
- \sa created(), lastModified()
+ \sa birthTime(), lastModified(), metadataChangeTime(), fileTime()
*/
QDateTime QFileInfo::lastRead() const
{
+ return fileTime(QFile::FileAccessTime);
+}
+
+/*!
+ \since 5.10
+
+ Returns the file time specified by \a time. If the time cannot be
+ determined, an invalid date time is returned.
+
+ \sa QFile::FileTime, QDateTime::isValid()
+*/
+QDateTime QFileInfo::fileTime(QFile::FileTime time) const
+{
+ Q_STATIC_ASSERT(int(QFile::FileAccessTime) == int(QAbstractFileEngine::AccessTime));
+ Q_STATIC_ASSERT(int(QFile::FileBirthTime) == int(QAbstractFileEngine::BirthTime));
+ Q_STATIC_ASSERT(int(QFile::FileMetadataChangeTime) == int(QAbstractFileEngine::MetadataChangeTime));
+ Q_STATIC_ASSERT(int(QFile::FileModificationTime) == int(QAbstractFileEngine::ModificationTime));
+
Q_D(const QFileInfo);
- if (d->isDefaultConstructed)
- return QDateTime();
- if (d->fileEngine == 0) {
- if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::AccessTime))
- if (!QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::AccessTime))
- return QDateTime();
- return d->metaData.accessTime().toLocalTime();
+ auto fetime = QAbstractFileEngine::FileTime(time);
+ QFileSystemMetaData::MetaDataFlags flag;
+ switch (time) {
+ case QFile::FileAccessTime:
+ flag = QFileSystemMetaData::AccessTime;
+ break;
+ case QFile::FileBirthTime:
+ flag = QFileSystemMetaData::BirthTime;
+ break;
+ case QFile::FileMetadataChangeTime:
+ flag = QFileSystemMetaData::MetadataChangeTime;
+ break;
+ case QFile::FileModificationTime:
+ flag = QFileSystemMetaData::ModificationTime;
+ break;
}
- return d->getFileTime(QAbstractFileEngine::AccessTime).toLocalTime();
+
+ return d->checkAttribute<QDateTime>(
+ flag,
+ [=]() { return d->metaData.fileTime(fetime).toLocalTime(); },
+ [=]() { return d->getFileTime(fetime).toLocalTime(); });
}
/*!
@@ -1410,4 +1416,15 @@ void QFileInfo::setCaching(bool enable)
Synonym for QList<QFileInfo>.
*/
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QFileInfo &fi)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace();
+ dbg.noquote();
+ dbg << "QFileInfo(" << QDir::toNativeSeparators(fi.filePath()) << ')';
+ return dbg;
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index a160e8463e..f295a86015 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -129,9 +129,16 @@ public:
qint64 size() const;
+ // ### Qt6: inline these functions
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED_X("Use either birthTime() or metadataChangeTime()")
QDateTime created() const;
+#endif
+ QDateTime birthTime() const;
+ QDateTime metadataChangeTime() const;
QDateTime lastModified() const;
QDateTime lastRead() const;
+ QDateTime fileTime(QFile::FileTime time) const;
bool caching() const;
void setCaching(bool on);
@@ -151,6 +158,10 @@ Q_DECLARE_SHARED(QFileInfo)
typedef QList<QFileInfo> QFileInfoList;
+#ifndef QT_NO_DEBUG_STREAM
+Q_CORE_EXPORT QDebug operator<<(QDebug, const QFileInfo &);
+#endif
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QFileInfo)
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 806df179e8..e4b28f4519 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -56,7 +56,6 @@
#include "qatomic.h"
#include "qshareddata.h"
#include "qfilesystemengine_p.h"
-#include "qvector.h"
#include <QtCore/private/qabstractfileengine_p.h>
#include <QtCore/private/qfilesystementry_p.h>
@@ -67,9 +66,18 @@ QT_BEGIN_NAMESPACE
class QFileInfoPrivate : public QSharedData
{
public:
- enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04,
- CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40,
- CachedSize =0x08, CachedPerms=0x80 };
+ enum {
+ // note: cachedFlags is only 30-bits wide
+ CachedFileFlags = 0x01,
+ CachedLinkTypeFlag = 0x02,
+ CachedBundleTypeFlag = 0x04,
+ CachedSize = 0x08,
+ CachedATime = 0x10,
+ CachedBTime = 0x20,
+ CachedMCTime = 0x40,
+ CachedMTime = 0x80,
+ CachedPerms = 0x100
+ };
inline QFileInfoPrivate()
: QSharedData(), fileEngine(0),
@@ -95,7 +103,7 @@ public:
fileEngine(QFileSystemEngine::resolveEntryAndCreateLegacyEngine(fileEntry, metaData)),
cachedFlags(0),
#ifndef QT_NO_FSFILEENGINE
- isDefaultConstructed(false),
+ isDefaultConstructed(file.isEmpty()),
#else
isDefaultConstructed(!fileEngine),
#endif
@@ -158,24 +166,40 @@ public:
QScopedPointer<QAbstractFileEngine> const fileEngine;
mutable QString fileNames[QAbstractFileEngine::NFileNames];
- mutable QString fileOwners[2];
+ mutable QString fileOwners[2]; // QAbstractFileEngine::FileOwner: OwnerUser and OwnerGroup
+ mutable QDateTime fileTimes[4]; // QAbstractFileEngine::FileTime: BirthTime, MetadataChangeTime, ModificationTime, AccessTime
mutable uint cachedFlags : 30;
bool const isDefaultConstructed : 1; // QFileInfo is a default constructed instance
bool cache_enabled : 1;
mutable uint fileFlags;
mutable qint64 fileSize;
- // ### Qt6: FIXME: This vector is essentially a plain array
- // mutable QDateTime fileTimes[3], but the array is slower
- // to initialize than the QVector as QDateTime has a pimpl.
- // In Qt 6, QDateTime should inline its data members,
- // and this here can be an array again.
- mutable QVector<QDateTime> fileTimes;
inline bool getCachedFlag(uint c) const
{ return cache_enabled ? (cachedFlags & c) : 0; }
inline void setCachedFlag(uint c) const
{ if (cache_enabled) cachedFlags |= c; }
+ template <typename Ret, typename FSLambda, typename EngineLambda>
+ Ret checkAttribute(Ret defaultValue, QFileSystemMetaData::MetaDataFlags fsFlags, const FSLambda &fsLambda,
+ const EngineLambda &engineLambda) const
+ {
+ if (isDefaultConstructed)
+ return defaultValue;
+ if (fileEngine)
+ return engineLambda();
+ if (!cache_enabled || !metaData.hasFlags(fsFlags)) {
+ QFileSystemEngine::fillMetaData(fileEntry, metaData, fsFlags);
+ // ignore errors, fillMetaData will have cleared the flags
+ }
+ return fsLambda();
+ }
+
+ template <typename Ret, typename FSLambda, typename EngineLambda>
+ Ret checkAttribute(QFileSystemMetaData::MetaDataFlags fsFlags, const FSLambda &fsLambda,
+ const EngineLambda &engineLambda) const
+ {
+ return checkAttribute(Ret(), fsFlags, fsLambda, engineLambda);
+ }
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index ccbcdb1037..73a2e37a38 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -204,228 +204,6 @@ QAbstractFileEngine *QFileSystemEngine::resolveEntryAndCreateLegacyEngine(
return engine;
}
-//these unix functions are in this file, because they are shared by symbian port
-//for open C file handles.
-#ifdef Q_OS_UNIX
-//static
-bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
-{
- data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
- data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags;
-
- QT_STATBUF statBuffer;
- if (QT_FSTAT(fd, &statBuffer) == 0) {
- data.fillFromStatBuf(statBuffer);
- return true;
- }
-
- return false;
-}
-
-#if defined(_DEXTRA_FIRST)
-static void fillStat64fromStat32(struct stat64 *statBuf64, const struct stat &statBuf32)
-{
- statBuf64->st_mode = statBuf32.st_mode;
- statBuf64->st_size = statBuf32.st_size;
-#if _POSIX_VERSION >= 200809L
- statBuf64->st_ctim = statBuf32.st_ctim;
- statBuf64->st_mtim = statBuf32.st_mtim;
- statBuf64->st_atim = statBuf32.st_atim;
-#else
- statBuf64->st_ctime = statBuf32.st_ctime;
- statBuf64->st_mtime = statBuf32.st_mtime;
- statBuf64->st_atime = statBuf32.st_atime;
-#endif
- statBuf64->st_uid = statBuf32.st_uid;
- statBuf64->st_gid = statBuf32.st_gid;
-}
-#endif
-
-#if _POSIX_VERSION >= 200809L
-static qint64 timespecToMSecs(const timespec &spec)
-{
- return (qint64(spec.tv_sec) * 1000) + (spec.tv_nsec / 1000000);
-}
-#endif
-
-void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
-{
- // Permissions
- if (statBuffer.st_mode & S_IRUSR)
- entryFlags |= QFileSystemMetaData::OwnerReadPermission;
- if (statBuffer.st_mode & S_IWUSR)
- entryFlags |= QFileSystemMetaData::OwnerWritePermission;
- if (statBuffer.st_mode & S_IXUSR)
- entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
-
- if (statBuffer.st_mode & S_IRGRP)
- entryFlags |= QFileSystemMetaData::GroupReadPermission;
- if (statBuffer.st_mode & S_IWGRP)
- entryFlags |= QFileSystemMetaData::GroupWritePermission;
- if (statBuffer.st_mode & S_IXGRP)
- entryFlags |= QFileSystemMetaData::GroupExecutePermission;
-
- if (statBuffer.st_mode & S_IROTH)
- entryFlags |= QFileSystemMetaData::OtherReadPermission;
- if (statBuffer.st_mode & S_IWOTH)
- entryFlags |= QFileSystemMetaData::OtherWritePermission;
- if (statBuffer.st_mode & S_IXOTH)
- entryFlags |= QFileSystemMetaData::OtherExecutePermission;
-
- // Type
- if ((statBuffer.st_mode & S_IFMT) == S_IFREG)
- entryFlags |= QFileSystemMetaData::FileType;
- else if ((statBuffer.st_mode & S_IFMT) == S_IFDIR)
- entryFlags |= QFileSystemMetaData::DirectoryType;
- else if ((statBuffer.st_mode & S_IFMT) != S_IFBLK)
- entryFlags |= QFileSystemMetaData::SequentialType;
-
- // Attributes
- entryFlags |= QFileSystemMetaData::ExistsAttribute;
- size_ = statBuffer.st_size;
-#if defined(Q_OS_DARWIN)
- if (statBuffer.st_flags & UF_HIDDEN) {
- entryFlags |= QFileSystemMetaData::HiddenAttribute;
- knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
- }
-#endif
-
- // Times
-#if _POSIX_VERSION >= 200809L
- modificationTime_ = timespecToMSecs(statBuffer.st_mtim);
- creationTime_ = timespecToMSecs(statBuffer.st_ctim);
- if (!creationTime_)
- creationTime_ = modificationTime_;
- accessTime_ = timespecToMSecs(statBuffer.st_atim);
-#else
- creationTime_ = qint64(statBuffer.st_ctime ? statBuffer.st_ctime : statBuffer.st_mtime) * 1000;
- modificationTime_ = qint64(statBuffer.st_mtime) * 1000;
- accessTime_ = qint64(statBuffer.st_atime) * 1000;
-#endif
- userId_ = statBuffer.st_uid;
- groupId_ = statBuffer.st_gid;
-}
-
-void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
-{
-#if defined(_DEXTRA_FIRST)
- knownFlagsMask = 0;
- entryFlags = 0;
- for (dirent_extra *extra = _DEXTRA_FIRST(&entry); _DEXTRA_VALID(extra, &entry);
- extra = _DEXTRA_NEXT(extra)) {
- if (extra->d_type == _DTYPE_STAT || extra->d_type == _DTYPE_LSTAT) {
-
- const struct dirent_extra_stat * const extra_stat =
- reinterpret_cast<struct dirent_extra_stat *>(extra);
-
- // Remember whether this was a link or not, this saves an lstat() call later.
- if (extra->d_type == _DTYPE_LSTAT) {
- knownFlagsMask |= QFileSystemMetaData::LinkType;
- if (S_ISLNK(extra_stat->d_stat.st_mode))
- entryFlags |= QFileSystemMetaData::LinkType;
- }
-
- // For symlinks, the extra type _DTYPE_LSTAT doesn't work for filling out the meta data,
- // as we need the stat() information there, not the lstat() information.
- // In this case, don't use the extra information.
- // Unfortunately, readdir() never seems to return extra info of type _DTYPE_STAT, so for
- // symlinks, we always incur the cost of an extra stat() call later.
- if (S_ISLNK(extra_stat->d_stat.st_mode) && extra->d_type == _DTYPE_LSTAT)
- continue;
-
-#if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT)
- // Even with large file support, d_stat is always of type struct stat, not struct stat64,
- // so it needs to be converted
- struct stat64 statBuf;
- fillStat64fromStat32(&statBuf, extra_stat->d_stat);
- fillFromStatBuf(statBuf);
-#else
- fillFromStatBuf(extra_stat->d_stat);
-#endif
- knownFlagsMask |= QFileSystemMetaData::PosixStatFlags;
- if (!S_ISLNK(extra_stat->d_stat.st_mode)) {
- knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
- entryFlags |= QFileSystemMetaData::ExistsAttribute;
- }
- }
- }
-#elif defined(_DIRENT_HAVE_D_TYPE) || defined(Q_OS_BSD4)
- // BSD4 includes OS X and iOS
-
- // ### This will clear all entry flags and knownFlagsMask
- switch (entry.d_type)
- {
- case DT_DIR:
- knownFlagsMask = QFileSystemMetaData::LinkType
- | QFileSystemMetaData::FileType
- | QFileSystemMetaData::DirectoryType
- | QFileSystemMetaData::SequentialType
- | QFileSystemMetaData::ExistsAttribute;
-
- entryFlags = QFileSystemMetaData::DirectoryType
- | QFileSystemMetaData::ExistsAttribute;
-
- break;
-
- case DT_BLK:
- knownFlagsMask = QFileSystemMetaData::LinkType
- | QFileSystemMetaData::FileType
- | QFileSystemMetaData::DirectoryType
- | QFileSystemMetaData::BundleType
- | QFileSystemMetaData::AliasType
- | QFileSystemMetaData::SequentialType
- | QFileSystemMetaData::ExistsAttribute;
-
- entryFlags = QFileSystemMetaData::ExistsAttribute;
-
- break;
-
- case DT_CHR:
- case DT_FIFO:
- case DT_SOCK:
- // ### System attribute
- knownFlagsMask = QFileSystemMetaData::LinkType
- | QFileSystemMetaData::FileType
- | QFileSystemMetaData::DirectoryType
- | QFileSystemMetaData::BundleType
- | QFileSystemMetaData::AliasType
- | QFileSystemMetaData::SequentialType
- | QFileSystemMetaData::ExistsAttribute;
-
- entryFlags = QFileSystemMetaData::SequentialType
- | QFileSystemMetaData::ExistsAttribute;
-
- break;
-
- case DT_LNK:
- knownFlagsMask = QFileSystemMetaData::LinkType;
- entryFlags = QFileSystemMetaData::LinkType;
- break;
-
- case DT_REG:
- knownFlagsMask = QFileSystemMetaData::LinkType
- | QFileSystemMetaData::FileType
- | QFileSystemMetaData::DirectoryType
- | QFileSystemMetaData::BundleType
- | QFileSystemMetaData::SequentialType
- | QFileSystemMetaData::ExistsAttribute;
-
- entryFlags = QFileSystemMetaData::FileType
- | QFileSystemMetaData::ExistsAttribute;
-
- break;
-
- case DT_UNKNOWN:
- default:
- clear();
- }
-#else
- Q_UNUSED(entry)
-#endif
-}
-
-#endif
-
//static
QString QFileSystemEngine::resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &metaData)
{
@@ -435,6 +213,8 @@ QString QFileSystemEngine::resolveUserName(const QFileSystemEntry &entry, QFileS
#else //(Q_OS_UNIX)
if (!metaData.hasFlags(QFileSystemMetaData::UserId))
QFileSystemEngine::fillMetaData(entry, metaData, QFileSystemMetaData::UserId);
+ if (!metaData.exists())
+ return QString();
return resolveUserName(metaData.userId());
#endif
}
@@ -448,6 +228,8 @@ QString QFileSystemEngine::resolveGroupName(const QFileSystemEntry &entry, QFile
#else //(Q_OS_UNIX)
if (!metaData.hasFlags(QFileSystemMetaData::GroupId))
QFileSystemEngine::fillMetaData(entry, metaData, QFileSystemMetaData::GroupId);
+ if (!metaData.exists())
+ return QString();
return resolveGroupName(metaData.groupId());
#endif
}
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h
index e3e52f6eaa..09ec2d6a10 100644
--- a/src/corelib/io/qfilesystemengine_p.h
+++ b/src/corelib/io/qfilesystemengine_p.h
@@ -91,8 +91,11 @@ public:
static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what);
#if defined(Q_OS_UNIX)
+ static bool cloneFile(int srcfd, int dstfd, const QFileSystemMetaData &knownData);
static bool fillMetaData(int fd, QFileSystemMetaData &data); // what = PosixStatFlags
static QByteArray id(int fd);
+ static bool setFileTime(int fd, const QDateTime &newDate,
+ QAbstractFileEngine::FileTime whatTime, QSystemError &error);
static bool setPermissions(int fd, QFile::Permissions permissions, QSystemError &error,
QFileSystemMetaData *data = nullptr);
#endif
@@ -106,6 +109,8 @@ public:
static bool fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what);
static QByteArray id(HANDLE fHandle);
+ static bool setFileTime(HANDLE fHandle, const QDateTime &newDate,
+ QAbstractFileEngine::FileTime whatTime, QSystemError &error);
static QString owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own);
static QString nativeAbsoluteFilePath(const QString &path);
#endif
@@ -121,11 +126,16 @@ public:
static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
+ static bool renameOverwriteFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
static bool removeFile(const QFileSystemEntry &entry, QSystemError &error);
static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error,
QFileSystemMetaData *data = 0);
+ // unused, therefore not implemented
+ static bool setFileTime(const QFileSystemEntry &entry, const QDateTime &newDate,
+ QAbstractFileEngine::FileTime whatTime, QSystemError &error);
+
static bool setCurrentPath(const QFileSystemEntry &entry);
static QFileSystemEntry currentPath();
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 7600c9a613..2828c85048 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -43,6 +43,8 @@
#include "qfilesystemengine_p.h"
#include "qfile.h"
+#include <QtCore/qoperatingsystemversion.h>
+#include <QtCore/private/qcore_unix_p.h>
#include <QtCore/qvarlengtharray.h>
#include <stdlib.h> // for realpath()
@@ -52,7 +54,6 @@
#include <stdio.h>
#include <errno.h>
-
#if defined(Q_OS_MAC)
# include <QtCore/private/qcore_mac_p.h>
# include <CoreFoundation/CFBundle.h>
@@ -67,14 +68,48 @@
#endif
#if defined(Q_OS_DARWIN)
+# if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(101200, 100000, 100000, 30000)
+# include <sys/clonefile.h>
+# endif
+# include <copyfile.h>
// We cannot include <Foundation/Foundation.h> (it's an Objective-C header), but
// we need these declarations:
Q_FORWARD_DECLARE_OBJC_CLASS(NSString);
extern "C" NSString *NSTemporaryDirectory();
#endif
+#if defined(Q_OS_LINUX)
+# include <sys/ioctl.h>
+# include <sys/syscall.h>
+# include <sys/sendfile.h>
+# include <linux/fs.h>
+
+// in case linux/fs.h is too old and doesn't define it:
+#ifndef FICLONE
+# define FICLONE _IOW(0x94, 9, int)
+#endif
+
+# if !QT_CONFIG(renameat2) && defined(SYS_renameat2)
+static int renameat2(int oldfd, const char *oldpath, int newfd, const char *newpath, unsigned flags)
+{ return syscall(SYS_renameat2, oldfd, oldpath, newfd, newpath, flags); }
+# endif
+
+# if !QT_CONFIG(statx) && defined(SYS_statx) && QT_HAS_INCLUDE(<linux/stat.h>)
+# include <linux/stat.h>
+static int statx(int dirfd, const char *pathname, int flag, unsigned mask, struct statx *statxbuf)
+{ return syscall(SYS_statx, dirfd, pathname, flag, mask, statxbuf); }
+# endif
+#endif
+
QT_BEGIN_NAMESPACE
+#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,
@@ -143,33 +178,450 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
}
#endif
+namespace {
+namespace GetFileTimes {
+#if !QT_CONFIG(futimens) && (QT_CONFIG(futimes))
+template <typename T>
+static inline typename QtPrivate::QEnableIf<(&T::st_atim, &T::st_mtim, true)>::Type get(const T *p, struct timeval *access, struct timeval *modification)
+{
+ access->tv_sec = p->st_atim.tv_sec;
+ access->tv_usec = p->st_atim.tv_nsec / 1000;
+
+ modification->tv_sec = p->st_mtim.tv_sec;
+ modification->tv_usec = p->st_mtim.tv_nsec / 1000;
+}
+
+template <typename T>
+static inline typename QtPrivate::QEnableIf<(&T::st_atimespec, &T::st_mtimespec, true)>::Type get(const T *p, struct timeval *access, struct timeval *modification)
+{
+ access->tv_sec = p->st_atimespec.tv_sec;
+ access->tv_usec = p->st_atimespec.tv_nsec / 1000;
+
+ modification->tv_sec = p->st_mtimespec.tv_sec;
+ modification->tv_usec = p->st_mtimespec.tv_nsec / 1000;
+}
+
+template <typename T>
+static inline typename QtPrivate::QEnableIf<(&T::st_atimensec, &T::st_mtimensec, true)>::Type get(const T *p, struct timeval *access, struct timeval *modification)
+{
+ access->tv_sec = p->st_atime;
+ access->tv_usec = p->st_atimensec / 1000;
+
+ modification->tv_sec = p->st_mtime;
+ modification->tv_usec = p->st_mtimensec / 1000;
+}
+#endif
+
+qint64 timespecToMSecs(const timespec &spec)
+{
+ return (qint64(spec.tv_sec) * 1000) + (spec.tv_nsec / 1000000);
+}
+
+// fallback set
+Q_DECL_UNUSED qint64 atime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_atime) * 1000; }
+Q_DECL_UNUSED qint64 birthtime(const QT_STATBUF &, ulong) { return Q_INT64_C(0); }
+Q_DECL_UNUSED qint64 ctime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_ctime) * 1000; }
+Q_DECL_UNUSED qint64 mtime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_mtime) * 1000; }
+
+// Xtim, POSIX.1-2008
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_atim, true), qint64>::type
+atime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_atim); }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_birthtim, true), qint64>::type
+birthtime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_birthtim); }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_ctim, true), qint64>::type
+ctime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_ctim); }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_mtim, true), qint64>::type
+mtime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_mtim); }
+
+#ifndef st_mtimespec
+// Xtimespec
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_atimespec, true), qint64>::type
+atime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_atimespec); }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_birthtimespec, true), qint64>::type
+birthtime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_birthtimespec); }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_ctimespec, true), qint64>::type
+ctime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_ctimespec); }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_mtimespec, true), qint64>::type
+mtime(const T &statBuffer, int)
+{ return timespecToMSecs(statBuffer.st_mtimespec); }
+#endif
+
+// Xtimensec
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_atimensec, true), qint64>::type
+atime(const T &statBuffer, int)
+{ return statBuffer.st_atime * Q_INT64_C(1000) + statBuffer.st_atimensec / 1000000; }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_birthtimensec, true), qint64>::type
+birthtime(const T &statBuffer, int)
+{ return statBuffer.st_birthtime * Q_INT64_C(1000) + statBuffer.st_birthtimensec / 1000000; }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_ctimensec, true), qint64>::type
+ctime(const T &statBuffer, int)
+{ return statBuffer.st_ctime * Q_INT64_C(1000) + statBuffer.st_ctimensec / 1000000; }
+
+template <typename T>
+Q_DECL_UNUSED static typename std::enable_if<(&T::st_mtimensec, true), qint64>::type
+mtime(const T &statBuffer, int)
+{ return statBuffer.st_mtime * Q_INT64_C(1000) + statBuffer.st_mtimensec / 1000000; }
+}
+}
+
+#ifdef STATX_BASIC_STATS
+static int qt_real_statx(int fd, const char *pathname, int flags, struct statx *statxBuffer)
+{
+#ifdef Q_ATOMIC_INT8_IS_SUPPORTED
+ static QBasicAtomicInteger<qint8> statxTested = Q_BASIC_ATOMIC_INITIALIZER(0);
+#else
+ static QBasicAtomicInt statxTested = Q_BASIC_ATOMIC_INITIALIZER(0);
+#endif
+
+ if (statxTested.load() == -1)
+ return -ENOSYS;
+
+ unsigned mask = STATX_BASIC_STATS | STATX_BTIME;
+ int ret = statx(fd, pathname, flags, mask, statxBuffer);
+ if (ret == -1 && errno == ENOSYS) {
+ statxTested.store(-1);
+ return -ENOSYS;
+ }
+ statxTested.store(1);
+ return ret == -1 ? -errno : 0;
+}
+
+static int qt_statx(const char *pathname, struct statx *statxBuffer)
+{
+ return qt_real_statx(AT_FDCWD, pathname, 0, statxBuffer);
+}
+
+static int qt_lstatx(const char *pathname, struct statx *statxBuffer)
+{
+ return qt_real_statx(AT_FDCWD, pathname, AT_SYMLINK_NOFOLLOW, statxBuffer);
+}
+
+static int qt_fstatx(int fd, struct statx *statxBuffer)
+{
+ return qt_real_statx(fd, "", AT_EMPTY_PATH, statxBuffer);
+}
+
+inline void QFileSystemMetaData::fillFromStatxBuf(const struct statx &statxBuffer)
+{
+ // Permissions
+ if (statxBuffer.stx_mode & S_IRUSR)
+ entryFlags |= QFileSystemMetaData::OwnerReadPermission;
+ if (statxBuffer.stx_mode & S_IWUSR)
+ entryFlags |= QFileSystemMetaData::OwnerWritePermission;
+ if (statxBuffer.stx_mode & S_IXUSR)
+ entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
+
+ if (statxBuffer.stx_mode & S_IRGRP)
+ entryFlags |= QFileSystemMetaData::GroupReadPermission;
+ if (statxBuffer.stx_mode & S_IWGRP)
+ entryFlags |= QFileSystemMetaData::GroupWritePermission;
+ if (statxBuffer.stx_mode & S_IXGRP)
+ entryFlags |= QFileSystemMetaData::GroupExecutePermission;
+
+ if (statxBuffer.stx_mode & S_IROTH)
+ entryFlags |= QFileSystemMetaData::OtherReadPermission;
+ if (statxBuffer.stx_mode & S_IWOTH)
+ entryFlags |= QFileSystemMetaData::OtherWritePermission;
+ if (statxBuffer.stx_mode & S_IXOTH)
+ entryFlags |= QFileSystemMetaData::OtherExecutePermission;
+
+ // Type
+ if (S_ISLNK(statxBuffer.stx_mode))
+ entryFlags |= QFileSystemMetaData::LinkType;
+ if ((statxBuffer.stx_mode & S_IFMT) == S_IFREG)
+ entryFlags |= QFileSystemMetaData::FileType;
+ else if ((statxBuffer.stx_mode & S_IFMT) == S_IFDIR)
+ entryFlags |= QFileSystemMetaData::DirectoryType;
+ else if ((statxBuffer.stx_mode & S_IFMT) != S_IFBLK)
+ entryFlags |= QFileSystemMetaData::SequentialType;
+
+ // Attributes
+ entryFlags |= QFileSystemMetaData::ExistsAttribute; // inode exists
+ if (statxBuffer.stx_nlink == 0)
+ entryFlags |= QFileSystemMetaData::WasDeletedAttribute;
+ size_ = qint64(statxBuffer.stx_size);
+
+ // Times
+ auto toMSecs = [](struct statx_timestamp ts)
+ {
+ return qint64(ts.tv_sec) * 1000 + (ts.tv_nsec / 1000000);
+ };
+ accessTime_ = toMSecs(statxBuffer.stx_atime);
+ metadataChangeTime_ = toMSecs(statxBuffer.stx_ctime);
+ modificationTime_ = toMSecs(statxBuffer.stx_mtime);
+ if (statxBuffer.stx_mask & STATX_BTIME)
+ birthTime_ = toMSecs(statxBuffer.stx_btime);
+ else
+ birthTime_ = 0;
+
+ userId_ = statxBuffer.stx_uid;
+ groupId_ = statxBuffer.stx_gid;
+}
+#else
+struct statx { mode_t stx_mode; };
+static int qt_statx(const char *, struct statx *)
+{ return -ENOSYS; }
+
+static int qt_lstatx(const char *, struct statx *)
+{ return -ENOSYS; }
+
+static int qt_fstatx(int, struct statx *)
+{ return -ENOSYS; }
+
+inline void QFileSystemMetaData::fillFromStatxBuf(const struct statx &)
+{ }
+#endif
+
//static
-QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
+bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
{
-#if defined(__GLIBC__) && !defined(PATH_MAX)
-#define PATH_CHUNK_SIZE 256
- char *s = 0;
- int len = -1;
- int size = PATH_CHUNK_SIZE;
-
- while (1) {
- s = (char *) ::realloc(s, size);
- Q_CHECK_PTR(s);
- len = ::readlink(link.nativeFilePath().constData(), s, size);
- if (len < 0) {
- ::free(s);
- break;
- }
- if (len < size) {
- break;
+ data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
+ data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags;
+
+ union {
+ struct statx statxBuffer;
+ QT_STATBUF statBuffer;
+ };
+
+ int ret = qt_fstatx(fd, &statxBuffer);
+ if (ret != -ENOSYS) {
+ data.fillFromStatxBuf(statxBuffer);
+ return ret == 0;
+ }
+
+ if (QT_FSTAT(fd, &statBuffer) == 0) {
+ data.fillFromStatBuf(statBuffer);
+ return true;
+ }
+
+ return false;
+}
+
+#if defined(_DEXTRA_FIRST)
+static void fillStat64fromStat32(struct stat64 *statBuf64, const struct stat &statBuf32)
+{
+ statBuf64->st_mode = statBuf32.st_mode;
+ statBuf64->st_size = statBuf32.st_size;
+#if _POSIX_VERSION >= 200809L
+ statBuf64->st_ctim = statBuf32.st_ctim;
+ statBuf64->st_mtim = statBuf32.st_mtim;
+ statBuf64->st_atim = statBuf32.st_atim;
+#else
+ statBuf64->st_ctime = statBuf32.st_ctime;
+ statBuf64->st_mtime = statBuf32.st_mtime;
+ statBuf64->st_atime = statBuf32.st_atime;
+#endif
+ statBuf64->st_uid = statBuf32.st_uid;
+ statBuf64->st_gid = statBuf32.st_gid;
+}
+#endif
+
+void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
+{
+ // Permissions
+ if (statBuffer.st_mode & S_IRUSR)
+ entryFlags |= QFileSystemMetaData::OwnerReadPermission;
+ if (statBuffer.st_mode & S_IWUSR)
+ entryFlags |= QFileSystemMetaData::OwnerWritePermission;
+ if (statBuffer.st_mode & S_IXUSR)
+ entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
+
+ if (statBuffer.st_mode & S_IRGRP)
+ entryFlags |= QFileSystemMetaData::GroupReadPermission;
+ if (statBuffer.st_mode & S_IWGRP)
+ entryFlags |= QFileSystemMetaData::GroupWritePermission;
+ if (statBuffer.st_mode & S_IXGRP)
+ entryFlags |= QFileSystemMetaData::GroupExecutePermission;
+
+ if (statBuffer.st_mode & S_IROTH)
+ entryFlags |= QFileSystemMetaData::OtherReadPermission;
+ if (statBuffer.st_mode & S_IWOTH)
+ entryFlags |= QFileSystemMetaData::OtherWritePermission;
+ if (statBuffer.st_mode & S_IXOTH)
+ entryFlags |= QFileSystemMetaData::OtherExecutePermission;
+
+ // Type
+ if ((statBuffer.st_mode & S_IFMT) == S_IFREG)
+ entryFlags |= QFileSystemMetaData::FileType;
+ else if ((statBuffer.st_mode & S_IFMT) == S_IFDIR)
+ entryFlags |= QFileSystemMetaData::DirectoryType;
+ else if ((statBuffer.st_mode & S_IFMT) != S_IFBLK)
+ entryFlags |= QFileSystemMetaData::SequentialType;
+
+ // Attributes
+ entryFlags |= QFileSystemMetaData::ExistsAttribute; // inode exists
+ if (statBuffer.st_nlink == 0)
+ entryFlags |= QFileSystemMetaData::WasDeletedAttribute;
+ size_ = statBuffer.st_size;
+#ifdef UF_HIDDEN
+ if (statBuffer.st_flags & UF_HIDDEN) {
+ entryFlags |= QFileSystemMetaData::HiddenAttribute;
+ knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
+ }
+#endif
+
+ // Times
+ accessTime_ = GetFileTimes::atime(statBuffer, 0);
+ birthTime_ = GetFileTimes::birthtime(statBuffer, 0);
+ metadataChangeTime_ = GetFileTimes::ctime(statBuffer, 0);
+ modificationTime_ = GetFileTimes::mtime(statBuffer, 0);
+
+ userId_ = statBuffer.st_uid;
+ groupId_ = statBuffer.st_gid;
+}
+
+void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
+{
+#if defined(_DEXTRA_FIRST)
+ knownFlagsMask = 0;
+ entryFlags = 0;
+ for (dirent_extra *extra = _DEXTRA_FIRST(&entry); _DEXTRA_VALID(extra, &entry);
+ extra = _DEXTRA_NEXT(extra)) {
+ if (extra->d_type == _DTYPE_STAT || extra->d_type == _DTYPE_LSTAT) {
+
+ const struct dirent_extra_stat * const extra_stat =
+ reinterpret_cast<struct dirent_extra_stat *>(extra);
+
+ // Remember whether this was a link or not, this saves an lstat() call later.
+ if (extra->d_type == _DTYPE_LSTAT) {
+ knownFlagsMask |= QFileSystemMetaData::LinkType;
+ if (S_ISLNK(extra_stat->d_stat.st_mode))
+ entryFlags |= QFileSystemMetaData::LinkType;
+ }
+
+ // For symlinks, the extra type _DTYPE_LSTAT doesn't work for filling out the meta data,
+ // as we need the stat() information there, not the lstat() information.
+ // In this case, don't use the extra information.
+ // Unfortunately, readdir() never seems to return extra info of type _DTYPE_STAT, so for
+ // symlinks, we always incur the cost of an extra stat() call later.
+ if (S_ISLNK(extra_stat->d_stat.st_mode) && extra->d_type == _DTYPE_LSTAT)
+ continue;
+
+#if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT)
+ // Even with large file support, d_stat is always of type struct stat, not struct stat64,
+ // so it needs to be converted
+ struct stat64 statBuf;
+ fillStat64fromStat32(&statBuf, extra_stat->d_stat);
+ fillFromStatBuf(statBuf);
+#else
+ fillFromStatBuf(extra_stat->d_stat);
+#endif
+ knownFlagsMask |= QFileSystemMetaData::PosixStatFlags;
+ if (!S_ISLNK(extra_stat->d_stat.st_mode)) {
+ knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
+ entryFlags |= QFileSystemMetaData::ExistsAttribute;
+ }
}
- size *= 2;
+ }
+#elif defined(_DIRENT_HAVE_D_TYPE) || defined(Q_OS_BSD4)
+ // BSD4 includes OS X and iOS
+
+ // ### This will clear all entry flags and knownFlagsMask
+ switch (entry.d_type)
+ {
+ case DT_DIR:
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_BLK:
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::BundleType
+ | QFileSystemMetaData::AliasType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_CHR:
+ case DT_FIFO:
+ case DT_SOCK:
+ // ### System attribute
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::BundleType
+ | QFileSystemMetaData::AliasType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_LNK:
+ knownFlagsMask = QFileSystemMetaData::LinkType;
+ entryFlags = QFileSystemMetaData::LinkType;
+ break;
+
+ case DT_REG:
+ knownFlagsMask = QFileSystemMetaData::LinkType
+ | QFileSystemMetaData::FileType
+ | QFileSystemMetaData::DirectoryType
+ | QFileSystemMetaData::BundleType
+ | QFileSystemMetaData::SequentialType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ entryFlags = QFileSystemMetaData::FileType
+ | QFileSystemMetaData::ExistsAttribute;
+
+ break;
+
+ case DT_UNKNOWN:
+ default:
+ clear();
}
#else
- char s[PATH_MAX+1];
- int len = readlink(link.nativeFilePath().constData(), s, PATH_MAX);
+ Q_UNUSED(entry)
#endif
- if (len > 0) {
+}
+
+//static
+QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
+{
+ if (Q_UNLIKELY(link.isEmpty()))
+ return emptyFileEntryWarning(), link;
+
+ QByteArray s = qt_readlink(link.nativeFilePath().constData());
+ if (s.length() > 0) {
QString ret;
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
fillMetaData(link, data, QFileSystemMetaData::DirectoryType);
@@ -180,11 +632,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
ret += QLatin1Char('/');
}
- s[len] = '\0';
- ret += QFile::decodeName(QByteArray(s));
-#if defined(__GLIBC__) && !defined(PATH_MAX)
- ::free(s);
-#endif
+ ret += QFile::decodeName(s);
if (!ret.startsWith(QLatin1Char('/'))) {
const QString linkPath = link.path();
@@ -234,7 +682,9 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
//static
QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
{
- if (entry.isEmpty() || entry.isRoot())
+ if (Q_UNLIKELY(entry.isEmpty()))
+ return emptyFileEntryWarning(), entry;
+ if (entry.isRoot())
return entry;
#if !defined(Q_OS_MAC) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && _POSIX_VERSION < 200809L
@@ -301,6 +751,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
//static
QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
{
+ if (Q_UNLIKELY(entry.isEmpty()))
+ return emptyFileEntryWarning(), entry;
if (entry.isAbsolute() && entry.isClean())
return entry;
@@ -334,6 +786,9 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
//static
QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
{
+ if (Q_UNLIKELY(entry.isEmpty()))
+ return emptyFileEntryWarning(), QByteArray();
+
QT_STATBUF statResult;
if (QT_STAT(entry.nativeFilePath().constData(), &statResult)) {
if (errno != ENOENT)
@@ -441,56 +896,105 @@ 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;
+
#if defined(Q_OS_DARWIN)
if (what & QFileSystemMetaData::BundleType) {
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
what |= QFileSystemMetaData::DirectoryType;
}
+#endif
+#ifdef UF_HIDDEN
if (what & QFileSystemMetaData::HiddenAttribute) {
// OS X >= 10.5: st_flags & UF_HIDDEN
what |= QFileSystemMetaData::PosixStatFlags;
}
#endif // defined(Q_OS_DARWIN)
+ // if we're asking for any of the stat(2) flags, then we're getting them all
if (what & QFileSystemMetaData::PosixStatFlags)
what |= QFileSystemMetaData::PosixStatFlags;
- if (what & QFileSystemMetaData::ExistsAttribute) {
- // FIXME: Would other queries being performed provide this bit?
- what |= QFileSystemMetaData::PosixStatFlags;
- }
-
data.entryFlags &= ~what;
const QByteArray nativeFilePath = entry.nativeFilePath();
bool entryExists = true; // innocent until proven otherwise
- QT_STATBUF statBuffer;
- bool statBufferValid = false;
+ // first, we may try lstat(2). Possible outcomes:
+ // - success and is a symlink: filesystem entry exists, but we need stat(2)
+ // -> statResult = -1;
+ // - success and is not a symlink: filesystem entry exists and we're done
+ // -> statResult = 0
+ // - failure: really non-existent filesystem entry
+ // -> entryExists = false; statResult = 0;
+ // both stat(2) and lstat(2) may generate a number of different errno
+ // conditions, but of those, the only ones that could happen and the
+ // entry still exist are EACCES, EFAULT, ENOMEM and EOVERFLOW. If we get
+ // EACCES or ENOMEM, then we have no choice on how to proceed, so we may
+ // as well conclude it doesn't exist; EFAULT can't happen and EOVERFLOW
+ // shouldn't happen because we build in _LARGEFIE64.
+ union {
+ QT_STATBUF statBuffer;
+ struct statx statxBuffer;
+ };
+ int statResult = -1;
if (what & QFileSystemMetaData::LinkType) {
- if (QT_LSTAT(nativeFilePath, &statBuffer) == 0) {
- if (S_ISLNK(statBuffer.st_mode)) {
+ mode_t mode = 0;
+ statResult = qt_lstatx(nativeFilePath, &statxBuffer);
+ if (statResult == -ENOSYS) {
+ // use lstst(2)
+ statResult = QT_LSTAT(nativeFilePath, &statBuffer);
+ if (statResult == 0)
+ mode = statBuffer.st_mode;
+ } else if (statResult == 0) {
+ statResult = 1; // record it was statx(2) that succeeded
+ mode = statxBuffer.stx_mode;
+ }
+
+ if (statResult >= 0) {
+ if (S_ISLNK(mode)) {
+ // it's a symlink, we don't know if the file "exists"
data.entryFlags |= QFileSystemMetaData::LinkType;
+ statResult = -1; // force stat(2) below
} else {
- statBufferValid = true;
- data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
+ // it's a reagular file and it exists
+ if (statResult)
+ data.fillFromStatxBuf(statxBuffer);
+ else
+ data.fillFromStatBuf(statBuffer);
+ data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags
+ | QFileSystemMetaData::ExistsAttribute;
+ data.entryFlags |= QFileSystemMetaData::ExistsAttribute;
}
} else {
+ // it doesn't exist
entryExists = false;
+ data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
}
data.knownFlagsMask |= QFileSystemMetaData::LinkType;
}
- if (statBufferValid || (what & QFileSystemMetaData::PosixStatFlags)) {
- if (entryExists && !statBufferValid)
- statBufferValid = (QT_STAT(nativeFilePath, &statBuffer) == 0);
+ // second, we try a regular stat(2)
+ if (statResult != 0 && (what & QFileSystemMetaData::PosixStatFlags)) {
+ if (entryExists && statResult == -1) {
+ data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
+ statResult = qt_statx(nativeFilePath, &statxBuffer);
+ if (statResult == -ENOSYS) {
+ // use stat(2)
+ statResult = QT_STAT(nativeFilePath, &statBuffer);
+ if (statResult == 0)
+ data.fillFromStatBuf(statBuffer);
+ } else if (statResult == 0) {
+ data.fillFromStatxBuf(statxBuffer);
+ }
+ }
- if (statBufferValid)
- data.fillFromStatBuf(statBuffer);
- else {
+ if (statResult != 0) {
entryExists = false;
- data.creationTime_ = 0;
+ data.birthTime_ = 0;
+ data.metadataChangeTime_ = 0;
data.modificationTime_ = 0;
data.accessTime_ = 0;
data.size_ = 0;
@@ -503,34 +1007,49 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
| QFileSystemMetaData::ExistsAttribute;
}
+ // third, we try access(2)
+ if (what & (QFileSystemMetaData::UserPermissions | QFileSystemMetaData::ExistsAttribute)) {
+ // calculate user permissions
+ auto checkAccess = [&](QFileSystemMetaData::MetaDataFlag flag, int mode) {
+ if (!entryExists || (what & flag) == 0)
+ return;
+ if (QT_ACCESS(nativeFilePath, mode) == 0) {
+ // access ok (and file exists)
+ data.entryFlags |= flag | QFileSystemMetaData::ExistsAttribute;
+ } else if (errno != EACCES && errno != EROFS) {
+ entryExists = false;
+ }
+ };
+
+ checkAccess(QFileSystemMetaData::UserReadPermission, R_OK);
+ checkAccess(QFileSystemMetaData::UserWritePermission, W_OK);
+ checkAccess(QFileSystemMetaData::UserExecutePermission, X_OK);
+
+ // if we still haven't found out if the file exists, try F_OK
+ if (entryExists && (data.entryFlags & QFileSystemMetaData::ExistsAttribute) == 0) {
+ entryExists = QT_ACCESS(nativeFilePath, F_OK) == 0;
+ if (entryExists)
+ data.entryFlags |= QFileSystemMetaData::ExistsAttribute;
+ }
+
+ data.knownFlagsMask |= (what & QFileSystemMetaData::UserPermissions) |
+ QFileSystemMetaData::ExistsAttribute;
+ }
+
#if defined(Q_OS_DARWIN)
- if (what & QFileSystemMetaData::AliasType)
- {
+ if (what & QFileSystemMetaData::AliasType) {
if (entryExists && hasResourcePropertyFlag(data, entry, kCFURLIsAliasFileKey))
data.entryFlags |= QFileSystemMetaData::AliasType;
data.knownFlagsMask |= QFileSystemMetaData::AliasType;
}
-#endif
- if (what & QFileSystemMetaData::UserPermissions) {
- // calculate user permissions
+ if (what & QFileSystemMetaData::BundleType) {
+ if (entryExists && isPackage(data, entry))
+ data.entryFlags |= QFileSystemMetaData::BundleType;
- if (entryExists) {
- if (what & QFileSystemMetaData::UserReadPermission) {
- if (QT_ACCESS(nativeFilePath, R_OK) == 0)
- data.entryFlags |= QFileSystemMetaData::UserReadPermission;
- }
- if (what & QFileSystemMetaData::UserWritePermission) {
- if (QT_ACCESS(nativeFilePath, W_OK) == 0)
- data.entryFlags |= QFileSystemMetaData::UserWritePermission;
- }
- if (what & QFileSystemMetaData::UserExecutePermission) {
- if (QT_ACCESS(nativeFilePath, X_OK) == 0)
- data.entryFlags |= QFileSystemMetaData::UserExecutePermission;
- }
- }
- data.knownFlagsMask |= (what & QFileSystemMetaData::UserPermissions);
+ data.knownFlagsMask |= QFileSystemMetaData::BundleType;
}
+#endif
if (what & QFileSystemMetaData::HiddenAttribute
&& !data.isHidden()) {
@@ -544,21 +1063,80 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
}
-#if defined(Q_OS_DARWIN)
- if (what & QFileSystemMetaData::BundleType) {
- if (entryExists && isPackage(data, entry))
- data.entryFlags |= QFileSystemMetaData::BundleType;
-
- data.knownFlagsMask |= QFileSystemMetaData::BundleType;
- }
-#endif
if (!entryExists) {
+ what &= ~QFileSystemMetaData::LinkType; // don't clear link: could be broken symlink
data.clearFlags(what);
return false;
}
return data.hasFlags(what);
}
+// static
+bool QFileSystemEngine::cloneFile(int srcfd, int dstfd, const QFileSystemMetaData &knownData)
+{
+ QT_STATBUF statBuffer;
+ if (knownData.hasFlags(QFileSystemMetaData::PosixStatFlags) &&
+ knownData.isFile()) {
+ statBuffer.st_size = knownData.size();
+ statBuffer.st_mode = S_IFREG;
+ } else if (knownData.hasFlags(QFileSystemMetaData::PosixStatFlags) &&
+ knownData.isDirectory()) {
+ return false; // fcopyfile(3) returns success on directories
+ } else if (QT_FSTAT(srcfd, &statBuffer) == -1) {
+ return false;
+ } else if (!S_ISREG((statBuffer.st_mode))) {
+ // not a regular file, let QFile do the copy
+ return false;
+ }
+
+#if defined(Q_OS_LINUX)
+ if (statBuffer.st_size == 0) {
+ // empty file? we're done.
+ return true;
+ }
+
+ // first, try FICLONE (only works on regular files and only on certain fs)
+ if (::ioctl(dstfd, FICLONE, srcfd) == 0)
+ return true;
+
+ // Second, try sendfile (it can send to some special types too).
+ // sendfile(2) is limited in the kernel to 2G - 4k
+ auto sendfileSize = [](QT_OFF_T size) { return size_t(qMin<qint64>(0x7ffff000, size)); };
+
+ ssize_t n = ::sendfile(dstfd, srcfd, NULL, sendfileSize(statBuffer.st_size));
+ if (n == -1) {
+ // if we got an error here, give up and try at an upper layer
+ return false;
+ }
+
+ statBuffer.st_size -= n;
+ while (statBuffer.st_size) {
+ n = ::sendfile(dstfd, srcfd, NULL, sendfileSize(statBuffer.st_size));
+ if (n == 0) {
+ // uh oh, this is probably a real error (like ENOSPC), but we have
+ // no way to notify QFile of partial success, so just erase any work
+ // done (hopefully we won't get any errors, because there's nothing
+ // we can do about them)
+ n = ftruncate(dstfd, 0);
+ n = lseek(srcfd, 0, SEEK_SET);
+ n = lseek(dstfd, 0, SEEK_SET);
+ return false;
+ }
+ if (n == 0)
+ return true;
+ statBuffer.st_size -= n;
+ }
+
+ return true;
+#elif defined(Q_OS_DARWIN)
+ // try fcopyfile
+ return fcopyfile(srcfd, dstfd, nullptr, COPYFILE_DATA | COPYFILE_STAT) == 0;
+#else
+ Q_UNUSED(dstfd);
+ return false;
+#endif
+}
+
// Note: if \a shouldMkdirFirst is false, we assume the caller did try to mkdir
// before calling this function.
static bool createDirectoryWithParents(const QByteArray &nativeName, bool shouldMkdirFirst = true)
@@ -597,6 +1175,8 @@ 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;
// Darwin doesn't support trailing /'s, so remove for everyone
while (dirName.size() > 1 && dirName.endsWith(QLatin1Char('/')))
@@ -615,6 +1195,9 @@ 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;
+
if (removeEmptyParents) {
QString dirName = QDir::cleanPath(entry.filePath());
for (int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
@@ -638,6 +1221,8 @@ 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;
if (::symlink(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)
return true;
error = QSystemError(errno, QSystemError::StandardLibraryError);
@@ -647,8 +1232,22 @@ bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSy
//static
bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
+#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(101200, 100000, 100000, 30000)
+ const auto current = QOperatingSystemVersion::current();
+ if (current >= QOperatingSystemVersion::MacOSSierra ||
+ current >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 10) ||
+ current >= QOperatingSystemVersion(QOperatingSystemVersion::TvOS, 10) ||
+ current >= QOperatingSystemVersion(QOperatingSystemVersion::WatchOS, 3)) {
+ if (::clonefile(source.nativeFilePath().constData(),
+ target.nativeFilePath().constData(), 0) == 0)
+ return true;
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+ }
+#else
Q_UNUSED(source);
Q_UNUSED(target);
+#endif
error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); //Function not implemented
return false;
}
@@ -656,6 +1255,81 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
//static
bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
+ QFileSystemEntry::NativePath srcPath = source.nativeFilePath();
+ QFileSystemEntry::NativePath tgtPath = target.nativeFilePath();
+ if (Q_UNLIKELY(srcPath.isEmpty() || tgtPath.isEmpty()))
+ return emptyFileEntryWarning(), false;
+
+#if defined(RENAME_NOREPLACE) && (QT_CONFIG(renameat2) || defined(SYS_renameat2))
+ if (renameat2(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_NOREPLACE) == 0)
+ return true;
+
+ // If we're using syscall(), check for ENOSYS;
+ // if renameat2 came from libc, we don't accept ENOSYS.
+ if (QT_CONFIG(renameat2) || errno != ENOSYS) {
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+ }
+#endif
+#if defined(Q_OS_DARWIN) && defined(RENAME_EXCL)
+ const auto current = QOperatingSystemVersion::current();
+ if (current >= QOperatingSystemVersion::MacOSSierra ||
+ current >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 10) ||
+ current >= QOperatingSystemVersion(QOperatingSystemVersion::TvOS, 10) ||
+ current >= QOperatingSystemVersion(QOperatingSystemVersion::WatchOS, 3)) {
+ if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0)
+ return true;
+ if (errno != ENOTSUP) {
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+ }
+ }
+#endif
+
+ if (::link(srcPath, tgtPath) == 0) {
+ if (::unlink(srcPath) == 0)
+ return true;
+
+ // if we managed to link but can't unlink the source, it's likely
+ // it's in a directory we don't have write access to; fail the
+ // renaming instead
+ int savedErrno = errno;
+
+ // this could fail too, but there's nothing we can do about it now
+ ::unlink(tgtPath);
+
+ error = QSystemError(savedErrno, QSystemError::StandardLibraryError);
+ return false;
+ }
+
+ switch (errno) {
+ case EACCES:
+ case EEXIST:
+ case ENAMETOOLONG:
+ case ENOENT:
+ case ENOTDIR:
+ case EROFS:
+ case EXDEV:
+ // accept the error from link(2) (especially EEXIST) and don't retry
+ break;
+
+ default:
+ // fall back to rename()
+ // ### Race condition. If a file is moved in after this, it /will/ be
+ // overwritten.
+ if (::rename(srcPath, tgtPath) == 0)
+ return true;
+ }
+
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+}
+
+//static
+bool QFileSystemEngine::renameOverwriteFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
+{
+ if (Q_UNLIKELY(source.isEmpty() || target.isEmpty()))
+ return emptyFileEntryWarning(), false;
if (::rename(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)
return true;
error = QSystemError(errno, QSystemError::StandardLibraryError);
@@ -665,6 +1339,8 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
//static
bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &error)
{
+ if (Q_UNLIKELY(entry.isEmpty()))
+ return emptyFileEntryWarning(), false;
if (unlink(entry.nativeFilePath().constData()) == 0)
return true;
error = QSystemError(errno, QSystemError::StandardLibraryError);
@@ -699,8 +1375,10 @@ static mode_t toMode_t(QFile::Permissions permissions)
//static
bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data)
{
- mode_t mode = toMode_t(permissions);
+ if (Q_UNLIKELY(entry.isEmpty()))
+ return emptyFileEntryWarning(), false;
+ mode_t mode = toMode_t(permissions);
bool success = ::chmod(entry.nativeFilePath().constData(), mode) == 0;
if (success && data) {
data->entryFlags &= ~QFileSystemMetaData::Permissions;
@@ -728,6 +1406,71 @@ bool QFileSystemEngine::setPermissions(int fd, QFile::Permissions permissions, Q
return success;
}
+//static
+bool QFileSystemEngine::setFileTime(int fd, const QDateTime &newDate, QAbstractFileEngine::FileTime time, QSystemError &error)
+{
+ if (!newDate.isValid() || time == QAbstractFileEngine::BirthTime ||
+ time == QAbstractFileEngine::MetadataChangeTime) {
+ error = QSystemError(EINVAL, QSystemError::StandardLibraryError);
+ return false;
+ }
+
+#if QT_CONFIG(futimens)
+ struct timespec ts[2];
+
+ ts[0].tv_sec = ts[1].tv_sec = 0;
+ ts[0].tv_nsec = ts[1].tv_nsec = UTIME_OMIT;
+
+ const qint64 msecs = newDate.toMSecsSinceEpoch();
+
+ if (time == QAbstractFileEngine::AccessTime) {
+ ts[0].tv_sec = msecs / 1000;
+ ts[0].tv_nsec = (msecs % 1000) * 1000000;
+ } else if (time == QAbstractFileEngine::ModificationTime) {
+ ts[1].tv_sec = msecs / 1000;
+ ts[1].tv_nsec = (msecs % 1000) * 1000000;
+ }
+
+ if (futimens(fd, ts) == -1) {
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+ }
+
+ return true;
+#elif QT_CONFIG(futimes)
+ struct timeval tv[2];
+ QT_STATBUF st;
+
+ if (QT_FSTAT(fd, &st) == -1) {
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+ }
+
+ GetFileTimes::get(&st, &tv[0], &tv[1]);
+
+ const qint64 msecs = newDate.toMSecsSinceEpoch();
+
+ if (time == QAbstractFileEngine::AccessTime) {
+ tv[0].tv_sec = msecs / 1000;
+ tv[0].tv_usec = (msecs % 1000) * 1000;
+ } else if (time == QAbstractFileEngine::ModificationTime) {
+ tv[1].tv_sec = msecs / 1000;
+ tv[1].tv_usec = (msecs % 1000) * 1000;
+ }
+
+ if (futimes(fd, tv) == -1) {
+ error = QSystemError(errno, QSystemError::StandardLibraryError);
+ return false;
+ }
+
+ return true;
+#else
+ Q_UNUSED(fd);
+ error = QSystemError(ENOSYS, QSystemError::StandardLibraryError);
+ return false;
+#endif
+}
+
QString QFileSystemEngine::homePath()
{
QString home = QFile::decodeName(qgetenv("HOME"));
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 79407afefc..35ddb41215 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -48,7 +48,6 @@
#include "qfile.h"
#include "qdir.h"
-#include "private/qmutexpool_p.h"
#include "qvarlengtharray.h"
#include "qdatetime.h"
#include "qt_windows.h"
@@ -60,6 +59,7 @@
#include <objbase.h>
#ifndef Q_OS_WINRT
# include <shlobj.h>
+# include <lm.h>
# include <accctrl.h>
#endif
#include <initguid.h>
@@ -147,48 +147,30 @@ typedef struct _REPARSE_DATA_BUFFER {
# define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
-QT_BEGIN_NAMESPACE
-
-Q_CORE_EXPORT int qt_ntfs_permission_lookup = 0;
-
-#if defined(Q_OS_WINRT)
-// As none of the functions we try to resolve do exist on WinRT we
-// avoid library loading on WinRT in general to shorten everything
-// up a little bit.
+#if defined(Q_OS_WINRT) || defined(QT_BOOTSTRAPPED)
# define QT_FEATURE_fslibs -1
#else
-# define QT_FEATURE_fslibs QT_FEATURE_library
+# define QT_FEATURE_fslibs 1
#endif // Q_OS_WINRT
#if QT_CONFIG(fslibs)
-QT_BEGIN_INCLUDE_NAMESPACE
-typedef DWORD (WINAPI *PtrGetNamedSecurityInfoW)(LPWSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID*, PSID*, PACL*, PACL*, PSECURITY_DESCRIPTOR*);
-static PtrGetNamedSecurityInfoW ptrGetNamedSecurityInfoW = 0;
-typedef BOOL (WINAPI *PtrLookupAccountSidW)(LPCWSTR, PSID, LPWSTR, LPDWORD, LPWSTR, LPDWORD, PSID_NAME_USE);
-static PtrLookupAccountSidW ptrLookupAccountSidW = 0;
-typedef VOID (WINAPI *PtrBuildTrusteeWithSidW)(PTRUSTEE_W, PSID);
-static PtrBuildTrusteeWithSidW ptrBuildTrusteeWithSidW = 0;
-typedef DWORD (WINAPI *PtrGetEffectiveRightsFromAclW)(PACL, PTRUSTEE_W, OUT PACCESS_MASK);
-static PtrGetEffectiveRightsFromAclW ptrGetEffectiveRightsFromAclW = 0;
-typedef BOOL (WINAPI *PtrGetUserProfileDirectoryW)(HANDLE, LPWSTR, LPDWORD);
-static PtrGetUserProfileDirectoryW ptrGetUserProfileDirectoryW = 0;
-QT_END_INCLUDE_NAMESPACE
-
+#include <aclapi.h>
+#include <userenv.h>
static TRUSTEE_W currentUserTrusteeW;
static TRUSTEE_W worldTrusteeW;
static PSID currentUserSID = 0;
static PSID worldSID = 0;
-/*
- Deletes the allocated SIDs during global static cleanup
-*/
-class SidCleanup
+QT_BEGIN_NAMESPACE
+
+namespace {
+struct GlobalSid
{
-public:
- ~SidCleanup();
+ GlobalSid();
+ ~GlobalSid();
};
-SidCleanup::~SidCleanup()
+GlobalSid::~GlobalSid()
{
free(currentUserSID);
currentUserSID = 0;
@@ -200,39 +182,13 @@ SidCleanup::~SidCleanup()
}
}
-Q_GLOBAL_STATIC(SidCleanup, initSidCleanup)
-
-static void resolveLibs()
+GlobalSid::GlobalSid()
{
- static bool triedResolve = false;
- if (!triedResolve) {
- // need to resolve the security info functions
-
- // protect initialization
-#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(&triedResolve));
- // check triedResolve again, since another thread may have already
- // done the initialization
- if (triedResolve) {
- // another thread did initialize the security function pointers,
- // so we shouldn't do it again.
- return;
- }
-#endif
-
- triedResolve = true;
- HINSTANCE advapiHnd = QSystemLibrary::load(L"advapi32");
- if (advapiHnd) {
- ptrGetNamedSecurityInfoW = (PtrGetNamedSecurityInfoW)GetProcAddress(advapiHnd, "GetNamedSecurityInfoW");
- ptrLookupAccountSidW = (PtrLookupAccountSidW)GetProcAddress(advapiHnd, "LookupAccountSidW");
- ptrBuildTrusteeWithSidW = (PtrBuildTrusteeWithSidW)GetProcAddress(advapiHnd, "BuildTrusteeWithSidW");
- ptrGetEffectiveRightsFromAclW = (PtrGetEffectiveRightsFromAclW)GetProcAddress(advapiHnd, "GetEffectiveRightsFromAclW");
- }
- if (ptrBuildTrusteeWithSidW) {
+ {
+ {
// Create TRUSTEE for current user
HANDLE hnd = ::GetCurrentProcess();
HANDLE token = 0;
- initSidCleanup();
if (::OpenProcessToken(hnd, TOKEN_QUERY, &token)) {
DWORD retsize = 0;
// GetTokenInformation requires a buffer big enough for the TOKEN_USER struct and
@@ -247,61 +203,69 @@ static void resolveLibs()
DWORD sidLen = ::GetLengthSid(tokenSid);
currentUserSID = reinterpret_cast<PSID>(malloc(sidLen));
if (::CopySid(sidLen, currentUserSID, tokenSid))
- ptrBuildTrusteeWithSidW(&currentUserTrusteeW, currentUserSID);
+ BuildTrusteeWithSid(&currentUserTrusteeW, currentUserSID);
}
free(tokenBuffer);
}
::CloseHandle(token);
}
- typedef BOOL (WINAPI *PtrAllocateAndInitializeSid)(PSID_IDENTIFIER_AUTHORITY, BYTE, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, PSID*);
- PtrAllocateAndInitializeSid ptrAllocateAndInitializeSid = (PtrAllocateAndInitializeSid)GetProcAddress(advapiHnd, "AllocateAndInitializeSid");
- if (ptrAllocateAndInitializeSid) {
+ {
// Create TRUSTEE for Everyone (World)
SID_IDENTIFIER_AUTHORITY worldAuth = { SECURITY_WORLD_SID_AUTHORITY };
- if (ptrAllocateAndInitializeSid(&worldAuth, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &worldSID))
- ptrBuildTrusteeWithSidW(&worldTrusteeW, worldSID);
+ if (AllocateAndInitializeSid(&worldAuth, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &worldSID))
+ BuildTrusteeWithSid(&worldTrusteeW, worldSID);
}
}
- HINSTANCE userenvHnd = QSystemLibrary::load(L"userenv");
- if (userenvHnd)
- ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW");
}
}
+
+Q_GLOBAL_STATIC(GlobalSid, initGlobalSid)
+
+QT_END_NAMESPACE
+
+} // anonymous namespace
#endif // QT_CONFIG(fslibs)
-typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD);
-static PtrNetShareEnum ptrNetShareEnum = 0;
-typedef DWORD (WINAPI *PtrNetApiBufferFree)(LPVOID);
-static PtrNetApiBufferFree ptrNetApiBufferFree = 0;
-typedef struct _SHARE_INFO_1 {
- LPWSTR shi1_netname;
- DWORD shi1_type;
- LPWSTR shi1_remark;
-} SHARE_INFO_1;
+QT_BEGIN_NAMESPACE
+Q_CORE_EXPORT int qt_ntfs_permission_lookup = 0;
-static bool resolveUNCLibs()
+static inline bool toFileTime(const QDateTime &date, FILETIME *fileTime)
{
- static bool triedResolve = false;
- if (!triedResolve) {
-#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(&triedResolve));
- if (triedResolve) {
- return ptrNetShareEnum && ptrNetApiBufferFree;
- }
-#endif
- triedResolve = true;
-#if !defined(Q_OS_WINRT)
- HINSTANCE hLib = QSystemLibrary::load(L"Netapi32");
- if (hLib) {
- ptrNetShareEnum = (PtrNetShareEnum)GetProcAddress(hLib, "NetShareEnum");
- if (ptrNetShareEnum)
- ptrNetApiBufferFree = (PtrNetApiBufferFree)GetProcAddress(hLib, "NetApiBufferFree");
- }
-#endif // !Q_OS_WINRT
+ SYSTEMTIME sTime;
+ if (date.timeSpec() == Qt::LocalTime) {
+ SYSTEMTIME lTime;
+ const QDate d = date.date();
+ const QTime t = date.time();
+
+ lTime.wYear = d.year();
+ lTime.wMonth = d.month();
+ lTime.wDay = d.day();
+ lTime.wHour = t.hour();
+ lTime.wMinute = t.minute();
+ lTime.wSecond = t.second();
+ lTime.wMilliseconds = t.msec();
+ lTime.wDayOfWeek = d.dayOfWeek() % 7;
+
+ if (!::TzSpecificLocalTimeToSystemTime(0, &lTime, &sTime))
+ return false;
+ } else {
+ QDateTime utcDate = date.toUTC();
+ const QDate d = utcDate.date();
+ const QTime t = utcDate.time();
+
+ sTime.wYear = d.year();
+ sTime.wMonth = d.month();
+ sTime.wDay = d.day();
+ sTime.wHour = t.hour();
+ sTime.wMinute = t.minute();
+ sTime.wSecond = t.second();
+ sTime.wMilliseconds = t.msec();
+ sTime.wDayOfWeek = d.dayOfWeek() % 7;
}
- return ptrNetShareEnum && ptrNetApiBufferFree;
+
+ return ::SystemTimeToFileTime(&sTime, fileTime);
}
static QString readSymLink(const QFileSystemEntry &link)
@@ -339,7 +303,7 @@ static QString readSymLink(const QFileSystemEntry &link)
CloseHandle(handle);
#if QT_CONFIG(fslibs)
- resolveLibs();
+ initGlobalSid();
QRegExp matchVolName(QLatin1String("^Volume\\{([a-z]|[0-9]|-)+\\}\\\\"), Qt::CaseInsensitive);
if (matchVolName.indexIn(result) == 0) {
DWORD len;
@@ -436,32 +400,35 @@ static inline bool getFindData(QString path, WIN32_FIND_DATA &findData)
bool QFileSystemEngine::uncListSharesOnServer(const QString &server, QStringList *list)
{
- if (resolveUNCLibs()) {
- SHARE_INFO_1 *BufPtr, *p;
- DWORD res;
- DWORD er = 0, tr = 0, resume = 0, i;
- do {
- res = ptrNetShareEnum((wchar_t*)server.utf16(), 1, (LPBYTE *)&BufPtr, DWORD(-1), &er, &tr, &resume);
- if (res == ERROR_SUCCESS || res == ERROR_MORE_DATA) {
- p = BufPtr;
- for (i = 1; i <= er; ++i) {
- if (list && p->shi1_type == 0)
- list->append(QString::fromWCharArray(p->shi1_netname));
- p++;
- }
+ DWORD res = ERROR_NOT_SUPPORTED;
+#ifndef Q_OS_WINRT
+ SHARE_INFO_1 *BufPtr, *p;
+ DWORD er = 0, tr = 0, resume = 0, i;
+ do {
+ res = NetShareEnum((wchar_t*)server.utf16(), 1, (LPBYTE *)&BufPtr, DWORD(-1), &er, &tr, &resume);
+ if (res == ERROR_SUCCESS || res == ERROR_MORE_DATA) {
+ p = BufPtr;
+ for (i = 1; i <= er; ++i) {
+ if (list && p->shi1_type == 0)
+ list->append(QString::fromWCharArray(p->shi1_netname));
+ p++;
}
- ptrNetApiBufferFree(BufPtr);
- } while (res == ERROR_MORE_DATA);
- return res == ERROR_SUCCESS;
- }
- return false;
+ }
+ NetApiBufferFree(BufPtr);
+ } while (res == ERROR_MORE_DATA);
+#else
+ Q_UNUSED(server);
+ Q_UNUSED(list);
+#endif
+ return res == ERROR_SUCCESS;
}
void QFileSystemEngine::clearWinStatData(QFileSystemMetaData &data)
{
data.size_ = 0;
data.fileAttribute_ = 0;
- data.creationTime_ = FILETIME();
+ data.birthTime_ = FILETIME();
+ data.changeTime_ = FILETIME();
data.lastAccessTime_ = FILETIME();
data.lastWriteTime_ = FILETIME();
}
@@ -647,36 +614,72 @@ QByteArray QFileSystemEngine::id(HANDLE fHandle)
}
//static
+bool QFileSystemEngine::setFileTime(HANDLE fHandle, const QDateTime &newDate,
+ QAbstractFileEngine::FileTime time, QSystemError &error)
+{
+ FILETIME fTime;
+ FILETIME *pLastWrite = NULL;
+ FILETIME *pLastAccess = NULL;
+ FILETIME *pCreationTime = NULL;
+
+ switch (time) {
+ case QAbstractFileEngine::ModificationTime:
+ pLastWrite = &fTime;
+ break;
+
+ case QAbstractFileEngine::AccessTime:
+ pLastAccess = &fTime;
+ break;
+
+ case QAbstractFileEngine::BirthTime:
+ pCreationTime = &fTime;
+ break;
+
+ default:
+ error = QSystemError(ERROR_INVALID_PARAMETER, QSystemError::NativeError);
+ return false;
+ }
+
+ if (!toFileTime(newDate, &fTime))
+ return false;
+
+ if (!::SetFileTime(fHandle, pCreationTime, pLastAccess, pLastWrite)) {
+ error = QSystemError(::GetLastError(), QSystemError::NativeError);
+ return false;
+ }
+ return true;
+}
+
QString QFileSystemEngine::owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own)
{
QString name;
#if QT_CONFIG(fslibs)
extern int qt_ntfs_permission_lookup;
- if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) {
- resolveLibs();
- if (ptrGetNamedSecurityInfoW && ptrLookupAccountSidW) {
+ if (qt_ntfs_permission_lookup > 0) {
+ initGlobalSid();
+ {
PSID pOwner = 0;
PSECURITY_DESCRIPTOR pSD;
- if (ptrGetNamedSecurityInfoW((wchar_t*)entry.nativeFilePath().utf16(), SE_FILE_OBJECT,
- own == QAbstractFileEngine::OwnerGroup ? GROUP_SECURITY_INFORMATION : OWNER_SECURITY_INFORMATION,
- own == QAbstractFileEngine::OwnerUser ? &pOwner : 0, own == QAbstractFileEngine::OwnerGroup ? &pOwner : 0,
- 0, 0, &pSD) == ERROR_SUCCESS) {
+ if (GetNamedSecurityInfo(reinterpret_cast<const wchar_t*>(entry.nativeFilePath().utf16()), SE_FILE_OBJECT,
+ own == QAbstractFileEngine::OwnerGroup ? GROUP_SECURITY_INFORMATION : OWNER_SECURITY_INFORMATION,
+ own == QAbstractFileEngine::OwnerUser ? &pOwner : 0, own == QAbstractFileEngine::OwnerGroup ? &pOwner : 0,
+ 0, 0, &pSD) == ERROR_SUCCESS) {
DWORD lowner = 64;
DWORD ldomain = 64;
QVarLengthArray<wchar_t, 64> owner(lowner);
QVarLengthArray<wchar_t, 64> domain(ldomain);
SID_NAME_USE use = SidTypeUnknown;
// First call, to determine size of the strings (with '\0').
- if (!ptrLookupAccountSidW(NULL, pOwner, (LPWSTR)owner.data(), &lowner,
- (LPWSTR)domain.data(), &ldomain, (SID_NAME_USE*)&use)) {
+ if (!LookupAccountSid(NULL, pOwner, (LPWSTR)owner.data(), &lowner,
+ domain.data(), &ldomain, &use)) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
if (lowner > (DWORD)owner.size())
owner.resize(lowner);
if (ldomain > (DWORD)domain.size())
domain.resize(ldomain);
// Second call, try on resized buf-s
- if (!ptrLookupAccountSidW(NULL, pOwner, (LPWSTR)owner.data(), &lowner,
- (LPWSTR)domain.data(), &ldomain, (SID_NAME_USE*)&use)) {
+ if (!LookupAccountSid(NULL, pOwner, owner.data(), &lowner,
+ domain.data(), &ldomain, &use)) {
lowner = 0;
}
} else {
@@ -701,9 +704,9 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
QFileSystemMetaData::MetaDataFlags what)
{
#if QT_CONFIG(fslibs)
- if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) {
- resolveLibs();
- if(ptrGetNamedSecurityInfoW && ptrBuildTrusteeWithSidW && ptrGetEffectiveRightsFromAclW) {
+ if (qt_ntfs_permission_lookup > 0) {
+ initGlobalSid();
+ {
enum { ReadMask = 0x00000001, WriteMask = 0x00000002, ExecMask = 0x00000020 };
QString fname = entry.nativeFilePath();
@@ -711,15 +714,15 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
PSID pGroup = 0;
PACL pDacl;
PSECURITY_DESCRIPTOR pSD;
- DWORD res = ptrGetNamedSecurityInfoW((wchar_t*)fname.utf16(), SE_FILE_OBJECT,
- OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
- &pOwner, &pGroup, &pDacl, 0, &pSD);
+ DWORD res = GetNamedSecurityInfo(reinterpret_cast<const wchar_t*>(fname.utf16()), SE_FILE_OBJECT,
+ OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
+ &pOwner, &pGroup, &pDacl, 0, &pSD);
if(res == ERROR_SUCCESS) {
ACCESS_MASK access_mask;
TRUSTEE_W trustee;
if (what & QFileSystemMetaData::UserPermissions) { // user
data.knownFlagsMask |= QFileSystemMetaData::UserPermissions;
- if(ptrGetEffectiveRightsFromAclW(pDacl, &currentUserTrusteeW, &access_mask) != ERROR_SUCCESS)
+ if (GetEffectiveRightsFromAcl(pDacl, &currentUserTrusteeW, &access_mask) != ERROR_SUCCESS)
access_mask = (ACCESS_MASK)-1;
if(access_mask & ReadMask)
data.entryFlags |= QFileSystemMetaData::UserReadPermission;
@@ -730,8 +733,8 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
}
if (what & QFileSystemMetaData::OwnerPermissions) { // owner
data.knownFlagsMask |= QFileSystemMetaData::OwnerPermissions;
- ptrBuildTrusteeWithSidW(&trustee, pOwner);
- if(ptrGetEffectiveRightsFromAclW(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
+ BuildTrusteeWithSid(&trustee, pOwner);
+ if (GetEffectiveRightsFromAcl(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
access_mask = (ACCESS_MASK)-1;
if(access_mask & ReadMask)
data.entryFlags |= QFileSystemMetaData::OwnerReadPermission;
@@ -742,8 +745,8 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
}
if (what & QFileSystemMetaData::GroupPermissions) { // group
data.knownFlagsMask |= QFileSystemMetaData::GroupPermissions;
- ptrBuildTrusteeWithSidW(&trustee, pGroup);
- if(ptrGetEffectiveRightsFromAclW(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
+ BuildTrusteeWithSid(&trustee, pGroup);
+ if (GetEffectiveRightsFromAcl(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
access_mask = (ACCESS_MASK)-1;
if(access_mask & ReadMask)
data.entryFlags |= QFileSystemMetaData::GroupReadPermission;
@@ -754,7 +757,7 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
}
if (what & QFileSystemMetaData::OtherPermissions) { // other (world)
data.knownFlagsMask |= QFileSystemMetaData::OtherPermissions;
- if(ptrGetEffectiveRightsFromAclW(pDacl, &worldTrusteeW, &access_mask) != ERROR_SUCCESS)
+ if (GetEffectiveRightsFromAcl(pDacl, &worldTrusteeW, &access_mask) != ERROR_SUCCESS)
access_mask = (ACCESS_MASK)-1; // ###
if(access_mask & ReadMask)
data.entryFlags |= QFileSystemMetaData::OtherReadPermission;
@@ -907,8 +910,10 @@ bool QFileSystemEngine::fillMetaData(HANDLE fHandle, QFileSystemMetaData &data,
FILE_BASIC_INFO fileBasicInfo;
if (GetFileInformationByHandleEx(fHandle, FileBasicInfo, &fileBasicInfo, sizeof(fileBasicInfo))) {
data.fillFromFileAttribute(fileBasicInfo.FileAttributes);
- data.creationTime_.dwHighDateTime = fileBasicInfo.CreationTime.HighPart;
- data.creationTime_.dwLowDateTime = fileBasicInfo.CreationTime.LowPart;
+ data.birthTime_.dwHighDateTime = fileBasicInfo.CreationTime.HighPart;
+ data.birthTime_.dwLowDateTime = fileBasicInfo.CreationTime.LowPart;
+ data.changeTime_.dwHighDateTime = fileBasicInfo.ChangeTime.HighPart;
+ data.changeTime_.dwLowDateTime = fileBasicInfo.ChangeTime.LowPart;
data.lastAccessTime_.dwHighDateTime = fileBasicInfo.LastAccessTime.HighPart;
data.lastAccessTime_.dwLowDateTime = fileBasicInfo.LastAccessTime.LowPart;
data.lastWriteTime_.dwHighDateTime = fileBasicInfo.LastWriteTime.HighPart;
@@ -1165,19 +1170,19 @@ QString QFileSystemEngine::homePath()
{
QString ret;
#if QT_CONFIG(fslibs)
- resolveLibs();
- if (ptrGetUserProfileDirectoryW) {
+ initGlobalSid();
+ {
HANDLE hnd = ::GetCurrentProcess();
HANDLE token = 0;
BOOL ok = ::OpenProcessToken(hnd, TOKEN_QUERY, &token);
if (ok) {
DWORD dwBufferSize = 0;
// First call, to determine size of the strings (with '\0').
- ok = ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize);
+ ok = GetUserProfileDirectory(token, NULL, &dwBufferSize);
if (!ok && dwBufferSize != 0) { // We got the required buffer size
wchar_t *userDirectory = new wchar_t[dwBufferSize];
// Second call, now we can fill the allocated buffer.
- ok = ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize);
+ ok = GetUserProfileDirectory(token, userDirectory, &dwBufferSize);
if (ok)
ret = QString::fromWCharArray(userDirectory);
delete [] userDirectory;
@@ -1323,6 +1328,17 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
}
//static
+bool QFileSystemEngine::renameOverwriteFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
+{
+ bool ret = ::MoveFileEx(reinterpret_cast<const wchar_t *>(source.nativeFilePath().utf16()),
+ reinterpret_cast<const wchar_t *>(target.nativeFilePath().utf16()),
+ MOVEFILE_REPLACE_EXISTING) != 0;
+ if (!ret)
+ error = QSystemError(::GetLastError(), QSystemError::NativeError);
+ return ret;
+}
+
+//static
bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &error)
{
bool ret = ::DeleteFile((wchar_t*)entry.nativeFilePath().utf16()) != 0;
@@ -1354,6 +1370,9 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per
static inline QDateTime fileTimeToQDateTime(const FILETIME *time)
{
+ if (time->dwHighDateTime == 0 && time->dwLowDateTime == 0)
+ return QDateTime();
+
SYSTEMTIME sTime;
FileTimeToSystemTime(time, &sTime);
return QDateTime(QDate(sTime.wYear, sTime.wMonth, sTime.wDay),
@@ -1361,9 +1380,13 @@ static inline QDateTime fileTimeToQDateTime(const FILETIME *time)
Qt::UTC);
}
-QDateTime QFileSystemMetaData::creationTime() const
+QDateTime QFileSystemMetaData::birthTime() const
+{
+ return fileTimeToQDateTime(&birthTime_);
+}
+QDateTime QFileSystemMetaData::metadataChangeTime() const
{
- return fileTimeToQDateTime(&creationTime_);
+ return fileTimeToQDateTime(&changeTime_);
}
QDateTime QFileSystemMetaData::modificationTime() const
{
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index cbff17d0f1..3ff90bd0a3 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -331,11 +331,6 @@ bool QFileSystemEntry::isRoot() const
return isRootPath(m_filePath);
}
-bool QFileSystemEntry::isEmpty() const
-{
- return m_filePath.isEmpty() && m_nativeFilePath.isEmpty();
-}
-
// private methods
void QFileSystemEntry::findLastSeparator() const
diff --git a/src/corelib/io/qfilesystementry_p.h b/src/corelib/io/qfilesystementry_p.h
index 700696d09e..251eca553a 100644
--- a/src/corelib/io/qfilesystementry_p.h
+++ b/src/corelib/io/qfilesystementry_p.h
@@ -98,7 +98,10 @@ public:
#endif
bool isRoot() const;
- bool isEmpty() const;
+ bool isEmpty() const
+ {
+ return m_filePath.isEmpty() && m_nativeFilePath.isEmpty();
+ }
void clear()
{
*this = QFileSystemEntry();
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index b09223d656..55e44d52c7 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -120,16 +120,22 @@ public:
// Attributes
HiddenAttribute = 0x00100000,
SizeAttribute = 0x00200000, // Note: overlaps with QAbstractFileEngine::LocalDiskFlag
- ExistsAttribute = 0x00400000,
+ ExistsAttribute = 0x00400000, // For historical reasons, indicates existence of data, not the file
+#if defined(Q_OS_WIN)
+ WasDeletedAttribute = 0x0,
+#else
+ WasDeletedAttribute = 0x40000000, // Indicates the file was deleted
+#endif
- Attributes = HiddenAttribute | SizeAttribute | ExistsAttribute,
+ Attributes = HiddenAttribute | SizeAttribute | ExistsAttribute | WasDeletedAttribute,
- // Times
- CreationTime = 0x01000000, // Note: overlaps with QAbstractFileEngine::Refresh
+ // Times - if we know one of them, we know them all
+ AccessTime = 0x02000000,
+ BirthTime = 0x02000000,
+ MetadataChangeTime = 0x02000000,
ModificationTime = 0x02000000,
- AccessTime = 0x04000000,
- Times = CreationTime | ModificationTime | AccessTime,
+ Times = AccessTime | BirthTime | MetadataChangeTime | ModificationTime,
// Owner IDs
UserId = 0x10000000,
@@ -144,6 +150,7 @@ public:
| QFileSystemMetaData::DirectoryType
| QFileSystemMetaData::SequentialType
| QFileSystemMetaData::SizeAttribute
+ | QFileSystemMetaData::WasDeletedAttribute
| QFileSystemMetaData::Times
| QFileSystemMetaData::OwnerIds,
@@ -191,6 +198,7 @@ public:
bool isLegacyLink() const { return (entryFlags & LegacyLinkType); }
bool isSequential() const { return (entryFlags & SequentialType); }
bool isHidden() const { return (entryFlags & HiddenAttribute); }
+ bool wasDeleted() const { return (entryFlags & WasDeletedAttribute); }
#if defined(Q_OS_WIN)
bool isLnkFile() const { return (entryFlags & WinLnkType); }
#else
@@ -201,9 +209,10 @@ public:
QFile::Permissions permissions() const { return QFile::Permissions(Permissions & entryFlags); }
- QDateTime creationTime() const;
- QDateTime modificationTime() const;
QDateTime accessTime() const;
+ QDateTime birthTime() const;
+ QDateTime metadataChangeTime() const;
+ QDateTime modificationTime() const;
QDateTime fileTime(QAbstractFileEngine::FileTime time) const;
uint userId() const;
@@ -211,6 +220,7 @@ public:
uint ownerId(QAbstractFileEngine::FileOwner owner) const;
#ifdef Q_OS_UNIX
+ void fillFromStatxBuf(const struct statx &statBuffer);
void fillFromStatBuf(const QT_STATBUF &statBuffer);
void fillFromDirEnt(const QT_DIRENT &statBuffer);
#endif
@@ -233,14 +243,16 @@ private:
// Platform-specific data goes here:
#if defined(Q_OS_WIN)
DWORD fileAttribute_;
- FILETIME creationTime_;
+ FILETIME birthTime_;
+ FILETIME changeTime_;
FILETIME lastAccessTime_;
FILETIME lastWriteTime_;
#else
// msec precision
- qint64 creationTime_;
- qint64 modificationTime_;
qint64 accessTime_;
+ qint64 birthTime_;
+ qint64 metadataChangeTime_;
+ qint64 modificationTime_;
uint userId_;
uint groupId_;
@@ -268,8 +280,11 @@ inline QDateTime QFileSystemMetaData::fileTime(QAbstractFileEngine::FileTime tim
case QAbstractFileEngine::AccessTime:
return accessTime();
- case QAbstractFileEngine::CreationTime:
- return creationTime();
+ case QAbstractFileEngine::BirthTime:
+ return birthTime();
+
+ case QAbstractFileEngine::MetadataChangeTime:
+ return metadataChangeTime();
}
return QDateTime();
@@ -277,9 +292,14 @@ inline QDateTime QFileSystemMetaData::fileTime(QAbstractFileEngine::FileTime tim
#endif
#if defined(Q_OS_UNIX)
-inline QDateTime QFileSystemMetaData::creationTime() const { return QDateTime::fromMSecsSinceEpoch(creationTime_); }
-inline QDateTime QFileSystemMetaData::modificationTime() const { return QDateTime::fromMSecsSinceEpoch(modificationTime_); }
-inline QDateTime QFileSystemMetaData::accessTime() const { return QDateTime::fromMSecsSinceEpoch(accessTime_); }
+inline QDateTime QFileSystemMetaData::birthTime() const
+{ return birthTime_ ? QDateTime::fromMSecsSinceEpoch(birthTime_) : QDateTime(); }
+inline QDateTime QFileSystemMetaData::metadataChangeTime() const
+{ return metadataChangeTime_ ? QDateTime::fromMSecsSinceEpoch(metadataChangeTime_) : QDateTime(); }
+inline QDateTime QFileSystemMetaData::modificationTime() const
+{ return modificationTime_ ? QDateTime::fromMSecsSinceEpoch(modificationTime_) : QDateTime(); }
+inline QDateTime QFileSystemMetaData::accessTime() const
+{ return accessTime_ ? QDateTime::fromMSecsSinceEpoch(accessTime_) : QDateTime(); }
inline uint QFileSystemMetaData::userId() const { return userId_; }
inline uint QFileSystemMetaData::groupId() const { return groupId_; }
@@ -318,9 +338,9 @@ inline void QFileSystemMetaData::fillFromFileAttribute(DWORD fileAttribute,bool
inline void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, bool setLinkType, bool isDriveRoot)
{
fillFromFileAttribute(findData.dwFileAttributes, isDriveRoot);
- creationTime_ = findData.ftCreationTime;
+ birthTime_ = findData.ftCreationTime;
lastAccessTime_ = findData.ftLastAccessTime;
- lastWriteTime_ = findData.ftLastWriteTime;
+ changeTime_ = lastWriteTime_ = findData.ftLastWriteTime;
if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) {
size_ = 0;
} else {
@@ -343,9 +363,9 @@ inline void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, boo
inline void QFileSystemMetaData::fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo)
{
fillFromFileAttribute(fileInfo.dwFileAttributes);
- creationTime_ = fileInfo.ftCreationTime;
+ birthTime_ = fileInfo.ftCreationTime;
lastAccessTime_ = fileInfo.ftLastAccessTime;
- lastWriteTime_ = fileInfo.ftLastWriteTime;
+ changeTime_ = lastWriteTime_ = fileInfo.ftLastWriteTime;
if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) {
size_ = 0;
} else {
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 88e8baedca..b7a5440224 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -195,6 +195,9 @@ void QFSFileEngine::setFileName(const QString &file)
*/
bool QFSFileEngine::open(QIODevice::OpenMode openMode)
{
+ Q_ASSERT_X(openMode & QIODevice::Unbuffered, "QFSFileEngine::open",
+ "QFSFileEngine no longer supports buffered mode; upper layer must buffer");
+
Q_D(QFSFileEngine);
if (d->fileEntry.isEmpty()) {
qWarning("QFSFileEngine::open: No file name specified");
@@ -230,6 +233,9 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh)
bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh, QFile::FileHandleFlags handleFlags)
{
+ Q_ASSERT_X(openMode & QIODevice::Unbuffered, "QFSFileEngine::open",
+ "QFSFileEngine no longer supports buffered mode; upper layer must buffer");
+
Q_D(QFSFileEngine);
// Append implies WriteOnly.
@@ -255,6 +261,9 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh, QFile::FileHand
*/
bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh)
{
+ Q_ASSERT_X(openMode & QIODevice::Unbuffered, "QFSFileEngine::open",
+ "QFSFileEngine no longer supports buffered mode; upper layer must buffer");
+
Q_Q(QFSFileEngine);
this->fh = fh;
fd = -1;
@@ -516,6 +525,25 @@ bool QFSFileEngine::seek(qint64 pos)
}
/*!
+ \reimp
+*/
+QDateTime QFSFileEngine::fileTime(FileTime time) const
+{
+ Q_D(const QFSFileEngine);
+
+ if (time == AccessTime) {
+ // always refresh for the access time
+ d->metaData.clearFlags(QFileSystemMetaData::AccessTime);
+ }
+
+ if (d->doStat(QFileSystemMetaData::Times))
+ return d->metaData.fileTime(time);
+
+ return QDateTime();
+}
+
+
+/*!
\internal
*/
bool QFSFileEnginePrivate::seekFdFh(qint64 pos)
@@ -699,6 +727,7 @@ qint64 QFSFileEnginePrivate::readLineFdFh(char *data, qint64 maxlen)
qint64 QFSFileEngine::write(const char *data, qint64 len)
{
Q_D(QFSFileEngine);
+ d->metaData.clearFlags(QFileSystemMetaData::Times);
// On Windows' stdlib implementation, the results of calling fread and
// fwrite are undefined if not called either in sequence, or if preceded
@@ -860,9 +889,9 @@ bool QFSFileEngine::supportsExtension(Extension extension) const
/*! \fn bool QFSFileEngine::copy(const QString &copyName)
- For windows, copy the file to file \a copyName.
+ For Windows or Apple platforms, copy the file to file \a copyName.
- Not implemented for Unix.
+ Not implemented for other Unix platforms.
*/
/*! \fn QString QFSFileEngine::currentPath(const QString &fileName)
@@ -890,7 +919,7 @@ bool QFSFileEngine::supportsExtension(Extension extension) const
\reimp
*/
-/*! \fn QDateTime QFSFileEngine::fileTime(FileTime time) const
+/*! \fn bool QFSFileEngine::setFileTime(const QDateTime &newDate, FileTime time)
\reimp
*/
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index ab9ad3aa6b..1f34dfc2be 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -97,6 +97,7 @@ public:
QString fileName(FileName file) const Q_DECL_OVERRIDE;
uint ownerId(FileOwner) const Q_DECL_OVERRIDE;
QString owner(FileOwner) const Q_DECL_OVERRIDE;
+ bool setFileTime(const QDateTime &newDate, FileTime time) Q_DECL_OVERRIDE;
QDateTime fileTime(FileTime time) const Q_DECL_OVERRIDE;
void setFileName(const QString &file) Q_DECL_OVERRIDE;
int handle() const Q_DECL_OVERRIDE;
@@ -109,6 +110,7 @@ public:
qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
qint64 readLine(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ bool cloneTo(QAbstractFileEngine *target) override;
bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) Q_DECL_OVERRIDE;
bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index c613368a91..c040d67862 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -65,46 +65,6 @@ QT_BEGIN_NAMESPACE
/*!
\internal
- Returns the stdlib open string corresponding to a QIODevice::OpenMode.
-*/
-static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QFileSystemEntry &fileEntry,
- QFileSystemMetaData &metaData)
-{
- QByteArray mode;
- if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) {
- mode = "rb";
- if (flags & QIODevice::WriteOnly) {
- metaData.clearFlags(QFileSystemMetaData::FileType);
- if (!fileEntry.isEmpty()
- && QFileSystemEngine::fillMetaData(fileEntry, metaData, QFileSystemMetaData::FileType)
- && metaData.isFile()) {
- mode += '+';
- } else {
- mode = "wb+";
- }
- }
- } else if (flags & QIODevice::WriteOnly) {
- mode = "wb";
- if (flags & QIODevice::ReadOnly)
- mode += '+';
- }
- if (flags & QIODevice::Append) {
- mode = "ab";
- if (flags & QIODevice::ReadOnly)
- mode += '+';
- }
-
-#if defined(__GLIBC__) && (__GLIBC__ * 0x100 + __GLIBC_MINOR__) >= 0x0207
- // must be glibc >= 2.7
- mode += 'e';
-#endif
-
- return mode;
-}
-
-/*!
- \internal
-
Returns the stdio open flags corresponding to a QIODevice::OpenMode.
*/
static inline int openModeToOpenFlags(QIODevice::OpenMode mode)
@@ -130,17 +90,6 @@ static inline int openModeToOpenFlags(QIODevice::OpenMode mode)
return oflags;
}
-/*!
- \internal
-
- Sets the file descriptor to close on exec. That is, the file
- descriptor is not inherited by child processes.
-*/
-static inline bool setCloseOnExec(int fd)
-{
- return fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) != -1;
-}
-
static inline QString msgOpenDirectory()
{
const char message[] = QT_TRANSLATE_NOOP("QIODevice", "file to open is a directory");
@@ -158,6 +107,8 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
{
Q_Q(QFSFileEngine);
+ Q_ASSERT_X(openMode & QIODevice::Unbuffered, "QFSFileEngine::open",
+ "QFSFileEngine no longer supports buffered mode; upper layer must buffer");
if (openMode & QIODevice::Unbuffered) {
int flags = openModeToOpenFlags(openMode);
@@ -199,49 +150,6 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
}
fh = 0;
- } else {
- QByteArray fopenMode = openModeToFopenMode(openMode, fileEntry, metaData);
-
- // Try to open the file in buffered mode.
- do {
- fh = QT_FOPEN(fileEntry.nativeFilePath().constData(), fopenMode.constData());
- } while (!fh && errno == EINTR);
-
- // On failure, return and report the error.
- if (!fh) {
- q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,
- qt_error_string(int(errno)));
- return false;
- }
-
- if (!(openMode & QIODevice::WriteOnly)) {
- // we don't need this check if we tried to open for writing because then
- // we had received EISDIR anyway.
- if (QFileSystemEngine::fillMetaData(QT_FILENO(fh), metaData)
- && metaData.isDirectory()) {
- q->setError(QFile::OpenError, msgOpenDirectory());
- fclose(fh);
- return false;
- }
- }
-
- setCloseOnExec(fileno(fh)); // ignore failure
-
- // Seek to the end when in Append mode.
- if (openMode & QIODevice::Append) {
- int ret;
- do {
- ret = QT_FSEEK(fh, 0, SEEK_END);
- } while (ret == -1 && errno == EINTR);
-
- if (ret == -1) {
- q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,
- qt_error_string(int(errno)));
- return false;
- }
- }
-
- fd = -1;
}
closeFileHandle = true;
@@ -416,8 +324,14 @@ bool QFSFileEngine::copy(const QString &newName)
bool QFSFileEngine::renameOverwrite(const QString &newName)
{
- // On Unix, rename() overwrites.
- return rename(newName);
+ Q_D(QFSFileEngine);
+ QSystemError error;
+ bool ret = QFileSystemEngine::renameOverwriteFile(d->fileEntry, QFileSystemEntry(newName), error);
+
+ if (!ret)
+ setError(QFile::RenameError, error.toString());
+
+ return ret;
}
bool QFSFileEngine::rename(const QString &newName)
@@ -549,11 +463,14 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
| QFileSystemMetaData::LinkType
| QFileSystemMetaData::FileType
| QFileSystemMetaData::DirectoryType
- | QFileSystemMetaData::BundleType;
+ | QFileSystemMetaData::BundleType
+ | QFileSystemMetaData::WasDeletedAttribute;
if (type & FlagsMask)
queryFlags |= QFileSystemMetaData::HiddenAttribute
| QFileSystemMetaData::ExistsAttribute;
+ else if (type & ExistsFlag)
+ queryFlags |= QFileSystemMetaData::WasDeletedAttribute;
queryFlags |= QFileSystemMetaData::LinkType;
@@ -585,7 +502,8 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
}
if (type & FlagsMask) {
- if (exists)
+ // the inode existing does not mean the file exists
+ if (!d->metaData.wasDeleted())
ret |= ExistsFlag;
if (d->fileEntry.isRoot())
ret |= RootFlag;
@@ -689,14 +607,23 @@ bool QFSFileEngine::setSize(qint64 size)
return ret;
}
-QDateTime QFSFileEngine::fileTime(FileTime time) const
+bool QFSFileEngine::setFileTime(const QDateTime &newDate, FileTime time)
{
- Q_D(const QFSFileEngine);
+ Q_D(QFSFileEngine);
+
+ if (d->openMode == QIODevice::NotOpen) {
+ setError(QFile::PermissionsError, qt_error_string(EACCES));
+ return false;
+ }
- if (d->doStat(QFileSystemMetaData::Times))
- return d->metaData.fileTime(time);
+ QSystemError error;
+ if (!QFileSystemEngine::setFileTime(d->nativeHandle(), newDate, time, error)) {
+ setError(QFile::PermissionsError, error.toString());
+ return false;
+ }
- return QDateTime();
+ d->metaData.clearFlags(QFileSystemMetaData::Times);
+ return true;
}
uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
@@ -715,7 +642,6 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
#endif
Q_Q(QFSFileEngine);
- Q_UNUSED(flags);
if (openMode == QIODevice::NotOpen) {
q->setError(QFile::PermissionsError, qt_error_string(int(EACCES)));
return 0;
@@ -806,6 +732,20 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
#endif
}
+/*!
+ \reimp
+*/
+bool QFSFileEngine::cloneTo(QAbstractFileEngine *target)
+{
+ Q_D(QFSFileEngine);
+ if ((target->fileFlags(LocalDiskFlag) & LocalDiskFlag) == 0)
+ return false;
+
+ int srcfd = d->nativeHandle();
+ int dstfd = target->handle();
+ return QFileSystemEngine::cloneFile(srcfd, dstfd, d->metaData);
+}
+
QT_END_NAMESPACE
#endif // QT_NO_FSFILEENGINE
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index c99a25f30d..759effe632 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -474,11 +474,10 @@ bool QFSFileEngine::rename(const QString &newName)
bool QFSFileEngine::renameOverwrite(const QString &newName)
{
Q_D(QFSFileEngine);
- bool ret = ::MoveFileEx((wchar_t*)d->fileEntry.nativeFilePath().utf16(),
- (wchar_t*)QFileSystemEntry(newName).nativeFilePath().utf16(),
- MOVEFILE_REPLACE_EXISTING) != 0;
+ QSystemError error;
+ bool ret = QFileSystemEngine::renameOverwriteFile(d->fileEntry, QFileSystemEntry(newName), error);
if (!ret)
- setError(QFile::RenameError, QSystemError(::GetLastError(), QSystemError::NativeError).toString());
+ setError(QFile::RenameError, error.toString());
return ret;
}
@@ -694,6 +693,8 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil
}
if (type & FlagsMask) {
if (d->metaData.exists()) {
+ // if we succeeded in querying, then the file exists: a file on
+ // Windows cannot be deleted if we have an open handle to it
ret |= ExistsFlag;
if (d->fileEntry.isRoot())
ret |= RootFlag;
@@ -854,15 +855,41 @@ bool QFSFileEngine::setSize(qint64 size)
return false;
}
-
-QDateTime QFSFileEngine::fileTime(FileTime time) const
+bool QFSFileEngine::setFileTime(const QDateTime &newDate, FileTime time)
{
- Q_D(const QFSFileEngine);
+ Q_D(QFSFileEngine);
+
+ if (d->openMode == QFile::NotOpen) {
+ setError(QFile::PermissionsError, qt_error_string(ERROR_ACCESS_DENIED));
+ return false;
+ }
+
+ if (!newDate.isValid() || time == QAbstractFileEngine::MetadataChangeTime) {
+ setError(QFile::UnspecifiedError, qt_error_string(ERROR_INVALID_PARAMETER));
+ return false;
+ }
+
+ HANDLE handle = d->fileHandle;
+ if (handle == INVALID_HANDLE_VALUE) {
+ if (d->fh)
+ handle = reinterpret_cast<HANDLE>(::_get_osfhandle(QT_FILENO(d->fh)));
+ else if (d->fd != -1)
+ handle = reinterpret_cast<HANDLE>(::_get_osfhandle(d->fd));
+ }
+
+ if (handle == INVALID_HANDLE_VALUE) {
+ setError(QFile::PermissionsError, qt_error_string(ERROR_ACCESS_DENIED));
+ return false;
+ }
- if (d->doStat(QFileSystemMetaData::Times))
- return d->metaData.fileTime(time);
+ QSystemError error;
+ if (!QFileSystemEngine::setFileTime(handle, newDate, time, error)) {
+ setError(QFile::PermissionsError, error.toString());
+ return false;
+ }
- return QDateTime();
+ d->metaData.clearFlags(QFileSystemMetaData::Times);
+ return true;
}
uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
@@ -1002,4 +1029,15 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
return true;
}
+/*!
+ \reimp
+*/
+bool QFSFileEngine::cloneTo(QAbstractFileEngine *target)
+{
+ // There's some Windows Server 2016 API, but we won't
+ // bother with it.
+ Q_UNUSED(target);
+ return false;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 80122eac5e..82fc34c537 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1879,6 +1879,128 @@ QByteArray QIODevice::peek(qint64 maxSize)
}
/*!
+ \since 5.11
+
+ Skips up to \a maxSize bytes from the device. Returns the number of bytes
+ actually skipped, or -1 on error.
+
+ This function does not wait and only discards the data that is already
+ available for reading.
+
+ If the device is opened in text mode, end-of-line terminators are
+ translated to '\n' symbols and count as a single byte identically to the
+ read() and peek() behavior.
+
+ This function works for all devices, including sequential ones that cannot
+ seek(). It is optimized to skip unwanted data after a peek() call.
+
+ For random-access devices, skip() can be used to seek forward from the
+ current position. Negative \a maxSize values are not allowed.
+
+ \sa peek(), seek(), read()
+*/
+qint64 QIODevice::skip(qint64 maxSize)
+{
+ Q_D(QIODevice);
+ CHECK_MAXLEN(skip, qint64(-1));
+ CHECK_READABLE(skip, qint64(-1));
+
+ const bool sequential = d->isSequential();
+
+#if defined QIODEVICE_DEBUG
+ printf("%p QIODevice::skip(%lld), d->pos = %lld, d->buffer.size() = %lld\n",
+ this, maxSize, d->pos, d->buffer.size());
+#endif
+
+ if ((sequential && d->transactionStarted) || (d->openMode & QIODevice::Text) != 0)
+ return d->skipByReading(maxSize);
+
+ // First, skip over any data in the internal buffer.
+ qint64 skippedSoFar = 0;
+ if (!d->buffer.isEmpty()) {
+ skippedSoFar = d->buffer.skip(maxSize);
+#if defined QIODEVICE_DEBUG
+ printf("%p \tskipping %lld bytes in buffer\n", this, skippedSoFar);
+#endif
+ if (!sequential)
+ d->pos += skippedSoFar;
+ if (d->buffer.isEmpty())
+ readData(nullptr, 0);
+ if (skippedSoFar == maxSize)
+ return skippedSoFar;
+
+ maxSize -= skippedSoFar;
+ }
+
+ // Try to seek on random-access device. At this point,
+ // the internal read buffer is empty.
+ if (!sequential) {
+ const qint64 bytesToSkip = qMin(size() - d->pos, maxSize);
+
+ // If the size is unknown or file position is at the end,
+ // fall back to reading below.
+ if (bytesToSkip > 0) {
+ if (!seek(d->pos + bytesToSkip))
+ return skippedSoFar ? skippedSoFar : Q_INT64_C(-1);
+ if (bytesToSkip == maxSize)
+ return skippedSoFar + bytesToSkip;
+
+ skippedSoFar += bytesToSkip;
+ maxSize -= bytesToSkip;
+ }
+ }
+
+ const qint64 skipResult = d->skip(maxSize);
+ if (skippedSoFar == 0)
+ return skipResult;
+
+ if (skipResult == -1)
+ return skippedSoFar;
+
+ return skippedSoFar + skipResult;
+}
+
+/*!
+ \internal
+*/
+qint64 QIODevicePrivate::skipByReading(qint64 maxSize)
+{
+ qint64 readSoFar = 0;
+ do {
+ char dummy[4096];
+ const qint64 readBytes = qMin<qint64>(maxSize, sizeof(dummy));
+ const qint64 readResult = read(dummy, readBytes);
+
+ // Do not try again, if we got less data.
+ if (readResult != readBytes) {
+ if (readSoFar == 0)
+ return readResult;
+
+ if (readResult == -1)
+ return readSoFar;
+
+ return readSoFar + readResult;
+ }
+
+ readSoFar += readResult;
+ maxSize -= readResult;
+ } while (maxSize > 0);
+
+ return readSoFar;
+}
+
+/*!
+ \internal
+*/
+qint64 QIODevicePrivate::skip(qint64 maxSize)
+{
+ // Base implementation discards the data by reading into the dummy buffer.
+ // It's slow, but this works for all types of devices. Subclasses can
+ // reimplement this function to improve on that.
+ return skipByReading(maxSize);
+}
+
+/*!
Blocks until new data is available for reading and the readyRead()
signal has been emitted, or until \a msecs milliseconds have
passed. If msecs is -1, this function will not time out.
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 162480d22f..e64a4d0bb1 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -136,6 +136,7 @@ public:
qint64 peek(char *data, qint64 maxlen);
QByteArray peek(qint64 maxlen);
+ qint64 skip(qint64 maxSize);
virtual bool waitForReadyRead(int msecs);
virtual bool waitForBytesWritten(int msecs);
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 71a326dd53..de2aa1597e 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -174,6 +174,9 @@ public:
qint64 read(char *data, qint64 maxSize, bool peeking = false);
virtual qint64 peek(char *data, qint64 maxSize);
virtual QByteArray peek(qint64 maxSize);
+ qint64 skipByReading(qint64 maxSize);
+ // ### Qt6: consider replacing with a protected virtual QIODevice::skipData().
+ virtual qint64 skip(qint64 maxSize);
#ifdef QT_NO_QOBJECT
QIODevice *q_ptr;
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index ccc607afd5..1ee8ce889c 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -199,7 +199,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
}
if (qt_write_loop(fd, fileData.constData(), fileData.size()) < fileData.size()) {
- close(fd);
+ qt_safe_close(fd);
if (!QFile::remove(fileName))
qWarning("QLockFile: Could not remove our own lock file %s.", qPrintable(fileName));
return QLockFile::UnknownError; // partition full
@@ -258,17 +258,17 @@ QString QLockFilePrivate::processNameByPid(qint64 pid)
proc_name(pid, name, sizeof(name) / sizeof(char));
return QFile::decodeName(name);
#elif defined(Q_OS_LINUX)
- if (!QFile::exists(QStringLiteral("/proc/version")))
+ if (!qt_haveLinuxProcfs())
return QString();
+
char exePath[64];
- char buf[PATH_MAX + 1];
sprintf(exePath, "/proc/%lld/exe", pid);
- size_t len = (size_t)readlink(exePath, buf, sizeof(buf));
- if (len >= sizeof(buf)) {
+
+ QByteArray buf = qt_readlink(exePath);
+ if (buf.isEmpty()) {
// The pid is gone. Return some invalid process name to fail the test.
return QStringLiteral("/ERROR/");
}
- buf[len] = 0;
return QFileInfo(QFile::decodeName(buf)).fileName();
#elif defined(Q_OS_HAIKU)
thread_info info;
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 88a54f275f..7ed319f5f1 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -450,11 +450,6 @@ void QProcessPrivate::Channel::clear()
process = 0;
}
-/*! \fn bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
-
-\internal
- */
-
/*!
\class QProcess
\inmodule QtCore
@@ -1058,10 +1053,7 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
readBuffer.chop(available - readBytes);
bool didRead = false;
- if (readBytes == 0) {
- if (channel->notifier)
- channel->notifier->setEnabled(false);
- } else if (currentReadChannel == channelIdx) {
+ if (currentReadChannel == channelIdx) {
didRead = true;
if (!emittedReadyRead) {
emittedReadyRead = true;
@@ -2114,6 +2106,64 @@ void QProcess::start(OpenMode mode)
}
/*!
+ \since 5.10
+
+ Starts the program set by setProgram() with arguments set by setArguments()
+ in a new process, and detaches from it. Returns \c true on success;
+ otherwise returns \c false. If the calling process exits, the
+ detached process will continue to run unaffected.
+
+ \b{Unix:} The started process will run in its own session and act
+ like a daemon.
+
+ The process will be started in the directory set by setWorkingDirectory().
+ If workingDirectory() is empty, the working directory is inherited
+ from the calling process.
+
+ \note On QNX, this may cause all application threads to
+ temporarily freeze.
+
+ If the function is successful then *\a pid is set to the process identifier
+ of the started process. Note that the child process may exit and the PID
+ may become invalid without notice. Furthermore, after the child process
+ exits, the same PID may be recycled and used by a completely different
+ process. User code should be careful when using this variable, especially
+ if one intends to forcibly terminate the process by operating system means.
+
+ Only the following property setters are supported by startDetached():
+ \list
+ \li setArguments()
+ \li setCreateProcessArgumentsModifier()
+ \li setNativeArguments()
+ \li setProcessEnvironment()
+ \li setProgram()
+ \li setStandardErrorFile()
+ \li setStandardInputFile()
+ \li setStandardOutputFile()
+ \li setWorkingDirectory()
+ \endlist
+ All other properties of the QProcess object are ignored.
+
+ \sa start()
+ \sa startDetached(const QString &program, const QStringList &arguments,
+ const QString &workingDirectory, qint64 *pid)
+ \sa startDetached(const QString &command)
+*/
+bool QProcess::startDetached(qint64 *pid)
+{
+ Q_D(QProcess);
+ if (d->processState != NotRunning) {
+ qWarning("QProcess::startDetached: Process is already running");
+ return false;
+ }
+ if (d->program.isEmpty()) {
+ d->setErrorAndEmit(QProcess::FailedToStart, tr("No program defined"));
+ return false;
+ }
+ return d->startDetached(pid);
+}
+
+/*!
Starts the program set by setProgram() with arguments set by setArguments().
The OpenMode is set to \a mode.
@@ -2447,6 +2497,8 @@ int QProcess::execute(const QString &command)
}
/*!
+ \overload startDetached()
+
Starts the program \a program with the arguments \a arguments in a
new process, and detaches from it. Returns \c true on success;
otherwise returns \c false. If the calling process exits, the
@@ -2454,16 +2506,10 @@ int QProcess::execute(const QString &command)
Argument handling is identical to the respective start() overload.
- \b{Unix:} The started process will run in its own session and act
- like a daemon.
-
The process will be started in the directory \a workingDirectory.
If \a workingDirectory is empty, the working directory is inherited
from the calling process.
- \note On QNX, this may cause all application threads to
- temporarily freeze.
-
If the function is successful then *\a pid is set to the process
identifier of the started process.
@@ -2474,10 +2520,11 @@ bool QProcess::startDetached(const QString &program,
const QString &workingDirectory,
qint64 *pid)
{
- return QProcessPrivate::startDetached(program,
- arguments,
- workingDirectory,
- pid);
+ QProcess process;
+ process.setProgram(program);
+ process.setArguments(arguments);
+ process.setWorkingDirectory(workingDirectory);
+ return process.startDetached(pid);
}
/*!
@@ -2486,11 +2533,14 @@ bool QProcess::startDetached(const QString &program,
bool QProcess::startDetached(const QString &program,
const QStringList &arguments)
{
- return QProcessPrivate::startDetached(program, arguments);
+ QProcess process;
+ process.setProgram(program);
+ process.setArguments(arguments);
+ return process.startDetached();
}
/*!
- \overload
+ \overload startDetached()
Starts the command \a command in a new process, and detaches from it.
Returns \c true on success; otherwise returns \c false.
@@ -2508,9 +2558,10 @@ bool QProcess::startDetached(const QString &command)
if (args.isEmpty())
return false;
- const QString prog = args.takeFirst();
-
- return QProcessPrivate::startDetached(prog, args);
+ QProcess process;
+ process.setProgram(args.takeFirst());
+ process.setArguments(args);
+ return process.startDetached();
}
QT_BEGIN_INCLUDE_NAMESPACE
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index 19157bdd02..c8aef2f0b1 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -163,6 +163,7 @@ public:
void start(const QString &command, OpenMode mode = ReadWrite);
#endif
void start(OpenMode mode = ReadWrite);
+ bool startDetached(qint64 *pid = nullptr);
bool open(OpenMode mode = ReadWrite) Q_DECL_OVERRIDE;
QString program() const;
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index c5abf7b762..deb29dca0a 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -350,7 +350,7 @@ public:
void start(QIODevice::OpenMode mode);
void startProcess();
#if defined(Q_OS_UNIX)
- void execChild(const char *workingDirectory, char **path, char **argv, char **envp);
+ void execChild(const char *workingDirectory, char **argv, char **envp);
#endif
bool processStarted(QString *errorMessage = Q_NULLPTR);
void terminateProcess();
@@ -360,13 +360,13 @@ public:
bool waitForDeadChild();
#endif
#ifdef Q_OS_WIN
+ bool callCreateProcess(QProcess::CreateProcessArguments *cpargs);
bool drainOutputPipes();
void flushPipeWriter();
qint64 pipeWriterBytesToWrite() const;
#endif
- static bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory = QString(),
- qint64 *pid = 0);
+ bool startDetached(qint64 *pPid);
int exitCode;
QProcess::ExitStatus exitStatus;
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 318c633017..15752f84b2 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -87,6 +87,7 @@ QT_END_NAMESPACE
#include "qprocess.h"
#include "qprocess_p.h"
+#include "qstandardpaths.h"
#include "private/qcore_unix_p.h"
#ifdef Q_OS_MAC
@@ -420,8 +421,16 @@ void QProcessPrivate::startProcess()
#endif
// Add the program name to the argument list.
- char *dupProgramName = ::strdup(encodedProgramName.constData());
- argv[0] = dupProgramName;
+ argv[0] = nullptr;
+ if (!program.contains(QLatin1Char('/'))) {
+ const QString &exeFilePath = QStandardPaths::findExecutable(program);
+ if (!exeFilePath.isEmpty()) {
+ const QByteArray &tmp = QFile::encodeName(exeFilePath);
+ argv[0] = ::strdup(tmp.constData());
+ }
+ }
+ if (!argv[0])
+ argv[0] = ::strdup(encodedProgramName.constData());
// Add every argument to the list
for (int i = 0; i < arguments.count(); ++i)
@@ -443,29 +452,6 @@ void QProcessPrivate::startProcess()
workingDirPtr = encodedWorkingDirectory.constData();
}
- // If the program does not specify a path, generate a list of possible
- // locations for the binary using the PATH environment variable.
- char **path = 0;
- int pathc = 0;
- if (!program.contains(QLatin1Char('/'))) {
- const QString pathEnv = QString::fromLocal8Bit(qgetenv("PATH"));
- if (!pathEnv.isEmpty()) {
- QStringList pathEntries = pathEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);
- if (!pathEntries.isEmpty()) {
- pathc = pathEntries.size();
- path = new char *[pathc + 1];
- path[pathc] = 0;
-
- for (int k = 0; k < pathEntries.size(); ++k) {
- QByteArray tmp = QFile::encodeName(pathEntries.at(k));
- if (!tmp.endsWith('/')) tmp += '/';
- tmp += encodedProgramName;
- path[k] = ::strdup(tmp.constData());
- }
- }
- }
- }
-
// Start the process manager, and fork off the child process.
pid_t childPid;
forkfd = ::forkfd(FFD_CLOEXEC, &childPid);
@@ -473,16 +459,12 @@ void QProcessPrivate::startProcess()
if (forkfd != FFD_CHILD_PROCESS) {
// Parent process.
// Clean up duplicated memory.
- free(dupProgramName);
- for (int i = 1; i <= arguments.count(); ++i)
+ for (int i = 0; i <= arguments.count(); ++i)
free(argv[i]);
for (int i = 0; i < envc; ++i)
free(envp[i]);
- for (int i = 0; i < pathc; ++i)
- free(path[i]);
delete [] argv;
delete [] envp;
- delete [] path;
}
// On QNX, if spawnChild failed, childPid will be -1 but forkfd is still 0.
@@ -503,7 +485,7 @@ void QProcessPrivate::startProcess()
// Start the child.
if (forkfd == FFD_CHILD_PROCESS) {
- execChild(workingDirPtr, path, argv, envp);
+ execChild(workingDirPtr, argv, envp);
::_exit(-1);
}
@@ -550,7 +532,7 @@ struct ChildError
char function[8];
};
-void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv, char **envp)
+void QProcessPrivate::execChild(const char *workingDir, char **argv, char **envp)
{
::signal(SIGPIPE, SIG_DFL); // reset the signal that we ignored
@@ -574,7 +556,7 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv
}
}
- // make sure this fd is closed if execvp() succeeds
+ // make sure this fd is closed if execv() succeeds
qt_safe_close(childStartedPipe[0]);
// enter the working directory
@@ -589,25 +571,13 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv
// execute the process
if (!envp) {
- qt_safe_execvp(argv[0], argv);
+ qt_safe_execv(argv[0], argv);
strcpy(error.function, "execvp");
} else {
- if (path) {
- char **arg = path;
- while (*arg) {
- argv[0] = *arg;
#if defined (QPROCESS_DEBUG)
- fprintf(stderr, "QProcessPrivate::execChild() searching / starting %s\n", argv[0]);
+ fprintf(stderr, "QProcessPrivate::execChild() starting %s\n", argv[0]);
#endif
- qt_safe_execve(argv[0], argv, envp);
- ++arg;
- }
- } else {
-#if defined (QPROCESS_DEBUG)
- fprintf(stderr, "QProcessPrivate::execChild() starting %s\n", argv[0]);
-#endif
- qt_safe_execve(argv[0], argv, envp);
- }
+ qt_safe_execve(argv[0], argv, envp);
strcpy(error.function, "execve");
}
@@ -933,7 +903,7 @@ bool QProcessPrivate::waitForDeadChild()
return true;
}
-bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
+bool QProcessPrivate::startDetached(qint64 *pid)
{
QByteArray encodedWorkingDirectory = QFile::encodeName(workingDirectory);
@@ -949,6 +919,17 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
return false;
}
+ if ((stdinChannel.type == Channel::Redirect && !openChannel(stdinChannel))
+ || (stdoutChannel.type == Channel::Redirect && !openChannel(stdoutChannel))
+ || (stderrChannel.type == Channel::Redirect && !openChannel(stderrChannel))) {
+ closeChannel(&stdinChannel);
+ closeChannel(&stdoutChannel);
+ closeChannel(&stderrChannel);
+ qt_safe_close(startedPipe[0]);
+ qt_safe_close(startedPipe[1]);
+ return false;
+ }
+
pid_t childPid = fork();
if (childPid == 0) {
struct sigaction noaction;
@@ -965,6 +946,18 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
if (doubleForkPid == 0) {
qt_safe_close(pidPipe[1]);
+ // copy the stdin socket if asked to (without closing on exec)
+ if (inputChannelMode != QProcess::ForwardedInputChannel)
+ qt_safe_dup2(stdinChannel.pipe[0], STDIN_FILENO, 0);
+
+ // copy the stdout and stderr if asked to
+ if (processChannelMode != QProcess::ForwardedChannels) {
+ if (processChannelMode != QProcess::ForwardedOutputChannel)
+ qt_safe_dup2(stdoutChannel.pipe[1], STDOUT_FILENO, 0);
+ if (processChannelMode != QProcess::ForwardedErrorChannel)
+ qt_safe_dup2(stderrChannel.pipe[1], STDERR_FILENO, 0);
+ }
+
if (!encodedWorkingDirectory.isEmpty()) {
if (QT_CHDIR(encodedWorkingDirectory.constData()) == -1)
qWarning("QProcessPrivate::startDetached: failed to chdir to %s", encodedWorkingDirectory.constData());
@@ -975,23 +968,28 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
argv[i + 1] = ::strdup(QFile::encodeName(arguments.at(i)).constData());
argv[arguments.size() + 1] = 0;
+ // Duplicate the environment.
+ int envc = 0;
+ char **envp = nullptr;
+ if (environment.d.constData()) {
+ QProcessEnvironmentPrivate::MutexLocker locker(environment.d);
+ envp = _q_dupEnvironment(environment.d.constData()->vars, &envc);
+ }
+
+ QByteArray tmp;
if (!program.contains(QLatin1Char('/'))) {
- const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
- if (!path.isEmpty()) {
- QStringList pathEntries = path.split(QLatin1Char(':'));
- for (int k = 0; k < pathEntries.size(); ++k) {
- QByteArray tmp = QFile::encodeName(pathEntries.at(k));
- if (!tmp.endsWith('/')) tmp += '/';
- tmp += QFile::encodeName(program);
- argv[0] = tmp.data();
- qt_safe_execv(argv[0], argv);
- }
- }
- } else {
- QByteArray tmp = QFile::encodeName(program);
- argv[0] = tmp.data();
- qt_safe_execv(argv[0], argv);
+ const QString &exeFilePath = QStandardPaths::findExecutable(program);
+ if (!exeFilePath.isEmpty())
+ tmp = QFile::encodeName(exeFilePath);
}
+ if (tmp.isEmpty())
+ tmp = QFile::encodeName(program);
+ argv[0] = tmp.data();
+
+ if (envp)
+ qt_safe_execve(argv[0], argv, envp);
+ else
+ qt_safe_execv(argv[0], argv);
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
@@ -1021,6 +1019,9 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
::_exit(1);
}
+ closeChannel(&stdinChannel);
+ closeChannel(&stdoutChannel);
+ closeChannel(&stderrChannel);
qt_safe_close(startedPipe[1]);
qt_safe_close(pidPipe[1]);
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 05c9d6594c..2bbc4eddd0 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -358,7 +358,8 @@ void QProcessPrivate::closeChannel(Channel *channel)
destroyPipe(channel->pipe);
}
-static QString qt_create_commandline(const QString &program, const QStringList &arguments)
+static QString qt_create_commandline(const QString &program, const QStringList &arguments,
+ const QString &nativeArguments)
{
QString args;
if (!program.isEmpty()) {
@@ -387,6 +388,13 @@ static QString qt_create_commandline(const QString &program, const QStringList &
}
args += QLatin1Char(' ') + tmp;
}
+
+ if (!nativeArguments.isEmpty()) {
+ if (!args.isEmpty())
+ args += QLatin1Char(' ');
+ args += nativeArguments;
+ }
+
return args;
}
@@ -450,6 +458,30 @@ static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Map &e
return envlist;
}
+bool QProcessPrivate::callCreateProcess(QProcess::CreateProcessArguments *cpargs)
+{
+ if (modifyCreateProcessArgs)
+ modifyCreateProcessArgs(cpargs);
+ bool success = CreateProcess(cpargs->applicationName, cpargs->arguments,
+ cpargs->processAttributes, cpargs->threadAttributes,
+ cpargs->inheritHandles, cpargs->flags, cpargs->environment,
+ cpargs->currentDirectory, cpargs->startupInfo,
+ cpargs->processInformation);
+ if (stdinChannel.pipe[0] != INVALID_Q_PIPE) {
+ CloseHandle(stdinChannel.pipe[0]);
+ stdinChannel.pipe[0] = INVALID_Q_PIPE;
+ }
+ if (stdoutChannel.pipe[1] != INVALID_Q_PIPE) {
+ CloseHandle(stdoutChannel.pipe[1]);
+ stdoutChannel.pipe[1] = INVALID_Q_PIPE;
+ }
+ if (stderrChannel.pipe[1] != INVALID_Q_PIPE) {
+ CloseHandle(stderrChannel.pipe[1]);
+ stderrChannel.pipe[1] = INVALID_Q_PIPE;
+ }
+ return success;
+}
+
void QProcessPrivate::startProcess()
{
Q_Q(QProcess);
@@ -472,15 +504,10 @@ void QProcessPrivate::startProcess()
!openChannel(stderrChannel))
return;
- QString args = qt_create_commandline(program, arguments);
+ const QString args = qt_create_commandline(program, arguments, nativeArguments);
QByteArray envlist;
if (environment.d.constData())
envlist = qt_create_environment(environment.d.constData()->vars);
- if (!nativeArguments.isEmpty()) {
- if (!args.isEmpty())
- args += QLatin1Char(' ');
- args += nativeArguments;
- }
#if defined QPROCESS_DEBUG
qDebug("Creating process");
@@ -507,18 +534,14 @@ void QProcessPrivate::startProcess()
const QString nativeWorkingDirectory = QDir::toNativeSeparators(workingDirectory);
QProcess::CreateProcessArguments cpargs = {
- 0, (wchar_t*)args.utf16(),
- 0, 0, TRUE, dwCreationFlags,
- environment.isEmpty() ? 0 : envlist.data(),
- nativeWorkingDirectory.isEmpty() ? Q_NULLPTR : (wchar_t*)nativeWorkingDirectory.utf16(),
+ nullptr, reinterpret_cast<wchar_t *>(const_cast<ushort *>(args.utf16())),
+ nullptr, nullptr, true, dwCreationFlags,
+ environment.isEmpty() ? nullptr : envlist.data(),
+ nativeWorkingDirectory.isEmpty()
+ ? nullptr : reinterpret_cast<const wchar_t *>(nativeWorkingDirectory.utf16()),
&startupInfo, pid
};
- if (modifyCreateProcessArgs)
- modifyCreateProcessArgs(&cpargs);
- success = CreateProcess(cpargs.applicationName, cpargs.arguments, cpargs.processAttributes,
- cpargs.threadAttributes, cpargs.inheritHandles, cpargs.flags,
- cpargs.environment, cpargs.currentDirectory, cpargs.startupInfo,
- cpargs.processInformation);
+ success = callCreateProcess(&cpargs);
QString errorString;
if (!success) {
@@ -526,19 +549,6 @@ void QProcessPrivate::startProcess()
errorString = QProcess::tr("Process failed to start: %1").arg(qt_error_string());
}
- if (stdinChannel.pipe[0] != INVALID_Q_PIPE) {
- CloseHandle(stdinChannel.pipe[0]);
- stdinChannel.pipe[0] = INVALID_Q_PIPE;
- }
- if (stdoutChannel.pipe[1] != INVALID_Q_PIPE) {
- CloseHandle(stdoutChannel.pipe[1]);
- stdoutChannel.pipe[1] = INVALID_Q_PIPE;
- }
- if (stderrChannel.pipe[1] != INVALID_Q_PIPE) {
- CloseHandle(stderrChannel.pipe[1]);
- stderrChannel.pipe[1] = INVALID_Q_PIPE;
- }
-
if (!success) {
cleanup();
setErrorAndEmit(QProcess::FailedToStart, errorString);
@@ -826,6 +836,7 @@ bool QProcessPrivate::writeToStdin()
// Use ShellExecuteEx() to trigger an UAC prompt when CreateProcess()fails
// with ERROR_ELEVATION_REQUIRED.
static bool startDetachedUacPrompt(const QString &programIn, const QStringList &arguments,
+ const QString &nativeArguments,
const QString &workingDir, qint64 *pid)
{
typedef BOOL (WINAPI *ShellExecuteExType)(SHELLEXECUTEINFOW *);
@@ -836,7 +847,8 @@ static bool startDetachedUacPrompt(const QString &programIn, const QStringList &
if (!shellExecuteEx)
return false;
- const QString args = qt_create_commandline(QString(), arguments); // needs arguments only
+ const QString args = qt_create_commandline(QString(), // needs arguments only
+ arguments, nativeArguments);
SHELLEXECUTEINFOW shellExecuteExInfo;
memset(&shellExecuteExInfo, 0, sizeof(SHELLEXECUTEINFOW));
shellExecuteExInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
@@ -859,25 +871,52 @@ static bool startDetachedUacPrompt(const QString &programIn, const QStringList &
return true;
}
-bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDir, qint64 *pid)
+bool QProcessPrivate::startDetached(qint64 *pid)
{
static const DWORD errorElevationRequired = 740;
- QString args = qt_create_commandline(program, arguments);
+ if ((stdinChannel.type == Channel::Redirect && !openChannel(stdinChannel))
+ || (stdoutChannel.type == Channel::Redirect && !openChannel(stdoutChannel))
+ || (stderrChannel.type == Channel::Redirect && !openChannel(stderrChannel))) {
+ closeChannel(&stdinChannel);
+ closeChannel(&stdoutChannel);
+ closeChannel(&stderrChannel);
+ return false;
+ }
+
+ QString args = qt_create_commandline(program, arguments, nativeArguments);
bool success = false;
PROCESS_INFORMATION pinfo;
+ void *envPtr = nullptr;
+ QByteArray envlist;
+ if (environment.d.constData()) {
+ envlist = qt_create_environment(environment.d.constData()->vars);
+ envPtr = envlist.data();
+ }
+
DWORD dwCreationFlags = (GetConsoleWindow() ? 0 : CREATE_NO_WINDOW);
dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT;
STARTUPINFOW startupInfo = { sizeof( STARTUPINFO ), 0, 0, 0,
(ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
(ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0,
+ STARTF_USESTDHANDLES,
+ 0, 0, 0,
+ stdinChannel.pipe[0], stdoutChannel.pipe[1], stderrChannel.pipe[1]
};
- success = CreateProcess(0, (wchar_t*)args.utf16(),
- 0, 0, FALSE, dwCreationFlags, 0,
- workingDir.isEmpty() ? 0 : (wchar_t*)workingDir.utf16(),
- &startupInfo, &pinfo);
+
+ const bool inheritHandles = stdinChannel.type == Channel::Redirect
+ || stdoutChannel.type == Channel::Redirect
+ || stderrChannel.type == Channel::Redirect;
+ QProcess::CreateProcessArguments cpargs = {
+ nullptr, reinterpret_cast<wchar_t *>(const_cast<ushort *>(args.utf16())),
+ nullptr, nullptr, inheritHandles, dwCreationFlags, envPtr,
+ workingDirectory.isEmpty()
+ ? nullptr : reinterpret_cast<const wchar_t *>(workingDirectory.utf16()),
+ &startupInfo, &pinfo
+ };
+ success = callCreateProcess(&cpargs);
if (success) {
CloseHandle(pinfo.hThread);
@@ -885,9 +924,19 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
if (pid)
*pid = pinfo.dwProcessId;
} else if (GetLastError() == errorElevationRequired) {
- success = startDetachedUacPrompt(program, arguments, workingDir, pid);
+ if (envPtr)
+ qWarning("QProcess: custom environment will be ignored for detached elevated process.");
+ if (!stdinChannel.file.isEmpty() || !stdoutChannel.file.isEmpty()
+ || !stderrChannel.file.isEmpty()) {
+ qWarning("QProcess: file redirection is unsupported for detached elevated processes.");
+ }
+ success = startDetachedUacPrompt(program, arguments, nativeArguments,
+ workingDirectory, pid);
}
+ closeChannel(&stdinChannel);
+ closeChannel(&stdoutChannel);
+ closeChannel(&stderrChannel);
return success;
}
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 4e7120a3b8..c1187e5145 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -67,10 +67,9 @@ QT_BEGIN_NAMESPACE
class QStringSplitter
{
public:
- QStringSplitter(const QString &s)
- : m_string(s), m_data(m_string.constData()), m_len(s.length()), m_pos(0)
+ explicit QStringSplitter(QStringView sv)
+ : m_data(sv.data()), m_len(sv.size())
{
- m_splitChar = QLatin1Char('/');
}
inline bool hasNext() {
@@ -79,18 +78,17 @@ public:
return m_pos < m_len;
}
- inline QStringRef next() {
+ inline QStringView next() {
int start = m_pos;
while (m_pos < m_len && m_data[m_pos] != m_splitChar)
++m_pos;
- return QStringRef(&m_string, start, m_pos - start);
+ return QStringView(m_data + start, m_pos - start);
}
- QString m_string;
const QChar *m_data;
- QChar m_splitChar;
- int m_len;
- int m_pos;
+ qssize_t m_len;
+ qssize_t m_pos = 0;
+ QChar m_splitChar = QLatin1Char('/');
};
@@ -679,7 +677,7 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
QStringSplitter splitter(path);
while (child_count && splitter.hasNext()) {
- QStringRef segment = splitter.next();
+ QStringView segment = splitter.next();
#ifdef DEBUG_RESOURCE_MATCH
qDebug() << " CHILDREN" << segment;
@@ -836,24 +834,24 @@ QStringList QResourceRoot::children(int node) const
bool QResourceRoot::mappingRootSubdir(const QString &path, QString *match) const
{
const QString root = mappingRoot();
- if(!root.isEmpty()) {
- const QVector<QStringRef> root_segments = root.splitRef(QLatin1Char('/'), QString::SkipEmptyParts),
- path_segments = path.splitRef(QLatin1Char('/'), QString::SkipEmptyParts);
- if(path_segments.size() <= root_segments.size()) {
- int matched = 0;
- for(int i = 0; i < path_segments.size(); ++i) {
- if(root_segments[i] != path_segments[i])
- break;
- ++matched;
- }
- if(matched == path_segments.size()) {
- if(match && root_segments.size() > matched)
- *match = root_segments.at(matched).toString();
- return true;
- }
+ if (root.isEmpty())
+ return false;
+
+ QStringSplitter rootIt(root);
+ QStringSplitter pathIt(path);
+ while (rootIt.hasNext()) {
+ if (pathIt.hasNext()) {
+ if (rootIt.next() != pathIt.next()) // mismatch
+ return false;
+ } else {
+ // end of path, but not of root:
+ if (match)
+ *match = rootIt.next().toString();
+ return true;
}
}
- return false;
+ // end of root
+ return !pathIt.hasNext();
}
Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index 3f45ca5f91..63f2284ef5 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -231,7 +231,38 @@ bool QSaveFile::open(OpenMode mode)
d->finalFileName = existingFile.filePath();
}
- d->fileEngine = new QTemporaryFileEngine;
+ auto openDirectly = [&]() {
+ d->fileEngine = QAbstractFileEngine::create(d->finalFileName);
+ if (d->fileEngine->open(mode | QIODevice::Unbuffered)) {
+ d->useTemporaryFile = false;
+ QFileDevice::open(mode);
+ return true;
+ }
+ return false;
+ };
+
+#ifdef Q_OS_WIN
+ // check if it is an Alternate Data Stream
+ if (d->finalFileName == d->fileName && d->fileName.indexOf(QLatin1Char(':'), 2) > 1) {
+ // yes, we can't rename onto it...
+ if (d->directWriteFallback) {
+ if (openDirectly())
+ return true;
+ d->setError(d->fileEngine->error(), d->fileEngine->errorString());
+ delete d->fileEngine;
+ d->fileEngine = 0;
+ } else {
+ QString msg =
+ QSaveFile::tr("QSaveFile cannot open '%1' without direct write fallback "
+ "enabled: path contains an Alternate Data Stream specifier")
+ .arg(QDir::toNativeSeparators(d->fileName));
+ d->setError(QFileDevice::OpenError, msg);
+ }
+ return false;
+ }
+#endif
+
+ d->fileEngine = new QTemporaryFileEngine(&d->finalFileName);
// 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
@@ -243,12 +274,8 @@ bool QSaveFile::open(OpenMode mode)
#ifdef Q_OS_UNIX
if (d->directWriteFallback && err == QFileDevice::OpenError && errno == EACCES) {
delete d->fileEngine;
- d->fileEngine = QAbstractFileEngine::create(d->finalFileName);
- if (d->fileEngine->open(mode | QIODevice::Unbuffered)) {
- d->useTemporaryFile = false;
- QFileDevice::open(mode);
+ if (openDirectly())
return true;
- }
err = d->fileEngine->error();
}
#endif
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index d5460238ec..d0cbc82c56 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1405,6 +1405,11 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
return;
}
+ if (!readOnly && !confFile->isWritable()) {
+ setStatus(QSettings::AccessError);
+ return;
+ }
+
#ifndef QT_BOOTSTRAPPED
/*
Use a lockfile in order to protect us against other QSettings instances
@@ -1414,17 +1419,11 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
Concurrent read and write are not a problem because the writing operation is atomic.
*/
QLockFile lockFile(confFile->name + QLatin1String(".lock"));
-#endif
- if (!readOnly) {
- if (!confFile->isWritable()
-#ifndef QT_BOOTSTRAPPED
- || !lockFile.lock()
-#endif
- ) {
- setStatus(QSettings::AccessError);
- return;
- }
+ if (!readOnly && !lockFile.lock() && atomicSyncOnly) {
+ setStatus(QSettings::AccessError);
+ return;
}
+#endif
/*
We hold the lock. Let's reread the file if it has changed
@@ -1496,6 +1495,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
QSaveFile sf(confFile->name);
+ sf.setDirectWriteFallback(!atomicSyncOnly);
#else
QFile sf(confFile->name);
#endif
@@ -1802,6 +1802,8 @@ struct QSettingsIniSection
inline QSettingsIniSection() : position(-1) {}
};
+Q_DECLARE_TYPEINFO(QSettingsIniSection, Q_MOVABLE_TYPE);
+
typedef QMap<QString, QSettingsIniSection> IniMap;
/*
@@ -2199,10 +2201,16 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
QSettings can safely be used from different processes (which can
be different instances of your application running at the same
time or different applications altogether) to read and write to
- the same system locations. It uses advisory file locking and a
- smart merging algorithm to ensure data integrity. Note that sync()
- imports changes made by other processes (in addition to writing
- the changes from this QSettings).
+ the same system locations, provided certain conditions are met. For
+ QSettings::IniFormat, it uses advisory file locking and a smart merging
+ algorithm to ensure data integrity. The condition for that to work is that
+ the writeable configuration file must be a regular file and must reside in
+ a directory that the current user can create new, temporary files in. If
+ that is not the case, then one must use setAtomicSyncRequired() to turn the
+ safety off.
+
+ Note that sync() imports changes made by other processes (in addition to
+ writing the changes from this QSettings).
\section1 Platform-Specific Notes
@@ -2883,6 +2891,50 @@ QSettings::Status QSettings::status() const
}
/*!
+ \since 5.10
+
+ Returns \c true if QSettings is only allowed to perform atomic saving and
+ reloading (synchronization) of the settings. Returns \c false if it is
+ allowed to save the settings contents directly to the configuration file.
+
+ The default is \c true.
+
+ \sa setAtomicSyncRequired(), QSaveFile
+*/
+bool QSettings::isAtomicSyncRequired() const
+{
+ Q_D(const QSettings);
+ return d->atomicSyncOnly;
+}
+
+/*!
+ \since 5.10
+
+ Configures whether QSettings is required to perform atomic saving and
+ reloading (synchronization) of the settings. If the \a enable argument is
+ \c true (the default), sync() will only perform synchronization operations
+ that are atomic. If this is not possible, sync() will fail and status()
+ will be an error condition.
+
+ Setting this property to \c false will allow QSettings to write directly to
+ the configuration file and ignore any errors trying to lock it against
+ other processes trying to write at the same time. Because of the potential
+ for corruption, this option should be used with care, but is required in
+ certain conditions, like a QSettings::IniFormat configuration file that
+ exists in an otherwise non-writeable directory or NTFS Alternate Data
+ Streams.
+
+ See \l QSaveFile for more information on the feature.
+
+ \sa isAtomicSyncRequired(), QSaveFile
+*/
+void QSettings::setAtomicSyncRequired(bool enable)
+{
+ Q_D(QSettings);
+ d->atomicSyncOnly = enable;
+}
+
+/*!
Appends \a prefix to the current group.
The current group is automatically prepended to all keys
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index edd59026ed..da5502e5ca 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -146,6 +146,8 @@ public:
void clear();
void sync();
Status status() const;
+ bool isAtomicSyncRequired() const;
+ void setAtomicSyncRequired(bool enable);
void beginGroup(const QString &prefix);
void endGroup();
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index 639605d8c4..7923c24770 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -109,6 +109,8 @@ private:
};
#endif
+Q_DECLARE_TYPEINFO(QSettingsKey, Q_MOVABLE_TYPE);
+
typedef QMap<QSettingsKey, QByteArray> UnparsedSettingsMap;
typedef QMap<QSettingsKey, QVariant> ParsedSettingsMap;
@@ -247,6 +249,7 @@ protected:
QString groupPrefix;
bool fallbacks;
bool pendingChanges;
+ bool atomicSyncOnly = true;
mutable QSettings::Status status;
};
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index f2368c3b23..c3d45caf0e 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -183,7 +183,7 @@ QT_BEGIN_NAMESPACE
\li "C:/Users/<USER>"
\row \li DataLocation
\li "~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"
- \li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"
+ \li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data", "<APPDIR>/data/<APPNAME>"
\row \li CacheLocation
\li "~/Library/Caches/<APPNAME>", "/Library/Caches/<APPNAME>"
\li "C:/Users/<USER>/AppData/Local/<APPNAME>/cache"
@@ -207,10 +207,10 @@ QT_BEGIN_NAMESPACE
\li "C:/Users/<USER>/AppData/Local/cache"
\row \li AppDataLocation
\li "~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"
- \li "C:/Users/<USER>/AppData/Roaming/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"
+ \li "C:/Users/<USER>/AppData/Roaming/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data", "<APPDIR>/data/<APPNAME>"
\row \li AppLocalDataLocation
\li "~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"
- \li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"
+ \li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data", "<APPDIR>/data/<APPNAME>"
\row \li AppConfigLocation
\li "~/Library/Preferences/<APPNAME>"
\li "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>"
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index f0ff46fe7f..d06778e2a1 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -42,6 +42,7 @@
#include <qfile.h>
#include <qhash.h>
#include <qtextstream.h>
+#include <qregularexpression.h>
#include <private/qfilesystemengine_p.h>
#include <errno.h>
#include <stdlib.h>
@@ -179,11 +180,12 @@ QString QStandardPaths::writableLocation(StandardLocation type)
QHash<QString, QString> lines;
QTextStream stream(&file);
// Only look for lines like: XDG_DESKTOP_DIR="$HOME/Desktop"
- QRegExp exp(QLatin1String("^XDG_(.*)_DIR=(.*)$"));
+ QRegularExpression exp(QLatin1String("^XDG_(.*)_DIR=(.*)$"));
while (!stream.atEnd()) {
const QString &line = stream.readLine();
- if (exp.indexIn(line) != -1) {
- const QStringList lst = exp.capturedTexts();
+ 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 (value.length() > 2
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index a64bde6fb4..41fd31df8b 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -218,7 +218,15 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
}
#ifndef QT_BOOTSTRAPPED
dirs.append(QCoreApplication::applicationDirPath());
- dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/data"));
+ const QString dataDir = QCoreApplication::applicationDirPath() + QLatin1String("/data");
+ dirs.append(dataDir);
+
+ if (!isGenericConfigLocation(type)) {
+ QString appDataDir = dataDir;
+ appendOrganizationAndApp(appDataDir);
+ if (appDataDir != dataDir)
+ dirs.append(appDataDir);
+ }
#endif // !QT_BOOTSTRAPPED
} // isConfigLocation()
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp
index 27f0552a31..e2c1f0232f 100644
--- a/src/corelib/io/qstorageinfo.cpp
+++ b/src/corelib/io/qstorageinfo.cpp
@@ -40,6 +40,8 @@
#include "qstorageinfo.h"
#include "qstorageinfo_p.h"
+#include "qdebug.h"
+
QT_BEGIN_NAMESPACE
/*!
@@ -431,4 +433,37 @@ QStorageInfo QStorageInfo::root()
volume than the \a second; otherwise returns false.
*/
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QStorageInfo &s)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug.noquote();
+ debug << "QStorageInfo(";
+ if (s.isValid()) {
+ const QStorageInfoPrivate *d = s.d.constData();
+ debug << '"' << d->rootPath << '"';
+ if (!d->fileSystemType.isEmpty())
+ debug << ", type=" << d->fileSystemType;
+ if (!d->name.isEmpty())
+ debug << ", name=\"" << d->name << '"';
+ if (!d->device.isEmpty())
+ debug << ", device=\"" << d->device << '"';
+ if (!d->subvolume.isEmpty())
+ debug << ", subvolume=\"" << d->subvolume << '"';
+ if (d->readOnly)
+ debug << " [read only]";
+ debug << (d->ready ? " [ready]" : " [not ready]");
+ if (d->bytesTotal > 0) {
+ debug << ", bytesTotal=" << d->bytesTotal << ", bytesFree=" << d->bytesFree
+ << ", bytesAvailable=" << d->bytesAvailable;
+ }
+ } else {
+ debug << "invalid";
+ }
+ debug<< ')';
+ return debug;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
QT_END_NAMESPACE
diff --git a/src/corelib/io/qstorageinfo.h b/src/corelib/io/qstorageinfo.h
index e2d9747ceb..4ab7a353ef 100644
--- a/src/corelib/io/qstorageinfo.h
+++ b/src/corelib/io/qstorageinfo.h
@@ -49,6 +49,8 @@
QT_BEGIN_NAMESPACE
+class QDebug;
+
class QStorageInfoPrivate;
class Q_CORE_EXPORT QStorageInfo
{
@@ -94,6 +96,7 @@ public:
private:
friend class QStorageInfoPrivate;
friend bool operator==(const QStorageInfo &first, const QStorageInfo &second);
+ friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QStorageInfo &);
QExplicitlySharedDataPointer<QStorageInfoPrivate> d;
};
@@ -114,6 +117,10 @@ inline bool QStorageInfo::isRoot() const
Q_DECLARE_SHARED(QStorageInfo)
+#ifndef QT_NO_DEBUG_STREAM
+Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QStorageInfo &);
+#endif
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QStorageInfo)
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index ffaee9c683..2779246c5b 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -44,22 +44,15 @@
#include "qdiriterator.h"
#include "qplatformdefs.h"
+#include "private/qtemporaryfile_p.h"
#include <QDebug>
#include <QPair>
+#include <QRandomGenerator>
#if defined(QT_BUILD_CORE_LIB)
#include "qcoreapplication.h"
#endif
-#if !defined(Q_OS_QNX) && !defined(Q_OS_WIN) && !defined(Q_OS_ANDROID) && !defined(Q_OS_INTEGRITY)
-# define USE_SYSTEM_MKDTEMP
-#endif
-
-#include <stdlib.h> // mkdtemp
-#ifndef USE_SYSTEM_MKDTEMP
-#include <private/qfilesystemengine_p.h>
-#endif
-
#if !defined(Q_OS_WIN)
#include <errno.h>
#endif
@@ -102,38 +95,12 @@ static QString defaultTemplateName()
return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX");
}
-#ifndef USE_SYSTEM_MKDTEMP
-static int nextRand(int &v)
-{
- int r = v % 62;
- v /= 62;
- if (v < 62)
- v = qrand();
- return r;
-}
-
-QPair<QString, bool> q_mkdtemp(QString templateName)
+void QTemporaryDirPrivate::create(const QString &templateName)
{
- Q_ASSERT(templateName.endsWith(QLatin1String("XXXXXX")));
-
- static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
-
- const int length = templateName.size();
-
- QChar *XXXXXX = templateName.data() + length - 6;
-
+ QTemporaryFileName tfn(templateName);
for (int i = 0; i < 256; ++i) {
- int v = qrand();
-
- /* Fill in the random bits. */
- XXXXXX[0] = QLatin1Char(letters[nextRand(v)]);
- XXXXXX[1] = QLatin1Char(letters[nextRand(v)]);
- XXXXXX[2] = QLatin1Char(letters[nextRand(v)]);
- XXXXXX[3] = QLatin1Char(letters[nextRand(v)]);
- XXXXXX[4] = QLatin1Char(letters[nextRand(v)]);
- XXXXXX[5] = QLatin1Char(letters[v % 62]);
-
- QFileSystemEntry fileSystemEntry(templateName);
+ tfn.generateNext();
+ QFileSystemEntry fileSystemEntry(tfn.path, QFileSystemEntry::FromNativePath());
if (QFileSystemEngine::createDirectory(fileSystemEntry, false)) {
QSystemError error;
QFileSystemEngine::setPermissions(fileSystemEntry,
@@ -145,7 +112,9 @@ QPair<QString, bool> q_mkdtemp(QString templateName)
qWarning() << "Unable to remove unused directory" << templateName;
continue;
}
- return qMakePair(templateName, true);
+ success = true;
+ pathOrError = fileSystemEntry.filePath();
+ return;
}
# ifdef Q_OS_WIN
const int exists = ERROR_ALREADY_EXISTS;
@@ -155,36 +124,10 @@ QPair<QString, bool> q_mkdtemp(QString templateName)
int code = errno;
# endif
if (code != exists)
- return qMakePair(qt_error_string(code), false);
+ break;
}
- return qMakePair(qt_error_string(), false);
-}
-
-#else // !USE_SYSTEM_MKDTEMP
-
-QPair<QString, bool> q_mkdtemp(char *templateName)
-{
- bool ok = (mkdtemp(templateName) != 0);
- return qMakePair(ok ? QFile::decodeName(templateName) : qt_error_string(), ok);
-}
-
-#endif // USE_SYSTEM_MKDTEMP
-
-void QTemporaryDirPrivate::create(const QString &templateName)
-{
-#ifndef USE_SYSTEM_MKDTEMP
- QString buffer = templateName;
- if (!buffer.endsWith(QLatin1String("XXXXXX")))
- buffer += QLatin1String("XXXXXX");
- const QPair<QString, bool> result = q_mkdtemp(buffer);
-#else // !USE_SYSTEM_MKDTEMP
- QByteArray buffer = QFile::encodeName(templateName);
- if (!buffer.endsWith("XXXXXX"))
- buffer += "XXXXXX";
- QPair<QString, bool> result = q_mkdtemp(buffer.data()); // modifies buffer
-#endif // USE_SYSTEM_MKDTEMP
- pathOrError = result.first;
- success = result.second;
+ pathOrError = qt_error_string();
+ success = false;
}
//************* QTemporaryDir
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 8a99873fee..3ecc24a5db 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -39,9 +40,8 @@
#include "qtemporaryfile.h"
-#ifndef QT_NO_TEMPORARYFILE
-
#include "qplatformdefs.h"
+#include "qrandom.h"
#include "private/qtemporaryfile_p.h"
#include "private/qfile_p.h"
#include "private/qsystemerror_p.h"
@@ -53,6 +53,8 @@
#if defined(QT_BUILD_CORE_LIB)
#include "qcoreapplication.h"
+#else
+#define tr(X) QString::fromLatin1(X)
#endif
QT_BEGIN_NAMESPACE
@@ -73,82 +75,145 @@ typedef char Latin1Char;
typedef int NativeFileHandle;
#endif
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
+QTemporaryFileName::QTemporaryFileName(const QString &templateName)
+{
+ // Ensure there is a placeholder mask
+ QString qfilename = templateName;
+ uint phPos = qfilename.length();
+ uint phLength = 0;
+
+ while (phPos != 0) {
+ --phPos;
+
+ if (qfilename[phPos] == QLatin1Char('X')) {
+ ++phLength;
+ continue;
+ }
+
+ if (phLength >= 6
+ || qfilename[phPos] == QLatin1Char('/')) {
+ ++phPos;
+ break;
+ }
+
+ // start over
+ phLength = 0;
+ }
+
+ if (phLength < 6)
+ qfilename.append(QLatin1String(".XXXXXX"));
+
+ // "Nativify" :-)
+ QFileSystemEntry::NativePath filename = QFileSystemEngine::absoluteName(
+ QFileSystemEntry(qfilename, QFileSystemEntry::FromInternalPath()))
+ .nativeFilePath();
+
+ // Find mask in native path
+ phPos = filename.length();
+ phLength = 0;
+ while (phPos != 0) {
+ --phPos;
+
+ if (filename[phPos] == Latin1Char('X')) {
+ ++phLength;
+ continue;
+ }
+
+ if (phLength >= 6) {
+ ++phPos;
+ break;
+ }
+
+ // start over
+ phLength = 0;
+ }
+
+ Q_ASSERT(phLength >= 6);
+ path = filename;
+ pos = phPos;
+ length = phLength;
+}
/*!
\internal
- Generates a unique file path and returns a native handle to the open file.
- \a path is used as a template when generating unique paths, \a pos
- identifies the position of the first character that will be replaced in the
- template and \a length the number of characters that may be substituted.
- \a mode specifies the file mode bits (not used on Windows).
-
- Returns an open handle to the newly created file if successful, an invalid
- handle otherwise. In both cases, the string in \a path will be changed and
- contain the generated path name.
+ Generates a unique file path from the template \a templ and returns it.
+ The path in \c templ.path is modified.
*/
-static bool createFileFromTemplate(NativeFileHandle &file,
- QFileSystemEntry::NativePath &path, size_t pos, size_t length, quint32 mode,
- QSystemError &error)
+QFileSystemEntry::NativePath QTemporaryFileName::generateNext()
{
Q_ASSERT(length != 0);
- Q_ASSERT(pos < size_t(path.length()));
- Q_ASSERT(length <= size_t(path.length()) - pos);
+ Q_ASSERT(pos < path.length());
+ Q_ASSERT(length <= path.length() - pos);
Char *const placeholderStart = (Char *)path.data() + pos;
Char *const placeholderEnd = placeholderStart + length;
- // Initialize placeholder with random chars + PID.
+ // Replace placeholder with random chars.
{
+ // Since our dictionary is 26+26 characters, it would seem we only need
+ // a random number from 0 to 63 to select a character. However, due to
+ // the limited range, that would mean 12 (64-52) characters have double
+ // the probability of the others: 1 in 32 instead of 1 in 64.
+ //
+ // To overcome this limitation, we use more bits per character. With 10
+ // bits, there are 16 characters with probability 19/1024 and the rest
+ // at 20/1024 (i.e, less than .1% difference). This allows us to do 3
+ // characters per 32-bit random number, which is also half the typical
+ // placeholder length.
+ enum { BitsPerCharacter = 10 };
+
Char *rIter = placeholderEnd;
+ while (rIter != placeholderStart) {
+ quint32 rnd = QRandomGenerator::get32();
+ auto applyOne = [&]() {
+ quint32 v = rnd & ((1 << BitsPerCharacter) - 1);
+ rnd >>= BitsPerCharacter;
+ char ch = char((26 + 26) * v / (1 << BitsPerCharacter));
+ if (ch < 26)
+ *--rIter = Latin1Char(ch + 'A');
+ else
+ *--rIter = Latin1Char(ch - 26 + 'a');
+ };
+
+ applyOne();
+ if (rIter == placeholderStart)
+ break;
-#if defined(QT_BUILD_CORE_LIB)
- quint64 pid = quint64(QCoreApplication::applicationPid());
- do {
- *--rIter = Latin1Char((pid % 10) + '0');
- pid /= 10;
- } while (rIter != placeholderStart && pid != 0);
-#endif
+ applyOne();
+ if (rIter == placeholderStart)
+ break;
- while (rIter != placeholderStart) {
- char ch = char((qrand() & 0xffff) % (26 + 26));
- if (ch < 26)
- *--rIter = Latin1Char(ch + 'A');
- else
- *--rIter = Latin1Char(ch - 26 + 'a');
+ applyOne();
}
}
- for (;;) {
+ return path;
+}
+
+#ifndef QT_NO_TEMPORARYFILE
+
+/*!
+ \internal
+
+ Generates a unique file path from the template \a templ and creates a new
+ file based based on those parameters: the \c templ.length characters in \c
+ templ.path starting at \c templ.pos will be replacd by a random sequence of
+ characters. \a mode specifies the file mode bits (not used on Windows).
+
+ Returns true on success and sets the file handle on \a file. On error,
+ returns false, sets an invalid handle on \a handle and sets the error
+ condition in \a error. In both cases, the string in \a templ will be
+ changed and contain the generated path name.
+*/
+static bool createFileFromTemplate(NativeFileHandle &file, QTemporaryFileName &templ,
+ quint32 mode, QSystemError &error)
+{
+ const int maxAttempts = 16;
+ for (int attempt = 0; attempt < maxAttempts; ++attempt) {
// Atomically create file and obtain handle
+ const QFileSystemEntry::NativePath &path = templ.generateNext();
+
#if defined(Q_OS_WIN)
Q_UNUSED(mode);
@@ -195,45 +260,58 @@ static bool createFileFromTemplate(NativeFileHandle &file,
return false;
}
#endif
-
- /* tricky little algorwwithm for backward compatibility */
- for (Char *iter = placeholderStart;;) {
- // Character progression: [0-9] => 'a' ... 'z' => 'A' .. 'Z'
- // String progression: "ZZaiC" => "aabiC"
- switch (char(*iter)) {
- case 'Z':
- // Rollover, advance next character
- *iter = Latin1Char('a');
- if (++iter == placeholderEnd) {
- // Out of alternatives. Return file exists error, previously set.
- error = QSystemError(err, QSystemError::NativeError);
- return false;
- }
-
- continue;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- *iter = Latin1Char('a');
- break;
-
- case 'z':
- // increment 'z' to 'A'
- *iter = Latin1Char('A');
- break;
-
- default:
- ++*iter;
- break;
- }
- break;
- }
}
- Q_ASSERT(false);
return false;
}
+enum class CreateUnnamedFileStatus {
+ Success = 0,
+ NotSupported,
+ OtherError
+};
+
+static CreateUnnamedFileStatus
+createUnnamedFile(NativeFileHandle &file, QTemporaryFileName &tfn, quint32 mode, QSystemError *error)
+{
+#ifdef LINUX_UNNAMED_TMPFILE
+ // first, check if we have /proc, otherwise can't make the file exist later
+ // (no error message set, as caller will try regular temporary file)
+ if (!qt_haveLinuxProcfs())
+ return CreateUnnamedFileStatus::NotSupported;
+
+ const char *p = ".";
+ int lastSlash = tfn.path.lastIndexOf('/');
+ if (lastSlash != -1) {
+ tfn.path[lastSlash] = '\0';
+ p = tfn.path.data();
+ }
+
+ file = QT_OPEN(p, O_TMPFILE | QT_OPEN_RDWR | QT_OPEN_LARGEFILE,
+ static_cast<mode_t>(mode));
+ if (file != -1)
+ return CreateUnnamedFileStatus::Success;
+
+ if (errno == EOPNOTSUPP || errno == EISDIR) {
+ // fs or kernel doesn't support O_TMPFILE, so
+ // put the slash back so we may try a regular file
+ if (lastSlash != -1)
+ tfn.path[lastSlash] = '/';
+ return CreateUnnamedFileStatus::NotSupported;
+ }
+
+ // real error
+ *error = QSystemError(errno, QSystemError::NativeError);
+ return CreateUnnamedFileStatus::OtherError;
+#else
+ Q_UNUSED(file);
+ Q_UNUSED(tfn);
+ Q_UNUSED(mode);
+ Q_UNUSED(error);
+ return CreateUnnamedFileStatus::NotSupported;
+#endif
+}
+
//************* QTemporaryFileEngine
QTemporaryFileEngine::~QTemporaryFileEngine()
{
@@ -264,13 +342,6 @@ void QTemporaryFileEngine::setFileName(const QString &file)
QFSFileEngine::setFileName(file);
}
-void QTemporaryFileEngine::setFileTemplate(const QString &fileTemplate)
-{
- Q_D(QFSFileEngine);
- if (filePathIsTemplate)
- d->fileEntry = QFileSystemEntry(fileTemplate);
-}
-
bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
{
Q_D(QFSFileEngine);
@@ -281,59 +352,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
if (!filePathIsTemplate)
return QFSFileEngine::open(openMode);
- QString qfilename = d->fileEntry.filePath();
-
- // Ensure there is a placeholder mask
- uint phPos = qfilename.length();
- uint phLength = 0;
-
- while (phPos != 0) {
- --phPos;
-
- if (qfilename[phPos] == QLatin1Char('X')) {
- ++phLength;
- continue;
- }
-
- if (phLength >= 6
- || qfilename[phPos] == QLatin1Char('/')) {
- ++phPos;
- break;
- }
-
- // start over
- phLength = 0;
- }
-
- if (phLength < 6)
- qfilename.append(QLatin1String(".XXXXXX"));
-
- // "Nativify" :-)
- QFileSystemEntry::NativePath filename = QFileSystemEngine::absoluteName(
- QFileSystemEntry(qfilename, QFileSystemEntry::FromInternalPath()))
- .nativeFilePath();
-
- // Find mask in native path
- phPos = filename.length();
- phLength = 0;
- while (phPos != 0) {
- --phPos;
-
- if (filename[phPos] == Latin1Char('X')) {
- ++phLength;
- continue;
- }
-
- if (phLength >= 6) {
- ++phPos;
- break;
- }
-
- // start over
- phLength = 0;
- }
-
- Q_ASSERT(phLength >= 6);
+ QTemporaryFileName tfn(templateName);
QSystemError error;
#if defined(Q_OS_WIN)
@@ -342,19 +361,24 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
NativeFileHandle &file = d->fd;
#endif
- if (!createFileFromTemplate(file, filename, phPos, phLength, fileMode, error)) {
+ CreateUnnamedFileStatus st = createUnnamedFile(file, tfn, fileMode, &error);
+ if (st == CreateUnnamedFileStatus::Success) {
+ unnamedFile = true;
+ d->fileEntry.clear();
+ } else if (st == CreateUnnamedFileStatus::NotSupported &&
+ createFileFromTemplate(file, tfn, fileMode, error)) {
+ filePathIsTemplate = false;
+ unnamedFile = false;
+ d->fileEntry = QFileSystemEntry(tfn.path, QFileSystemEntry::FromNativePath());
+ } else {
setError(QFile::OpenError, error.toString());
return false;
}
- d->fileEntry = QFileSystemEntry(filename, QFileSystemEntry::FromNativePath());
-
#if !defined(Q_OS_WIN) || defined(Q_OS_WINRT)
d->closeFileHandle = true;
#endif
- filePathIsTemplate = false;
-
d->openMode = openMode;
d->lastFlushFailed = false;
d->tried_stat = 0;
@@ -369,7 +393,7 @@ bool QTemporaryFileEngine::remove()
// we must explicitly call QFSFileEngine::close() before we remove it.
d->unmapAll();
QFSFileEngine::close();
- if (QFSFileEngine::remove()) {
+ if (isUnnamedFile() || QFSFileEngine::remove()) {
d->fileEntry.clear();
// If a QTemporaryFile is constructed using a template file path, the path
// is generated in QTemporaryFileEngine::open() and then filePathIsTemplate
@@ -384,12 +408,22 @@ bool QTemporaryFileEngine::remove()
bool QTemporaryFileEngine::rename(const QString &newName)
{
+ if (isUnnamedFile()) {
+ bool ok = materializeUnnamedFile(newName, DontOverwrite);
+ QFSFileEngine::close();
+ return ok;
+ }
QFSFileEngine::close();
return QFSFileEngine::rename(newName);
}
bool QTemporaryFileEngine::renameOverwrite(const QString &newName)
{
+ if (isUnnamedFile()) {
+ bool ok = materializeUnnamedFile(newName, Overwrite);
+ QFSFileEngine::close();
+ return ok;
+ }
QFSFileEngine::close();
return QFSFileEngine::renameOverwrite(newName);
}
@@ -402,6 +436,88 @@ bool QTemporaryFileEngine::close()
return true;
}
+QString QTemporaryFileEngine::fileName(QAbstractFileEngine::FileName file) const
+{
+ if (isUnnamedFile()) {
+ if (file == LinkName) {
+ // we know our file isn't (won't be) a symlink
+ return QString();
+ }
+
+ // for all other cases, materialize the file
+ const_cast<QTemporaryFileEngine *>(this)->materializeUnnamedFile(templateName, NameIsTemplate);
+ }
+ return QFSFileEngine::fileName(file);
+}
+
+bool QTemporaryFileEngine::materializeUnnamedFile(const QString &newName, QTemporaryFileEngine::MaterializationMode mode)
+{
+ Q_ASSERT(isUnnamedFile());
+
+#ifdef LINUX_UNNAMED_TMPFILE
+ Q_D(QFSFileEngine);
+ const QByteArray src = "/proc/self/fd/" + QByteArray::number(d->fd);
+ auto materializeAt = [=](const QFileSystemEntry &dst) {
+ return ::linkat(AT_FDCWD, src, AT_FDCWD, dst.nativeFilePath(), AT_SYMLINK_FOLLOW) == 0;
+ };
+#else
+ auto materializeAt = [](const QFileSystemEntry &) { return false; };
+#endif
+
+ auto success = [this](const QFileSystemEntry &entry) {
+ filePathIsTemplate = false;
+ unnamedFile = false;
+ d_func()->fileEntry = entry;
+ return true;
+ };
+
+ auto materializeAsTemplate = [=](const QString &newName) {
+ QTemporaryFileName tfn(newName);
+ static const int maxAttempts = 16;
+ for (int attempt = 0; attempt < maxAttempts; ++attempt) {
+ tfn.generateNext();
+ QFileSystemEntry entry(tfn.path, QFileSystemEntry::FromNativePath());
+ if (materializeAt(entry))
+ return success(entry);
+ }
+ return false;
+ };
+
+ if (mode == NameIsTemplate) {
+ if (materializeAsTemplate(newName))
+ return true;
+ } else {
+ // Use linkat to materialize the file
+ QFileSystemEntry dst(newName);
+ if (materializeAt(dst))
+ return success(dst);
+
+ if (errno == EEXIST && mode == Overwrite) {
+ // retry by first creating a temporary file in the right dir
+ if (!materializeAsTemplate(templateName))
+ return false;
+
+ // then rename the materialized file to target (same as renameOverwrite)
+ QFSFileEngine::close();
+ return QFSFileEngine::renameOverwrite(newName);
+ }
+ }
+
+ // failed
+ setError(QFile::RenameError, QSystemError(errno, QSystemError::NativeError).toString());
+ return false;
+}
+
+bool QTemporaryFileEngine::isUnnamedFile() const
+{
+#ifdef LINUX_UNNAMED_TMPFILE
+ Q_ASSERT(unnamedFile == d_func()->fileEntry.isEmpty());
+ return unnamedFile;
+#else
+ return false;
+#endif
+}
+
//************* QTemporaryFilePrivate
QTemporaryFilePrivate::QTemporaryFilePrivate()
@@ -420,7 +536,7 @@ QTemporaryFilePrivate::~QTemporaryFilePrivate()
QAbstractFileEngine *QTemporaryFilePrivate::engine() const
{
if (!fileEngine) {
- fileEngine = new QTemporaryFileEngine;
+ fileEngine = new QTemporaryFileEngine(&templateName);
resetFileEngine();
}
return fileEngine;
@@ -438,6 +554,17 @@ void QTemporaryFilePrivate::resetFileEngine() const
tef->initialize(fileName, 0600, false);
}
+void QTemporaryFilePrivate::materializeUnnamedFile()
+{
+#ifdef LINUX_UNNAMED_TMPFILE
+ if (!fileName.isEmpty() || !fileEngine)
+ return;
+
+ auto *tef = static_cast<QTemporaryFileEngine *>(fileEngine);
+ fileName = tef->fileName(QAbstractFileEngine::DefaultName);
+#endif
+}
+
QString QTemporaryFilePrivate::defaultTemplateName()
{
QString baseName;
@@ -646,6 +773,10 @@ void QTemporaryFile::setAutoRemove(bool b)
QString QTemporaryFile::fileName() const
{
Q_D(const QTemporaryFile);
+ auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ if (tef && tef->isReallyOpen())
+ const_cast<QTemporaryFilePrivate *>(d)->materializeUnnamedFile();
+
if(d->fileName.isEmpty())
return QString();
return d->engine()->fileName(QAbstractFileEngine::DefaultName);
@@ -679,8 +810,36 @@ void QTemporaryFile::setFileTemplate(const QString &name)
{
Q_D(QTemporaryFile);
d->templateName = name;
- if (d->fileEngine)
- static_cast<QTemporaryFileEngine*>(d->fileEngine)->setFileTemplate(name);
+}
+
+/*!
+ \internal
+
+ This is just a simplified version of QFile::rename() because we know a few
+ extra details about what kind of file we have. The documentation is hidden
+ from the user because QFile::rename() should be enough.
+*/
+bool QTemporaryFile::rename(const QString &newName)
+{
+ Q_D(QTemporaryFile);
+ auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ if (!tef || !tef->isReallyOpen() || !tef->filePathWasTemplate)
+ return QFile::rename(newName);
+
+ unsetError();
+ close();
+ if (error() == QFile::NoError) {
+ if (tef->rename(newName)) {
+ unsetError();
+ // engine was able to handle the new name so we just reset it
+ tef->setFileName(newName);
+ d->fileName = newName;
+ return true;
+ }
+
+ d->setError(QFile::RenameError, tef->errorString());
+ }
+ return false;
}
/*!
@@ -771,11 +930,10 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
bool QTemporaryFile::open(OpenMode flags)
{
Q_D(QTemporaryFile);
- if (!d->fileName.isEmpty()) {
- if (static_cast<QTemporaryFileEngine*>(d->engine())->isReallyOpen()) {
- setOpenMode(flags);
- return true;
- }
+ auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ if (tef && tef->isReallyOpen()) {
+ setOpenMode(flags);
+ return true;
}
// reset the engine state so it creates a new, unique file name from the template;
@@ -786,16 +944,20 @@ bool QTemporaryFile::open(OpenMode flags)
d->resetFileEngine();
if (QFile::open(flags)) {
- d->fileName = d->fileEngine->fileName(QAbstractFileEngine::DefaultName);
+ tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ if (tef->isUnnamedFile())
+ d->fileName.clear();
+ else
+ d->fileName = tef->fileName(QAbstractFileEngine::DefaultName);
return true;
}
return false;
}
-QT_END_NAMESPACE
-
#endif // QT_NO_TEMPORARYFILE
+QT_END_NAMESPACE
+
#ifndef QT_NO_QOBJECT
#include "moc_qtemporaryfile.cpp"
#endif
diff --git a/src/corelib/io/qtemporaryfile.h b/src/corelib/io/qtemporaryfile.h
index 3dc2e75f50..7fc5a299fc 100644
--- a/src/corelib/io/qtemporaryfile.h
+++ b/src/corelib/io/qtemporaryfile.h
@@ -80,6 +80,10 @@ public:
QString fileName() const Q_DECL_OVERRIDE;
QString fileTemplate() const;
void setFileTemplate(const QString &name);
+
+ // Hides QFile::rename
+ bool rename(const QString &newName);
+
#if QT_DEPRECATED_SINCE(5,1)
QT_DEPRECATED inline static QTemporaryFile *createLocalFile(const QString &fileName)
{ return createNativeFile(fileName); }
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index 7f365f0e8a..46a0d7aba3 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -53,25 +53,48 @@
#include <QtCore/qglobal.h>
-#ifndef QT_NO_TEMPORARYFILE
-
#include "private/qfsfileengine_p.h"
#include "private/qfilesystemengine_p.h"
#include "private/qfile_p.h"
+#include "qtemporaryfile.h"
+
+#ifdef Q_OS_LINUX
+# include <fcntl.h>
+# ifdef O_TMPFILE
+// some early libc support had the wrong values for O_TMPFILE
+// (see https://bugzilla.gnome.org/show_bug.cgi?id=769453#c18)
+# if (O_TMPFILE & O_DIRECTORY) == O_DIRECTORY
+# define LINUX_UNNAMED_TMPFILE
+# endif
+# endif
+#endif
QT_BEGIN_NAMESPACE
+struct QTemporaryFileName
+{
+ QFileSystemEntry::NativePath path;
+ qssize_t pos;
+ qssize_t length;
+
+ QTemporaryFileName(const QString &templateName);
+ QFileSystemEntry::NativePath generateNext();
+};
+
+#ifndef QT_NO_TEMPORARYFILE
+
class QTemporaryFilePrivate : public QFilePrivate
{
Q_DECLARE_PUBLIC(QTemporaryFile)
-protected:
+public:
QTemporaryFilePrivate();
explicit QTemporaryFilePrivate(const QString &templateNameIn);
~QTemporaryFilePrivate();
QAbstractFileEngine *engine() const override;
void resetFileEngine() const;
+ void materializeUnnamedFile();
bool autoRemove = true;
QString templateName = defaultTemplateName();
@@ -85,37 +108,50 @@ class QTemporaryFileEngine : public QFSFileEngine
{
Q_DECLARE_PRIVATE(QFSFileEngine)
public:
+ QTemporaryFileEngine(const QString *templateName)
+ : templateName(*templateName)
+ {}
+
void initialize(const QString &file, quint32 mode, bool nameIsTemplate = true)
{
Q_D(QFSFileEngine);
Q_ASSERT(!isReallyOpen());
fileMode = mode;
filePathIsTemplate = filePathWasTemplate = nameIsTemplate;
- d->fileEntry = QFileSystemEntry(file);
- if (!filePathIsTemplate)
+ if (filePathIsTemplate) {
+ d->fileEntry.clear();
+ } else {
+ d->fileEntry = QFileSystemEntry(file);
QFSFileEngine::setFileName(file);
+ }
}
~QTemporaryFileEngine();
bool isReallyOpen() const;
void setFileName(const QString &file) override;
- void setFileTemplate(const QString &fileTemplate);
bool open(QIODevice::OpenMode flags) override;
bool remove() override;
bool rename(const QString &newName) override;
bool renameOverwrite(const QString &newName) override;
bool close() override;
+ QString fileName(FileName file) const override;
+ enum MaterializationMode { Overwrite, DontOverwrite, NameIsTemplate };
+ bool materializeUnnamedFile(const QString &newName, MaterializationMode mode);
+ bool isUnnamedFile() const;
+
+ const QString &templateName;
quint32 fileMode;
bool filePathIsTemplate;
bool filePathWasTemplate;
+ bool unnamedFile = false;
};
-QT_END_NAMESPACE
-
#endif // QT_NO_TEMPORARYFILE
+QT_END_NAMESPACE
+
#endif /* QTEMPORARYFILE_P_H */
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 5144ac0ec9..ee3cb4efcb 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -954,8 +954,7 @@ QTextStreamPrivate::PaddingResult QTextStreamPrivate::padding(int len) const
right = padSize - padSize/2;
break;
}
- const PaddingResult result = { left, right };
- return result;
+ return { left, right };
}
/*!
diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp
index 96543bbbfd..a934d19fa2 100644
--- a/src/corelib/io/qtldurl.cpp
+++ b/src/corelib/io/qtldurl.cpp
@@ -50,9 +50,21 @@
QT_BEGIN_NAMESPACE
-static bool containsTLDEntry(const QStringRef &entry)
+enum TLDMatchType {
+ ExactMatch,
+ SuffixMatch,
+ ExceptionMatch,
+};
+
+static bool containsTLDEntry(QStringView entry, TLDMatchType match)
{
- int index = qt_hash(entry) % tldCount;
+ const QStringView matchSymbols[] = {
+ QStringViewLiteral(""),
+ QStringViewLiteral("*"),
+ QStringViewLiteral("!"),
+ };
+ const auto symbol = matchSymbols[match];
+ int index = qt_hash(entry, qt_hash(symbol)) % tldCount;
// select the right chunk from the big table
short chunk = 0;
@@ -65,19 +77,14 @@ static bool containsTLDEntry(const QStringRef &entry)
// check all the entries from the given index
while (chunkIndex < tldIndices[index+1] - offset) {
- QString currentEntry = QString::fromUtf8(tldData[chunk] + chunkIndex);
- if (currentEntry == entry)
+ const auto utf8 = tldData[chunk] + chunkIndex;
+ if ((symbol.isEmpty() || QLatin1Char(*utf8) == symbol) && entry == QString::fromUtf8(utf8 + symbol.size()))
return true;
- chunkIndex += qstrlen(tldData[chunk] + chunkIndex) + 1; // +1 for the ending \0
+ chunkIndex += qstrlen(utf8) + 1; // +1 for the ending \0
}
return false;
}
-static inline bool containsTLDEntry(const QString &entry)
-{
- return containsTLDEntry(QStringRef(&entry));
-}
-
/*!
\internal
@@ -111,19 +118,16 @@ Q_CORE_EXPORT bool qIsEffectiveTLD(const QStringRef &domain)
{
// for domain 'foo.bar.com':
// 1. return if TLD table contains 'foo.bar.com'
- if (containsTLDEntry(domain))
+ // 2. else if table contains '*.bar.com',
+ // 3. test that table does not contain '!foo.bar.com'
+
+ if (containsTLDEntry(domain, ExactMatch)) // 1
return true;
const int dot = domain.indexOf(QLatin1Char('.'));
if (dot >= 0) {
- int count = domain.size() - dot;
- QString wildCardDomain = QLatin1Char('*') + domain.right(count);
- // 2. if table contains '*.bar.com',
- // test if table contains '!foo.bar.com'
- if (containsTLDEntry(wildCardDomain)) {
- QString exceptionDomain = QLatin1Char('!') + domain;
- return (! containsTLDEntry(exceptionDomain));
- }
+ if (containsTLDEntry(domain.mid(dot), SuffixMatch)) // 2
+ return !containsTLDEntry(domain, ExceptionMatch); // 3
}
return false;
}
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index b93fed5ba8..ef5ff2d827 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -132,17 +132,8 @@ qint64 QWindowsPipeReader::read(char *data, qint64 maxlen)
actualReadBufferSize--;
readSoFar = 1;
} else {
- qint64 bytesToRead = qMin(actualReadBufferSize, maxlen);
- readSoFar = 0;
- while (readSoFar < bytesToRead) {
- const char *ptr = readBuffer.readPointer();
- qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,
- readBuffer.nextDataBlockSize());
- memcpy(data + readSoFar, ptr, bytesToReadFromThisBlock);
- readSoFar += bytesToReadFromThisBlock;
- readBuffer.free(bytesToReadFromThisBlock);
- actualReadBufferSize -= bytesToReadFromThisBlock;
- }
+ readSoFar = readBuffer.read(data, qMin(actualReadBufferSize, maxlen));
+ actualReadBufferSize -= readSoFar;
}
if (!pipeBroken) {
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index 846891102f..75cb8a7ede 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -57,7 +57,6 @@ QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipeWriteEnd, QObject *parent)
: QObject(parent),
handle(pipeWriteEnd),
overlapped(nullptr),
- numberOfBytesToWrite(0),
pendingBytesWrittenValue(0),
stopped(true),
writeSequenceStarted(false),
@@ -98,7 +97,7 @@ bool QWindowsPipeWriter::waitForWrite(int msecs)
qint64 QWindowsPipeWriter::bytesToWrite() const
{
- return numberOfBytesToWrite + pendingBytesWrittenValue;
+ return buffer.size() + pendingBytesWrittenValue;
}
void QWindowsPipeWriter::emitPendingBytesWrittenValue()
@@ -137,7 +136,6 @@ void QWindowsPipeWriter::notified(DWORD errorCode, DWORD numberOfBytesWritten)
{
notifiedCalled = true;
writeSequenceStarted = false;
- numberOfBytesToWrite = 0;
Q_ASSERT(errorCode != ERROR_SUCCESS || numberOfBytesWritten == DWORD(buffer.size()));
buffer.clear();
@@ -193,13 +191,11 @@ bool QWindowsPipeWriter::write(const QByteArray &ba)
overlapped = new Overlapped(this);
overlapped->clear();
buffer = ba;
- numberOfBytesToWrite = buffer.size();
stopped = false;
writeSequenceStarted = true;
- if (!WriteFileEx(handle, buffer.constData(), numberOfBytesToWrite,
+ if (!WriteFileEx(handle, buffer.constData(), buffer.size(),
overlapped, &writeFileCompleted)) {
writeSequenceStarted = false;
- numberOfBytesToWrite = 0;
buffer.clear();
const DWORD errorCode = GetLastError();
diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h
index c8252e2a4b..d6671c3f27 100644
--- a/src/corelib/io/qwindowspipewriter_p.h
+++ b/src/corelib/io/qwindowspipewriter_p.h
@@ -145,7 +145,6 @@ private:
HANDLE handle;
Overlapped *overlapped;
QByteArray buffer;
- qint64 numberOfBytesToWrite;
qint64 pendingBytesWrittenValue;
bool stopped;
bool writeSequenceStarted;
diff --git a/src/corelib/io/qwinoverlappedionotifier.cpp b/src/corelib/io/qwinoverlappedionotifier.cpp
deleted file mode 100644
index d7745ae1b6..0000000000
--- a/src/corelib/io/qwinoverlappedionotifier.cpp
+++ /dev/null
@@ -1,428 +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 "qwinoverlappedionotifier_p.h"
-#include <qdebug.h>
-#include <qatomic.h>
-#include <qelapsedtimer.h>
-#include <qmutex.h>
-#include <qpointer.h>
-#include <qqueue.h>
-#include <qset.h>
-#include <qthread.h>
-#include <qt_windows.h>
-#include <private/qobject_p.h>
-#include <private/qiodevice_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QWinOverlappedIoNotifier
- \inmodule QtCore
- \brief The QWinOverlappedIoNotifier class provides support for overlapped I/O notifications on Windows.
- \since 5.0
- \internal
-
- The QWinOverlappedIoNotifier class makes it possible to use efficient
- overlapped (asynchronous) I/O notifications on Windows by using an
- I/O completion port.
-
- Once you have obtained a file handle, you can use setHandle() to get
- notifications for I/O operations. Whenever an I/O operation completes,
- the notified() signal is emitted which will pass the number of transferred
- bytes, the operation's error code and a pointer to the operation's
- OVERLAPPED object to the receiver.
-
- Every handle that supports overlapped I/O can be used by
- QWinOverlappedIoNotifier. That includes file handles, TCP sockets
- and named pipes.
-
- Note that you must not use ReadFileEx() and WriteFileEx() together
- with QWinOverlappedIoNotifier. They are not supported as they use a
- different I/O notification mechanism.
-
- The hEvent member in the OVERLAPPED structure passed to ReadFile()
- or WriteFile() is ignored and can be used for other purposes.
-
- \warning This class is only available on Windows.
-
- Due to peculiarities of the Windows I/O completion port API, users of
- QWinOverlappedIoNotifier must pay attention to the following restrictions:
- \list
- \li File handles with a QWinOverlappedIoNotifer are assigned to an I/O
- completion port until the handle is closed. It is impossible to
- disassociate the file handle from the I/O completion port.
- \li There can be only one QWinOverlappedIoNotifer per file handle. Creating
- another QWinOverlappedIoNotifier for that file, even with a duplicated
- handle, will fail.
- \li Certain Windows API functions are unavailable for file handles that are
- assigned to an I/O completion port. This includes the functions
- \c{ReadFileEx} and \c{WriteFileEx}.
- \endlist
- See also the remarks in the MSDN documentation for the
- \c{CreateIoCompletionPort} function.
-*/
-
-struct IOResult
-{
- IOResult(DWORD n = 0, DWORD e = 0, OVERLAPPED *p = 0)
- : numberOfBytes(n), errorCode(e), overlapped(p)
- {}
-
- DWORD numberOfBytes;
- DWORD errorCode;
- OVERLAPPED *overlapped;
-};
-
-
-class QWinIoCompletionPort;
-
-class QWinOverlappedIoNotifierPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QWinOverlappedIoNotifier)
-public:
- QWinOverlappedIoNotifierPrivate()
- : hHandle(INVALID_HANDLE_VALUE)
- {
- }
-
- OVERLAPPED *waitForAnyNotified(int msecs);
- void notify(DWORD numberOfBytes, DWORD errorCode, OVERLAPPED *overlapped);
- void _q_notified();
- OVERLAPPED *dispatchNextIoResult();
-
- static QWinIoCompletionPort *iocp;
- static HANDLE iocpInstanceLock;
- static unsigned int iocpInstanceRefCount;
- HANDLE hHandle;
- HANDLE hSemaphore;
- HANDLE hResultsMutex;
- QAtomicInt waiting;
- QQueue<IOResult> results;
-};
-
-QWinIoCompletionPort *QWinOverlappedIoNotifierPrivate::iocp = 0;
-HANDLE QWinOverlappedIoNotifierPrivate::iocpInstanceLock = CreateMutex(NULL, FALSE, NULL);
-unsigned int QWinOverlappedIoNotifierPrivate::iocpInstanceRefCount = 0;
-
-
-class QWinIoCompletionPort : protected QThread
-{
-public:
- QWinIoCompletionPort()
- : finishThreadKey(reinterpret_cast<ULONG_PTR>(this)),
- drainQueueKey(reinterpret_cast<ULONG_PTR>(this + 1)),
- hPort(INVALID_HANDLE_VALUE)
- {
- setObjectName(QLatin1String("I/O completion port thread"));
- HANDLE hIOCP = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
- if (!hIOCP) {
- qErrnoWarning("CreateIoCompletionPort failed.");
- return;
- }
- hPort = hIOCP;
- hQueueDrainedEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- if (!hQueueDrainedEvent) {
- qErrnoWarning("CreateEvent failed.");
- return;
- }
- }
-
- ~QWinIoCompletionPort()
- {
- PostQueuedCompletionStatus(hPort, 0, finishThreadKey, NULL);
- QThread::wait();
- CloseHandle(hPort);
- CloseHandle(hQueueDrainedEvent);
- }
-
- void registerNotifier(QWinOverlappedIoNotifierPrivate *notifier)
- {
- const HANDLE hHandle = notifier->hHandle;
- HANDLE hIOCP = CreateIoCompletionPort(hHandle, hPort,
- reinterpret_cast<ULONG_PTR>(notifier), 0);
- if (!hIOCP) {
- qErrnoWarning("Can't associate file handle %x with I/O completion port.", hHandle);
- return;
- }
- mutex.lock();
- notifiers += notifier;
- mutex.unlock();
- if (!QThread::isRunning())
- QThread::start();
- }
-
- void unregisterNotifier(QWinOverlappedIoNotifierPrivate *notifier)
- {
- mutex.lock();
- notifiers.remove(notifier);
- mutex.unlock();
- }
-
- void drainQueue()
- {
- QMutexLocker locker(&drainQueueMutex);
- ResetEvent(hQueueDrainedEvent);
- PostQueuedCompletionStatus(hPort, 0, drainQueueKey, NULL);
- WaitForSingleObject(hQueueDrainedEvent, INFINITE);
- }
-
- using QThread::isRunning;
-
-protected:
- void run()
- {
- DWORD dwBytesRead;
- ULONG_PTR pulCompletionKey;
- OVERLAPPED *overlapped;
- DWORD msecs = INFINITE;
-
- forever {
- BOOL success = GetQueuedCompletionStatus(hPort,
- &dwBytesRead,
- &pulCompletionKey,
- &overlapped,
- msecs);
-
- DWORD errorCode = success ? ERROR_SUCCESS : GetLastError();
- if (!success && !overlapped) {
- if (!msecs) {
- // Time out in drain mode. The completion status queue is empty.
- msecs = INFINITE;
- SetEvent(hQueueDrainedEvent);
- continue;
- }
- qErrnoWarning(errorCode, "GetQueuedCompletionStatus failed.");
- return;
- }
-
- if (pulCompletionKey == finishThreadKey)
- return;
- if (pulCompletionKey == drainQueueKey) {
- // Enter drain mode.
- Q_ASSERT(msecs == INFINITE);
- msecs = 0;
- continue;
- }
-
- QWinOverlappedIoNotifierPrivate *notifier
- = reinterpret_cast<QWinOverlappedIoNotifierPrivate *>(pulCompletionKey);
- mutex.lock();
- if (notifiers.contains(notifier))
- notifier->notify(dwBytesRead, errorCode, overlapped);
- mutex.unlock();
- }
- }
-
-private:
- const ULONG_PTR finishThreadKey;
- const ULONG_PTR drainQueueKey;
- HANDLE hPort;
- QSet<QWinOverlappedIoNotifierPrivate *> notifiers;
- QMutex mutex;
- QMutex drainQueueMutex;
- HANDLE hQueueDrainedEvent;
-};
-
-
-QWinOverlappedIoNotifier::QWinOverlappedIoNotifier(QObject *parent)
- : QObject(*new QWinOverlappedIoNotifierPrivate, parent)
-{
- Q_D(QWinOverlappedIoNotifier);
- WaitForSingleObject(d->iocpInstanceLock, INFINITE);
- if (!d->iocp)
- d->iocp = new QWinIoCompletionPort;
- d->iocpInstanceRefCount++;
- ReleaseMutex(d->iocpInstanceLock);
-
- d->hSemaphore = CreateSemaphore(NULL, 0, 255, NULL);
- d->hResultsMutex = CreateMutex(NULL, FALSE, NULL);
- connect(this, SIGNAL(_q_notify()), this, SLOT(_q_notified()), Qt::QueuedConnection);
-}
-
-QWinOverlappedIoNotifier::~QWinOverlappedIoNotifier()
-{
- Q_D(QWinOverlappedIoNotifier);
- setEnabled(false);
- CloseHandle(d->hResultsMutex);
- CloseHandle(d->hSemaphore);
-
- WaitForSingleObject(d->iocpInstanceLock, INFINITE);
- if (!--d->iocpInstanceRefCount) {
- delete d->iocp;
- d->iocp = 0;
- }
- ReleaseMutex(d->iocpInstanceLock);
-}
-
-void QWinOverlappedIoNotifier::setHandle(Qt::HANDLE h)
-{
- Q_D(QWinOverlappedIoNotifier);
- d->hHandle = h;
-}
-
-Qt::HANDLE QWinOverlappedIoNotifier::handle() const
-{
- Q_D(const QWinOverlappedIoNotifier);
- return d->hHandle;
-}
-
-void QWinOverlappedIoNotifier::setEnabled(bool enabled)
-{
- Q_D(QWinOverlappedIoNotifier);
- if (enabled)
- d->iocp->registerNotifier(d);
- else
- d->iocp->unregisterNotifier(d);
-}
-
-OVERLAPPED *QWinOverlappedIoNotifierPrivate::waitForAnyNotified(int msecs)
-{
- if (!iocp->isRunning()) {
- qWarning("Called QWinOverlappedIoNotifier::waitForAnyNotified on inactive notifier.");
- return 0;
- }
-
- if (msecs == 0)
- iocp->drainQueue();
-
- const DWORD wfso = WaitForSingleObject(hSemaphore, msecs == -1 ? INFINITE : DWORD(msecs));
- switch (wfso) {
- case WAIT_OBJECT_0:
- return dispatchNextIoResult();
- case WAIT_TIMEOUT:
- return 0;
- default:
- qErrnoWarning("QWinOverlappedIoNotifier::waitForAnyNotified: WaitForSingleObject failed.");
- return 0;
- }
-}
-
-class QScopedAtomicIntIncrementor
-{
-public:
- QScopedAtomicIntIncrementor(QAtomicInt &i)
- : m_int(i)
- {
- ++m_int;
- }
-
- ~QScopedAtomicIntIncrementor()
- {
- --m_int;
- }
-
-private:
- QAtomicInt &m_int;
-};
-
-/*!
- * Wait synchronously for any notified signal.
- *
- * The function returns a pointer to the OVERLAPPED object corresponding to the completed I/O
- * operation. In case no I/O operation was completed during the \a msec timeout, this function
- * returns a null pointer.
- */
-OVERLAPPED *QWinOverlappedIoNotifier::waitForAnyNotified(int msecs)
-{
- Q_D(QWinOverlappedIoNotifier);
- QScopedAtomicIntIncrementor saii(d->waiting);
- OVERLAPPED *result = d->waitForAnyNotified(msecs);
- return result;
-}
-
-/*!
- * Wait synchronously for the notified signal.
- *
- * The function returns true if the notified signal was emitted for
- * the I/O operation that corresponds to the OVERLAPPED object.
- */
-bool QWinOverlappedIoNotifier::waitForNotified(int msecs, OVERLAPPED *overlapped)
-{
- Q_D(QWinOverlappedIoNotifier);
- QScopedAtomicIntIncrementor saii(d->waiting);
- int t = msecs;
- QElapsedTimer stopWatch;
- stopWatch.start();
- forever {
- OVERLAPPED *triggeredOverlapped = waitForAnyNotified(t);
- if (!triggeredOverlapped)
- return false;
- if (triggeredOverlapped == overlapped)
- return true;
- t = qt_subtract_from_timeout(msecs, stopWatch.elapsed());
- if (t == 0)
- return false;
- }
-}
-
-/*!
- * Note: This function runs in the I/O completion port thread.
- */
-void QWinOverlappedIoNotifierPrivate::notify(DWORD numberOfBytes, DWORD errorCode,
- OVERLAPPED *overlapped)
-{
- Q_Q(QWinOverlappedIoNotifier);
- WaitForSingleObject(hResultsMutex, INFINITE);
- results.enqueue(IOResult(numberOfBytes, errorCode, overlapped));
- ReleaseMutex(hResultsMutex);
- ReleaseSemaphore(hSemaphore, 1, NULL);
- if (!waiting)
- emit q->_q_notify();
-}
-
-void QWinOverlappedIoNotifierPrivate::_q_notified()
-{
- if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0)
- dispatchNextIoResult();
-}
-
-OVERLAPPED *QWinOverlappedIoNotifierPrivate::dispatchNextIoResult()
-{
- Q_Q(QWinOverlappedIoNotifier);
- WaitForSingleObject(hResultsMutex, INFINITE);
- IOResult ioresult = results.dequeue();
- ReleaseMutex(hResultsMutex);
- emit q->notified(ioresult.numberOfBytes, ioresult.errorCode, ioresult.overlapped);
- return ioresult.overlapped;
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qwinoverlappedionotifier_p.cpp"
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 226a2401e1..ef3281df30 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -56,6 +56,15 @@ QT_BEGIN_NAMESPACE
typedef QVector<QPair<QModelIndex, QPersistentModelIndex> > QModelIndexPairList;
+struct QSortFilterProxyModelDataChanged
+{
+ QSortFilterProxyModelDataChanged(const QModelIndex &tl, const QModelIndex &br)
+ : topLeft(tl), bottomRight(br) { }
+
+ QModelIndex topLeft;
+ QModelIndex bottomRight;
+};
+
static inline QSet<int> qVectorToSet(const QVector<int> &vector)
{
QSet<int> set;
@@ -164,9 +173,12 @@ public:
bool sort_localeaware;
int filter_column;
- QRegExp filter_regexp;
int filter_role;
+ QRegExp filter_regexp;
+ QModelIndex last_top_source;
+ bool filter_recursive;
+ bool complete_insert;
bool dynamic_sortfilter;
QRowsRemoval itemsBeingRemoved;
@@ -289,6 +301,11 @@ public:
Qt::Orientation orient, int start, int end, int delta_item_count, bool remove);
virtual void _q_sourceModelDestroyed() Q_DECL_OVERRIDE;
+
+ bool needsReorder(const QVector<int> &source_rows, const QModelIndex &source_parent) const;
+
+ bool filterAcceptsRowInternal(int source_row, const QModelIndex &source_parent) const;
+ bool filterRecursiveAcceptsRow(int source_row, const QModelIndex &source_parent) const;
};
typedef QHash<QModelIndex, QSortFilterProxyModelPrivate::Mapping *> IndexMap;
@@ -300,6 +317,32 @@ void QSortFilterProxyModelPrivate::_q_sourceModelDestroyed()
source_index_mapping.clear();
}
+bool QSortFilterProxyModelPrivate::filterAcceptsRowInternal(int source_row, const QModelIndex &source_parent) const
+{
+ Q_Q(const QSortFilterProxyModel);
+ return filter_recursive
+ ? filterRecursiveAcceptsRow(source_row, source_parent)
+ : q->filterAcceptsRow(source_row, source_parent);
+}
+
+bool QSortFilterProxyModelPrivate::filterRecursiveAcceptsRow(int source_row, const QModelIndex &source_parent) const
+{
+ Q_Q(const QSortFilterProxyModel);
+
+ if (q->filterAcceptsRow(source_row, source_parent))
+ return true;
+
+ const QModelIndex index = model->index(source_row, 0, source_parent);
+ const int count = model->rowCount(index);
+
+ for (int i = 0; i < count; ++i) {
+ if (filterRecursiveAcceptsRow(i, index))
+ return true;
+ }
+
+ return false;
+}
+
void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source_parent)
{
if (Mapping *m = source_index_mapping.take(source_parent)) {
@@ -340,7 +383,7 @@ IndexMap::const_iterator QSortFilterProxyModelPrivate::create_mapping(
int source_rows = model->rowCount(source_parent);
m->source_rows.reserve(source_rows);
for (int i = 0; i < source_rows; ++i) {
- if (q->filterAcceptsRow(i, source_parent))
+ if (filterAcceptsRowInternal(i, source_parent))
m->source_rows.append(i);
}
int source_cols = model->columnCount(source_parent);
@@ -794,7 +837,7 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
QVector<int> source_items;
for (int i = start; i <= end; ++i) {
if ((orient == Qt::Vertical)
- ? q->filterAcceptsRow(i, source_parent)
+ ? filterAcceptsRowInternal(i, source_parent)
: q->filterAcceptsColumn(i, source_parent)) {
source_items.append(i);
}
@@ -814,7 +857,7 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
orthogonal_source_to_proxy.resize(ortho_end);
for (int ortho_item = 0; ortho_item < ortho_end; ++ortho_item) {
- if ((orient == Qt::Horizontal) ? q->filterAcceptsRow(ortho_item, source_parent)
+ if ((orient == Qt::Horizontal) ? filterAcceptsRowInternal(ortho_item, source_parent)
: q->filterAcceptsColumn(ortho_item, source_parent)) {
orthogonal_proxy_to_source.append(ortho_item);
}
@@ -969,12 +1012,7 @@ void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &sour
// reinsert moved, mapped indexes
QVector<QPair<QModelIndex, Mapping*> >::iterator it = moved_source_index_mappings.begin();
for (; it != moved_source_index_mappings.end(); ++it) {
-#ifdef QT_STRICT_ITERATORS
- source_index_mapping.insert((*it).first, (*it).second);
- (*it).second->map_iter = source_index_mapping.constFind((*it).first);
-#else
- (*it).second->map_iter = source_index_mapping.insert((*it).first, (*it).second);
-#endif
+ (*it).second->map_iter = QHash<QModelIndex, Mapping *>::const_iterator(source_index_mapping.insert((*it).first, (*it).second));
}
}
@@ -1125,7 +1163,7 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
for (int i = 0; i < proxy_to_source.count(); ++i) {
const int source_item = proxy_to_source.at(i);
if ((orient == Qt::Vertical)
- ? !q->filterAcceptsRow(source_item, source_parent)
+ ? !filterAcceptsRowInternal(source_item, source_parent)
: !q->filterAcceptsColumn(source_item, source_parent)) {
// This source item does not satisfy the filter, so it must be removed
source_items_remove.append(source_item);
@@ -1137,7 +1175,7 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
for (int source_item = 0; source_item < source_count; ++source_item) {
if (source_to_proxy.at(source_item) == -1) {
if ((orient == Qt::Vertical)
- ? q->filterAcceptsRow(source_item, source_parent)
+ ? filterAcceptsRowInternal(source_item, source_parent)
: q->filterAcceptsColumn(source_item, source_parent)) {
// This source item satisfies the filter, so it must be added
source_items_insert.append(source_item);
@@ -1156,6 +1194,33 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
return qVectorToSet(source_items_remove);
}
+bool QSortFilterProxyModelPrivate::needsReorder(const QVector<int> &source_rows, const QModelIndex &source_parent) const
+{
+ Q_Q(const QSortFilterProxyModel);
+ Q_ASSERT(source_sort_column != -1);
+ const int proxyRowCount = q->rowCount(source_to_proxy(source_parent));
+ // If any modified proxy row no longer passes lessThan(previous, current) or lessThan(current, next) then we need to reorder.
+ return std::any_of(source_rows.begin(), source_rows.end(),
+ [this, q, proxyRowCount, source_parent](int sourceRow) -> bool {
+ const QModelIndex sourceIndex = model->index(sourceRow, source_sort_column, source_parent);
+ const QModelIndex proxyIndex = source_to_proxy(sourceIndex);
+ Q_ASSERT(proxyIndex.isValid()); // caller ensured source_rows were not filtered out
+ if (proxyIndex.row() > 0) {
+ const QModelIndex prevProxyIndex = q->sibling(proxyIndex.row() - 1, proxy_sort_column, proxyIndex);
+ const QModelIndex prevSourceIndex = proxy_to_source(prevProxyIndex);
+ if (sort_order == Qt::AscendingOrder ? q->lessThan(sourceIndex, prevSourceIndex) : q->lessThan(prevSourceIndex, sourceIndex))
+ return true;
+ }
+ if (proxyIndex.row() < proxyRowCount - 1) {
+ const QModelIndex nextProxyIndex = q->sibling(proxyIndex.row() + 1, proxy_sort_column, proxyIndex);
+ const QModelIndex nextSourceIndex = proxy_to_source(nextProxyIndex);
+ if (sort_order == Qt::AscendingOrder ? q->lessThan(nextSourceIndex, sourceIndex) : q->lessThan(sourceIndex, nextSourceIndex))
+ return true;
+ }
+ return false;
+ });
+}
+
void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &source_top_left,
const QModelIndex &source_bottom_right,
const QVector<int> &roles)
@@ -1163,106 +1228,127 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
Q_Q(QSortFilterProxyModel);
if (!source_top_left.isValid() || !source_bottom_right.isValid())
return;
- QModelIndex source_parent = source_top_left.parent();
- IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);
- if (it == source_index_mapping.constEnd()) {
- // Don't care, since we don't have mapping for this index
- return;
+
+ std::vector<QSortFilterProxyModelDataChanged> data_changed_list;
+ data_changed_list.emplace_back(source_top_left, source_bottom_right);
+
+ // Do check parents if the filter role have changed and we are recursive
+ if (filter_recursive && (roles.isEmpty() || roles.contains(filter_role))) {
+ QModelIndex source_parent = source_top_left.parent();
+
+ while (source_parent.isValid()) {
+ data_changed_list.emplace_back(source_parent, source_parent);
+ source_parent = source_parent.parent();
+ }
}
- Mapping *m = it.value();
- // Figure out how the source changes affect us
- QVector<int> source_rows_remove;
- QVector<int> source_rows_insert;
- QVector<int> source_rows_change;
- QVector<int> source_rows_resort;
- int end = qMin(source_bottom_right.row(), m->proxy_rows.count() - 1);
- for (int source_row = source_top_left.row(); source_row <= end; ++source_row) {
- if (dynamic_sortfilter) {
- if (m->proxy_rows.at(source_row) != -1) {
- if (!q->filterAcceptsRow(source_row, source_parent)) {
- // This source row no longer satisfies the filter, so it must be removed
- source_rows_remove.append(source_row);
- } else if (source_sort_column >= source_top_left.column() && source_sort_column <= source_bottom_right.column()) {
- // This source row has changed in a way that may affect sorted order
- source_rows_resort.append(source_row);
+ for (const QSortFilterProxyModelDataChanged &data_changed : data_changed_list) {
+ const QModelIndex &source_top_left = data_changed.topLeft;
+ const QModelIndex &source_bottom_right = data_changed.bottomRight;
+ const QModelIndex source_parent = source_top_left.parent();
+
+ IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);
+ if (it == source_index_mapping.constEnd()) {
+ // Don't care, since we don't have mapping for this index
+ continue;
+ }
+ Mapping *m = it.value();
+
+ // Figure out how the source changes affect us
+ QVector<int> source_rows_remove;
+ QVector<int> source_rows_insert;
+ QVector<int> source_rows_change;
+ QVector<int> source_rows_resort;
+ int end = qMin(source_bottom_right.row(), m->proxy_rows.count() - 1);
+ for (int source_row = source_top_left.row(); source_row <= end; ++source_row) {
+ if (dynamic_sortfilter) {
+ if (m->proxy_rows.at(source_row) != -1) {
+ if (!filterAcceptsRowInternal(source_row, source_parent)) {
+ // This source row no longer satisfies the filter, so it must be removed
+ source_rows_remove.append(source_row);
+ } else if (source_sort_column >= source_top_left.column() && source_sort_column <= source_bottom_right.column()) {
+ // This source row has changed in a way that may affect sorted order
+ source_rows_resort.append(source_row);
+ } else {
+ // This row has simply changed, without affecting filtering nor sorting
+ source_rows_change.append(source_row);
+ }
} else {
- // This row has simply changed, without affecting filtering nor sorting
- source_rows_change.append(source_row);
+ if (!itemsBeingRemoved.contains(source_parent, source_row) && filterAcceptsRowInternal(source_row, source_parent)) {
+ // This source row now satisfies the filter, so it must be added
+ source_rows_insert.append(source_row);
+ }
}
} else {
- if (!itemsBeingRemoved.contains(source_parent, source_row) && q->filterAcceptsRow(source_row, source_parent)) {
- // This source row now satisfies the filter, so it must be added
- source_rows_insert.append(source_row);
+ if (m->proxy_rows.at(source_row) != -1)
+ source_rows_change.append(source_row);
+ }
+ }
+
+ if (!source_rows_remove.isEmpty()) {
+ remove_source_items(m->proxy_rows, m->source_rows,
+ source_rows_remove, source_parent, Qt::Vertical);
+ QSet<int> source_rows_remove_set = qVectorToSet(source_rows_remove);
+ QVector<QModelIndex>::iterator childIt = m->mapped_children.end();
+ while (childIt != m->mapped_children.begin()) {
+ --childIt;
+ const QModelIndex source_child_index = *childIt;
+ if (source_rows_remove_set.contains(source_child_index.row())) {
+ childIt = m->mapped_children.erase(childIt);
+ remove_from_mapping(source_child_index);
}
}
- } else {
- if (m->proxy_rows.at(source_row) != -1)
- source_rows_change.append(source_row);
}
- }
- if (!source_rows_remove.isEmpty()) {
- remove_source_items(m->proxy_rows, m->source_rows,
- source_rows_remove, source_parent, Qt::Vertical);
- QSet<int> source_rows_remove_set = qVectorToSet(source_rows_remove);
- QVector<QModelIndex>::iterator childIt = m->mapped_children.end();
- while (childIt != m->mapped_children.begin()) {
- --childIt;
- const QModelIndex source_child_index = *childIt;
- if (source_rows_remove_set.contains(source_child_index.row())) {
- childIt = m->mapped_children.erase(childIt);
- remove_from_mapping(source_child_index);
+ if (!source_rows_resort.isEmpty()) {
+ if (needsReorder(source_rows_resort, source_parent)) {
+ // Re-sort the rows of this level
+ QList<QPersistentModelIndex> parents;
+ parents << q->mapFromSource(source_parent);
+ emit q->layoutAboutToBeChanged(parents, QAbstractItemModel::VerticalSortHint);
+ QModelIndexPairList source_indexes = store_persistent_indexes();
+ remove_source_items(m->proxy_rows, m->source_rows, source_rows_resort,
+ source_parent, Qt::Vertical, false);
+ sort_source_rows(source_rows_resort, source_parent);
+ insert_source_items(m->proxy_rows, m->source_rows, source_rows_resort,
+ source_parent, Qt::Vertical, false);
+ update_persistent_indexes(source_indexes);
+ emit q->layoutChanged(parents, QAbstractItemModel::VerticalSortHint);
}
+ // Make sure we also emit dataChanged for the rows
+ source_rows_change += source_rows_resort;
}
- }
- if (!source_rows_resort.isEmpty()) {
- // Re-sort the rows of this level
- QList<QPersistentModelIndex> parents;
- parents << q->mapFromSource(source_parent);
- emit q->layoutAboutToBeChanged(parents, QAbstractItemModel::VerticalSortHint);
- QModelIndexPairList source_indexes = store_persistent_indexes();
- remove_source_items(m->proxy_rows, m->source_rows, source_rows_resort,
- source_parent, Qt::Vertical, false);
- sort_source_rows(source_rows_resort, source_parent);
- insert_source_items(m->proxy_rows, m->source_rows, source_rows_resort,
- source_parent, Qt::Vertical, false);
- update_persistent_indexes(source_indexes);
- emit q->layoutChanged(parents, QAbstractItemModel::VerticalSortHint);
- // Make sure we also emit dataChanged for the rows
- source_rows_change += source_rows_resort;
- }
-
- if (!source_rows_change.isEmpty()) {
- // Find the proxy row range
- int proxy_start_row;
- int proxy_end_row;
- proxy_item_range(m->proxy_rows, source_rows_change,
- proxy_start_row, proxy_end_row);
- // ### Find the proxy column range also
- if (proxy_end_row >= 0) {
- // the row was accepted, but some columns might still be filtered out
- int source_left_column = source_top_left.column();
- while (source_left_column < source_bottom_right.column()
- && m->proxy_columns.at(source_left_column) == -1)
- ++source_left_column;
- const QModelIndex proxy_top_left = create_index(
- proxy_start_row, m->proxy_columns.at(source_left_column), it);
- int source_right_column = source_bottom_right.column();
- while (source_right_column > source_top_left.column()
- && m->proxy_columns.at(source_right_column) == -1)
- --source_right_column;
- const QModelIndex proxy_bottom_right = create_index(
- proxy_end_row, m->proxy_columns.at(source_right_column), it);
- emit q->dataChanged(proxy_top_left, proxy_bottom_right, roles);
+ if (!source_rows_change.isEmpty()) {
+ // Find the proxy row range
+ int proxy_start_row;
+ int proxy_end_row;
+ proxy_item_range(m->proxy_rows, source_rows_change,
+ proxy_start_row, proxy_end_row);
+ // ### Find the proxy column range also
+ if (proxy_end_row >= 0) {
+ // the row was accepted, but some columns might still be filtered out
+ int source_left_column = source_top_left.column();
+ while (source_left_column < source_bottom_right.column()
+ && m->proxy_columns.at(source_left_column) == -1)
+ ++source_left_column;
+ const QModelIndex proxy_top_left = create_index(
+ proxy_start_row, m->proxy_columns.at(source_left_column), it);
+ int source_right_column = source_bottom_right.column();
+ while (source_right_column > source_top_left.column()
+ && m->proxy_columns.at(source_right_column) == -1)
+ --source_right_column;
+ const QModelIndex proxy_bottom_right = create_index(
+ proxy_end_row, m->proxy_columns.at(source_right_column), it);
+ emit q->dataChanged(proxy_top_left, proxy_bottom_right, roles);
+ }
}
- }
- if (!source_rows_insert.isEmpty()) {
- sort_source_rows(source_rows_insert, source_parent);
- insert_source_items(m->proxy_rows, m->source_rows,
- source_rows_insert, source_parent, Qt::Vertical);
+ if (!source_rows_insert.isEmpty()) {
+ sort_source_rows(source_rows_insert, source_parent);
+ insert_source_items(m->proxy_rows, m->source_rows,
+ source_rows_insert, source_parent, Qt::Vertical);
+ }
}
}
@@ -1322,7 +1408,7 @@ void QSortFilterProxyModelPrivate::_q_sourceReset()
// All internal structures are deleted in clear()
q->endResetModel();
update_source_sort_column();
- if (dynamic_sortfilter)
+ if (dynamic_sortfilter && update_source_sort_column())
sort();
}
@@ -1386,18 +1472,60 @@ void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeInserted(
{
Q_UNUSED(start);
Q_UNUSED(end);
+
+ const bool toplevel = !source_parent.isValid();
+ const bool recursive_accepted = filter_recursive && !toplevel && filterAcceptsRowInternal(source_parent.row(), source_parent.parent());
//Force the creation of a mapping now, even if its empty.
//We need it because the proxy can be acessed at the moment it emits rowsAboutToBeInserted in insert_source_items
- if (can_create_mapping(source_parent))
- create_mapping(source_parent);
+ if (!filter_recursive || toplevel || recursive_accepted) {
+ if (can_create_mapping(source_parent))
+ create_mapping(source_parent);
+ if (filter_recursive)
+ complete_insert = true;
+ } else {
+ // The row could have been rejected or the parent might be not yet known... let's try to discover it
+ QModelIndex top_source_parent = source_parent;
+ QModelIndex parent = source_parent.parent();
+ QModelIndex grandParent = parent.parent();
+
+ while (parent.isValid() && !filterAcceptsRowInternal(parent.row(), grandParent)) {
+ top_source_parent = parent;
+ parent = grandParent;
+ grandParent = parent.parent();
+ }
+
+ last_top_source = top_source_parent;
+ }
}
void QSortFilterProxyModelPrivate::_q_sourceRowsInserted(
const QModelIndex &source_parent, int start, int end)
{
- source_items_inserted(source_parent, start, end, Qt::Vertical);
- if (update_source_sort_column() && dynamic_sortfilter) //previous call to update_source_sort_column may fail if the model has no column.
- sort(); // now it should succeed so we need to make sure to sort again
+ if (!filter_recursive || complete_insert) {
+ if (filter_recursive)
+ complete_insert = false;
+ source_items_inserted(source_parent, start, end, Qt::Vertical);
+ if (update_source_sort_column() && dynamic_sortfilter) //previous call to update_source_sort_column may fail if the model has no column.
+ sort(); // now it should succeed so we need to make sure to sort again
+ return;
+ }
+
+ if (filter_recursive) {
+ bool accept = false;
+
+ for (int row = start; row <= end; ++row) {
+ if (filterAcceptsRowInternal(row, source_parent)) {
+ accept = true;
+ break;
+ }
+ }
+
+ if (!accept) // the new rows have no descendants that match the filter, filter them out.
+ return;
+
+ // last_top_source should now become visible
+ _q_sourceDataChanged(last_top_source, last_top_source, QVector<int>());
+ }
}
void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeRemoved(
@@ -1413,6 +1541,27 @@ void QSortFilterProxyModelPrivate::_q_sourceRowsRemoved(
{
itemsBeingRemoved = QRowsRemoval();
source_items_removed(source_parent, start, end, Qt::Vertical);
+
+ if (filter_recursive) {
+ // Find out if removing this visible row means that some ascendant
+ // row can now be hidden.
+ // We go up until we find a row that should still be visible
+ // and then make QSFPM re-evaluate the last one we saw before that, to hide it.
+
+ QModelIndex to_hide;
+ QModelIndex source_ascendant = source_parent;
+
+ while (source_ascendant.isValid()) {
+ if (filterAcceptsRowInternal(source_ascendant.row(), source_ascendant.parent()))
+ break;
+
+ to_hide = source_ascendant;
+ source_ascendant = source_ascendant.parent();
+ }
+
+ if (to_hide.isValid())
+ _q_sourceDataChanged(to_hide, to_hide, QVector<int>());
+ }
}
void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeMoved(
@@ -1685,7 +1834,9 @@ QSortFilterProxyModel::QSortFilterProxyModel(QObject *parent)
d->sort_localeaware = false;
d->filter_column = 0;
d->filter_role = Qt::DisplayRole;
+ d->filter_recursive = false;
d->dynamic_sortfilter = true;
+ d->complete_insert = false;
connect(this, SIGNAL(modelReset()), this, SLOT(_q_clearMapping()));
}
@@ -2506,6 +2657,32 @@ void QSortFilterProxyModel::setFilterRole(int role)
}
/*!
+ \since 5.9
+ \property QSortFilterProxyModel::recursiveFiltering
+ \brief whether the filter to be applied recursively on children, and for
+ any matching child, its parents will be visible as well.
+
+ The default value is false.
+
+ \sa filterAcceptsRow()
+*/
+bool QSortFilterProxyModel::recursiveFiltering() const
+{
+ Q_D(const QSortFilterProxyModel);
+ return d->filter_recursive;
+}
+
+void QSortFilterProxyModel::setRecursiveFiltering(bool recursive)
+{
+ Q_D(QSortFilterProxyModel);
+ if (d->filter_recursive == recursive)
+ return;
+ d->filter_about_to_be_changed();
+ d->filter_recursive = recursive;
+ d->filter_changed();
+}
+
+/*!
\obsolete
This function is obsolete. Use invalidate() instead.
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h
index 06ff79ef5f..6f2e9806ed 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.h
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.h
@@ -67,6 +67,7 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel
Q_PROPERTY(bool isSortLocaleAware READ isSortLocaleAware WRITE setSortLocaleAware)
Q_PROPERTY(int sortRole READ sortRole WRITE setSortRole)
Q_PROPERTY(int filterRole READ filterRole WRITE setFilterRole)
+ Q_PROPERTY(bool recursiveFiltering READ recursiveFiltering WRITE setRecursiveFiltering)
public:
explicit QSortFilterProxyModel(QObject *parent = Q_NULLPTR);
@@ -107,6 +108,9 @@ public:
int filterRole() const;
void setFilterRole(int role);
+ bool recursiveFiltering() const;
+ void setRecursiveFiltering(bool recursive);
+
public Q_SLOTS:
void setFilterRegExp(const QString &pattern);
void setFilterWildcard(const QString &pattern);
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index 2b47d43469..bcfd88fb19 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -131,7 +131,7 @@ int QStringListModel::rowCount(const QModelIndex &parent) const
*/
QModelIndex QStringListModel::sibling(int row, int column, const QModelIndex &idx) const
{
- if (!idx.isValid() || column != 0 || row >= lst.count())
+ if (!idx.isValid() || column != 0 || row >= lst.count() || row < 0)
return QModelIndex();
return createIndex(row, 0);
diff --git a/src/corelib/json/qjson.cpp b/src/corelib/json/qjson.cpp
index d509349a51..e4bca3bcd0 100644
--- a/src/corelib/json/qjson.cpp
+++ b/src/corelib/json/qjson.cpp
@@ -45,15 +45,8 @@ QT_BEGIN_NAMESPACE
namespace QJsonPrivate
{
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
-#define Q_TO_LITTLE_ENDIAN(x) (x)
-#else
-#define Q_TO_LITTLE_ENDIAN(x) ( ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | ((x & 0xff000000) >> 24) )
-#endif
-
-static const Base emptyArray = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } };
-static const Base emptyObject = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } };
-
+static Q_CONSTEXPR Base emptyArray = { { qle_uint(sizeof(Base)) }, { 0 }, { qle_uint(0) } };
+static Q_CONSTEXPR Base emptyObject = { { qle_uint(sizeof(Base)) }, { 0 }, { qle_uint(0) } };
void Data::compact()
{
@@ -394,7 +387,7 @@ int Value::requiredStorage(QJsonValue &v, bool *compressed)
v.d->compact();
v.base = static_cast<QJsonPrivate::Base *>(v.d->header->root());
}
- return v.base ? v.base->size : sizeof(QJsonPrivate::Base);
+ return v.base ? uint(v.base->size) : sizeof(QJsonPrivate::Base);
case QJsonValue::Undefined:
case QJsonValue::Null:
case QJsonValue::Bool:
diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h
index c012ec2662..131528376b 100644
--- a/src/corelib/json/qjson_p.h
+++ b/src/corelib/json/qjson_p.h
@@ -61,6 +61,7 @@
#include <qendian.h>
#include <qnumeric.h>
+#include "private/qendian_p.h"
#include "private/qsimd_p.h"
#include <limits.h>
@@ -131,42 +132,7 @@ class Value;
class Entry;
template<typename T>
-class q_littleendian
-{
-public:
- T val;
-
- q_littleendian &operator =(T i) { val = qToLittleEndian(i); return *this; }
- operator T() const { return qFromLittleEndian(val); }
-
- bool operator ==(T i) { return qFromLittleEndian(val) == i; }
- bool operator !=(T i) { return qFromLittleEndian(val) != i; }
- bool operator ==(q_littleendian<T> i) { return val == i.val; }
- bool operator !=(q_littleendian<T> i) { return val != i.val; }
- bool operator <(T i) { return qFromLittleEndian(val) < i; }
- bool operator >(T i) { return qFromLittleEndian(val) > i; }
- bool operator <=(T i) { return qFromLittleEndian(val) <= i; }
- bool operator >=(T i) { return qFromLittleEndian(val) >= i; }
- q_littleendian &operator +=(T i) {
- val = qToLittleEndian(qFromLittleEndian(val) + i);
- return *this;
- }
- q_littleendian &operator |=(T i) {
- val = qToLittleEndian(qFromLittleEndian(val) | i);
- return *this;
- }
- q_littleendian &operator &=(T i) {
- val = qToLittleEndian(qFromLittleEndian(val) & i);
- return *this;
- }
-};
-} // namespace QJsonPrivate
-
-template <typename T>
-class QTypeInfo<QJsonPrivate::q_littleendian<T> >
- : public QTypeInfoMerger<QJsonPrivate::q_littleendian<T>, T> {};
-
-namespace QJsonPrivate {
+using q_littleendian = QLEInteger<T>;
typedef q_littleendian<short> qle_short;
typedef q_littleendian<unsigned short> qle_ushort;
@@ -174,97 +140,10 @@ typedef q_littleendian<int> qle_int;
typedef q_littleendian<unsigned int> qle_uint;
template<int pos, int width>
-class qle_bitfield
-{
-public:
- uint val;
-
- enum {
- mask = ((1u << width) - 1) << pos
- };
-
- void operator =(uint t) {
- uint i = qFromLittleEndian(val);
- i &= ~mask;
- i |= t << pos;
- val = qToLittleEndian(i);
- }
- operator uint() const {
- uint t = qFromLittleEndian(val);
- t &= mask;
- t >>= pos;
- return t;
- }
- bool operator !() const {
- return !operator uint();
- }
-
- bool operator ==(uint t) { return uint(*this) == t; }
- bool operator !=(uint t) { return uint(*this) != t; }
- bool operator <(uint t) { return uint(*this) < t; }
- bool operator >(uint t) { return uint(*this) > t; }
- bool operator <=(uint t) { return uint(*this) <= t; }
- bool operator >=(uint t) { return uint(*this) >= t; }
- qle_bitfield &operator +=(uint i) {
- *this = (uint(*this) + i);
- return *this;
- }
- qle_bitfield &operator -=(uint i) {
- *this = (uint(*this) - i);
- return *this;
- }
- qle_bitfield &operator |=(uint i) {
- *this = (uint(*this) | i);
- return *this;
- }
- qle_bitfield &operator &=(uint i) {
- *this = (uint(*this) & i);
- return *this;
- }
-};
+using qle_bitfield = QLEIntegerBitfield<uint, pos, width>;
template<int pos, int width>
-class qle_signedbitfield
-{
-public:
- uint val;
-
- enum {
- mask = ((1u << width) - 1) << pos
- };
-
- void operator =(int t) {
- uint i = qFromLittleEndian(val);
- i &= ~mask;
- i |= t << pos;
- val = qToLittleEndian(i);
- }
- operator int() const {
- uint i = qFromLittleEndian(val);
- i <<= 32 - width - pos;
- int t = (int) i;
- t >>= 32 - width;
- return t;
- }
- bool operator !() const {
- return !operator int();
- }
-
- bool operator ==(int t) { return int(*this) == t; }
- bool operator !=(int t) { return int(*this) != t; }
- bool operator <(int t) { return int(*this) < t; }
- bool operator >(int t) { return int(*this) > t; }
- bool operator <=(int t) { return int(*this) <= t; }
- bool operator >=(int t) { return int(*this) >= t; }
- qle_signedbitfield &operator +=(int i) {
- *this = (int(*this) + i);
- return *this;
- }
- qle_signedbitfield &operator -=(int i) {
- *this = (int(*this) - i);
- return *this;
- }
-};
+using qle_signedbitfield = QLEIntegerBitfield<int, pos, width>;
typedef qle_uint offset;
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index d4cc4b81df..c5a5aaf39d 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -212,6 +212,27 @@ QJsonArray &QJsonArray::operator =(const QJsonArray &other)
return *this;
}
+/*!
+ \fn QJsonArray::QJsonArray(QJsonArray &&other)
+ \since 5.10
+
+ Move-constructs a QJsonArray from \a other.
+*/
+
+/*!
+ \fn QJsonArray &QJsonArray::operator =(QJsonArray &&other)
+ \since 5.10
+
+ Move-assigns \a other to this array.
+*/
+
+/*!
+ \fn void QJsonArray::swap(QJsonArray &other)
+ \since 5.10
+
+ Swaps the array \a other with this. This operation is very fast and never fails.
+*/
+
/*! \fn QJsonArray &QJsonArray::operator+=(const QJsonValue &value)
Appends \a value to the array, and returns a reference to the array itself.
diff --git a/src/corelib/json/qjsonarray.h b/src/corelib/json/qjsonarray.h
index 3b6fa37cfa..ddba2ca78e 100644
--- a/src/corelib/json/qjsonarray.h
+++ b/src/corelib/json/qjsonarray.h
@@ -72,6 +72,20 @@ public:
QJsonArray(const QJsonArray &other);
QJsonArray &operator =(const QJsonArray &other);
+ QJsonArray(QJsonArray &&other) Q_DECL_NOTHROW
+ : d(other.d),
+ a(other.a)
+ {
+ other.d = nullptr;
+ other.a = nullptr;
+ }
+
+ QJsonArray &operator =(QJsonArray &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
+
static QJsonArray fromStringList(const QStringList &list);
static QJsonArray fromVariantList(const QVariantList &list);
QVariantList toVariantList() const;
@@ -101,6 +115,12 @@ public:
bool operator==(const QJsonArray &other) const;
bool operator!=(const QJsonArray &other) const;
+ void swap(QJsonArray &other) Q_DECL_NOTHROW
+ {
+ qSwap(d, other.d);
+ qSwap(a, other.a);
+ }
+
class const_iterator;
class iterator {
@@ -243,6 +263,8 @@ private:
QJsonPrivate::Array *a;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QJsonArray)
+
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonArray &);
#endif
diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp
index ed454d5442..6469412054 100644
--- a/src/corelib/json/qjsondocument.cpp
+++ b/src/corelib/json/qjsondocument.cpp
@@ -153,6 +153,28 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other)
return *this;
}
+/*!
+ \fn QJsonDocument::QJsonDocument(QJsonDocument &&other)
+ \since 5.10
+
+ Move-constructs a QJsonDocument from \a other.
+*/
+
+/*!
+ \fn QJsonDocument &QJsonDocument::operator =(QJsonDocument &&other)
+ \since 5.10
+
+ Move-assigns \a other to this document.
+*/
+
+/*!
+ \fn void QJsonDocument::swap(QJsonDocument &other)
+ \since 5.10
+
+ Swaps the document \a other with this. This operation is very fast and never fails.
+*/
+
+
/*! \enum QJsonDocument::DataValidation
This value is used to tell QJsonDocument whether to validate the binary data
@@ -529,6 +551,58 @@ void QJsonDocument::setArray(const QJsonArray &array)
}
/*!
+ Returns a QJsonValue representing the value for the key \a key.
+
+ Equivalent to calling object().value(key).
+
+ The returned QJsonValue is QJsonValue::Undefined if the key does not exist,
+ or if isObject() is false.
+
+ \since 5.10
+
+ \sa QJsonValue, QJsonValue::isUndefined(), QJsonObject
+ */
+const QJsonValue QJsonDocument::operator[](const QString &key) const
+{
+ if (!isObject())
+ return QJsonValue(QJsonValue::Undefined);
+
+ return object().value(key);
+}
+
+/*!
+ \overload
+ \since 5.10
+*/
+const QJsonValue QJsonDocument::operator[](QLatin1String key) const
+{
+ if (!isObject())
+ return QJsonValue(QJsonValue::Undefined);
+
+ return object().value(key);
+}
+
+/*!
+ Returns a QJsonValue representing the value for index \a i.
+
+ Equivalent to calling array().at(i).
+
+ The returned QJsonValue is QJsonValue::Undefined, if \a i is out of bounds,
+ or if isArray() is false.
+
+ \since 5.10
+
+ \sa QJsonValue, QJsonValue::isUndefined(), QJsonArray
+ */
+const QJsonValue QJsonDocument::operator[](int i) const
+{
+ if (!isArray())
+ return QJsonValue(QJsonValue::Undefined);
+
+ return array().at(i);
+}
+
+/*!
Returns \c true if the \a other document is equal to this document.
*/
bool QJsonDocument::operator==(const QJsonDocument &other) const
diff --git a/src/corelib/json/qjsondocument.h b/src/corelib/json/qjsondocument.h
index 19885a8d56..4e76af21e2 100644
--- a/src/corelib/json/qjsondocument.h
+++ b/src/corelib/json/qjsondocument.h
@@ -93,6 +93,23 @@ public:
QJsonDocument(const QJsonDocument &other);
QJsonDocument &operator =(const QJsonDocument &other);
+ QJsonDocument(QJsonDocument &&other) Q_DECL_NOTHROW
+ : d(other.d)
+ {
+ other.d = nullptr;
+ }
+
+ QJsonDocument &operator =(QJsonDocument &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
+
+ void swap(QJsonDocument &other) Q_DECL_NOTHROW
+ {
+ qSwap(d, other.d);
+ }
+
enum DataValidation {
Validate,
BypassValidation
@@ -131,6 +148,10 @@ public:
void setObject(const QJsonObject &object);
void setArray(const QJsonArray &array);
+ const QJsonValue operator[](const QString &key) const;
+ const QJsonValue operator[](QLatin1String key) const;
+ const QJsonValue operator[](int i) const;
+
bool operator==(const QJsonDocument &other) const;
bool operator!=(const QJsonDocument &other) const { return !(*this == other); }
@@ -147,6 +168,8 @@ private:
QJsonPrivate::Data *d;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QJsonDocument)
+
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonDocument &);
#endif
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index b5b6f36bc6..4a316c8a6f 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -194,6 +194,28 @@ QJsonObject &QJsonObject::operator =(const QJsonObject &other)
}
/*!
+ \fn QJsonObject::QJsonObject(QJsonObject &&other)
+ \since 5.10
+
+ Move-constructs a QJsonObject from \a other.
+*/
+
+/*!
+ \fn QJsonObject &QJsonObject::operator =(QJsonObject &&other)
+ \since 5.10
+
+ Move-assigns \a other to this object.
+*/
+
+/*!
+ \fn void QJsonObject::swap(QJsonObject &other)
+ \since 5.10
+
+ Swaps the object \a other with this. This operation is very fast and never fails.
+*/
+
+
+/*!
Converts the variant map \a map to a QJsonObject.
The keys in \a map will be used as the keys in the JSON object,
diff --git a/src/corelib/json/qjsonobject.h b/src/corelib/json/qjsonobject.h
index e238c84d98..c77e2164a8 100644
--- a/src/corelib/json/qjsonobject.h
+++ b/src/corelib/json/qjsonobject.h
@@ -74,6 +74,25 @@ public:
QJsonObject(const QJsonObject &other);
QJsonObject &operator =(const QJsonObject &other);
+ QJsonObject(QJsonObject &&other) Q_DECL_NOTHROW
+ : d(other.d), o(other.o)
+ {
+ other.d = nullptr;
+ other.o = nullptr;
+ }
+
+ QJsonObject &operator =(QJsonObject &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
+
+ void swap(QJsonObject &other) Q_DECL_NOTHROW
+ {
+ qSwap(d, other.d);
+ qSwap(o, other.o);
+ }
+
static QJsonObject fromVariantMap(const QVariantMap &map);
QVariantMap toVariantMap() const;
static QJsonObject fromVariantHash(const QVariantHash &map);
@@ -241,6 +260,8 @@ private:
QJsonPrivate::Object *o;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QJsonObject)
+
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonObject &);
#endif
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index 4b52014db1..33707b6ec3 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -276,14 +276,32 @@ QJsonValue::QJsonValue(const QJsonValue &other)
QJsonValue &QJsonValue::operator =(const QJsonValue &other)
{
QJsonValue copy(other);
- // swap(copy);
- qSwap(dbl, copy.dbl);
- qSwap(d, copy.d);
- qSwap(t, copy.t);
+ swap(copy);
return *this;
}
/*!
+ \fn QJsonValue::QJsonValue(QJsonValue &&other)
+ \since 5.10
+
+ Move-constructs a QJsonValue from \a other.
+*/
+
+/*!
+ \fn QJsonValue &QJsonValue::operator =(QJsonValue &&other)
+ \since 5.10
+
+ Move-assigns \a other to this value.
+*/
+
+/*!
+ \fn void QJsonValue::swap(QJsonValue &other)
+ \since 5.10
+
+ Swaps the value \a other with this. This operation is very fast and never fails.
+*/
+
+/*!
\fn bool QJsonValue::isNull() const
Returns \c true if the value is null.
@@ -625,6 +643,58 @@ QJsonObject QJsonValue::toObject() const
}
/*!
+ Returns a QJsonValue representing the value for the key \a key.
+
+ Equivalent to calling toObject().value(key).
+
+ The returned QJsonValue is QJsonValue::Undefined if the key does not exist,
+ or if isObject() is false.
+
+ \since 5.10
+
+ \sa QJsonValue, QJsonValue::isUndefined(), QJsonObject
+ */
+const QJsonValue QJsonValue::operator[](const QString &key) const
+{
+ if (!isObject())
+ return QJsonValue(QJsonValue::Undefined);
+
+ return toObject().value(key);
+}
+
+/*!
+ \overload
+ \since 5.10
+*/
+const QJsonValue QJsonValue::operator[](QLatin1String key) const
+{
+ if (!isObject())
+ return QJsonValue(QJsonValue::Undefined);
+
+ return toObject().value(key);
+}
+
+/*!
+ Returns a QJsonValue representing the value for index \a i.
+
+ Equivalent to calling toArray().at(i).
+
+ The returned QJsonValue is QJsonValue::Undefined, if \a i is out of bounds,
+ or if isArray() is false.
+
+ \since 5.10
+
+ \sa QJsonValue, QJsonValue::isUndefined(), QJsonArray
+ */
+const QJsonValue QJsonValue::operator[](int i) const
+{
+ if (!isArray())
+ return QJsonValue(QJsonValue::Undefined);
+
+ return toArray().at(i);
+}
+
+/*!
Returns \c true if the value is equal to \a other.
*/
bool QJsonValue::operator==(const QJsonValue &other) const
diff --git a/src/corelib/json/qjsonvalue.h b/src/corelib/json/qjsonvalue.h
index a853acaddd..5d5ec72605 100644
--- a/src/corelib/json/qjsonvalue.h
+++ b/src/corelib/json/qjsonvalue.h
@@ -92,6 +92,29 @@ public:
QJsonValue(const QJsonValue &other);
QJsonValue &operator =(const QJsonValue &other);
+ QJsonValue(QJsonValue &&other) Q_DECL_NOTHROW
+ : ui(other.ui),
+ d(other.d),
+ t(other.t)
+ {
+ other.ui = 0;
+ other.d = nullptr;
+ other.t = Null;
+ }
+
+ QJsonValue &operator =(QJsonValue &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
+
+ void swap(QJsonValue &other) Q_DECL_NOTHROW
+ {
+ qSwap(ui, other.ui);
+ qSwap(d, other.d);
+ qSwap(t, other.t);
+ }
+
static QJsonValue fromVariant(const QVariant &variant);
QVariant toVariant() const;
@@ -114,6 +137,10 @@ public:
QJsonObject toObject() const;
QJsonObject toObject(const QJsonObject &defaultValue) const;
+ const QJsonValue operator[](const QString &key) const;
+ const QJsonValue operator[](QLatin1String key) const;
+ const QJsonValue operator[](int i) const;
+
bool operator==(const QJsonValue &other) const;
bool operator!=(const QJsonValue &other) const;
@@ -217,6 +244,8 @@ public:
};
#endif
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QJsonValue)
+
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonValue &);
#endif
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 29bd5bbc6c..8abe9b2b44 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -79,7 +79,8 @@ win32 {
kernel/qsharedmemory_win.cpp \
kernel/qsystemsemaphore_win.cpp
HEADERS += \
- kernel/qwineventnotifier.h
+ kernel/qwineventnotifier.h \
+ kernel/qwineventnotifier_p.h
winrt {
SOURCES += kernel/qeventdispatcher_winrt.cpp
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index d234949d14..d1e436c371 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -375,8 +375,7 @@ void QAbstractEventDispatcher::closingDown()
*/
/*!
- Installs an event filter \a filterObj for all native event filters
- received by the application.
+ Installs an event filter \a filterObj for all native events received by the application.
The event filter \a filterObj receives events via its \l {QAbstractNativeEventFilter::}{nativeEventFilter()}
function, which is called for all events received by all threads.
diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h
index 0d3e53e4a7..3a530cf1de 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.h
+++ b/src/corelib/kernel/qabstracteventdispatcher.h
@@ -124,6 +124,8 @@ protected:
QObject *parent);
};
+Q_DECLARE_TYPEINFO(QAbstractEventDispatcher::TimerInfo, (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) ? Q_PRIMITIVE_TYPE : Q_RELOCATABLE_TYPE));
+
QT_END_NAMESPACE
#endif // QABSTRACTEVENTDISPATCHER_H
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp
index c689f47d8f..bfb3b2ff07 100644
--- a/src/corelib/kernel/qcore_mac.cpp
+++ b/src/corelib/kernel/qcore_mac.cpp
@@ -45,16 +45,16 @@ QT_BEGIN_NAMESPACE
QCFString::operator QString() const
{
- if (string.isEmpty() && type)
- const_cast<QCFString*>(this)->string = QString::fromCFString(type);
+ if (string.isEmpty() && value)
+ const_cast<QCFString*>(this)->string = QString::fromCFString(value);
return string;
}
QCFString::operator CFStringRef() const
{
- if (!type)
- const_cast<QCFString*>(this)->type = string.toCFString();
- return type;
+ if (!value)
+ const_cast<QCFString*>(this)->value = string.toCFString();
+ return value;
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index 231afb991c..db7e55f4b1 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -42,7 +42,6 @@
#ifdef Q_OS_OSX
#include <AppKit/NSText.h>
-#include <Carbon/Carbon.h>
#endif
#include <qdebug.h>
@@ -53,7 +52,11 @@ QT_BEGIN_NAMESPACE
QDebug operator<<(QDebug dbg, const NSObject *nsObject)
{
- return dbg << (nsObject ? nsObject.description.UTF8String : "NSObject(0x0)");
+ return dbg << (nsObject ?
+ dbg.verbosity() > 2 ?
+ nsObject.debugDescription.UTF8String :
+ nsObject.description.UTF8String
+ : "NSObject(0x0)");
}
QDebug operator<<(QDebug dbg, CFStringRef stringRef)
@@ -94,6 +97,45 @@ QMacAutoReleasePool::~QMacAutoReleasePool()
[static_cast<NSAutoreleasePool*>(pool) drain];
}
+#ifdef Q_OS_MACOS
+/*
+ Ensure that Objective-C objects auto-released in main(), directly or indirectly,
+ after QCoreApplication construction, are released when the app goes out of scope.
+ The memory will be reclaimed by the system either way when the process exits,
+ but by having a root level pool we ensure that the objects get their dealloc
+ methods called, which is useful for debugging object ownership graphs, etc.
+*/
+
+QT_END_NAMESPACE
+#define ROOT_LEVEL_POOL_MARKER QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE
+@interface QT_MANGLE_NAMESPACE(ROOT_LEVEL_POOL_MARKER) : NSObject @end
+@implementation QT_MANGLE_NAMESPACE(ROOT_LEVEL_POOL_MARKER) @end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(ROOT_LEVEL_POOL_MARKER);
+QT_BEGIN_NAMESPACE
+
+const char ROOT_LEVEL_POOL_DISABLE_SWITCH[] = "QT_DISABLE_ROOT_LEVEL_AUTORELEASE_POOL";
+
+QMacRootLevelAutoReleasePool::QMacRootLevelAutoReleasePool()
+{
+ if (qEnvironmentVariableIsSet(ROOT_LEVEL_POOL_DISABLE_SWITCH))
+ return;
+
+ pool.reset(new QMacAutoReleasePool);
+
+ [[[ROOT_LEVEL_POOL_MARKER alloc] init] autorelease];
+
+ if (qstrcmp(qgetenv("OBJC_DEBUG_MISSING_POOLS"), "YES") == 0) {
+ qDebug("QCoreApplication root level NSAutoreleasePool in place. Break on ~%s and use\n" \
+ "'p [NSAutoreleasePool showPools]' to show leaked objects, or set %s",
+ __FUNCTION__, ROOT_LEVEL_POOL_DISABLE_SWITCH);
+ }
+}
+
+QMacRootLevelAutoReleasePool::~QMacRootLevelAutoReleasePool()
+{
+}
+#endif
+
// -------------------------------------------------------------------------
#ifdef Q_OS_OSX
@@ -140,6 +182,7 @@ struct qtKey2CocoaKeySortLessThan
}
};
+static const int NSEscapeCharacter = 27; // not defined by Cocoa headers
static const int NumEntries = 59;
static const KeyPair entries[NumEntries] = {
{ NSEnterCharacter, Qt::Key_Enter },
@@ -148,7 +191,7 @@ static const KeyPair entries[NumEntries] = {
{ NSNewlineCharacter, Qt::Key_Return },
{ NSCarriageReturnCharacter, Qt::Key_Return },
{ NSBackTabCharacter, Qt::Key_Backtab },
- { kEscapeCharCode, Qt::Key_Escape },
+ { NSEscapeCharacter, Qt::Key_Escape },
// Cocoa sends us delete when pressing backspace!
// (NB when we reverse this list in qtKey2CocoaKey, there
// will be two indices of Qt::Key_Backspace. But is seems to work
@@ -237,6 +280,36 @@ Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode)
#endif // Q_OS_OSX
+void qt_apple_check_os_version()
+{
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ const char *os = "iOS";
+ const int version = __IPHONE_OS_VERSION_MIN_REQUIRED;
+#elif defined(__TV_OS_VERSION_MIN_REQUIRED)
+ const char *os = "tvOS";
+ const int version = __TV_OS_VERSION_MIN_REQUIRED;
+#elif defined(__WATCH_OS_VERSION_MIN_REQUIRED)
+ const char *os = "watchOS";
+ const int version = __WATCH_OS_VERSION_MIN_REQUIRED;
+#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+ const char *os = "macOS";
+ const int version = __MAC_OS_X_VERSION_MIN_REQUIRED;
+#endif
+ const NSOperatingSystemVersion required = (NSOperatingSystemVersion){
+ version / 10000, version / 100 % 100, version % 100};
+ const NSOperatingSystemVersion current = NSProcessInfo.processInfo.operatingSystemVersion;
+ if (![NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:required]) {
+ fprintf(stderr, "You can't use this version of %s with this version of %s. "
+ "You have %s %ld.%ld.%ld. Qt requires %s %ld.%ld.%ld or later.\n",
+ (reinterpret_cast<const NSString *>(
+ NSBundle.mainBundle.infoDictionary[@"CFBundleName"]).UTF8String),
+ os,
+ os, long(current.majorVersion), long(current.minorVersion), long(current.patchVersion),
+ os, long(required.majorVersion), long(required.minorVersion), long(required.patchVersion));
+ abort();
+ }
+}
+
// -------------------------------------------------------------------------
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index b87babc07a..5522a617b3 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -68,6 +68,7 @@
#endif
#include "qstring.h"
+#include "qscopedpointer.h"
#if defined( __OBJC__) && defined(QT_NAMESPACE)
#define QT_NAMESPACE_ALIAS_OBJC_CLASS(__KLASS__) @compatibility_alias __KLASS__ QT_MANGLE_NAMESPACE(__KLASS__)
@@ -76,6 +77,37 @@
#endif
QT_BEGIN_NAMESPACE
+template <typename T, typename U, U (*RetainFunction)(U), void (*ReleaseFunction)(U)>
+class QAppleRefCounted
+{
+public:
+ QAppleRefCounted(const T &t = T()) : value(t) {}
+ QAppleRefCounted(QAppleRefCounted &&other) : value(other.value) { other.value = T(); }
+ QAppleRefCounted(const QAppleRefCounted &other) : value(other.value) { if (value) RetainFunction(value); }
+ ~QAppleRefCounted() { if (value) ReleaseFunction(value); }
+ operator T() { return value; }
+ void swap(QAppleRefCounted &other) Q_DECL_NOEXCEPT_EXPR(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)
+ { QAppleRefCounted moved(std::move(other)); swap(moved); return *this; }
+ T *operator&() { return &value; }
+protected:
+ T value;
+};
+
+
+#ifdef Q_OS_MACOS
+class QMacRootLevelAutoReleasePool
+{
+public:
+ QMacRootLevelAutoReleasePool();
+ ~QMacRootLevelAutoReleasePool();
+private:
+ QScopedPointer<QMacAutoReleasePool> pool;
+};
+#endif
/*
Helper class that automates refernce counting for CFtypes.
@@ -90,33 +122,17 @@ QT_BEGIN_NAMESPACE
HIThemeGet*Shape functions, which in reality are "Copy" functions.
*/
template <typename T>
-class Q_CORE_EXPORT QCFType
+class QCFType : public QAppleRefCounted<T, CFTypeRef, CFRetain, CFRelease>
{
public:
- inline QCFType(const T &t = 0) : type(t) {}
- inline QCFType(const QCFType &helper) : type(helper.type) { if (type) CFRetain(type); }
- inline ~QCFType() { if (type) CFRelease(type); }
- inline operator T() { return type; }
- inline QCFType operator =(const QCFType &helper)
- {
- if (helper.type)
- CFRetain(helper.type);
- CFTypeRef type2 = type;
- type = helper.type;
- if (type2)
- CFRelease(type2);
- return *this;
- }
- inline T *operator&() { return &type; }
- template <typename X> X as() const { return reinterpret_cast<X>(type); }
+ using QAppleRefCounted<T, CFTypeRef, CFRetain, CFRelease>::QAppleRefCounted;
+ template <typename X> X as() const { return reinterpret_cast<X>(this->value); }
static QCFType constructFromGet(const T &t)
{
if (t)
CFRetain(t);
return QCFType<T>(t);
}
-protected:
- T type;
};
class Q_CORE_EXPORT QCFString : public QCFType<CFStringRef>
@@ -137,6 +153,8 @@ Q_CORE_EXPORT QChar qt_mac_qtKey2CocoaKey(Qt::Key key);
Q_CORE_EXPORT Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode);
#endif
+Q_CORE_EXPORT void qt_apple_check_os_version();
+
QT_END_NAMESPACE
#endif // QCORE_MAC_P_H
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 686143f8c7..3b0da136ca 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -50,6 +50,37 @@
QT_BEGIN_NAMESPACE
+QByteArray qt_readlink(const char *path)
+{
+#ifndef PATH_MAX
+ // suitably large value that won't consume too much memory
+# define PATH_MAX 1024*1024
+#endif
+
+ QByteArray buf(256, Qt::Uninitialized);
+
+ ssize_t len = ::readlink(path, buf.data(), buf.size());
+ while (len == buf.size()) {
+ // readlink(2) will fill our buffer and not necessarily terminate with NUL;
+ if (buf.size() >= PATH_MAX) {
+ errno = ENAMETOOLONG;
+ return QByteArray();
+ }
+
+ // double the size and try again
+ buf.resize(buf.size() * 2);
+ len = ::readlink(path, buf.data(), buf.size());
+ }
+
+ if (len == -1)
+ return QByteArray();
+
+ buf.resize(len);
+ return buf;
+}
+
+#ifndef QT_BOOTSTRAPPED
+
#if QT_CONFIG(poll_pollts)
# define ppoll pollts
#endif
@@ -121,4 +152,6 @@ int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout
}
}
+#endif // QT_BOOTSTRAPPED
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 86bace3260..f78d2b9f24 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -55,6 +55,7 @@
#include <QtCore/private/qglobal_p.h>
#include "qplatformdefs.h"
#include "qatomic.h"
+#include "qbytearray.h"
#ifndef Q_OS_UNIX
# error "qcore_unix_p.h included on a non-Unix system"
@@ -102,6 +103,8 @@ struct sockaddr;
QT_BEGIN_NAMESPACE
+Q_DECLARE_TYPEINFO(pollfd, Q_PRIMITIVE_TYPE);
+
// Internal operator functions for timespecs
inline timespec &normalizedTimespec(timespec &t)
{
@@ -183,10 +186,11 @@ static inline int qt_safe_open(const char *pathname, int flags, mode_t mode = 07
int fd;
EINTR_LOOP(fd, QT_OPEN(pathname, flags, mode));
- // unknown flags are ignored, so we have no way of verifying if
- // O_CLOEXEC was accepted
+#ifndef O_CLOEXEC
if (fd != -1)
::fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
+
return fd;
}
#undef QT_OPEN
@@ -337,6 +341,22 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options)
// in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp
timespec qt_gettime() Q_DECL_NOTHROW;
void qt_nanosleep(timespec amount);
+QByteArray qt_readlink(const char *path);
+
+/* non-static */
+inline bool qt_haveLinuxProcfs()
+{
+#ifdef Q_OS_LINUX
+# ifdef QT_LINUX_ALWAYS_HAVE_PROCFS
+ return true;
+# else
+ static const bool present = (access("/proc/version", F_OK) == 0);
+ return present;
+# endif
+#else
+ return false;
+#endif
+}
Q_CORE_EXPORT int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts);
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index cba279c184..609e52d9d2 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -263,7 +263,7 @@ Q_GLOBAL_STATIC(QStartUpFuncList, preRList)
typedef QList<QtCleanUpFunction> QVFuncList;
Q_GLOBAL_STATIC(QVFuncList, postRList)
#ifndef QT_NO_QOBJECT
-static QBasicMutex globalPreRoutinesMutex;
+static QBasicMutex globalRoutinesMutex;
#endif
/*!
@@ -277,13 +277,15 @@ void qAddPreRoutine(QtStartUpFunction p)
QStartUpFuncList *list = preRList();
if (!list)
return;
+
+ if (QCoreApplication::instance())
+ p();
+
// Due to C++11 parallel dynamic initialization, this can be called
// from multiple threads.
#ifndef QT_NO_THREAD
- QMutexLocker locker(&globalPreRoutinesMutex);
+ QMutexLocker locker(&globalRoutinesMutex);
#endif
- if (QCoreApplication::instance())
- p();
list->prepend(p); // in case QCoreApplication is re-created, see qt_call_pre_routines
}
@@ -292,6 +294,9 @@ void qAddPostRoutine(QtCleanUpFunction p)
QVFuncList *list = postRList();
if (!list)
return;
+#ifndef QT_NO_THREAD
+ QMutexLocker locker(&globalRoutinesMutex);
+#endif
list->prepend(p);
}
@@ -300,6 +305,9 @@ void qRemovePostRoutine(QtCleanUpFunction p)
QVFuncList *list = postRList();
if (!list)
return;
+#ifndef QT_NO_THREAD
+ QMutexLocker locker(&globalRoutinesMutex);
+#endif
list->removeAll(p);
}
@@ -308,15 +316,18 @@ static void qt_call_pre_routines()
if (!preRList.exists())
return;
+ QVFuncList list;
+ {
#ifndef QT_NO_THREAD
- QMutexLocker locker(&globalPreRoutinesMutex);
+ QMutexLocker locker(&globalRoutinesMutex);
#endif
- QVFuncList *list = &(*preRList);
- // 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.
- for (int i = 0; i < list->count(); ++i)
- list->at(i)();
+ // 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.
+ list = *preRList;
+ }
+ for (int i = 0; i < list.count(); ++i)
+ list.at(i)();
}
void Q_CORE_EXPORT qt_call_post_routines()
@@ -324,9 +335,21 @@ void Q_CORE_EXPORT qt_call_post_routines()
if (!postRList.exists())
return;
- QVFuncList *list = &(*postRList);
- while (!list->isEmpty())
- (list->takeFirst())();
+ forever {
+ QVFuncList list;
+ {
+ // extract the current list and make the stored list empty
+#ifndef QT_NO_THREAD
+ QMutexLocker locker(&globalRoutinesMutex);
+#endif
+ qSwap(*postRList, list);
+ }
+
+ if (list.isEmpty())
+ break;
+ for (QtCleanUpFunction f : qAsConst(list))
+ f();
+ }
}
@@ -437,6 +460,9 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, q_ptr(0)
#endif
{
+#if defined(Q_OS_DARWIN)
+ qt_apple_check_os_version();
+#endif
app_compile_version = flags & 0xffffff;
static const char *const empty = "";
if (argc == 0 || argv == 0) {
@@ -1019,6 +1045,21 @@ bool QCoreApplication::notifyInternal2(QObject *receiver, QEvent *event)
}
/*!
+ \internal
+ \since 5.10
+
+ Forwards the \a event to the \a receiver, using the spontaneous
+ state of the \a originatingEvent if specified.
+*/
+bool QCoreApplication::forwardEvent(QObject *receiver, QEvent *event, QEvent *originatingEvent)
+{
+ if (event && originatingEvent)
+ event->spont = originatingEvent->spont;
+
+ return notifyInternal2(receiver, event);
+}
+
+/*!
Sends \a event to \a receiver: \a {receiver}->event(\a event).
Returns the value that is returned from the receiver's event
handler. Note that this function is called for all events sent to
@@ -1916,7 +1957,10 @@ bool QCoreApplication::installTranslator(QTranslator *translationFile)
if (!QCoreApplicationPrivate::checkInstance("installTranslator"))
return false;
QCoreApplicationPrivate *d = self->d_func();
- d->translators.prepend(translationFile);
+ {
+ QWriteLocker locker(&d->translateMutex);
+ d->translators.prepend(translationFile);
+ }
#ifndef QT_NO_TRANSLATION_BUILDER
if (translationFile->isEmpty())
@@ -1948,8 +1992,10 @@ bool QCoreApplication::removeTranslator(QTranslator *translationFile)
if (!QCoreApplicationPrivate::checkInstance("removeTranslator"))
return false;
QCoreApplicationPrivate *d = self->d_func();
+ QWriteLocker locker(&d->translateMutex);
if (d->translators.removeAll(translationFile)) {
#ifndef QT_NO_QOBJECT
+ locker.unlock();
if (!self->closingDown()) {
QEvent ev(QEvent::LanguageChange);
QCoreApplication::sendEvent(self, &ev);
@@ -1985,7 +2031,7 @@ static void replacePercentN(QString *result, int n)
}
/*!
- \reentrant
+ \threadsafe
Returns the translation text for \a sourceText, by querying the
installed translation files. The translation files are searched
@@ -2014,13 +2060,7 @@ static void replacePercentN(QString *result, int n)
This function is not virtual. You can use alternative translation
techniques by subclassing \l QTranslator.
- \warning This method is reentrant only if all translators are
- installed \e before calling this method. Installing or removing
- translators while performing translations is not supported. Doing
- so will most likely result in crashes or other undesirable
- behavior.
-
- \sa QObject::tr(), installTranslator()
+ \sa QObject::tr(), installTranslator(), removeTranslator(), translate()
*/
QString QCoreApplication::translate(const char *context, const char *sourceText,
const char *disambiguation, int n)
@@ -2030,14 +2070,18 @@ QString QCoreApplication::translate(const char *context, const char *sourceText,
if (!sourceText)
return result;
- if (self && !self->d_func()->translators.isEmpty()) {
- QList<QTranslator*>::ConstIterator it;
- QTranslator *translationFile;
- for (it = self->d_func()->translators.constBegin(); it != self->d_func()->translators.constEnd(); ++it) {
- translationFile = *it;
- result = translationFile->translate(context, sourceText, disambiguation, n);
- if (!result.isNull())
- break;
+ if (self) {
+ QCoreApplicationPrivate *d = self->d_func();
+ QReadLocker locker(&d->translateMutex);
+ if (!d->translators.isEmpty()) {
+ QList<QTranslator*>::ConstIterator it;
+ QTranslator *translationFile;
+ for (it = d->translators.constBegin(); it != d->translators.constEnd(); ++it) {
+ translationFile = *it;
+ result = translationFile->translate(context, sourceText, disambiguation, n);
+ if (!result.isNull())
+ break;
+ }
}
}
@@ -2061,8 +2105,11 @@ QString qtTrId(const char *id, int n)
bool QCoreApplicationPrivate::isTranslatorInstalled(QTranslator *translator)
{
- return QCoreApplication::self
- && QCoreApplication::self->d_func()->translators.contains(translator);
+ if (!QCoreApplication::self)
+ return false;
+ QCoreApplicationPrivate *d = QCoreApplication::self->d_func();
+ QReadLocker locker(&d->translateMutex);
+ return d->translators.contains(translator);
}
#else
@@ -2840,6 +2887,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
/*!
\fn void qAddPostRoutine(QtCleanUpFunction ptr)
+ \threadsafe
\relates QCoreApplication
Adds a global routine that will be called from the QCoreApplication
@@ -2853,10 +2901,10 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
\snippet code/src_corelib_kernel_qcoreapplication.cpp 4
- Note that for an application- or module-wide cleanup, qaddPostRoutine()
+ Note that for an application- or module-wide cleanup, qAddPostRoutine()
is often not suitable. For example, if the program is split into dynamically
loaded modules, the relevant module may be unloaded long before the
- QCoreApplication destructor is called. In such cases, if using qaddPostRoutine()
+ QCoreApplication destructor is called. In such cases, if using qAddPostRoutine()
is still desirable, qRemovePostRoutine() can be used to prevent a routine
from being called by the QCoreApplication destructor. For example, if that
routine was called before the module was unloaded.
@@ -2872,11 +2920,14 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
By selecting the right parent object, this can often be made to
clean up the module's data at the right moment.
+ \note This function has been thread-safe since Qt 5.10.
+
\sa qRemovePostRoutine()
*/
/*!
\fn void qRemovePostRoutine(QtCleanUpFunction ptr)
+ \threadsafe
\relates QCoreApplication
\since 5.3
@@ -2885,6 +2936,8 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
must have been previously added to the list by a call to
qAddPostRoutine(), otherwise this function has no effect.
+ \note This function has been thread-safe since Qt 5.10.
+
\sa qAddPostRoutine()
*/
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 0fee7b3de8..34133533f0 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -206,6 +206,7 @@ private:
QT_DEPRECATED bool notifyInternal(QObject *receiver, QEvent *event); // ### Qt6 BIC: remove me
# endif
static bool notifyInternal2(QObject *receiver, QEvent *);
+ static bool forwardEvent(QObject *receiver, QEvent *event, QEvent *originatingEvent = nullptr);
#endif
static QCoreApplication *self;
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index c646786296..963aec70e8 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -58,6 +58,10 @@
#include "private/qobject_p.h"
#endif
+#ifdef Q_OS_MACOS
+#include "private/qcore_mac_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
typedef QList<QTranslator*> QTranslatorList;
@@ -85,6 +89,10 @@ public:
QString appName() const;
QString appVersion() const;
+#ifdef Q_OS_MACOS
+ QMacRootLevelAutoReleasePool autoReleasePool;
+#endif
+
#ifdef Q_OS_DARWIN
static QString infoDictionaryStringProperty(const QString &propertyName);
#endif
@@ -134,7 +142,7 @@ public:
#ifndef QT_NO_TRANSLATION
QTranslatorList translators;
-
+ QReadWriteLock translateMutex;
static bool isTranslatorInstalled(QTranslator *translator);
#endif
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 50888dd0aa..00548365d2 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -67,43 +67,33 @@ int appCmdShow = 0;
Q_CORE_EXPORT QString qAppFileName() // get application file name
{
- // We do MAX_PATH + 2 here, and request with MAX_PATH + 1, so we can handle all paths
- // up to, and including MAX_PATH size perfectly fine with string termination, as well
- // as easily detect if the file path is indeed larger than MAX_PATH, in which case we
- // need to use the heap instead. This is a work-around, since contrary to what the
- // MSDN documentation states, GetModuleFileName sometimes doesn't set the
- // ERROR_INSUFFICIENT_BUFFER error number, and we thus cannot rely on this value if
- // GetModuleFileName(0, buffer, MAX_PATH) == MAX_PATH.
- // GetModuleFileName(0, buffer, MAX_PATH + 1) == MAX_PATH just means we hit the normal
- // file path limit, and we handle it normally, if the result is MAX_PATH + 1, we use
- // heap (even if the result _might_ be exactly MAX_PATH + 1, but that's ok).
- wchar_t buffer[MAX_PATH + 2];
- DWORD v = GetModuleFileName(0, buffer, MAX_PATH + 1);
- buffer[MAX_PATH + 1] = 0;
-
- if (v == 0)
- return QString();
- else if (v <= MAX_PATH)
- return QString::fromWCharArray(buffer);
-
- // MAX_PATH sized buffer wasn't large enough to contain the full path, use heap
- wchar_t *b = 0;
- int i = 1;
- size_t size;
+ /*
+ GetModuleFileName() returns the length of the module name, when it has
+ space to store it and 0-terminate; this return is necessarily smaller than
+ the buffer size, as it doesn't include the terminator. When it lacks
+ space, the function returns the full size of the buffer and fills the
+ buffer, truncating the full path to make it fit. We have reports that
+ GetModuleFileName sometimes doesn't set the error number to
+ ERROR_INSUFFICIENT_BUFFER, as claimed by the MSDN documentation; so we
+ only trust the answer when the return is actually less than the buffer
+ size we pass in. (When truncating, except on XP, it does so by enough to
+ still have space to 0-terminate; in either case, it fills the claimed
+ space and returns the size of the space. While XP might thus give us the
+ full name, without a 0 terminator, and return its actual length, we can
+ never be sure that's what's happened until a later call with bigger buffer
+ confirms it by returning less than its buffer size.)
+ */
+ // Full path may be longer than MAX_PATH - expand until we have enough space:
+ QVarLengthArray<wchar_t, MAX_PATH + 1> space;
+ DWORD v;
+ size_t size = 1;
do {
- ++i;
- size = MAX_PATH * i;
- b = reinterpret_cast<wchar_t *>(realloc(b, (size + 1) * sizeof(wchar_t)));
- if (b)
- v = GetModuleFileName(NULL, b, DWORD(size));
- } while (b && v == size);
-
- if (b)
- *(b + size) = 0;
- QString res = QString::fromWCharArray(b);
- free(b);
+ size += MAX_PATH;
+ space.resize(int(size));
+ v = GetModuleFileName(NULL, space.data(), DWORD(space.size()));
+ } while (Q_UNLIKELY(v >= size));
- return res;
+ return QString::fromWCharArray(space.data(), v);
}
QString QCoreApplicationPrivate::appName() const
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index d728040343..bcf5b10baa 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -55,7 +55,6 @@
#include "QtCore/qlist.h"
#include "private/qabstracteventdispatcher_p.h"
#include "private/qcore_unix_p.h"
-#include "private/qpodlist_p.h"
#include "QtCore/qvarlengtharray.h"
#include "private/qtimerinfo_unix_p.h"
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 7a6149b405..569fbc2796 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -53,6 +53,7 @@
#include "qcoreapplication_p.h"
#include <private/qthread_p.h>
#include <private/qmutexpool_p.h>
+#include <private/qwineventnotifier_p.h>
QT_BEGIN_NAMESPACE
@@ -96,13 +97,14 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
QEventDispatcherWin32Private::QEventDispatcherWin32Private()
: threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
- wakeUps(0)
- , activateNotifiersPosted(false)
+ wakeUps(0), activateNotifiersPosted(false), winEventNotifierActivatedEvent(NULL)
{
}
QEventDispatcherWin32Private::~QEventDispatcherWin32Private()
{
+ if (winEventNotifierActivatedEvent)
+ CloseHandle(winEventNotifierActivatedEvent);
if (internalHwnd)
DestroyWindow(internalHwnd);
}
@@ -538,12 +540,14 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
bool needWM_QT_SENDPOSTEDEVENTS = false;
do {
DWORD waitRet = 0;
- HANDLE pHandles[MAXIMUM_WAIT_OBJECTS - 1];
+ DWORD nCount = 0;
+ HANDLE *pHandles = nullptr;
+ if (d->winEventNotifierActivatedEvent) {
+ nCount = 1;
+ pHandles = &d->winEventNotifierActivatedEvent;
+ }
QVarLengthArray<MSG> processedTimers;
while (!d->interrupt) {
- DWORD nCount = d->winEventNotifierList.count();
- Q_ASSERT(nCount < MAXIMUM_WAIT_OBJECTS - 1);
-
MSG msg;
bool haveMessage;
@@ -585,8 +589,6 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
if (!haveMessage) {
// no message - check for signalled objects
- for (int i=0; i<(int)nCount; i++)
- pHandles[i] = d->winEventNotifierList.at(i)->handle();
waitRet = MsgWaitForMultipleObjectsEx(nCount, pHandles, 0, QS_ALLINPUT, MWMO_ALERTABLE);
if ((haveMessage = (waitRet == WAIT_OBJECT_0 + nCount))) {
// a new message has arrived, process it
@@ -627,7 +629,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
DispatchMessage(&msg);
}
} else if (waitRet - WAIT_OBJECT_0 < nCount) {
- d->activateEventNotifier(d->winEventNotifierList.at(waitRet - WAIT_OBJECT_0));
+ activateEventNotifiers();
} else {
// nothing todo so break
break;
@@ -640,16 +642,11 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
&& !d->interrupt
&& (flags & QEventLoop::WaitForMoreEvents));
if (canWait) {
- DWORD nCount = d->winEventNotifierList.count();
- Q_ASSERT(nCount < MAXIMUM_WAIT_OBJECTS - 1);
- for (int i=0; i<(int)nCount; i++)
- pHandles[i] = d->winEventNotifierList.at(i)->handle();
-
emit aboutToBlock();
waitRet = MsgWaitForMultipleObjectsEx(nCount, pHandles, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE | MWMO_INPUTAVAILABLE);
emit awake();
if (waitRet - WAIT_OBJECT_0 < nCount) {
- d->activateEventNotifier(d->winEventNotifierList.at(waitRet - WAIT_OBJECT_0));
+ activateEventNotifiers();
retVal = true;
}
}
@@ -907,12 +904,12 @@ bool QEventDispatcherWin32::registerEventNotifier(QWinEventNotifier *notifier)
if (d->winEventNotifierList.contains(notifier))
return true;
- if (d->winEventNotifierList.count() >= MAXIMUM_WAIT_OBJECTS - 2) {
- qWarning("QWinEventNotifier: Cannot have more than %d enabled at one time", MAXIMUM_WAIT_OBJECTS - 2);
- return false;
- }
d->winEventNotifierList.append(notifier);
- return true;
+
+ if (!d->winEventNotifierActivatedEvent)
+ d->winEventNotifierActivatedEvent = CreateEvent(0, TRUE, FALSE, nullptr);
+
+ return QWinEventNotifierPrivate::get(notifier)->registerWaitObject();
}
void QEventDispatcherWin32::unregisterEventNotifier(QWinEventNotifier *notifier)
@@ -928,17 +925,35 @@ void QEventDispatcherWin32::unregisterEventNotifier(QWinEventNotifier *notifier)
Q_D(QEventDispatcherWin32);
int i = d->winEventNotifierList.indexOf(notifier);
- if (i != -1)
- d->winEventNotifierList.takeAt(i);
+ if (i == -1)
+ return;
+ d->winEventNotifierList.takeAt(i);
+ QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
+ if (nd->waitHandle)
+ nd->unregisterWaitObject();
}
void QEventDispatcherWin32::activateEventNotifiers()
{
Q_D(QEventDispatcherWin32);
- //### this could break if events are removed/added in the activation
- for (int i=0; i<d->winEventNotifierList.count(); i++) {
- if (WaitForSingleObjectEx(d->winEventNotifierList.at(i)->handle(), 0, TRUE) == WAIT_OBJECT_0)
- d->activateEventNotifier(d->winEventNotifierList.at(i));
+ ResetEvent(d->winEventNotifierActivatedEvent);
+
+ // Iterate backwards, because the notifier might remove itself on activate().
+ for (int i = d->winEventNotifierList.count(); --i >= 0;) {
+ QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
+ QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
+ if (WaitForSingleObject(nd->handleToEvent, 0) == WAIT_OBJECT_0) {
+ nd->unregisterWaitObject();
+ d->activateEventNotifier(notifier);
+ }
+ }
+
+ // Re-register the remaining activated notifiers.
+ for (int i = 0; i < d->winEventNotifierList.count(); ++i) {
+ QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
+ QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
+ if (!nd->waitHandle)
+ nd->registerWaitObject();
}
}
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index f6d1bffdf5..683c7f8f36 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -161,6 +161,7 @@ class Q_CORE_EXPORT QEventDispatcherWin32Private : public QAbstractEventDispatch
public:
QEventDispatcherWin32Private();
~QEventDispatcherWin32Private();
+ static QEventDispatcherWin32Private *get(QEventDispatcherWin32 *q) { return q->d_func(); }
DWORD threadId;
@@ -192,6 +193,7 @@ public:
void postActivateSocketNotifiers();
void doWsaAsyncSelect(int socket, long event);
+ HANDLE winEventNotifierActivatedEvent;
QList<QWinEventNotifier *> winEventNotifierList;
void activateEventNotifier(QWinEventNotifier * wen);
diff --git a/src/corelib/kernel/qfunctions_fake_env_p.h b/src/corelib/kernel/qfunctions_fake_env_p.h
index 16d18c4d88..7010d2cf5d 100644
--- a/src/corelib/kernel/qfunctions_fake_env_p.h
+++ b/src/corelib/kernel/qfunctions_fake_env_p.h
@@ -77,7 +77,9 @@ struct NameEquals {
{ return qstrcmp(other.name, name) == 0; }
};
+#ifndef Q_CLANG_QDOC
Q_GLOBAL_STATIC(QVector<Variable>, qt_app_environment)
+#endif
errno_t qt_fake_getenv_s(size_t *sizeNeeded, char *buffer, size_t bufferSize, const char *varName)
{
diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp
index cb4b93905e..02c58858ff 100644
--- a/src/corelib/kernel/qjnihelpers.cpp
+++ b/src/corelib/kernel/qjnihelpers.cpp
@@ -75,6 +75,11 @@ static jmethodID g_hideSplashScreenMethodID = Q_NULLPTR;
Q_GLOBAL_STATIC(std::deque<QtAndroidPrivate::Runnable>, g_pendingRunnables);
static QBasicMutex g_pendingRunnablesMutex;
+Q_GLOBAL_STATIC_WITH_ARGS(QtAndroidPrivate::OnBindListener*, g_onBindListener, (nullptr));
+Q_GLOBAL_STATIC(QMutex, g_onBindListenerMutex);
+Q_GLOBAL_STATIC(QSemaphore, g_waitForServiceSetupSemaphore);
+Q_GLOBAL_STATIC(QAtomicInt, g_serviceSetupLockers);
+
class PermissionsResultClass : public QObject
{
Q_OBJECT
@@ -406,7 +411,7 @@ jint QtAndroidPrivate::initJNI(JavaVM *vm, JNIEnv *env)
g_runPendingCppRunnablesMethodID = env->GetStaticMethodID(jQtNative,
"runPendingCppRunnablesOnAndroidThread",
"()V");
- g_hideSplashScreenMethodID = env->GetStaticMethodID(jQtNative, "hideSplashScreen", "()V");
+ g_hideSplashScreenMethodID = env->GetStaticMethodID(jQtNative, "hideSplashScreen", "(I)V");
g_jNativeClass = static_cast<jclass>(env->NewGlobalRef(jQtNative));
env->DeleteLocalRef(jQtNative);
@@ -511,7 +516,7 @@ void QtAndroidPrivate::requestPermissions(JNIEnv *env, const QStringList &permis
}, env);
}
-QHash<QString, QtAndroidPrivate::PermissionsResult> QtAndroidPrivate::requestPermissionsSync(JNIEnv *env, const QStringList &permissions, int timeoutMs)
+QtAndroidPrivate::PermissionsHash QtAndroidPrivate::requestPermissionsSync(JNIEnv *env, const QStringList &permissions, int timeoutMs)
{
QSharedPointer<QHash<QString, QtAndroidPrivate::PermissionsResult>> res(new QHash<QString, QtAndroidPrivate::PermissionsResult>());
QSharedPointer<QSemaphore> sem(new QSemaphore);
@@ -567,9 +572,36 @@ void QtAndroidPrivate::unregisterKeyEventListener(QtAndroidPrivate::KeyEventList
g_keyEventListeners()->listeners.removeOne(listener);
}
-void QtAndroidPrivate::hideSplashScreen(JNIEnv *env)
+void QtAndroidPrivate::hideSplashScreen(JNIEnv *env, int duration)
+{
+ env->CallStaticVoidMethod(g_jNativeClass, g_hideSplashScreenMethodID, duration);
+}
+
+void QtAndroidPrivate::waitForServiceSetup()
+{
+ g_waitForServiceSetupSemaphore->acquire();
+}
+
+int QtAndroidPrivate::acuqireServiceSetup(int flags)
+{
+ g_serviceSetupLockers->ref();
+ return flags;
+}
+
+void QtAndroidPrivate::setOnBindListener(QtAndroidPrivate::OnBindListener *listener)
+{
+ QMutexLocker lock(g_onBindListenerMutex);
+ *g_onBindListener = listener;
+ if (!(*g_serviceSetupLockers)--)
+ g_waitForServiceSetupSemaphore->release();
+}
+
+jobject QtAndroidPrivate::callOnBindListener(jobject intent)
{
- env->CallStaticVoidMethod(g_jNativeClass, g_hideSplashScreenMethodID);
+ QMutexLocker lock(g_onBindListenerMutex);
+ if (g_onBindListener)
+ return (*g_onBindListener)->onBind(intent);
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qjnihelpers_p.h b/src/corelib/kernel/qjnihelpers_p.h
index d88e4fc19e..ea5103c173 100644
--- a/src/corelib/kernel/qjnihelpers_p.h
+++ b/src/corelib/kernel/qjnihelpers_p.h
@@ -100,6 +100,13 @@ namespace QtAndroidPrivate
virtual bool handleKeyEvent(jobject event) = 0;
};
+ class Q_CORE_EXPORT OnBindListener
+ {
+ public:
+ virtual ~OnBindListener() {}
+ virtual jobject onBind(jobject intent) = 0;
+ };
+
enum class PermissionsResult {
Granted,
Denied
@@ -142,7 +149,14 @@ namespace QtAndroidPrivate
Q_CORE_EXPORT void registerKeyEventListener(KeyEventListener *listener);
Q_CORE_EXPORT void unregisterKeyEventListener(KeyEventListener *listener);
- Q_CORE_EXPORT void hideSplashScreen(JNIEnv *env);
+ Q_CORE_EXPORT void hideSplashScreen(JNIEnv *env, int duration = 0);
+
+
+ Q_CORE_EXPORT void waitForServiceSetup();
+ Q_CORE_EXPORT int acuqireServiceSetup(int flags);
+ Q_CORE_EXPORT void setOnBindListener(OnBindListener *listener);
+ Q_CORE_EXPORT jobject callOnBindListener(jobject intent);
+
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h
index 773884047a..305e9065e9 100644
--- a/src/corelib/kernel/qmath.h
+++ b/src/corelib/kernel/qmath.h
@@ -149,6 +149,8 @@ inline qreal qPow(qreal x, qreal y)
return pow(x, y);
}
+// TODO: use template variables (e.g. Qt::pi<type>) for these once we have C++14 support:
+
#ifndef M_E
#define M_E (2.7182818284590452354)
#endif
@@ -242,16 +244,13 @@ Q_DECL_CONSTEXPR inline double qRadiansToDegrees(double radians)
}
-#if defined(QT_HAS_BUILTIN_CLZ)
-inline quint32 qNextPowerOfTwo(quint32 v)
+Q_DECL_RELAXED_CONSTEXPR inline quint32 qNextPowerOfTwo(quint32 v)
{
+#if defined(QT_HAS_BUILTIN_CLZ)
if (v == 0)
return 1;
return 2U << (31 ^ QAlgorithmsPrivate::qt_builtin_clz(v));
-}
#else
-inline quint32 qNextPowerOfTwo(quint32 v)
-{
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
@@ -259,19 +258,16 @@ inline quint32 qNextPowerOfTwo(quint32 v)
v |= v >> 16;
++v;
return v;
-}
#endif
+}
-#if defined(QT_HAS_BUILTIN_CLZLL)
-inline quint64 qNextPowerOfTwo(quint64 v)
+Q_DECL_RELAXED_CONSTEXPR inline quint64 qNextPowerOfTwo(quint64 v)
{
+#if defined(QT_HAS_BUILTIN_CLZLL)
if (v == 0)
return 1;
return Q_UINT64_C(2) << (63 ^ QAlgorithmsPrivate::qt_builtin_clzll(v));
-}
#else
-inline quint64 qNextPowerOfTwo(quint64 v)
-{
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
@@ -280,15 +276,15 @@ inline quint64 qNextPowerOfTwo(quint64 v)
v |= v >> 32;
++v;
return v;
-}
#endif
+}
-inline quint32 qNextPowerOfTwo(qint32 v)
+Q_DECL_RELAXED_CONSTEXPR inline quint32 qNextPowerOfTwo(qint32 v)
{
return qNextPowerOfTwo(quint32(v));
}
-inline quint64 qNextPowerOfTwo(qint64 v)
+Q_DECL_RELAXED_CONSTEXPR inline quint64 qNextPowerOfTwo(qint64 v)
{
return qNextPowerOfTwo(quint64(v));
}
diff --git a/src/corelib/kernel/qmath.qdoc b/src/corelib/kernel/qmath.qdoc
index 3a692d5935..a2e24e925b 100644
--- a/src/corelib/kernel/qmath.qdoc
+++ b/src/corelib/kernel/qmath.qdoc
@@ -35,7 +35,24 @@
These functions are partly convenience definitions for basic math operations
not available in the C or Standard Template Libraries.
- \pagekeywords math trigonometry qmath floor ceiling absolute sine cosine tangent inverse tan exponent power natural logarithm
+ The header also ensures some constants specified in POSIX, but not present
+ in C++ standards (so absent from <math.h> on some platforms), are defined:
+
+ \value M_E The base of the natural logarithms, e = exp(1)
+ \value M_LOG2E The base-two logarithm of e
+ \value M_LOG10E The base-ten logarithm of e
+ \value M_LN2 The natural logarithm of two
+ \value M_LN10 The natural logarithm of ten
+ \value M_PI The ratio of a circle's circumference to diameter, \unicode{0x3C0}
+ \value M_PI_2 Half M_PI, \unicode{0x3C0} / 2
+ \value M_PI_4 Quarter M_PI, \unicode{0x3C0} / 4
+ \value M_1_PI The inverse of M_PI, 1 / \unicode{0x3C0}
+ \value M_2_PI Twice the inverse of M_PI, 2 / \unicode{0x3C0}
+ \value M_2_SQRTPI Two divided by the square root of pi, 2 / \unicode{0x221A}\unicode{0x3C0}
+ \value M_SQRT2 The square root of two, \unicode{0x221A}2
+ \value M_SQRT1_2 The square roof of half, 1 / \unicode{0x221A}2
+
+ \pagekeywords math trigonometry qmath floor ceiling absolute sine cosine tangent inverse tan exponent power natural logarithm pi
*/
/*!
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index a8003f7e46..f07b463482 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1489,6 +1489,51 @@ bool QMetaObject::invokeMethod(QObject *obj,
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
+bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *slot, Qt::ConnectionType type, void *ret)
+{
+ if (! object)
+ return false;
+
+ QThread *currentThread = QThread::currentThread();
+ QThread *objectThread = object->thread();
+ if (type == Qt::AutoConnection)
+ type = (currentThread == objectThread) ? Qt::DirectConnection : Qt::QueuedConnection;
+
+ void *argv[] = { ret };
+
+ if (type == Qt::DirectConnection) {
+ slot->call(object, argv);
+ } else if (type == Qt::QueuedConnection) {
+ if (argv[0]) {
+ qWarning("QMetaObject::invokeMethod: Unable to invoke methods with return values in "
+ "queued connections");
+ 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));
+ } else if (type == Qt::BlockingQueuedConnection) {
+#ifndef QT_NO_THREAD
+ if (currentThread == objectThread)
+ qWarning("QMetaObject::invokeMethod: Dead lock detected");
+
+ QSemaphore semaphore;
+ QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 0, 0, argv, &semaphore));
+ semaphore.acquire();
+#endif // QT_NO_THREAD
+ } else {
+ qWarning("QMetaObject::invokeMethod: Unknown connection type");
+ return false;
+ }
+ return true;
+}
+
/*! \fn bool QMetaObject::invokeMethod(QObject *obj, const char *member,
QGenericReturnArgument ret,
QGenericArgument val0 = QGenericArgument(0),
@@ -1544,6 +1589,44 @@ bool QMetaObject::invokeMethod(QObject *obj,
*/
/*!
+ \fn bool QMetaObject::invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = Q_NULLPTR)
+
+ \since 5.10
+
+ \overload
+*/
+
+/*!
+ \fn bool QMetaObject::invokeMethod(QObject *receiver, PointerToMemberFunction function, MemberFunctionReturnType *ret)
+
+ \since 5.10
+
+ \overload
+
+ This overload invokes the member function using the connection type Qt::AutoConnection.
+*/
+
+/*!
+ \fn bool QMetaObject::invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = Q_NULLPTR)
+
+ \since 5.10
+
+ \overload
+
+ Call the functor in the event loop of \a context.
+*/
+
+/*!
+ \fn bool QMetaObject::invokeMethod(QObject *context, Functor function, FunctorReturnType *ret = Q_NULLPTR)
+
+ \since 5.10
+
+ \overload
+
+ Call the functor in the event loop of \a context using the connection type Qt::AutoConnection.
+*/
+
+/*!
\fn QMetaObject::Connection::Connection(const Connection &other)
Constructs a copy of \a other.
@@ -3264,7 +3347,21 @@ int QMetaProperty::notifySignalIndex() const
if (hasNotifySignal()) {
int offset = priv(mobj->d.data)->propertyData +
priv(mobj->d.data)->propertyCount * 3 + idx;
- return mobj->d.data[offset] + mobj->methodOffset();
+ int methodIndex = mobj->d.data[offset];
+ if (methodIndex & IsUnresolvedSignal) {
+ methodIndex &= ~IsUnresolvedSignal;
+ const QByteArray signalName = stringData(mobj, methodIndex);
+ const QMetaObject *m = mobj;
+ const int idx = indexOfMethodRelative<MethodSignal>(&m, signalName, 0, nullptr);
+ if (idx >= 0) {
+ return idx + m->methodOffset();
+ } else {
+ qWarning("QMetaProperty::notifySignal: cannot find the NOTIFY signal %s in class %s for property '%s'",
+ signalName.constData(), objectClassName(mobj), name());
+ return -1;
+ }
+ }
+ return methodIndex + mobj->methodOffset();
} else {
return -1;
}
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index e247c48703..434ef84808 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -111,7 +111,8 @@ enum MetaObjectFlags {
enum MetaDataFlags {
IsUnresolvedType = 0x80000000,
- TypeNameIndexMask = 0x7FFFFFFF
+ TypeNameIndexMask = 0x7FFFFFFF,
+ IsUnresolvedSignal = 0x70000000
};
enum EnumFlags {
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index 56f187a59d..e3b70638c6 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -190,12 +190,13 @@ class QMetaEnumBuilderPrivate
{
public:
QMetaEnumBuilderPrivate(const QByteArray& _name)
- : name(_name), isFlag(false)
+ : name(_name), isFlag(false), isScoped(false)
{
}
QByteArray name;
bool isFlag;
+ bool isScoped;
QList<QByteArray> keys;
QVector<int> values;
};
@@ -637,6 +638,7 @@ QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QMetaEnum& prototype)
{
QMetaEnumBuilder en = addEnumerator(prototype.name());
en.setIsFlag(prototype.isFlag());
+ en.setIsScoped(prototype.isScoped());
int count = prototype.keyCount();
for (int index = 0; index < count; ++index)
en.addKey(prototype.key(index), prototype.value(index));
@@ -1408,12 +1410,13 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
Q_ASSERT(!buf || dataIndex == pmeta->enumeratorData);
for (const auto &enumerator : d->enumerators) {
int name = strings.enter(enumerator.name);
- int isFlag = (int)(enumerator.isFlag);
+ int isFlag = enumerator.isFlag ? EnumIsFlag : 0;
+ int isScoped = enumerator.isScoped ? EnumIsScoped : 0;
int count = enumerator.keys.size();
int enumOffset = enumIndex;
if (buf) {
data[dataIndex] = name;
- data[dataIndex + 1] = isFlag;
+ data[dataIndex + 1] = isFlag | isScoped;
data[dataIndex + 2] = count;
data[dataIndex + 3] = enumOffset;
}
@@ -1641,6 +1644,7 @@ void QMetaObjectBuilder::serialize(QDataStream& stream) const
for (const auto &enumerator : d->enumerators) {
stream << enumerator.name;
stream << enumerator.isFlag;
+ stream << enumerator.isScoped;
stream << enumerator.keys;
stream << enumerator.values;
}
@@ -1807,6 +1811,7 @@ void QMetaObjectBuilder::deserialize
addEnumerator(name);
QMetaEnumBuilderPrivate &enumerator = d->enumerators[index];
stream >> enumerator.isFlag;
+ stream >> enumerator.isScoped;
stream >> enumerator.keys;
stream >> enumerator.values;
if (enumerator.keys.size() != enumerator.values.size()) {
@@ -2633,6 +2638,31 @@ void QMetaEnumBuilder::setIsFlag(bool value)
}
/*!
+ Return \c true if this enumerator should be considered scoped (C++11 enum class).
+
+ \sa setIsScoped()
+*/
+bool QMetaEnumBuilder::isScoped() const
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d)
+ return d->isScoped;
+ return false;
+}
+
+/*!
+ Sets this enumerator to be a scoped enum if \value is true
+
+ \sa isScoped()
+*/
+void QMetaEnumBuilder::setIsScoped(bool value)
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d)
+ d->isScoped = value;
+}
+
+/*!
Returns the number of keys.
\sa key(), addKey()
diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h
index 144595330d..03b2afaebc 100644
--- a/src/corelib/kernel/qmetaobjectbuilder_p.h
+++ b/src/corelib/kernel/qmetaobjectbuilder_p.h
@@ -300,6 +300,9 @@ public:
bool isFlag() const;
void setIsFlag(bool value);
+ bool isScoped() const;
+ void setIsScoped(bool value);
+
int keyCount() const;
QByteArray key(int index) const;
int value(int index) const;
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index b75f2ad9dc..e48807ea49 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -308,6 +308,7 @@ struct DefinedTypesFilter {
\omitvalue TrackingPointerToQObject
\omitvalue WasDeclaredAsMetaType
\omitvalue IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5.
+ \omitvalue PointerToGadget
*/
/*!
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index d88f469e0f..f704c5b21a 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -462,7 +462,8 @@ public:
WeakPointerToQObject = 0x40,
TrackingPointerToQObject = 0x80,
WasDeclaredAsMetaType = 0x100,
- IsGadget = 0x200
+ IsGadget = 0x200,
+ PointerToGadget = 0x400
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
@@ -1388,6 +1389,19 @@ namespace QtPrivate
enum { Value = sizeof(checkType(&T::qt_check_for_QGADGET_macro)) == sizeof(void *) };
};
+ template<typename T, typename Enable = void>
+ struct IsPointerToGadgetHelper { enum { Value = false }; };
+
+ template<typename T>
+ struct IsPointerToGadgetHelper<T*, typename T::QtGadgetHelper>
+ {
+ using BaseType = T;
+ template <typename X>
+ static char checkType(void (X::*)());
+ static void *checkType(void (T::*)());
+ enum { Value = sizeof(checkType(&T::qt_check_for_QGADGET_macro)) == sizeof(void *) };
+ };
+
template<typename T> char qt_getEnumMetaObject(const T&);
@@ -1423,6 +1437,11 @@ namespace QtPrivate
static inline const QMetaObject *value() { return &T::staticMetaObject; }
};
template<typename T>
+ struct MetaObjectForType<T, typename QEnableIf<IsPointerToGadgetHelper<T>::Value>::Type>
+ {
+ static inline const QMetaObject *value() { return &IsPointerToGadgetHelper<T>::BaseType::staticMetaObject; }
+ };
+ template<typename T>
struct MetaObjectForType<T, typename std::enable_if<IsQEnumHelper<T>::Value>::type >
{
static inline const QMetaObject *value() { return qt_getEnumMetaObject(T()); }
@@ -1578,6 +1597,7 @@ namespace QtPrivate
template <typename T, int =
QtPrivate::IsPointerToTypeDerivedFromQObject<T>::Value ? QMetaType::PointerToQObject :
QtPrivate::IsGadgetHelper<T>::Value ? QMetaType::IsGadget :
+ QtPrivate::IsPointerToGadgetHelper<T>::Value ? QMetaType::PointerToGadget :
QtPrivate::IsQEnumHelper<T>::Value ? QMetaType::IsEnumeration : 0>
struct QMetaTypeIdQObject
{
@@ -1631,6 +1651,7 @@ namespace QtPrivate {
| (IsTrackingPointerToTypeDerivedFromQObject<T>::Value ? QMetaType::TrackingPointerToQObject : 0)
| (std::is_enum<T>::value ? QMetaType::IsEnumeration : 0)
| (IsGadgetHelper<T>::Value ? QMetaType::IsGadget : 0)
+ | (IsPointerToGadgetHelper<T>::Value ? QMetaType::PointerToGadget : 0)
};
};
@@ -1798,6 +1819,30 @@ struct QMetaTypeIdQObject<T, QMetaType::IsGadget>
};
template <typename T>
+struct QMetaTypeIdQObject<T*, QMetaType::PointerToGadget>
+{
+ enum {
+ Defined = 1
+ };
+
+ static int qt_metatype_id()
+ {
+ static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0);
+ if (const int id = metatype_id.loadAcquire())
+ return id;
+ const char * const cName = T::staticMetaObject.className();
+ QByteArray typeName;
+ typeName.reserve(int(strlen(cName)) + 1);
+ typeName.append(cName).append('*');
+ const int newId = qRegisterNormalizedMetaType<T*>(
+ typeName,
+ reinterpret_cast<T**>(quintptr(-1)));
+ metatype_id.storeRelease(newId);
+ return newId;
+ }
+};
+
+template <typename T>
struct QMetaTypeIdQObject<T, QMetaType::IsEnumeration>
{
enum {
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 3f50716cd7..3b0f7ead09 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2339,7 +2339,7 @@ static void err_info_about_objects(const char * func,
a thread different from this object's thread. Do not use this
function in this type of scenario.
- \sa senderSignalIndex(), QSignalMapper
+ \sa senderSignalIndex()
*/
QObject *QObject::sender() const
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 6941c55896..2e66daa914 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -304,7 +304,7 @@ public:
static inline typename std::enable_if<QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1, QMetaObject::Connection>::type
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
{
- return connect(sender, signal, sender, slot, Qt::DirectConnection);
+ return connect(sender, signal, sender, std::move(slot), Qt::DirectConnection);
}
//connect to a functor, with a "context" object defining in which event loop is going to be executed
@@ -334,7 +334,7 @@ public:
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
new QtPrivate::QFunctorSlotObject<Func2, SlotArgumentCount,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotArgumentCount>::Value,
- typename SignalType::ReturnType>(slot),
+ typename SignalType::ReturnType>(std::move(slot)),
type, types, &SignalType::Object::staticMetaObject);
}
#endif //Q_QDOC
diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h
index d7ae63a98c..c775d807b1 100644
--- a/src/corelib/kernel/qobject_impl.h
+++ b/src/corelib/kernel/qobject_impl.h
@@ -74,60 +74,6 @@ namespace QtPrivate {
template <typename... Args> struct ConnectionTypes<List<Args...>, true>
{ static const int *types() { static const int t[sizeof...(Args) + 1] = { (QtPrivate::QMetaTypeIdHelper<Args>::qt_metatype_id())..., 0 }; return t; } };
- // internal base class (interface) containing functions required to call a slot managed by a pointer to function.
- class QSlotObjectBase {
- QAtomicInt m_ref;
- // don't use virtual functions here; we don't want the
- // compiler to create tons of per-polymorphic-class stuff that
- // we'll never need. We just use one function pointer.
- typedef void (*ImplFn)(int which, QSlotObjectBase* this_, QObject *receiver, void **args, bool *ret);
- const ImplFn m_impl;
- protected:
- enum Operation {
- Destroy,
- Call,
- Compare,
-
- NumOperations
- };
- 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
- { if (!m_ref.deref()) m_impl(Destroy, this, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); }
-
- inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, Q_NULLPTR, a, &ret); return ret; }
- inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, Q_NULLPTR); }
- protected:
- ~QSlotObjectBase() {}
- private:
- Q_DISABLE_COPY(QSlotObjectBase)
- };
- // implementation of QSlotObjectBase for which the slot is a pointer to member function of a QObject
- // Args and R are the List of arguments and the returntype of the signal to which the slot is connected.
- template<typename Func, typename Args, typename R> class QSlotObject : public QSlotObjectBase
- {
- typedef QtPrivate::FunctionPointer<Func> FuncType;
- Func function;
- static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)
- {
- switch (which) {
- case Destroy:
- delete static_cast<QSlotObject*>(this_);
- break;
- case Call:
- FuncType::template call<Args, R>(static_cast<QSlotObject*>(this_)->function, static_cast<typename FuncType::Object *>(r), a);
- break;
- case Compare:
- *ret = *reinterpret_cast<Func *>(a) == static_cast<QSlotObject*>(this_)->function;
- break;
- case NumOperations: ;
- }
- }
- public:
- explicit QSlotObject(Func f) : QSlotObjectBase(&impl), function(f) {}
- };
// implementation of QSlotObjectBase for which the slot is a static function
// Args and R are the List of arguments and the returntype of the signal to which the slot is connected.
template<typename Func, typename Args, typename R> class QStaticSlotObject : public QSlotObjectBase
@@ -151,30 +97,6 @@ namespace QtPrivate {
public:
explicit QStaticSlotObject(Func f) : QSlotObjectBase(&impl), function(f) {}
};
- // implementation of QSlotObjectBase for which the slot is a functor (or lambda)
- // N is the number of arguments
- // Args and R are the List of arguments and the returntype of the signal to which the slot is connected.
- template<typename Func, int N, typename Args, typename R> class QFunctorSlotObject : public QSlotObjectBase
- {
- typedef QtPrivate::Functor<Func, N> FuncType;
- Func function;
- static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)
- {
- switch (which) {
- case Destroy:
- delete static_cast<QFunctorSlotObject*>(this_);
- break;
- case Call:
- FuncType::template call<Args, R>(static_cast<QFunctorSlotObject*>(this_)->function, r, a);
- break;
- case Compare: // not implemented
- case NumOperations:
- Q_UNUSED(ret);
- }
- }
- public:
- explicit QFunctorSlotObject(const Func &f) : QSlotObjectBase(&impl), function(f) {}
- };
}
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 7b9253ac64..ad88bcf274 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -235,7 +235,7 @@ public:
mutable quint32 connectedSignals[2];
union {
- QObject *currentChildBeingDeleted;
+ QObject *currentChildBeingDeleted; // should only be used when QObjectData::isDeletingChildren is set
QAbstractDeclarativeData *declarativeData; //extra data used by the declarative module
};
@@ -244,6 +244,7 @@ public:
QAtomicPointer<QtSharedPointer::ExternalRefCountData> sharedRefcount;
};
+Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_MOVABLE_TYPE);
/*! \internal
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index cec822ad14..5fc8937f23 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -57,7 +57,6 @@ struct QArrayData;
typedef QArrayData QByteArrayData;
class QString;
-
#ifndef Q_MOC_OUTPUT_REVISION
#define Q_MOC_OUTPUT_REVISION 67
#endif
@@ -467,6 +466,91 @@ struct Q_CORE_EXPORT QMetaObject
val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
+#ifdef Q_QDOC
+ template<typename PointerToMemberFunction, typename MemberFunctionReturnType>
+ static bool invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = nullptr);
+ template<typename PointerToMemberFunction, typename MemberFunctionReturnType>
+ static bool invokeMethod(QObject *receiver, PointerToMemberFunction function, MemberFunctionReturnType *ret);
+ template<typename Functor, typename FunctorReturnType>
+ static bool invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = nullptr);
+ template<typename Functor, typename FunctorReturnType>
+ static bool invokeMethod(QObject *context, Functor function, FunctorReturnType *ret);
+#else
+
+ // invokeMethod() for member function pointer
+ template <typename Func>
+ static typename std::enable_if<QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
+ && !std::is_convertible<Func, const char*>::value
+ && QtPrivate::FunctionPointer<Func>::ArgumentCount == 0, bool>::type
+ invokeMethod(typename QtPrivate::FunctionPointer<Func>::Object *object,
+ Func function,
+ Qt::ConnectionType type = Qt::AutoConnection,
+ typename QtPrivate::FunctionPointer<Func>::ReturnType *ret = nullptr)
+ {
+ return invokeMethodImpl(object, new QtPrivate::QSlotObjectWithNoArgs<Func>(function), type, ret);
+ }
+
+ template <typename Func>
+ static typename std::enable_if<QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
+ && !std::is_convertible<Func, const char*>::value
+ && QtPrivate::FunctionPointer<Func>::ArgumentCount == 0, bool>::type
+ invokeMethod(typename QtPrivate::FunctionPointer<Func>::Object *object,
+ Func function,
+ typename QtPrivate::FunctionPointer<Func>::ReturnType *ret)
+ {
+ return invokeMethodImpl(object, new QtPrivate::QSlotObjectWithNoArgs<Func>(function), Qt::AutoConnection, ret);
+ }
+
+ // invokeMethod() for function pointer (not member)
+ template <typename Func>
+ static typename std::enable_if<!QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
+ && !std::is_convertible<Func, const char*>::value
+ && QtPrivate::FunctionPointer<Func>::ArgumentCount == 0, bool>::type
+ invokeMethod(QObject *context, Func function,
+ Qt::ConnectionType type = Qt::AutoConnection,
+ typename QtPrivate::FunctionPointer<Func>::ReturnType *ret = nullptr)
+ {
+ return invokeMethodImpl(context, new QtPrivate::QFunctorSlotObjectWithNoArgsImplicitReturn<Func>(function), type, ret);
+ }
+
+ template <typename Func>
+ static typename std::enable_if<!QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
+ && !std::is_convertible<Func, const char*>::value
+ && QtPrivate::FunctionPointer<Func>::ArgumentCount == 0, bool>::type
+ invokeMethod(QObject *context, Func function,
+ typename QtPrivate::FunctionPointer<Func>::ReturnType *ret)
+ {
+ return invokeMethodImpl(context, new QtPrivate::QFunctorSlotObjectWithNoArgsImplicitReturn<Func>(function), Qt::AutoConnection, ret);
+ }
+
+ // invokeMethod() for Functor
+ template <typename Func>
+ static typename std::enable_if<!QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
+ && QtPrivate::FunctionPointer<Func>::ArgumentCount == -1
+ && !std::is_convertible<Func, const char*>::value, bool>::type
+ invokeMethod(QObject *context, Func function,
+ Qt::ConnectionType type = Qt::AutoConnection, decltype(function()) *ret = nullptr)
+ {
+ return invokeMethodImpl(context,
+ new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(function),
+ type,
+ ret);
+ }
+
+ template <typename Func>
+ static typename std::enable_if<!QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
+ && QtPrivate::FunctionPointer<Func>::ArgumentCount == -1
+ && !std::is_convertible<Func, const char*>::value, bool>::type
+ invokeMethod(QObject *context, Func function, typename std::result_of<Func()>::type *ret)
+ {
+ return invokeMethodImpl(context,
+ new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(function),
+ Qt::AutoConnection,
+ ret);
+ }
+
+#endif
+
QObject *newInstance(QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
@@ -506,6 +590,9 @@ struct Q_CORE_EXPORT QMetaObject
const QMetaObject * const *relatedMetaObjects;
void *extradata; //reserved for future use
} d;
+
+private:
+ static bool invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *slot, Qt::ConnectionType type, void *ret);
};
class Q_CORE_EXPORT QMetaObject::Connection {
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index 29ab77b269..b9f2e47e32 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -51,7 +51,7 @@
#endif
QT_BEGIN_NAMESPACE
-
+class QObject;
namespace QtPrivate {
template <typename T> struct RemoveRef { typedef T Type; };
@@ -350,6 +350,98 @@ namespace QtPrivate {
template <typename D> static D dummy();
typedef decltype(dummy<Functor>().operator()((dummy<ArgList>())...)) Value;
};
+
+ // internal base class (interface) containing functions required to call a slot managed by a pointer to function.
+ class QSlotObjectBase {
+ QAtomicInt m_ref;
+ // don't use virtual functions here; we don't want the
+ // compiler to create tons of per-polymorphic-class stuff that
+ // we'll never need. We just use one function pointer.
+ typedef void (*ImplFn)(int which, QSlotObjectBase* this_, QObject *receiver, void **args, bool *ret);
+ const ImplFn m_impl;
+ protected:
+ enum Operation {
+ Destroy,
+ Call,
+ Compare,
+
+ NumOperations
+ };
+ 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
+ { if (!m_ref.deref()) m_impl(Destroy, this, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); }
+
+ inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, Q_NULLPTR, a, &ret); return ret; }
+ inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, Q_NULLPTR); }
+ protected:
+ ~QSlotObjectBase() {}
+ private:
+ Q_DISABLE_COPY(QSlotObjectBase)
+ };
+
+ // implementation of QSlotObjectBase for which the slot is a pointer to member function of a QObject
+ // Args and R are the List of arguments and the returntype of the signal to which the slot is connected.
+ template<typename Func, typename Args, typename R> class QSlotObject : public QSlotObjectBase
+ {
+ typedef QtPrivate::FunctionPointer<Func> FuncType;
+ Func function;
+ static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)
+ {
+ switch (which) {
+ case Destroy:
+ delete static_cast<QSlotObject*>(this_);
+ break;
+ case Call:
+ FuncType::template call<Args, R>(static_cast<QSlotObject*>(this_)->function, static_cast<typename FuncType::Object *>(r), a);
+ break;
+ case Compare:
+ *ret = *reinterpret_cast<Func *>(a) == static_cast<QSlotObject*>(this_)->function;
+ break;
+ case NumOperations: ;
+ }
+ }
+ public:
+ explicit QSlotObject(Func f) : QSlotObjectBase(&impl), function(f) {}
+ };
+ // implementation of QSlotObjectBase for which the slot is a functor (or lambda)
+ // N is the number of arguments
+ // Args and R are the List of arguments and the returntype of the signal to which the slot is connected.
+ template<typename Func, int N, typename Args, typename R> class QFunctorSlotObject : public QSlotObjectBase
+ {
+ typedef QtPrivate::Functor<Func, N> FuncType;
+ Func function;
+ static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret)
+ {
+ switch (which) {
+ case Destroy:
+ delete static_cast<QFunctorSlotObject*>(this_);
+ break;
+ case Call:
+ FuncType::template call<Args, R>(static_cast<QFunctorSlotObject*>(this_)->function, r, a);
+ break;
+ case Compare: // not implemented
+ case NumOperations:
+ Q_UNUSED(ret);
+ }
+ }
+ public:
+ explicit QFunctorSlotObject(Func f) : QSlotObjectBase(&impl), function(std::move(f)) {}
+ };
+
+ // typedefs for readability for when there are no parameters
+ template <typename Func>
+ using QSlotObjectWithNoArgs = QSlotObject<Func,
+ QtPrivate::List<>,
+ typename QtPrivate::FunctionPointer<Func>::ReturnType>;
+
+ template <typename Func, typename R>
+ using QFunctorSlotObjectWithNoArgs = QFunctorSlotObject<Func, 0, QtPrivate::List<>, R>;
+
+ template <typename Func>
+ using QFunctorSlotObjectWithNoArgsImplicitReturn = QFunctorSlotObjectWithNoArgs<Func, typename QtPrivate::FunctionPointer<Func>::ReturnType>;
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qsignalmapper.cpp b/src/corelib/kernel/qsignalmapper.cpp
index a483717da5..d56965281e 100644
--- a/src/corelib/kernel/qsignalmapper.cpp
+++ b/src/corelib/kernel/qsignalmapper.cpp
@@ -58,10 +58,10 @@ public:
};
-
/*!
\class QSignalMapper
\inmodule QtCore
+ \obsolete
\brief The QSignalMapper class bundles signals from identifiable senders.
\ingroup objectmodel
@@ -108,6 +108,12 @@ public:
widget will emit a single \c clicked() signal whose argument is
the text of the button the user clicked.
+ This class was mostly useful before lambda functions could be used as
+ slots. The example above can be rewritten simpler without QSignalMapper
+ by connecting to a lambda function.
+
+ \snippet qsignalmapper/buttonwidget.cpp 3
+
\sa QObject, QButtonGroup, QActionGroup
*/
diff --git a/src/corelib/kernel/qsignalmapper.h b/src/corelib/kernel/qsignalmapper.h
index f960c7cabf..6c4cfa9627 100644
--- a/src/corelib/kernel/qsignalmapper.h
+++ b/src/corelib/kernel/qsignalmapper.h
@@ -42,6 +42,8 @@
#include <QtCore/qobject.h>
+#if QT_DEPRECATED_SINCE(5, 10)
+
QT_BEGIN_NAMESPACE
class QSignalMapperPrivate;
@@ -51,7 +53,7 @@ class Q_CORE_EXPORT QSignalMapper : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QSignalMapper)
public:
- explicit QSignalMapper(QObject *parent = Q_NULLPTR);
+ QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr);
~QSignalMapper();
void setMapping(QObject *sender, int id);
@@ -82,4 +84,6 @@ private:
QT_END_NAMESPACE
+#endif
+
#endif // QSIGNALMAPPER_H
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 6e61ca10cb..7db5fc759b 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -122,14 +122,14 @@ public:
!std::is_same<const char*, Func1>::value, void>::type
singleShot(Duration interval, Func1 slot)
{
- singleShot(interval, defaultTypeFor(interval), nullptr, slot);
+ singleShot(interval, defaultTypeFor(interval), nullptr, std::move(slot));
}
template <typename Duration, typename Func1>
static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
!std::is_same<const char*, Func1>::value, void>::type
singleShot(Duration interval, Qt::TimerType timerType, Func1 slot)
{
- singleShot(interval, timerType, nullptr, slot);
+ singleShot(interval, timerType, nullptr, std::move(slot));
}
// singleShot to a functor or function pointer (with context)
template <typename Duration, typename Func1>
@@ -137,7 +137,7 @@ public:
!std::is_same<const char*, Func1>::value, void>::type
singleShot(Duration interval, QObject *context, Func1 slot)
{
- singleShot(interval, defaultTypeFor(interval), context, slot);
+ singleShot(interval, defaultTypeFor(interval), context, std::move(slot));
}
template <typename Duration, typename Func1>
static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
@@ -150,7 +150,7 @@ public:
singleShotImpl(interval, timerType, context,
new QtPrivate::QFunctorSlotObject<Func1, 0,
- typename QtPrivate::List_Left<void, 0>::Value, void>(slot));
+ typename QtPrivate::List_Left<void, 0>::Value, void>(std::move(slot)));
}
#endif
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index e6262124fb..b79716ff4c 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -470,6 +470,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Uuid:
*str = v_cast<QUuid>(d)->toString();
break;
+ case QMetaType::Nullptr:
+ *str = QString();
+ break;
default:
#ifndef QT_NO_QOBJECT
{
@@ -652,6 +655,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Uuid:
*ba = v_cast<QUuid>(d)->toByteArray();
break;
+ case QMetaType::Nullptr:
+ *ba = QByteArray();
+ break;
default:
#ifndef QT_NO_QOBJECT
{
@@ -938,6 +944,107 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
return false;
}
break;
+#ifndef QT_BOOTSTRAPPED
+ case QMetaType::QJsonValue:
+ switch (d->type) {
+ case QMetaType::Nullptr:
+ *static_cast<QJsonValue *>(result) = QJsonValue(QJsonValue::Null);
+ break;
+ case QVariant::Bool:
+ *static_cast<QJsonValue *>(result) = QJsonValue(d->data.b);
+ break;
+ case QMetaType::Int:
+ case QMetaType::UInt:
+ case QMetaType::Double:
+ case QMetaType::Float:
+ case QMetaType::ULong:
+ case QMetaType::Long:
+ case QMetaType::LongLong:
+ case QMetaType::ULongLong:
+ case QMetaType::UShort:
+ case QMetaType::UChar:
+ case QMetaType::Char:
+ case QMetaType::SChar:
+ case QMetaType::Short:
+ *static_cast<QJsonValue *>(result) = QJsonValue(qConvertToRealNumber(d, ok));
+ Q_ASSERT(ok);
+ break;
+ case QVariant::String:
+ *static_cast<QJsonValue *>(result) = QJsonValue(*v_cast<QString>(d));
+ break;
+ case QVariant::StringList:
+ *static_cast<QJsonValue *>(result) = QJsonValue(QJsonArray::fromStringList(*v_cast<QStringList>(d)));
+ break;
+ case QVariant::List:
+ *static_cast<QJsonValue *>(result) = QJsonValue(QJsonArray::fromVariantList(*v_cast<QVariantList>(d)));
+ break;
+ case QVariant::Map:
+ *static_cast<QJsonValue *>(result) = QJsonValue(QJsonObject::fromVariantMap(*v_cast<QVariantMap>(d)));
+ break;
+ case QVariant::Hash:
+ *static_cast<QJsonValue *>(result) = QJsonValue(QJsonObject::fromVariantHash(*v_cast<QVariantHash>(d)));
+ break;
+ case QMetaType::QJsonObject:
+ *static_cast<QJsonValue *>(result) = *v_cast<QJsonObject>(d);
+ break;
+ case QMetaType::QJsonArray:
+ *static_cast<QJsonValue *>(result) = *v_cast<QJsonArray>(d);
+ break;
+ case QMetaType::QJsonDocument: {
+ QJsonDocument doc = *v_cast<QJsonDocument>(d);
+ *static_cast<QJsonValue *>(result) = doc.isArray() ? QJsonValue(doc.array()) : QJsonValue(doc.object());
+ break;
+ }
+ default:
+ *static_cast<QJsonValue *>(result) = QJsonValue(QJsonValue::Undefined);
+ return false;
+ }
+ break;
+ case QMetaType::QJsonArray:
+ switch (d->type) {
+ case QVariant::StringList:
+ *static_cast<QJsonArray *>(result) = QJsonArray::fromStringList(*v_cast<QStringList>(d));
+ break;
+ case QVariant::List:
+ *static_cast<QJsonArray *>(result) = QJsonArray::fromVariantList(*v_cast<QVariantList>(d));
+ break;
+ case QMetaType::QJsonValue:
+ if (!v_cast<QJsonValue>(d)->isArray())
+ return false;
+ *static_cast<QJsonArray *>(result) = v_cast<QJsonValue>(d)->toArray();
+ break;
+ case QMetaType::QJsonDocument:
+ if (!v_cast<QJsonDocument>(d)->isArray())
+ return false;
+ *static_cast<QJsonArray *>(result) = v_cast<QJsonDocument>(d)->array();
+ break;
+ default:
+ return false;
+ }
+ break;
+ case QMetaType::QJsonObject:
+ switch (d->type) {
+ case QVariant::Map:
+ *static_cast<QJsonObject *>(result) = QJsonObject::fromVariantMap(*v_cast<QVariantMap>(d));
+ break;
+ case QVariant::Hash:
+ *static_cast<QJsonObject *>(result) = QJsonObject::fromVariantHash(*v_cast<QVariantHash>(d));
+ break;
+ case QMetaType::QJsonValue:
+ if (!v_cast<QJsonValue>(d)->isObject())
+ return false;
+ *static_cast<QJsonObject *>(result) = v_cast<QJsonValue>(d)->toObject();
+ break;
+ case QMetaType::QJsonDocument:
+ if (v_cast<QJsonDocument>(d)->isArray())
+ return false;
+ *static_cast<QJsonObject *>(result) = v_cast<QJsonDocument>(d)->object();
+ break;
+ default:
+ return false;
+ }
+ break;
+#endif
default:
#ifndef QT_NO_QOBJECT
if (d->type == QVariant::String || d->type == QVariant::ByteArray) {
@@ -1076,7 +1183,17 @@ static void customClear(QVariant::Private *d)
static bool customIsNull(const QVariant::Private *d)
{
- return d->is_null;
+ if (d->is_null)
+ return true;
+ const char *const typeName = QMetaType::typeName(d->type);
+ if (Q_UNLIKELY(!typeName) && Q_LIKELY(!QMetaType::isRegistered(d->type)))
+ qFatal("QVariant::isNull: type %d unknown to QVariant.", d->type);
+ uint typeNameLen = qstrlen(typeName);
+ if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*') {
+ const void *d_ptr = d->is_shared ? d->data.shared->ptr : &(d->data.ptr);
+ return *static_cast<void *const *>(d_ptr) == nullptr;
+ }
+ return false;
}
static bool customCompare(const QVariant::Private *a, const QVariant::Private *b)
@@ -1358,7 +1475,11 @@ Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names
/*!
\fn QVariant::QVariant(Type type)
- Constructs a null variant of type \a type.
+ Constructs an uninitialized variant of type \a type. This will create a
+ variant in a special null state that if accessed will return a default
+ constructed value of the \a type.
+
+ \sa isNull()
*/
@@ -3106,8 +3227,8 @@ bool QVariant::canConvert(int targetTypeId) const
}
}
- if (currentType == QMetaType::QJsonValue) {
- switch (targetTypeId) {
+ if (currentType == QMetaType::QJsonValue || targetTypeId == QMetaType::QJsonValue) {
+ switch (currentType == QMetaType::QJsonValue ? targetTypeId : currentType) {
case QMetaType::Nullptr:
case QMetaType::QString:
case QMetaType::Bool:
@@ -3163,11 +3284,11 @@ bool QVariant::canConvert(int targetTypeId) const
case QVariant::Bitmap:
return currentType == QVariant::Pixmap || currentType == QVariant::Image;
case QVariant::ByteArray:
- return currentType == QVariant::Color
+ return currentType == QVariant::Color || currentType == QMetaType::Nullptr
|| ((QMetaType::typeFlags(currentType) & QMetaType::IsEnumeration) && QMetaType::metaObjectForType(currentType));
case QVariant::String:
return currentType == QVariant::KeySequence || currentType == QVariant::Font
- || currentType == QVariant::Color
+ || currentType == QVariant::Color || currentType == QMetaType::Nullptr
|| ((QMetaType::typeFlags(currentType) & QMetaType::IsEnumeration) && QMetaType::metaObjectForType(currentType));
case QVariant::KeySequence:
return currentType == QVariant::String || currentType == QVariant::Int;
@@ -3204,17 +3325,20 @@ bool QVariant::canConvert(int targetTypeId) const
/*!
Casts the variant to the requested type, \a targetTypeId. If the cast cannot be
- done, the variant is cleared. Returns \c true if the current type of
- the variant was successfully cast; otherwise returns \c false.
+ done, the variant is still changed to the requested type, but is left in a cleared
+ null state similar to that constructed by QVariant(Type).
+
+ Returns \c true if the current type of the variant was successfully cast;
+ otherwise returns \c false.
A QVariant containing a pointer to a type derived from QObject will also convert
and return true for this function if a qobject_cast to the type described
by \a targetTypeId would succeed. Note that this only works for QObject subclasses
which use the Q_OBJECT macro.
- \warning For historical reasons, converting a null QVariant results
- in a null value of the desired type (e.g., an empty string for
- QString) and a result of false.
+ \note converting QVariants that are null due to not being initialized or having
+ failed a previous conversion will always fail, changing the type, remaining null,
+ and returning \c false.
\sa canConvert(), clear()
*/
@@ -3231,7 +3355,8 @@ bool QVariant::convert(int targetTypeId)
return false;
create(targetTypeId, 0);
- if (oldValue.isNull())
+ // Fail if the value is not initialized or was forced null by a previous failed convert.
+ if (oldValue.d.is_null)
return false;
if ((QMetaType::typeFlags(oldValue.userType()) & QMetaType::PointerToQObject) && (QMetaType::typeFlags(targetTypeId) & QMetaType::PointerToQObject)) {
@@ -3631,12 +3756,15 @@ void* QVariant::data()
/*!
Returns \c true if this is a null variant, false otherwise. A variant is
- considered null if it contains a default constructed value or a built-in
- type instance that has an isNull method, in which case the result
- would be the same as calling isNull on the wrapped object.
+ considered null if it contains no initialized value, or the contained value
+ is a null pointer or is an instance of a built-in type that has an isNull
+ method, in which case the result would be the same as calling isNull on the
+ wrapped object.
+
+ \warning Null variants is not a single state and two null variants may easily
+ return \c false on the == operator if they do not contain similar null values.
- \warning The result of the function doesn't affect == operator, which means
- that two values can be equal even if one of them is null and another is not.
+ \sa QVariant(Type), convert(int)
*/
bool QVariant::isNull() const
{
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 487949431c..75c269d710 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -187,6 +187,16 @@ public:
}
};
+template <typename T>
+struct PrimitiveIsNull<T*>
+{
+public:
+ static bool isNull(const QVariant::Private *d)
+ {
+ return d->is_null || d->data.ptr == nullptr;
+ }
+};
+
template <>
struct PrimitiveIsNull<std::nullptr_t>
{
diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp
index 0808374a6a..6bfa6ca729 100644
--- a/src/corelib/kernel/qwineventnotifier.cpp
+++ b/src/corelib/kernel/qwineventnotifier.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qwineventnotifier.h"
+#include "qwineventnotifier_p.h"
#ifdef Q_OS_WINRT
#include "qeventdispatcher_winrt_p.h"
@@ -50,19 +50,6 @@
QT_BEGIN_NAMESPACE
-class QWinEventNotifierPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QWinEventNotifier)
-public:
- QWinEventNotifierPrivate()
- : handleToEvent(0), enabled(false) {}
- QWinEventNotifierPrivate(HANDLE h, bool e)
- : handleToEvent(h), enabled(e) {}
-
- HANDLE handleToEvent;
- bool enabled;
-};
-
/*!
\class QWinEventNotifier
\inmodule QtCore
@@ -246,4 +233,49 @@ bool QWinEventNotifier::event(QEvent * e)
return false;
}
+#if defined(Q_OS_WINRT)
+
+bool QWinEventNotifierPrivate::registerWaitObject()
+{
+ Q_UNIMPLEMENTED();
+ return false;
+}
+
+void QWinEventNotifierPrivate::unregisterWaitObject()
+{
+ Q_UNIMPLEMENTED();
+}
+
+#else // defined(Q_OS_WINRT)
+
+static void CALLBACK wfsoCallback(void *context, BOOLEAN /*ignore*/)
+{
+ QWinEventNotifierPrivate *nd = reinterpret_cast<QWinEventNotifierPrivate *>(context);
+ QAbstractEventDispatcher *eventDispatcher = nd->threadData->eventDispatcher.load();
+ QEventDispatcherWin32Private *edp = QEventDispatcherWin32Private::get(
+ static_cast<QEventDispatcherWin32 *>(eventDispatcher));
+ SetEvent(edp->winEventNotifierActivatedEvent);
+}
+
+bool QWinEventNotifierPrivate::registerWaitObject()
+{
+ if (RegisterWaitForSingleObject(&waitHandle, handleToEvent, wfsoCallback, this,
+ INFINITE, WT_EXECUTEONLYONCE) == 0) {
+ qErrnoWarning("QWinEventNotifier: RegisterWaitForSingleObject failed.");
+ return false;
+ }
+ return true;
+}
+
+void QWinEventNotifierPrivate::unregisterWaitObject()
+{
+ // Unregister the wait handle and wait for pending callbacks to finish.
+ if (UnregisterWaitEx(waitHandle, INVALID_HANDLE_VALUE))
+ waitHandle = NULL;
+ else
+ qErrnoWarning("QWinEventNotifier: UnregisterWaitEx failed.");
+}
+
+#endif // !defined(Q_OS_WINRT)
+
QT_END_NAMESPACE
diff --git a/src/corelib/io/qwinoverlappedionotifier_p.h b/src/corelib/kernel/qwineventnotifier_p.h
index 276a1d861e..bddeaaf134 100644
--- a/src/corelib/io/qwinoverlappedionotifier_p.h
+++ b/src/corelib/kernel/qwineventnotifier_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 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 QWINOVERLAPPEDIONOTIFIER_P_H
-#define QWINOVERLAPPEDIONOTIFIER_P_H
+#ifndef QWINEVENTNOTIFIER_P_H
+#define QWINEVENTNOTIFIER_P_H
//
// W A R N I N G
@@ -51,40 +51,31 @@
// We mean it.
//
-#include <QtCore/private/qglobal_p.h>
-#include <qobject.h>
+#include "qwineventnotifier.h"
-typedef struct _OVERLAPPED OVERLAPPED;
+#include <private/qobject_p.h>
+#include <QtCore/qt_windows.h>
QT_BEGIN_NAMESPACE
-class QWinOverlappedIoNotifierPrivate;
-
-class Q_CORE_EXPORT QWinOverlappedIoNotifier : public QObject
+class QWinEventNotifierPrivate : public QObjectPrivate
{
- Q_OBJECT
- Q_DISABLE_COPY(QWinOverlappedIoNotifier)
- Q_DECLARE_PRIVATE(QWinOverlappedIoNotifier)
- Q_PRIVATE_SLOT(d_func(), void _q_notified())
- friend class QWinIoCompletionPort;
+ Q_DECLARE_PUBLIC(QWinEventNotifier)
public:
- QWinOverlappedIoNotifier(QObject *parent = 0);
- ~QWinOverlappedIoNotifier();
-
- void setHandle(Qt::HANDLE h);
- Qt::HANDLE handle() const;
+ QWinEventNotifierPrivate()
+ : handleToEvent(0), enabled(false) {}
+ QWinEventNotifierPrivate(HANDLE h, bool e)
+ : handleToEvent(h), enabled(e) {}
- void setEnabled(bool enabled);
- OVERLAPPED *waitForAnyNotified(int msecs);
- bool waitForNotified(int msecs, OVERLAPPED *overlapped);
+ static QWinEventNotifierPrivate *get(QWinEventNotifier *q) { return q->d_func(); }
+ bool registerWaitObject();
+ void unregisterWaitObject();
-Q_SIGNALS:
- void notified(quint32 numberOfBytes, quint32 errorCode, OVERLAPPED *overlapped);
-#if !defined(Q_QDOC)
- void _q_notify();
-#endif
+ HANDLE handleToEvent;
+ HANDLE waitHandle = NULL;
+ bool enabled;
};
QT_END_NAMESPACE
-#endif // QWINOVERLAPPEDIONOTIFIER_P_H
+#endif // QWINEVENTNOTIFIER_P_H
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 5c0acce4c3..ed7ebb2ef5 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -655,7 +655,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
}
// Binary search in the icons or generic-icons list
-QString QMimeBinaryProvider::iconForMime(CacheFile *cacheFile, int posListOffset, const QByteArray &inputMime)
+QLatin1String QMimeBinaryProvider::iconForMime(CacheFile *cacheFile, int posListOffset, const QByteArray &inputMime)
{
const int iconsListOffset = cacheFile->getUint32(posListOffset);
const int numIcons = cacheFile->getUint32(iconsListOffset);
@@ -676,7 +676,7 @@ QString QMimeBinaryProvider::iconForMime(CacheFile *cacheFile, int posListOffset
return QLatin1String(cacheFile->getCharStar(iconOffset));
}
}
- return QString();
+ return QLatin1String();
}
void QMimeBinaryProvider::loadIcon(QMimeTypePrivate &data)
@@ -684,7 +684,7 @@ void QMimeBinaryProvider::loadIcon(QMimeTypePrivate &data)
checkCache();
const QByteArray inputMime = data.name.toLatin1();
for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
- const QString icon = iconForMime(cacheFile, PosIconsListOffset, inputMime);
+ const QLatin1String icon = iconForMime(cacheFile, PosIconsListOffset, inputMime);
if (!icon.isEmpty()) {
data.iconName = icon;
return;
@@ -697,7 +697,7 @@ void QMimeBinaryProvider::loadGenericIcon(QMimeTypePrivate &data)
checkCache();
const QByteArray inputMime = data.name.toLatin1();
for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {
- const QString icon = iconForMime(cacheFile, PosGenericIconsListOffset, inputMime);
+ const QLatin1String icon = iconForMime(cacheFile, PosGenericIconsListOffset, inputMime);
if (!icon.isEmpty()) {
data.genericIconName = icon;
return;
diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h
index f410e62267..0be01d2fd0 100644
--- a/src/corelib/mimetypes/qmimeprovider_p.h
+++ b/src/corelib/mimetypes/qmimeprovider_p.h
@@ -116,7 +116,7 @@ private:
void matchGlobList(QMimeGlobMatchResult &result, CacheFile *cacheFile, int offset, const QString &fileName);
bool matchSuffixTree(QMimeGlobMatchResult &result, CacheFile *cacheFile, int numEntries, int firstOffset, const QString &fileName, int charPos, bool caseSensitiveCheck);
bool matchMagicRule(CacheFile *cacheFile, int numMatchlets, int firstOffset, const QByteArray &data);
- QString iconForMime(CacheFile *cacheFile, int posListOffset, const QByteArray &inputMime);
+ QLatin1String iconForMime(CacheFile *cacheFile, int posListOffset, const QByteArray &inputMime);
void loadMimeTypeList();
void checkCache();
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 98a0e8eb1b..28113babfe 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -206,10 +206,14 @@ uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW
*/
/*!
- \fn bool QMimeType::isValid() const;
- Returns \c true if the QMimeType object contains valid data, otherwise returns \c false.
+ \property QMimeType::valid
+ \brief \c true if the QMimeType object contains valid data, \c false otherwise
+
A valid MIME type has a non-empty name().
The invalid MIME type is the default-constructed QMimeType.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
bool QMimeType::isValid() const
{
@@ -217,9 +221,12 @@ bool QMimeType::isValid() const
}
/*!
- \fn bool QMimeType::isDefault() const;
- Returns \c true if this MIME type is the default MIME type which
+ \property QMimeType::isDefault
+ \brief \c true if this MIME type is the default MIME type which
applies to all files: application/octet-stream.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
bool QMimeType::isDefault() const
{
@@ -227,8 +234,11 @@ bool QMimeType::isDefault() const
}
/*!
- \fn QString QMimeType::name() const;
- Returns the name of the MIME type.
+ \property QMimeType::name
+ \brief the name of the MIME type
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QString QMimeType::name() const
{
@@ -236,9 +246,13 @@ QString QMimeType::name() const
}
/*!
- Returns the description of the MIME type to be displayed on user interfaces.
+ \property QMimeType::comment
+ \brief the description of the MIME type to be displayed on user interfaces
The default language (QLocale().name()) is used to select the appropriate translation.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QString QMimeType::comment() const
{
@@ -267,8 +281,8 @@ QString QMimeType::comment() const
}
/*!
- \fn QString QMimeType::genericIconName() const;
- Returns the file name of a generic icon that represents the MIME type.
+ \property QMimeType::genericIconName
+ \brief the file name of a generic icon that represents the MIME type
This should be used if the icon returned by iconName() cannot be found on
the system. It is used for categories of similar types (like spreadsheets
@@ -276,6 +290,9 @@ QString QMimeType::comment() const
The freedesktop.org Icon Naming Specification lists a set of such icon names.
The icon name can be given to QIcon::fromTheme() in order to load the icon.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QString QMimeType::genericIconName() const
{
@@ -297,10 +314,13 @@ QString QMimeType::genericIconName() const
}
/*!
- \fn QString QMimeType::iconName() const;
- Returns the file name of an icon image that represents the MIME type.
+ \property QMimeType::iconName
+ \brief the file name of an icon image that represents the MIME type
The icon name can be given to QIcon::fromTheme() in order to load the icon.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QString QMimeType::iconName() const
{
@@ -316,8 +336,11 @@ QString QMimeType::iconName() const
}
/*!
- \fn QStringList QMimeType::globPatterns() const;
- Returns the list of glob matching patterns.
+ \property QMimeType::globPatterns
+ \brief the list of glob matching patterns
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QStringList QMimeType::globPatterns() const
{
@@ -326,6 +349,9 @@ QStringList QMimeType::globPatterns() const
}
/*!
+ \property QMimeType::parentMimeTypes
+ \brief the names of parent MIME types
+
A type is a subclass of another type if any instance of the first type is
also an instance of the second. For example, all image/svg+xml files are also
text/xml, text/plain and application/octet-stream files. Subclassing is about
@@ -336,6 +362,9 @@ QStringList QMimeType::globPatterns() const
A mimetype can have multiple parents. For instance application/x-perl
has two parents: application/x-executable and text/plain. This makes
it possible to both execute perl scripts, and to open them in text editors.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QStringList QMimeType::parentMimeTypes() const
{
@@ -357,6 +386,9 @@ static void collectParentMimeTypes(const QString &mime, QStringList &allParents)
}
/*!
+ \property QMimeType::allAncestors
+ \brief the names of direct and indirect parent MIME types
+
Return all the parent mimetypes of this mimetype, direct and indirect.
This includes the parent(s) of its parent(s), etc.
@@ -365,6 +397,9 @@ static void collectParentMimeTypes(const QString &mime, QStringList &allParents)
Note that application/octet-stream is the ultimate parent for all types
of files (but not directories).
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QStringList QMimeType::allAncestors() const
{
@@ -374,7 +409,8 @@ QStringList QMimeType::allAncestors() const
}
/*!
- Return the list of aliases of this mimetype.
+ \property QMimeType::aliases
+ \brief the list of aliases of this mimetype
For instance, for text/csv, the returned list would be:
text/x-csv, text/x-comma-separated-values.
@@ -383,6 +419,9 @@ QStringList QMimeType::allAncestors() const
never to aliases directly.
The order of the aliases in the list is undefined.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QStringList QMimeType::aliases() const
{
@@ -390,8 +429,13 @@ QStringList QMimeType::aliases() const
}
/*!
- Returns the known suffixes for the MIME type.
+ \property QMimeType::suffixes
+ \brief the known suffixes for the MIME type
+
No leading dot is included, so for instance this would return "jpg", "jpeg" for image/jpeg.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QStringList QMimeType::suffixes() const
{
@@ -412,9 +456,14 @@ QStringList QMimeType::suffixes() const
}
/*!
- Returns the preferred suffix for the MIME type.
+ \property QMimeType::preferredSuffix
+ \brief the preferred suffix for the MIME type
+
No leading dot is included, so for instance this would return "pdf" for application/pdf.
The return value can be empty, for mime types which do not have any suffixes associated.
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QString QMimeType::preferredSuffix() const
{
@@ -423,8 +472,11 @@ QString QMimeType::preferredSuffix() const
}
/*!
- \fn QString QMimeType::filterString() const;
- Returns a filter string usable for a file dialog.
+ \property QMimeType::filterString
+ \brief a filter string usable for a file dialog
+
+ While this property was introduced in 5.10, the
+ corresponding accessor method has always been there.
*/
QString QMimeType::filterString() const
{
@@ -449,6 +501,8 @@ QString QMimeType::filterString() const
Returns \c true if this mimetype is \a mimeTypeName,
or inherits \a mimeTypeName (see parentMimeTypes()),
or \a mimeTypeName is an alias for this mimetype.
+
+ This method has been made invokable from QML since 5.10.
*/
bool QMimeType::inherits(const QString &mimeTypeName) const
{
diff --git a/src/corelib/mimetypes/qmimetype.h b/src/corelib/mimetypes/qmimetype.h
index e9ff9ace84..def4034f8a 100644
--- a/src/corelib/mimetypes/qmimetype.h
+++ b/src/corelib/mimetypes/qmimetype.h
@@ -45,6 +45,7 @@
#ifndef QT_NO_MIMETYPE
+#include <QtCore/qobjectdefs.h>
#include <QtCore/qshareddata.h>
#include <QtCore/qstring.h>
@@ -58,6 +59,21 @@ Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed = 0) Q_DECL_NOTHROW;
class Q_CORE_EXPORT QMimeType
{
+ Q_GADGET
+ Q_PROPERTY(bool valid READ isValid CONSTANT)
+ Q_PROPERTY(bool isDefault READ isDefault CONSTANT)
+ Q_PROPERTY(QString name READ name CONSTANT)
+ Q_PROPERTY(QString comment READ comment CONSTANT)
+ Q_PROPERTY(QString genericIconName READ genericIconName CONSTANT)
+ Q_PROPERTY(QString iconName READ iconName CONSTANT)
+ Q_PROPERTY(QStringList globPatterns READ globPatterns CONSTANT)
+ Q_PROPERTY(QStringList parentMimeTypes READ parentMimeTypes CONSTANT)
+ Q_PROPERTY(QStringList allAncestors READ allAncestors CONSTANT)
+ Q_PROPERTY(QStringList aliases READ aliases CONSTANT)
+ Q_PROPERTY(QStringList suffixes READ suffixes CONSTANT)
+ Q_PROPERTY(QString preferredSuffix READ preferredSuffix CONSTANT)
+ Q_PROPERTY(QString filterString READ filterString CONSTANT)
+
public:
QMimeType();
QMimeType(const QMimeType &other);
@@ -94,7 +110,7 @@ public:
QStringList suffixes() const;
QString preferredSuffix() const;
- bool inherits(const QString &mimeTypeName) const;
+ Q_INVOKABLE bool inherits(const QString &mimeTypeName) const;
QString filterString() const;
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index 20b4461b03..5ecd339908 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -49,7 +49,6 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QDir>
-#include <QtCore/QPair>
#include <QtCore/QXmlStreamReader>
#include <QtCore/QXmlStreamWriter>
#include <QtCore/QStack>
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 40000e7b24..0cc193c325 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -122,8 +122,8 @@ void QFactoryLoader::update()
//
// ### FIXME find a proper solution
//
- const bool isLoadingDebugAndReleaseCocoa = plugins.contains(QStringLiteral("libqcocoa_debug.dylib"))
- && plugins.contains(QStringLiteral("libqcocoa.dylib"));
+ const bool isLoadingDebugAndReleaseCocoa = plugins.contains(QLatin1String("libqcocoa_debug.dylib"))
+ && plugins.contains(QLatin1String("libqcocoa.dylib"));
#endif
for (int j = 0; j < plugins.count(); ++j) {
QString fileName = QDir::cleanPath(path + QLatin1Char('/') + plugins.at(j));
@@ -131,10 +131,10 @@ void QFactoryLoader::update()
#ifdef Q_OS_MAC
if (isLoadingDebugAndReleaseCocoa) {
#ifdef QT_DEBUG
- if (fileName.contains(QStringLiteral("libqcocoa.dylib")))
+ if (fileName.contains(QLatin1String("libqcocoa.dylib")))
continue; // Skip release plugin in debug mode
#else
- if (fileName.contains(QStringLiteral("libqcocoa_debug.dylib")))
+ if (fileName.contains(QLatin1String("libqcocoa_debug.dylib")))
continue; // Skip debug plugin in release mode
#endif
}
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 0afce7fcf0..11ef247531 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 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.
@@ -39,31 +40,34 @@
#include "quuid.h"
+#include "qcryptographichash.h"
#include "qdatastream.h"
-#include "qendian.h"
#include "qdebug.h"
+#include "qendian.h"
+#include "qrandom.h"
#include "private/qtools_p.h"
-#ifndef QT_BOOTSTRAPPED
-#include "qcryptographichash.h"
-#endif
QT_BEGIN_NAMESPACE
-template <class Char, class Integral>
-void _q_toHex(Char *&dst, Integral value)
+// 16 bytes (a uint, two shorts and a uchar[8]), each represented by two hex
+// digits; plus four dashes and a pair of enclosing brace: 16*2 + 4 + 2 = 38.
+enum { MaxStringUuidLength = 38 };
+
+template <class Integral>
+void _q_toHex(char *&dst, Integral value)
{
value = qToBigEndian(value);
const char* p = reinterpret_cast<const char*>(&value);
for (uint i = 0; i < sizeof(Integral); ++i, dst += 2) {
- dst[0] = Char(QtMiscUtils::toHexLower((p[i] >> 4) & 0xf));
- dst[1] = Char(QtMiscUtils::toHexLower(p[i] & 0xf));
+ dst[0] = QtMiscUtils::toHexLower((p[i] >> 4) & 0xf);
+ dst[1] = QtMiscUtils::toHexLower(p[i] & 0xf);
}
}
-template <class Char, class Integral>
-bool _q_fromHex(const Char *&src, Integral &value)
+template <class Integral>
+bool _q_fromHex(const char *&src, Integral &value)
{
value = 0;
@@ -79,48 +83,64 @@ bool _q_fromHex(const Char *&src, Integral &value)
return true;
}
-template <class Char>
-void _q_uuidToHex(Char *&dst, const uint &d1, const ushort &d2, const ushort &d3, const uchar (&d4)[8])
+static char *_q_uuidToHex(const QUuid &uuid, char *dst)
{
- *dst++ = Char('{');
- _q_toHex(dst, d1);
- *dst++ = Char('-');
- _q_toHex(dst, d2);
- *dst++ = Char('-');
- _q_toHex(dst, d3);
- *dst++ = Char('-');
+ *dst++ = '{';
+ _q_toHex(dst, uuid.data1);
+ *dst++ = '-';
+ _q_toHex(dst, uuid.data2);
+ *dst++ = '-';
+ _q_toHex(dst, uuid.data3);
+ *dst++ = '-';
for (int i = 0; i < 2; i++)
- _q_toHex(dst, d4[i]);
- *dst++ = Char('-');
+ _q_toHex(dst, uuid.data4[i]);
+ *dst++ = '-';
for (int i = 2; i < 8; i++)
- _q_toHex(dst, d4[i]);
- *dst = Char('}');
+ _q_toHex(dst, uuid.data4[i]);
+ *dst++ = '}';
+ return dst;
}
-template <class Char>
-bool _q_uuidFromHex(const Char *&src, uint &d1, ushort &d2, ushort &d3, uchar (&d4)[8])
+/*!
+ \internal
+
+ Parses the string representation of a UUID (with optional surrounding "{}")
+ by reading at most MaxStringUuidLength (38) characters from \a src, which
+ may be \c nullptr. Stops at the first invalid character (which includes a
+ premature NUL).
+
+ Returns the successfully parsed QUuid, or a null QUuid in case of failure.
+*/
+Q_NEVER_INLINE
+static QUuid _q_uuidFromHex(const char *src)
{
- if (*src == Char('{'))
- src++;
- if (!_q_fromHex(src, d1)
- || *src++ != Char('-')
- || !_q_fromHex(src, d2)
- || *src++ != Char('-')
- || !_q_fromHex(src, d3)
- || *src++ != Char('-')
- || !_q_fromHex(src, d4[0])
- || !_q_fromHex(src, d4[1])
- || *src++ != Char('-')
- || !_q_fromHex(src, d4[2])
- || !_q_fromHex(src, d4[3])
- || !_q_fromHex(src, d4[4])
- || !_q_fromHex(src, d4[5])
- || !_q_fromHex(src, d4[6])
- || !_q_fromHex(src, d4[7])) {
- return false;
+ uint d1;
+ ushort d2, d3;
+ uchar d4[8];
+
+ if (src) {
+ if (*src == '{')
+ src++;
+ if (Q_LIKELY( _q_fromHex(src, d1)
+ && *src++ == '-'
+ && _q_fromHex(src, d2)
+ && *src++ == '-'
+ && _q_fromHex(src, d3)
+ && *src++ == '-'
+ && _q_fromHex(src, d4[0])
+ && _q_fromHex(src, d4[1])
+ && *src++ == '-'
+ && _q_fromHex(src, d4[2])
+ && _q_fromHex(src, d4[3])
+ && _q_fromHex(src, d4[4])
+ && _q_fromHex(src, d4[5])
+ && _q_fromHex(src, d4[6])
+ && _q_fromHex(src, d4[7]))) {
+ return QUuid(d1, d2, d3, d4[0], d4[1], d4[2], d4[3], d4[4], d4[5], d4[6], d4[7]);
+ }
}
- return true;
+ return QUuid();
}
#ifndef QT_BOOTSTRAPPED
@@ -331,7 +351,7 @@ static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCrypto
/*!
Creates a QUuid object from the string \a text, which must be
formatted as five hex fields separated by '-', e.g.,
- "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where 'x' is a hex
+ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where each 'x' is a hex
digit. The curly braces shown here are optional, but it is normal to
include them. If the conversion fails, a null UUID is created. See
toString() for an explanation of how the five hex fields map to the
@@ -340,45 +360,76 @@ static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCrypto
\sa toString(), QUuid()
*/
QUuid::QUuid(const QString &text)
+ : QUuid(fromString(text))
{
- if (text.length() < 36) {
- *this = QUuid();
- return;
- }
+}
- const ushort *data = reinterpret_cast<const ushort *>(text.unicode());
+/*!
+ \since 5.10
- if (*data == '{' && text.length() < 37) {
- *this = QUuid();
- return;
- }
+ Creates a QUuid object from the string \a text, which must be
+ formatted as five hex fields separated by '-', e.g.,
+ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where each 'x' is a hex
+ digit. The curly braces shown here are optional, but it is normal to
+ include them. If the conversion fails, a null UUID is returned. See
+ toString() for an explanation of how the five hex fields map to the
+ public data members in QUuid.
+
+ \sa toString(), QUuid()
+*/
+QUuid QUuid::fromString(QStringView text) Q_DECL_NOTHROW
+{
+ if (text.size() > MaxStringUuidLength)
+ text = text.left(MaxStringUuidLength); // text.truncate(MaxStringUuidLength);
+
+ char latin1[MaxStringUuidLength + 1];
+ char *dst = latin1;
- if (!_q_uuidFromHex(data, data1, data2, data3, data4)) {
- *this = QUuid();
- return;
+ for (QChar ch : text)
+ *dst++ = ch.toLatin1();
+
+ *dst++ = '\0'; // don't read garbage as potentially valid data
+
+ return _q_uuidFromHex(latin1);
+}
+
+/*!
+ \since 5.10
+ \overload
+
+ Creates a QUuid object from the string \a text, which must be
+ formatted as five hex fields separated by '-', e.g.,
+ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where each 'x' is a hex
+ digit. The curly braces shown here are optional, but it is normal to
+ include them. If the conversion fails, a null UUID is returned. See
+ toString() for an explanation of how the five hex fields map to the
+ public data members in QUuid.
+
+ \sa toString(), QUuid()
+*/
+QUuid QUuid::fromString(QLatin1String text) Q_DECL_NOTHROW
+{
+ if (Q_UNLIKELY(text.size() < MaxStringUuidLength - 2
+ || (text.front() == QLatin1Char('{') && text.size() < MaxStringUuidLength - 1))) {
+ // Too short. Don't call _q_uuidFromHex(); QL1Ss need not be NUL-terminated,
+ // and we don't want to read trailing garbage as potentially valid data.
+ text = QLatin1String();
}
+ return _q_uuidFromHex(text.data());
}
/*!
\internal
*/
QUuid::QUuid(const char *text)
+ : QUuid(_q_uuidFromHex(text))
{
- if (!text) {
- *this = QUuid();
- return;
- }
-
- if (!_q_uuidFromHex(text, data1, data2, data3, data4)) {
- *this = QUuid();
- return;
- }
}
/*!
Creates a QUuid object from the QByteArray \a text, which must be
formatted as five hex fields separated by '-', e.g.,
- "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where 'x' is a hex
+ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where each 'x' is a hex
digit. The curly braces shown here are optional, but it is normal to
include them. If the conversion fails, a null UUID is created. See
toByteArray() for an explanation of how the five hex fields map to the
@@ -389,23 +440,8 @@ QUuid::QUuid(const char *text)
\sa toByteArray(), QUuid()
*/
QUuid::QUuid(const QByteArray &text)
+ : QUuid(fromString(QLatin1String(text.data(), text.size())))
{
- if (text.length() < 36) {
- *this = QUuid();
- return;
- }
-
- const char *data = text.constData();
-
- if (*data == '{' && text.length() < 37) {
- *this = QUuid();
- return;
- }
-
- if (!_q_uuidFromHex(data, data1, data2, data3, data4)) {
- *this = QUuid();
- return;
- }
}
/*!
@@ -548,12 +584,11 @@ QUuid QUuid::fromRfc4122(const QByteArray &bytes)
*/
QString QUuid::toString() const
{
- QString result(38, Qt::Uninitialized);
- ushort *data = (ushort *)result.data();
-
- _q_uuidToHex(data, data1, data2, data3, data4);
-
- return result;
+ char latin1[MaxStringUuidLength];
+ const auto end = _q_uuidToHex(*this, latin1);
+ Q_ASSERT(end - latin1 == MaxStringUuidLength);
+ Q_UNUSED(end);
+ return QString::fromLatin1(latin1, MaxStringUuidLength);
}
/*!
@@ -594,11 +629,10 @@ QString QUuid::toString() const
*/
QByteArray QUuid::toByteArray() const
{
- QByteArray result(38, Qt::Uninitialized);
- char *data = result.data();
-
- _q_uuidToHex(data, data1, data2, data3, data4);
-
+ QByteArray result(MaxStringUuidLength, Qt::Uninitialized);
+ const auto end = _q_uuidToHex(*this, const_cast<char*>(result.constData()));
+ Q_ASSERT(end - result.constData() == MaxStringUuidLength);
+ Q_UNUSED(end);
return result;
}
@@ -883,17 +917,10 @@ bool QUuid::operator>(const QUuid &other) const Q_DECL_NOTHROW
/*!
\fn QUuid QUuid::createUuid()
- On any platform other than Windows, this function returns a new
- UUID with variant QUuid::DCE and version QUuid::Random. If
- the /dev/urandom device exists, then the numbers used to construct
- the UUID will be of cryptographic quality, which will make the UUID
- unique. Otherwise, the numbers of the UUID will be obtained from
- the local pseudo-random number generator (qrand(), which is seeded
- by qsrand()) which is usually not of cryptograhic quality, which
- means that the UUID can't be guaranteed to be unique.
-
- On a Windows platform, a GUID is generated, which almost certainly
- \e{will} be unique, on this or any other system, networked or not.
+ On any platform other than Windows, this function returns a new UUID with
+ variant QUuid::DCE and version QUuid::Random. On Windows, a GUID is
+ generated using the Windows API and will be of the type that the API
+ decides to create.
\sa variant(), version()
*/
@@ -913,82 +940,12 @@ QUuid QUuid::createUuid()
#else // Q_OS_WIN
-QT_BEGIN_INCLUDE_NAMESPACE
-#include "qdatetime.h"
-#include "qfile.h"
-#include "qthreadstorage.h"
-#include <stdlib.h> // for RAND_MAX
-QT_END_INCLUDE_NAMESPACE
-
-#if !defined(QT_BOOTSTRAPPED) && defined(Q_OS_UNIX)
-Q_GLOBAL_STATIC(QThreadStorage<QFile *>, devUrandomStorage);
-#endif
-
QUuid QUuid::createUuid()
{
- QUuid result;
+ QUuid result(Qt::Uninitialized);
uint *data = &(result.data1);
-
-#if defined(Q_OS_UNIX)
- QFile *devUrandom;
-# if !defined(QT_BOOTSTRAPPED)
- devUrandom = devUrandomStorage()->localData();
- if (!devUrandom) {
- devUrandom = new QFile(QLatin1String("/dev/urandom"));
- devUrandom->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
- devUrandomStorage()->setLocalData(devUrandom);
- }
-# else
- QFile file(QLatin1String("/dev/urandom"));
- devUrandom = &file;
- devUrandom->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
-# endif
- enum { AmountToRead = 4 * sizeof(uint) };
- if (devUrandom->isOpen()
- && devUrandom->read((char *) data, AmountToRead) == AmountToRead) {
- // we got what we wanted, nothing more to do
- ;
- } else
-#endif
- {
- static const int intbits = sizeof(int)*8;
- static int randbits = 0;
- if (!randbits) {
- int r = 0;
- int max = RAND_MAX;
- do { ++r; } while ((max=max>>1));
- randbits = r;
- }
-
- // Seed the PRNG once per thread with a combination of current time, a
- // stack address and a serial counter (since thread stack addresses are
- // re-used).
-#ifndef QT_BOOTSTRAPPED
- static QThreadStorage<int *> uuidseed;
- if (!uuidseed.hasLocalData())
- {
- int *pseed = new int;
- static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0);
- qsrand(*pseed = QDateTime::currentSecsSinceEpoch()
- + quintptr(&pseed)
- + 2 + serial.fetchAndAddRelaxed(1));
- uuidseed.setLocalData(pseed);
- }
-#else
- static bool seeded = false;
- if (!seeded)
- qsrand(QDateTime::currentSecsSinceEpoch()
- + quintptr(&seeded));
-#endif
-
- int chunks = 16 / sizeof(uint);
- while (chunks--) {
- uint randNumber = 0;
- for (int filled = 0; filled < intbits; filled += randbits)
- randNumber |= qrand()<<filled;
- *(data+chunks) = randNumber;
- }
- }
+ enum { AmountToRead = 4 };
+ QRandomGenerator::fillRange(data, AmountToRead);
result.data4[0] = (result.data4[0] & 0x3F) | 0x80; // UV_DCE
result.data3 = (result.data3 & 0x0FFF) | 0x4000; // UV_Random
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 264f572993..9e1a35f492 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QUuid
{
+ QUuid(Qt::Initialization) {}
public:
enum Variant {
VarUnknown =-1,
@@ -116,6 +117,8 @@ public:
#endif
QUuid(const QString &);
+ static QUuid fromString(QStringView string) Q_DECL_NOTHROW;
+ static QUuid fromString(QLatin1String string) Q_DECL_NOTHROW;
QUuid(const char *);
QString toString() const;
QUuid(const QByteArray &);
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 7e3610f0b3..3e7033451e 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -642,7 +642,7 @@ const int FreeListConstants::Sizes[FreeListConstants::BlockCount] = {
16,
128,
1024,
- FreeListConstants::MaxIndex - (16-128-1024)
+ FreeListConstants::MaxIndex - (16 + 128 + 1024)
};
typedef QFreeList<QMutexPrivate, FreeListConstants> FreeList;
diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h
index be9f632557..6c814ef854 100644
--- a/src/corelib/thread/qresultstore.h
+++ b/src/corelib/thread/qresultstore.h
@@ -196,6 +196,8 @@ public:
} // namespace QtPrivate
+Q_DECLARE_TYPEINFO(QtPrivate::ResultItem, Q_PRIMITIVE_TYPE);
+
#endif //Q_QDOC
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index ce0c1c91df..96c031eec6 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -94,7 +94,7 @@ QT_BEGIN_NAMESPACE
seated (taking the available seats to 5, making the party of 10
people wait longer).
- \sa QMutex, QWaitCondition, QThread, {Semaphores Example}
+ \sa QSemaphoreReleaser, QMutex, QWaitCondition, QThread, {Semaphores Example}
*/
class QSemaphorePrivate {
@@ -152,7 +152,10 @@ void QSemaphore::acquire(int n)
\snippet code/src_corelib_thread_qsemaphore.cpp 1
- \sa acquire(), available()
+ QSemaphoreReleaser is a \l{http://en.cppreference.com/w/cpp/language/raii}{RAII}
+ wrapper around this function.
+
+ \sa acquire(), available(), QSemaphoreReleaser
*/
void QSemaphore::release(int n)
{
@@ -233,6 +236,152 @@ bool QSemaphore::tryAcquire(int n, int timeout)
}
+/*!
+ \class QSemaphoreReleaser
+ \brief The QSemaphoreReleaser class provides exception-safe deferral of a QSemaphore::release() call
+ \since 5.10
+ \ingroup thread
+ \inmodule QtCore
+
+ \reentrant
+
+ QSemaphoreReleaser can be used wherever you would otherwise use
+ QSemaphore::release(). Constructing a QSemaphoreReleaser defers the
+ release() call on the semaphore until the QSemaphoreReleaser is
+ destroyed (see
+ \l{http://en.cppreference.com/w/cpp/language/raii}{RAII pattern}).
+
+ You can use this to reliably release a semaphore to avoid dead-lock
+ in the face of exceptions or early returns:
+
+ \code
+ // ... do something that may throw or return early
+ sem.release();
+ \endcode
+
+ If an early return is taken or an exception is thrown before the
+ \c{sem.release()} call is reached, the semaphore is not released,
+ possibly preventing the thread waiting in the corresponding
+ \c{sem.acquire()} call from ever continuing execution.
+
+ When using RAII instead:
+
+ \code
+ const QSemaphoreReleaser releaser(sem);
+ // ... do something that may throw or early return
+ // implicitly calls sem.release() here and at every other return in between
+ \endcode
+
+ this can no longer happen, because the compiler will make sure that
+ the QSemaphoreReleaser destructor is always called, and therefore
+ the semaphore is always released.
+
+ QSemaphoreReleaser is move-enabled and can therefore be returned
+ from functions to transfer responsibility for releasing a semaphore
+ out of a function or a scope:
+
+ \code
+ { // some scope
+ QSemaphoreReleaser releaser; // does nothing
+ // ...
+ if (someCondition) {
+ releaser = QSemaphoreReleaser(sem);
+ // ...
+ }
+ // ...
+ } // conditionally calls sem.release(), depending on someCondition
+ \endcode
+
+ A QSemaphoreReleaser can be canceled by a call to cancel(). A canceled
+ semaphore releaser will no longer call QSemaphore::release() in its
+ destructor.
+
+ \sa QMutexLocker
+*/
+
+/*!
+ \fn QSemaphoreReleaser::QSemaphoreReleaser()
+
+ Default constructor. Creates a QSemaphoreReleaser that does nothing.
+*/
+
+/*!
+ \fn QSemaphoreReleaser::QSemaphoreReleaser(QSemaphore &sem, int n)
+
+ Constructor. Stores the arguments and calls \a{sem}.release(\a{n})
+ in the destructor.
+*/
+
+/*!
+ \fn QSemaphoreReleaser::QSemaphoreReleaser(QSemaphore *sem, int n)
+
+ Constructor. Stores the arguments and calls \a{sem}->release(\a{n})
+ in the destructor.
+*/
+
+/*!
+ \fn QSemaphoreReleaser::QSemaphoreReleaser(QSemaphoreReleaser &&other)
+
+ Move constructor. Takes over responsibility to call QSemaphore::release()
+ from \a other, which in turn is canceled.
+
+ \sa cancel()
+*/
+
+/*!
+ \fn QSemaphoreReleaser::operator=(QSemaphoreReleaser &&other)
+
+ Move assignment operator. Takes over responsibility to call QSemaphore::release()
+ from \a other, which in turn is canceled.
+
+ If this semaphore releaser had the responsibility to call some QSemaphore::release()
+ itself, it performs the call before taking over from \a other.
+
+ \sa cancel()
+*/
+
+/*!
+ \fn QSemaphoreReleaser::~QSemaphoreReleaser()
+
+ Unless canceled, calls QSemaphore::release() with the arguments provided
+ to the constructor, or by the last move assignment.
+*/
+
+/*!
+ \fn QSemaphoreReleaser::swap(QSemaphoreReleaser &other)
+
+ Exchanges the responsibilites of \c{*this} and \a other.
+
+ Unlike move assignment, neither of the two objects ever releases its
+ semaphore, if any, as a consequence of swapping.
+
+ Therefore this function is very fast and never fails.
+*/
+
+/*!
+ \fn QSemaphoreReleaser::semaphore() const
+
+ Returns a pointer to the QSemaphore object provided to the constructor,
+ or by the last move assignment, if any. Otherwise, returns \c nullptr.
+*/
+
+/*!
+ \fn QSemaphoreReleaser::cancel()
+
+ Cancels this QSemaphoreReleaser such that the destructor will no longer
+ call \c{semaphore()->release()}. Returns the value of semaphore()
+ before this call. After this call, semaphore() will return \c nullptr.
+
+ To enable again, assign a new QSemaphoreReleaser:
+
+ \code
+ releaser.cancel(); // avoid releasing old semaphore()
+ releaser = QSemaphoreReleaser(sem, 42);
+ // now will call sem.release(42) when 'releaser' is destroyed
+ \endcode
+*/
+
+
QT_END_NAMESPACE
#endif // QT_NO_THREAD
diff --git a/src/corelib/thread/qsemaphore.h b/src/corelib/thread/qsemaphore.h
index adb9d73e50..a92740c8ce 100644
--- a/src/corelib/thread/qsemaphore.h
+++ b/src/corelib/thread/qsemaphore.h
@@ -69,6 +69,45 @@ private:
QSemaphorePrivate *d;
};
+class QSemaphoreReleaser
+{
+ QSemaphore *m_sem = nullptr;
+ int m_n;
+public:
+ QSemaphoreReleaser() = default;
+ explicit QSemaphoreReleaser(QSemaphore &sem, int n = 1) Q_DECL_NOTHROW
+ : m_sem(&sem), m_n(n) {}
+ explicit QSemaphoreReleaser(QSemaphore *sem, int n = 1) Q_DECL_NOTHROW
+ : m_sem(sem), m_n(n) {}
+ QSemaphoreReleaser(QSemaphoreReleaser &&other) Q_DECL_NOTHROW
+ : m_sem(other.m_sem), m_n(other.m_n)
+ { other.m_sem = nullptr; }
+ QSemaphoreReleaser &operator=(QSemaphoreReleaser &&other) Q_DECL_NOTHROW
+ { QSemaphoreReleaser moved(std::move(other)); swap(moved); return *this; }
+
+ ~QSemaphoreReleaser()
+ {
+ if (m_sem)
+ m_sem->release(m_n);
+ }
+
+ void swap(QSemaphoreReleaser &other) Q_DECL_NOTHROW
+ {
+ qSwap(m_sem, other.m_sem);
+ qSwap(m_n, other.m_n);
+ }
+
+ QSemaphore *semaphore() const Q_DECL_NOTHROW
+ { return m_sem; }
+
+ QSemaphore *cancel() Q_DECL_NOTHROW
+ {
+ QSemaphore *old = m_sem;
+ m_sem = nullptr;
+ return old;
+ }
+};
+
#endif // QT_NO_THREAD
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 996a1df9a0..1ec626a53b 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -291,7 +291,7 @@ QThreadPrivate::~QThreadPrivate()
\fn int QThread::idealThreadCount()
Returns the ideal number of threads that can be run on the system. This is done querying
- the number of processor cores, both real and logical, in the system. This function returns -1
+ the number of processor cores, both real and logical, in the system. This function returns 1
if the number of processor cores could not be detected.
*/
@@ -880,6 +880,51 @@ bool QThread::isInterruptionRequested() const
return d->interruptionRequested;
}
+/*
+ \fn template <typename Function, typename Args...> static QThread *QThread::create(Function &&f, Args &&... args)
+ \since 5.10
+
+ Creates a new QThread object that will execute the function \a f with the
+ arguments \a args.
+
+ The new thread is not started -- it must be started by an explicit call
+ to start(). This allows you to connect to its signals, move QObjects
+ to the thread, choose the new thread's priority and so on. The function
+ \a f will be called in the new thread.
+
+ Returns the newly created QThread instance.
+
+ \note the caller acquires ownership of the returned QThread instance.
+
+ \note this function is only available when using C++17.
+
+ \warning do not call start() on the returned QThread instance more than once;
+ doing so will result in undefined behavior.
+
+ \sa start()
+*/
+
+/*
+ \fn template <typename Function> static QThread *QThread::create(Function &&f)
+ \since 5.10
+
+ Creates a new QThread object that will execute the function \a f.
+
+ The new thread is not started -- it must be started by an explicit call
+ to start(). This allows you to connect to its signals, move QObjects
+ to the thread, choose the new thread's priority and so on. The function
+ \a f will be called in the new thread.
+
+ Returns the newly created QThread instance.
+
+ \note the caller acquires ownership of the returned QThread instance.
+
+ \warning do not call start() on the returned QThread instance more than once;
+ doing so will result in undefined behavior.
+
+ \sa start()
+*/
+
/*!
\class QDaemonThread
\since 5.5
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index 45786537e2..5e6f216219 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -42,6 +42,27 @@
#include <QtCore/qobject.h>
+// The implementation of QThread::create uses various C++14/C++17 facilities;
+// we must check for their presence. Specifically for glibcxx bundled in MinGW
+// with win32 threads, we check the condition found in its <future> header
+// since _GLIBCXX_HAS_GTHREADS might then not be defined.
+// For std::async (used in all codepaths)
+// there is no SG10 feature macro; just test for the header presence.
+// For the C++17 codepath do some more throughout checks for std::invoke and
+// C++14 lambdas availability.
+#if QT_HAS_INCLUDE(<future>) \
+ && (!defined(__GLIBCXX__) || (defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)))
+# define QTHREAD_HAS_CREATE
+# include <future> // for std::async
+# include <functional> // for std::invoke; no guard needed as it's a C++98 header
+
+# if defined(__cpp_lib_invoke) && __cpp_lib_invoke >= 201411 \
+ && defined(__cpp_init_captures) && __cpp_init_captures >= 201304 \
+ && defined(__cpp_generic_lambdas) && __cpp_generic_lambdas >= 201304
+# define QTHREAD_HAS_VARIADIC_CREATE
+# endif
+#endif
+
#include <limits.h>
QT_BEGIN_NAMESPACE
@@ -98,6 +119,16 @@ public:
bool event(QEvent *event) Q_DECL_OVERRIDE;
int loopLevel() const;
+#ifdef QTHREAD_HAS_CREATE
+#ifdef QTHREAD_HAS_VARIADIC_CREATE
+ template <typename Function, typename... Args>
+ static QThread *create(Function &&f, Args &&... args);
+#else
+ template <typename Function>
+ static QThread *create(Function &&f);
+#endif
+#endif
+
public Q_SLOTS:
void start(Priority = InheritPriority);
void terminate();
@@ -131,6 +162,99 @@ private:
friend class QThreadData;
};
+#ifdef QTHREAD_HAS_CREATE
+namespace QtPrivate {
+
+class QThreadCreateThread : public QThread
+{
+public:
+#if defined(QTHREAD_HAS_VARIADIC_CREATE)
+ // C++17: std::thread's constructor complying call
+ template <typename Function, typename... Args>
+ explicit QThreadCreateThread(Function &&f, Args &&... args)
+ : m_future(std::async(std::launch::deferred,
+ [f = static_cast<typename std::decay<Function>::type>(std::forward<Function>(f))](auto &&... largs) mutable -> void
+ {
+ (void)std::invoke(std::move(f), std::forward<decltype(largs)>(largs)...);
+ }, std::forward<Args>(args)...))
+ {
+ }
+#elif defined(__cpp_init_captures) && __cpp_init_captures >= 201304
+ // C++14: implementation for just one callable
+ template <typename Function>
+ explicit QThreadCreateThread(Function &&f)
+ : m_future(std::async(std::launch::deferred,
+ [f = static_cast<typename std::decay<Function>::type>(std::forward<Function>(f))]() mutable -> void
+ {
+ (void)f();
+ }))
+ {
+ }
+#else
+private:
+ // C++11: same as C++14, but with a workaround for not having generalized lambda captures
+ template <typename Function>
+ struct Callable
+ {
+ explicit Callable(Function &&f)
+ : m_function(std::forward<Function>(f))
+ {
+ }
+
+#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])
+ ~Callable() = default;
+ Callable(const Callable &) = default;
+ Callable(Callable &&) = default;
+ Callable &operator=(const Callable &) = delete;
+ Callable &operator=(Callable &&) = default;
+#endif
+
+ void operator()()
+ {
+ (void)m_function();
+ }
+
+ typename std::decay<Function>::type m_function;
+ };
+
+public:
+ template <typename Function>
+ explicit QThreadCreateThread(Function &&f)
+ : m_future(std::async(std::launch::deferred, Callable<Function>(std::forward<Function>(f))))
+ {
+ }
+#endif // QTHREAD_HAS_VARIADIC_CREATE
+
+private:
+ void run() override
+ {
+ m_future.get();
+ }
+
+ std::future<void> m_future;
+};
+
+} // namespace QtPrivate
+
+#ifdef QTHREAD_HAS_VARIADIC_CREATE
+template <typename Function, typename... Args>
+QThread *QThread::create(Function &&f, Args &&... args)
+{
+ return new QtPrivate::QThreadCreateThread(std::forward<Function>(f), std::forward<Args>(args)...);
+}
+#else
+template <typename Function>
+QThread *QThread::create(Function &&f)
+{
+ return new QtPrivate::QThreadCreateThread(std::forward<Function>(f));
+}
+#endif // QTHREAD_HAS_VARIADIC_CREATE
+
+#endif // QTHREAD_HAS_CREATE
+
#else // QT_NO_THREAD
class Q_CORE_EXPORT QThread : public QObject
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 885b4c0c1e..f3d4750177 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -184,8 +184,8 @@ public:
#endif // Q_OS_UNIX
#ifdef Q_OS_WIN
- static unsigned int __stdcall start(void *);
- static void finish(void *, bool lockAnyway=true);
+ static unsigned int __stdcall start(void *) Q_DECL_NOEXCEPT;
+ static void finish(void *, bool lockAnyway=true) Q_DECL_NOEXCEPT;
Qt::HANDLE handle;
unsigned int id;
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 69a11b2b62..6540f02f34 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -61,6 +61,10 @@
#include "qdebug.h"
+#ifdef __GLIBCXX__
+#include <cxxabi.h>
+#endif
+
#include <sched.h>
#include <errno.h>
@@ -324,49 +328,70 @@ void *QThreadPrivate::start(void *arg)
#endif
pthread_cleanup_push(QThreadPrivate::finish, arg);
- QThread *thr = reinterpret_cast<QThread *>(arg);
- QThreadData *data = QThreadData::get2(thr);
-
+#ifndef QT_NO_EXCEPTIONS
+ try
+#endif
{
- QMutexLocker locker(&thr->d_func()->mutex);
+ QThread *thr = reinterpret_cast<QThread *>(arg);
+ QThreadData *data = QThreadData::get2(thr);
- // do we need to reset the thread priority?
- if (int(thr->d_func()->priority) & ThreadPriorityResetFlag) {
- thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
- }
-
- data->threadId.store(to_HANDLE(pthread_self()));
- set_thread_data(data);
+ {
+ QMutexLocker locker(&thr->d_func()->mutex);
- data->ref();
- data->quitNow = thr->d_func()->exited;
- }
+ // do we need to reset the thread priority?
+ if (int(thr->d_func()->priority) & ThreadPriorityResetFlag) {
+ thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
+ }
- if (data->eventDispatcher.load()) // custom event dispatcher set?
- data->eventDispatcher.load()->startingUp();
- else
- createEventDispatcher(data);
+ data->threadId.store(to_HANDLE(pthread_self()));
+ set_thread_data(data);
-#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
- {
- // sets the name of the current thread.
- QString objectName = thr->objectName();
+ data->ref();
+ data->quitNow = thr->d_func()->exited;
+ }
- pthread_t thread_id = from_HANDLE<pthread_t>(data->threadId.load());
- if (Q_LIKELY(objectName.isEmpty()))
- setCurrentThreadName(thread_id, thr->metaObject()->className());
+ if (data->eventDispatcher.load()) // custom event dispatcher set?
+ data->eventDispatcher.load()->startingUp();
else
- setCurrentThreadName(thread_id, objectName.toLocal8Bit());
- }
+ createEventDispatcher(data);
+
+#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
+ {
+ // sets the name of the current thread.
+ QString objectName = thr->objectName();
+
+ pthread_t thread_id = from_HANDLE<pthread_t>(data->threadId.load());
+ if (Q_LIKELY(objectName.isEmpty()))
+ setCurrentThreadName(thread_id, thr->metaObject()->className());
+ else
+ setCurrentThreadName(thread_id, objectName.toLocal8Bit());
+ }
#endif
- emit thr->started(QThread::QPrivateSignal());
+ emit thr->started(QThread::QPrivateSignal());
#if !defined(Q_OS_ANDROID)
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
- pthread_testcancel();
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+ pthread_testcancel();
#endif
- thr->run();
+ thr->run();
+ }
+#ifndef QT_NO_EXCEPTIONS
+#ifdef __GLIBCXX__
+ // POSIX thread cancellation under glibc is implemented by throwing an exception
+ // of this type. Do what libstdc++ is doing and handle it specially in order not to
+ // abort the application if user's code calls a cancellation function.
+ catch (const abi::__forced_unwind &) {
+ throw;
+ }
+#endif // __GLIBCXX__
+ catch (...) {
+ qTerminate();
+ }
+#endif // QT_NO_EXCEPTIONS
+ // This pop runs finish() below. It's outside the try/catch (and has its
+ // own try/catch) to prevent finish() to be run in case an exception is
+ // thrown.
pthread_cleanup_pop(1);
return 0;
@@ -374,35 +399,53 @@ void *QThreadPrivate::start(void *arg)
void QThreadPrivate::finish(void *arg)
{
- QThread *thr = reinterpret_cast<QThread *>(arg);
- QThreadPrivate *d = thr->d_func();
+#ifndef QT_NO_EXCEPTIONS
+ try
+#endif
+ {
+ QThread *thr = reinterpret_cast<QThread *>(arg);
+ QThreadPrivate *d = thr->d_func();
- QMutexLocker locker(&d->mutex);
+ QMutexLocker locker(&d->mutex);
- d->isInFinish = true;
- d->priority = QThread::InheritPriority;
- void *data = &d->data->tls;
- locker.unlock();
- emit thr->finished(QThread::QPrivateSignal());
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QThreadStorageData::finish((void **)data);
- locker.relock();
-
- QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.load();
- if (eventDispatcher) {
- d->data->eventDispatcher = 0;
+ d->isInFinish = true;
+ d->priority = QThread::InheritPriority;
+ void *data = &d->data->tls;
locker.unlock();
- eventDispatcher->closingDown();
- delete eventDispatcher;
+ emit thr->finished(QThread::QPrivateSignal());
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QThreadStorageData::finish((void **)data);
locker.relock();
- }
- d->running = false;
- d->finished = true;
- d->interruptionRequested = false;
+ QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.load();
+ if (eventDispatcher) {
+ d->data->eventDispatcher = 0;
+ locker.unlock();
+ eventDispatcher->closingDown();
+ delete eventDispatcher;
+ locker.relock();
+ }
+
+ d->running = false;
+ d->finished = true;
+ d->interruptionRequested = false;
- d->isInFinish = false;
- d->thread_done.wakeAll();
+ d->isInFinish = false;
+ d->thread_done.wakeAll();
+ }
+#ifndef QT_NO_EXCEPTIONS
+#ifdef __GLIBCXX__
+ // POSIX thread cancellation under glibc is implemented by throwing an exception
+ // of this type. Do what libstdc++ is doing and handle it specially in order not to
+ // abort the application if user's code calls a cancellation function.
+ catch (const abi::__forced_unwind &) {
+ throw;
+ }
+#endif // __GLIBCXX__
+ catch (...) {
+ qTerminate();
+ }
+#endif // QT_NO_EXCEPTIONS
}
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index ef7bfc511d..24d3ca2d7d 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -344,7 +344,7 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
#ifndef QT_NO_THREAD
-unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg)
+unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) Q_DECL_NOEXCEPT
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadData *data = QThreadData::get2(thr);
@@ -381,7 +381,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
return 0;
}
-void QThreadPrivate::finish(void *arg, bool lockAnyway)
+void QThreadPrivate::finish(void *arg, bool lockAnyway) Q_DECL_NOEXCEPT
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadPrivate *d = thr->d_func();
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index f3ce1f258f..ba46d98cf9 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -74,7 +74,9 @@ public:
*/
QThreadPoolThread::QThreadPoolThread(QThreadPoolPrivate *manager)
:manager(manager), runnable(0)
-{ }
+{
+ setStackSize(manager->stackSize);
+}
/*
\internal
@@ -154,11 +156,6 @@ void QThreadPoolThread::registerThreadInactive()
\internal
*/
QThreadPoolPrivate:: QThreadPoolPrivate()
- : isExiting(false),
- expiryTimeout(30000),
- maxThreadCount(qAbs(QThread::idealThreadCount())),
- reservedThreads(0),
- activeThreads(0)
{ }
bool QThreadPoolPrivate::tryStart(QRunnable *task)
@@ -609,6 +606,32 @@ void QThreadPool::reserveThread()
++d->reservedThreads;
}
+/*! \property QThreadPool::stackSize
+
+ This property contains the stack size for the thread pool worker
+ threads.
+
+ The value of the property is only used when the thread pool creates
+ new threads. Changing it has no effect for already created
+ or running threads.
+
+ The default value is 0, which makes QThread use the operating
+ system default stack size.
+
+ \since 5.10
+*/
+void QThreadPool::setStackSize(uint stackSize)
+{
+ Q_D(QThreadPool);
+ d->stackSize = stackSize;
+}
+
+uint QThreadPool::stackSize() const
+{
+ Q_D(const QThreadPool);
+ return d->stackSize;
+}
+
/*!
Releases a thread previously reserved by a call to reserveThread().
diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h
index 09b7f96f48..a65eacc996 100644
--- a/src/corelib/thread/qthreadpool.h
+++ b/src/corelib/thread/qthreadpool.h
@@ -58,6 +58,7 @@ class Q_CORE_EXPORT QThreadPool : public QObject
Q_PROPERTY(int expiryTimeout READ expiryTimeout WRITE setExpiryTimeout)
Q_PROPERTY(int maxThreadCount READ maxThreadCount WRITE setMaxThreadCount)
Q_PROPERTY(int activeThreadCount READ activeThreadCount)
+ Q_PROPERTY(uint stackSize READ stackSize WRITE setStackSize)
friend class QFutureInterfaceBase;
public:
@@ -77,6 +78,9 @@ public:
int activeThreadCount() const;
+ void setStackSize(uint stackSize);
+ uint stackSize() const;
+
void reserveThread();
void releaseThread();
diff --git a/src/corelib/thread/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h
index 4a9f9e5cfa..8b6a8cc476 100644
--- a/src/corelib/thread/qthreadpool_p.h
+++ b/src/corelib/thread/qthreadpool_p.h
@@ -53,6 +53,7 @@
//
#include "QtCore/qmutex.h"
+#include "QtCore/qthread.h"
#include "QtCore/qwaitcondition.h"
#include "QtCore/qset.h"
#include "QtCore/qqueue.h"
@@ -91,11 +92,12 @@ public:
QVector<QPair<QRunnable *, int> > queue;
QWaitCondition noActiveThreads;
- bool isExiting;
- int expiryTimeout;
- int maxThreadCount;
- int reservedThreads;
- int activeThreads;
+ int expiryTimeout = 30000;
+ int maxThreadCount = QThread::idealThreadCount();
+ int reservedThreads = 0;
+ int activeThreads = 0;
+ uint stackSize = 0;
+ bool isExiting = false;
};
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 0e7365c32b..9b648adb06 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -686,14 +686,6 @@ QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel)
\sa qCompress()
*/
-/*! \relates QByteArray
-
- \overload
-
- Uncompresses the first \a nbytes of \a data and returns a new byte
- array with the uncompressed data.
-*/
-
#ifndef QT_NO_COMPRESS
namespace {
struct QByteArrayDataDeleter
@@ -709,6 +701,13 @@ static QByteArray invalidCompressedData()
return QByteArray();
}
+/*! \relates QByteArray
+
+ \overload
+
+ Uncompresses the first \a nbytes of \a data and returns a new byte
+ array with the uncompressed data.
+*/
QByteArray qUncompress(const uchar* data, int nbytes)
{
if (!data) {
@@ -1134,6 +1133,13 @@ static inline char qToLower(char c)
Same as prepend(\a ch).
*/
+/*! \fn void QByteArray::shrink_to_fit()
+ \since 5.10
+
+ This function is provided for STL compatibility. It is equivalent to
+ squeeze().
+*/
+
/*! \fn QByteArray::QByteArray(const QByteArray &other)
Constructs a copy of \a other.
@@ -1446,6 +1452,66 @@ QByteArray &QByteArray::operator=(const char *str)
\overload
*/
+/*!
+ \fn char QByteArray::front() const
+ \since 5.10
+
+ Returns the first character in the byte array.
+ Same as \c{at(0)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty byte array constitutes
+ undefined behavior.
+
+ \sa back(), at(), operator[]()
+*/
+
+/*!
+ \fn char QByteArray::back() const
+ \since 5.10
+
+ Returns the last character in the byte array.
+ Same as \c{at(size() - 1)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty byte array constitutes
+ undefined behavior.
+
+ \sa front(), at(), operator[]()
+*/
+
+/*!
+ \fn QByteRef QByteArray::front()
+ \since 5.10
+
+ Returns a reference to the first character in the byte array.
+ Same as \c{operator[](0)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty byte array constitutes
+ undefined behavior.
+
+ \sa back(), at(), operator[]()
+*/
+
+/*!
+ \fn QByteRef QByteArray::back()
+ \since 5.10
+
+ Returns a reference to the last character in the byte array.
+ Same as \c{operator[](size() - 1)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty byte array constitutes
+ undefined behavior.
+
+ \sa front(), at(), operator[]()
+*/
+
/*! \fn bool QByteArray::contains(const QByteArray &ba) const
Returns \c true if the byte array contains an occurrence of the byte
@@ -2905,7 +2971,7 @@ bool QByteArray::endsWith(char ch) const
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 27
- \sa right(), mid(), startsWith(), truncate()
+ \sa startsWith(), right(), mid(), chopped(), chop(), truncate()
*/
QByteArray QByteArray::left(int len) const
@@ -2927,7 +2993,7 @@ QByteArray QByteArray::left(int len) const
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 28
- \sa endsWith(), left(), mid()
+ \sa endsWith(), left(), mid(), chopped(), chop(), truncate()
*/
QByteArray QByteArray::right(int len) const
@@ -2950,7 +3016,7 @@ QByteArray QByteArray::right(int len) const
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 29
- \sa left(), right()
+ \sa left(), right(), chopped(), chop(), truncate()
*/
QByteArray QByteArray::mid(int pos, int len) const
@@ -2974,6 +3040,18 @@ QByteArray QByteArray::mid(int pos, int len) const
}
/*!
+ \fn QByteArray::chopped(int len) const
+ \since 5.10
+
+ Returns a byte array that contains the leftmost size() - \a len bytes of
+ this byte array.
+
+ \note The behavior is undefined if \a len is negative or greater than size().
+
+ \sa endsWith(), left(), right(), mid(), chop(), truncate()
+*/
+
+/*!
\fn QByteArray QByteArray::toLower() const
Returns a lowercase copy of the byte array. The bytearray is
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 432ef922f6..9a600ca366 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -186,32 +186,36 @@ public:
{ qSwap(d, other.d); }
inline int size() const;
- bool isEmpty() const;
+ inline bool isEmpty() const;
void resize(int size);
QByteArray &fill(char c, int size = -1);
- int capacity() const;
- void reserve(int size);
- void squeeze();
+ inline int capacity() const;
+ inline void reserve(int size);
+ inline void squeeze();
#ifndef QT_NO_CAST_FROM_BYTEARRAY
- operator const char *() const;
- operator const void *() const;
+ inline operator const char *() const;
+ inline operator const void *() const;
#endif
- char *data();
- const char *data() const;
+ inline char *data();
+ inline const char *data() const;
inline const char *constData() const;
inline void detach();
- bool isDetached() const;
+ inline bool isDetached() const;
inline bool isSharedWith(const QByteArray &other) const { return d == other.d; }
void clear();
- char at(int i) const;
- char operator[](int i) const;
- char operator[](uint i) const;
- QByteRef operator[](int i);
- QByteRef operator[](uint i);
+ 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 char front() const { return at(0); }
+ Q_REQUIRED_RESULT inline QByteRef front();
+ Q_REQUIRED_RESULT char back() const { return at(size() - 1); }
+ Q_REQUIRED_RESULT inline QByteRef back();
int indexOf(char c, int from = 0) const;
int indexOf(const char *c, int from = 0) const;
@@ -220,9 +224,9 @@ public:
int lastIndexOf(const char *c, int from = -1) const;
int lastIndexOf(const QByteArray &a, int from = -1) const;
- bool contains(char c) const;
- bool contains(const char *a) const;
- bool contains(const QByteArray &a) const;
+ inline bool contains(char c) const;
+ inline bool contains(const char *a) const;
+ inline bool contains(const QByteArray &a) const;
int count(char c) const;
int count(const char *a) const;
int count(const QByteArray &a) const;
@@ -230,6 +234,8 @@ public:
Q_REQUIRED_RESULT QByteArray left(int len) const;
Q_REQUIRED_RESULT QByteArray right(int len) const;
Q_REQUIRED_RESULT QByteArray mid(int index, int len = -1) const;
+ Q_REQUIRED_RESULT QByteArray chopped(int len) const
+ { Q_ASSERT(len >= 0); Q_ASSERT(len <= size()); return left(size() - len); }
bool startsWith(const QByteArray &a) const;
bool startsWith(char c) const;
@@ -280,12 +286,12 @@ public:
Q_REQUIRED_RESULT QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
QByteArray &prepend(char c);
- QByteArray &prepend(int count, char c);
+ inline QByteArray &prepend(int count, char c);
QByteArray &prepend(const char *s);
QByteArray &prepend(const char *s, int len);
QByteArray &prepend(const QByteArray &a);
QByteArray &append(char c);
- QByteArray &append(int count, char c);
+ inline QByteArray &append(int count, char c);
QByteArray &append(const char *s);
QByteArray &append(const char *s, int len);
QByteArray &append(const QByteArray &a);
@@ -298,17 +304,17 @@ public:
QByteArray &replace(int index, int len, const char *s);
QByteArray &replace(int index, int len, const char *s, int alen);
QByteArray &replace(int index, int len, const QByteArray &s);
- QByteArray &replace(char before, const char *after);
+ inline QByteArray &replace(char before, const char *after);
QByteArray &replace(char before, const QByteArray &after);
- QByteArray &replace(const char *before, const char *after);
+ inline QByteArray &replace(const char *before, const char *after);
QByteArray &replace(const char *before, int bsize, const char *after, int asize);
QByteArray &replace(const QByteArray &before, const QByteArray &after);
- QByteArray &replace(const QByteArray &before, const char *after);
+ inline QByteArray &replace(const QByteArray &before, const char *after);
QByteArray &replace(const char *before, const QByteArray &after);
QByteArray &replace(char before, char after);
- QByteArray &operator+=(char c);
- QByteArray &operator+=(const char *s);
- QByteArray &operator+=(const QByteArray &a);
+ inline QByteArray &operator+=(char c);
+ inline QByteArray &operator+=(const char *s);
+ inline QByteArray &operator+=(const QByteArray &a);
QList<QByteArray> split(char sep) const;
@@ -352,13 +358,13 @@ public:
const QByteArray &include = QByteArray(),
char percent = '%') const;
- QByteArray &setNum(short, int base = 10);
- QByteArray &setNum(ushort, int base = 10);
- QByteArray &setNum(int, int base = 10);
- QByteArray &setNum(uint, int base = 10);
+ inline QByteArray &setNum(short, int base = 10);
+ inline QByteArray &setNum(ushort, int base = 10);
+ inline QByteArray &setNum(int, int base = 10);
+ inline QByteArray &setNum(uint, int base = 10);
QByteArray &setNum(qlonglong, int base = 10);
QByteArray &setNum(qulonglong, int base = 10);
- QByteArray &setNum(float, char f = 'g', int prec = 6);
+ inline QByteArray &setNum(float, char f = 'g', int prec = 6);
QByteArray &setNum(double, char f = 'g', int prec = 6);
QByteArray &setRawData(const char *a, uint n); // ### Qt 6: use an int
@@ -413,12 +419,13 @@ public:
typedef char *pointer;
typedef const char *const_pointer;
typedef char value_type;
- void push_back(char c);
- void push_back(const char *c);
- void push_back(const QByteArray &a);
- void push_front(char c);
- void push_front(const char *c);
- void push_front(const QByteArray &a);
+ inline void push_back(char c);
+ inline void push_back(const char *c);
+ inline void push_back(const QByteArray &a);
+ inline void push_front(char c);
+ inline void push_front(const char *c);
+ inline void push_front(const QByteArray &a);
+ void shrink_to_fit() { squeeze(); }
static inline QByteArray fromStdString(const std::string &s);
inline std::string toStdString() const;
@@ -549,6 +556,8 @@ inline QByteRef QByteArray::operator[](int i)
{ Q_ASSERT(i >= 0); return QByteRef(*this, i); }
inline QByteRef QByteArray::operator[](uint i)
{ return QByteRef(*this, i); }
+inline QByteRef QByteArray::front() { return operator[](0); }
+inline QByteRef QByteArray::back() { return operator[](size() - 1); }
inline QByteArray::iterator QByteArray::begin()
{ detach(); return d->data(); }
inline QByteArray::const_iterator QByteArray::begin() const
@@ -683,8 +692,4 @@ Q_DECLARE_SHARED(QByteArray)
QT_END_NAMESPACE
-#ifdef QT_USE_QSTRINGBUILDER
-#include <QtCore/qstring.h>
-#endif
-
#endif // QBYTEARRAY_H
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 1d3293e85e..5c887f47cd 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -608,6 +608,24 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QChar::QChar(char16_t ch)
+ \since 5.10
+
+ Constructs a QChar corresponding to the UTF-16 character \a ch.
+
+ \note This constructor is not available on MSVC 2013.
+*/
+
+/*!
+ \fn QChar::QChar(wchar_t ch)
+ \since 5.10
+
+ Constructs a QChar corresponding to the wide character \a ch.
+
+ \note This constructor is only available on Windows.
+*/
+
+/*!
\fn QChar::QChar(char ch)
Constructs a QChar corresponding to ASCII/Latin-1 character \a ch.
@@ -1532,6 +1550,11 @@ static inline ushort foldCase(ushort ch) Q_DECL_NOTHROW
return convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
}
+static inline QChar foldCase(QChar ch) Q_DECL_NOTHROW
+{
+ return QChar(foldCase(ch.unicode()));
+}
+
/*!
\fn QChar QChar::toCaseFolded() const
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 81ef67d116..53cb8993fb 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -86,6 +86,13 @@ public:
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
+#if defined(Q_COMPILER_UNICODE_STRINGS)
+ Q_DECL_CONSTEXPR QChar(char16_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+#endif
+#if defined(Q_OS_WIN)
+ Q_STATIC_ASSERT(sizeof(wchar_t) == sizeof(ushort));
+ Q_DECL_CONSTEXPR QChar(wchar_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+#endif
#ifndef QT_NO_CAST_FROM_ASCII
QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) Q_DECL_NOTHROW : ucs(uchar(c)) { }
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 5410adc737..ffad2df053 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -181,13 +181,18 @@ public:
#endif
};
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
- void sha3Finish(int bitCount);
+ enum class Sha3Variant
+ {
+ Sha3,
+ Keccak
+ };
+ void sha3Finish(int bitCount, Sha3Variant sha3Variant);
#endif
QByteArray result;
};
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
-void QCryptographicHashPrivate::sha3Finish(int bitCount)
+void QCryptographicHashPrivate::sha3Finish(int bitCount, Sha3Variant sha3Variant)
{
/*
FIPS 202 §6.1 defines SHA-3 in terms of calculating the Keccak function
@@ -214,7 +219,15 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount)
result.resize(bitCount / 8);
SHA3Context copy = sha3Context;
- sha3Update(&copy, reinterpret_cast<const BitSequence *>(&sha3FinalSuffix), 2);
+
+ switch (sha3Variant) {
+ case Sha3Variant::Sha3:
+ sha3Update(&copy, reinterpret_cast<const BitSequence *>(&sha3FinalSuffix), 2);
+ break;
+ case Sha3Variant::Keccak:
+ break;
+ }
+
sha3Final(&copy, reinterpret_cast<BitSequence *>(result.data()));
}
#endif
@@ -239,6 +252,10 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount)
/*!
\enum QCryptographicHash::Algorithm
+ \note In Qt versions before 5.9, when asked to generate a SHA3 hash sum,
+ QCryptographicHash actually calculated Keccak. If you need compatibility with
+ SHA-3 hashes produced by those versions of Qt, use the \c{Keccak_} enumerators.
+
\value Md4 Generate an MD4 hash sum
\value Md5 Generate an MD5 hash sum
\value Sha1 Generate an SHA-1 hash sum
@@ -250,6 +267,10 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount)
\value Sha3_256 Generate an SHA3-256 hash sum. Introduced in Qt 5.1
\value Sha3_384 Generate an SHA3-384 hash sum. Introduced in Qt 5.1
\value Sha3_512 Generate an SHA3-512 hash sum. Introduced in Qt 5.1
+ \value Keccak_224 \deprecated Generate a Keccak-224 hash sum. Introduced in Qt 5.10
+ \value Keccak_256 \deprecated Generate a Keccak-256 hash sum. Introduced in Qt 5.10
+ \value Keccak_384 \deprecated Generate a Keccak-384 hash sum. Introduced in Qt 5.10
+ \value Keccak_512 \deprecated Generate a Keccak-512 hash sum. Introduced in Qt 5.10
*/
/*!
@@ -304,15 +325,19 @@ void QCryptographicHash::reset()
SHA512Reset(&d->sha512Context);
break;
case Sha3_224:
+ case Keccak_224:
sha3Init(&d->sha3Context, 224);
break;
case Sha3_256:
+ case Keccak_256:
sha3Init(&d->sha3Context, 256);
break;
case Sha3_384:
+ case Keccak_384:
sha3Init(&d->sha3Context, 384);
break;
case Sha3_512:
+ case Keccak_512:
sha3Init(&d->sha3Context, 512);
break;
#endif
@@ -355,15 +380,19 @@ void QCryptographicHash::addData(const char *data, int length)
SHA512Input(&d->sha512Context, reinterpret_cast<const unsigned char *>(data), length);
break;
case Sha3_224:
+ case Keccak_224:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
case Sha3_256:
+ case Keccak_256:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
case Sha3_384:
+ case Keccak_384:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
case Sha3_512:
+ case Keccak_512:
sha3Update(&d->sha3Context, reinterpret_cast<const BitSequence *>(data), length*8);
break;
#endif
@@ -463,19 +492,35 @@ QByteArray QCryptographicHash::result() const
break;
}
case Sha3_224: {
- d->sha3Finish(224);
+ d->sha3Finish(224, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
case Sha3_256: {
- d->sha3Finish(256);
+ d->sha3Finish(256, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
case Sha3_384: {
- d->sha3Finish(384);
+ d->sha3Finish(384, QCryptographicHashPrivate::Sha3Variant::Sha3);
break;
}
case Sha3_512: {
- d->sha3Finish(512);
+ d->sha3Finish(512, QCryptographicHashPrivate::Sha3Variant::Sha3);
+ break;
+ }
+ case Keccak_224: {
+ d->sha3Finish(224, QCryptographicHashPrivate::Sha3Variant::Keccak);
+ break;
+ }
+ case Keccak_256: {
+ d->sha3Finish(256, QCryptographicHashPrivate::Sha3Variant::Keccak);
+ break;
+ }
+ case Keccak_384: {
+ d->sha3Finish(384, QCryptographicHashPrivate::Sha3Variant::Keccak);
+ break;
+ }
+ case Keccak_512: {
+ d->sha3Finish(512, QCryptographicHashPrivate::Sha3Variant::Keccak);
break;
}
#endif
diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h
index 0f17baa036..20afab8b87 100644
--- a/src/corelib/tools/qcryptographichash.h
+++ b/src/corelib/tools/qcryptographichash.h
@@ -68,7 +68,12 @@ public:
Sha3_224,
Sha3_256,
Sha3_384,
- Sha3_512
+ Sha3_512,
+ // ### Qt 6: remove the Keccak enumerators
+ Keccak_224,
+ Keccak_256,
+ Keccak_384,
+ Keccak_512
#endif
};
Q_ENUM(Algorithm)
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 11c023f762..056dff5442 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -160,8 +160,7 @@ static ParsedDate getDateFromJulianDay(qint64 julianDay)
if (year <= 0)
--year ;
- const ParsedDate result = { year, month, day };
- return result;
+ return { year, month, day };
}
/*****************************************************************************
@@ -194,7 +193,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 == QDate::shortMonthName(i))
+ if (monthName == QLocale::system().monthName(i, QLocale::ShortFormat))
return i;
}
return -1;
@@ -212,7 +211,7 @@ static ParsedRfcDateTime rfcDateImpl(const QString &s)
{
ParsedRfcDateTime result;
- // Matches "Wdy, DD Mon YYYY HH:mm:ss ±hhmm" (Wdy, being optional)
+ // Matches "Wdy, dd Mon yyyy HH:mm:ss ±hhmm" (Wdy, being optional)
QRegExp rex(QStringLiteral("^(?:[A-Z][a-z]+,)?[ \\t]*(\\d{1,2})[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d)(?::(\\d\\d))?)?[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?"));
if (s.indexOf(rex) == 0) {
const QStringList cap = rex.capturedTexts();
@@ -224,7 +223,7 @@ static ParsedRfcDateTime rfcDateImpl(const QString &s)
const int minOffset = cap[9].toInt();
result.utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60));
} else {
- // Matches "Wdy Mon DD HH:mm:ss YYYY"
+ // Matches "Wdy Mon dd HH:mm:ss yyyy"
QRegExp rex(QStringLiteral("^[A-Z][a-z]+[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d):(\\d\\d))?[ \\t]+(\\d\\d\\d\\d)[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?"));
if (s.indexOf(rex) == 0) {
const QStringList cap = rex.capturedTexts();
@@ -612,9 +611,10 @@ int QDate::weekNumber(int *yearNumber) const
return week;
}
-#ifndef QT_NO_TEXTDATE
+#if QT_DEPRECATED_SINCE(5, 11) && !defined(QT_NO_TEXTDATE)
/*!
\since 4.5
+ \deprecated
Returns the short name of the \a month for the representation specified
by \a type.
@@ -646,19 +646,18 @@ int QDate::weekNumber(int *yearNumber) const
QString QDate::shortMonthName(int month, QDate::MonthNameType type)
{
- if (month >= 1 || month <= 12) {
- switch (type) {
- case QDate::DateFormat:
- return QLocale::system().monthName(month, QLocale::ShortFormat);
- case QDate::StandaloneFormat:
- return QLocale::system().standaloneMonthName(month, QLocale::ShortFormat);
- }
+ switch (type) {
+ case QDate::DateFormat:
+ return QLocale::system().monthName(month, QLocale::ShortFormat);
+ case QDate::StandaloneFormat:
+ return QLocale::system().standaloneMonthName(month, QLocale::ShortFormat);
}
return QString();
}
/*!
\since 4.5
+ \deprecated
Returns the long name of the \a month for the representation specified
by \a type.
@@ -690,19 +689,18 @@ QString QDate::shortMonthName(int month, QDate::MonthNameType type)
QString QDate::longMonthName(int month, MonthNameType type)
{
- if (month >= 1 && month <= 12) {
- switch (type) {
- case QDate::DateFormat:
- return QLocale::system().monthName(month, QLocale::LongFormat);
- case QDate::StandaloneFormat:
- return QLocale::system().standaloneMonthName(month, QLocale::LongFormat);
- }
+ switch (type) {
+ case QDate::DateFormat:
+ return QLocale::system().monthName(month, QLocale::LongFormat);
+ case QDate::StandaloneFormat:
+ return QLocale::system().standaloneMonthName(month, QLocale::LongFormat);
}
return QString();
}
/*!
\since 4.5
+ \deprecated
Returns the short name of the \a weekday for the representation specified
by \a type.
@@ -729,19 +727,18 @@ QString QDate::longMonthName(int month, MonthNameType type)
QString QDate::shortDayName(int weekday, MonthNameType type)
{
- if (weekday >= 1 && weekday <= 7) {
- switch (type) {
- case QDate::DateFormat:
- return QLocale::system().dayName(weekday, QLocale::ShortFormat);
- case QDate::StandaloneFormat:
- return QLocale::system().standaloneDayName(weekday, QLocale::ShortFormat);
- }
+ switch (type) {
+ case QDate::DateFormat:
+ return QLocale::system().dayName(weekday, QLocale::ShortFormat);
+ case QDate::StandaloneFormat:
+ return QLocale::system().standaloneDayName(weekday, QLocale::ShortFormat);
}
return QString();
}
/*!
\since 4.5
+ \deprecated
Returns the long name of the \a weekday for the representation specified
by \a type.
@@ -768,17 +765,15 @@ QString QDate::shortDayName(int weekday, MonthNameType type)
QString QDate::longDayName(int weekday, MonthNameType type)
{
- if (weekday >= 1 && weekday <= 7) {
- switch (type) {
- case QDate::DateFormat:
- return QLocale::system().dayName(weekday, QLocale::LongFormat);
- case QDate::StandaloneFormat:
- return QLocale::system().standaloneDayName(weekday, QLocale::LongFormat);
- }
+ switch (type) {
+ case QDate::DateFormat:
+ return QLocale::system().dayName(weekday, QLocale::LongFormat);
+ case QDate::StandaloneFormat:
+ return QLocale::system().standaloneDayName(weekday, QLocale::LongFormat);
}
return QString();
}
-#endif //QT_NO_TEXTDATE
+#endif // QT_NO_TEXTDATE && deprecated
#ifndef QT_NO_DATESTRING
@@ -787,8 +782,8 @@ static QString toStringTextDate(QDate date)
{
const ParsedDate pd = getDateFromJulianDay(date.toJulianDay());
static const QLatin1Char sp(' ');
- return date.shortDayName(date.dayOfWeek()) + sp
- + date.shortMonthName(pd.month) + 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);
}
@@ -819,8 +814,8 @@ static QString toStringIsoDate(qint64 jd)
If the \a format is Qt::ISODate, the string format corresponds
to the ISO 8601 extended specification for representations of
- dates and times, taking the form YYYY-MM-DD, where YYYY is the
- year, MM is the month of the year (between 01 and 12), and DD is
+ dates and times, taking the form yyyy-MM-dd, where yyyy is the
+ year, MM is the month of the year (between 01 and 12), and dd is
the day of the month between 01 and 31.
If the \a format is Qt::SystemLocaleShortDate or
@@ -866,7 +861,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, QStringLiteral("dd MMM yyyy"));
+ return QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy"));
default:
#ifndef QT_NO_TEXTDATE
case Qt::TextDate:
@@ -879,6 +874,9 @@ QString QDate::toString(Qt::DateFormat format) const
}
/*!
+ \fn QString QDate::toString(const QString &format) const
+ \fn QString QDate::toString(QStringView format) const
+
Returns the date as a string. The \a format parameter determines
the format of the result string.
@@ -927,10 +925,18 @@ QString QDate::toString(Qt::DateFormat format) const
\sa fromString(), QDateTime::toString(), QTime::toString(), QLocale::toString()
*/
-QString QDate::toString(const QString& format) const
+QString QDate::toString(QStringView format) const
{
return QLocale::system().toString(*this, format); // QLocale::c() ### Qt6
}
+
+#if QT_STRINGVIEW_LEVEL < 2
+QString QDate::toString(const QString &format) const
+{
+ return toString(qToStringViewIgnoringNull(format));
+}
+#endif
+
#endif //QT_NO_DATESTRING
/*!
@@ -1625,6 +1631,9 @@ QString QTime::toString(Qt::DateFormat format) const
}
/*!
+ \fn QString QTime::toString(const QString &format) const
+ \fn QString QTime::toString(QStringView format) const
+
Returns the time as a string. The \a format parameter determines
the format of the result string.
@@ -1679,11 +1688,20 @@ QString QTime::toString(Qt::DateFormat format) const
\sa fromString(), QDate::toString(), QDateTime::toString(), QLocale::toString()
*/
-QString QTime::toString(const QString& format) const
+QString QTime::toString(QStringView format) const
{
return QLocale::system().toString(*this, format); // QLocale::c() ### Qt6
}
+
+#if QT_STRINGVIEW_VERSION < 2
+QString QTime::toString(const QString &format) const
+{
+ return toString(qToStringViewIgnoringNull(format));
+}
+#endif
+
#endif //QT_NO_DATESTRING
+
/*!
Sets the time to hour \a h, minute \a m, seconds \a s and
milliseconds \a ms.
@@ -2207,6 +2225,26 @@ static QString qt_tzname(QDateTimePrivate::DaylightStatus daylightStatus)
#endif // Q_OS_WIN
}
+#ifndef QT_BOOTSTRAPPED
+/*
+ \internal
+ Implemented here to share qt_tzname()
+*/
+int QDateTimeParser::startsWithLocalTimeZone(const QStringRef name)
+{
+ QDateTimePrivate::DaylightStatus zones[2] = {
+ QDateTimePrivate::StandardTime,
+ QDateTimePrivate::DaylightTime
+ };
+ for (const auto z : zones) {
+ QString zone(qt_tzname(z));
+ if (name.startsWith(zone))
+ return zone.size();
+ }
+ return 0;
+}
+#endif // QT_BOOTSTRAPPED
+
// Calls the platform variant of mktime for the given date, time and daylightStatus,
// and updates the date, time, daylightStatus and abbreviation with the returned values
// If the date falls outside the 1970 to 2037 range supported by mktime / time_t
@@ -3751,13 +3789,13 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC)
If the \a format is Qt::ISODate, the string format corresponds
to the ISO 8601 extended specification for representations of
- dates and times, taking the form YYYY-MM-DDTHH:mm:ss[Z|[+|-]HH:mm],
+ dates and times, taking the form yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm],
depending on the timeSpec() of the QDateTime. If the timeSpec()
is Qt::UTC, Z will be appended to the string; if the timeSpec() is
Qt::OffsetFromUTC, the offset in hours and minutes from UTC will
be appended to the string. To include milliseconds in the ISO 8601
date, use the \a format Qt::ISODateWithMs, which corresponds to
- YYYY-MM-DDTHH:mm:ss.zzz[Z|[+|-]HH:mm].
+ yyyy-MM-ddTHH:mm:ss.zzz[Z|[+|-]HH:mm].
If the \a format is Qt::SystemLocaleShortDate or
Qt::SystemLocaleLongDate, the string format depends on the locale
@@ -3804,7 +3842,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, QStringLiteral("dd MMM yyyy hh:mm:ss "));
+ buf = QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy hh:mm:ss "));
buf += toOffsetString(Qt::TextDate, offsetFromUtc());
return buf;
}
@@ -3862,6 +3900,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.
@@ -3939,10 +3980,18 @@ QString QDateTime::toString(Qt::DateFormat format) const
\sa fromString(), QDate::toString(), QTime::toString(), QLocale::toString()
*/
-QString QDateTime::toString(const QString& format) const
+QString QDateTime::toString(QStringView format) const
{
return QLocale::system().toString(*this, format); // QLocale::c() ### Qt6
}
+
+#if QT_STRINGVIEW_LEVEL < 2
+QString QDateTime::toString(const QString &format) const
+{
+ return toString(qToStringViewIgnoringNull(format));
+}
+#endif
+
#endif //QT_NO_DATESTRING
static inline void massageAdjustedDateTime(const QDateTimeData &d, QDate *date, QTime *time)
@@ -4718,25 +4767,35 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
if (size < 10)
return QDateTime();
- QStringRef isoString(&string);
- Qt::TimeSpec spec = Qt::LocalTime;
-
QDate date = QDate::fromString(string.left(10), Qt::ISODate);
if (!date.isValid())
return QDateTime();
if (size == 10)
return QDateTime(date);
- isoString = isoString.right(isoString.length() - 11);
+ Qt::TimeSpec spec = Qt::LocalTime;
+ QStringRef isoString(&string);
+ isoString = isoString.mid(10); // trim "yyyy-MM-dd"
+
+ // Must be left with T and at least one digit for the hour:
+ if (isoString.size() < 2
+ || !(isoString.startsWith(QLatin1Char('T'))
+ // FIXME: QSql relies on QVariant::toDateTime() accepting a space here:
+ || isoString.startsWith(QLatin1Char(' ')))) {
+ return QDateTime();
+ }
+ isoString = isoString.mid(1); // trim 'T' (or space)
+
int offset = 0;
// Check end of string for Time Zone definition, either Z for UTC or [+-]HH:mm for Offset
if (isoString.endsWith(QLatin1Char('Z'))) {
spec = Qt::UTC;
- isoString = isoString.left(isoString.size() - 1);
+ isoString.chop(1); // trim 'Z'
} else {
// the loop below is faster but functionally equal to:
// const int signIndex = isoString.indexOf(QRegExp(QStringLiteral("[+-]")));
int signIndex = isoString.size() - 1;
+ Q_ASSERT(signIndex >= 0);
bool found = false;
{
const QChar plus = QLatin1Char('+');
@@ -4744,8 +4803,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
do {
QChar character(isoString.at(signIndex));
found = character == plus || character == minus;
- } while (--signIndex >= 0 && !found);
- ++signIndex;
+ } while (!found && --signIndex >= 0);
}
if (found) {
@@ -5275,39 +5333,53 @@ QDataStream &operator>>(QDataStream &in, QDateTime &dateTime)
QDebug operator<<(QDebug dbg, const QDate &date)
{
QDebugStateSaver saver(dbg);
- dbg.nospace() << "QDate(" << date.toString(Qt::ISODate) << ')';
+ dbg.nospace() << "QDate(";
+ if (date.isValid())
+ dbg.nospace() << date.toString(Qt::ISODate);
+ else
+ dbg.nospace() << "Invalid";
+ dbg.nospace() << ')';
return dbg;
}
QDebug operator<<(QDebug dbg, const QTime &time)
{
QDebugStateSaver saver(dbg);
- dbg.nospace() << "QTime(" << time.toString(QStringLiteral("HH:mm:ss.zzz")) << ')';
+ dbg.nospace() << "QTime(";
+ if (time.isValid())
+ dbg.nospace() << time.toString(QStringViewLiteral("HH:mm:ss.zzz"));
+ else
+ dbg.nospace() << "Invalid";
+ dbg.nospace() << ')';
return dbg;
}
QDebug operator<<(QDebug dbg, const QDateTime &date)
{
QDebugStateSaver saver(dbg);
- const Qt::TimeSpec ts = date.timeSpec();
dbg.nospace() << "QDateTime(";
- dbg.noquote() << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t"))
- << ' ' << ts;
- switch (ts) {
- case Qt::UTC:
- break;
- case Qt::OffsetFromUTC:
- dbg << ' ' << date.offsetFromUtc() << 's';
- break;
- case Qt::TimeZone:
+ if (date.isValid()) {
+ const Qt::TimeSpec ts = date.timeSpec();
+ dbg.noquote() << date.toString(QStringViewLiteral("yyyy-MM-dd HH:mm:ss.zzz t"))
+ << ' ' << ts;
+ switch (ts) {
+ case Qt::UTC:
+ break;
+ case Qt::OffsetFromUTC:
+ dbg.space() << date.offsetFromUtc() << 's';
+ break;
+ case Qt::TimeZone:
#if QT_CONFIG(timezone)
- dbg << ' ' << date.timeZone().id();
+ dbg.space() << date.timeZone().id();
#endif // timezone
- break;
- case Qt::LocalTime:
- break;
+ break;
+ case Qt::LocalTime:
+ break;
+ }
+ } else {
+ dbg.nospace() << "Invalid";
}
- return dbg << ')';
+ return dbg.nospace() << ')';
}
#endif
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 2518dc7301..adab47fc1f 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -59,7 +59,7 @@ class QTimeZone;
class Q_CORE_EXPORT QDate
{
public:
- enum MonthNameType {
+ enum MonthNameType { // ### Qt 6: remove, along with methods using it
DateFormat = 0,
StandaloneFormat
};
@@ -81,16 +81,23 @@ public:
int daysInYear() const;
int weekNumber(int *yearNum = Q_NULLPTR) const;
-#ifndef QT_NO_TEXTDATE
- static QString shortMonthName(int month, MonthNameType type = DateFormat);
- static QString shortDayName(int weekday, MonthNameType type = DateFormat);
- static QString longMonthName(int month, MonthNameType type = DateFormat);
- static QString longDayName(int weekday, MonthNameType type = DateFormat);
-#endif // QT_NO_TEXTDATE
+#if QT_DEPRECATED_SINCE(5, 11) && !defined QT_NO_TEXTDATE
+ QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
+ static QString shortMonthName(int month, MonthNameType type = DateFormat);
+ QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
+ static QString shortDayName(int weekday, MonthNameType type = DateFormat);
+ QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
+ static QString longMonthName(int month, MonthNameType type = DateFormat);
+ QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
+ static QString longDayName(int weekday, MonthNameType type = DateFormat);
+#endif // QT_NO_TEXTDATE && deprecated
#ifndef QT_NO_DATESTRING
QString toString(Qt::DateFormat f = Qt::TextDate) const;
+#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
#endif
+ QString toString(QStringView format) 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); }
@@ -162,8 +169,11 @@ public:
int msec() const;
#ifndef QT_NO_DATESTRING
QString toString(Qt::DateFormat f = Qt::TextDate) const;
+#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
#endif
+ QString toString(QStringView format) const;
+#endif
bool setHMS(int h, int m, int s, int ms = 0);
Q_REQUIRED_RESULT QTime addSecs(int secs) const;
@@ -295,8 +305,11 @@ public:
#ifndef QT_NO_DATESTRING
QString toString(Qt::DateFormat f = Qt::TextDate) const;
+#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
#endif
+ QString toString(QStringView format) const;
+#endif
Q_REQUIRED_RESULT QDateTime addDays(qint64 days) const;
Q_REQUIRED_RESULT QDateTime addMonths(int months) const;
Q_REQUIRED_RESULT QDateTime addYears(int years) const;
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 62dd25e072..3908e6710e 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -44,6 +44,7 @@
#include "qset.h"
#include "qlocale.h"
#include "qdatetime.h"
+#include "qtimezone.h"
#include "qregexp.h"
#include "qdebug.h"
@@ -86,6 +87,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
}
const SectionNode &node = sectionNodes.at(index);
switch (node.type) {
+ case TimeZoneSection: return t.offsetFromUtc();
case Hour24Section: case Hour12Section: return t.time().hour();
case MinuteSection: return t.time().minute();
case SecondSection: return t.time().second();
@@ -144,6 +146,9 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
int minute = time.minute();
int second = time.second();
int msec = time.msec();
+ Qt::TimeSpec tspec = v.timeSpec();
+ // Only offset from UTC is amenable to setting an int value:
+ int offset = tspec == Qt::OffsetFromUTC ? v.offsetFromUtc() : 0;
switch (node.type) {
case Hour24Section: case Hour12Section: hour = newVal; break;
@@ -164,6 +169,12 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
}
day = newVal;
break;
+ case TimeZoneSection:
+ if (newVal < absoluteMin(index) || newVal > absoluteMax(index))
+ return false;
+ tspec = Qt::OffsetFromUTC;
+ offset = newVal;
+ break;
case AmPmSection: hour = (newVal == 0 ? hour % 12 : (hour % 12) + 12); break;
default:
qWarning("QDateTimeParser::setDigit() Internal error (%s)",
@@ -179,17 +190,23 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
day = max;
}
}
- if (QDate::isValid(year, month, day) && QTime::isValid(hour, minute, second, msec)) {
- v = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), spec);
- return true;
- }
- return false;
+
+ const QDate newDate(year, month, day);
+ const QTime newTime(hour, minute, second, msec);
+ if (!newDate.isValid() || !newTime.isValid())
+ return false;
+
+ // Preserve zone:
+ v = (tspec == Qt::TimeZone
+ ? QDateTime(newDate, newTime, v.timeZone())
+ : QDateTime(newDate, newTime, tspec, offset));
+ return true;
}
/*!
- \
+ \internal
Returns the absolute maximum for a section
*/
@@ -198,6 +215,7 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const
{
const SectionNode &sn = sectionNode(s);
switch (sn.type) {
+ case TimeZoneSection: return QTimeZone::MaxUtcOffsetSecs;
case Hour24Section:
case Hour12Section: return 23; // this is special-cased in
// parseSection. We want it to be
@@ -232,6 +250,7 @@ int QDateTimeParser::absoluteMin(int s) const
{
const SectionNode &sn = sectionNode(s);
switch (sn.type) {
+ case TimeZoneSection: return QTimeZone::MinUtcOffsetSecs;
case Hour24Section:
case Hour12Section:
case MinuteSection:
@@ -492,7 +511,16 @@ bool QDateTimeParser::parseFormat(const QString &newFormat)
newDisplay |= sn.type;
}
break;
-
+ case 't':
+ if (parserType != QVariant::Time) {
+ const SectionNode sn = { TimeZoneSection, i - add, countRepeat(newFormat, i, 4), 0 };
+ newSectionNodes.append(sn);
+ appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);
+ i += sn.count - 1;
+ index = i + 1;
+ newDisplay |= TimeZoneSection;
+ }
+ break;
default:
break;
}
@@ -631,6 +659,8 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
case MSecSection: return 3;
case YearSection: return 4;
case YearSection2Digits: return 2;
+ // Arbitrarily many tokens (each up to 14 bytes) joined with / separators:
+ case TimeZoneSection: return std::numeric_limits<int>::max();
case CalendarPopupSection:
case Internal:
@@ -689,89 +719,79 @@ QString QDateTimeParser::sectionText(int sectionIndex) const
}
-#ifndef QT_NO_TEXTDATE
-/*!
- \internal:skipToNextSection
-
- Parses the part of \a text that corresponds to \a s and returns
- the value of that field. Sets *stateptr to the right state if
- stateptr != 0.
-*/
+#ifndef QT_NO_DATESTRING
-int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
- QString &text, int &cursorPosition, int index,
- State &state, int *usedptr) const
+QDateTimeParser::ParsedSection
+QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
+ int offset, QString *text) const
{
- state = Invalid;
- int num = 0;
+ ParsedSection result; // initially Invalid
const SectionNode &sn = sectionNode(sectionIndex);
- if ((sn.type & Internal) == Internal) {
+ if (sn.type & Internal) {
qWarning("QDateTimeParser::parseSection Internal error (%s %d)",
qPrintable(sn.name()), sectionIndex);
- return -1;
+ return result;
}
const int sectionmaxsize = sectionMaxSize(sectionIndex);
- QStringRef sectionTextRef = text.midRef(index, sectionmaxsize);
- int sectiontextSize = sectionTextRef.size();
+ QStringRef sectionTextRef = text->midRef(offset, sectionmaxsize);
QDTPDEBUG << "sectionValue for" << sn.name()
- << "with text" << text << "and st" << sectionTextRef
- << text.midRef(index, sectionmaxsize)
- << index;
+ << "with text" << *text << "and (at" << offset
+ << ") st:" << sectionTextRef;
- int used = 0;
switch (sn.type) {
case AmPmSection: {
QString sectiontext = sectionTextRef.toString();
+ int used;
const int ampm = findAmPm(sectiontext, sectionIndex, &used);
switch (ampm) {
case AM: // sectiontext == AM
case PM: // sectiontext == PM
- num = ampm;
- state = Acceptable;
+ result = ParsedSection(Acceptable, ampm, used);
break;
case PossibleAM: // sectiontext => AM
case PossiblePM: // sectiontext => PM
- num = ampm - 2;
- state = Intermediate;
+ result = ParsedSection(Intermediate, ampm - 2, used);
break;
case PossibleBoth: // sectiontext => AM|PM
- num = 0;
- state = Intermediate;
+ result = ParsedSection(Intermediate, 0, used);
break;
case Neither:
- state = Invalid;
QDTPDEBUG << "invalid because findAmPm(" << sectiontext << ") returned -1";
break;
default:
QDTPDEBUGN("This should never happen (findAmPm returned %d)", ampm);
break;
}
- if (state != Invalid)
- text.replace(index, used, sectiontext.constData(), used);
+ if (result.state != Invalid)
+ text->replace(offset, used, sectiontext.constData(), used);
break; }
+ case TimeZoneSection:
+ result = findTimeZone(sectionTextRef, currentValue,
+ absoluteMax(sectionIndex),
+ absoluteMin(sectionIndex));
+ break;
case MonthSection:
case DayOfWeekSectionShort:
case DayOfWeekSectionLong:
if (sn.count >= 3) {
QString sectiontext = sectionTextRef.toString();
+ int num = 0, used = 0;
if (sn.type == MonthSection) {
- int min = 1;
const QDate minDate = getMinimum().date();
- if (currentValue.date().year() == minDate.year()) {
- min = minDate.month();
- }
+ const int min = (currentValue.date().year() == minDate.year())
+ ? minDate.month() : 1;
num = findMonth(sectiontext.toLower(), min, sectionIndex, &sectiontext, &used);
} else {
num = findDay(sectiontext.toLower(), 1, sectionIndex, &sectiontext, &used);
}
+ result = ParsedSection(Intermediate, num, used);
if (num != -1) {
- state = (used == sectiontext.size() ? Acceptable : Intermediate);
- text.replace(index, used, sectiontext.constData(), used);
- } else {
- state = Intermediate;
+ text->replace(offset, used, sectiontext.constData(), used);
+ if (used == sectiontext.size())
+ result = ParsedSection(Acceptable, num, used);
}
break;
}
@@ -784,26 +804,22 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
case MinuteSection:
case SecondSection:
case MSecSection: {
+ int sectiontextSize = sectionTextRef.size();
if (sectiontextSize == 0) {
- num = 0;
- used = 0;
- state = Intermediate;
+ result = ParsedSection(Intermediate);
} else {
+ for (int i = 0; i < sectiontextSize; ++i) {
+ if (sectionTextRef.at(i).isSpace())
+ sectiontextSize = i; // which exits the loop
+ }
+
const int absMax = absoluteMax(sectionIndex);
QLocale loc;
bool ok = true;
- int last = -1;
- used = -1;
-
- QStringRef digitsStr = sectionTextRef;
- for (int i = 0; i < sectiontextSize; ++i) {
- if (digitsStr.at(i).isSpace()) {
- sectiontextSize = i;
- break;
- }
- }
+ int last = -1, used = -1;
const int max = qMin(sectionmaxsize, sectiontextSize);
+ QStringRef digitsStr = sectionTextRef.left(max);
for (int digits = max; digits >= 1; --digits) {
digitsStr.truncate(digits);
int tmp = (int)loc.toUInt(digitsStr, &ok);
@@ -825,42 +841,36 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
if (last == -1) {
QChar first(sectionTextRef.at(0));
- if (separators.at(sectionIndex + 1).startsWith(first)) {
- used = 0;
- state = Intermediate;
- } else {
- state = Invalid;
+ if (separators.at(sectionIndex + 1).startsWith(first))
+ result = ParsedSection(Intermediate, 0, used);
+ else
QDTPDEBUG << "invalid because" << sectionTextRef << "can't become a uint" << last << ok;
- }
} else {
- num += last;
const FieldInfo fi = fieldInfo(sectionIndex);
const bool done = (used == sectionmaxsize);
if (!done && fi & Fraction) { // typing 2 in a zzz field should be .200, not .002
- for (int i=used; i<sectionmaxsize; ++i) {
- num *= 10;
- }
+ for (int i = used; i < sectionmaxsize; ++i)
+ last *= 10;
}
const int absMin = absoluteMin(sectionIndex);
- if (num < absMin) {
- state = done ? Invalid : Intermediate;
- if (done)
- QDTPDEBUG << "invalid because" << num << "is less than absoluteMin" << absMin;
- } else if (num > absMax) {
- state = Intermediate;
+ if (last < absMin) {
+ if (!done) // reversed test to dodge QDTPDEBUG ugliness !
+ result = ParsedSection(Intermediate, last, used);
+ else
+ QDTPDEBUG << "invalid because" << last << "is less than absoluteMin" << absMin;
+ } else if (last > absMax) {
+ result = ParsedSection(Intermediate, last, used);
} else if (!done && (fi & (FixedWidth|Numeric)) == (FixedWidth|Numeric)) {
if (skipToNextSection(sectionIndex, currentValue, digitsStr)) {
- state = Acceptable;
const int missingZeroes = sectionmaxsize - digitsStr.size();
- text.insert(index, QString(missingZeroes, QLatin1Char('0')));
- used = sectionmaxsize;
- cursorPosition += missingZeroes;
+ result = ParsedSection(Acceptable, last, sectionmaxsize, missingZeroes);
+ text->insert(offset, QString(missingZeroes, QLatin1Char('0')));
++(const_cast<QDateTimeParser*>(this)->sectionNodes[sectionIndex].zeroesAdded);
} else {
- state = Intermediate;;
+ result = ParsedSection(Intermediate, last, used);;
}
} else {
- state = Acceptable;
+ result = ParsedSection(Acceptable, last, used);
}
}
}
@@ -868,277 +878,506 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
default:
qWarning("QDateTimeParser::parseSection Internal error (%s %d)",
qPrintable(sn.name()), sectionIndex);
- return -1;
+ return result;
+ }
+ Q_ASSERT(result.state != Invalid || result.value == -1);
+
+ return result;
+}
+
+/*!
+ \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)
+{
+ QDate actual(year, month, day);
+ if (actual.isValid() && year % 100 == year2digits && actual.dayOfWeek() == dayofweek)
+ return actual; // The obvious candidate is fine :-)
+
+ if (dayofweek < 1 || dayofweek > 7) // Invalid: ignore
+ known &= ~QDateTimeParser::DayOfWeekSectionMask;
+
+ // Assuming year > 0 ...
+ if (year % 100 != year2digits) {
+ if (known & QDateTimeParser::YearSection2Digits) {
+ // Over-ride year, even if specified:
+ year += year2digits - year % 100;
+ known &= ~QDateTimeParser::YearSection;
+ } else {
+ year2digits = year % 100;
+ }
+ }
+ Q_ASSERT(year % 100 == year2digits);
+
+ if (month < 1) { // If invalid, clip to nearest valid and ignore in known.
+ month = 1;
+ known &= ~QDateTimeParser::MonthSection;
+ } else if (month > 12) {
+ month = 12;
+ known &= ~QDateTimeParser::MonthSection;
+ }
+
+ QDate first(year, month, 1);
+ int last = known & QDateTimeParser::YearSection && known & QDateTimeParser::MonthSection
+ ? first.daysInMonth() : 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;
+ 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();
+ if (day < 1)
+ day += 7;
+ } else {
+ day = 1;
+ }
+ known &= ~QDateTimeParser::DaySection;
+ } else if (day > 31) {
+ day = last;
+ known &= ~QDateTimeParser::DaySection;
+ } else if (last && day > last && (known & QDateTimeParser::DaySection) == 0) {
+ day = last;
+ }
+
+ actual = QDate(year, month, day);
+ 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.
+ || (known & QDateTimeParser::DayOfWeekSectionMask) == 0) { // No contradiction, use it.
+ return actual;
+ }
+
+ /*
+ Now it gets trickier.
+
+ We have some inconsistency in our data; we've been told day of week, but
+ it doesn't fit with our year, month and day. At least one of these is
+ unknown, though: so we can fix day of week by tweaking it.
+ */
+
+ 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);
+ return actual;
+ }
+
+ if ((known & QDateTimeParser::MonthSection) == 0) {
+ /*
+ Try possible month-offsets, m, preferring small; at least one (present
+ month doesn't work) and at most 11 (max month, 12, minus min, 1); try
+ in both directions, ignoring any offset that takes us out of range.
+ */
+ for (int m = 1; m < 12; m++) {
+ if (m < month) {
+ actual = QDate(year, month - m, day);
+ if (actual.dayOfWeek() == dayofweek)
+ return actual;
+ }
+ if (m + month <= 12) {
+ actual = QDate(year, month + m, day);
+ if (actual.dayOfWeek() == dayofweek)
+ return actual;
+ }
+ }
+ // Should only get here in corner cases; e.g. day == 31
+ actual = QDate(year, month, day); // Restore from trial values.
}
- if (usedptr)
- *usedptr = used;
+ if ((known & QDateTimeParser::YearSection) == 0) {
+ if (known & QDateTimeParser::YearSection2Digits) {
+ /*
+ Two-digit year and month are specified; choice of century can only
+ fix this if diff is in one of {1, 2, 5} or {2, 4, 6}; but not if
+ diff is in the other. It's also only reasonable to consider
+ adjacent century, e.g. if year thinks it's 2012 and two-digit year
+ 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)
+ return actual;
+ actual = QDate(year - 100, month, day);
+ if (actual.dayOfWeek() == 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)
+ return actual;
+ actual = QDate(year + y, month, day);
+ if (actual.dayOfWeek() == dayofweek)
+ return actual;
+ }
+ }
+ actual = QDate(year, month, day); // Restore from trial values.
+ }
- return (state != Invalid ? num : -1);
+ return actual; // It'll just have to do :-(
}
-#endif // QT_NO_TEXTDATE
-#ifndef QT_NO_DATESTRING
/*!
\internal
*/
-QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPosition,
- const QDateTime &currentValue, bool fixup) const
+static QTime actualTime(QDateTimeParser::Sections known,
+ int hour, int hour12, int ampm,
+ int minute, int second, int msec)
{
- const QDateTime minimum = getMinimum();
- const QDateTime maximum = getMaximum();
+ // If we have no conflict, or don't know enough to diagonose one, use this:
+ QTime actual(hour, minute, second, msec);
+ if (hour12 < 0 || hour12 > 12) { // ignore bogus value
+ known &= ~QDateTimeParser::Hour12Section;
+ hour12 = hour % 12;
+ }
- State state = Acceptable;
+ if (ampm == -1 || (known & QDateTimeParser::AmPmSection) == 0) {
+ if ((known & QDateTimeParser::Hour12Section) == 0 || hour % 12 == hour12)
+ return actual;
- QDateTime newCurrentValue;
+ if ((known & QDateTimeParser::Hour24Section) == 0)
+ hour = hour12 + (hour > 12 ? 12 : 0);
+ } else {
+ Q_ASSERT(ampm == 0 || ampm == 1);
+ if (hour - hour12 == ampm * 12)
+ return actual;
+
+ if ((known & QDateTimeParser::Hour24Section) == 0
+ && known & QDateTimeParser::Hour12Section) {
+ hour = hour12 + ampm * 12;
+ }
+ }
+ actual = QTime(hour, minute, second, msec);
+ return actual;
+}
+
+/*!
+ \internal
+*/
+QDateTimeParser::StateNode
+QDateTimeParser::scanString(const QDateTime &defaultValue,
+ bool fixup, QString *input) const
+{
+ State state = Acceptable;
bool conflicts = false;
const int sectionNodesCount = sectionNodes.size();
+ int padding = 0;
+ int pos = 0;
+ int year, month, day;
+ const QDate defaultDate = defaultValue.date();
+ const QTime defaultTime = defaultValue.time();
+ defaultDate.getDate(&year, &month, &day);
+ int year2digits = year % 100;
+ int hour = defaultTime.hour();
+ int hour12 = -1;
+ int minute = defaultTime.minute();
+ int second = defaultTime.second();
+ int msec = defaultTime.msec();
+ int dayofweek = defaultDate.dayOfWeek();
+ Qt::TimeSpec tspec = defaultValue.timeSpec();
+ int zoneOffset = 0; // In seconds; local - UTC
+ QString zoneName;
+ QTimeZone timeZone;
+ switch (tspec) {
+ case Qt::OffsetFromUTC: // timeZone is ignored
+ zoneOffset = defaultValue.offsetFromUtc();
+ break;
+ case Qt::TimeZone:
+ timeZone = defaultValue.timeZone();
+ if (timeZone.isValid())
+ zoneOffset = timeZone.offsetFromUtc(defaultValue);
+ // else: is there anything we can do about this ?
+ break;
+ default: // zoneOffset and timeZone are ignored
+ break;
+ }
- QDTPDEBUG << "parse" << input;
- {
- int pos = 0;
- int year, month, day;
- const QDate currentDate = currentValue.date();
- const QTime currentTime = currentValue.time();
- currentDate.getDate(&year, &month, &day);
- int year2digits = year % 100;
- int hour = currentTime.hour();
- int hour12 = -1;
- int minute = currentTime.minute();
- int second = currentTime.second();
- int msec = currentTime.msec();
- int dayofweek = currentDate.dayOfWeek();
-
- int ampm = -1;
- Sections isSet = NoSection;
- int num;
- State tmpstate;
-
- for (int index=0; state != Invalid && index<sectionNodesCount; ++index) {
- if (QStringRef(&input, pos, separators.at(index).size()) != separators.at(index)) {
- QDTPDEBUG << "invalid because" << input.midRef(pos, separators.at(index).size())
- << "!=" << separators.at(index)
- << index << pos << currentSectionIndex;
- state = Invalid;
- goto end;
- }
- pos += separators.at(index).size();
- sectionNodes[index].pos = pos;
- int *current = 0;
- const SectionNode sn = sectionNodes.at(index);
- int used;
-
- num = parseSection(currentValue, index, input, cursorPosition, pos, tmpstate, &used);
- QDTPDEBUG << "sectionValue" << sn.name() << input
- << "pos" << pos << "used" << used << stateName(tmpstate);
- if (fixup && tmpstate == Intermediate && used < sn.count) {
- const FieldInfo fi = fieldInfo(index);
- if ((fi & (Numeric|FixedWidth)) == (Numeric|FixedWidth)) {
- const QString newText = QString::fromLatin1("%1").arg(num, sn.count, 10, QLatin1Char('0'));
- input.replace(pos, used, newText);
- used = sn.count;
- }
- }
- pos += qMax(0, used);
+ int ampm = -1;
+ Sections isSet = NoSection;
- state = qMin<State>(state, tmpstate);
- if (state == Intermediate && context == FromString) {
- state = Invalid;
- break;
+ for (int index = 0; index < sectionNodesCount; ++index) {
+ Q_ASSERT(state != Invalid);
+ if (QStringRef(input, pos, separators.at(index).size()) != separators.at(index)) {
+ QDTPDEBUG << "invalid because" << input->midRef(pos, separators.at(index).size())
+ << "!=" << separators.at(index)
+ << index << pos << currentSectionIndex;
+ return StateNode();
+ }
+ pos += separators.at(index).size();
+ sectionNodes[index].pos = pos;
+ int *current = 0;
+ const SectionNode sn = sectionNodes.at(index);
+ ParsedSection sect;
+
+ {
+ const QDate date = actualDate(isSet, year, year2digits, month, day, dayofweek);
+ const QTime time = actualTime(isSet, hour, hour12, ampm, minute, second, msec);
+ sect = parseSection(tspec == Qt::TimeZone
+ ? QDateTime(date, time, timeZone)
+ : QDateTime(date, time, tspec, zoneOffset),
+ index, pos, input);
+ }
+
+ QDTPDEBUG << "sectionValue" << sn.name() << *input
+ << "pos" << pos << "used" << sect.used << stateName(sect.state);
+
+ padding += sect.zeroes;
+ if (fixup && sect.state == Intermediate && sect.used < sn.count) {
+ const FieldInfo fi = fieldInfo(index);
+ if ((fi & (Numeric|FixedWidth)) == (Numeric|FixedWidth)) {
+ const QString newText = QString::fromLatin1("%1").arg(sect.value, sn.count, 10, QLatin1Char('0'));
+ input->replace(pos, sect.used, newText);
+ sect.used = sn.count;
}
+ }
- QDTPDEBUG << index << sn.name() << "is set to"
- << pos << "state is" << stateName(state);
-
-
- if (state != Invalid) {
- switch (sn.type) {
- case Hour24Section: current = &hour; break;
- case Hour12Section: current = &hour12; break;
- case MinuteSection: current = &minute; break;
- case SecondSection: current = &second; break;
- case MSecSection: current = &msec; break;
- case YearSection: current = &year; break;
- case YearSection2Digits: current = &year2digits; break;
- case MonthSection: current = &month; break;
- case DayOfWeekSectionShort:
- case DayOfWeekSectionLong: current = &dayofweek; break;
- case DaySection: current = &day; num = qMax<int>(1, num); break;
- case AmPmSection: current = &ampm; break;
- default:
- qWarning("QDateTimeParser::parse Internal error (%s)",
- qPrintable(sn.name()));
- break;
- }
- if (!current) {
- qWarning("QDateTimeParser::parse Internal error 2");
- return StateNode();
- }
- if (isSet & sn.type && *current != num) {
- QDTPDEBUG << "CONFLICT " << sn.name() << *current << num;
- conflicts = true;
- if (index != currentSectionIndex || num == -1) {
- continue;
- }
- }
- if (num != -1)
- *current = num;
- isSet |= sn.type;
+ state = qMin<State>(state, sect.state);
+ if (state == Invalid || (state == Intermediate && context == FromString))
+ return StateNode();
+
+ switch (sn.type) {
+ case TimeZoneSection:
+ current = &zoneOffset;
+ if (sect.used > 0) {
+ // Synchronize with what findTimeZone() found:
+ QStringRef zoneName = input->midRef(pos, sect.used);
+ Q_ASSERT(!zoneName.isEmpty()); // sect.used > 0
+ const QByteArray latinZone(zoneName.toLatin1());
+ timeZone = QTimeZone(latinZone);
+ tspec = timeZone.isValid()
+ ? (QTimeZone::isTimeZoneIdAvailable(latinZone)
+ ? Qt::TimeZone
+ : Qt::OffsetFromUTC)
+ : (Q_ASSERT(startsWithLocalTimeZone(zoneName)), Qt::LocalTime);
}
+ break;
+ case Hour24Section: current = &hour; break;
+ case Hour12Section: current = &hour12; break;
+ case MinuteSection: current = &minute; break;
+ case SecondSection: current = &second; break;
+ case MSecSection: current = &msec; break;
+ case YearSection: current = &year; break;
+ case YearSection2Digits: current = &year2digits; break;
+ case MonthSection: current = &month; break;
+ case DayOfWeekSectionShort:
+ case DayOfWeekSectionLong: current = &dayofweek; break;
+ 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()));
+ break;
}
- if (state != Invalid && QStringRef(&input, pos, input.size() - pos) != separators.last()) {
- QDTPDEBUG << "invalid because" << input.midRef(pos)
- << "!=" << separators.last() << pos;
- state = Invalid;
+ if (sect.used > 0)
+ pos += sect.used;
+ QDTPDEBUG << index << sn.name() << "is set to"
+ << pos << "state is" << stateName(state);
+
+ if (!current) {
+ qWarning("QDateTimeParser::parse Internal error 2");
+ return StateNode();
+ }
+ if (isSet & sn.type && *current != sect.value) {
+ QDTPDEBUG << "CONFLICT " << sn.name() << *current << sect.value;
+ conflicts = true;
+ if (index != currentSectionIndex || sect.state == Invalid) {
+ continue;
+ }
}
+ if (sect.state != Invalid)
+ *current = sect.value;
- if (state != Invalid) {
- if (parserType != QVariant::Time) {
- if (year % 100 != year2digits && (isSet & YearSection2Digits)) {
- if (!(isSet & YearSection)) {
- year = (year / 100) * 100;
- year += year2digits;
- } else {
- conflicts = true;
- const SectionNode &sn = sectionNode(currentSectionIndex);
- if (sn.type == YearSection2Digits) {
- year = (year / 100) * 100;
- year += year2digits;
- }
- }
- }
+ // Record the present section:
+ isSet |= sn.type;
+ }
- const QDate date(year, month, day);
- const int diff = dayofweek - date.dayOfWeek();
- if (diff != 0 && 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;
- }
- QDTPDEBUG << year << month << day << dayofweek
- << diff << QDate(year, month, day).dayOfWeek();
- }
- }
+ if (QStringRef(input, pos, input->size() - pos) != separators.last()) {
+ QDTPDEBUG << "invalid because" << input->midRef(pos)
+ << "!=" << separators.last() << pos;
+ return StateNode();
+ }
- bool needfixday = false;
- if (sectionType(currentSectionIndex) & DaySectionMask) {
- cachedDay = day;
- } else if (cachedDay > day) {
- day = cachedDay;
- needfixday = true;
+ if (parserType != QVariant::Time) {
+ if (year % 100 != year2digits && (isSet & YearSection2Digits)) {
+ if (!(isSet & YearSection)) {
+ year = (year / 100) * 100;
+ year += year2digits;
+ } else {
+ conflicts = true;
+ const SectionNode &sn = sectionNode(currentSectionIndex);
+ if (sn.type == YearSection2Digits) {
+ year = (year / 100) * 100;
+ year += year2digits;
}
+ }
+ }
- if (!QDate::isValid(year, month, day)) {
- if (day < 32) {
- cachedDay = day;
- }
- if (day > 28 && QDate::isValid(year, month, 1)) {
- needfixday = true;
- }
- }
- if (needfixday) {
- if (context == FromString) {
- state = Invalid;
- goto end;
- }
- if (state == Acceptable && fixday) {
- day = qMin<int>(day, QDate(year, month, 1).daysInMonth());
-
- const QLocale loc = locale();
- for (int i=0; i<sectionNodesCount; ++i) {
- const SectionNode sn = sectionNode(i);
- 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 QLocale::FormatType dayFormat =
- (sn.type == DayOfWeekSectionShort
- ? QLocale::ShortFormat : QLocale::LongFormat);
- const QString dayName(loc.dayName(dayOfWeek, dayFormat));
- input.replace(sectionPos(sn), sectionSize(i), dayName);
- }
- }
- } else {
- state = qMin(Intermediate, state);
- }
+ const QDate date(year, month, day);
+ const int diff = dayofweek - date.dayOfWeek();
+ if (diff != 0 && 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;
}
+ QDTPDEBUG << year << month << day << dayofweek
+ << diff << QDate(year, month, day).dayOfWeek();
}
+ }
- if (parserType != QVariant::Date) {
- if (isSet & Hour12Section) {
- const bool hasHour = isSet & Hour24Section;
- if (ampm == -1) {
- if (hasHour) {
- ampm = (hour < 12 ? 0 : 1);
- } else {
- ampm = 0; // no way to tell if this is am or pm so I assume am
- }
- }
- hour12 = (ampm == 0 ? hour12 % 12 : (hour12 % 12) + 12);
- if (!hasHour) {
- hour = hour12;
- } else if (hour != hour12) {
- conflicts = true;
- }
- } else if (ampm != -1) {
- if (!(isSet & (Hour24Section))) {
- hour = (12 * ampm); // special case. Only ap section
- } else if ((ampm == 0) != (hour < 12)) {
- conflicts = true;
+ bool needfixday = false;
+ if (sectionType(currentSectionIndex) & DaySectionMask) {
+ cachedDay = day;
+ } else if (cachedDay > day) {
+ day = cachedDay;
+ needfixday = true;
+ }
+
+ if (!QDate::isValid(year, month, day)) {
+ if (day < 32) {
+ cachedDay = day;
+ }
+ if (day > 28 && QDate::isValid(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());
+
+ const QLocale loc = locale();
+ for (int i=0; i<sectionNodesCount; ++i) {
+ const SectionNode sn = sectionNode(i);
+ 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 QLocale::FormatType dayFormat =
+ (sn.type == DayOfWeekSectionShort
+ ? QLocale::ShortFormat : QLocale::LongFormat);
+ const QString dayName(loc.dayName(dayOfWeek, dayFormat));
+ input->replace(sectionPos(sn), sectionSize(i), dayName);
}
}
-
+ } else if (state > Intermediate) {
+ state = Intermediate;
}
+ }
+ }
- newCurrentValue = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), spec);
- QDTPDEBUG << year << month << day << hour << minute << second << msec;
+ if (parserType != QVariant::Date) {
+ if (isSet & Hour12Section) {
+ const bool hasHour = isSet & Hour24Section;
+ if (ampm == -1) {
+ if (hasHour) {
+ ampm = (hour < 12 ? 0 : 1);
+ } else {
+ ampm = 0; // no way to tell if this is am or pm so I assume am
+ }
+ }
+ hour12 = (ampm == 0 ? hour12 % 12 : (hour12 % 12) + 12);
+ if (!hasHour) {
+ hour = hour12;
+ } else if (hour != hour12) {
+ conflicts = true;
+ }
+ } else if (ampm != -1) {
+ if (!(isSet & (Hour24Section))) {
+ hour = (12 * ampm); // special case. Only ap section
+ } else if ((ampm == 0) != (hour < 12)) {
+ conflicts = true;
+ }
}
- QDTPDEBUGN("'%s' => '%s'(%s)", input.toLatin1().constData(),
- newCurrentValue.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(),
- stateName(state).toLatin1().constData());
+
}
-end:
- if (newCurrentValue.isValid()) {
- if (context != FromString && state != Invalid && newCurrentValue < minimum) {
+
+ QDTPDEBUG << year << month << day << hour << minute << second << msec;
+ Q_ASSERT(state != Invalid);
+
+ const QDate date(year, month, day);
+ const QTime time(hour, minute, second, msec);
+ return StateNode(tspec == Qt::TimeZone
+ ? QDateTime(date, time, timeZone)
+ : QDateTime(date, time, tspec, zoneOffset),
+ state, padding, conflicts);
+}
+
+/*!
+ \internal
+*/
+
+QDateTimeParser::StateNode
+QDateTimeParser::parse(QString input, int position, const QDateTime &defaultValue, bool fixup) const
+{
+ const QDateTime minimum = getMinimum();
+ const QDateTime maximum = getMaximum();
+
+ QDTPDEBUG << "parse" << input;
+ StateNode scan = scanString(defaultValue, fixup, &input);
+ QDTPDEBUGN("'%s' => '%s'(%s)", input.toLatin1().constData(),
+ scan.value.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(),
+ stateName(scan.state).toLatin1().constData());
+
+ if (scan.value.isValid() && scan.state != Invalid) {
+ if (context != FromString && scan.value < minimum) {
const QLatin1Char space(' ');
- if (newCurrentValue >= minimum)
+ if (scan.value >= minimum)
qWarning("QDateTimeParser::parse Internal error 3 (%s %s)",
- qPrintable(newCurrentValue.toString()), qPrintable(minimum.toString()));
+ qPrintable(scan.value.toString()), qPrintable(minimum.toString()));
bool done = false;
- state = Invalid;
+ scan.state = Invalid;
+ const int sectionNodesCount = sectionNodes.size();
for (int i=0; i<sectionNodesCount && !done; ++i) {
const SectionNode &sn = sectionNodes.at(i);
QString t = sectionText(input, i, sn.pos).toLower();
- if ((t.size() < sectionMaxSize(i) && (((int)fieldInfo(i) & (FixedWidth|Numeric)) != Numeric))
+ if ((t.size() < sectionMaxSize(i)
+ && (((int)fieldInfo(i) & (FixedWidth|Numeric)) != Numeric))
|| t.contains(space)) {
switch (sn.type) {
case AmPmSection:
switch (findAmPm(t, i)) {
case AM:
case PM:
- state = Acceptable;
+ scan.state = Acceptable;
done = true;
break;
case Neither:
- state = Invalid;
+ scan.state = Invalid;
done = true;
break;
case PossibleAM:
case PossiblePM:
case PossibleBoth: {
- const QDateTime copy(newCurrentValue.addSecs(12 * 60 * 60));
+ const QDateTime copy(scan.value.addSecs(12 * 60 * 60));
if (copy >= minimum && copy <= maximum) {
- state = Intermediate;
+ scan.state = Intermediate;
done = true;
}
break; }
@@ -1146,19 +1385,18 @@ end:
Q_FALLTHROUGH();
case MonthSection:
if (sn.count >= 3) {
- const int currentMonth = newCurrentValue.date().month();
- int tmp = currentMonth;
+ const int finalMonth = scan.value.date().month();
+ int tmp = finalMonth;
// I know the first possible month makes the date too early
while ((tmp = findMonth(t, tmp + 1, i)) != -1) {
- const QDateTime copy(newCurrentValue.addMonths(tmp - currentMonth));
+ const QDateTime copy(scan.value.addMonths(tmp - finalMonth));
if (copy >= minimum && copy <= maximum)
break; // break out of while
}
- if (tmp == -1) {
- break;
+ if (tmp != -1) {
+ scan.state = Intermediate;
+ done = true;
}
- state = Intermediate;
- done = true;
break;
}
Q_FALLTHROUGH();
@@ -1167,25 +1405,24 @@ end:
int toMax;
if (sn.type & TimeSectionMask) {
- if (newCurrentValue.daysTo(minimum) != 0) {
+ if (scan.value.daysTo(minimum) != 0) {
break;
}
- const QTime time = newCurrentValue.time();
+ const QTime time = scan.value.time();
toMin = time.msecsTo(minimum.time());
- if (newCurrentValue.daysTo(maximum) > 0) {
+ if (scan.value.daysTo(maximum) > 0)
toMax = -1; // can't get to max
- } else {
+ else
toMax = time.msecsTo(maximum.time());
- }
} else {
- toMin = newCurrentValue.daysTo(minimum);
- toMax = newCurrentValue.daysTo(maximum);
+ toMin = scan.value.daysTo(minimum);
+ toMax = scan.value.daysTo(maximum);
}
const int maxChange = sn.maxChange();
if (toMin > maxChange) {
QDTPDEBUG << "invalid because toMin > maxChange" << toMin
- << maxChange << t << newCurrentValue << minimum;
- state = Invalid;
+ << maxChange << t << scan.value << minimum;
+ scan.state = Invalid;
done = true;
break;
} else if (toMax > maxChange) {
@@ -1196,23 +1433,23 @@ end:
if (min == -1) {
qWarning("QDateTimeParser::parse Internal error 4 (%s)",
qPrintable(sn.name()));
- state = Invalid;
+ scan.state = Invalid;
done = true;
break;
}
- int max = toMax != -1 ? getDigit(maximum, i) : absoluteMax(i, newCurrentValue);
- int pos = cursorPosition - sn.pos;
+ int max = toMax != -1 ? getDigit(maximum, i) : absoluteMax(i, scan.value);
+ int pos = position + scan.padded - sn.pos;
if (pos < 0 || pos >= t.size())
pos = -1;
- if (!potentialValue(t.simplified(), min, max, i, newCurrentValue, pos)) {
+ if (!potentialValue(t.simplified(), min, max, i, scan.value, pos)) {
QDTPDEBUG << "invalid because potentialValue(" << t.simplified() << min << max
<< sn.name() << "returned" << toMax << toMin << pos;
- state = Invalid;
+ scan.state = Invalid;
done = true;
break;
}
- state = Intermediate;
+ scan.state = Intermediate;
done = true;
break; }
}
@@ -1222,27 +1459,21 @@ end:
if (context == FromString) {
// optimization
Q_ASSERT(maximum.date().toJulianDay() == 4642999);
- if (newCurrentValue.date().toJulianDay() > 4642999)
- state = Invalid;
+ if (scan.value.date().toJulianDay() > 4642999)
+ scan.state = Invalid;
} else {
- if (newCurrentValue > maximum)
- state = Invalid;
+ if (scan.value > maximum)
+ scan.state = Invalid;
}
- QDTPDEBUG << "not checking intermediate because newCurrentValue is" << newCurrentValue << minimum << maximum;
+ QDTPDEBUG << "not checking intermediate because scanned value is" << scan.value << minimum << maximum;
}
}
- StateNode node;
- node.input = input;
- node.state = state;
- node.conflicts = conflicts;
- node.value = newCurrentValue.toTimeSpec(spec);
- text = input;
- return node;
+ text = scan.input = input;
+ // Set spec *after* all checking, so validity is a property of the string:
+ scan.value = scan.value.toTimeSpec(spec);
+ return scan;
}
-#endif // QT_NO_DATESTRING
-
-#ifndef QT_NO_TEXTDATE
/*
\internal
@@ -1330,7 +1561,57 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
const int index = findTextEntry(str1, daysOfWeek, usedDay, used);
return index < 0 ? index : index + startDay;
}
-#endif // QT_NO_TEXTDATE
+
+/*!
+ \internal
+
+ Return's .value is zone's offset, zone time - UTC time, in seconds.
+ See QTimeZonePrivate::isValidId() for the format of zone names.
+ */
+QDateTimeParser::ParsedSection
+QDateTimeParser::findTimeZone(QStringRef str, const QDateTime &when,
+ int maxVal, int minVal) const
+{
+ int index = startsWithLocalTimeZone(str);
+ int offset;
+
+ if (index > 0) {
+ // We won't actually use this, but we need a valid return:
+ offset = QDateTime(when.date(), when.time(), Qt::LocalTime).offsetFromUtc();
+ } else {
+ int size = str.length();
+ offset = std::numeric_limits<int>::max(); // deliberately out of range
+ Q_ASSERT(offset > QTimeZone::MaxUtcOffsetSecs); // cf. absoluteMax()
+
+ // Collect up plausibly-valid characters; let QTimeZone work out what's truly valid.
+ while (index < size) {
+ QChar here = str[index];
+ if (here < 127
+ && (here.isLetterOrNumber()
+ || here == '/' || here == '-'
+ || here == '_' || here == '.'
+ || here == '+' || here == ':'))
+ index++;
+ else
+ break;
+ }
+
+ while (index > 0) {
+ str.truncate(index);
+ QTimeZone zone(str.toLatin1());
+ if (zone.isValid()) {
+ offset = zone.offsetFromUtc(when);
+ break;
+ }
+ index--; // maybe we collected too much ...
+ }
+ }
+
+ if (index > 0 && maxVal >= offset && offset >= minVal)
+ return ParsedSection(Acceptable, offset, index);
+
+ return ParsedSection();
+}
/*!
\internal
@@ -1419,6 +1700,7 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI
return PossibleBoth;
return (!broken[amindex] ? PossibleAM : PossiblePM);
}
+#endif // QT_NO_DATESTRING
/*!
\internal
@@ -1461,15 +1743,13 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const
case MinuteSection:
case Hour24Section:
case Hour12Section:
- case YearSection:
case YearSection2Digits:
+ ret |= AllowPartial;
+ Q_FALLTHROUGH();
+ case YearSection:
ret |= Numeric;
- if (sn.type != YearSection) {
- ret |= AllowPartial;
- }
- if (sn.count != 1) {
+ if (sn.count != 1)
ret |= FixedWidth;
- }
break;
case MonthSection:
case DaySection:
@@ -1490,6 +1770,8 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const
case AmPmSection:
ret |= FixedWidth;
break;
+ case TimeZoneSection:
+ break;
default:
qWarning("QDateTimeParser::fieldInfo Internal error 2 (%d %s %d)",
index, qPrintable(sn.name()), sn.count);
@@ -1571,39 +1853,39 @@ bool QDateTimeParser::potentialValue(const QStringRef &str, int min, int max, in
return false;
}
+/*!
+ \internal
+*/
bool QDateTimeParser::skipToNextSection(int index, const QDateTime &current, const QStringRef &text) const
{
- const SectionNode &node = sectionNode(index);
Q_ASSERT(text.size() < sectionMaxSize(index));
-
- const QDateTime maximum = getMaximum();
- const QDateTime minimum = getMinimum();
- Q_ASSERT(current >= minimum && current <= maximum);
-
- QDateTime tmp = current;
+ const SectionNode &node = sectionNode(index);
int min = absoluteMin(index);
- setDigit(tmp, index, min);
- if (tmp < minimum) {
- min = getDigit(minimum, index);
- }
-
int max = absoluteMax(index, current);
- setDigit(tmp, index, max);
- if (tmp > maximum) {
- max = getDigit(maximum, index);
+ // Time-zone field is only numeric if given as offset from UTC:
+ if (node.type != TimeZoneSection || current.timeSpec() == Qt::OffsetFromUTC) {
+ const QDateTime maximum = getMaximum();
+ const QDateTime minimum = getMinimum();
+ Q_ASSERT(current >= minimum && current <= maximum);
+
+ QDateTime tmp = current;
+ if (!setDigit(tmp, index, min) || tmp < minimum)
+ min = getDigit(minimum, index);
+
+ if (!setDigit(tmp, index, max) || tmp > maximum)
+ max = getDigit(maximum, index);
}
int pos = cursorPosition() - node.pos;
if (pos < 0 || pos >= text.size())
pos = -1;
- const bool potential = potentialValue(text, min, max, index, current, pos);
- return !potential;
-
- /* If the value potentially can become another valid entry we
- * don't want to skip to the next. E.g. In a M field (month
- * without leading 0 if you type 1 we don't want to autoskip but
- * if you type 3 we do
+ /*
+ If the value potentially can become another valid entry we don't want to
+ skip to the next. E.g. In a M field (month without leading 0) if you type
+ 1 we don't want to autoskip (there might be [012] following) but if you
+ type 3 we do.
*/
+ return !potentialValue(text, min, max, index, current, pos);
}
/*!
@@ -1624,6 +1906,7 @@ QString QDateTimeParser::SectionNode::name(QDateTimeParser::Section s)
case QDateTimeParser::MinuteSection: return QLatin1String("MinuteSection");
case QDateTimeParser::MonthSection: return QLatin1String("MonthSection");
case QDateTimeParser::SecondSection: return QLatin1String("SecondSection");
+ case QDateTimeParser::TimeZoneSection: return QLatin1String("TimeZoneSection");
case QDateTimeParser::YearSection: return QLatin1String("YearSection");
case QDateTimeParser::YearSection2Digits: return QLatin1String("YearSection2Digits");
case QDateTimeParser::NoSection: return QLatin1String("NoSection");
@@ -1652,9 +1935,7 @@ QString QDateTimeParser::stateName(State s) const
bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const
{
QDateTime val(QDate(1900, 1, 1), QDATETIMEEDIT_TIME_MIN);
- QString text = t;
- int copy = -1;
- const StateNode tmp = parse(text, copy, val, false);
+ const StateNode tmp = parse(t, -1, val, false);
if (tmp.state != Acceptable || tmp.conflicts) {
return false;
}
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index b50c88b4c1..f6f9ed5e24 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -113,9 +113,10 @@ public:
MinuteSection = 0x00008,
Hour12Section = 0x00010,
Hour24Section = 0x00020,
+ TimeZoneSection = 0x00040,
HourSectionMask = (Hour12Section | Hour24Section),
TimeSectionMask = (MSecSection | SecondSection | MinuteSection |
- HourSectionMask | AmPmSection),
+ HourSectionMask | AmPmSection | TimeZoneSection),
DaySection = 0x00100,
MonthSection = 0x00200,
@@ -159,11 +160,14 @@ public:
};
struct StateNode {
- StateNode() : state(Invalid), conflicts(false) {}
+ StateNode() : state(Invalid), padded(0), conflicts(false) {}
+ StateNode(const QDateTime &val, State ok=Acceptable, int pad=0, bool bad=false)
+ : value(val), state(ok), padded(pad), conflicts(bad) {}
QString input;
+ QDateTime value;
State state;
+ int padded;
bool conflicts;
- QDateTime value;
};
enum AmPm {
@@ -177,12 +181,10 @@ public:
};
#ifndef QT_NO_DATESTRING
- StateNode parse(QString &input, int &cursorPosition, const QDateTime &currentValue, bool fixup) const;
-#endif
- bool parseFormat(const QString &format);
-#ifndef QT_NO_DATESTRING
+ StateNode parse(QString input, int position, const QDateTime &defaultValue, bool fixup) const;
bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif
+ bool parseFormat(const QString &format);
enum FieldInfoFlag {
Numeric = 0x01,
@@ -200,14 +202,28 @@ public:
private:
int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
- int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
- int index, QDateTimeParser::State &state, int *used = 0) const;
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
+ StateNode scanString(const QDateTime &defaultValue,
+ bool fixup, QString *input) const;
+ struct ParsedSection {
+ int value;
+ int used;
+ int zeroes;
+ State state;
+ Q_DECL_CONSTEXPR ParsedSection(State ok = Invalid,
+ int val = 0, int read = 0, int zs = 0)
+ : value(ok == Invalid ? -1 : val), used(read), zeroes(zs), state(ok)
+ {}
+ };
+ 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 findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
-#endif
+ ParsedSection findTimeZone(QStringRef str, const QDateTime &when,
+ int maxVal, int minVal) const;
+ static int startsWithLocalTimeZone(const QStringRef name); // implemented in qdatetime.cpp
enum AmPmFinder {
Neither = -1,
@@ -218,6 +234,8 @@ private:
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
+#endif // QT_NO_DATESTRING
+
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 4cc9ec8ec8..e336b7e618 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -63,13 +63,9 @@
#ifndef QT_BOOTSTRAPPED
#include <qcoreapplication.h>
+#include <qrandom.h>
#endif // QT_BOOTSTRAPPED
-#ifdef Q_OS_UNIX
-#include <stdio.h>
-#include "private/qcore_unix_p.h"
-#endif // Q_OS_UNIX
-
#include <limits.h>
QT_BEGIN_NAMESPACE
@@ -205,7 +201,7 @@ static inline uint hash(const uchar *p, size_t len, uint seed) Q_DECL_NOTHROW
{
uint h = seed;
- if (hasFastCrc32())
+ if (seed && hasFastCrc32())
return crc32(p, len, h);
for (size_t i = 0; i < len; ++i)
@@ -223,7 +219,7 @@ static inline uint hash(const QChar *p, size_t len, uint seed) Q_DECL_NOTHROW
{
uint h = seed;
- if (hasFastCrc32())
+ if (seed && hasFastCrc32())
return crc32(p, len, h);
for (size_t i = 0; i < len; ++i)
@@ -237,6 +233,7 @@ uint qHash(const QByteArray &key, uint seed) Q_DECL_NOTHROW
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
{
return hash(key.unicode(), size_t(key.size()), seed);
@@ -246,6 +243,12 @@ uint qHash(const QStringRef &key, uint seed) Q_DECL_NOTHROW
{
return hash(key.unicode(), size_t(key.size()), seed);
}
+#endif
+
+uint qHash(QStringView key, uint seed) Q_DECL_NOTHROW
+{
+ return hash(key.data(), key.size(), seed);
+}
uint qHash(const QBitArray &bitArray, uint seed) Q_DECL_NOTHROW
{
@@ -283,42 +286,17 @@ static uint qt_create_qhash_seed()
#ifndef QT_BOOTSTRAPPED
QByteArray envSeed = qgetenv("QT_HASH_SEED");
- if (!envSeed.isNull())
- return envSeed.toUInt();
-
-#ifdef Q_OS_UNIX
- int randomfd = qt_safe_open("/dev/urandom", O_RDONLY);
- if (randomfd == -1)
- randomfd = qt_safe_open("/dev/random", O_RDONLY | O_NONBLOCK);
- if (randomfd != -1) {
- if (qt_safe_read(randomfd, reinterpret_cast<char *>(&seed), sizeof(seed)) == sizeof(seed)) {
- qt_safe_close(randomfd);
- return seed;
+ if (!envSeed.isNull()) {
+ uint seed = envSeed.toUInt();
+ if (seed) {
+ // can't use qWarning here (reentrancy)
+ fprintf(stderr, "QT_HASH_SEED: forced seed value is not 0, cannot guarantee that the "
+ "hashing functions will produce a stable value.");
}
- qt_safe_close(randomfd);
- }
-#endif // Q_OS_UNIX
-
-#if defined(Q_OS_WIN32) && !defined(Q_CC_GNU)
- errno_t err;
- err = rand_s(&seed);
- if (err == 0)
return seed;
-#endif // Q_OS_WIN32
-
- // general fallback: initialize from the current timestamp, pid,
- // and address of a stack-local variable
- quint64 timestamp = QDateTime::currentMSecsSinceEpoch();
- seed ^= timestamp;
- seed ^= (timestamp >> 32);
-
- quint64 pid = QCoreApplication::applicationPid();
- seed ^= pid;
- seed ^= (pid >> 32);
+ }
- quintptr seedPtr = reinterpret_cast<quintptr>(&seed);
- seed ^= seedPtr;
- seed ^= (qulonglong(seedPtr) >> 32); // no-op on 32-bit platforms
+ seed = QRandomGenerator::get32();
#endif // QT_BOOTSTRAPPED
return seed;
@@ -374,14 +352,17 @@ int qGlobalQHashSeed()
is needed. We discourage to do it in production code as it can make your
application susceptible to \l{algorithmic complexity attacks}.
+ From Qt 5.10 and onwards, the only allowed values are 0 and -1. Passing the
+ value -1 will reinitialize the global QHash seed to a random value, while
+ the value of 0 is used to request a stable algorithm for C++ primitive
+ types types (like \c int) and string types (QString, QByteArray).
+
The seed is set in any newly created QHash. See \l{qHash} about how this seed
is being used by QHash.
If the environment variable \c QT_HASH_SEED is set, calling this function will
result in a no-op.
- Passing the value -1 will reinitialize the global QHash seed to a random value.
-
\sa qGlobalQHashSeed
*/
void qSetGlobalQHashSeed(int newSeed)
@@ -392,6 +373,11 @@ void qSetGlobalQHashSeed(int newSeed)
int x(qt_create_qhash_seed() & INT_MAX);
qt_qhash_seed.store(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);
}
}
@@ -407,37 +393,25 @@ void qSetGlobalQHashSeed(int newSeed)
results.
The qt_hash functions must *never* change their results.
+
+ 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.
*/
-static uint qt_hash(const QChar *p, int n) Q_DECL_NOTHROW
+uint qt_hash(QStringView key, uint chained) Q_DECL_NOTHROW
{
- uint h = 0;
+ auto n = key.size();
+ auto p = key.utf16();
+
+ uint h = chained;
while (n--) {
- h = (h << 4) + (*p++).unicode();
+ h = (h << 4) + *p++;
h ^= (h & 0xf0000000) >> 23;
h &= 0x0fffffff;
}
return h;
}
-/*!
- \internal
- \overload
-*/
-uint qt_hash(const QString &key) Q_DECL_NOTHROW
-{
- return qt_hash(key.unicode(), key.size());
-}
-
-/*!
- \internal
- \overload
-*/
-uint qt_hash(const QStringRef &key) Q_DECL_NOTHROW
-{
- return qt_hash(key.unicode(), key.size());
-}
-
/*
The prime_deltas array contains the difference between a power
of two and the next prime number:
@@ -1035,6 +1009,13 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
+/*! \fn uint qHash(QStringView key, uint seed = 0)
+ \relates QStringView
+ \since 5.10
+
+ Returns the hash value for the \a key, using \a seed to seed the calculation.
+*/
+
/*! \fn uint qHash(QLatin1String key, uint seed = 0)
\relates QHash
\since 5.0
@@ -1254,9 +1235,8 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
should never depend on a particular QHash ordering, there may be situations
where you temporarily need deterministic behavior, for example for debugging or
regression testing. To disable the randomization, define the environment
- variable \c QT_HASH_SEED. The contents of that variable, interpreted as a
- decimal value, will be used as the seed for qHash(). Alternatively, you can
- call the qSetGlobalQHashSeed() function.
+ variable \c QT_HASH_SEED to have the value 0. Alternatively, you can call
+ the qSetGlobalQHashSeed() function with the value 0.
\sa QHashIterator, QMutableHashIterator, QMap, QSet
*/
@@ -1708,6 +1688,60 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
\sa keyBegin()
*/
+/*! \fn QHash::key_value_iterator QHash::keyValueBegin()
+ \since 5.10
+
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first entry
+ in the hash.
+
+ \sa keyValueEnd()
+*/
+
+/*! \fn QHash::key_value_iterator QHash::keyValueEnd()
+ \since 5.10
+
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ entry after the last entry in the hash.
+
+ \sa keyValueBegin()
+*/
+
+/*! \fn QHash::const_key_value_iterator QHash::keyValueBegin() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry
+ in the hash.
+
+ \sa keyValueEnd()
+*/
+
+/*! \fn QHash::const_key_value_iterator QHash::constKeyValueBegin() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry
+ in the hash.
+
+ \sa keyValueBegin()
+*/
+
+/*! \fn QHash::const_key_value_iterator QHash::keyValueEnd() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ entry after the last entry in the hash.
+
+ \sa keyValueBegin()
+*/
+
+/*! \fn QHash::const_key_value_iterator QHash::constKeyValueEnd() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ entry after the last entry in the hash.
+
+ \sa constKeyValueBegin()
+*/
+
/*! \fn QHash::iterator QHash::erase(const_iterator pos)
\since 5.7
@@ -2443,6 +2477,18 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
Returns the underlying const_iterator this key_iterator is based on.
*/
+/*! \typedef QHash::key_value_iterator
+ \inmodule QtCore
+ \since 5.10
+ \brief The QMap::key_value_iterator typedef provides an STL-style iterator for QHash and QMultiHash.
+
+ QHash::key_value_iterator is essentially the same as QHash::iterator
+ with the difference that operator*() returns a key/value pair instead of a
+ value.
+
+ \sa QKeyValueIterator
+*/
+
/*! \fn QDataStream &operator<<(QDataStream &out, const QHash<Key, T>& hash)
\relates QHash
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 703066857d..715acc77ce 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -449,6 +449,9 @@ public:
const_iterator base() const { return i; }
};
+ typedef QKeyValueIterator<const Key&, const T&, const_iterator> const_key_value_iterator;
+ typedef QKeyValueIterator<const Key&, T&, iterator> key_value_iterator;
+
// STL style
inline iterator begin() { detach(); return iterator(d->firstNode()); }
inline const_iterator begin() const { return const_iterator(d->firstNode()); }
@@ -460,6 +463,12 @@ public:
inline const_iterator constEnd() const { return const_iterator(e); }
inline key_iterator keyBegin() const { return key_iterator(begin()); }
inline key_iterator keyEnd() const { return key_iterator(end()); }
+ inline key_value_iterator keyValueBegin() { return key_value_iterator(begin()); }
+ inline key_value_iterator keyValueEnd() { return key_value_iterator(end()); }
+ inline const_key_value_iterator keyValueBegin() const { return const_key_value_iterator(begin()); }
+ inline const_key_value_iterator constKeyValueBegin() const { return const_key_value_iterator(begin()); }
+ inline const_key_value_iterator keyValueEnd() const { return const_key_value_iterator(end()); }
+ 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;
@@ -816,7 +825,7 @@ Q_OUTOFLINE_TEMPLATE T QHash<Key, T>::take(const Key &akey)
Node **node = findNode(akey);
if (*node != e) {
- T t = (*node)->value;
+ T t = std::move((*node)->value);
Node *next = (*node)->next;
deleteNode(*node);
*node = next;
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
index 0eb6c1b5ce..f75b310e4e 100644
--- a/src/corelib/tools/qhashfunctions.h
+++ b/src/corelib/tools/qhashfunctions.h
@@ -41,7 +41,7 @@
#ifndef QHASHFUNCTIONS_H
#define QHASHFUNCTIONS_H
-#include <QtCore/qchar.h>
+#include <QtCore/qstring.h>
#include <QtCore/qpair.h>
#include <numeric> // for std::accumulate
@@ -95,12 +95,14 @@ Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) Q
#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;
+#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;
+#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(const QString &key) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(const QStringRef &key) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = 0) Q_DECL_NOTHROW;
template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW
{
diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h
index 3953005242..918b124d5c 100644
--- a/src/corelib/tools/qiterator.h
+++ b/src/corelib/tools/qiterator.h
@@ -179,6 +179,157 @@ public: \
n = c->end(); return false; } \
};
+template<typename Key, typename T, class Iterator>
+class QKeyValueIterator
+{
+public:
+ typedef typename Iterator::iterator_category iterator_category;
+ typedef typename Iterator::difference_type difference_type;
+ typedef std::pair<Key, T> value_type;
+ typedef const value_type *pointer;
+ 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)
+ : 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; }
+
+ inline QKeyValueIterator &operator++() { ++i; return *this; }
+ inline QKeyValueIterator operator++(int) { return QKeyValueIterator(i++);}
+ inline QKeyValueIterator &operator--() { --i; return *this; }
+ inline QKeyValueIterator operator--(int) { return QKeyValueIterator(i--); }
+ Iterator base() const { return i; }
+
+private:
+ Iterator i;
+};
+
+/*! \class QKeyValueIterator
+ \inmodule QtCore
+ \since 5.10
+
+ \brief Iterator over the key/value pairs of an associative container.
+
+ The QKeyValueIterator class provides an STL-style iterator for returning
+ key/value pairs from associative containers like QHash and QMap. It
+ supports the same API as the STL associative containers, i.e. getting a
+ key/value pair when iterating through the container.
+
+ This will allow for better interoperability between QMap, QHash and friends
+ and STL-style algorithms.
+
+ \warning Iterators on implicitly shared containers do not work
+ exactly like STL-iterators. You should avoid copying a container
+ while iterators are active on that container. For more information,
+ read \l{Implicit sharing iterator problem}.
+*/
+
+/*! \typedef QKeyValueIterator::iterator_category
+ \internal
+*/
+
+/*! \typedef QKeyValueIterator::difference_type
+ \internal
+*/
+
+/*! \typedef QKeyValueIterator::value_type
+ \internal
+*/
+
+/*! \typedef QKeyValueIterator::pointer
+ \internal
+*/
+
+/*! \typedef QKeyValueIterator::reference
+ \internal
+*/
+
+/*! \fn QKeyValueIterator()
+
+ Constructs a default QKeyValueIterator.
+*/
+
+/*! \fn QKeyValueIterator(Iterator o)
+
+ Constructs a QKeyValueIterator on top of \a o.
+*/
+
+/*! \fn const T &QKeyValueIterator::operator*() const
+
+ Returns the current entry as a pair.
+*/
+
+/*! \fn bool QKeyValueIterator::operator==(QKeyValueIterator lhs, QKeyValueIterator rhs)
+
+ Returns \c true if \a rhs points to the same item as \a lhs otherwise returns
+ \c false.
+
+ \sa operator!=()
+*/
+
+/*! \fn bool QKeyValueIterator::operator!=(QKeyValueIterator lhs, QKeyValueIterator rhs) const
+
+ Returns \c true if \a rhs points to a different item than \a lhs otherwise
+ returns \c false.
+
+ \sa operator==()
+*/
+
+/*!
+ \fn QKeyValueIterator &QKeyValueIterator::operator++()
+
+ The prefix ++ operator (\c{++i}) advances the iterator to the
+ next item in the container and returns the iterator.
+
+ \note Advancing the iterator past its container's end() constitutes
+ undefined behavior.
+
+ \sa operator--()
+*/
+
+/*! \fn QKeyValueIterator QKeyValueIterator::operator++(int)
+
+ \overload
+
+ The postfix ++ operator (\c{i++}) advances the iterator to the
+ next item in the container and returns the iterator's prior value.
+
+ \note Advancing the iterator past its container's end() constitutes
+ undefined behavior.
+*/
+
+/*! \fn QKeyValueIterator &QKeyValueIterator::operator--()
+
+ The prefix -- operator (\c{--i}) backs the iterator up to the previous item
+ in the container and returns the iterator.
+
+ \note Backing up an iterator to before its container's begin() constitutes
+ undefined behavior.
+
+ \sa operator++()
+*/
+
+/*! \fn QKeyValueIterator QKeyValueIterator::operator--(int)
+
+ \overload
+
+ The postfix -- operator (\c{i--}) backs the iterator up to the previous item
+ in the container and returns the iterator's prior value.
+
+ \note Backing up an iterator to before its container's begin() constitutes
+ undefined behavior.
+*/
+
+/*! \fn Iterator QKeyValueIterator::base() const
+ Returns the underlying iterator this QKeyValueIterator is based on.
+*/
+
QT_END_NAMESPACE
#endif // QITERATOR_H
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 249f76dafd..9f54ba7825 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -448,7 +448,7 @@ bool QLinkedList<T>::removeOne(const T &_t)
template <typename T>
inline T QLinkedList<T>::takeFirst()
{
- T t = first();
+ T t = std::move(first());
removeFirst();
return t;
}
@@ -456,7 +456,7 @@ inline T QLinkedList<T>::takeFirst()
template <typename T>
inline T QLinkedList<T>::takeLast()
{
- T t = last();
+ T t = std::move(last());
removeLast();
return t;
}
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index e2706de9ee..1042c29460 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -555,14 +555,14 @@ inline void QList<T>::removeAt(int i)
template <typename T>
inline T QList<T>::takeAt(int i)
{ Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>::take", "index out of range");
- detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = n->t(); node_destruct(n);
+ detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = std::move(n->t()); node_destruct(n);
p.remove(i); return t; }
template <typename T>
inline T QList<T>::takeFirst()
-{ T t = first(); removeFirst(); return t; }
+{ T t = std::move(first()); removeFirst(); return t; }
template <typename T>
inline T QList<T>::takeLast()
-{ T t = last(); removeLast(); return t; }
+{ T t = std::move(last()); removeLast(); return t; }
template <typename T>
Q_OUTOFLINE_TEMPLATE void QList<T>::reserve(int alloc)
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 63219b5bab..9a46018ede 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -61,6 +61,7 @@
#include "qvariant.h"
#include "qstringbuilder.h"
#include "private/qnumeric_p.h"
+#include <cmath>
#ifdef Q_OS_WIN
# include <qt_windows.h>
# include <time.h>
@@ -89,8 +90,9 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qlocale_data_p.h"
QT_END_INCLUDE_NAMESPACE
-QLocale::Language QLocalePrivate::codeToLanguage(const QChar *code, int len) Q_DECL_NOTHROW
+QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) Q_DECL_NOTHROW
{
+ const auto len = code.size();
if (len != 2 && len != 3)
return QLocale::C;
ushort uc1 = code[0].toLower().unicode();
@@ -131,8 +133,9 @@ QLocale::Language QLocalePrivate::codeToLanguage(const QChar *code, int len) Q_D
return QLocale::C;
}
-QLocale::Script QLocalePrivate::codeToScript(const QChar *code, int len) Q_DECL_NOTHROW
+QLocale::Script QLocalePrivate::codeToScript(QStringView code) Q_DECL_NOTHROW
{
+ const auto len = code.size();
if (len != 4)
return QLocale::AnyScript;
@@ -150,10 +153,12 @@ QLocale::Script QLocalePrivate::codeToScript(const QChar *code, int len) Q_DECL_
return QLocale::AnyScript;
}
-QLocale::Country QLocalePrivate::codeToCountry(const QChar *code, int len) Q_DECL_NOTHROW
+QLocale::Country QLocalePrivate::codeToCountry(QStringView code) Q_DECL_NOTHROW
{
+ const auto len = code.size();
if (len != 2 && len != 3)
return QLocale::AnyCountry;
+
ushort uc1 = code[0].toUpper().unicode();
ushort uc2 = code[1].toUpper().unicode();
ushort uc3 = len > 2 ? code[2].toUpper().unicode() : 0;
@@ -167,48 +172,35 @@ QLocale::Country QLocalePrivate::codeToCountry(const QChar *code, int len) Q_DEC
return QLocale::AnyCountry;
}
-QString QLocalePrivate::languageToCode(QLocale::Language language)
+QLatin1String QLocalePrivate::languageToCode(QLocale::Language language)
{
if (language == QLocale::AnyLanguage)
- return QString();
+ return QLatin1String();
if (language == QLocale::C)
return QLatin1String("C");
const unsigned char *c = language_code_list + 3*(uint(language));
- QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized);
+ return QLatin1String(reinterpret_cast<const char*>(c), c[2] == 0 ? 2 : 3);
- code[0] = ushort(c[0]);
- code[1] = ushort(c[1]);
- if (c[2] != 0)
- code[2] = ushort(c[2]);
-
- return code;
}
-QString QLocalePrivate::scriptToCode(QLocale::Script script)
+QLatin1String QLocalePrivate::scriptToCode(QLocale::Script script)
{
if (script == QLocale::AnyScript || script > QLocale::LastScript)
- return QString();
+ return QLatin1String();
const unsigned char *c = script_code_list + 4*(uint(script));
- return QString::fromLatin1((const char *)c, 4);
+ return QLatin1String(reinterpret_cast<const char *>(c), 4);
}
-QString QLocalePrivate::countryToCode(QLocale::Country country)
+QLatin1String QLocalePrivate::countryToCode(QLocale::Country country)
{
if (country == QLocale::AnyCountry)
- return QString();
+ return QLatin1String();
const unsigned char *c = country_code_list + 3*(uint(country));
- QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized);
-
- code[0] = ushort(c[0]);
- code[1] = ushort(c[1]);
- if (c[2] != 0)
- code[2] = ushort(c[2]);
-
- return code;
+ return QLatin1String(reinterpret_cast<const char*>(c), c[2] == 0 ? 2 : 3);
}
// http://www.unicode.org/reports/tr35/#Likely_Subtags
@@ -527,7 +519,7 @@ static const QLocaleData *findLocaleData(const QString &name)
return QLocaleData::findLocaleData(lang, script, cntry);
}
-QString qt_readEscapedFormatString(const QString &format, int *idx)
+QString qt_readEscapedFormatString(QStringView format, int *idx)
{
int &i = *idx;
@@ -561,13 +553,31 @@ QString qt_readEscapedFormatString(const QString &format, int *idx)
return result;
}
-int qt_repeatCount(const QString &s, int i)
+/*!
+ \internal
+
+ Counts the number of identical leading characters in \a s.
+
+ If \a s is empty, returns 0.
+
+ Otherwise, returns the number of consecutive \c{s.front()}
+ characters at the start of \a s.
+
+ \code
+ qt_repeatCount(u"a"); // == 1
+ qt_repeatCount(u"ab"); // == 1
+ qt_repeatCount(u"aab"); // == 2
+ \endcode
+*/
+int qt_repeatCount(QStringView s)
{
- QChar c = s.at(i);
- int j = i + 1;
+ if (s.isEmpty())
+ return 0;
+ const QChar c = s.front();
+ qssize_t j = 1;
while (j < s.size() && s.at(j) == c)
++j;
- return j - i;
+ return int(j);
}
static const QLocaleData *default_data = 0;
@@ -1122,27 +1132,27 @@ QString QLocale::name() const
return d->languageCode() + QLatin1Char('_') + d->countryCode();
}
-static qlonglong toIntegral_helper(const QLocaleData *d, const QChar *data, int len, bool *ok,
+static qlonglong toIntegral_helper(const QLocaleData *d, QStringView str, bool *ok,
QLocale::NumberOptions mode, qlonglong)
{
- return d->stringToLongLong(data, len, 10, ok, mode);
+ return d->stringToLongLong(str, 10, ok, mode);
}
-static qulonglong toIntegral_helper(const QLocaleData *d, const QChar *data, int len, bool *ok,
+static qulonglong toIntegral_helper(const QLocaleData *d, QStringView str, bool *ok,
QLocale::NumberOptions mode, qulonglong)
{
- return d->stringToUnsLongLong(data, len, 10, ok, mode);
+ return d->stringToUnsLongLong(str, 10, ok, mode);
}
template <typename T> static inline
-T toIntegral_helper(const QLocalePrivate *d, const QChar *data, int len, bool *ok)
+T toIntegral_helper(const QLocalePrivate *d, QStringView str, bool *ok)
{
// ### Qt6: use std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type
const bool isUnsigned = T(0) < T(-1);
typedef typename QtPrivate::QConditional<isUnsigned, qulonglong, qlonglong>::Type Int64;
// we select the right overload by the last, unused parameter
- Int64 val = toIntegral_helper(d->m_data, data, len, ok, d->m_numberOptions, Int64());
+ Int64 val = toIntegral_helper(d->m_data, str, ok, d->m_numberOptions, Int64());
if (T(val) != val) {
if (ok)
*ok = false;
@@ -1211,6 +1221,7 @@ QString QLocale::scriptToString(QLocale::Script script)
return QLatin1String(script_name_list + script_name_index[script]);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns the short int represented by the localized string \a s.
@@ -1226,7 +1237,7 @@ QString QLocale::scriptToString(QLocale::Script script)
short QLocale::toShort(const QString &s, bool *ok) const
{
- return toIntegral_helper<short>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<short>(d, s, ok);
}
/*!
@@ -1244,7 +1255,7 @@ short QLocale::toShort(const QString &s, bool *ok) const
ushort QLocale::toUShort(const QString &s, bool *ok) const
{
- return toIntegral_helper<ushort>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<ushort>(d, s, ok);
}
/*!
@@ -1262,7 +1273,7 @@ ushort QLocale::toUShort(const QString &s, bool *ok) const
int QLocale::toInt(const QString &s, bool *ok) const
{
- return toIntegral_helper<int>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<int>(d, s, ok);
}
/*!
@@ -1280,7 +1291,7 @@ int QLocale::toInt(const QString &s, bool *ok) const
uint QLocale::toUInt(const QString &s, bool *ok) const
{
- return toIntegral_helper<uint>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<uint>(d, s, ok);
}
/*!
@@ -1299,7 +1310,7 @@ uint QLocale::toUInt(const QString &s, bool *ok) const
qlonglong QLocale::toLongLong(const QString &s, bool *ok) const
{
- return toIntegral_helper<qlonglong>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<qlonglong>(d, s, ok);
}
/*!
@@ -1318,7 +1329,7 @@ qlonglong QLocale::toLongLong(const QString &s, bool *ok) const
qulonglong QLocale::toULongLong(const QString &s, bool *ok) const
{
- return toIntegral_helper<qulonglong>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<qulonglong>(d, s, ok);
}
/*!
@@ -1361,7 +1372,7 @@ float QLocale::toFloat(const QString &s, bool *ok) const
double QLocale::toDouble(const QString &s, bool *ok) const
{
- return d->m_data->stringToDouble(s.constData(), s.size(), ok, d->m_numberOptions);
+ return d->m_data->stringToDouble(s, ok, d->m_numberOptions);
}
/*!
@@ -1381,7 +1392,7 @@ double QLocale::toDouble(const QString &s, bool *ok) const
short QLocale::toShort(const QStringRef &s, bool *ok) const
{
- return toIntegral_helper<short>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<short>(d, s, ok);
}
/*!
@@ -1401,7 +1412,7 @@ short QLocale::toShort(const QStringRef &s, bool *ok) const
ushort QLocale::toUShort(const QStringRef &s, bool *ok) const
{
- return toIntegral_helper<ushort>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<ushort>(d, s, ok);
}
/*!
@@ -1421,7 +1432,7 @@ ushort QLocale::toUShort(const QStringRef &s, bool *ok) const
int QLocale::toInt(const QStringRef &s, bool *ok) const
{
- return toIntegral_helper<int>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<int>(d, s, ok);
}
/*!
@@ -1441,7 +1452,7 @@ int QLocale::toInt(const QStringRef &s, bool *ok) const
uint QLocale::toUInt(const QStringRef &s, bool *ok) const
{
- return toIntegral_helper<uint>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<uint>(d, s, ok);
}
/*!
@@ -1462,7 +1473,7 @@ uint QLocale::toUInt(const QStringRef &s, bool *ok) const
qlonglong QLocale::toLongLong(const QStringRef &s, bool *ok) const
{
- return toIntegral_helper<qlonglong>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<qlonglong>(d, s, ok);
}
/*!
@@ -1483,7 +1494,7 @@ qlonglong QLocale::toLongLong(const QStringRef &s, bool *ok) const
qulonglong QLocale::toULongLong(const QStringRef &s, bool *ok) const
{
- return toIntegral_helper<qulonglong>(d, s.constData(), s.size(), ok);
+ return toIntegral_helper<qulonglong>(d, s, ok);
}
/*!
@@ -1530,9 +1541,178 @@ float QLocale::toFloat(const QStringRef &s, bool *ok) const
double QLocale::toDouble(const QStringRef &s, bool *ok) const
{
- return d->m_data->stringToDouble(s.constData(), s.size(), ok, d->m_numberOptions);
+ return d->m_data->stringToDouble(s, ok, d->m_numberOptions);
+}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ Returns the short int represented by the localized string \a s.
+
+ If the conversion fails, the function returns 0.
+
+ If \a ok is not null, failure is reported by setting *ok to false, and
+ success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toUShort(), toString()
+
+ \since 5.10
+*/
+
+short QLocale::toShort(QStringView s, bool *ok) const
+{
+ return toIntegral_helper<short>(d, s, ok);
+}
+
+/*!
+ Returns the unsigned short int represented by the localized string \a s.
+
+ If the conversion fails, the function returns 0.
+
+ If \a ok is not null, failure is reported by setting *ok to false, and
+ success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toShort(), toString()
+
+ \since 5.10
+*/
+
+ushort QLocale::toUShort(QStringView s, bool *ok) const
+{
+ return toIntegral_helper<ushort>(d, s, ok);
+}
+
+/*!
+ Returns the int represented by the localized string \a s.
+
+ If the conversion fails, the function returns 0.
+
+ If \a ok is not null, failure is reported by setting *ok to false, and
+ success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toUInt(), toString()
+
+ \since 5.10
+*/
+
+int QLocale::toInt(QStringView s, bool *ok) const
+{
+ return toIntegral_helper<int>(d, s, ok);
+}
+
+/*!
+ Returns the unsigned int represented by the localized string \a s.
+
+ If the conversion fails, the function returns 0.
+
+ If \a ok is not null, failure is reported by setting *ok to false, and
+ success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toInt(), toString()
+
+ \since 5.10
+*/
+
+uint QLocale::toUInt(QStringView s, bool *ok) const
+{
+ return toIntegral_helper<uint>(d, s, ok);
}
+/*!
+ Returns the long long int represented by the localized string \a s.
+
+ If the conversion fails, the function returns 0.
+
+ If \a ok is not null, failure is reported by setting *ok to false, and
+ success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toInt(), toULongLong(), toDouble(), toString()
+
+ \since 5.10
+*/
+
+
+qlonglong QLocale::toLongLong(QStringView s, bool *ok) const
+{
+ return toIntegral_helper<qlonglong>(d, s, ok);
+}
+
+/*!
+ Returns the unsigned long long int represented by the localized
+ string \a s.
+
+ If the conversion fails, the function returns 0.
+
+ If \a ok is not null, failure is reported by setting *ok to false, and
+ success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toLongLong(), toInt(), toDouble(), toString()
+
+ \since 5.10
+*/
+
+qulonglong QLocale::toULongLong(QStringView s, bool *ok) const
+{
+ return toIntegral_helper<qulonglong>(d, s, ok);
+}
+
+/*!
+ Returns the float represented by the localized string \a s, or 0.0
+ if the conversion failed.
+
+ If \a ok is not null, reports failure by setting
+ *ok to false and success by setting *ok to true.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toDouble(), toInt(), toString()
+
+ \since 5.10
+*/
+
+float QLocale::toFloat(QStringView s, bool *ok) const
+{
+ return QLocaleData::convertDoubleToFloat(toDouble(s, ok), ok);
+}
+
+/*!
+ Returns the double represented by the localized string \a s, or
+ 0.0 if the conversion failed.
+
+ If \a ok is not null, reports failure by setting
+ *ok to false and success by setting *ok to true.
+
+ Unlike QString::toDouble(), this function does not fall back to
+ the "C" locale if the string cannot be interpreted in this
+ locale.
+
+ \snippet code/src_corelib_tools_qlocale.cpp 3-qstringview
+
+ Notice that the last conversion returns 1234.0, because '.' is the
+ thousands group separator in the German locale.
+
+ This function ignores leading and trailing whitespace.
+
+ \sa toFloat(), toInt(), toString()
+
+ \since 5.10
+*/
+
+double QLocale::toDouble(QStringView s, bool *ok) const
+{
+ return d->m_data->stringToDouble(s, ok, d->m_numberOptions);
+}
/*!
Returns a localized string representation of \a i.
@@ -1564,6 +1744,7 @@ QString QLocale::toString(qulonglong i) const
return d->m_data->unsLongLongToString(i, -1, 10, -1, flags);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a localized string representation of the given \a date in the
specified \a format.
@@ -1574,6 +1755,19 @@ QString QLocale::toString(const QDate &date, const QString &format) const
{
return d->dateTimeToString(format, QDateTime(), date, QTime(), this);
}
+#endif
+
+/*!
+ \since 5.10
+
+ Returns a localized string representation of the given \a date in the
+ specified \a format.
+ If \a format is an empty string, an empty string is returned.
+*/
+QString QLocale::toString(const QDate &date, QStringView format) const
+{
+ return d->dateTimeToString(format, QDateTime(), date, QTime(), this);
+}
/*!
Returns a localized string representation of the given \a date according
@@ -1599,7 +1793,7 @@ QString QLocale::toString(const QDate &date, FormatType format) const
return toString(date, format_str);
}
-static bool timeFormatContainsAP(const QString &format)
+static bool timeFormatContainsAP(QStringView format)
{
int i = 0;
while (i < format.size()) {
@@ -1616,6 +1810,7 @@ static bool timeFormatContainsAP(const QString &format)
return false;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a localized string representation of the given \a time according
to the specified \a format.
@@ -1625,7 +1820,21 @@ QString QLocale::toString(const QTime &time, const QString &format) const
{
return d->dateTimeToString(format, QDateTime(), QDate(), time, this);
}
+#endif
+
+/*!
+ \since 5.10
+
+ Returns a localized string representation of the given \a time according
+ to the specified \a format.
+ If \a format is an empty string, an empty string is returned.
+*/
+QString QLocale::toString(const QTime &time, QStringView format) const
+{
+ return d->dateTimeToString(format, QDateTime(), QDate(), time, this);
+}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.4
@@ -1638,6 +1847,19 @@ QString QLocale::toString(const QDateTime &dateTime, const QString &format) cons
{
return d->dateTimeToString(format, dateTime, QDate(), QTime(), this);
}
+#endif
+
+/*!
+ \since 5.10
+
+ Returns a localized string representation of the given \a dateTime according
+ to the specified \a format.
+ If \a format is an empty string, an empty string is returned.
+*/
+QString QLocale::toString(const QDateTime &dateTime, QStringView format) const
+{
+ return d->dateTimeToString(format, dateTime, QDate(), QTime(), this);
+}
/*!
\since 4.4
@@ -2549,7 +2771,7 @@ QString QLocale::pmText() const
}
-QString QLocalePrivate::dateTimeToString(const QString &format, const QDateTime &datetime,
+QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &datetime,
const QDate &dateOnly, const QTime &timeOnly,
const QLocale *q) const
{
@@ -2582,7 +2804,7 @@ QString QLocalePrivate::dateTimeToString(const QString &format, const QDateTime
}
const QChar c = format.at(i);
- int repeat = qt_repeatCount(format, i);
+ int repeat = qt_repeatCount(format.mid(i));
bool used = false;
if (formatDate) {
switch (c.unicode()) {
@@ -2717,7 +2939,7 @@ QString QLocalePrivate::dateTimeToString(const QString &format, const QDateTime
case 'a':
used = true;
- if (i + 1 < format.length() && format.at(i + 1).unicode() == 'p') {
+ if (i + 1 < format.size() && format.at(i + 1).unicode() == 'p') {
repeat = 2;
} else {
repeat = 1;
@@ -2727,7 +2949,7 @@ QString QLocalePrivate::dateTimeToString(const QString &format, const QDateTime
case 'A':
used = true;
- if (i + 1 < format.length() && format.at(i + 1).unicode() == 'P') {
+ if (i + 1 < format.size() && format.at(i + 1).unicode() == 'P') {
repeat = 2;
} else {
repeat = 1;
@@ -3082,12 +3304,12 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
number. We can't detect junk here, since we don't even know the base
of the number.
*/
-bool QLocaleData::numberToCLocale(const QChar *str, int len, QLocale::NumberOptions number_options,
+bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_options,
CharBuff *result) const
{
- const QChar *uc = str;
- int l = len;
- int idx = 0;
+ const QChar *uc = s.data();
+ auto l = s.size();
+ decltype(l) idx = 0;
// Skip whitespace
while (idx < l && uc[idx].isSpace())
@@ -3205,7 +3427,7 @@ bool QLocaleData::numberToCLocale(const QChar *str, int len, QLocale::NumberOpti
return idx == l;
}
-bool QLocaleData::validateChars(const QString &str, NumberMode numMode, QByteArray *buff,
+bool QLocaleData::validateChars(QStringView str, NumberMode numMode, QByteArray *buff,
int decDigits, QLocale::NumberOptions number_options) const
{
buff->clear();
@@ -3219,7 +3441,7 @@ bool QLocaleData::validateChars(const QString &str, NumberMode numMode, QByteArr
bool dec = false;
int decDigitCnt = 0;
- for (int i = 0; i < str.length(); ++i) {
+ for (qssize_t i = 0; i < str.size(); ++i) {
char c = digitToCLocale(str.at(i));
if (c >= '0' && c <= '9') {
@@ -3306,11 +3528,11 @@ bool QLocaleData::validateChars(const QString &str, NumberMode numMode, QByteArr
return true;
}
-double QLocaleData::stringToDouble(const QChar *begin, int len, bool *ok,
+double QLocaleData::stringToDouble(QStringView str, bool *ok,
QLocale::NumberOptions number_options) const
{
CharBuff buff;
- if (!numberToCLocale(begin, len, number_options, &buff)) {
+ if (!numberToCLocale(str, number_options, &buff)) {
if (ok != 0)
*ok = false;
return 0.0;
@@ -3323,11 +3545,11 @@ double QLocaleData::stringToDouble(const QChar *begin, int len, bool *ok,
return d;
}
-qlonglong QLocaleData::stringToLongLong(const QChar *begin, int len, int base, bool *ok,
+qlonglong QLocaleData::stringToLongLong(QStringView str, int base, bool *ok,
QLocale::NumberOptions number_options) const
{
CharBuff buff;
- if (!numberToCLocale(begin, len, number_options, &buff)) {
+ if (!numberToCLocale(str, number_options, &buff)) {
if (ok != 0)
*ok = false;
return 0;
@@ -3336,11 +3558,11 @@ qlonglong QLocaleData::stringToLongLong(const QChar *begin, int len, int base, b
return bytearrayToLongLong(buff.constData(), base, ok);
}
-qulonglong QLocaleData::stringToUnsLongLong(const QChar *begin, int len, int base, bool *ok,
+qulonglong QLocaleData::stringToUnsLongLong(QStringView str, int base, bool *ok,
QLocale::NumberOptions number_options) const
{
CharBuff buff;
- if (!numberToCLocale(begin, len, number_options, &buff)) {
+ if (!numberToCLocale(str, number_options, &buff)) {
if (ok != 0)
*ok = false;
return 0;
@@ -3349,7 +3571,7 @@ qulonglong QLocaleData::stringToUnsLongLong(const QChar *begin, int len, int bas
return bytearrayToUnsLongLong(buff.constData(), base, ok);
}
-double QLocaleData::bytearrayToDouble(const char *num, bool *ok, bool *overflow)
+double QLocaleData::bytearrayToDouble(const char *num, bool *ok)
{
bool nonNullOk = false;
int len = static_cast<int>(strlen(num));
@@ -3358,12 +3580,10 @@ double QLocaleData::bytearrayToDouble(const char *num, bool *ok, bool *overflow)
double d = asciiToDouble(num, len, nonNullOk, processed);
if (ok)
*ok = nonNullOk;
- if (overflow)
- *overflow = processed < len;
return d;
}
-qlonglong QLocaleData::bytearrayToLongLong(const char *num, int base, bool *ok, bool *overflow)
+qlonglong QLocaleData::bytearrayToLongLong(const char *num, int base, bool *ok)
{
bool _ok;
const char *endptr;
@@ -3371,8 +3591,6 @@ qlonglong QLocaleData::bytearrayToLongLong(const char *num, int base, bool *ok,
if (*num == '\0') {
if (ok != 0)
*ok = false;
- if (overflow != 0)
- *overflow = false;
return 0;
}
@@ -3381,11 +3599,6 @@ qlonglong QLocaleData::bytearrayToLongLong(const char *num, int base, bool *ok,
if (!_ok) {
if (ok != 0)
*ok = false;
- if (overflow != 0) {
- // the only way qstrtoll can fail with *endptr != '\0' on a non-empty
- // input string is overflow
- *overflow = *endptr != '\0';
- }
return 0;
}
@@ -3393,15 +3606,11 @@ qlonglong QLocaleData::bytearrayToLongLong(const char *num, int base, bool *ok,
// we stopped at a non-digit character after converting some digits
if (ok != 0)
*ok = false;
- if (overflow != 0)
- *overflow = false;
return 0;
}
if (ok != 0)
*ok = true;
- if (overflow != 0)
- *overflow = false;
return l;
}
@@ -3576,6 +3785,74 @@ QString QLocale::toCurrencyString(double value, const QString &symbol, int preci
}
/*!
+ \since 5.10
+
+ \enum QLocale::DataSizeFormat
+
+ Specifies the format for representation of data quantities.
+
+ \omitvalue DataSizeBase1000
+ \omitvalue DataSizeSIQuantifiers
+ \value DataSizeIecFormat format using base 1024 and IEC prefixes: KiB, MiB, GiB, ...
+ \value DataSizeTraditionalFormat format using base 1024 and SI prefixes: kB, MB, GB, ...
+ \value DataSizeSIFormat format using base 1000 and SI prefixes: kB, MB, GB, ...
+
+ \sa formattedDataSize()
+*/
+
+/*!
+ \since 5.10
+
+ Converts a size in bytes to a human-readable localized string, expressed in
+ a unit for which the numeric portion is at least 1 but as low as
+ possible. For example if \a bytes is 16384, \a precision is 2, and \a format
+ is \c DataSizeIecFormat (the default), this function returns "16.00 KiB";
+ for 1330409069609 bytes it returns "1.21 GiB"; and so on. If \a format is \c
+ DataSizeIecFormat or \c DataSizeTraditionalFormat, the given number of bytes
+ is divided by a power of 1024, with result less than 1024; for \c
+ DataSizeSIFormat, it is divided by a power of 1000, with result less than
+ 1000. DataSizeIecFormat uses the new IEC standard quantifiers Ki, Mi and so
+ on, whereas DataSizeSIFormat uses and DataSizeTraditionalFormat abuses the
+ older SI quantifiers k, M, etc.
+*/
+QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats format)
+{
+ int power, base = 1000;
+ if (!bytes) {
+ power = 0;
+ } else if (format & DataSizeBase1000) {
+ power = int(std::log10(qAbs(bytes)) / 3);
+ } else { // Compute log2(bytes) / 10:
+ power = int((63 - qCountLeadingZeroBits(quint64(qAbs(bytes)))) / 10);
+ base = 1024;
+ }
+ // Only go to doubles if we'll be using a quantifier:
+ const QString number = power
+ ? toString(bytes / std::pow(double(base), power), 'f', qMin(precision, 3 * power))
+ : toString(bytes);
+
+ // We don't support sizes in units larger than exbibytes because
+ // the number of bytes would not fit into qint64.
+ Q_ASSERT(power <= 6 && power >= 0);
+ QString unit;
+ if (power > 0) {
+ quint16 index, size;
+ if (format & DataSizeSIQuantifiers) {
+ index = d->m_data->m_byte_si_quantified_idx;
+ size = d->m_data->m_byte_si_quantified_size;
+ } else {
+ index = d->m_data->m_byte_iec_quantified_idx;
+ size = d->m_data->m_byte_iec_quantified_size;
+ }
+ unit = getLocaleListData(byte_unit_data + index, size, power - 1);
+ } else {
+ unit = getLocaleData(byte_unit_data + d->m_data->m_byte_idx, d->m_data->m_byte_size);
+ }
+
+ return number + QLatin1Char(' ') + unit;
+}
+
+/*!
\since 4.8
Returns an ordered list of locale names for translation purposes in
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index bd89e48234..54b1a32946 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -913,6 +913,19 @@ public:
CurrencyDisplayName
};
+ enum DataSizeFormat {
+ // Single-bit values, for internal use.
+ DataSizeBase1000 = 1, // use factors of 1000 instead of IEC's 1024;
+ DataSizeSIQuantifiers = 2, // use SI quantifiers instead of IEC ones.
+
+ // Flags values for use in API:
+ DataSizeIecFormat = 0, // base 1024, KiB, MiB, GiB, ...
+ DataSizeTraditionalFormat = DataSizeSIQuantifiers, // base 1024, kB, MB, GB, ...
+ DataSizeSIFormat = DataSizeBase1000 | DataSizeSIQuantifiers // base 1000, kB, MB, GB, ...
+ };
+ Q_DECLARE_FLAGS(DataSizeFormats, DataSizeFormat)
+ Q_FLAG(DataSizeFormats)
+
QLocale();
QLocale(const QString &name);
QLocale(Language language, Country country = AnyCountry);
@@ -935,6 +948,7 @@ public:
QString nativeLanguageName() const;
QString nativeCountryName() const;
+#if QT_STRINGVIEW_LEVEL < 2
short toShort(const QString &s, bool *ok = Q_NULLPTR) const;
ushort toUShort(const QString &s, bool *ok = Q_NULLPTR) const;
int toInt(const QString &s, bool *ok = Q_NULLPTR) const;
@@ -952,6 +966,16 @@ public:
qulonglong toULongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const;
float toFloat(const QStringRef &s, bool *ok = Q_NULLPTR) const;
double toDouble(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+#endif
+
+ short toShort(QStringView s, bool *ok = nullptr) const;
+ ushort toUShort(QStringView s, bool *ok = nullptr) const;
+ int toInt(QStringView s, bool *ok = nullptr) const;
+ uint toUInt(QStringView s, bool *ok = nullptr) const;
+ qlonglong toLongLong(QStringView s, bool *ok = nullptr) const;
+ qulonglong toULongLong(QStringView s, bool *ok = nullptr) const;
+ float toFloat(QStringView s, bool *ok = nullptr) const;
+ double toDouble(QStringView s, bool *ok = nullptr) const;
QString toString(qlonglong i) const;
QString toString(qulonglong i) const;
@@ -961,12 +985,18 @@ public:
inline QString toString(uint i) const;
QString toString(double i, char f = 'g', int prec = 6) const;
inline QString toString(float i, char f = 'g', int prec = 6) const;
+
+#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QDate &date, const QString &formatStr) const;
- QString toString(const QDate &date, FormatType format = LongFormat) const;
QString toString(const QTime &time, const QString &formatStr) const;
+ QString toString(const QDateTime &dateTime, const QString &format) const;
+#endif
+ QString toString(const QDate &date, QStringView formatStr) const;
+ QString toString(const QTime &time, QStringView formatStr) const;
+ QString toString(const QDateTime &dateTime, QStringView format) const;
+ 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;
- QString toString(const QDateTime &dateTime, const QString &format) const;
QString dateFormat(FormatType format = LongFormat) const;
QString timeFormat(FormatType format = LongFormat) const;
@@ -1028,6 +1058,8 @@ public:
{ return toCurrencyString(double(i), symbol, precision); }
#endif
+ QString formattedDataSize(qint64 bytes, int precision = 2, DataSizeFormats format = DataSizeIecFormat);
+
QStringList uiLanguages() const;
bool operator==(const QLocale &other) const;
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index d419172356..ed3eb93313 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -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 v29.
+ QLocale's data is based on Common Locale Data Repository v31.0.1.
\sa QString::arg(), QString::toInt(), QString::toDouble(),
QInputMethod::locale()
diff --git a/src/corelib/tools/qlocale_data_p.h b/src/corelib/tools/qlocale_data_p.h
index 869153942e..cf210454d4 100644
--- a/src/corelib/tools/qlocale_data_p.h
+++ b/src/corelib/tools/qlocale_data_p.h
@@ -77,16 +77,16 @@ static const int ImperialMeasurementSystemsCount =
// GENERATED PART STARTS HERE
/*
- This part of the file was generated on 2016-03-19 from the
- Common Locale Data Repository v29
+ This part of the file was generated on 2017-06-07 from the
+ Common Locale Data Repository v31.0.1
http://www.unicode.org/cldr/
- Do not change it, instead edit CLDR data and regenerate this file using
- cldr2qlocalexml.py and qlocalexml2cpp.py.
+ 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
@@ -138,8 +138,7 @@ static const QLocaleId likely_subtags[] = {
{ 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, 11, 100 }, // ccp -> ccp_Beng_IN
- { 272, 46, 0 }, { 272, 46, 18 }, // ccp_Cakm -> ccp_Cakm_BD
+ { 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
@@ -744,7 +743,6 @@ static const QLocaleId likely_subtags[] = {
{ 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, 172 }, { 22, 2, 172 }, // und_Cyrl_PL -> be_Cyrl_PL
{ 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
@@ -932,184 +930,184 @@ static const quint16 locale_index[] = {
231, // Galician
232, // Georgian
233, // German
- 239, // Greek
- 241, // Greenlandic
- 242, // Guarani
- 243, // Gujarati
- 244, // Hausa
- 248, // Hebrew
- 249, // Hindi
- 250, // Hungarian
- 251, // Icelandic
- 252, // Indonesian
- 253, // Interlingua
+ 240, // Greek
+ 242, // Greenlandic
+ 243, // Guarani
+ 244, // Gujarati
+ 245, // Hausa
+ 249, // Hebrew
+ 250, // Hindi
+ 251, // Hungarian
+ 252, // Icelandic
+ 253, // Indonesian
+ 254, // Interlingua
0, // Interlingue
- 254, // Inuktitut
+ 255, // Inuktitut
0, // Inupiak
- 256, // Irish
- 257, // Italian
- 260, // Japanese
- 261, // Javanese
- 262, // Kannada
- 263, // Kashmiri
- 264, // Kazakh
- 265, // Kinyarwanda
- 266, // Kirghiz
- 267, // Korean
- 269, // Kurdish
- 270, // Rundi
- 271, // Lao
+ 257, // Irish
+ 258, // Italian
+ 262, // Japanese
+ 263, // Javanese
+ 264, // Kannada
+ 265, // Kashmiri
+ 266, // Kazakh
+ 267, // Kinyarwanda
+ 268, // Kirghiz
+ 269, // Korean
+ 271, // Kurdish
+ 272, // Rundi
+ 273, // Lao
0, // Latin
- 272, // Latvian
- 273, // Lingala
- 277, // Lithuanian
- 278, // Macedonian
- 279, // Malagasy
- 280, // Malay
- 284, // Malayalam
- 285, // Maltese
- 286, // Maori
- 287, // Marathi
+ 274, // Latvian
+ 275, // Lingala
+ 279, // Lithuanian
+ 280, // Macedonian
+ 281, // Malagasy
+ 282, // Malay
+ 286, // Malayalam
+ 287, // Maltese
+ 288, // Maori
+ 289, // Marathi
0, // Marshallese
- 288, // Mongolian
+ 290, // Mongolian
0, // Nauru
- 290, // Nepali
- 292, // NorwegianBokmal
- 294, // Occitan
- 295, // Oriya
- 296, // Pashto
- 297, // Persian
- 299, // Polish
- 300, // Portuguese
- 312, // Punjabi
- 314, // Quechua
- 317, // Romansh
- 318, // Romanian
- 320, // Russian
+ 292, // Nepali
+ 294, // NorwegianBokmal
+ 296, // Occitan
+ 297, // Oriya
+ 298, // Pashto
+ 299, // Persian
+ 301, // Polish
+ 302, // Portuguese
+ 314, // Punjabi
+ 316, // Quechua
+ 319, // Romansh
+ 320, // Romanian
+ 322, // Russian
0, // Samoan
- 326, // Sango
- 327, // Sanskrit
- 328, // Serbian
- 336, // Ossetic
- 338, // Southern Sotho
- 339, // Tswana
- 340, // Shona
- 341, // Sindhi
- 342, // Sinhala
- 343, // Swati
- 344, // Slovak
- 345, // Slovenian
- 346, // Somali
- 350, // Spanish
+ 328, // Sango
+ 329, // Sanskrit
+ 330, // Serbian
+ 338, // Ossetic
+ 340, // Southern Sotho
+ 341, // Tswana
+ 342, // Shona
+ 343, // Sindhi
+ 344, // Sinhala
+ 345, // Swati
+ 346, // Slovak
+ 347, // Slovenian
+ 348, // Somali
+ 352, // Spanish
0, // Sundanese
- 377, // Swahili
- 381, // Swedish
+ 380, // Swahili
+ 384, // Swedish
0, // Sardinian
- 384, // Tajik
- 385, // Tamil
- 389, // Tatar
- 390, // Telugu
- 391, // Thai
- 392, // Tibetan
- 394, // Tigrinya
- 396, // Tongan
- 397, // Tsonga
- 398, // Turkish
- 400, // Turkmen
+ 387, // Tajik
+ 388, // Tamil
+ 392, // Tatar
+ 393, // Telugu
+ 394, // Thai
+ 395, // Tibetan
+ 397, // Tigrinya
+ 399, // Tongan
+ 400, // Tsonga
+ 401, // Turkish
+ 403, // Turkmen
0, // Tahitian
- 401, // Uighur
- 402, // Ukrainian
- 403, // Urdu
- 405, // Uzbek
- 408, // Vietnamese
+ 404, // Uighur
+ 405, // Ukrainian
+ 406, // Urdu
+ 408, // Uzbek
+ 411, // Vietnamese
0, // Volapuk
- 409, // Welsh
- 410, // Wolof
- 411, // Xhosa
+ 412, // Welsh
+ 413, // Wolof
+ 414, // Xhosa
0, // Yiddish
- 412, // Yoruba
+ 415, // Yoruba
0, // Zhuang
- 414, // Zulu
- 415, // NorwegianNynorsk
- 416, // Bosnian
- 418, // Divehi
- 419, // Manx
- 420, // Cornish
- 421, // Akan
- 422, // Konkani
- 423, // Ga
- 424, // Igbo
- 425, // Kamba
- 426, // Syriac
- 427, // Blin
- 428, // Geez
+ 417, // Zulu
+ 418, // NorwegianNynorsk
+ 419, // Bosnian
+ 421, // Divehi
+ 422, // Manx
+ 423, // Cornish
+ 424, // Akan
+ 425, // Konkani
+ 426, // Ga
+ 427, // Igbo
+ 428, // Kamba
+ 429, // Syriac
+ 430, // Blin
+ 431, // Geez
0, // Koro
- 429, // Sidamo
- 430, // Atsam
- 431, // Tigre
- 432, // Jju
- 433, // Friulian
- 434, // Venda
- 435, // Ewe
- 437, // Walamo
- 438, // Hawaiian
- 439, // Tyap
- 440, // Nyanja
- 441, // Filipino
- 442, // Swiss German
- 445, // Sichuan Yi
- 446, // Kpelle
- 447, // Low German
- 448, // South Ndebele
- 449, // Northern Sotho
- 450, // Northern Sami
- 453, // Taroko
- 454, // Gusii
- 455, // Taita
- 456, // Fulah
- 460, // Kikuyu
- 461, // Samburu
- 462, // Sena
- 463, // North Ndebele
- 464, // Rombo
- 465, // Tachelhit
- 467, // Kabyle
- 468, // Nyankole
- 469, // Bena
- 470, // Vunjo
- 471, // Bambara
- 473, // Embu
- 474, // Cherokee
- 475, // Morisyen
- 476, // Makonde
- 477, // Langi
- 478, // Ganda
- 479, // Bemba
- 480, // Kabuverdianu
- 481, // Meru
- 482, // Kalenjin
- 483, // Nama
- 484, // Machame
- 485, // Colognian
- 486, // Masai
- 488, // Soga
- 489, // Luyia
- 490, // Asu
- 491, // Teso
- 493, // Saho
- 494, // Koyra Chiini
- 495, // Rwa
- 496, // Luo
- 497, // Chiga
- 498, // Central Morocco Tamazight
- 499, // Koyraboro Senni
- 500, // Shambala
- 501, // Bodo
+ 432, // Sidamo
+ 433, // Atsam
+ 434, // Tigre
+ 435, // Jju
+ 436, // Friulian
+ 437, // Venda
+ 438, // Ewe
+ 440, // Walamo
+ 441, // Hawaiian
+ 442, // Tyap
+ 443, // Nyanja
+ 444, // Filipino
+ 445, // Swiss German
+ 448, // Sichuan Yi
+ 449, // Kpelle
+ 450, // Low German
+ 452, // South Ndebele
+ 453, // Northern Sotho
+ 454, // Northern Sami
+ 457, // Taroko
+ 458, // Gusii
+ 459, // Taita
+ 460, // Fulah
+ 464, // Kikuyu
+ 465, // Samburu
+ 466, // Sena
+ 467, // North Ndebele
+ 468, // Rombo
+ 469, // Tachelhit
+ 471, // Kabyle
+ 472, // Nyankole
+ 473, // Bena
+ 474, // Vunjo
+ 475, // Bambara
+ 477, // Embu
+ 478, // Cherokee
+ 479, // Morisyen
+ 480, // Makonde
+ 481, // Langi
+ 482, // Ganda
+ 483, // Bemba
+ 484, // Kabuverdianu
+ 485, // Meru
+ 486, // Kalenjin
+ 487, // Nama
+ 488, // Machame
+ 489, // Colognian
+ 490, // Masai
+ 492, // Soga
+ 493, // Luyia
+ 494, // Asu
+ 495, // Teso
+ 497, // Saho
+ 498, // Koyra Chiini
+ 499, // Rwa
+ 500, // Luo
+ 501, // Chiga
+ 502, // Central Morocco Tamazight
+ 503, // Koyraboro Senni
+ 504, // Shambala
+ 505, // Bodo
0, // Avaric
0, // Chamorro
- 502, // Chechen
- 503, // Church
- 504, // Chuvash
+ 506, // Chechen
+ 507, // Church
+ 508, // Chuvash
0, // Cree
0, // Haitian
0, // Herero
@@ -1119,37 +1117,37 @@ static const quint16 locale_index[] = {
0, // Kongo
0, // Kwanyama
0, // Limburgish
- 505, // LubaKatanga
- 506, // Luxembourgish
+ 509, // LubaKatanga
+ 510, // Luxembourgish
0, // Navaho
0, // Ndonga
0, // Ojibwa
0, // Pali
- 507, // Walloon
- 508, // Aghem
- 509, // Basaa
- 510, // Zarma
- 511, // Duala
- 512, // JolaFonyi
- 513, // Ewondo
- 514, // Bafia
- 515, // MakhuwaMeetto
- 516, // Mundang
- 517, // Kwasio
- 518, // Nuer
- 519, // Sakha
- 520, // Sangu
+ 511, // Walloon
+ 512, // Aghem
+ 513, // Basaa
+ 514, // Zarma
+ 515, // Duala
+ 516, // JolaFonyi
+ 517, // Ewondo
+ 518, // Bafia
+ 519, // MakhuwaMeetto
+ 520, // Mundang
+ 521, // Kwasio
+ 522, // Nuer
+ 523, // Sakha
+ 524, // Sangu
0, // Congo Swahili
- 521, // Tasawaq
- 522, // Vai
- 524, // Walser
- 525, // Yangben
+ 525, // Tasawaq
+ 526, // Vai
+ 528, // Walser
+ 529, // Yangben
0, // Avestan
- 526, // Asturian
- 527, // Ngomba
- 528, // Kako
- 529, // Meta
- 530, // Ngiemboon
+ 530, // Asturian
+ 531, // Ngomba
+ 532, // Kako
+ 533, // Meta
+ 534, // Ngiemboon
0, // Aragonese
0, // Akkadian
0, // AncientEgyptian
@@ -1161,7 +1159,7 @@ static const quint16 locale_index[] = {
0, // Buginese
0, // Buhid
0, // Carian
- 0, // Chakma
+ 535, // Chakma
0, // ClassicalMandaic
0, // Coptic
0, // Dogri
@@ -1179,7 +1177,7 @@ static const quint16 locale_index[] = {
0, // Lycian
0, // Lydian
0, // Mandingo
- 0, // Manipuri
+ 536, // Manipuri
0, // Meroitic
0, // NorthernThai
0, // OldIrish
@@ -1198,26 +1196,26 @@ static const quint16 locale_index[] = {
0, // Sora
0, // Sylheti
0, // Tagbanwa
- 0, // TaiDam
+ 537, // TaiDam
0, // TaiNua
0, // Ugaritic
- 531, // Akoose
- 532, // Lakota
- 533, // Standard Moroccan Tamazight
- 534, // Mapuche
- 535, // Central Kurdish
- 537, // LowerSorbian
- 538, // UpperSorbian
- 539, // Kenyang
- 540, // Mohawk
- 541, // Nko
+ 538, // Akoose
+ 539, // Lakota
+ 540, // Standard Moroccan Tamazight
+ 541, // Mapuche
+ 542, // Central Kurdish
+ 544, // LowerSorbian
+ 545, // UpperSorbian
+ 546, // Kenyang
+ 547, // Mohawk
+ 548, // Nko
0, // Prussian
- 542, // Kiche
- 543, // Southern Sami
- 544, // Lule Sami
- 545, // Inari Sami
- 546, // Skolt Sami
- 547, // Warlpiri
+ 549, // Kiche
+ 550, // Southern Sami
+ 551, // Lule Sami
+ 552, // Inari Sami
+ 553, // Skolt Sami
+ 554, // Warlpiri
0, // Manichaean Middle Persian
0, // Mende
0, // Ancient North Arabian
@@ -1235,10 +1233,10 @@ static const quint16 locale_index[] = {
0, // Bhojpuri
0, // Hieroglyphic Luwian
0, // Literary Chinese
- 548, // Mazanderani
+ 555, // Mazanderani
0, // Mru
0, // Newari
- 549, // Northern Luri
+ 556, // Northern Luri
0, // Palauan
0, // Papiamento
0, // Saraiki
@@ -1246,567 +1244,574 @@ static const quint16 locale_index[] = {
0, // Tok Pisin
0, // Tuvalu
0, // UncodedLanguages
- 551, // Cantonese
+ 558, // Cantonese
0, // Osage
0, // Tangut
0 // trailing 0
};
static const QLocaleData locale_data[] = {
-// lang script terr dec group list prcnt zero minus plus exp quotStart quotEnd altQuotStart altQuotEnd lpStart lpMid lpEnd lpTwo sDtFmt lDtFmt sTmFmt lTmFmt ssMonth slMonth sMonth lMonth sDays lDays am,len pm,len
- { 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,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 , {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 , 134,24 , 185,48 , 233,111 , 134,24 , 113,28 , 141,55 , 85,14 , 113,28 , 141,55 , 85,14 , 2,2 , 2,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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,18 , 18,7 , 25,12 , 392,59 , 451,92 , 134,24 , 392,59 , 451,92 , 134,24 , 196,28 , 224,58 , 282,14 , 196,28 , 224,58 , 282,14 , 4,3 , 4,3 , {90,65,82}, 5,1 , 31,67 , 4,4 , 4,0 , 24,9 , 33,11 , 2, 1, 7, 6, 7 }, // Afrikaans/Latin/SouthAfrica
- { 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 , 98,16 , 18,7 , 25,12 , 392,59 , 451,92 , 134,24 , 392,59 , 451,92 , 134,24 , 196,28 , 224,58 , 282,14 , 196,28 , 224,58 , 282,14 , 4,3 , 4,3 , {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 , 114,6 , 10,17 , 18,7 , 42,13 , 543,48 , 591,78 , 669,24 , 543,48 , 693,78 , 669,24 , 296,28 , 324,58 , 382,14 , 296,28 , 396,58 , 382,14 , 7,11 , 7,10 , {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 , 114,6 , 10,17 , 37,5 , 8,10 , 543,48 , 591,78 , 669,24 , 543,48 , 693,78 , 669,24 , 296,28 , 324,58 , 382,14 , 296,28 , 396,58 , 382,14 , 7,11 , 7,10 , {77,75,68}, 11,3 , 198,54 , 13,5 , 4,0 , 51,5 , 64,8 , 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 , 114,6 , 10,17 , 37,5 , 8,10 , 543,48 , 591,78 , 669,24 , 543,48 , 693,78 , 669,24 , 296,28 , 324,58 , 382,14 , 296,28 , 396,58 , 382,14 , 7,11 , 7,10 , {69,85,82}, 14,1 , 252,21 , 13,5 , 4,0 , 51,5 , 72,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 , 120,10 , 130,17 , 18,7 , 25,12 , 771,46 , 817,61 , 878,24 , 771,46 , 817,61 , 878,24 , 454,27 , 481,28 , 509,14 , 454,27 , 481,28 , 509,14 , 18,3 , 17,4 , {69,84,66}, 15,2 , 273,34 , 4,4 , 4,0 , 78,4 , 82,5 , 2, 1, 7, 6, 7 }, // Amharic/Ethiopic/Ethiopia
- { 8, 1, 64, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {69,71,80}, 17,5 , 307,81 , 8,5 , 4,0 , 87,7 , 94,3 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Egypt
- { 8, 1, 3, 44, 46, 59, 1642, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1001,71 , 1001,71 , 1072,24 , 1001,71 , 1001,71 , 1072,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {68,90,68}, 22,5 , 388,102 , 8,5 , 4,0 , 87,7 , 97,7 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Algeria
- { 8, 1, 17, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {66,72,68}, 27,5 , 490,98 , 8,5 , 4,0 , 87,7 , 104,7 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Bahrain
- { 8, 1, 42, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {88,65,70}, 32,4 , 588,112 , 8,5 , 4,0 , 87,7 , 111,4 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Chad
- { 8, 1, 48, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 37,5 , 8,10 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {75,77,70}, 36,7 , 700,105 , 8,5 , 4,0 , 87,7 , 115,9 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Comoros
- { 8, 1, 59, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {68,74,70}, 43,3 , 805,84 , 8,5 , 4,0 , 87,7 , 124,6 , 0, 0, 6, 6, 7 }, // Arabic/Arabic/Djibouti
- { 8, 1, 67, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {69,82,78}, 46,3 , 889,91 , 8,5 , 4,0 , 87,7 , 130,7 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Eritrea
- { 8, 1, 103, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1096,92 , 1096,92 , 1188,24 , 1212,92 , 1096,92 , 1188,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {73,81,68}, 49,5 , 980,91 , 8,5 , 4,0 , 87,7 , 137,6 , 0, 0, 6, 5, 6 }, // Arabic/Arabic/Iraq
- { 8, 1, 105, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 55,4 , 59,9 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {73,76,83}, 54,1 , 1071,133 , 8,5 , 4,0 , 87,7 , 143,7 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/Israel
- { 8, 1, 109, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1096,92 , 1096,92 , 1188,24 , 1096,92 , 1096,92 , 1188,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {74,79,68}, 55,5 , 1204,91 , 8,5 , 4,0 , 87,7 , 150,6 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Jordan
- { 8, 1, 115, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {75,87,68}, 60,5 , 1295,91 , 8,5 , 4,0 , 87,7 , 156,6 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Kuwait
- { 8, 1, 119, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1096,92 , 1096,92 , 1188,24 , 1096,92 , 1096,92 , 1188,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {76,66,80}, 65,5 , 1386,84 , 8,5 , 4,0 , 87,7 , 162,5 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Lebanon
- { 8, 1, 122, 44, 46, 59, 1642, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {76,89,68}, 70,5 , 1470,88 , 8,5 , 4,0 , 87,7 , 167,5 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Libya
- { 8, 1, 136, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1304,72 , 1304,72 , 1376,24 , 1304,72 , 1304,72 , 1376,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {77,82,79}, 75,5 , 1558,112 , 8,5 , 4,0 , 87,7 , 172,9 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Mauritania
- { 8, 1, 145, 44, 46, 59, 1642, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 37,5 , 8,10 , 1400,70 , 1400,70 , 1470,24 , 1400,70 , 1400,70 , 1470,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {77,65,68}, 80,5 , 1670,87 , 8,5 , 4,0 , 87,7 , 181,6 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Morocco
- { 8, 1, 162, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {79,77,82}, 85,5 , 1757,84 , 8,5 , 4,0 , 87,7 , 187,5 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Oman
- { 8, 1, 165, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1096,92 , 1096,92 , 1188,24 , 1096,92 , 1096,92 , 1188,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {73,76,83}, 54,1 , 1071,133 , 8,5 , 4,0 , 87,7 , 192,18 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/PalestinianTerritories
- { 8, 1, 175, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {81,65,82}, 90,5 , 1841,77 , 8,5 , 4,0 , 87,7 , 210,3 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Qatar
- { 8, 1, 186, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {83,65,82}, 95,5 , 1918,84 , 8,5 , 4,0 , 87,7 , 213,24 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/SaudiArabia
- { 8, 1, 194, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {83,79,83}, 100,1 , 2002,77 , 8,5 , 4,0 , 87,7 , 237,7 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Somalia
- { 8, 1, 201, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {83,68,71}, 101,4 , 2079,91 , 8,5 , 4,0 , 87,7 , 244,7 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Sudan
- { 8, 1, 207, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1096,92 , 1096,92 , 1188,24 , 1096,92 , 1096,92 , 1188,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {83,89,80}, 105,5 , 2170,78 , 8,5 , 4,0 , 87,7 , 251,5 , 0, 0, 6, 5, 6 }, // Arabic/Arabic/Syria
- { 8, 1, 216, 44, 46, 59, 1642, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 1001,71 , 1001,71 , 1072,24 , 1001,71 , 1001,71 , 1072,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {84,78,68}, 110,5 , 2248,95 , 8,5 , 4,0 , 87,7 , 256,4 , 3, 0, 7, 5, 6 }, // Arabic/Arabic/Tunisia
- { 8, 1, 223, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {65,69,68}, 115,5 , 2343,97 , 8,5 , 4,0 , 87,7 , 260,24 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/UnitedArabEmirates
- { 8, 1, 236, 46, 44, 59, 1642, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {77,65,68}, 80,5 , 1670,87 , 8,5 , 4,0 , 87,7 , 284,15 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/WesternSahara
- { 8, 1, 237, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {89,69,82}, 120,5 , 2440,77 , 8,5 , 4,0 , 87,7 , 299,5 , 0, 0, 7, 5, 6 }, // Arabic/Arabic/Yemen
- { 8, 1, 254, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 902,75 , 902,75 , 977,24 , 902,75 , 902,75 , 977,24 , 523,52 , 523,52 , 575,14 , 523,52 , 523,52 , 575,14 , 21,1 , 21,1 , {83,83,80}, 125,1 , 2517,132 , 8,5 , 4,0 , 87,7 , 304,12 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/SouthSudan
- { 9, 10, 11, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 65,7 , 65,7 , 175,8 , 183,19 , 55,4 , 68,10 , 1494,48 , 1542,94 , 1636,24 , 1494,48 , 1660,106 , 1636,24 , 589,28 , 617,62 , 679,21 , 589,28 , 617,62 , 700,15 , 0,2 , 0,2 , {65,77,68}, 126,1 , 2649,46 , 8,5 , 4,0 , 316,7 , 323,8 , 0, 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 , 0,6 , 0,6 , 202,8 , 210,18 , 78,8 , 86,12 , 1766,62 , 1828,88 , 158,27 , 1766,62 , 1828,88 , 158,27 , 715,37 , 752,58 , 85,14 , 715,37 , 752,58 , 85,14 , 22,9 , 22,7 , {73,78,82}, 127,1 , 0,7 , 8,5 , 4,0 , 331,7 , 338,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 , 72,8 , 72,8 , 175,8 , 228,17 , 37,5 , 8,10 , 1916,48 , 1964,77 , 158,27 , 1916,48 , 2041,77 , 158,27 , 810,27 , 837,67 , 99,14 , 810,27 , 837,67 , 99,14 , 0,2 , 0,2 , {65,90,78}, 128,1 , 2695,58 , 8,5 , 4,0 , 342,15 , 357,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 175,8 , 245,19 , 37,5 , 8,10 , 2118,77 , 2118,77 , 158,27 , 2118,77 , 2118,77 , 158,27 , 904,67 , 904,67 , 99,14 , 904,67 , 904,67 , 99,14 , 0,2 , 0,2 , {65,90,78}, 128,1 , 2753,12 , 8,5 , 4,0 , 367,15 , 382,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {82,85,66}, 129,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, 45, 43, 101, 8220, 8221, 8220, 8221, 0,6 , 0,6 , 80,9 , 80,9 , 264,10 , 274,26 , 37,5 , 98,12 , 2195,60 , 2255,93 , 2348,24 , 2372,60 , 2432,105 , 2348,24 , 971,28 , 999,68 , 1067,14 , 1081,28 , 1109,68 , 1067,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 2765,20 , 13,5 , 4,0 , 392,7 , 399,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 , 89,10 , 99,9 , 300,6 , 210,18 , 18,7 , 25,12 , 2537,90 , 2537,90 , 2627,33 , 2537,90 , 2537,90 , 2627,33 , 1177,37 , 1214,58 , 1272,18 , 1177,37 , 1290,58 , 1272,18 , 31,9 , 29,7 , {66,68,84}, 130,1 , 2785,49 , 0,4 , 4,0 , 407,5 , 412,8 , 2, 1, 5, 6, 7 }, // Bengali/Bengali/Bangladesh
- { 15, 11, 100, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 89,10 , 99,9 , 300,6 , 210,18 , 18,7 , 25,12 , 2537,90 , 2537,90 , 2627,33 , 2537,90 , 2537,90 , 2627,33 , 1177,37 , 1214,58 , 1272,18 , 1177,37 , 1290,58 , 1272,18 , 31,9 , 29,7 , {73,78,82}, 127,1 , 2834,43 , 0,4 , 4,0 , 407,5 , 420,4 , 2, 1, 7, 7, 7 }, // Bengali/Bengali/India
- { 16, 31, 25, 46, 44, 59, 37, 3872, 45, 43, 101, 8220, 8221, 8216, 8217, 108,9 , 108,9 , 108,9 , 108,9 , 53,10 , 306,30 , 110,22 , 132,27 , 2660,63 , 2723,191 , 2914,27 , 2941,27 , 2968,132 , 3100,27 , 1348,34 , 1382,79 , 1461,27 , 1348,34 , 1382,79 , 1461,27 , 40,5 , 36,6 , {66,84,78}, 131,3 , 2877,15 , 4,4 , 4,0 , 424,6 , 430,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 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 3127,63 , 3190,78 , 3268,36 , 3304,63 , 3190,78 , 3268,36 , 1488,33 , 1521,43 , 1564,18 , 1488,33 , 1521,43 , 1564,18 , 45,4 , 42,4 , {69,85,82}, 14,1 , 2892,36 , 13,5 , 4,0 , 435,9 , 444,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 , 117,7 , 117,7 , 336,12 , 348,22 , 55,4 , 59,9 , 3367,49 , 3416,82 , 3498,24 , 3367,49 , 3416,82 , 3498,24 , 1582,21 , 1603,55 , 1658,14 , 1582,21 , 1603,55 , 1658,14 , 49,6 , 46,6 , {66,71,78}, 134,3 , 2928,47 , 13,5 , 4,0 , 449,9 , 458,8 , 2, 1, 1, 6, 7 }, // Bulgarian/Cyrillic/Bulgaria
- { 21, 25, 147, 46, 44, 4170, 37, 4160, 45, 43, 101, 8220, 8221, 8216, 8217, 124,6 , 124,6 , 130,11 , 141,9 , 370,8 , 378,18 , 37,5 , 8,10 , 3522,46 , 3568,88 , 3656,24 , 3522,46 , 3568,88 , 3656,24 , 1672,54 , 1672,54 , 1726,14 , 1672,54 , 1672,54 , 1726,14 , 55,5 , 52,3 , {77,77,75}, 137,1 , 2975,27 , 8,5 , 4,0 , 466,3 , 469,6 , 0, 0, 7, 6, 7 }, // Burmese/Myanmar/Myanmar
- { 22, 2, 20, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 150,7 , 150,7 , 114,6 , 10,17 , 159,5 , 164,10 , 3680,48 , 3728,95 , 3823,24 , 3847,48 , 3895,98 , 3823,24 , 1740,21 , 1761,56 , 1817,14 , 1740,21 , 1761,56 , 1817,14 , 60,9 , 55,12 , {66,89,82}, 138,2 , 3002,89 , 13,5 , 4,0 , 475,10 , 485,8 , 0, 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 , 157,9 , 166,9 , 300,6 , 98,16 , 18,7 , 25,12 , 3993,71 , 3993,71 , 158,27 , 3993,71 , 3993,71 , 158,27 , 1831,47 , 1831,47 , 1878,19 , 1831,47 , 1831,47 , 1878,19 , 69,5 , 67,5 , {75,72,82}, 140,1 , 3091,29 , 4,4 , 4,0 , 493,5 , 498,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 , 175,7 , 175,7 , 300,6 , 396,22 , 55,4 , 59,9 , 4064,60 , 4124,82 , 4206,36 , 4064,60 , 4242,115 , 4206,36 , 1897,28 , 1925,60 , 1985,21 , 1897,28 , 1925,60 , 1985,21 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 505,6 , 511,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 , 175,7 , 175,7 , 300,6 , 396,22 , 55,4 , 59,9 , 4064,60 , 4124,82 , 4206,36 , 4064,60 , 4242,115 , 4206,36 , 1897,28 , 1925,60 , 1985,21 , 1897,28 , 1925,60 , 1985,21 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 505,6 , 518,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 , 175,7 , 175,7 , 300,6 , 396,22 , 55,4 , 59,9 , 4064,60 , 4124,82 , 4206,36 , 4064,60 , 4242,115 , 4206,36 , 1897,28 , 1925,60 , 1985,21 , 1897,28 , 1925,60 , 1985,21 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 505,6 , 525,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 , 175,7 , 175,7 , 300,6 , 396,22 , 55,4 , 59,9 , 4064,60 , 4124,82 , 4206,36 , 4064,60 , 4242,115 , 4206,36 , 1897,28 , 1925,60 , 1985,21 , 1897,28 , 1925,60 , 1985,21 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 505,6 , 531,6 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Italy
- { 25, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 182,5 , 182,5 , 187,5 , 187,5 , 418,8 , 426,13 , 174,6 , 180,11 , 4357,39 , 4396,38 , 158,27 , 4357,39 , 4396,38 , 158,27 , 2006,21 , 2027,28 , 2055,14 , 2006,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {67,78,89}, 141,1 , 3140,13 , 4,4 , 4,0 , 537,4 , 541,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, 182,5 , 182,5 , 187,5 , 187,5 , 300,6 , 426,13 , 174,6 , 180,11 , 4357,39 , 4396,38 , 158,27 , 4357,39 , 4396,38 , 158,27 , 2006,21 , 2027,28 , 2055,14 , 2006,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {72,75,68}, 142,3 , 3153,11 , 4,4 , 4,0 , 537,4 , 543,9 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/HongKong
- { 25, 5, 126, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 182,5 , 182,5 , 187,5 , 187,5 , 300,6 , 426,13 , 174,6 , 180,11 , 4357,39 , 4396,38 , 158,27 , 4357,39 , 4396,38 , 158,27 , 2006,21 , 2027,28 , 2055,14 , 2006,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {77,79,80}, 145,4 , 3164,13 , 4,4 , 4,0 , 537,4 , 552,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, 182,5 , 182,5 , 187,5 , 187,5 , 27,8 , 426,13 , 174,6 , 180,11 , 4357,39 , 4396,38 , 158,27 , 4357,39 , 4396,38 , 158,27 , 2006,21 , 2027,28 , 2055,14 , 2006,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {83,71,68}, 6,1 , 3177,15 , 4,4 , 4,0 , 537,4 , 561,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, 182,5 , 182,5 , 192,5 , 192,5 , 439,8 , 426,13 , 174,6 , 191,13 , 4357,39 , 4357,39 , 158,27 , 4357,39 , 4357,39 , 158,27 , 2069,21 , 2027,28 , 2055,14 , 2069,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {72,75,68}, 142,3 , 3153,11 , 18,5 , 4,0 , 564,4 , 568,14 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/HongKong
- { 25, 6, 126, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 182,5 , 182,5 , 192,5 , 192,5 , 439,8 , 426,13 , 174,6 , 191,13 , 4357,39 , 4357,39 , 158,27 , 4357,39 , 4357,39 , 158,27 , 2069,21 , 2027,28 , 2055,14 , 2069,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {77,79,80}, 145,4 , 3192,13 , 18,5 , 4,0 , 564,4 , 582,14 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/Macau
- { 25, 6, 208, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 182,5 , 182,5 , 187,5 , 187,5 , 418,8 , 447,14 , 174,6 , 191,13 , 4357,39 , 4357,39 , 158,27 , 4357,39 , 4357,39 , 158,27 , 2069,21 , 2027,28 , 2055,14 , 2069,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {84,87,68}, 6,1 , 3205,13 , 4,4 , 4,0 , 564,4 , 596,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 175,7 , 175,7 , 461,11 , 472,19 , 37,5 , 8,10 , 4434,49 , 4483,94 , 4577,39 , 4434,49 , 4616,98 , 4577,39 , 2090,28 , 2118,58 , 2176,14 , 2090,28 , 2118,58 , 2190,14 , 0,2 , 0,2 , {72,82,75}, 149,3 , 3218,60 , 13,5 , 4,0 , 598,8 , 606,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 , 175,7 , 175,7 , 461,11 , 472,19 , 37,5 , 8,10 , 4434,49 , 4483,94 , 4577,39 , 4434,49 , 4616,98 , 4577,39 , 2090,28 , 2118,58 , 2176,14 , 2090,28 , 2118,58 , 2190,14 , 0,2 , 0,2 , {66,65,77}, 152,2 , 3278,85 , 13,5 , 4,0 , 598,8 , 614,19 , 2, 1, 1, 6, 7 }, // Croatian/Latin/BosniaAndHerzegowina
- { 28, 7, 57, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 197,7 , 197,7 , 175,8 , 491,17 , 55,4 , 59,9 , 4714,48 , 4762,82 , 158,27 , 4714,48 , 4844,84 , 158,27 , 2204,21 , 2225,49 , 2274,14 , 2204,21 , 2225,49 , 2274,14 , 81,4 , 79,4 , {67,90,75}, 154,2 , 3363,68 , 13,5 , 4,0 , 633,7 , 640,15 , 2, 0, 1, 6, 7 }, // Czech/Latin/CzechRepublic
- { 29, 7, 58, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 204,8 , 204,8 , 120,10 , 508,23 , 159,5 , 164,10 , 4928,48 , 4976,84 , 134,24 , 5060,59 , 4976,84 , 134,24 , 2288,28 , 2316,51 , 2367,14 , 2381,35 , 2316,51 , 2367,14 , 0,2 , 0,2 , {68,75,75}, 156,3 , 3431,42 , 13,5 , 4,0 , 655,5 , 660,7 , 2, 1, 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 , 204,8 , 204,8 , 120,10 , 508,23 , 204,7 , 86,12 , 4928,48 , 4976,84 , 134,24 , 5060,59 , 4976,84 , 134,24 , 2288,28 , 2316,51 , 2367,14 , 2381,35 , 2316,51 , 2367,14 , 0,2 , 0,2 , {68,75,75}, 156,3 , 3431,42 , 13,5 , 4,0 , 655,5 , 667,8 , 2, 1, 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 , 370,8 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {69,85,82}, 14,1 , 3473,19 , 8,5 , 23,6 , 675,10 , 685,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 , 370,8 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {65,87,71}, 159,4 , 3492,55 , 8,5 , 23,6 , 675,10 , 694,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 , 531,7 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {69,85,82}, 14,1 , 3473,19 , 13,5 , 4,0 , 699,6 , 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 , 370,8 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {65,78,71}, 163,4 , 3547,97 , 8,5 , 23,6 , 675,10 , 711,7 , 2, 1, 1, 6, 7 }, // Dutch/Latin/CuraSao
- { 30, 7, 202, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 370,8 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {83,82,68}, 6,1 , 3644,58 , 8,5 , 23,6 , 675,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 , 370,8 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {85,83,68}, 6,1 , 3702,61 , 8,5 , 23,6 , 675,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 , 370,8 , 98,16 , 37,5 , 8,10 , 5119,59 , 5178,88 , 134,24 , 5119,59 , 5178,88 , 134,24 , 2416,21 , 2437,59 , 2496,14 , 2416,21 , 2437,59 , 2496,14 , 85,4 , 83,4 , {65,78,71}, 163,4 , 3547,97 , 8,5 , 23,6 , 675,10 , 745,12 , 2, 1, 1, 6, 7 }, // Dutch/Latin/SintMaarten
- { 31, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 757,16 , 773,13 , 2, 1, 7, 6, 7 }, // English/Latin/UnitedStates
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {85,83,68}, 167,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // English/Deseret/UnitedStates
- { 31, 7, 4, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 786,7 , 793,14 , 2, 1, 7, 6, 7 }, // English/Latin/AmericanSamoa
- { 31, 7, 7, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {88,67,68}, 6,1 , 3798,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 , 212,10 , 222,9 , 120,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 , {88,67,68}, 6,1 , 3798,71 , 4,4 , 4,0 , 786,7 , 815,17 , 2, 1, 7, 6, 7 }, // English/Latin/AntiguaAndBarbuda
- { 31, 7, 13, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 222,9 , 222,9 , 300,6 , 10,17 , 18,7 , 25,12 , 5266,59 , 48,86 , 5266,59 , 5266,59 , 48,86 , 5266,59 , 2510,35 , 28,57 , 2545,25 , 2510,35 , 28,57 , 2545,25 , 89,2 , 87,2 , {65,85,68}, 6,1 , 3869,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 120,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 , {66,83,68}, 6,1 , 3948,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 , 212,10 , 222,9 , 120,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 , {66,66,68}, 6,1 , 4001,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 , 212,10 , 222,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 27,8 , 80,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 , {66,90,68}, 6,1 , 4057,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 , 212,10 , 222,9 , 120,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 , {66,77,68}, 6,1 , 4104,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 , 212,10 , 222,9 , 27,8 , 80,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 , {66,87,80}, 170,1 , 4157,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {85,83,68}, 167,3 , 3763,35 , 4,4 , 4,0 , 786,7 , 909,30 , 2, 1, 1, 6, 7 }, // English/Latin/BritishIndianOceanTerritory
- { 31, 7, 35, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 538,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 , {66,73,70}, 171,3 , 4207,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {88,65,70}, 32,4 , 4260,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 , 212,10 , 222,9 , 53,10 , 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 , {67,65,68}, 6,1 , 4343,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 , 212,10 , 222,9 , 120,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 , {75,89,68}, 6,1 , 4396,71 , 4,4 , 4,0 , 786,7 , 976,14 , 2, 1, 1, 6, 7 }, // English/Latin/CaymanIslands
- { 31, 7, 45, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {65,85,68}, 6,1 , 3869,59 , 4,4 , 4,0 , 786,7 , 990,16 , 2, 1, 1, 6, 7 }, // English/Latin/ChristmasIsland
- { 31, 7, 46, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {65,85,68}, 6,1 , 3869,59 , 4,4 , 4,0 , 786,7 , 1006,23 , 2, 1, 1, 6, 7 }, // English/Latin/CocosIslands
- { 31, 7, 51, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {78,90,68}, 6,1 , 4467,62 , 4,4 , 4,0 , 786,7 , 1029,12 , 2, 1, 1, 6, 7 }, // English/Latin/CookIslands
- { 31, 7, 56, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 120,10 , 10,17 , 159,5 , 164,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 , {68,75,75}, 156,3 , 4529,44 , 13,5 , 4,0 , 786,7 , 1047,7 , 2, 1, 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 , 212,10 , 222,9 , 120,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 , {88,67,68}, 6,1 , 3798,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 , 212,10 , 222,9 , 120,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 , {69,82,78}, 46,3 , 4573,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {70,75,80}, 125,1 , 4623,74 , 4,4 , 4,0 , 786,7 , 1069,16 , 2, 1, 1, 6, 7 }, // English/Latin/FalklandIslands
- { 31, 7, 72, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {70,74,68}, 6,1 , 4697,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 , 212,10 , 222,9 , 120,10 , 10,17 , 211,4 , 215,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {71,66,80}, 125,1 , 4744,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 , 212,10 , 222,9 , 120,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 , {71,77,68}, 174,1 , 4776,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 120,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 , {71,72,83}, 175,3 , 4826,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {71,73,80}, 125,1 , 4873,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 , 212,10 , 222,9 , 120,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 , {88,67,68}, 6,1 , 3798,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 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,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 , 212,10 , 222,9 , 120,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 , {71,89,68}, 6,1 , 4926,56 , 4,4 , 4,0 , 786,7 , 1142,6 , 0, 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 , 212,10 , 222,9 , 439,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 , 0,2 , 0,2 , {72,75,68}, 142,3 , 4982,56 , 4,4 , 4,0 , 786,7 , 1148,19 , 2, 1, 7, 6, 7 }, // English/Latin/HongKong
- { 31, 7, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 27,8 , 98,16 , 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 , {73,78,82}, 127,1 , 5038,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 , 212,10 , 222,9 , 120,10 , 98,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 , 85,4 , 83,4 , {69,85,82}, 14,1 , 3928,20 , 4,4 , 4,0 , 786,7 , 1172,7 , 2, 1, 7, 6, 7 }, // English/Latin/Ireland
- { 31, 7, 105, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {73,76,83}, 54,1 , 5082,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 , 212,10 , 222,9 , 300,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 , 0,2 , 0,2 , {74,77,68}, 6,1 , 5144,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {75,69,83}, 2,3 , 5197,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 , 212,10 , 222,9 , 120,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 , {65,85,68}, 6,1 , 3869,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 , 212,10 , 222,9 , 120,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 , {90,65,82}, 5,1 , 5250,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 , 212,10 , 222,9 , 120,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 , {76,82,68}, 6,1 , 5311,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 , 212,10 , 222,9 , 120,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 , {77,79,80}, 145,4 , 5364,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {77,71,65}, 178,2 , 5417,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 , 212,10 , 222,9 , 120,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 , {77,87,75}, 180,2 , 5471,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 , 212,10 , 222,9 , 120,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 , {77,89,82}, 182,2 , 5524,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 786,7 , 1263,16 , 2, 1, 7, 6, 7 }, // English/Latin/MarshallIslands
- { 31, 7, 137, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {77,85,82}, 184,2 , 5583,53 , 4,4 , 4,0 , 786,7 , 1279,9 , 0, 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 , 212,10 , 222,9 , 120,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 , {85,83,68}, 167,3 , 3763,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {88,67,68}, 6,1 , 3798,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 , 212,10 , 222,9 , 120,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 , {78,65,68}, 6,1 , 5636,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {65,85,68}, 6,1 , 3869,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 531,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 , 0,2 , 0,2 , {78,90,68}, 6,1 , 4467,62 , 4,4 , 4,0 , 786,7 , 1331,11 , 2, 1, 7, 6, 7 }, // English/Latin/NewZealand
- { 31, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {78,71,78}, 186,1 , 5689,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {78,90,68}, 6,1 , 4467,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {65,85,68}, 6,1 , 3869,59 , 4,4 , 4,0 , 786,7 , 1353,14 , 2, 1, 1, 6, 7 }, // English/Latin/NorfolkIsland
- { 31, 7, 160, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 786,7 , 1367,24 , 2, 1, 1, 6, 7 }, // English/Latin/NorthernMarianaIslands
- { 31, 7, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {80,75,82}, 184,2 , 5739,53 , 4,4 , 4,0 , 786,7 , 1391,8 , 0, 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 , 212,10 , 222,9 , 120,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 , {85,83,68}, 167,3 , 3763,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 , 212,10 , 222,9 , 120,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 , {80,71,75}, 137,1 , 5792,73 , 4,4 , 4,0 , 786,7 , 1404,16 , 2, 1, 1, 6, 7 }, // English/Latin/PapuaNewGuinea
- { 31, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {80,72,80}, 187,1 , 5865,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {78,90,68}, 6,1 , 4467,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 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 786,7 , 1447,11 , 2, 1, 7, 6, 7 }, // English/Latin/PuertoRico
- { 31, 7, 179, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {82,87,70}, 188,2 , 5918,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 , 212,10 , 222,9 , 120,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 , {88,67,68}, 6,1 , 3798,71 , 4,4 , 4,0 , 786,7 , 1464,17 , 2, 1, 1, 6, 7 }, // English/Latin/SaintKittsAndNevis
- { 31, 7, 181, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {88,67,68}, 6,1 , 3798,71 , 4,4 , 4,0 , 786,7 , 1481,9 , 2, 1, 1, 6, 7 }, // English/Latin/SaintLucia
- { 31, 7, 182, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {88,67,68}, 6,1 , 3798,71 , 4,4 , 4,0 , 786,7 , 1490,24 , 2, 1, 1, 6, 7 }, // English/Latin/SaintVincentAndTheGrenadines
- { 31, 7, 183, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {87,83,84}, 190,3 , 5965,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {83,67,82}, 193,2 , 6005,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 , 212,10 , 222,9 , 120,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 , {83,76,76}, 195,2 , 6064,68 , 4,4 , 4,0 , 786,7 , 1529,12 , 0, 0, 1, 6, 7 }, // English/Latin/SierraLeone
- { 31, 7, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 300,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 , 0,2 , 0,2 , {83,71,68}, 6,1 , 6132,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3928,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 , 212,10 , 222,9 , 120,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 , {83,66,68}, 6,1 , 6188,74 , 4,4 , 4,0 , 786,7 , 1558,15 , 2, 1, 1, 6, 7 }, // English/Latin/SolomonIslands
- { 31, 7, 195, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 264,10 , 80,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 , {90,65,82}, 5,1 , 5250,61 , 4,4 , 4,0 , 786,7 , 1573,12 , 2, 1, 7, 6, 7 }, // English/Latin/SouthAfrica
- { 31, 7, 199, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {83,72,80}, 125,1 , 6262,56 , 4,4 , 4,0 , 786,7 , 1585,10 , 2, 1, 1, 6, 7 }, // English/Latin/SaintHelena
- { 31, 7, 201, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {83,68,71}, 0,0 , 6318,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 , 212,10 , 222,9 , 120,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 , {83,90,76}, 197,1 , 6368,53 , 4,4 , 4,0 , 786,7 , 1600,9 , 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 , 212,10 , 222,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 , 0,2 , 0,2 , {83,69,75}, 198,2 , 6421,47 , 13,5 , 4,0 , 786,7 , 1609,6 , 2, 1, 1, 6, 7 }, // English/Latin/Sweden
- { 31, 7, 206, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {67,72,70}, 0,0 , 6468,41 , 8,5 , 36,5 , 786,7 , 1615,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {84,90,83}, 200,3 , 6509,62 , 4,4 , 4,0 , 786,7 , 1626,8 , 0, 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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {78,90,68}, 6,1 , 4467,62 , 4,4 , 4,0 , 786,7 , 1634,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 , 212,10 , 222,9 , 120,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 , {84,79,80}, 203,2 , 6571,49 , 4,4 , 4,0 , 786,7 , 1641,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 , 212,10 , 222,9 , 120,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 , {84,84,68}, 6,1 , 6620,80 , 4,4 , 4,0 , 786,7 , 1646,17 , 2, 1, 7, 6, 7 }, // English/Latin/TrinidadAndTobago
- { 31, 7, 219, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {85,83,68}, 167,3 , 3763,35 , 4,4 , 4,0 , 786,7 , 1663,22 , 2, 1, 1, 6, 7 }, // English/Latin/TurksAndCaicosIslands
- { 31, 7, 220, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {65,85,68}, 6,1 , 3869,59 , 4,4 , 4,0 , 786,7 , 1685,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {85,71,88}, 205,3 , 6700,56 , 4,4 , 4,0 , 786,7 , 1691,6 , 0, 0, 1, 6, 7 }, // English/Latin/Uganda
- { 31, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 222,9 , 222,9 , 120,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 , 89,2 , 87,2 , {71,66,80}, 125,1 , 6756,47 , 4,4 , 4,0 , 1697,15 , 1712,14 , 2, 1, 1, 6, 7 }, // English/Latin/UnitedKingdom
- { 31, 7, 226, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 786,7 , 1726,21 , 2, 1, 7, 6, 7 }, // English/Latin/UnitedStatesMinorOutlyingIslands
- { 31, 7, 229, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {86,85,86}, 208,2 , 6803,44 , 4,4 , 4,0 , 786,7 , 1747,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 , 212,10 , 222,9 , 120,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 , {85,83,68}, 167,3 , 3763,35 , 4,4 , 4,0 , 786,7 , 1754,22 , 2, 1, 1, 6, 7 }, // English/Latin/BritishVirginIslands
- { 31, 7, 234, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 538,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 , {85,83,68}, 6,1 , 3763,35 , 4,4 , 4,0 , 786,7 , 1776,19 , 2, 1, 7, 6, 7 }, // English/Latin/UnitedStatesVirginIslands
- { 31, 7, 239, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , {90,77,87}, 137,1 , 6847,50 , 4,4 , 4,0 , 786,7 , 1795,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 , 212,10 , 222,9 , 439,8 , 80,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 , {85,83,68}, 167,3 , 3763,35 , 4,4 , 4,0 , 786,7 , 1801,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 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {85,83,68}, 167,3 , 3763,35 , 4,4 , 4,0 , 786,7 , 1809,12 , 2, 1, 1, 6, 7 }, // English/Latin/DiegoGarcia
- { 31, 7, 251, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {71,66,80}, 125,1 , 4744,32 , 4,4 , 4,0 , 786,7 , 1821,11 , 2, 1, 1, 6, 7 }, // English/Latin/IsleOfMan
- { 31, 7, 252, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {71,66,80}, 125,1 , 4744,32 , 4,4 , 4,0 , 786,7 , 1832,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 , 212,10 , 222,9 , 120,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 , {83,83,80}, 125,1 , 6897,68 , 4,4 , 4,0 , 786,7 , 1838,11 , 2, 1, 1, 6, 7 }, // English/Latin/SouthSudan
- { 31, 7, 256, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 212,10 , 222,9 , 120,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 , 0,2 , 0,2 , {65,78,71}, 163,4 , 6965,95 , 4,4 , 4,0 , 786,7 , 1849,12 , 2, 1, 1, 6, 7 }, // English/Latin/SintMaarten
- { 33, 7, 68, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 231,8 , 231,8 , 175,8 , 544,18 , 55,4 , 224,9 , 5325,59 , 5384,91 , 5475,24 , 5325,59 , 5384,91 , 5475,24 , 2570,14 , 2584,63 , 2570,14 , 2570,14 , 2584,63 , 2570,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 7060,20 , 13,5 , 4,0 , 1861,5 , 1866,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 , 204,8 , 204,8 , 175,8 , 544,18 , 37,5 , 8,10 , 5499,48 , 5547,83 , 134,24 , 5630,59 , 5547,83 , 134,24 , 2647,28 , 2675,74 , 2749,14 , 2763,35 , 2675,74 , 2749,14 , 0,2 , 0,2 , {68,75,75}, 198,2 , 7080,43 , 13,5 , 4,0 , 1871,8 , 1879,7 , 2, 1, 1, 6, 7 }, // Faroese/Latin/FaroeIslands
- { 34, 7, 58, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 204,8 , 204,8 , 175,8 , 544,18 , 37,5 , 8,10 , 5499,48 , 5547,83 , 134,24 , 5630,59 , 5547,83 , 134,24 , 2647,28 , 2675,74 , 2749,14 , 2763,35 , 2675,74 , 2749,14 , 0,2 , 0,2 , {68,75,75}, 156,3 , 7080,43 , 13,5 , 4,0 , 1871,8 , 660,7 , 2, 1, 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 , 231,8 , 231,8 , 562,8 , 491,17 , 211,4 , 215,9 , 5689,69 , 5758,105 , 5863,24 , 5887,129 , 5887,129 , 5863,24 , 2798,21 , 2819,67 , 2886,14 , 2798,21 , 2900,81 , 2886,14 , 91,3 , 89,3 , {69,85,82}, 14,1 , 7123,20 , 13,5 , 4,0 , 1886,5 , 1891,5 , 2, 1, 1, 6, 7 }, // Finnish/Latin/Finland
- { 37, 7, 74, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 1904,6 , 2, 1, 1, 6, 7 }, // French/Latin/France
- { 37, 7, 3, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {68,90,68}, 210,2 , 7143,51 , 13,5 , 4,0 , 1896,8 , 1910,7 , 2, 1, 6, 5, 6 }, // French/Latin/Algeria
- { 37, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 531,7 , 98,16 , 37,5 , 233,23 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 1917,8 , 2, 1, 1, 6, 7 }, // French/Latin/Belgium
- { 37, 7, 23, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 1925,5 , 0, 0, 1, 6, 7 }, // French/Latin/Benin
- { 37, 7, 34, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 1930,12 , 0, 0, 1, 6, 7 }, // French/Latin/BurkinaFaso
- { 37, 7, 35, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {66,73,70}, 171,3 , 7253,53 , 13,5 , 4,0 , 1896,8 , 939,7 , 0, 0, 1, 6, 7 }, // French/Latin/Burundi
- { 37, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,65,70}, 32,4 , 7306,56 , 13,5 , 4,0 , 1896,8 , 1942,8 , 0, 0, 1, 6, 7 }, // French/Latin/Cameroon
- { 37, 7, 38, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 570,8 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {67,65,68}, 6,1 , 7362,54 , 41,8 , 4,0 , 1950,17 , 970,6 , 2, 0, 7, 6, 7 }, // French/Latin/Canada
- { 37, 7, 41, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,65,70}, 32,4 , 7306,56 , 13,5 , 4,0 , 1896,8 , 1967,25 , 0, 0, 1, 6, 7 }, // French/Latin/CentralAfricanRepublic
- { 37, 7, 42, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,65,70}, 32,4 , 7306,56 , 13,5 , 4,0 , 1896,8 , 1992,5 , 0, 0, 1, 6, 7 }, // French/Latin/Chad
- { 37, 7, 48, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {75,77,70}, 215,2 , 7416,51 , 13,5 , 4,0 , 1896,8 , 1997,7 , 0, 0, 1, 6, 7 }, // French/Latin/Comoros
- { 37, 7, 49, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {67,68,70}, 217,2 , 7467,53 , 13,5 , 4,0 , 1896,8 , 2004,14 , 2, 1, 1, 6, 7 }, // French/Latin/CongoKinshasa
- { 37, 7, 50, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,65,70}, 32,4 , 7306,56 , 13,5 , 4,0 , 1896,8 , 2018,17 , 0, 0, 1, 6, 7 }, // French/Latin/CongoBrazzaville
- { 37, 7, 53, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 2035,13 , 0, 0, 1, 6, 7 }, // French/Latin/IvoryCoast
- { 37, 7, 59, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {68,74,70}, 43,3 , 7520,57 , 13,5 , 4,0 , 1896,8 , 2048,8 , 0, 0, 6, 6, 7 }, // French/Latin/Djibouti
- { 37, 7, 66, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,65,70}, 32,4 , 7306,56 , 13,5 , 4,0 , 1896,8 , 2056,18 , 0, 0, 1, 6, 7 }, // French/Latin/EquatorialGuinea
- { 37, 7, 76, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2074,16 , 2, 1, 1, 6, 7 }, // French/Latin/FrenchGuiana
- { 37, 7, 77, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,80,70}, 219,4 , 7577,35 , 13,5 , 4,0 , 1896,8 , 2090,19 , 0, 0, 1, 6, 7 }, // French/Latin/FrenchPolynesia
- { 37, 7, 79, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,65,70}, 32,4 , 7306,56 , 13,5 , 4,0 , 1896,8 , 2109,5 , 0, 0, 1, 6, 7 }, // French/Latin/Gabon
- { 37, 7, 88, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2114,10 , 2, 1, 1, 6, 7 }, // French/Latin/Guadeloupe
- { 37, 7, 91, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {71,78,70}, 223,2 , 7612,48 , 13,5 , 4,0 , 1896,8 , 2124,6 , 0, 0, 1, 6, 7 }, // French/Latin/Guinea
- { 37, 7, 94, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {72,84,71}, 225,1 , 7660,57 , 13,5 , 4,0 , 1896,8 , 2130,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 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2135,10 , 2, 1, 1, 6, 7 }, // French/Latin/Luxembourg
- { 37, 7, 128, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {77,71,65}, 178,2 , 7717,54 , 13,5 , 4,0 , 1896,8 , 1234,10 , 0, 0, 1, 6, 7 }, // French/Latin/Madagascar
- { 37, 7, 132, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 2145,4 , 0, 0, 1, 6, 7 }, // French/Latin/Mali
- { 37, 7, 135, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2149,10 , 2, 1, 1, 6, 7 }, // French/Latin/Martinique
- { 37, 7, 136, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {77,82,79}, 226,2 , 7771,66 , 13,5 , 4,0 , 1896,8 , 2159,10 , 0, 0, 1, 6, 7 }, // French/Latin/Mauritania
- { 37, 7, 137, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {77,85,82}, 184,2 , 7837,63 , 13,5 , 4,0 , 1896,8 , 2169,7 , 0, 0, 1, 6, 7 }, // French/Latin/Mauritius
- { 37, 7, 138, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2176,7 , 2, 1, 1, 6, 7 }, // French/Latin/Mayotte
- { 37, 7, 142, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2183,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 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6164,61 , 6079,85 , 134,24 , 6164,61 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 85,4 , 83,4 , {77,65,68}, 228,3 , 7900,54 , 13,5 , 4,0 , 1896,8 , 2189,5 , 2, 1, 6, 5, 6 }, // French/Latin/Morocco
- { 37, 7, 153, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,80,70}, 219,4 , 7577,35 , 13,5 , 4,0 , 1896,8 , 2194,18 , 0, 0, 1, 6, 7 }, // French/Latin/NewCaledonia
- { 37, 7, 156, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 2212,5 , 0, 0, 1, 6, 7 }, // French/Latin/Niger
- { 37, 7, 176, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2217,10 , 2, 1, 1, 6, 7 }, // French/Latin/Reunion
- { 37, 7, 179, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {82,87,70}, 188,2 , 7954,50 , 13,5 , 4,0 , 1896,8 , 1458,6 , 0, 0, 1, 6, 7 }, // French/Latin/Rwanda
- { 37, 7, 187, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 2227,7 , 0, 0, 1, 6, 7 }, // French/Latin/Senegal
- { 37, 7, 188, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {83,67,82}, 193,2 , 8004,71 , 13,5 , 4,0 , 1896,8 , 1519,10 , 2, 1, 1, 6, 7 }, // French/Latin/Seychelles
- { 37, 7, 200, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2234,24 , 2, 1, 1, 6, 7 }, // French/Latin/SaintPierreAndMiquelon
- { 37, 7, 206, 46, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 239,8 , 239,8 , 175,8 , 10,17 , 37,5 , 256,14 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {67,72,70}, 231,3 , 8075,45 , 8,5 , 36,5 , 2258,15 , 2273,6 , 2, 0, 1, 6, 7 }, // French/Latin/Switzerland
- { 37, 7, 207, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {83,89,80}, 234,2 , 8120,51 , 13,5 , 4,0 , 1896,8 , 2279,5 , 0, 0, 6, 5, 6 }, // French/Latin/Syria
- { 37, 7, 212, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 7194,59 , 13,5 , 4,0 , 1896,8 , 2284,4 , 0, 0, 1, 6, 7 }, // French/Latin/Togo
- { 37, 7, 216, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {84,78,68}, 236,2 , 8171,51 , 13,5 , 4,0 , 1896,8 , 2288,7 , 3, 0, 7, 5, 6 }, // French/Latin/Tunisia
- { 37, 7, 229, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {86,85,86}, 208,2 , 8222,51 , 13,5 , 4,0 , 1896,8 , 1747,7 , 0, 0, 1, 6, 7 }, // French/Latin/Vanuatu
- { 37, 7, 235, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {88,80,70}, 219,4 , 7577,35 , 13,5 , 4,0 , 1896,8 , 2295,16 , 0, 0, 1, 6, 7 }, // French/Latin/WallisAndFutunaIslands
- { 37, 7, 244, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2311,16 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Barthelemy
- { 37, 7, 245, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 239,8 , 239,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6016,63 , 6079,85 , 134,24 , 6016,63 , 6079,85 , 134,24 , 2981,35 , 3016,52 , 3068,14 , 2981,35 , 3016,52 , 3068,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 1896,8 , 2327,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 , 370,8 , 98,16 , 37,5 , 8,10 , 6225,48 , 6273,95 , 134,24 , 6368,60 , 6273,95 , 134,24 , 3082,21 , 3103,54 , 2496,14 , 3082,21 , 3103,54 , 2496,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 3473,19 , 8,5 , 49,6 , 2339,10 , 2349,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 , 247,10 , 247,10 , 120,10 , 578,21 , 37,5 , 8,10 , 6428,61 , 6489,142 , 6631,24 , 6428,61 , 6655,167 , 6631,24 , 3157,28 , 3185,69 , 3254,14 , 3157,28 , 3185,69 , 3254,14 , 94,1 , 92,1 , {71,66,80}, 125,1 , 8273,86 , 4,4 , 4,0 , 2357,8 , 2365,22 , 2, 1, 1, 6, 7 }, // Gaelic/Latin/UnitedKingdom
- { 40, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 599,17 , 37,5 , 8,10 , 6822,48 , 6870,87 , 6957,24 , 6981,48 , 7029,87 , 6957,24 , 3268,28 , 3296,49 , 3345,14 , 3359,29 , 3388,49 , 3345,14 , 85,4 , 83,4 , {69,85,82}, 14,1 , 3928,20 , 13,5 , 4,0 , 2387,6 , 2393,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 , 264,8 , 264,8 , 175,8 , 616,19 , 37,5 , 8,10 , 7116,48 , 7164,99 , 7263,24 , 7116,48 , 7164,99 , 7263,24 , 3437,28 , 3465,62 , 3527,14 , 3437,28 , 3465,62 , 3527,14 , 0,2 , 0,2 , {71,69,76}, 238,1 , 8359,43 , 13,5 , 4,0 , 2399,7 , 2406,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 7335,83 , 134,24 , 7418,59 , 7335,83 , 134,24 , 3541,21 , 3562,60 , 3622,14 , 3636,28 , 3562,60 , 3622,14 , 95,5 , 93,6 , {69,85,82}, 14,1 , 8402,19 , 13,5 , 4,0 , 2416,7 , 2423,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7477,48 , 7525,83 , 134,24 , 7608,59 , 7525,83 , 134,24 , 3541,21 , 3562,60 , 3622,14 , 3636,28 , 3562,60 , 3622,14 , 95,5 , 93,6 , {69,85,82}, 14,1 , 8402,19 , 8,5 , 4,0 , 2434,24 , 2458,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 7335,83 , 134,24 , 7418,59 , 7335,83 , 134,24 , 3541,21 , 3562,60 , 3622,14 , 3636,28 , 3562,60 , 3622,14 , 95,5 , 93,6 , {69,85,82}, 14,1 , 8402,19 , 13,5 , 4,0 , 2416,7 , 2468,7 , 2, 1, 1, 6, 7 }, // German/Latin/Belgium
- { 42, 7, 123, 46, 39, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 7335,83 , 134,24 , 7418,59 , 7335,83 , 134,24 , 3541,21 , 3562,60 , 3622,14 , 3636,28 , 3562,60 , 3622,14 , 95,5 , 93,6 , {67,72,70}, 231,3 , 8421,58 , 8,5 , 4,0 , 2416,7 , 2475,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 7335,83 , 134,24 , 7418,59 , 7335,83 , 134,24 , 3541,21 , 3562,60 , 3622,14 , 3636,28 , 3562,60 , 3622,14 , 95,5 , 93,6 , {69,85,82}, 14,1 , 8402,19 , 13,5 , 4,0 , 2416,7 , 2488,9 , 2, 1, 1, 6, 7 }, // German/Latin/Luxembourg
- { 42, 7, 206, 46, 39, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 7335,83 , 134,24 , 7418,59 , 7335,83 , 134,24 , 3541,21 , 3562,60 , 3622,14 , 3636,28 , 3562,60 , 3622,14 , 95,5 , 93,6 , {67,72,70}, 231,3 , 8421,58 , 8,5 , 36,5 , 2497,21 , 2518,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 , 281,9 , 281,9 , 300,6 , 10,17 , 18,7 , 25,12 , 7667,50 , 7717,115 , 7832,24 , 7856,50 , 7906,115 , 7832,24 , 3664,28 , 3692,55 , 3747,14 , 3664,28 , 3692,55 , 3747,14 , 100,4 , 99,4 , {69,85,82}, 14,1 , 8479,19 , 13,5 , 4,0 , 2525,8 , 2533,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 , 281,9 , 281,9 , 300,6 , 10,17 , 18,7 , 25,12 , 7667,50 , 7717,115 , 7832,24 , 7856,50 , 7906,115 , 7832,24 , 3664,28 , 3692,55 , 3747,14 , 3664,28 , 3692,55 , 3747,14 , 100,4 , 99,4 , {69,85,82}, 14,1 , 8479,19 , 13,5 , 4,0 , 2525,8 , 2539,6 , 2, 1, 1, 6, 7 }, // Greek/Greek/Cyprus
- { 44, 7, 86, 44, 46, 59, 37, 48, 45, 43, 101, 187, 171, 8250, 8249, 0,6 , 0,6 , 290,11 , 290,11 , 53,10 , 599,17 , 18,7 , 25,12 , 4928,48 , 8021,96 , 134,24 , 4928,48 , 8021,96 , 134,24 , 3761,28 , 3789,98 , 3887,14 , 3761,28 , 3789,98 , 3887,14 , 0,2 , 0,2 , {68,75,75}, 156,3 , 8498,62 , 4,4 , 36,5 , 2545,11 , 2556,16 , 2, 1, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {80,89,71}, 239,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 , 301,9 , 301,9 , 300,6 , 210,18 , 270,8 , 278,13 , 8117,67 , 8184,87 , 8271,31 , 8117,67 , 8184,87 , 8271,31 , 3901,32 , 3933,53 , 3986,19 , 3901,32 , 3933,53 , 3986,19 , 0,2 , 0,2 , {73,78,82}, 127,1 , 8560,46 , 4,4 , 4,0 , 2572,7 , 2579,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 , 0,6 , 0,6 , 300,6 , 210,18 , 18,7 , 25,12 , 8302,48 , 8350,85 , 8435,24 , 8302,48 , 8350,85 , 8435,24 , 4005,21 , 4026,52 , 4078,14 , 4005,21 , 4026,52 , 4078,14 , 0,2 , 0,2 , {78,71,78}, 186,1 , 8606,12 , 8,5 , 4,0 , 2583,5 , 2588,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {78,71,78}, 186,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 , 0,6 , 0,6 , 300,6 , 210,18 , 18,7 , 25,12 , 8302,48 , 8350,85 , 8435,24 , 8302,48 , 8350,85 , 8435,24 , 4005,21 , 4026,52 , 4078,14 , 4005,21 , 4026,52 , 4078,14 , 0,2 , 0,2 , {71,72,83}, 175,3 , 0,7 , 8,5 , 4,0 , 2583,5 , 2596,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 , 0,6 , 0,6 , 300,6 , 210,18 , 37,5 , 8,10 , 8302,48 , 8350,85 , 8435,24 , 8302,48 , 8350,85 , 8435,24 , 4005,21 , 4026,52 , 4078,14 , 4005,21 , 4026,52 , 4078,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 8618,36 , 8,5 , 4,0 , 2583,5 , 2600,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 , 562,8 , 635,18 , 55,4 , 59,9 , 8459,58 , 8517,72 , 158,27 , 8459,58 , 8517,72 , 158,27 , 4092,46 , 4138,65 , 4203,21 , 4092,46 , 4138,65 , 4203,21 , 104,6 , 103,5 , {73,76,83}, 54,1 , 8654,54 , 13,5 , 4,0 , 2605,5 , 2610,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 , 300,6 , 10,17 , 18,7 , 25,12 , 8589,59 , 8648,73 , 8721,30 , 8589,59 , 8648,73 , 8721,30 , 4224,32 , 4256,53 , 4309,19 , 4224,32 , 4256,53 , 4309,19 , 110,9 , 108,7 , {73,78,82}, 127,1 , 8708,42 , 4,4 , 4,0 , 2615,6 , 2621,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 , 653,13 , 666,19 , 55,4 , 59,9 , 8751,64 , 8815,98 , 8913,25 , 8751,64 , 8815,98 , 8913,25 , 4328,19 , 4347,52 , 4399,17 , 4328,19 , 4347,52 , 4399,17 , 119,3 , 115,3 , {72,85,70}, 240,2 , 8750,46 , 13,5 , 4,0 , 2625,6 , 2631,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 , 204,8 , 204,8 , 562,8 , 544,18 , 37,5 , 8,10 , 8938,59 , 8997,82 , 9079,24 , 8938,59 , 8997,82 , 9079,24 , 4416,35 , 4451,81 , 4532,14 , 4416,35 , 4451,81 , 4532,14 , 122,4 , 118,4 , {73,83,75}, 242,3 , 8796,49 , 13,5 , 4,0 , 2643,8 , 2651,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 , 80,18 , 159,5 , 164,10 , 9103,48 , 9151,87 , 134,24 , 9103,48 , 9151,87 , 134,24 , 4546,28 , 4574,43 , 4617,14 , 4546,28 , 4574,43 , 4617,14 , 0,2 , 0,2 , {73,68,82}, 245,2 , 8845,39 , 4,4 , 4,0 , 2657,9 , 2657,9 , 0, 0, 7, 6, 7 }, // Indonesian/Latin/Indonesia
- { 53, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Interlingua/Latin/France
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {67,65,68}, 247,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Inuktitut/CanadianAboriginal/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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {67,65,68}, 247,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 , 247,10 , 120,10 , 98,16 , 37,5 , 8,10 , 9238,62 , 9300,107 , 9407,24 , 9238,62 , 9300,107 , 9407,24 , 4631,37 , 4668,75 , 4743,14 , 4631,37 , 4668,75 , 4743,14 , 85,4 , 83,4 , {69,85,82}, 14,1 , 8884,31 , 4,4 , 4,0 , 2666,7 , 2673,4 , 2, 1, 7, 6, 7 }, // Irish/Latin/Ireland
- { 58, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 98,16 , 37,5 , 8,10 , 9431,48 , 9479,94 , 9573,24 , 9431,48 , 9597,94 , 9573,24 , 4757,28 , 4785,57 , 4842,14 , 4757,28 , 4856,57 , 4842,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 8915,19 , 13,5 , 4,0 , 2677,8 , 2685,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 , 257,7 , 257,7 , 27,8 , 98,16 , 37,5 , 8,10 , 9431,48 , 9479,94 , 9573,24 , 9431,48 , 9597,94 , 9573,24 , 4757,28 , 4785,57 , 4842,14 , 4757,28 , 4856,57 , 4842,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 8915,19 , 13,5 , 4,0 , 2677,8 , 2691,10 , 2, 1, 1, 6, 7 }, // Italian/Latin/SanMarino
- { 58, 7, 206, 46, 39, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 257,7 , 257,7 , 175,8 , 10,17 , 37,5 , 8,10 , 9431,48 , 9597,94 , 9573,24 , 9431,48 , 9597,94 , 9573,24 , 4757,28 , 4785,57 , 4842,14 , 4757,28 , 4856,57 , 4842,14 , 0,2 , 0,2 , {67,72,70}, 231,3 , 8934,53 , 8,5 , 36,5 , 2677,8 , 2701,8 , 2, 0, 1, 6, 7 }, // Italian/Latin/Switzerland
- { 59, 19, 108, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 182,5 , 182,5 , 182,5 , 182,5 , 264,10 , 426,13 , 55,4 , 291,10 , 4357,39 , 4357,39 , 158,27 , 4357,39 , 4357,39 , 158,27 , 4913,14 , 4927,28 , 4913,14 , 4913,14 , 4927,28 , 4913,14 , 126,2 , 122,2 , {74,80,89}, 141,1 , 8987,11 , 4,4 , 4,0 , 2709,3 , 2712,2 , 0, 0, 7, 6, 7 }, // Japanese/Japanese/Japan
- { 60, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {73,68,82}, 245,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 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 , 371,12 , 383,11 , 300,6 , 35,18 , 270,8 , 278,13 , 9691,63 , 9754,87 , 9841,31 , 9691,63 , 9754,87 , 9841,31 , 4955,33 , 4988,54 , 5042,20 , 4955,33 , 4988,54 , 5042,20 , 128,9 , 124,7 , {73,78,82}, 127,1 , 8998,49 , 4,4 , 4,0 , 2714,5 , 2719,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 , 538,6 , 35,18 , 18,7 , 25,12 , 9872,72 , 9872,72 , 9944,24 , 9872,72 , 9872,72 , 9944,24 , 5062,54 , 5116,56 , 5172,14 , 5062,54 , 5116,56 , 5172,14 , 0,2 , 0,2 , {73,78,82}, 127,1 , 9047,23 , 8,5 , 4,0 , 2723,5 , 2728,10 , 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 , 394,10 , 175,8 , 685,22 , 37,5 , 8,10 , 9968,60 , 10028,83 , 10111,24 , 10135,60 , 10195,83 , 10111,24 , 5186,21 , 5207,56 , 5263,14 , 5186,21 , 5277,56 , 5263,14 , 137,5 , 131,11 , {75,90,84}, 250,1 , 9070,58 , 13,5 , 4,0 , 2738,10 , 2748,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 , 707,8 , 715,18 , 37,5 , 8,10 , 10278,60 , 10338,101 , 158,27 , 10278,60 , 10338,101 , 158,27 , 5333,35 , 5368,84 , 85,14 , 5333,35 , 5368,84 , 85,14 , 0,2 , 0,2 , {82,87,70}, 188,2 , 0,7 , 55,6 , 4,0 , 2757,11 , 1458,6 , 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 , 404,10 , 404,10 , 175,8 , 733,23 , 37,5 , 8,10 , 10439,48 , 10487,80 , 10567,24 , 10591,59 , 10650,80 , 10567,24 , 5452,38 , 5490,57 , 5547,14 , 5452,38 , 5490,57 , 5547,14 , 142,5 , 142,14 , {75,71,83}, 251,3 , 9128,52 , 13,5 , 4,0 , 2768,8 , 2776,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 , 414,7 , 414,7 , 756,9 , 765,16 , 301,7 , 308,13 , 10730,39 , 10730,39 , 10730,39 , 10730,39 , 10730,39 , 10730,39 , 5561,14 , 5575,28 , 5561,14 , 5561,14 , 5575,28 , 5561,14 , 147,2 , 156,2 , {75,82,87}, 254,1 , 9180,19 , 4,4 , 4,0 , 2786,3 , 2789,4 , 0, 0, 7, 6, 7 }, // Korean/Korean/SouthKorea
- { 66, 22, 113, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 414,7 , 414,7 , 756,9 , 765,16 , 301,7 , 308,13 , 10730,39 , 10730,39 , 10730,39 , 10730,39 , 10730,39 , 10730,39 , 5561,14 , 5575,28 , 5561,14 , 5561,14 , 5575,28 , 5561,14 , 147,2 , 156,2 , {75,80,87}, 255,3 , 9199,39 , 4,4 , 4,0 , 2786,3 , 2793,11 , 0, 0, 1, 6, 7 }, // Korean/Korean/NorthKorea
- { 67, 7, 217, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {84,82,89}, 258,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 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 , 439,8 , 98,16 , 37,5 , 8,10 , 10769,60 , 10829,106 , 158,27 , 10769,60 , 10829,106 , 158,27 , 5603,34 , 5637,89 , 85,14 , 5603,34 , 5637,89 , 85,14 , 149,5 , 158,5 , {66,73,70}, 171,3 , 9238,27 , 0,4 , 4,0 , 2804,8 , 2812,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 , 421,9 , 439,8 , 781,19 , 55,4 , 321,24 , 10935,61 , 10996,75 , 158,27 , 10935,61 , 10996,75 , 158,27 , 5726,36 , 5762,57 , 5819,16 , 5762,57 , 5762,57 , 5835,14 , 154,8 , 163,8 , {76,65,75}, 259,1 , 9265,21 , 4,4 , 36,5 , 2820,3 , 2820,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 , 430,8 , 430,8 , 175,8 , 800,26 , 37,5 , 8,10 , 11071,65 , 11136,101 , 134,24 , 11237,65 , 11302,101 , 134,24 , 5849,21 , 5870,72 , 5942,14 , 5849,21 , 5956,72 , 5942,14 , 162,14 , 171,11 , {69,85,82}, 14,1 , 9286,23 , 13,5 , 4,0 , 2823,8 , 2831,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 , 438,9 , 438,9 , 439,8 , 98,16 , 37,5 , 8,10 , 11403,48 , 11451,203 , 11654,24 , 11403,48 , 11451,203 , 11654,24 , 6028,28 , 6056,100 , 6156,14 , 6028,28 , 6056,100 , 6156,14 , 176,8 , 182,6 , {67,68,70}, 217,2 , 9309,23 , 13,5 , 4,0 , 2838,7 , 2845,29 , 2, 1, 1, 6, 7 }, // Lingala/Latin/CongoKinshasa
- { 72, 7, 6, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 438,9 , 438,9 , 439,8 , 98,16 , 37,5 , 8,10 , 11403,48 , 11451,203 , 11654,24 , 11403,48 , 11451,203 , 11654,24 , 6028,28 , 6056,100 , 6156,14 , 6028,28 , 6056,100 , 6156,14 , 176,8 , 182,6 , {65,79,65}, 260,2 , 9332,23 , 13,5 , 4,0 , 2838,7 , 2874,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 , 438,9 , 438,9 , 439,8 , 98,16 , 37,5 , 8,10 , 11403,48 , 11451,203 , 11654,24 , 11403,48 , 11451,203 , 11654,24 , 6028,28 , 6056,100 , 6156,14 , 6028,28 , 6056,100 , 6156,14 , 176,8 , 182,6 , {88,65,70}, 32,4 , 9355,23 , 13,5 , 4,0 , 2838,7 , 2880,26 , 0, 0, 1, 6, 7 }, // Lingala/Latin/CentralAfricanRepublic
- { 72, 7, 50, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 438,9 , 438,9 , 439,8 , 98,16 , 37,5 , 8,10 , 11403,48 , 11451,203 , 11654,24 , 11403,48 , 11451,203 , 11654,24 , 6028,28 , 6056,100 , 6156,14 , 6028,28 , 6056,100 , 6156,14 , 176,8 , 182,6 , {88,65,70}, 32,4 , 9355,23 , 13,5 , 4,0 , 2838,7 , 2906,5 , 0, 0, 1, 6, 7 }, // Lingala/Latin/CongoBrazzaville
- { 73, 7, 124, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 447,8 , 447,8 , 53,10 , 826,27 , 37,5 , 8,10 , 11678,70 , 11748,96 , 11844,24 , 11678,70 , 11868,98 , 11844,24 , 6170,21 , 6191,89 , 6280,14 , 6170,21 , 6191,89 , 6280,14 , 184,9 , 188,6 , {69,85,82}, 14,1 , 9378,30 , 13,5 , 4,0 , 2911,8 , 2919,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 , 117,7 , 0,6 , 853,7 , 80,18 , 37,5 , 8,10 , 11966,61 , 12027,85 , 12112,24 , 11966,61 , 12027,85 , 12112,24 , 6294,34 , 6328,54 , 1658,14 , 6294,34 , 6328,54 , 1658,14 , 193,10 , 194,8 , {77,75,68}, 262,3 , 9408,56 , 8,5 , 4,0 , 2926,10 , 2936,10 , 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 , 439,8 , 98,16 , 37,5 , 8,10 , 12136,48 , 12184,92 , 134,24 , 12136,48 , 12184,92 , 134,24 , 6382,34 , 6416,60 , 6476,14 , 6382,34 , 6416,60 , 6476,14 , 0,2 , 0,2 , {77,71,65}, 178,2 , 9464,13 , 4,4 , 4,0 , 2946,8 , 2954,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 , 531,7 , 10,17 , 18,7 , 25,12 , 12276,48 , 12324,82 , 12406,24 , 12276,48 , 12324,82 , 12406,24 , 6490,28 , 6518,43 , 6561,14 , 6490,28 , 6518,43 , 6561,14 , 203,2 , 202,3 , {77,89,82}, 182,2 , 9477,39 , 4,4 , 4,0 , 2966,13 , 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {77,89,82}, 182,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 , 531,7 , 860,12 , 18,7 , 25,12 , 12276,48 , 12324,82 , 12406,24 , 12276,48 , 12324,82 , 12406,24 , 6490,28 , 6518,43 , 6561,14 , 6490,28 , 6518,43 , 6561,14 , 203,2 , 202,3 , {66,78,68}, 6,1 , 9516,31 , 8,5 , 4,0 , 2966,13 , 2979,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 , 531,7 , 10,17 , 18,7 , 25,12 , 12276,48 , 12324,82 , 12406,24 , 12276,48 , 12324,82 , 12406,24 , 6490,28 , 6518,43 , 6561,14 , 6490,28 , 6518,43 , 6561,14 , 203,2 , 202,3 , {83,71,68}, 6,1 , 9547,37 , 4,4 , 4,0 , 2966,13 , 2985,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 , 455,13 , 468,12 , 300,6 , 872,18 , 18,7 , 25,12 , 12430,62 , 12492,88 , 12580,31 , 12430,62 , 12492,88 , 12611,29 , 6575,41 , 6616,77 , 6693,22 , 6575,41 , 6715,76 , 6791,21 , 0,2 , 0,2 , {73,78,82}, 127,1 , 9584,40 , 4,4 , 4,0 , 2994,6 , 3000,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 , 480,8 , 488,7 , 120,10 , 890,23 , 37,5 , 8,10 , 12640,48 , 12688,86 , 12774,36 , 12640,48 , 12688,86 , 12810,24 , 6812,28 , 6840,63 , 6903,21 , 6812,28 , 6840,63 , 6924,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 9624,27 , 4,4 , 4,0 , 3006,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 , 37,5 , 8,10 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {78,90,68}, 265,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Maori/Latin/NewZealand
- { 80, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 495,9 , 495,9 , 300,6 , 210,18 , 18,7 , 25,12 , 12834,66 , 12900,86 , 12986,32 , 12834,66 , 12900,86 , 12986,32 , 6938,32 , 6970,53 , 4309,19 , 6938,32 , 6970,53 , 4309,19 , 205,5 , 205,4 , {73,78,82}, 127,1 , 9651,43 , 4,4 , 4,0 , 3011,5 , 2621,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 , 53,10 , 913,29 , 37,5 , 8,10 , 13018,99 , 13117,189 , 158,27 , 13018,99 , 13117,189 , 158,27 , 7023,21 , 7044,43 , 5835,14 , 7023,21 , 7044,43 , 5835,14 , 210,2 , 209,2 , {77,78,84}, 268,1 , 9694,25 , 8,5 , 4,0 , 3016,6 , 3022,6 , 0, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {67,78,89}, 269,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, 504,7 , 0,6 , 504,7 , 504,7 , 53,10 , 63,17 , 37,5 , 8,10 , 13306,85 , 13306,85 , 13391,27 , 13306,85 , 13418,85 , 13391,27 , 7087,33 , 7120,54 , 7174,18 , 7087,33 , 7120,54 , 7174,18 , 110,9 , 108,7 , {78,80,82}, 272,4 , 9719,49 , 8,5 , 4,0 , 3028,6 , 3034,5 , 2, 1, 7, 6, 7 }, // Nepali/Devanagari/Nepal
- { 84, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 504,7 , 0,6 , 504,7 , 504,7 , 53,10 , 63,17 , 18,7 , 25,12 , 13306,85 , 13306,85 , 13391,27 , 13306,85 , 13418,85 , 13391,27 , 7087,33 , 7120,54 , 7174,18 , 7087,33 , 7120,54 , 7174,18 , 110,9 , 108,7 , {73,78,82}, 127,1 , 9768,49 , 8,5 , 4,0 , 3028,6 , 2621,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 , 204,8 , 204,8 , 942,10 , 491,17 , 159,5 , 164,10 , 5499,48 , 13503,83 , 134,24 , 5630,59 , 13503,83 , 134,24 , 2381,35 , 2316,51 , 2367,14 , 2381,35 , 2316,51 , 2367,14 , 85,4 , 83,4 , {78,79,75}, 198,2 , 9817,44 , 8,5 , 4,0 , 3039,12 , 3051,5 , 2, 1, 1, 6, 7 }, // NorwegianBokmal/Latin/Norway
- { 85, 7, 203, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 204,8 , 204,8 , 942,10 , 491,17 , 159,5 , 164,10 , 5499,48 , 13503,83 , 134,24 , 5630,59 , 13503,83 , 134,24 , 2381,35 , 2316,51 , 2367,14 , 2381,35 , 2316,51 , 2367,14 , 85,4 , 83,4 , {78,79,75}, 198,2 , 9817,44 , 8,5 , 4,0 , 3039,12 , 3056,21 , 2, 1, 1, 6, 7 }, // NorwegianBokmal/Latin/SvalbardAndJanMayenIslands
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 0,6 , 0,6 , 952,6 , 10,17 , 18,7 , 25,12 , 13586,86 , 13586,86 , 13672,32 , 13586,86 , 13586,86 , 13672,32 , 7192,33 , 7225,54 , 7279,18 , 7192,33 , 7225,54 , 7279,18 , 89,2 , 87,2 , {73,78,82}, 127,1 , 9861,11 , 8,5 , 4,0 , 3077,5 , 3082,4 , 2, 1, 7, 7, 7 }, // Oriya/Oriya/India
- { 88, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 418,8 , 958,20 , 55,4 , 345,11 , 13704,68 , 13704,68 , 158,27 , 13704,68 , 13704,68 , 158,27 , 7297,49 , 7297,49 , 85,14 , 7297,49 , 7297,49 , 85,14 , 212,4 , 211,4 , {65,70,78}, 276,1 , 9872,13 , 13,5 , 4,0 , 3086,4 , 3090,9 , 0, 0, 6, 4, 5 }, // Pashto/Arabic/Afghanistan
- { 89, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 511,7 , 511,7 , 518,8 , 526,7 , 418,8 , 98,16 , 55,4 , 345,11 , 13772,70 , 13772,70 , 13842,24 , 13866,74 , 13866,74 , 13842,24 , 7297,49 , 7297,49 , 7346,14 , 7297,49 , 7297,49 , 7346,14 , 216,9 , 215,8 , {73,82,82}, 277,4 , 9885,37 , 61,5 , 4,0 , 3099,5 , 3104,5 , 0, 0, 6, 5, 5 }, // Persian/Arabic/Iran
- { 89, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 511,7 , 511,7 , 518,8 , 526,7 , 418,8 , 98,16 , 55,4 , 345,11 , 13772,70 , 13772,70 , 13940,24 , 13964,62 , 14026,68 , 13842,24 , 7297,49 , 7297,49 , 7346,14 , 7297,49 , 7297,49 , 7346,14 , 216,9 , 215,8 , {65,70,78}, 276,1 , 9922,55 , 61,5 , 4,0 , 3109,3 , 3090,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 , 175,7 , 175,7 , 942,10 , 10,17 , 37,5 , 8,10 , 14094,48 , 14142,97 , 14239,24 , 14094,48 , 14263,99 , 14239,24 , 7360,34 , 7394,59 , 7453,14 , 7360,34 , 7394,59 , 7453,14 , 0,2 , 0,2 , {80,76,78}, 281,2 , 9977,77 , 13,5 , 4,0 , 3112,6 , 3118,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 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7467,28 , 7495,79 , 7574,14 , 7467,28 , 7495,79 , 7574,14 , 0,2 , 0,2 , {66,82,76}, 283,2 , 10054,54 , 4,4 , 4,0 , 3124,19 , 3143,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 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {65,79,65}, 260,2 , 10108,54 , 13,5 , 4,0 , 3149,9 , 3158,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 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {67,86,69}, 285,1 , 10162,69 , 13,5 , 4,0 , 3149,9 , 3164,10 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/CapeVerde
- { 91, 7, 62, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {85,83,68}, 167,3 , 10231,81 , 13,5 , 4,0 , 3149,9 , 3174,11 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/EastTimor
- { 91, 7, 66, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {88,65,70}, 32,4 , 10312,59 , 13,5 , 4,0 , 3149,9 , 3185,16 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/EquatorialGuinea
- { 91, 7, 92, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {88,79,70}, 212,3 , 10371,62 , 13,5 , 4,0 , 3149,9 , 3201,12 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/GuineaBissau
- { 91, 7, 125, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {69,85,82}, 14,1 , 10433,20 , 13,5 , 4,0 , 3149,9 , 3213,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 , 257,7 , 257,7 , 27,8 , 978,27 , 18,7 , 25,12 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {77,79,80}, 145,4 , 10453,53 , 13,5 , 4,0 , 3149,9 , 3223,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 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {77,90,78}, 286,3 , 10506,72 , 13,5 , 4,0 , 3149,9 , 3242,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 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {69,85,82}, 14,1 , 10433,20 , 13,5 , 4,0 , 3252,17 , 3269,8 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Portugal
- { 91, 7, 185, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {83,84,68}, 289,2 , 10578,92 , 13,5 , 4,0 , 3149,9 , 3277,19 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/SaoTomeAndPrincipe
- { 91, 7, 206, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 257,7 , 257,7 , 27,8 , 978,27 , 37,5 , 8,10 , 14362,48 , 14410,89 , 134,24 , 14362,48 , 14410,89 , 134,24 , 7588,49 , 7495,79 , 7574,14 , 7588,49 , 7495,79 , 7574,14 , 225,8 , 223,8 , {67,72,70}, 231,3 , 10670,45 , 13,5 , 4,0 , 3149,9 , 3296,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 , 533,9 , 533,9 , 300,6 , 10,17 , 18,7 , 25,12 , 14499,50 , 14549,68 , 14617,28 , 14499,50 , 14549,68 , 14617,28 , 7637,36 , 7673,57 , 7730,23 , 7637,36 , 7673,57 , 7730,23 , 233,6 , 231,6 , {73,78,82}, 127,1 , 10715,39 , 4,4 , 4,0 , 3301,6 , 3307,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 , 120,10 , 80,18 , 18,7 , 25,12 , 14645,67 , 14645,67 , 158,27 , 14645,67 , 14645,67 , 158,27 , 7753,37 , 7753,37 , 85,14 , 7753,37 , 7753,37 , 85,14 , 0,2 , 0,2 , {80,75,82}, 291,1 , 10754,13 , 55,6 , 4,0 , 3311,6 , 3317,6 , 0, 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 , 120,10 , 210,18 , 37,5 , 8,10 , 14712,48 , 14760,128 , 158,27 , 14712,48 , 14760,128 , 158,27 , 7790,28 , 7818,53 , 7871,14 , 7790,28 , 7818,53 , 7871,14 , 85,4 , 83,4 , {80,69,78}, 292,3 , 0,7 , 8,5 , 4,0 , 3323,8 , 3331,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 , 120,10 , 210,18 , 37,5 , 8,10 , 14712,48 , 14760,128 , 158,27 , 14712,48 , 14760,128 , 158,27 , 7790,28 , 7818,53 , 7871,14 , 7790,28 , 7818,53 , 7871,14 , 85,4 , 83,4 , {66,79,66}, 295,2 , 0,7 , 8,5 , 4,0 , 3323,8 , 3335,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 , 120,10 , 210,18 , 37,5 , 8,10 , 14712,48 , 14760,128 , 158,27 , 14712,48 , 14760,128 , 158,27 , 7790,28 , 7818,53 , 7871,14 , 7790,28 , 7818,53 , 7871,14 , 85,4 , 83,4 , {85,83,68}, 6,1 , 0,7 , 8,5 , 4,0 , 3323,8 , 3342,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 , 370,8 , 1005,28 , 37,5 , 8,10 , 14888,67 , 14955,92 , 15047,24 , 14888,67 , 14955,92 , 15047,24 , 7885,23 , 7908,56 , 7964,14 , 7885,23 , 7908,56 , 7964,14 , 89,2 , 237,2 , {67,72,70}, 231,3 , 10767,46 , 13,5 , 4,0 , 3349,9 , 3358,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 , 542,8 , 542,8 , 942,10 , 10,17 , 37,5 , 8,10 , 15071,60 , 15131,98 , 15229,24 , 15071,60 , 15131,98 , 15229,24 , 7978,34 , 8012,48 , 3068,14 , 7978,34 , 8012,48 , 3068,14 , 85,4 , 83,4 , {82,79,78}, 297,3 , 10813,57 , 13,5 , 4,0 , 3364,6 , 3370,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 , 542,8 , 542,8 , 942,10 , 10,17 , 37,5 , 8,10 , 15071,60 , 15131,98 , 15229,24 , 15071,60 , 15131,98 , 15229,24 , 8060,28 , 8012,48 , 8088,16 , 8060,28 , 8012,48 , 8088,16 , 85,4 , 83,4 , {77,68,76}, 300,1 , 10870,69 , 13,5 , 4,0 , 3377,13 , 3390,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 , 117,7 , 117,7 , 175,8 , 348,22 , 55,4 , 59,9 , 15253,62 , 10650,80 , 10567,24 , 15315,62 , 15377,82 , 10567,24 , 8104,21 , 8125,62 , 8187,14 , 8104,21 , 8125,62 , 8104,21 , 239,2 , 239,2 , {82,85,66}, 129,1 , 10939,89 , 13,5 , 4,0 , 3407,7 , 3414,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 , 117,7 , 117,7 , 175,8 , 348,22 , 55,4 , 59,9 , 15253,62 , 10650,80 , 10567,24 , 15315,62 , 15377,82 , 10567,24 , 8104,21 , 8125,62 , 8187,14 , 8104,21 , 8125,62 , 8104,21 , 239,2 , 239,2 , {66,89,82}, 138,2 , 11028,94 , 13,5 , 4,0 , 3407,7 , 485,8 , 0, 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 , 117,7 , 117,7 , 175,8 , 348,22 , 55,4 , 59,9 , 15253,62 , 10650,80 , 10567,24 , 15315,62 , 15377,82 , 10567,24 , 8104,21 , 8125,62 , 8187,14 , 8104,21 , 8125,62 , 8104,21 , 239,2 , 239,2 , {75,90,84}, 250,1 , 11122,83 , 13,5 , 4,0 , 3407,7 , 3420,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 , 117,7 , 117,7 , 175,8 , 348,22 , 55,4 , 59,9 , 15253,62 , 10650,80 , 10567,24 , 15315,62 , 15377,82 , 10567,24 , 8104,21 , 8125,62 , 8187,14 , 8104,21 , 8125,62 , 8104,21 , 239,2 , 239,2 , {75,71,83}, 251,3 , 11205,81 , 13,5 , 4,0 , 3407,7 , 3429,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 , 117,7 , 117,7 , 175,8 , 348,22 , 55,4 , 59,9 , 15253,62 , 10650,80 , 10567,24 , 15315,62 , 15377,82 , 10567,24 , 8104,21 , 8125,62 , 8187,14 , 8104,21 , 8125,62 , 8104,21 , 239,2 , 239,2 , {77,68,76}, 300,1 , 11286,79 , 13,5 , 4,0 , 3407,7 , 3437,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 , 117,7 , 117,7 , 175,8 , 348,22 , 37,5 , 8,10 , 15253,62 , 10650,80 , 10567,24 , 15315,62 , 15377,82 , 10567,24 , 8104,21 , 8125,62 , 8187,14 , 8104,21 , 8125,62 , 8104,21 , 239,2 , 239,2 , {85,65,72}, 301,1 , 11365,92 , 13,5 , 4,0 , 3407,7 , 3444,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 , 439,8 , 98,16 , 37,5 , 8,10 , 15459,48 , 15507,91 , 15598,24 , 15459,48 , 15507,91 , 15598,24 , 8201,28 , 8229,66 , 8295,14 , 8201,28 , 8229,66 , 8295,14 , 241,2 , 241,2 , {88,65,70}, 32,4 , 11457,25 , 4,4 , 36,5 , 3451,5 , 3456,22 , 0, 0, 1, 6, 7 }, // Sango/Latin/CentralAfricanRepublic
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {73,78,82}, 127,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 , 117,7 , 117,7 , 1033,7 , 1040,20 , 159,5 , 164,10 , 15622,48 , 15670,81 , 12112,24 , 15622,48 , 15670,81 , 12112,24 , 8309,28 , 8337,52 , 8389,14 , 8309,28 , 8337,52 , 8389,14 , 243,9 , 243,8 , {82,83,68}, 302,3 , 11482,58 , 13,5 , 4,0 , 3478,6 , 3484,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 , 175,7 , 175,7 , 1033,7 , 1040,20 , 37,5 , 8,10 , 15751,48 , 15799,81 , 15880,24 , 15751,48 , 15799,81 , 15880,24 , 8403,28 , 8431,54 , 2176,14 , 8403,28 , 8431,54 , 2176,14 , 252,9 , 251,8 , {66,65,77}, 152,2 , 11540,174 , 13,5 , 4,0 , 3490,6 , 614,19 , 2, 1, 1, 6, 7 }, // Serbian/Latin/BosniaAndHerzegowina
- { 100, 7, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 175,7 , 175,7 , 1033,7 , 1040,20 , 159,5 , 164,10 , 15751,48 , 15799,81 , 15880,24 , 15751,48 , 15799,81 , 15880,24 , 8403,28 , 8431,54 , 2176,14 , 8403,28 , 8431,54 , 2176,14 , 252,9 , 251,8 , {69,85,82}, 14,1 , 11714,23 , 13,5 , 4,0 , 3490,6 , 3496,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 , 175,7 , 175,7 , 1033,7 , 1040,20 , 159,5 , 164,10 , 15751,48 , 15799,81 , 15880,24 , 15751,48 , 15799,81 , 15880,24 , 8403,28 , 8431,54 , 2176,14 , 8403,28 , 8431,54 , 2176,14 , 252,9 , 251,8 , {82,83,68}, 302,3 , 11737,58 , 13,5 , 4,0 , 3490,6 , 3505,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 , 117,7 , 117,7 , 1033,7 , 1040,20 , 37,5 , 8,10 , 15622,48 , 15670,81 , 12112,24 , 15622,48 , 15670,81 , 12112,24 , 8309,28 , 8337,52 , 8389,14 , 8309,28 , 8337,52 , 8389,14 , 243,9 , 243,8 , {66,65,77}, 305,2 , 11795,174 , 13,5 , 4,0 , 3478,6 , 3511,19 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/BosniaAndHerzegowina
- { 100, 2, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 117,7 , 117,7 , 1033,7 , 1040,20 , 159,5 , 164,10 , 15622,48 , 15670,81 , 12112,24 , 15622,48 , 15670,81 , 12112,24 , 8309,28 , 8337,52 , 8389,14 , 8309,28 , 8337,52 , 8389,14 , 243,9 , 243,8 , {69,85,82}, 14,1 , 11969,23 , 13,5 , 4,0 , 3478,6 , 3530,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 , 117,7 , 117,7 , 1033,7 , 1040,20 , 159,5 , 164,10 , 15622,48 , 15670,81 , 12112,24 , 15622,48 , 15670,81 , 12112,24 , 8309,28 , 8337,52 , 8389,14 , 8309,28 , 8337,52 , 8389,14 , 243,9 , 243,8 , {69,85,82}, 14,1 , 11969,23 , 13,5 , 4,0 , 3478,6 , 3539,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 , 175,7 , 175,7 , 1033,7 , 1040,20 , 159,5 , 164,10 , 15751,48 , 15799,81 , 15880,24 , 15751,48 , 15799,81 , 15880,24 , 8403,28 , 8431,54 , 2176,14 , 8403,28 , 8431,54 , 2176,14 , 252,9 , 251,8 , {69,85,82}, 14,1 , 11714,23 , 13,5 , 4,0 , 3490,6 , 3545,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 , 550,9 , 550,9 , 175,8 , 1060,23 , 37,5 , 8,10 , 15904,63 , 15967,82 , 10567,24 , 16049,60 , 16109,86 , 10567,24 , 8485,28 , 8513,61 , 8574,14 , 8588,28 , 8616,61 , 8574,14 , 261,15 , 259,15 , {71,69,76}, 238,1 , 11992,17 , 8,5 , 4,0 , 3551,4 , 3555,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 , 550,9 , 550,9 , 175,8 , 1060,23 , 37,5 , 8,10 , 15904,63 , 15967,82 , 10567,24 , 16049,60 , 16109,86 , 10567,24 , 8485,28 , 8513,61 , 8574,14 , 8588,28 , 8616,61 , 8574,14 , 261,15 , 259,15 , {82,85,66}, 129,1 , 12009,17 , 8,5 , 4,0 , 3551,4 , 3566,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Southern Sotho/Latin/SouthAfrica
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Tswana/Latin/SouthAfrica
- { 104, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 18,7 , 25,12 , 16195,47 , 16242,100 , 16342,24 , 16195,47 , 16242,100 , 16342,24 , 8677,32 , 8709,55 , 8764,14 , 8677,32 , 8709,55 , 8764,14 , 0,2 , 0,2 , {85,83,68}, 167,3 , 12026,22 , 4,4 , 4,0 , 3572,8 , 1801,8 , 2, 1, 7, 6, 7 }, // Shona/Latin/Zimbabwe
- { 105, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {80,75,82}, 184,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 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 , 559,9 , 568,8 , 53,10 , 63,17 , 159,5 , 164,10 , 16366,59 , 16425,96 , 16521,32 , 16553,61 , 16425,96 , 16521,32 , 8778,39 , 8817,62 , 8879,19 , 8778,39 , 8817,62 , 8879,19 , 276,5 , 274,4 , {76,75,82}, 307,3 , 12048,58 , 4,4 , 4,0 , 3580,5 , 3585,11 , 2, 1, 1, 6, 7 }, // Sinhala/Sinhala/SriLanka
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Swati/Latin/SouthAfrica
- { 108, 7, 191, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 197,7 , 576,7 , 114,6 , 544,18 , 55,4 , 59,9 , 16614,48 , 16662,82 , 15880,24 , 16614,48 , 16744,89 , 15880,24 , 8898,21 , 8919,52 , 8971,14 , 8898,21 , 8919,52 , 8971,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 12106,26 , 13,5 , 4,0 , 3596,10 , 3606,9 , 2, 1, 1, 6, 7 }, // Slovak/Latin/Slovakia
- { 109, 7, 192, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 583,8 , 583,8 , 1083,9 , 1092,19 , 37,5 , 8,10 , 15751,48 , 16833,86 , 15880,24 , 16919,59 , 16833,86 , 15880,24 , 8985,28 , 9013,52 , 9065,14 , 9079,35 , 9013,52 , 9065,14 , 81,4 , 278,4 , {69,85,82}, 14,1 , 12132,28 , 13,5 , 4,0 , 3615,11 , 3626,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 , 0,6 , 0,6 , 27,8 , 1111,19 , 18,7 , 25,12 , 16978,48 , 17026,189 , 17215,24 , 16978,48 , 17026,189 , 17215,24 , 9114,28 , 9142,47 , 9189,14 , 9114,28 , 9142,47 , 9189,14 , 281,3 , 282,3 , {83,79,83}, 100,1 , 12160,22 , 4,4 , 4,0 , 3635,8 , 3643,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 , 0,6 , 0,6 , 27,8 , 1111,19 , 18,7 , 25,12 , 16978,48 , 17026,189 , 17215,24 , 16978,48 , 17026,189 , 17215,24 , 9114,28 , 9142,47 , 9189,14 , 9114,28 , 9142,47 , 9189,14 , 281,3 , 282,3 , {68,74,70}, 43,3 , 12182,21 , 4,4 , 4,0 , 3635,8 , 3653,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 , 0,6 , 0,6 , 27,8 , 1111,19 , 18,7 , 25,12 , 16978,48 , 17026,189 , 17215,24 , 16978,48 , 17026,189 , 17215,24 , 9114,28 , 9142,47 , 9189,14 , 9114,28 , 9142,47 , 9189,14 , 281,3 , 282,3 , {69,84,66}, 0,2 , 12203,22 , 4,4 , 4,0 , 3635,8 , 3660,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 , 0,6 , 0,6 , 27,8 , 1111,19 , 37,5 , 8,10 , 16978,48 , 17026,189 , 17215,24 , 16978,48 , 17026,189 , 17215,24 , 9114,28 , 9142,47 , 9189,14 , 9114,28 , 9142,47 , 9189,14 , 281,3 , 282,3 , {75,69,83}, 2,3 , 0,7 , 4,4 , 4,0 , 3635,8 , 3668,7 , 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 , 591,7 , 591,7 , 300,6 , 978,27 , 55,4 , 345,11 , 17239,61 , 17300,89 , 17389,24 , 17239,61 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 7871,14 , 9203,35 , 9238,53 , 7871,14 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 3675,17 , 2393,6 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Spain
- { 111, 7, 10, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {65,82,83}, 6,1 , 12225,51 , 8,5 , 4,0 , 3692,7 , 3699,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Argentina
- { 111, 7, 26, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {66,79,66}, 295,2 , 12276,35 , 4,4 , 4,0 , 3692,7 , 3335,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Bolivia
- { 111, 7, 30, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {66,82,76}, 283,2 , 12311,52 , 4,4 , 4,0 , 3692,7 , 3143,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Brazil
- { 111, 7, 43, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 370,8 , 978,27 , 37,5 , 8,10 , 17239,61 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {67,76,80}, 6,1 , 12363,45 , 4,4 , 36,5 , 3692,7 , 3708,5 , 0, 0, 1, 6, 7 }, // Spanish/Latin/Chile
- { 111, 7, 47, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 531,7 , 978,27 , 18,7 , 25,12 , 17239,61 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 9291,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {67,79,80}, 6,1 , 12408,54 , 8,5 , 4,0 , 3692,7 , 3713,8 , 0, 0, 7, 6, 7 }, // Spanish/Latin/Colombia
- { 111, 7, 52, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {67,82,67}, 310,1 , 12462,67 , 4,4 , 4,0 , 3692,7 , 3721,10 , 0, 0, 1, 6, 7 }, // Spanish/Latin/CostaRica
- { 111, 7, 55, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {67,85,80}, 6,1 , 12529,42 , 4,4 , 4,0 , 3692,7 , 3731,4 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Cuba
- { 111, 7, 61, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 18,7 , 25,12 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {68,79,80}, 311,3 , 12571,54 , 4,4 , 66,6 , 3692,7 , 3735,20 , 2, 1, 7, 6, 7 }, // Spanish/Latin/DominicanRepublic
- { 111, 7, 63, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {85,83,68}, 6,1 , 12625,70 , 4,4 , 36,5 , 3692,7 , 3342,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Ecuador
- { 111, 7, 65, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {85,83,68}, 6,1 , 12625,70 , 4,4 , 4,0 , 3692,7 , 3755,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/ElSalvador
- { 111, 7, 66, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 55,4 , 345,11 , 17239,61 , 17300,89 , 17389,24 , 17239,61 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 7871,14 , 9203,35 , 9238,53 , 7871,14 , 74,5 , 72,5 , {88,65,70}, 32,4 , 12695,53 , 4,4 , 4,0 , 3692,7 , 3766,17 , 0, 0, 1, 6, 7 }, // Spanish/Latin/EquatorialGuinea
- { 111, 7, 90, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 531,7 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {71,84,81}, 314,1 , 12748,30 , 18,5 , 4,0 , 3692,7 , 3783,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Guatemala
- { 111, 7, 96, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 1130,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {72,78,76}, 300,1 , 12778,60 , 4,4 , 4,0 , 3692,7 , 3792,8 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Honduras
- { 111, 7, 139, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 27,8 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17497,48 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 3068,14 , 85,4 , 83,4 , {77,88,78}, 6,1 , 12838,48 , 4,4 , 4,0 , 3800,17 , 3817,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Mexico
- { 111, 7, 155, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {78,73,79}, 315,2 , 12886,69 , 4,4 , 4,0 , 3692,7 , 3823,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Nicaragua
- { 111, 7, 166, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 1157,8 , 978,27 , 18,7 , 25,12 , 17413,60 , 17300,89 , 17389,24 , 17413,60 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {80,65,66}, 317,3 , 12955,54 , 4,4 , 4,0 , 3692,7 , 3832,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Panama
- { 111, 7, 168, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17239,61 , 17300,89 , 17473,24 , 17239,61 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {80,89,71}, 320,3 , 13009,61 , 8,5 , 23,6 , 3692,7 , 3838,8 , 0, 0, 7, 6, 7 }, // Spanish/Latin/Paraguay
- { 111, 7, 169, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 531,7 , 978,27 , 37,5 , 8,10 , 17545,60 , 17605,88 , 17473,24 , 17693,60 , 17753,88 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {80,69,78}, 292,3 , 13070,62 , 4,4 , 4,0 , 3692,7 , 3331,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 , 591,7 , 591,7 , 300,6 , 978,27 , 18,7 , 25,12 , 17239,61 , 17300,89 , 17389,24 , 17239,61 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 7871,14 , 9203,35 , 9238,53 , 7871,14 , 74,5 , 72,5 , {80,72,80}, 187,1 , 13132,48 , 13,5 , 4,0 , 3692,7 , 3846,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Philippines
- { 111, 7, 174, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 1157,8 , 978,27 , 18,7 , 25,12 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {85,83,68}, 6,1 , 12625,70 , 4,4 , 4,0 , 3692,7 , 1447,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/PuertoRico
- { 111, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 18,7 , 25,12 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 0,2 , 0,2 , {85,83,68}, 6,1 , 12625,70 , 4,4 , 4,0 , 3692,7 , 3855,14 , 2, 1, 7, 6, 7 }, // Spanish/Latin/UnitedStates
- { 111, 7, 227, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17545,60 , 17605,88 , 17473,24 , 17693,60 , 17753,88 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {85,89,85}, 6,1 , 13180,48 , 8,5 , 4,0 , 3692,7 , 3869,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Uruguay
- { 111, 7, 231, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 18,7 , 25,12 , 17239,61 , 17300,89 , 17473,24 , 17239,61 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 74,5 , 72,5 , {86,69,70}, 323,3 , 13228,64 , 4,4 , 36,5 , 3692,7 , 3876,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 , 591,7 , 591,7 , 300,6 , 978,27 , 55,4 , 345,11 , 17239,61 , 17300,89 , 17389,24 , 17239,61 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 7871,14 , 9203,35 , 9238,53 , 7871,14 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 3692,7 , 3885,8 , 2, 1, 1, 6, 7 }, // Spanish/Latin/CanaryIslands
- { 111, 7, 246, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 37,5 , 8,10 , 17413,60 , 17300,89 , 17473,24 , 17413,60 , 17300,89 , 17473,24 , 9203,35 , 9238,53 , 3068,14 , 9203,35 , 9238,53 , 9291,14 , 85,4 , 83,4 , {0,0,0}, 0,0 , 13292,0 , 4,4 , 4,0 , 3893,23 , 3916,13 , 2, 1, 1, 6, 7 }, // Spanish/Latin/LatinAmericaAndTheCaribbean
- { 111, 7, 250, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 591,7 , 591,7 , 300,6 , 978,27 , 55,4 , 345,11 , 17239,61 , 17300,89 , 17389,24 , 17239,61 , 17300,89 , 17389,24 , 9203,35 , 9238,53 , 7871,14 , 9203,35 , 9238,53 , 7871,14 , 74,5 , 72,5 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 3692,7 , 3929,15 , 2, 1, 1, 6, 7 }, // Spanish/Latin/CeutaAndMelilla
- { 113, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 598,8 , 598,8 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 17889,84 , 134,24 , 17841,48 , 17889,84 , 134,24 , 9305,60 , 9305,60 , 85,14 , 9305,60 , 9305,60 , 85,14 , 0,2 , 0,2 , {84,90,83}, 200,3 , 13292,67 , 4,4 , 4,0 , 3944,9 , 1626,8 , 0, 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 , 598,8 , 598,8 , 439,8 , 98,16 , 37,5 , 8,10 , 17841,48 , 17889,84 , 17973,24 , 17997,48 , 18045,188 , 134,24 , 9305,60 , 9305,60 , 9365,14 , 9379,28 , 9407,93 , 85,14 , 284,10 , 285,10 , {67,68,70}, 217,2 , 13359,55 , 4,4 , 4,0 , 3953,18 , 3971,32 , 2, 1, 1, 6, 7 }, // Swahili/Latin/CongoKinshasa
- { 113, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 598,8 , 598,8 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 17889,84 , 134,24 , 17841,48 , 17889,84 , 134,24 , 9305,60 , 9305,60 , 85,14 , 9305,60 , 9305,60 , 85,14 , 0,2 , 0,2 , {75,69,83}, 2,3 , 13414,58 , 4,4 , 4,0 , 3944,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 , 598,8 , 598,8 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 17889,84 , 134,24 , 17841,48 , 17889,84 , 134,24 , 9305,60 , 9305,60 , 85,14 , 9305,60 , 9305,60 , 85,14 , 0,2 , 0,2 , {85,71,88}, 205,3 , 13472,61 , 4,4 , 4,0 , 3944,9 , 1691,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 , 606,9 , 606,9 , 53,10 , 98,16 , 37,5 , 356,16 , 18233,59 , 18292,86 , 134,24 , 18233,59 , 18292,86 , 134,24 , 9500,29 , 9529,50 , 2367,14 , 9500,29 , 9529,50 , 2367,14 , 294,2 , 295,2 , {83,69,75}, 198,2 , 13533,45 , 13,5 , 4,0 , 4003,7 , 4010,7 , 2, 1, 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 , 606,9 , 606,9 , 1165,10 , 98,16 , 37,5 , 356,16 , 18233,59 , 18292,86 , 134,24 , 18233,59 , 18292,86 , 134,24 , 9500,29 , 9529,50 , 2367,14 , 9500,29 , 9529,50 , 2367,14 , 294,2 , 295,2 , {69,85,82}, 14,1 , 8915,19 , 13,5 , 4,0 , 4003,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 , 606,9 , 606,9 , 53,10 , 98,16 , 37,5 , 356,16 , 18233,59 , 18292,86 , 134,24 , 18233,59 , 18292,86 , 134,24 , 9500,29 , 9529,50 , 2367,14 , 9500,29 , 9529,50 , 2367,14 , 294,2 , 295,2 , {69,85,82}, 14,1 , 8915,19 , 13,5 , 4,0 , 4003,7 , 4017,5 , 2, 1, 1, 6, 7 }, // Swedish/Latin/AlandIslands
- { 116, 2, 209, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {84,74,83}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 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 , 615,13 , 615,13 , 300,6 , 210,18 , 301,7 , 372,12 , 18378,58 , 18436,86 , 18522,31 , 18378,58 , 18553,86 , 18522,31 , 9579,39 , 9618,49 , 9667,20 , 9579,39 , 9618,49 , 9667,20 , 296,8 , 297,8 , {73,78,82}, 127,1 , 13578,49 , 8,5 , 4,0 , 4022,5 , 4027,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 , 615,13 , 615,13 , 300,6 , 210,18 , 301,7 , 372,12 , 18378,58 , 18436,86 , 18522,31 , 18378,58 , 18553,86 , 18522,31 , 9579,39 , 9618,49 , 9667,20 , 9579,39 , 9618,49 , 9667,20 , 296,8 , 297,8 , {77,89,82}, 182,2 , 13627,61 , 8,5 , 4,0 , 4022,5 , 4034,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 , 615,13 , 615,13 , 300,6 , 210,18 , 301,7 , 372,12 , 18378,58 , 18436,86 , 18522,31 , 18378,58 , 18553,86 , 18522,31 , 9579,39 , 9618,49 , 9667,20 , 9579,39 , 9618,49 , 9667,20 , 296,8 , 297,8 , {83,71,68}, 6,1 , 13688,61 , 8,5 , 4,0 , 4022,5 , 4041,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 , 615,13 , 615,13 , 300,6 , 210,18 , 37,5 , 8,10 , 18378,58 , 18436,86 , 18522,31 , 18378,58 , 18553,86 , 18522,31 , 9579,39 , 9618,49 , 9667,20 , 9579,39 , 9618,49 , 9667,20 , 296,8 , 297,8 , {76,75,82}, 326,3 , 13749,49 , 8,5 , 4,0 , 4022,5 , 4052,6 , 2, 1, 1, 6, 7 }, // Tamil/Tamil/SriLanka
- { 118, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {82,85,66}, 129,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 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 , 628,11 , 628,11 , 370,8 , 1175,18 , 18,7 , 25,12 , 18639,66 , 18705,86 , 18791,31 , 18822,62 , 18705,86 , 18791,31 , 9687,32 , 9719,60 , 9779,18 , 9687,32 , 9719,60 , 9779,18 , 304,4 , 305,4 , {73,78,82}, 127,1 , 13798,26 , 4,4 , 4,0 , 4058,6 , 4064,9 , 2, 1, 7, 7, 7 }, // Telugu/Telugu/India
- { 120, 30, 211, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 639,5 , 639,5 , 644,8 , 652,7 , 300,6 , 1193,19 , 37,5 , 384,28 , 18884,63 , 18947,98 , 18884,63 , 18884,63 , 18947,98 , 18884,63 , 9797,23 , 9820,68 , 9888,16 , 9797,23 , 9820,68 , 9888,16 , 308,10 , 309,10 , {84,72,66}, 329,3 , 13824,19 , 4,4 , 4,0 , 4073,3 , 4073,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 , 1212,23 , 18,7 , 25,12 , 2660,63 , 19045,159 , 158,27 , 2660,63 , 19204,147 , 158,27 , 9904,51 , 9955,79 , 10034,27 , 9904,51 , 9955,79 , 10034,27 , 318,7 , 319,8 , {67,78,89}, 332,1 , 13843,13 , 8,5 , 4,0 , 4076,8 , 4084,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 , 1212,23 , 18,7 , 25,12 , 2660,63 , 19045,159 , 158,27 , 2660,63 , 19204,147 , 158,27 , 9904,51 , 9955,79 , 10034,27 , 9904,51 , 9955,79 , 10034,27 , 318,7 , 319,8 , {73,78,82}, 127,1 , 13856,19 , 8,5 , 4,0 , 4076,8 , 4090,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 , 1235,23 , 18,7 , 25,12 , 19351,46 , 19397,62 , 878,24 , 19351,46 , 19397,62 , 878,24 , 10061,29 , 10061,29 , 10090,14 , 10061,29 , 10061,29 , 10090,14 , 325,7 , 327,7 , {69,84,66}, 0,2 , 13875,16 , 4,4 , 4,0 , 4097,4 , 82,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 , 1258,23 , 18,7 , 25,12 , 19459,46 , 19505,54 , 878,24 , 19459,46 , 19505,54 , 878,24 , 10104,29 , 10104,29 , 10090,14 , 10104,29 , 10104,29 , 10090,14 , 325,7 , 327,7 , {69,82,78}, 46,3 , 0,7 , 4,4 , 4,0 , 4097,4 , 4101,4 , 2, 1, 1, 6, 7 }, // Tigrinya/Ethiopic/Eritrea
- { 123, 7, 214, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 659,8 , 659,8 , 659,8 , 659,8 , 300,6 , 98,16 , 18,7 , 25,12 , 19559,51 , 19610,87 , 19697,24 , 19559,51 , 19610,87 , 19697,24 , 10133,29 , 10162,60 , 10222,14 , 10133,29 , 10162,60 , 10222,14 , 0,2 , 0,2 , {84,79,80}, 203,2 , 13891,41 , 8,5 , 4,0 , 4105,13 , 1641,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Tsonga/Latin/SouthAfrica
- { 125, 7, 217, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 667,8 , 667,8 , 1281,9 , 1290,16 , 37,5 , 8,10 , 19721,48 , 19769,75 , 19844,24 , 19721,48 , 19769,75 , 19844,24 , 10236,28 , 10264,54 , 10318,14 , 10236,28 , 10264,54 , 10318,14 , 332,2 , 334,2 , {84,82,89}, 258,1 , 13932,40 , 13,5 , 4,0 , 4118,6 , 4124,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 , 667,8 , 667,8 , 1281,9 , 1290,16 , 18,7 , 25,12 , 19721,48 , 19769,75 , 19844,24 , 19721,48 , 19769,75 , 19844,24 , 10236,28 , 10264,54 , 10318,14 , 10236,28 , 10264,54 , 10318,14 , 332,2 , 334,2 , {69,85,82}, 14,1 , 8402,19 , 13,5 , 4,0 , 4118,6 , 4131,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 , 675,8 , 675,8 , 942,10 , 1290,16 , 37,5 , 8,10 , 19868,51 , 19919,77 , 19996,24 , 19868,51 , 19919,77 , 19996,24 , 10332,21 , 10353,54 , 10407,14 , 10332,21 , 10353,54 , 10407,14 , 0,2 , 0,2 , {84,77,84}, 333,3 , 13972,49 , 13,5 , 4,0 , 4137,9 , 4146,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 , 212,10 , 222,9 , 538,6 , 1306,18 , 18,7 , 25,12 , 20020,84 , 20020,84 , 158,27 , 20020,84 , 20020,84 , 158,27 , 10421,21 , 10442,55 , 10497,14 , 10421,21 , 10442,55 , 10497,14 , 334,12 , 336,12 , {67,78,89}, 141,1 , 14021,40 , 4,4 , 4,0 , 4158,8 , 4166,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 , 150,7 , 150,7 , 175,8 , 1324,22 , 37,5 , 8,10 , 20104,48 , 20152,95 , 20247,24 , 20271,67 , 20338,87 , 20247,24 , 10511,21 , 10532,56 , 10588,14 , 10511,21 , 10532,56 , 10588,14 , 346,2 , 348,2 , {85,65,72}, 301,1 , 14061,49 , 13,5 , 4,0 , 4171,10 , 4181,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 , 683,10 , 693,9 , 300,6 , 157,18 , 18,7 , 25,12 , 20425,68 , 20425,68 , 134,24 , 20425,68 , 20425,68 , 134,24 , 10602,39 , 10602,39 , 85,14 , 10602,39 , 10602,39 , 85,14 , 348,9 , 350,9 , {80,75,82}, 184,2 , 14110,49 , 8,5 , 4,0 , 4188,4 , 4192,7 , 0, 0, 7, 6, 7 }, // Urdu/Arabic/Pakistan
- { 130, 1, 100, 46, 44, 59, 37, 1776, 45, 43, 1602, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 702,6 , 702,6 , 300,6 , 157,18 , 18,7 , 25,12 , 20425,68 , 20425,68 , 134,24 , 20425,68 , 20425,68 , 134,24 , 10602,39 , 10602,39 , 85,14 , 10602,39 , 10602,39 , 85,14 , 348,9 , 350,9 , {73,78,82}, 127,1 , 14159,42 , 8,5 , 4,0 , 4188,4 , 4199,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 , 708,8 , 708,8 , 27,8 , 715,18 , 37,5 , 345,11 , 20493,52 , 20545,75 , 20620,24 , 20644,48 , 20692,75 , 20620,24 , 10641,21 , 10662,61 , 10723,14 , 10641,21 , 10662,61 , 10723,14 , 357,2 , 359,2 , {85,90,83}, 336,4 , 14201,58 , 8,5 , 4,0 , 4204,6 , 4210,11 , 0, 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 , 418,8 , 1346,33 , 55,4 , 345,11 , 20767,47 , 14026,68 , 158,27 , 20767,47 , 14026,68 , 158,27 , 10737,21 , 7297,49 , 85,14 , 10737,21 , 7297,49 , 85,14 , 0,2 , 0,2 , {65,70,78}, 276,1 , 14259,13 , 13,5 , 4,0 , 4221,6 , 3090,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 , 715,18 , 37,5 , 8,10 , 10439,48 , 20814,71 , 10567,24 , 10439,48 , 20814,71 , 10567,24 , 10758,28 , 10786,53 , 10839,14 , 10758,28 , 10786,53 , 10839,14 , 0,2 , 0,2 , {85,90,83}, 340,3 , 14272,49 , 8,5 , 4,0 , 4227,5 , 4232,10 , 0, 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 , 716,8 , 716,8 , 120,10 , 1379,31 , 37,5 , 8,10 , 20885,75 , 20960,99 , 158,27 , 21059,75 , 21134,99 , 158,27 , 10853,33 , 10886,55 , 10941,21 , 10853,33 , 10886,55 , 10941,21 , 359,2 , 361,2 , {86,78,68}, 343,1 , 14321,33 , 8,5 , 4,0 , 4242,10 , 4252,8 , 0, 0, 1, 6, 7 }, // Vietnamese/Latin/Vietnam
- { 134, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 10,17 , 37,5 , 8,10 , 21233,52 , 21285,87 , 21372,26 , 21398,59 , 21285,87 , 21372,26 , 10962,29 , 10991,77 , 11068,15 , 11083,30 , 10991,77 , 11068,15 , 0,2 , 0,2 , {71,66,80}, 125,1 , 14354,92 , 4,4 , 4,0 , 4260,7 , 4267,16 , 2, 1, 1, 6, 7 }, // Welsh/Latin/UnitedKingdom
- { 135, 7, 187, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Wolof/Latin/Senegal
- { 136, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Xhosa/Latin/SouthAfrica
- { 138, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 18,7 , 25,12 , 21457,73 , 21530,121 , 158,27 , 21457,73 , 21530,121 , 158,27 , 11113,44 , 11157,69 , 85,14 , 11113,44 , 11157,69 , 85,14 , 361,5 , 363,5 , {78,71,78}, 186,1 , 14446,34 , 4,4 , 4,0 , 4283,10 , 4293,18 , 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 , 120,10 , 10,17 , 18,7 , 25,12 , 21651,74 , 21725,134 , 158,27 , 21651,74 , 21725,134 , 158,27 , 11226,44 , 11270,69 , 85,14 , 11226,44 , 11270,69 , 85,14 , 366,5 , 368,5 , {88,79,70}, 212,3 , 14480,34 , 4,4 , 4,0 , 4283,10 , 4311,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 , 724,9 , 733,10 , 538,6 , 35,18 , 18,7 , 25,12 , 21859,48 , 21907,91 , 134,24 , 21859,48 , 21907,91 , 21998,24 , 11339,28 , 11367,74 , 11441,14 , 11339,28 , 11367,74 , 11441,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 14514,67 , 4,4 , 4,0 , 4327,7 , 4334,14 , 2, 1, 7, 6, 7 }, // Zulu/Latin/SouthAfrica
- { 141, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 204,8 , 204,8 , 942,10 , 491,17 , 159,5 , 412,16 , 5499,48 , 13503,83 , 134,24 , 22022,59 , 13503,83 , 134,24 , 11455,28 , 11483,51 , 2367,14 , 11534,28 , 11483,51 , 2367,14 , 371,9 , 373,11 , {78,79,75}, 198,2 , 14581,42 , 13,5 , 4,0 , 4348,7 , 4355,5 , 2, 1, 1, 6, 7 }, // NorwegianNynorsk/Latin/Norway
- { 142, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8217, 0,6 , 0,6 , 175,7 , 175,7 , 1410,9 , 1040,20 , 37,5 , 8,10 , 4928,48 , 22081,83 , 15880,24 , 4928,48 , 22081,83 , 15880,24 , 2090,28 , 2118,58 , 2176,14 , 2090,28 , 2118,58 , 2190,14 , 380,11 , 384,7 , {66,65,77}, 152,2 , 14623,174 , 13,5 , 4,0 , 4360,8 , 614,19 , 2, 1, 1, 6, 7 }, // Bosnian/Latin/BosniaAndHerzegowina
- { 142, 2, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 117,7 , 117,7 , 1033,7 , 1040,20 , 37,5 , 8,10 , 15622,48 , 22164,83 , 12112,24 , 15622,48 , 22164,83 , 12112,24 , 11562,28 , 11590,54 , 8389,14 , 11562,28 , 11590,54 , 8389,14 , 243,9 , 391,7 , {66,65,77}, 305,2 , 14797,151 , 13,5 , 4,0 , 4368,8 , 3511,19 , 2, 1, 1, 6, 7 }, // Bosnian/Cyrillic/BosniaAndHerzegowina
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 599,17 , 37,5 , 8,10 , 22247,102 , 22349,140 , 158,27 , 22247,102 , 22349,140 , 158,27 , 11644,30 , 11674,57 , 85,14 , 11644,30 , 11674,57 , 85,14 , 85,4 , 83,4 , {71,66,80}, 125,1 , 0,7 , 4,4 , 4,0 , 4376,5 , 4381,12 , 2, 1, 1, 6, 7 }, // Manx/Latin/IsleOfMan
- { 145, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 98,16 , 37,5 , 8,10 , 22489,46 , 22535,130 , 158,27 , 22489,46 , 22535,130 , 158,27 , 11731,28 , 11759,61 , 85,14 , 11731,28 , 11759,61 , 85,14 , 85,4 , 83,4 , {71,66,80}, 125,1 , 0,7 , 4,4 , 4,0 , 4393,8 , 4401,14 , 2, 1, 1, 6, 7 }, // Cornish/Latin/UnitedKingdom
- { 146, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 707,8 , 715,18 , 18,7 , 25,12 , 22665,48 , 22713,192 , 158,27 , 22665,48 , 22713,192 , 158,27 , 11820,28 , 11848,49 , 11897,14 , 11820,28 , 11848,49 , 11897,14 , 391,2 , 398,2 , {71,72,83}, 175,3 , 14948,17 , 4,4 , 4,0 , 4415,4 , 4419,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 , 952,6 , 98,16 , 18,7 , 25,12 , 22905,87 , 22905,87 , 158,27 , 22905,87 , 22905,87 , 158,27 , 6938,32 , 11911,55 , 85,14 , 6938,32 , 11911,55 , 85,14 , 205,5 , 400,5 , {73,78,82}, 127,1 , 0,7 , 8,5 , 4,0 , 4424,6 , 2621,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 0,6 , 0,6 , 120,10 , 10,17 , 18,7 , 25,12 , 22992,48 , 23040,86 , 158,27 , 22992,48 , 23040,86 , 158,27 , 11966,29 , 11995,57 , 85,14 , 11966,29 , 11995,57 , 85,14 , 45,4 , 405,4 , {78,71,78}, 186,1 , 14965,12 , 4,4 , 4,0 , 4430,4 , 1342,7 , 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 , 120,10 , 10,17 , 37,5 , 8,10 , 23126,48 , 23174,189 , 23363,24 , 23126,48 , 23174,189 , 23363,24 , 12052,28 , 12080,74 , 12154,14 , 12052,28 , 12080,74 , 12154,14 , 393,9 , 409,7 , {75,69,83}, 2,3 , 14977,23 , 4,4 , 4,0 , 4434,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {78,71,78}, 186,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {78,71,78}, 186,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 , 257,7 , 257,7 , 27,8 , 1419,27 , 37,5 , 8,10 , 23387,48 , 23435,77 , 23512,24 , 23387,48 , 23435,77 , 23512,24 , 12168,28 , 12196,50 , 3068,14 , 12168,28 , 12196,50 , 3068,14 , 402,2 , 416,2 , {69,85,82}, 14,1 , 3120,20 , 8,5 , 4,0 , 4441,6 , 4447,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Venda/Latin/SouthAfrica
- { 161, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 743,11 , 754,10 , 538,6 , 1446,23 , 428,12 , 440,17 , 23536,48 , 23584,87 , 23671,24 , 23536,48 , 23584,87 , 23671,24 , 12246,28 , 12274,44 , 12318,14 , 12246,28 , 12274,44 , 12318,14 , 404,3 , 418,5 , {71,72,83}, 175,3 , 15000,37 , 4,4 , 4,0 , 4453,6 , 4459,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 , 743,11 , 754,10 , 538,6 , 1446,23 , 37,5 , 8,10 , 23536,48 , 23584,87 , 23671,24 , 23536,48 , 23584,87 , 23671,24 , 12246,28 , 12274,44 , 12318,14 , 12246,28 , 12274,44 , 12318,14 , 404,3 , 418,5 , {88,79,70}, 212,3 , 15037,106 , 4,4 , 4,0 , 4453,6 , 4471,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 300,6 , 10,17 , 18,7 , 25,12 , 23695,59 , 23754,95 , 158,27 , 23695,59 , 23754,95 , 158,27 , 12332,21 , 12353,57 , 85,14 , 12332,21 , 12353,57 , 85,14 , 0,2 , 0,2 , {85,83,68}, 6,1 , 0,7 , 4,4 , 4,0 , 4482,14 , 4496,19 , 2, 1, 7, 6, 7 }, // Hawaiian/Latin/UnitedStates
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {78,71,78}, 186,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 764,9 , 773,8 , 538,6 , 35,18 , 18,7 , 25,12 , 23849,48 , 23897,88 , 23985,38 , 23849,48 , 23897,88 , 23849,48 , 12410,28 , 12438,55 , 12410,28 , 12410,28 , 12438,55 , 12410,28 , 0,2 , 0,2 , {80,72,80}, 187,1 , 15143,58 , 4,4 , 4,0 , 4515,8 , 4523,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 24023,86 , 134,24 , 7287,48 , 24023,86 , 134,24 , 12493,28 , 12521,63 , 3622,14 , 12493,28 , 12521,63 , 3622,14 , 95,5 , 423,4 , {67,72,70}, 231,3 , 15201,55 , 13,5 , 4,0 , 4532,16 , 4548,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 24023,86 , 134,24 , 7287,48 , 24023,86 , 134,24 , 12493,28 , 12521,63 , 3622,14 , 12493,28 , 12521,63 , 3622,14 , 95,5 , 423,4 , {69,85,82}, 14,1 , 8402,19 , 13,5 , 4,0 , 4532,16 , 4555,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 , 272,9 , 272,9 , 175,8 , 544,18 , 37,5 , 8,10 , 7287,48 , 24023,86 , 134,24 , 7287,48 , 24023,86 , 134,24 , 12493,28 , 12521,63 , 3622,14 , 12493,28 , 12521,63 , 3622,14 , 95,5 , 423,4 , {67,72,70}, 231,3 , 15201,55 , 13,5 , 4,0 , 4532,16 , 4565,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 , 158,27 , 24109,38 , 158,27 , 158,27 , 24109,38 , 158,27 , 12584,21 , 12605,28 , 12633,14 , 12584,21 , 12605,28 , 12633,14 , 407,2 , 427,2 , {67,78,89}, 332,1 , 0,7 , 55,6 , 4,0 , 4578,3 , 4581,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Low German/Latin/Germany
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // South Ndebele/Latin/SouthAfrica
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Northern Sotho/Latin/SouthAfrica
- { 173, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 231,8 , 231,8 , 53,10 , 63,17 , 37,5 , 8,10 , 24147,59 , 24206,145 , 24351,24 , 24147,59 , 24206,145 , 24351,24 , 12647,33 , 12680,75 , 12755,14 , 12647,33 , 12680,75 , 12755,14 , 409,11 , 429,13 , {78,79,75}, 198,2 , 15256,63 , 13,5 , 4,0 , 4583,15 , 4598,5 , 2, 1, 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 , 231,8 , 231,8 , 53,10 , 63,17 , 37,5 , 8,10 , 24375,85 , 24206,145 , 24351,24 , 24375,85 , 24206,145 , 24351,24 , 12647,33 , 12769,65 , 12834,14 , 12647,33 , 12769,65 , 12834,14 , 409,11 , 429,13 , {69,85,82}, 14,1 , 15319,23 , 13,5 , 4,0 , 4583,15 , 4603,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 , 231,8 , 231,8 , 53,10 , 63,17 , 37,5 , 8,10 , 24147,59 , 24206,145 , 24351,24 , 24147,59 , 24206,145 , 24351,24 , 12647,33 , 12680,75 , 12755,14 , 12647,33 , 12680,75 , 12755,14 , 409,11 , 429,13 , {83,69,75}, 198,2 , 15342,63 , 13,5 , 4,0 , 4583,15 , 4609,6 , 2, 1, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {84,87,68}, 344,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 , 120,10 , 10,17 , 37,5 , 8,10 , 24460,48 , 24508,88 , 24596,24 , 24460,48 , 24508,88 , 24596,24 , 12848,28 , 12876,62 , 12938,14 , 12848,28 , 12876,62 , 12938,14 , 420,6 , 442,3 , {75,69,83}, 2,3 , 15405,24 , 4,4 , 4,0 , 4615,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 , 120,10 , 10,17 , 37,5 , 8,10 , 24620,48 , 24668,221 , 24889,24 , 24620,48 , 24668,221 , 24889,24 , 12952,28 , 12980,105 , 13085,14 , 12952,28 , 12980,105 , 13085,14 , 426,10 , 445,10 , {75,69,83}, 2,3 , 15405,24 , 4,4 , 4,0 , 4623,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 , 439,8 , 98,16 , 37,5 , 8,10 , 24913,48 , 24961,77 , 25038,24 , 24913,48 , 24961,77 , 25038,24 , 13099,28 , 13127,59 , 13186,14 , 13099,28 , 13127,59 , 13186,14 , 436,6 , 455,7 , {88,79,70}, 212,3 , 15429,26 , 13,5 , 4,0 , 4630,6 , 4636,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Senegal
- { 177, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 439,8 , 98,16 , 37,5 , 8,10 , 24913,48 , 24961,77 , 25038,24 , 24913,48 , 24961,77 , 25038,24 , 13099,28 , 13127,59 , 13186,14 , 13099,28 , 13127,59 , 13186,14 , 436,6 , 455,7 , {88,65,70}, 32,4 , 15455,25 , 13,5 , 4,0 , 4630,6 , 4644,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Cameroon
- { 177, 7, 91, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 439,8 , 98,16 , 37,5 , 8,10 , 24913,48 , 24961,77 , 25038,24 , 24913,48 , 24961,77 , 25038,24 , 13099,28 , 13127,59 , 13186,14 , 13099,28 , 13127,59 , 13186,14 , 436,6 , 455,7 , {71,78,70}, 223,2 , 0,7 , 13,5 , 4,0 , 4630,6 , 4652,4 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Guinea
- { 177, 7, 136, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 439,8 , 98,16 , 18,7 , 25,12 , 24913,48 , 24961,77 , 25038,24 , 24913,48 , 24961,77 , 25038,24 , 13099,28 , 13127,59 , 13186,14 , 13099,28 , 13127,59 , 13186,14 , 436,6 , 455,7 , {77,82,79}, 226,2 , 15480,22 , 13,5 , 4,0 , 4630,6 , 4656,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Mauritania
- { 178, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 37,5 , 8,10 , 25062,48 , 25110,185 , 25295,24 , 25062,48 , 25110,185 , 25295,24 , 13200,28 , 13228,63 , 13291,14 , 13200,28 , 13228,63 , 13291,14 , 442,6 , 462,8 , {75,69,83}, 2,3 , 15502,23 , 4,4 , 4,0 , 4664,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 , 120,10 , 10,17 , 37,5 , 8,10 , 25319,48 , 25367,173 , 25540,24 , 25319,48 , 25367,173 , 25540,24 , 13305,28 , 13333,105 , 13438,14 , 13305,28 , 13333,105 , 13438,14 , 448,7 , 470,5 , {75,69,83}, 2,3 , 15525,25 , 4,4 , 4,0 , 4670,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 , 439,8 , 978,27 , 37,5 , 8,10 , 25564,48 , 25612,88 , 134,24 , 25564,48 , 25612,88 , 134,24 , 13452,28 , 13480,55 , 13535,14 , 13452,28 , 13480,55 , 13535,14 , 0,2 , 0,2 , {77,90,78}, 286,3 , 15550,28 , 0,4 , 4,0 , 4678,4 , 3242,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 , 120,10 , 10,17 , 18,7 , 25,12 , 25700,52 , 25752,112 , 25864,24 , 25700,52 , 25752,112 , 25864,24 , 13549,28 , 13577,50 , 13627,14 , 13549,28 , 13577,50 , 13627,14 , 0,2 , 0,2 , {85,83,68}, 167,3 , 15578,24 , 4,4 , 4,0 , 4682,10 , 1801,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 , 120,10 , 10,17 , 37,5 , 8,10 , 25888,39 , 25927,194 , 26121,24 , 25888,39 , 25927,194 , 26121,24 , 13641,29 , 13670,65 , 13735,14 , 13641,29 , 13670,65 , 13735,14 , 455,8 , 475,7 , {84,90,83}, 200,3 , 15602,25 , 4,4 , 4,0 , 4692,9 , 1626,8 , 0, 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 , 439,8 , 98,16 , 37,5 , 8,10 , 26145,48 , 26193,81 , 26274,24 , 26145,48 , 26193,81 , 26274,24 , 13749,30 , 13779,47 , 85,14 , 13749,30 , 13779,47 , 85,14 , 463,6 , 482,8 , {77,65,68}, 0,0 , 15627,21 , 0,4 , 4,0 , 4701,7 , 4708,6 , 2, 1, 6, 5, 6 }, // 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 , 439,8 , 98,16 , 37,5 , 8,10 , 26298,48 , 26346,81 , 26427,24 , 26298,48 , 26346,81 , 26427,24 , 13826,30 , 13856,48 , 85,14 , 13826,30 , 13856,48 , 85,14 , 469,6 , 490,8 , {77,65,68}, 0,0 , 15648,21 , 0,4 , 4,0 , 4714,10 , 4724,6 , 2, 1, 6, 5, 6 }, // Tachelhit/Latin/Morocco
- { 184, 7, 3, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 439,8 , 98,16 , 18,7 , 25,12 , 26451,48 , 26499,84 , 26583,24 , 26451,48 , 26499,84 , 26583,24 , 13904,30 , 13934,51 , 13985,14 , 13904,30 , 13934,51 , 13985,14 , 475,7 , 498,9 , {68,90,68}, 210,2 , 15669,21 , 0,4 , 4,0 , 4730,9 , 4739,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26607,48 , 26655,152 , 134,24 , 26607,48 , 26655,152 , 134,24 , 13999,28 , 14027,74 , 14101,14 , 13999,28 , 14027,74 , 14101,14 , 0,2 , 0,2 , {85,71,88}, 205,3 , 15690,26 , 4,4 , 4,0 , 4747,10 , 1691,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26807,48 , 26855,254 , 27109,24 , 26807,48 , 26855,254 , 27109,24 , 14115,28 , 14143,82 , 14225,14 , 14115,28 , 14143,82 , 14225,14 , 482,7 , 507,7 , {84,90,83}, 200,3 , 15716,29 , 0,4 , 4,0 , 4757,6 , 4763,10 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 27133,87 , 134,24 , 17841,48 , 27133,87 , 134,24 , 14239,28 , 14267,62 , 14329,14 , 14239,28 , 14267,62 , 14329,14 , 489,5 , 514,9 , {84,90,83}, 200,3 , 15745,27 , 4,4 , 4,0 , 4773,8 , 1626,8 , 0, 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 , 439,8 , 98,16 , 37,5 , 8,10 , 27220,47 , 27267,92 , 27359,24 , 27220,47 , 27267,92 , 27359,24 , 14343,28 , 14371,44 , 14415,14 , 14343,28 , 14371,44 , 14415,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 15772,24 , 4,4 , 4,0 , 4781,9 , 2145,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {88,79,70}, 212,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 , 120,10 , 10,17 , 37,5 , 8,10 , 27383,48 , 27431,207 , 27638,24 , 27383,48 , 27431,207 , 27638,24 , 14429,28 , 14457,64 , 14521,14 , 14429,28 , 14457,64 , 14521,14 , 494,2 , 523,2 , {75,69,83}, 2,3 , 15405,24 , 4,4 , 4,0 , 4790,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 , 0,6 , 0,6 , 538,6 , 35,18 , 18,7 , 25,12 , 27662,36 , 27698,58 , 27756,24 , 27662,36 , 27698,58 , 27756,24 , 14535,28 , 14563,49 , 14612,14 , 14535,28 , 14563,49 , 14612,14 , 496,3 , 525,6 , {85,83,68}, 6,1 , 15796,19 , 4,4 , 4,0 , 4796,3 , 4799,4 , 2, 1, 7, 6, 7 }, // Cherokee/Cherokee/UnitedStates
- { 191, 7, 137, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 439,8 , 98,16 , 37,5 , 8,10 , 27780,47 , 27827,68 , 27895,24 , 27780,47 , 27827,68 , 27895,24 , 14626,27 , 14653,48 , 14701,14 , 14626,27 , 14653,48 , 14701,14 , 0,2 , 0,2 , {77,85,82}, 184,2 , 15815,21 , 55,6 , 4,0 , 4803,14 , 4817,5 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 27919,264 , 134,24 , 17841,48 , 27919,264 , 134,24 , 14715,28 , 14743,133 , 13735,14 , 14715,28 , 14743,133 , 13735,14 , 499,4 , 531,5 , {84,90,83}, 200,3 , 15745,27 , 4,4 , 4,0 , 4822,10 , 1626,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 28183,83 , 28266,111 , 28377,24 , 28183,83 , 28266,111 , 28377,24 , 14876,36 , 14912,63 , 14975,14 , 14876,36 , 14912,63 , 14975,14 , 503,3 , 536,3 , {84,90,83}, 200,3 , 15836,29 , 55,6 , 4,0 , 4832,8 , 4840,9 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 28401,48 , 28449,97 , 134,24 , 28401,48 , 28449,97 , 134,24 , 14989,28 , 15017,66 , 15083,14 , 14989,28 , 15017,66 , 15083,14 , 0,2 , 0,2 , {85,71,88}, 205,3 , 15865,26 , 0,4 , 4,0 , 4849,7 , 4856,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 , 120,10 , 10,17 , 18,7 , 25,12 , 28546,48 , 28594,83 , 28677,24 , 28546,48 , 28594,83 , 28677,24 , 15097,80 , 15097,80 , 85,14 , 15097,80 , 15097,80 , 85,14 , 506,8 , 539,7 , {90,77,87}, 137,1 , 0,7 , 4,4 , 4,0 , 4863,9 , 1795,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 , 175,7 , 175,7 , 439,8 , 1469,27 , 37,5 , 8,10 , 28701,48 , 28749,85 , 134,24 , 28701,48 , 28749,85 , 134,24 , 15177,28 , 15205,73 , 15278,14 , 15177,28 , 15205,73 , 15292,14 , 89,2 , 87,2 , {67,86,69}, 285,1 , 15891,43 , 13,5 , 4,0 , 4872,12 , 4884,10 , 2, 1, 1, 6, 7 }, // Kabuverdianu/Latin/CapeVerde
- { 197, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 37,5 , 8,10 , 28834,48 , 28882,86 , 28968,24 , 28834,48 , 28882,86 , 28968,24 , 15306,28 , 15334,51 , 15385,14 , 15306,28 , 15334,51 , 15385,14 , 514,2 , 546,2 , {75,69,83}, 2,3 , 15405,24 , 4,4 , 4,0 , 4894,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 , 120,10 , 10,17 , 37,5 , 8,10 , 28992,49 , 29041,121 , 29162,24 , 28992,49 , 29041,121 , 29162,24 , 15399,28 , 15427,53 , 15480,14 , 15399,28 , 15427,53 , 15480,14 , 516,6 , 548,10 , {75,69,83}, 2,3 , 15934,26 , 4,4 , 4,0 , 4900,8 , 4908,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 , 120,10 , 10,17 , 18,7 , 25,12 , 0,48 , 29186,136 , 134,24 , 0,48 , 29186,136 , 134,24 , 15494,23 , 15517,92 , 15609,14 , 15494,23 , 15517,92 , 15609,14 , 522,7 , 558,5 , {78,65,68}, 6,1 , 15960,22 , 4,4 , 4,0 , 4920,13 , 4933,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 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 27133,87 , 134,24 , 17841,48 , 27133,87 , 134,24 , 14239,28 , 14267,62 , 14329,14 , 14239,28 , 14267,62 , 14329,14 , 489,5 , 514,9 , {84,90,83}, 200,3 , 15745,27 , 4,4 , 4,0 , 4941,9 , 1626,8 , 0, 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 , 430,8 , 430,8 , 1496,10 , 1506,23 , 37,5 , 8,10 , 29322,59 , 29381,87 , 134,24 , 29468,48 , 29381,87 , 134,24 , 15623,28 , 15651,72 , 3622,14 , 15623,28 , 15651,72 , 3622,14 , 529,16 , 563,16 , {69,85,82}, 14,1 , 15982,11 , 13,5 , 4,0 , 4950,6 , 4956,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29516,51 , 29567,132 , 158,27 , 29516,51 , 29567,132 , 158,27 , 14239,28 , 15723,58 , 13735,14 , 14239,28 , 15723,58 , 13735,14 , 545,9 , 579,6 , {75,69,83}, 2,3 , 15993,25 , 4,4 , 4,0 , 4967,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29516,51 , 29567,132 , 158,27 , 29516,51 , 29567,132 , 158,27 , 14239,28 , 15723,58 , 13735,14 , 14239,28 , 15723,58 , 13735,14 , 545,9 , 579,6 , {84,90,83}, 200,3 , 16018,28 , 4,4 , 4,0 , 4967,3 , 4970,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 28401,48 , 28449,97 , 134,24 , 28401,48 , 28449,97 , 134,24 , 15781,35 , 15816,65 , 15881,14 , 15781,35 , 15816,65 , 15881,14 , 554,6 , 585,6 , {85,71,88}, 205,3 , 15865,26 , 13,5 , 4,0 , 4978,7 , 4856,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29699,48 , 17889,84 , 134,24 , 29699,48 , 17889,84 , 134,24 , 15895,21 , 15916,75 , 85,14 , 15895,21 , 15916,75 , 85,14 , 85,4 , 83,4 , {75,69,83}, 2,3 , 16046,23 , 4,4 , 72,6 , 4985,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29747,48 , 17889,84 , 134,24 , 29747,48 , 17889,84 , 134,24 , 15991,28 , 9305,60 , 14329,14 , 15991,28 , 9305,60 , 14329,14 , 560,9 , 591,8 , {84,90,83}, 200,3 , 16069,28 , 13,5 , 4,0 , 4992,6 , 4998,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 29795,48 , 29843,94 , 29937,24 , 29795,48 , 29843,94 , 29937,24 , 16019,28 , 16047,69 , 16116,14 , 16019,28 , 16047,69 , 16116,14 , 569,9 , 599,6 , {85,71,88}, 205,3 , 16097,28 , 4,4 , 4,0 , 5006,6 , 1691,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29795,48 , 29843,94 , 29937,24 , 29795,48 , 29843,94 , 29937,24 , 16019,28 , 16047,69 , 16116,14 , 16019,28 , 16047,69 , 16116,14 , 569,9 , 599,6 , {75,69,83}, 2,3 , 16125,27 , 4,4 , 4,0 , 5006,6 , 5012,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 439,8 , 98,16 , 37,5 , 8,10 , 29961,46 , 30007,88 , 30095,24 , 29961,46 , 30007,88 , 30095,24 , 16130,28 , 16158,53 , 16211,14 , 16130,28 , 16158,53 , 16211,14 , 578,6 , 605,6 , {88,79,70}, 212,3 , 16152,23 , 0,4 , 4,0 , 5017,11 , 5028,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 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 27133,87 , 134,24 , 17841,48 , 27133,87 , 134,24 , 14239,28 , 14267,62 , 14329,14 , 14239,28 , 14267,62 , 14329,14 , 489,5 , 514,9 , {84,90,83}, 200,3 , 15745,27 , 0,4 , 4,0 , 5033,6 , 1626,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 30119,48 , 30167,186 , 30353,24 , 30119,48 , 30167,186 , 30353,24 , 16225,28 , 16253,69 , 16322,14 , 16225,28 , 16253,69 , 16322,14 , 584,2 , 611,2 , {75,69,83}, 2,3 , 16175,23 , 0,4 , 4,0 , 5039,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26607,48 , 26655,152 , 134,24 , 26607,48 , 26655,152 , 134,24 , 13999,28 , 14027,74 , 14101,14 , 13999,28 , 14027,74 , 14101,14 , 0,2 , 0,2 , {85,71,88}, 205,3 , 15690,26 , 4,4 , 4,0 , 5045,6 , 1691,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 , 120,10 , 10,17 , 37,5 , 8,10 , 30377,48 , 30425,86 , 30511,24 , 30377,48 , 30425,86 , 30511,24 , 16336,28 , 16364,48 , 16412,14 , 16336,28 , 16364,48 , 16412,14 , 586,9 , 613,10 , {77,65,68}, 0,0 , 16198,22 , 13,5 , 4,0 , 5051,17 , 5068,6 , 2, 1, 6, 5, 6 }, // 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 , 439,8 , 98,16 , 37,5 , 8,10 , 29961,46 , 30007,88 , 30095,24 , 29961,46 , 30007,88 , 30095,24 , 16426,28 , 16454,54 , 16211,14 , 16426,28 , 16454,54 , 16211,14 , 578,6 , 605,6 , {88,79,70}, 212,3 , 16152,23 , 0,4 , 4,0 , 5074,15 , 5028,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 , 120,10 , 10,17 , 37,5 , 8,10 , 17841,48 , 30535,84 , 134,24 , 17841,48 , 30535,84 , 134,24 , 16508,28 , 16536,63 , 16599,14 , 16508,28 , 16536,63 , 16599,14 , 595,5 , 623,8 , {84,90,83}, 200,3 , 16220,27 , 0,4 , 4,0 , 5089,9 , 1626,8 , 0, 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 , 538,6 , 35,18 , 18,7 , 25,12 , 30619,88 , 30619,88 , 30707,31 , 30619,88 , 30619,88 , 30707,31 , 16613,33 , 16646,54 , 16700,19 , 16613,33 , 16646,54 , 16700,19 , 600,3 , 631,6 , {73,78,82}, 127,1 , 16247,10 , 8,5 , 4,0 , 5098,4 , 2621,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 , 30738,48 , 10650,80 , 158,27 , 30738,48 , 10650,80 , 158,27 , 16719,74 , 16719,74 , 85,14 , 16719,74 , 16719,74 , 85,14 , 0,2 , 0,2 , {82,85,66}, 129,1 , 16257,43 , 13,5 , 4,0 , 5102,7 , 5109,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 , 781,8 , 781,8 , 1529,10 , 1539,23 , 37,5 , 8,10 , 30786,65 , 30851,117 , 30968,30 , 30786,65 , 30998,117 , 30968,30 , 16793,37 , 16830,68 , 10588,14 , 16793,37 , 16830,68 , 10588,14 , 0,2 , 0,2 , {82,85,66}, 129,1 , 16300,44 , 13,5 , 4,0 , 5114,19 , 5133,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {82,85,66}, 129,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 , 439,8 , 98,16 , 37,5 , 8,10 , 31115,49 , 31164,99 , 31263,24 , 31115,49 , 31164,99 , 31263,24 , 16898,28 , 16926,50 , 16976,14 , 16898,28 , 16926,50 , 16976,14 , 603,5 , 637,6 , {67,68,70}, 217,2 , 16344,24 , 0,4 , 4,0 , 5140,8 , 5148,16 , 2, 1, 1, 6, 7 }, // LubaKatanga/Latin/CongoKinshasa
- { 231, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 789,10 , 789,10 , 175,8 , 544,18 , 37,5 , 8,10 , 31287,48 , 31335,85 , 134,24 , 31420,59 , 31335,85 , 134,24 , 16990,28 , 17018,65 , 3622,14 , 17083,35 , 17018,65 , 3622,14 , 608,5 , 643,8 , {69,85,82}, 14,1 , 8402,19 , 13,5 , 4,0 , 5164,14 , 5178,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 439,8 , 98,16 , 37,5 , 8,10 , 31479,48 , 31527,195 , 31722,24 , 31479,48 , 31527,195 , 31722,24 , 17118,28 , 17146,72 , 17218,14 , 17118,28 , 17146,72 , 17218,14 , 613,3 , 651,3 , {88,65,70}, 32,4 , 16368,21 , 0,4 , 4,0 , 5188,5 , 5193,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 , 439,8 , 98,16 , 37,5 , 8,10 , 31746,48 , 31794,90 , 31884,24 , 31746,48 , 31794,90 , 31884,24 , 17232,28 , 17260,70 , 17330,14 , 17232,28 , 17260,70 , 17330,14 , 616,10 , 654,9 , {88,65,70}, 32,4 , 16389,22 , 13,5 , 4,0 , 5200,5 , 5205,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 , 439,8 , 98,16 , 37,5 , 8,10 , 29961,46 , 30007,88 , 30095,24 , 29961,46 , 30007,88 , 30095,24 , 16426,28 , 17344,53 , 17397,14 , 16426,28 , 17344,53 , 17397,14 , 626,8 , 663,10 , {88,79,70}, 212,3 , 16152,23 , 0,4 , 4,0 , 5213,10 , 5223,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 , 439,8 , 98,16 , 37,5 , 8,10 , 31908,49 , 31957,99 , 32056,24 , 31908,49 , 31957,99 , 32056,24 , 17411,28 , 17439,45 , 17484,14 , 17411,28 , 17439,45 , 17484,14 , 634,5 , 673,6 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5228,5 , 1942,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 , 439,8 , 98,16 , 37,5 , 8,10 , 32080,36 , 32116,82 , 32198,24 , 32080,36 , 32116,82 , 32198,24 , 17498,28 , 17526,50 , 17576,14 , 17498,28 , 17526,50 , 17576,14 , 0,2 , 0,2 , {88,79,70}, 212,3 , 16411,23 , 13,5 , 4,0 , 5233,5 , 5238,7 , 0, 0, 1, 6, 7 }, // JolaFonyi/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 , 439,8 , 98,16 , 37,5 , 8,10 , 32222,50 , 32272,141 , 32413,24 , 32222,50 , 32272,141 , 32413,24 , 17590,30 , 17620,85 , 17705,14 , 17590,30 , 17620,85 , 17705,14 , 639,7 , 679,9 , {88,65,70}, 32,4 , 16434,23 , 13,5 , 4,0 , 5245,6 , 5251,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 , 439,8 , 98,16 , 37,5 , 8,10 , 32437,39 , 32476,191 , 158,27 , 32437,39 , 32476,191 , 158,27 , 17719,29 , 17748,45 , 17793,14 , 17719,29 , 17748,45 , 17793,14 , 646,6 , 688,7 , {88,65,70}, 32,4 , 16457,11 , 13,5 , 4,0 , 5258,5 , 5263,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 , 120,10 , 10,17 , 37,5 , 8,10 , 32667,48 , 32715,213 , 32928,24 , 32667,48 , 32715,213 , 32928,24 , 17807,28 , 17835,59 , 17894,14 , 17807,28 , 17835,59 , 17894,14 , 652,8 , 695,10 , {77,90,78}, 286,3 , 0,7 , 55,6 , 4,0 , 5270,5 , 5275,10 , 2, 1, 7, 6, 7 }, // MakhuwaMeetto/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 , 439,8 , 98,16 , 37,5 , 8,10 , 32952,48 , 33000,139 , 33139,24 , 32952,48 , 33000,139 , 33139,24 , 17908,28 , 17936,74 , 18010,14 , 17908,28 , 17936,74 , 18010,14 , 660,5 , 705,5 , {88,65,70}, 32,4 , 16468,17 , 4,4 , 4,0 , 5285,6 , 5291,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 , 439,8 , 98,16 , 37,5 , 8,10 , 33163,51 , 33214,143 , 158,27 , 33163,51 , 33214,143 , 158,27 , 18024,30 , 18054,89 , 18143,14 , 18024,30 , 18054,89 , 18143,14 , 665,4 , 710,4 , {88,65,70}, 32,4 , 16485,20 , 13,5 , 4,0 , 5298,6 , 5304,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 , 1562,9 , 98,16 , 18,7 , 457,12 , 33357,54 , 33411,96 , 33507,24 , 33357,54 , 33411,96 , 33507,24 , 18157,38 , 18195,79 , 18274,14 , 18157,38 , 18195,79 , 18274,14 , 669,2 , 714,2 , {83,83,80}, 125,1 , 0,7 , 4,4 , 4,0 , 5311,9 , 0,0 , 2, 1, 1, 6, 7 }, // Nuer/Latin/SouthSudan
- { 248, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1571,6 , 1577,30 , 37,5 , 8,10 , 33531,75 , 33606,121 , 33727,24 , 33531,75 , 33606,121 , 33727,24 , 18288,21 , 18309,73 , 18382,14 , 18288,21 , 18309,73 , 18382,14 , 671,2 , 716,2 , {82,85,66}, 129,1 , 0,7 , 55,6 , 4,0 , 5320,9 , 5329,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 , 120,10 , 10,17 , 37,5 , 8,10 , 33751,48 , 33799,117 , 158,27 , 33751,48 , 33799,117 , 158,27 , 18396,28 , 18424,60 , 18484,14 , 18396,28 , 18424,60 , 18484,14 , 673,9 , 718,9 , {84,90,83}, 200,3 , 16505,25 , 0,4 , 4,0 , 5338,9 , 5347,9 , 0, 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 , 439,8 , 98,16 , 37,5 , 8,10 , 29961,46 , 30007,88 , 30095,24 , 29961,46 , 30007,88 , 30095,24 , 16426,28 , 16454,54 , 16211,14 , 16426,28 , 16454,54 , 16211,14 , 626,8 , 663,10 , {88,79,70}, 212,3 , 16152,23 , 0,4 , 4,0 , 5356,13 , 5223,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 , 120,10 , 10,17 , 18,7 , 25,12 , 33916,50 , 33916,50 , 158,27 , 33916,50 , 33916,50 , 158,27 , 18498,30 , 18498,30 , 85,14 , 18498,30 , 18498,30 , 85,14 , 0,2 , 0,2 , {76,82,68}, 6,1 , 16530,15 , 4,4 , 4,0 , 5369,2 , 5371,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 , 120,10 , 10,17 , 18,7 , 25,12 , 33966,81 , 33966,81 , 158,27 , 33966,81 , 33966,81 , 158,27 , 18528,48 , 18528,48 , 85,14 , 18528,48 , 18528,48 , 85,14 , 0,2 , 0,2 , {76,82,68}, 6,1 , 16545,20 , 4,4 , 4,0 , 5375,3 , 5378,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 , 272,9 , 272,9 , 53,10 , 544,18 , 37,5 , 8,10 , 34047,48 , 34095,99 , 34194,24 , 34047,48 , 34095,99 , 34194,24 , 18576,28 , 18604,53 , 18657,14 , 18576,28 , 18604,53 , 18657,14 , 0,2 , 0,2 , {67,72,70}, 0,0 , 0,7 , 55,6 , 4,0 , 5386,6 , 5392,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 , 439,8 , 98,16 , 37,5 , 8,10 , 34218,51 , 34269,191 , 158,27 , 34218,51 , 34269,191 , 158,27 , 18671,21 , 18692,71 , 18763,14 , 18671,21 , 18692,71 , 18763,14 , 682,8 , 727,8 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5398,6 , 5404,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 , 591,7 , 591,7 , 300,6 , 396,22 , 37,5 , 8,10 , 34460,48 , 34508,85 , 34593,24 , 34617,48 , 34665,117 , 34593,24 , 18777,28 , 18805,54 , 3345,14 , 18777,28 , 18805,54 , 3345,14 , 690,12 , 735,11 , {69,85,82}, 14,1 , 3120,20 , 13,5 , 4,0 , 5411,9 , 2393,6 , 2, 1, 1, 6, 7 }, // Asturian/Latin/Spain
- { 257, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 799,11 , 799,11 , 810,16 , 826,9 , 53,10 , 715,18 , 37,5 , 8,10 , 34782,174 , 34782,174 , 158,27 , 34782,174 , 34782,174 , 158,27 , 18859,60 , 18859,60 , 18919,25 , 18859,60 , 18859,60 , 18919,25 , 702,8 , 746,13 , {88,65,70}, 32,4 , 16565,12 , 8,5 , 4,0 , 5420,5 , 5425,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 , 1607,10 , 599,17 , 37,5 , 8,10 , 34956,102 , 34956,102 , 158,27 , 34956,102 , 34956,102 , 158,27 , 18944,54 , 18944,54 , 18998,21 , 18944,54 , 18944,54 , 18998,21 , 0,2 , 0,2 , {88,65,70}, 32,4 , 16577,16 , 55,6 , 4,0 , 5432,4 , 5436,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 , 715,18 , 37,5 , 8,10 , 35058,137 , 35195,142 , 35337,36 , 35058,137 , 35195,142 , 35337,36 , 19019,49 , 19019,49 , 19068,21 , 19019,49 , 19019,49 , 19068,21 , 0,2 , 0,2 , {88,65,70}, 32,4 , 16593,12 , 8,5 , 4,0 , 5443,5 , 5448,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 , 1617,32 , 37,5 , 8,10 , 35373,165 , 35373,165 , 158,27 , 35373,165 , 35373,165 , 158,27 , 19089,111 , 19089,111 , 85,14 , 19089,111 , 19089,111 , 85,14 , 710,9 , 759,8 , {88,65,70}, 32,4 , 16605,16 , 8,5 , 4,0 , 5455,16 , 5471,7 , 0, 0, 1, 6, 7 }, // Ngiemboon/Latin/Cameroon
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 538,6 , 35,18 , 18,7 , 25,12 , 35538,180 , 35538,180 , 158,27 , 35538,180 , 35538,180 , 158,27 , 19200,87 , 19200,87 , 85,14 , 19200,87 , 19200,87 , 19287,14 , 0,2 , 0,2 , {85,83,68}, 6,1 , 0,7 , 55,6 , 4,0 , 5478,12 , 5490,22 , 2, 1, 7, 6, 7 }, // Lakota/Latin/UnitedStates
- { 314, 9, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 439,8 , 98,16 , 37,5 , 8,10 , 26145,48 , 26193,81 , 26274,24 , 26145,48 , 26193,81 , 26274,24 , 13749,30 , 19301,48 , 85,14 , 13749,30 , 19301,48 , 85,14 , 463,6 , 482,8 , {77,65,68}, 0,0 , 15627,21 , 0,4 , 4,0 , 5512,8 , 4708,6 , 2, 1, 6, 5, 6 }, // 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 35718,105 , 35718,105 , 158,27 , 35718,105 , 35718,105 , 158,27 , 19349,58 , 19349,58 , 19407,14 , 19349,58 , 19349,58 , 19407,14 , 0,2 , 0,2 , {73,81,68}, 0,0 , 16621,20 , 8,5 , 4,0 , 5520,14 , 5534,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 , 35718,105 , 35718,105 , 158,27 , 35718,105 , 35718,105 , 158,27 , 19349,58 , 19349,58 , 19407,14 , 19349,58 , 19349,58 , 19407,14 , 0,2 , 0,2 , {73,82,82}, 0,0 , 16641,19 , 8,5 , 4,0 , 5520,14 , 5539,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 , 197,7 , 197,7 , 114,6 , 544,18 , 55,4 , 59,9 , 35823,48 , 35871,85 , 15880,24 , 35956,60 , 36016,93 , 15880,24 , 19421,28 , 19449,53 , 19502,14 , 19421,28 , 19449,53 , 19502,14 , 719,9 , 767,10 , {69,85,82}, 14,1 , 16660,27 , 13,5 , 4,0 , 5544,14 , 5558,6 , 2, 1, 1, 6, 7 }, // LowerSorbian/Latin/Germany
- { 318, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 197,7 , 197,7 , 114,6 , 544,18 , 469,12 , 59,9 , 36109,48 , 36157,86 , 15880,24 , 36243,60 , 36303,93 , 15880,24 , 19516,28 , 19544,53 , 19597,14 , 19516,28 , 19544,53 , 19597,14 , 719,9 , 777,9 , {69,85,82}, 14,1 , 16687,29 , 13,5 , 4,0 , 5564,15 , 5579,6 , 2, 1, 1, 6, 7 }, // UpperSorbian/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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {67,65,68}, 247,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {71,78,70}, 223,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Nko/Nko/Guinea
- { 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {71,84,81}, 314,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {83,69,75}, 198,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {83,69,75}, 198,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Lule Sami/Latin/Sweden
- { 326, 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 , 344,48 , 36396,140 , 158,27 , 344,48 , 344,48 , 158,27 , 19611,21 , 19632,70 , 85,14 , 19611,21 , 19702,73 , 19775,14 , 0,2 , 0,2 , {69,85,82}, 14,1 , 16716,11 , 55,6 , 4,0 , 5585,11 , 5596,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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {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 , 344,48 , 344,48 , 158,27 , 344,48 , 344,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {65,85,68}, 347,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 , 13772,70 , 13772,70 , 158,27 , 13772,70 , 13772,70 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {73,82,82}, 349,3 , 16727,27 , 8,5 , 4,0 , 5601,7 , 3104,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 , 36536,77 , 36536,77 , 158,27 , 36536,77 , 36536,77 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 5608,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 , 36536,77 , 36536,77 , 158,27 , 36536,77 , 36536,77 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , {73,81,68}, 0,0 , 0,7 , 8,5 , 4,0 , 5608,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, 182,5 , 182,5 , 835,5 , 835,5 , 418,8 , 447,14 , 174,6 , 191,13 , 4357,39 , 4357,39 , 158,27 , 4357,39 , 4357,39 , 158,27 , 2069,21 , 2027,28 , 2055,14 , 2069,21 , 2027,28 , 2055,14 , 79,2 , 77,2 , {72,75,68}, 142,3 , 16754,11 , 4,4 , 4,0 , 5619,2 , 568,14 , 2, 1, 7, 6, 7 }, // Cantonese/Traditional Han/HongKong
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 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
+ // 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,18 , 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/SouthAfrica
+ { 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 , 98,16 , 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 , {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 , 114,6 , 10,17 , 18,7 , 42,13 , 567,48 , 615,78 , 693,24 , 717,48 , 765,78 , 843,24 , 310,28 , 338,58 , 396,14 , 310,28 , 410,58 , 396,14 , 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 , 114,6 , 10,17 , 37,5 , 8,10 , 567,48 , 615,78 , 693,24 , 717,48 , 765,78 , 843,24 , 310,28 , 338,58 , 396,14 , 310,28 , 410,58 , 396,14 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {77,75,68}, 11,3 , 198,54 , 13,5 , 4,0 , 51,5 , 64,8 , 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 , 114,6 , 10,17 , 37,5 , 8,10 , 567,48 , 615,78 , 693,24 , 717,48 , 765,78 , 843,24 , 310,28 , 338,58 , 396,14 , 310,28 , 410,58 , 396,14 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 252,21 , 13,5 , 4,0 , 51,5 , 72,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 , 120,10 , 130,17 , 18,7 , 25,12 , 867,46 , 913,61 , 974,24 , 867,46 , 913,61 , 974,24 , 468,27 , 495,28 , 523,14 , 468,27 , 495,28 , 523,14 , 18,3 , 17,4 , 58,3 , 61,23 , 22,23 , {69,84,66}, 15,2 , 273,34 , 4,4 , 4,0 , 78,4 , 82,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {69,71,80}, 17,5 , 307,81 , 13,5 , 4,0 , 87,7 , 94,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1097,71 , 1097,71 , 1168,24 , 1097,71 , 1097,71 , 1168,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {68,90,68}, 22,5 , 388,102 , 13,5 , 4,0 , 87,7 , 97,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {66,72,68}, 27,5 , 490,91 , 13,5 , 4,0 , 87,7 , 104,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {88,65,70}, 32,4 , 581,112 , 13,5 , 4,0 , 87,7 , 111,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 , 147,10 , 157,18 , 37,5 , 8,10 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {75,77,70}, 36,7 , 693,105 , 13,5 , 4,0 , 87,7 , 115,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {68,74,70}, 43,3 , 798,84 , 13,5 , 4,0 , 87,7 , 124,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {69,82,78}, 46,3 , 882,91 , 13,5 , 4,0 , 87,7 , 130,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1192,92 , 1192,92 , 1284,24 , 1308,92 , 1192,92 , 1284,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {73,81,68}, 49,5 , 973,84 , 13,5 , 4,0 , 87,7 , 137,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 , 147,10 , 157,18 , 55,4 , 59,9 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {73,76,83}, 54,1 , 1057,133 , 13,5 , 4,0 , 87,7 , 143,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1192,92 , 1192,92 , 1284,24 , 1192,92 , 1192,92 , 1284,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {74,79,68}, 55,5 , 1190,84 , 13,5 , 4,0 , 87,7 , 150,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {75,87,68}, 60,5 , 1274,84 , 13,5 , 4,0 , 87,7 , 156,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1192,92 , 1192,92 , 1284,24 , 1192,92 , 1192,92 , 1284,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {76,66,80}, 65,5 , 1358,84 , 13,5 , 4,0 , 87,7 , 162,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {76,89,68}, 70,5 , 1442,88 , 13,5 , 4,0 , 87,7 , 167,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1400,72 , 1400,72 , 1472,24 , 1400,72 , 1400,72 , 1472,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {77,82,79}, 75,5 , 1530,112 , 13,5 , 4,0 , 87,7 , 172,9 , 0, 0, 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 , 147,10 , 157,18 , 37,5 , 8,10 , 1496,70 , 1496,70 , 1566,24 , 1496,70 , 1496,70 , 1566,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {77,65,68}, 80,5 , 1642,87 , 13,5 , 4,0 , 87,7 , 181,6 , 2, 1, 6, 5, 6 }, // 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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {79,77,82}, 85,5 , 1729,77 , 13,5 , 4,0 , 87,7 , 187,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1192,92 , 1192,92 , 1284,24 , 1192,92 , 1192,92 , 1284,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {73,76,83}, 54,1 , 1057,133 , 13,5 , 4,0 , 87,7 , 192,18 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/PalestinianTerritories
+ { 8, 1, 175, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {81,65,82}, 90,5 , 1806,70 , 13,5 , 4,0 , 87,7 , 210,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {83,65,82}, 95,5 , 1876,77 , 13,5 , 4,0 , 87,7 , 213,24 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/SaudiArabia
+ { 8, 1, 194, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {83,79,83}, 100,1 , 1953,77 , 13,5 , 4,0 , 87,7 , 237,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {83,68,71}, 101,4 , 2030,91 , 13,5 , 4,0 , 87,7 , 244,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1192,92 , 1192,92 , 1284,24 , 1192,92 , 1192,92 , 1284,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {83,89,80}, 105,5 , 2121,77 , 13,5 , 4,0 , 87,7 , 251,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 , 147,10 , 157,18 , 18,7 , 25,12 , 1097,71 , 1097,71 , 1168,24 , 1097,71 , 1097,71 , 1168,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {84,78,68}, 110,5 , 2198,95 , 13,5 , 4,0 , 87,7 , 256,4 , 3, 0, 7, 5, 6 }, // 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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {65,69,68}, 115,5 , 2293,91 , 13,5 , 4,0 , 87,7 , 260,24 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/UnitedArabEmirates
+ { 8, 1, 236, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {77,65,68}, 80,5 , 1642,87 , 13,5 , 4,0 , 87,7 , 284,15 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/WesternSahara
+ { 8, 1, 237, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {89,69,82}, 120,5 , 2384,70 , 13,5 , 4,0 , 87,7 , 299,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 , 147,10 , 157,18 , 18,7 , 25,12 , 998,75 , 998,75 , 1073,24 , 998,75 , 998,75 , 1073,24 , 537,52 , 537,52 , 589,14 , 537,52 , 537,52 , 589,14 , 21,1 , 21,1 , 84,4 , 88,41 , 22,23 , {83,83,80}, 125,1 , 2454,132 , 13,5 , 4,0 , 87,7 , 304,12 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/SouthSudan
+ { 9, 10, 11, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 65,7 , 65,7 , 175,8 , 183,20 , 37,5 , 8,10 , 1590,48 , 1638,94 , 1732,24 , 1590,48 , 1756,106 , 1732,24 , 603,28 , 631,62 , 693,14 , 603,28 , 631,62 , 693,14 , 0,2 , 0,2 , 129,6 , 135,17 , 22,23 , {65,77,68}, 126,1 , 2586,46 , 8,5 , 4,0 , 316,7 , 323,8 , 0, 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 , 0,6 , 0,6 , 203,8 , 211,18 , 68,8 , 76,12 , 1862,62 , 1924,88 , 158,27 , 1862,62 , 1924,88 , 158,27 , 707,37 , 744,58 , 85,14 , 707,37 , 744,58 , 85,14 , 22,9 , 22,7 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 0,7 , 8,5 , 4,0 , 331,7 , 338,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 , 72,8 , 72,8 , 175,8 , 229,17 , 37,5 , 8,10 , 2012,48 , 2060,77 , 158,27 , 2012,48 , 2137,77 , 158,27 , 802,27 , 829,67 , 99,14 , 802,27 , 829,67 , 99,14 , 0,2 , 0,2 , 152,4 , 5,17 , 22,23 , {65,90,78}, 128,1 , 2632,58 , 8,5 , 4,0 , 342,10 , 352,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 , 175,8 , 229,17 , 37,5 , 8,10 , 2214,48 , 2262,77 , 158,27 , 2214,48 , 2339,77 , 158,27 , 896,27 , 923,67 , 99,14 , 896,27 , 923,67 , 99,14 , 31,2 , 29,2 , 45,4 , 5,17 , 22,23 , {65,90,78}, 128,1 , 2690,12 , 8,5 , 4,0 , 362,10 , 372,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}, 129,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, 45, 43, 101, 8220, 8221, 8220, 8221, 0,6 , 0,6 , 80,9 , 80,9 , 246,6 , 252,26 , 37,5 , 88,12 , 2416,60 , 2476,93 , 2569,24 , 2416,60 , 2593,93 , 2569,24 , 990,28 , 1018,68 , 1086,14 , 990,28 , 1100,68 , 1086,14 , 0,2 , 0,2 , 156,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 2702,20 , 13,5 , 4,0 , 382,7 , 389,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 , 89,9 , 89,9 , 278,6 , 211,18 , 18,7 , 25,12 , 2686,90 , 2686,90 , 2776,33 , 2809,77 , 2686,90 , 2776,33 , 1168,37 , 1205,58 , 1263,18 , 1168,37 , 1281,58 , 1263,18 , 0,2 , 0,2 , 163,4 , 5,17 , 22,23 , {66,68,84}, 130,1 , 2722,49 , 0,4 , 4,0 , 397,5 , 402,8 , 2, 1, 5, 6, 7 }, // Bengali/Bengali/Bangladesh
+ { 15, 11, 100, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 89,9 , 89,9 , 278,6 , 211,18 , 18,7 , 25,12 , 2686,90 , 2686,90 , 2776,33 , 2809,77 , 2686,90 , 2776,33 , 1168,37 , 1205,58 , 1263,18 , 1168,37 , 1281,58 , 1263,18 , 0,2 , 0,2 , 163,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 2771,43 , 0,4 , 4,0 , 397,5 , 410,4 , 2, 1, 7, 7, 7 }, // Bengali/Bengali/India
+ { 16, 31, 25, 46, 44, 59, 37, 3872, 45, 43, 101, 8220, 8221, 8216, 8217, 98,9 , 98,9 , 98,9 , 98,9 , 53,10 , 284,30 , 100,22 , 122,27 , 2886,63 , 2949,191 , 3140,27 , 3167,27 , 3194,132 , 3326,27 , 1339,34 , 1373,79 , 1452,27 , 1339,34 , 1373,79 , 1452,27 , 33,5 , 31,6 , 45,4 , 5,17 , 22,23 , {66,84,78}, 131,3 , 2814,15 , 4,4 , 4,0 , 414,6 , 420,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 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 3353,63 , 3416,78 , 3494,36 , 3530,63 , 3416,78 , 3494,36 , 1479,33 , 1512,43 , 1555,18 , 1479,33 , 1512,43 , 1555,18 , 38,4 , 37,4 , 167,7 , 174,17 , 191,23 , {69,85,82}, 14,1 , 2829,36 , 13,5 , 4,0 , 425,9 , 434,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 , 107,7 , 107,7 , 314,12 , 326,22 , 55,4 , 59,9 , 3593,49 , 3642,82 , 3724,24 , 3593,49 , 3642,82 , 3724,24 , 1573,21 , 1594,55 , 1649,14 , 1573,21 , 1594,55 , 1649,14 , 42,6 , 41,6 , 214,7 , 5,17 , 22,23 , {66,71,78}, 134,3 , 2865,47 , 13,5 , 4,0 , 439,9 , 448,8 , 2, 1, 1, 6, 7 }, // Bulgarian/Cyrillic/Bulgaria
+ { 21, 25, 147, 46, 44, 4170, 37, 4160, 45, 43, 101, 8220, 8221, 8216, 8217, 114,5 , 114,5 , 119,10 , 119,10 , 348,8 , 98,16 , 37,5 , 149,10 , 3748,43 , 3791,88 , 3879,24 , 3748,43 , 3791,88 , 3879,24 , 1663,54 , 1663,54 , 1717,14 , 1663,54 , 1663,54 , 1717,14 , 48,5 , 47,3 , 221,5 , 5,17 , 22,23 , {77,77,75}, 137,1 , 2912,27 , 13,5 , 4,0 , 456,6 , 456,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 , 129,7 , 129,7 , 356,7 , 326,22 , 37,5 , 159,11 , 3903,48 , 3951,95 , 4046,24 , 4070,48 , 4118,98 , 4046,24 , 1731,21 , 1752,56 , 1808,14 , 1731,21 , 1752,56 , 1808,14 , 0,2 , 0,2 , 226,5 , 231,17 , 22,23 , {66,89,78}, 0,2 , 2939,89 , 13,5 , 4,0 , 462,10 , 472,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 , 136,9 , 145,9 , 278,6 , 98,16 , 18,7 , 25,12 , 4216,71 , 4216,71 , 4287,24 , 4216,71 , 4216,71 , 4287,24 , 1822,47 , 1822,47 , 1869,14 , 1822,47 , 1822,47 , 1869,14 , 0,2 , 0,2 , 248,2 , 5,17 , 22,23 , {75,72,82}, 138,1 , 3028,29 , 0,4 , 4,0 , 480,5 , 485,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 , 154,7 , 154,7 , 278,6 , 363,22 , 55,4 , 59,9 , 4311,60 , 4371,82 , 4453,36 , 4489,93 , 4582,115 , 4453,36 , 1883,28 , 1911,60 , 1971,21 , 1883,28 , 1911,60 , 1971,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 492,6 , 498,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 , 154,7 , 154,7 , 278,6 , 363,22 , 55,4 , 59,9 , 4311,60 , 4371,82 , 4453,36 , 4489,93 , 4582,115 , 4453,36 , 1883,28 , 1911,60 , 1971,21 , 1883,28 , 1911,60 , 1971,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 492,6 , 505,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 , 154,7 , 154,7 , 278,6 , 363,22 , 55,4 , 59,9 , 4311,60 , 4371,82 , 4453,36 , 4489,93 , 4582,115 , 4453,36 , 1883,28 , 1911,60 , 1971,21 , 1883,28 , 1911,60 , 1971,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 492,6 , 512,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 , 154,7 , 154,7 , 278,6 , 363,22 , 55,4 , 59,9 , 4311,60 , 4371,82 , 4453,36 , 4489,93 , 4582,115 , 4453,36 , 1883,28 , 1911,60 , 1971,21 , 1883,28 , 1911,60 , 1971,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 492,6 , 518,6 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Italy
+ { 25, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 161,5 , 161,5 , 166,5 , 166,5 , 385,8 , 393,13 , 170,6 , 176,11 , 4697,39 , 4736,38 , 158,27 , 4697,39 , 4736,38 , 158,27 , 1992,21 , 2013,28 , 2041,14 , 1992,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 250,2 , 252,21 , 22,23 , {67,78,89}, 139,1 , 3077,13 , 4,4 , 4,0 , 524,4 , 528,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, 161,5 , 161,5 , 166,5 , 166,5 , 278,6 , 393,13 , 170,6 , 176,11 , 4697,39 , 4736,38 , 158,27 , 4697,39 , 4736,38 , 158,27 , 1992,21 , 2013,28 , 2041,14 , 1992,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 250,2 , 252,21 , 22,23 , {72,75,68}, 140,3 , 3090,11 , 4,4 , 4,0 , 524,4 , 530,9 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/HongKong
+ { 25, 5, 126, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 161,5 , 161,5 , 166,5 , 166,5 , 278,6 , 393,13 , 170,6 , 176,11 , 4697,39 , 4736,38 , 158,27 , 4697,39 , 4736,38 , 158,27 , 1992,21 , 2013,28 , 2041,14 , 1992,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 250,2 , 252,21 , 22,23 , {77,79,80}, 143,4 , 3101,13 , 4,4 , 4,0 , 524,4 , 539,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, 161,5 , 161,5 , 166,5 , 166,5 , 27,8 , 393,13 , 170,6 , 176,11 , 4697,39 , 4736,38 , 158,27 , 4697,39 , 4736,38 , 158,27 , 1992,21 , 2013,28 , 2041,14 , 1992,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 250,2 , 252,21 , 22,23 , {83,71,68}, 6,1 , 3114,15 , 4,4 , 4,0 , 524,4 , 548,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, 161,5 , 161,5 , 171,5 , 171,5 , 406,8 , 393,13 , 170,6 , 187,13 , 4697,39 , 4697,39 , 158,27 , 4697,39 , 4697,39 , 158,27 , 2055,21 , 2013,28 , 2041,14 , 2055,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 273,3 , 5,17 , 22,23 , {72,75,68}, 140,3 , 3090,11 , 18,5 , 4,0 , 551,4 , 555,9 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/HongKong
+ { 25, 6, 126, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 161,5 , 161,5 , 171,5 , 171,5 , 406,8 , 393,13 , 170,6 , 187,13 , 4697,39 , 4697,39 , 158,27 , 4697,39 , 4697,39 , 158,27 , 2055,21 , 2013,28 , 2041,14 , 2055,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 273,3 , 5,17 , 22,23 , {77,79,80}, 143,4 , 3129,13 , 18,5 , 4,0 , 551,4 , 564,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, 161,5 , 161,5 , 166,5 , 166,5 , 385,8 , 414,14 , 170,6 , 187,13 , 4697,39 , 4697,39 , 158,27 , 4697,39 , 4697,39 , 158,27 , 2055,21 , 2013,28 , 2041,14 , 2055,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {84,87,68}, 6,1 , 3142,13 , 4,4 , 4,0 , 551,4 , 573,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 , 154,7 , 154,7 , 428,13 , 441,19 , 37,5 , 88,12 , 4774,49 , 4823,94 , 4917,39 , 4774,49 , 4956,98 , 4917,39 , 2076,28 , 2104,58 , 2162,14 , 2076,28 , 2104,58 , 2176,14 , 0,2 , 0,2 , 276,7 , 5,17 , 22,23 , {72,82,75}, 147,3 , 3155,60 , 13,5 , 4,0 , 575,8 , 583,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 , 154,7 , 154,7 , 460,9 , 441,19 , 37,5 , 88,12 , 4774,49 , 4823,94 , 4917,39 , 4774,49 , 4956,98 , 4917,39 , 2076,28 , 2104,58 , 2176,14 , 2076,28 , 2104,58 , 2176,14 , 0,2 , 0,2 , 276,7 , 5,17 , 22,23 , {66,65,77}, 150,2 , 3215,85 , 13,5 , 4,0 , 575,8 , 591,19 , 2, 1, 1, 6, 7 }, // Croatian/Latin/BosniaAndHerzegowina
+ { 28, 7, 57, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 176,7 , 176,7 , 175,8 , 469,17 , 55,4 , 59,9 , 5054,48 , 5102,82 , 158,27 , 5054,48 , 5184,84 , 158,27 , 2190,21 , 2211,49 , 2260,14 , 2190,21 , 2211,49 , 2260,14 , 60,4 , 57,4 , 283,5 , 5,17 , 22,23 , {67,90,75}, 152,2 , 3300,68 , 13,5 , 4,0 , 610,7 , 617,5 , 2, 0, 1, 6, 7 }, // Czech/Latin/CzechRepublic
+ { 29, 7, 58, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 183,8 , 183,8 , 120,10 , 486,23 , 200,5 , 205,10 , 5268,59 , 5327,84 , 134,24 , 5268,59 , 5327,84 , 134,24 , 2274,28 , 2302,51 , 2353,14 , 2367,35 , 2302,51 , 2353,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {68,75,75}, 154,3 , 3368,42 , 13,5 , 4,0 , 622,5 , 627,7 , 2, 1, 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 , 183,8 , 183,8 , 120,10 , 486,23 , 215,7 , 76,12 , 5268,59 , 5327,84 , 134,24 , 5268,59 , 5327,84 , 134,24 , 2274,28 , 2302,51 , 2353,14 , 2367,35 , 2302,51 , 2353,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {68,75,75}, 154,3 , 3368,42 , 13,5 , 4,0 , 622,5 , 634,8 , 2, 1, 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 , 348,8 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3410,19 , 13,5 , 4,0 , 642,10 , 652,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 , 348,8 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,87,71}, 157,4 , 3429,55 , 13,5 , 4,0 , 642,10 , 661,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 , 509,7 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3410,19 , 13,5 , 4,0 , 642,10 , 666,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 , 348,8 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,78,71}, 161,4 , 3484,97 , 13,5 , 4,0 , 642,10 , 672,7 , 2, 1, 1, 6, 7 }, // Dutch/Latin/CuraSao
+ { 30, 7, 202, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 348,8 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {83,82,68}, 6,1 , 3581,58 , 13,5 , 4,0 , 642,10 , 679,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 , 348,8 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3639,61 , 13,5 , 4,0 , 642,10 , 687,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 , 348,8 , 98,16 , 37,5 , 8,10 , 5411,59 , 5470,88 , 134,24 , 5411,59 , 5470,88 , 134,24 , 2402,21 , 2423,59 , 2482,14 , 2402,21 , 2423,59 , 2482,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,78,71}, 161,4 , 3484,97 , 13,5 , 4,0 , 642,10 , 706,12 , 2, 1, 1, 6, 7 }, // Dutch/Latin/SintMaarten
+ { 31, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 718,16 , 734,13 , 2, 1, 7, 6, 7 }, // English/Latin/UnitedStates
+ { 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}, 165,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // English/Deseret/UnitedStates
+ { 31, 7, 4, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 754,14 , 2, 1, 7, 6, 7 }, // English/Latin/AmericanSamoa
+ { 31, 7, 7, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 768,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 , 191,10 , 201,9 , 120,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 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 776,17 , 2, 1, 7, 6, 7 }, // English/Latin/AntiguaAndBarbuda
+ { 31, 7, 13, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 201,9 , 201,9 , 278,6 , 10,17 , 18,7 , 25,12 , 5558,59 , 48,86 , 134,24 , 5558,59 , 48,86 , 134,24 , 2496,35 , 28,57 , 2531,25 , 2496,35 , 28,57 , 2531,25 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 793,18 , 811,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 8,5 , 4,0 , 747,7 , 820,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 , 191,10 , 201,9 , 120,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 , {66,83,68}, 6,1 , 3885,53 , 4,4 , 4,0 , 747,7 , 827,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 , 191,10 , 201,9 , 120,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 , {66,66,68}, 6,1 , 3938,56 , 4,4 , 4,0 , 747,7 , 834,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 , 191,10 , 201,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 13,5 , 4,0 , 747,7 , 842,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 , 191,10 , 201,9 , 27,8 , 80,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,90,68}, 6,1 , 3994,47 , 4,4 , 4,0 , 747,7 , 849,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 , 191,10 , 201,9 , 120,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 , {66,77,68}, 6,1 , 4041,53 , 4,4 , 4,0 , 747,7 , 855,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 , 191,10 , 201,9 , 27,8 , 80,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,87,80}, 168,1 , 4094,50 , 4,4 , 4,0 , 747,7 , 862,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 870,30 , 2, 1, 1, 6, 7 }, // English/Latin/BritishIndianOceanTerritory
+ { 31, 7, 35, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 516,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 , {66,73,70}, 169,3 , 4144,53 , 4,4 , 4,0 , 747,7 , 900,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 4197,83 , 4,4 , 4,0 , 747,7 , 907,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 , 191,10 , 201,9 , 53,10 , 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 , {67,65,68}, 6,1 , 4280,53 , 4,4 , 4,0 , 915,16 , 931,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 , 191,10 , 201,9 , 120,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 , {75,89,68}, 6,1 , 4333,71 , 4,4 , 4,0 , 747,7 , 937,14 , 2, 1, 1, 6, 7 }, // English/Latin/CaymanIslands
+ { 31, 7, 45, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 747,7 , 951,16 , 2, 1, 1, 6, 7 }, // English/Latin/ChristmasIsland
+ { 31, 7, 46, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 747,7 , 967,23 , 2, 1, 1, 6, 7 }, // English/Latin/CocosIslands
+ { 31, 7, 51, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4404,62 , 4,4 , 4,0 , 747,7 , 990,12 , 2, 1, 1, 6, 7 }, // English/Latin/CookIslands
+ { 31, 7, 56, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {69,85,82}, 14,1 , 3865,20 , 4,4 , 4,0 , 747,7 , 1002,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 , 191,10 , 201,9 , 120,10 , 10,17 , 200,5 , 205,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 , {68,75,75}, 154,3 , 4466,44 , 13,5 , 4,0 , 747,7 , 1008,7 , 2, 1, 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 , 191,10 , 201,9 , 120,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 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 1015,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 , 191,10 , 201,9 , 120,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 , {69,82,78}, 46,3 , 4510,50 , 4,4 , 4,0 , 747,7 , 1023,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {70,75,80}, 125,1 , 4560,74 , 4,4 , 4,0 , 747,7 , 1030,16 , 2, 1, 1, 6, 7 }, // English/Latin/FalklandIslands
+ { 31, 7, 72, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {70,74,68}, 6,1 , 4634,47 , 4,4 , 4,0 , 747,7 , 1046,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 , 191,10 , 201,9 , 120,10 , 10,17 , 222,4 , 226,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 13,5 , 4,0 , 747,7 , 1050,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 125,1 , 4681,32 , 4,4 , 4,0 , 747,7 , 1057,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 , 191,10 , 201,9 , 120,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 , {71,77,68}, 172,1 , 4713,50 , 4,4 , 4,0 , 747,7 , 1065,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 13,5 , 4,0 , 747,7 , 1071,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 , 191,10 , 201,9 , 120,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 , {71,72,83}, 173,3 , 4763,47 , 4,4 , 4,0 , 747,7 , 1078,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {71,73,80}, 125,1 , 4810,53 , 4,4 , 4,0 , 747,7 , 1083,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 , 191,10 , 201,9 , 120,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 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 1092,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 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 1099,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 , 191,10 , 201,9 , 120,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 , {71,89,68}, 6,1 , 4863,56 , 4,4 , 4,0 , 747,7 , 1103,6 , 0, 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 , 191,10 , 201,9 , 406,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {72,75,68}, 140,3 , 4919,56 , 4,4 , 4,0 , 747,7 , 1109,19 , 2, 1, 7, 6, 7 }, // English/Latin/HongKong
+ { 31, 7, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 27,8 , 98,16 , 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 , {73,78,82}, 127,1 , 4975,44 , 8,5 , 4,0 , 747,7 , 1128,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 , 191,10 , 201,9 , 120,10 , 98,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 , 3865,20 , 4,4 , 4,0 , 747,7 , 1133,7 , 2, 1, 7, 6, 7 }, // English/Latin/Ireland
+ { 31, 7, 105, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {73,76,83}, 54,1 , 5019,62 , 4,4 , 4,0 , 747,7 , 1140,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 , 191,10 , 201,9 , 278,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {74,77,68}, 6,1 , 5081,53 , 4,4 , 4,0 , 747,7 , 1146,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {75,69,83}, 2,3 , 5134,53 , 4,4 , 4,0 , 747,7 , 1153,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 , 191,10 , 201,9 , 120,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,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 747,7 , 1158,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 , 191,10 , 201,9 , 120,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 , {90,65,82}, 5,1 , 5187,61 , 4,4 , 4,0 , 747,7 , 1166,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 , 191,10 , 201,9 , 120,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 , {76,82,68}, 6,1 , 5248,53 , 4,4 , 4,0 , 747,7 , 1173,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 , 191,10 , 201,9 , 120,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 , {77,79,80}, 143,4 , 5301,53 , 4,4 , 4,0 , 747,7 , 1180,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {77,71,65}, 176,2 , 5354,54 , 4,4 , 4,0 , 747,7 , 1195,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 , 191,10 , 201,9 , 120,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 , {77,87,75}, 178,2 , 5408,53 , 4,4 , 4,0 , 747,7 , 1205,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 , 191,10 , 201,9 , 120,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 , {77,89,82}, 180,2 , 5461,59 , 4,4 , 4,0 , 747,7 , 1211,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 4,4 , 4,0 , 747,7 , 1219,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 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 1224,16 , 2, 1, 7, 6, 7 }, // English/Latin/MarshallIslands
+ { 31, 7, 137, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {77,85,82}, 182,2 , 5520,53 , 4,4 , 4,0 , 747,7 , 1240,9 , 0, 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 , 191,10 , 201,9 , 120,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 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 1249,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 1259,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 , 191,10 , 201,9 , 120,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 , {78,65,68}, 6,1 , 5573,53 , 4,4 , 4,0 , 747,7 , 1269,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 747,7 , 1276,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 8,5 , 23,6 , 747,7 , 1281,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 , 191,10 , 201,9 , 509,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4404,62 , 4,4 , 4,0 , 747,7 , 1292,11 , 2, 1, 7, 6, 7 }, // English/Latin/NewZealand
+ { 31, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {78,71,78}, 184,1 , 5626,50 , 4,4 , 4,0 , 747,7 , 1303,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4404,62 , 4,4 , 4,0 , 747,7 , 1310,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 747,7 , 1314,14 , 2, 1, 1, 6, 7 }, // English/Latin/NorfolkIsland
+ { 31, 7, 160, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 1328,24 , 2, 1, 1, 6, 7 }, // English/Latin/NorthernMarianaIslands
+ { 31, 7, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {80,75,82}, 182,2 , 5676,53 , 4,4 , 4,0 , 747,7 , 1352,8 , 0, 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 , 191,10 , 201,9 , 120,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 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 1360,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 , 191,10 , 201,9 , 120,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 , {80,71,75}, 137,1 , 5729,73 , 4,4 , 4,0 , 747,7 , 1365,16 , 2, 1, 1, 6, 7 }, // English/Latin/PapuaNewGuinea
+ { 31, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {80,72,80}, 185,1 , 5802,53 , 4,4 , 4,0 , 747,7 , 1381,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4404,62 , 4,4 , 4,0 , 747,7 , 1392,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 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 1408,11 , 2, 1, 7, 6, 7 }, // English/Latin/PuertoRico
+ { 31, 7, 179, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {82,87,70}, 186,2 , 5855,47 , 4,4 , 4,0 , 747,7 , 1419,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 , 191,10 , 201,9 , 120,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 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 1425,17 , 2, 1, 1, 6, 7 }, // English/Latin/SaintKittsAndNevis
+ { 31, 7, 181, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 1442,9 , 2, 1, 1, 6, 7 }, // English/Latin/SaintLucia
+ { 31, 7, 182, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {88,67,68}, 6,1 , 3735,71 , 4,4 , 4,0 , 747,7 , 1451,24 , 2, 1, 1, 6, 7 }, // English/Latin/SaintVincentAndTheGrenadines
+ { 31, 7, 183, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {87,83,84}, 188,3 , 5902,40 , 4,4 , 4,0 , 747,7 , 1475,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {83,67,82}, 191,2 , 5942,59 , 4,4 , 4,0 , 747,7 , 1480,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 , 191,10 , 201,9 , 120,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 , {83,76,76}, 193,2 , 6001,68 , 4,4 , 4,0 , 747,7 , 1490,12 , 0, 0, 1, 6, 7 }, // English/Latin/SierraLeone
+ { 31, 7, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 278,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {83,71,68}, 6,1 , 6069,56 , 4,4 , 4,0 , 747,7 , 1502,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 13,5 , 29,7 , 747,7 , 1511,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 , 191,10 , 201,9 , 120,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 , {83,66,68}, 6,1 , 6125,74 , 4,4 , 4,0 , 747,7 , 1519,15 , 2, 1, 1, 6, 7 }, // English/Latin/SolomonIslands
+ { 31, 7, 195, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 522,10 , 80,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 , {90,65,82}, 5,1 , 5187,61 , 4,4 , 4,0 , 747,7 , 1534,12 , 2, 1, 7, 6, 7 }, // English/Latin/SouthAfrica
+ { 31, 7, 199, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {83,72,80}, 125,1 , 6199,56 , 4,4 , 4,0 , 747,7 , 1546,10 , 2, 1, 1, 6, 7 }, // English/Latin/SaintHelena
+ { 31, 7, 201, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {83,68,71}, 0,0 , 6255,50 , 4,4 , 4,0 , 747,7 , 1556,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 , 191,10 , 201,9 , 120,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 , {83,90,76}, 195,1 , 6305,53 , 4,4 , 4,0 , 747,7 , 1561,9 , 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 , 191,10 , 201,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {83,69,75}, 196,2 , 6358,47 , 13,5 , 4,0 , 747,7 , 1570,6 , 2, 1, 1, 6, 7 }, // English/Latin/Sweden
+ { 31, 7, 206, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {67,72,70}, 0,0 , 6405,41 , 8,5 , 36,5 , 747,7 , 1576,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {84,90,83}, 198,3 , 6446,62 , 4,4 , 4,0 , 747,7 , 1587,8 , 0, 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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4404,62 , 4,4 , 4,0 , 747,7 , 1595,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 , 191,10 , 201,9 , 120,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 , {84,79,80}, 201,2 , 6508,49 , 4,4 , 4,0 , 747,7 , 1602,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 , 191,10 , 201,9 , 120,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 , {84,84,68}, 6,1 , 6557,80 , 4,4 , 4,0 , 747,7 , 1607,17 , 2, 1, 7, 6, 7 }, // English/Latin/TrinidadAndTobago
+ { 31, 7, 219, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 1624,22 , 2, 1, 1, 6, 7 }, // English/Latin/TurksAndCaicosIslands
+ { 31, 7, 220, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3806,59 , 4,4 , 4,0 , 747,7 , 1646,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,71,88}, 203,3 , 6637,56 , 4,4 , 4,0 , 747,7 , 1652,6 , 0, 0, 1, 6, 7 }, // English/Latin/Uganda
+ { 31, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 201,9 , 201,9 , 120,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}, 125,1 , 6693,47 , 4,4 , 4,0 , 1658,15 , 1673,14 , 2, 1, 1, 6, 7 }, // English/Latin/UnitedKingdom
+ { 31, 7, 226, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 1687,21 , 2, 1, 7, 6, 7 }, // English/Latin/UnitedStatesMinorOutlyingIslands
+ { 31, 7, 229, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {86,85,86}, 206,2 , 6740,44 , 4,4 , 4,0 , 747,7 , 1708,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 , 191,10 , 201,9 , 120,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 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 1715,22 , 2, 1, 1, 6, 7 }, // English/Latin/BritishVirginIslands
+ { 31, 7, 234, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 516,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 , 3700,35 , 4,4 , 4,0 , 747,7 , 1737,19 , 2, 1, 7, 6, 7 }, // English/Latin/UnitedStatesVirginIslands
+ { 31, 7, 239, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , {90,77,87}, 137,1 , 6784,50 , 4,4 , 4,0 , 747,7 , 1756,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 , 191,10 , 201,9 , 406,8 , 80,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 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 1762,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 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 165,3 , 3700,35 , 4,4 , 4,0 , 747,7 , 1770,12 , 2, 1, 1, 6, 7 }, // English/Latin/DiegoGarcia
+ { 31, 7, 251, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 125,1 , 4681,32 , 4,4 , 4,0 , 747,7 , 1782,11 , 2, 1, 1, 6, 7 }, // English/Latin/IsleOfMan
+ { 31, 7, 252, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 125,1 , 4681,32 , 4,4 , 4,0 , 747,7 , 1793,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 , 191,10 , 201,9 , 120,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 , {83,83,80}, 125,1 , 6834,68 , 4,4 , 4,0 , 747,7 , 1799,11 , 2, 1, 1, 6, 7 }, // English/Latin/SouthSudan
+ { 31, 7, 256, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 191,10 , 201,9 , 120,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 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,78,71}, 161,4 , 6902,95 , 4,4 , 4,0 , 747,7 , 1810,12 , 2, 1, 1, 6, 7 }, // English/Latin/SintMaarten
+ { 33, 7, 68, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 210,8 , 210,8 , 175,8 , 532,18 , 37,5 , 8,10 , 5617,59 , 5676,91 , 5767,24 , 5617,59 , 5676,91 , 5767,24 , 2556,14 , 2570,63 , 2556,14 , 2556,14 , 2570,63 , 2556,14 , 0,2 , 0,2 , 288,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 6997,20 , 13,5 , 4,0 , 1822,5 , 1827,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 , 183,8 , 183,8 , 175,8 , 532,18 , 37,5 , 8,10 , 5791,48 , 5839,83 , 134,24 , 5922,59 , 5839,83 , 134,24 , 2633,28 , 2661,74 , 2735,14 , 2749,35 , 2661,74 , 2735,14 , 0,2 , 0,2 , 294,3 , 297,17 , 22,23 , {68,75,75}, 196,2 , 7017,43 , 13,5 , 4,0 , 1832,8 , 1840,7 , 2, 1, 1, 6, 7 }, // Faroese/Latin/FaroeIslands
+ { 34, 7, 58, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 183,8 , 183,8 , 175,8 , 532,18 , 37,5 , 8,10 , 5791,48 , 5839,83 , 134,24 , 5922,59 , 5839,83 , 134,24 , 2633,28 , 2661,74 , 2735,14 , 2749,35 , 2661,74 , 2735,14 , 0,2 , 0,2 , 294,3 , 297,17 , 22,23 , {68,75,75}, 154,3 , 7017,43 , 13,5 , 4,0 , 1832,8 , 627,7 , 2, 1, 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 , 210,8 , 210,8 , 550,8 , 469,17 , 222,4 , 226,9 , 5981,69 , 6050,105 , 6155,24 , 6179,93 , 6272,129 , 6155,24 , 2784,21 , 2805,67 , 2872,14 , 2784,21 , 2886,81 , 2872,14 , 70,3 , 67,3 , 314,5 , 319,17 , 336,23 , {69,85,82}, 14,1 , 7060,20 , 13,5 , 4,0 , 1847,5 , 1852,5 , 2, 1, 1, 6, 7 }, // Finnish/Latin/Finland
+ { 37, 7, 74, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 1865,6 , 2, 1, 1, 6, 7 }, // French/Latin/France
+ { 37, 7, 3, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {68,90,68}, 208,2 , 7080,51 , 13,5 , 4,0 , 1857,8 , 1871,7 , 2, 1, 6, 5, 6 }, // French/Latin/Algeria
+ { 37, 7, 21, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 509,7 , 98,16 , 37,5 , 235,23 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 1878,8 , 2, 1, 1, 6, 7 }, // French/Latin/Belgium
+ { 37, 7, 23, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 1886,5 , 0, 0, 1, 6, 7 }, // French/Latin/Benin
+ { 37, 7, 34, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 1891,12 , 0, 0, 1, 6, 7 }, // French/Latin/BurkinaFaso
+ { 37, 7, 35, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {66,73,70}, 169,3 , 7190,53 , 13,5 , 4,0 , 1857,8 , 900,7 , 0, 0, 1, 6, 7 }, // French/Latin/Burundi
+ { 37, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 73,5 , 70,4 , 359,6 , 174,17 , 191,23 , {88,65,70}, 32,4 , 7243,56 , 13,5 , 4,0 , 1857,8 , 1903,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 , 218,8 , 218,8 , 558,8 , 98,16 , 258,9 , 8,10 , 6549,64 , 6464,85 , 134,24 , 6549,64 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 64,4 , 61,4 , 359,6 , 174,17 , 191,23 , {67,65,68}, 6,1 , 7299,54 , 41,8 , 4,0 , 1911,17 , 931,6 , 2, 0, 7, 6, 7 }, // French/Latin/Canada
+ { 37, 7, 41, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,65,70}, 32,4 , 7243,56 , 13,5 , 4,0 , 1857,8 , 1928,25 , 0, 0, 1, 6, 7 }, // French/Latin/CentralAfricanRepublic
+ { 37, 7, 42, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,65,70}, 32,4 , 7243,56 , 13,5 , 4,0 , 1857,8 , 1953,5 , 0, 0, 1, 6, 7 }, // French/Latin/Chad
+ { 37, 7, 48, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {75,77,70}, 213,2 , 7353,51 , 13,5 , 4,0 , 1857,8 , 1958,7 , 0, 0, 1, 6, 7 }, // French/Latin/Comoros
+ { 37, 7, 49, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {67,68,70}, 215,2 , 7404,53 , 13,5 , 4,0 , 1857,8 , 1965,14 , 2, 1, 1, 6, 7 }, // French/Latin/CongoKinshasa
+ { 37, 7, 50, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,65,70}, 32,4 , 7243,56 , 13,5 , 4,0 , 1857,8 , 1979,17 , 0, 0, 1, 6, 7 }, // French/Latin/CongoBrazzaville
+ { 37, 7, 53, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 1996,13 , 0, 0, 1, 6, 7 }, // French/Latin/IvoryCoast
+ { 37, 7, 59, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {68,74,70}, 43,3 , 7457,57 , 13,5 , 4,0 , 1857,8 , 2009,8 , 0, 0, 6, 6, 7 }, // French/Latin/Djibouti
+ { 37, 7, 66, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,65,70}, 32,4 , 7243,56 , 13,5 , 4,0 , 1857,8 , 2017,18 , 0, 0, 1, 6, 7 }, // French/Latin/EquatorialGuinea
+ { 37, 7, 76, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2035,16 , 2, 1, 1, 6, 7 }, // French/Latin/FrenchGuiana
+ { 37, 7, 77, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,80,70}, 217,4 , 7514,35 , 13,5 , 4,0 , 1857,8 , 2051,19 , 0, 0, 1, 6, 7 }, // French/Latin/FrenchPolynesia
+ { 37, 7, 79, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,65,70}, 32,4 , 7243,56 , 13,5 , 4,0 , 1857,8 , 2070,5 , 0, 0, 1, 6, 7 }, // French/Latin/Gabon
+ { 37, 7, 88, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2075,10 , 2, 1, 1, 6, 7 }, // French/Latin/Guadeloupe
+ { 37, 7, 91, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {71,78,70}, 221,2 , 7549,48 , 13,5 , 4,0 , 1857,8 , 2085,6 , 0, 0, 1, 6, 7 }, // French/Latin/Guinea
+ { 37, 7, 94, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {72,84,71}, 223,1 , 7597,57 , 13,5 , 4,0 , 1857,8 , 2091,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 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2096,10 , 2, 1, 1, 6, 7 }, // French/Latin/Luxembourg
+ { 37, 7, 128, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {77,71,65}, 176,2 , 7654,54 , 13,5 , 4,0 , 1857,8 , 1195,10 , 0, 0, 1, 6, 7 }, // French/Latin/Madagascar
+ { 37, 7, 132, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 2106,4 , 0, 0, 1, 6, 7 }, // French/Latin/Mali
+ { 37, 7, 135, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2110,10 , 2, 1, 1, 6, 7 }, // French/Latin/Martinique
+ { 37, 7, 136, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {77,82,79}, 224,2 , 7708,66 , 13,5 , 4,0 , 1857,8 , 2120,10 , 0, 0, 1, 6, 7 }, // French/Latin/Mauritania
+ { 37, 7, 137, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {77,85,82}, 182,2 , 7774,63 , 13,5 , 4,0 , 1857,8 , 2130,7 , 0, 0, 1, 6, 7 }, // French/Latin/Mauritius
+ { 37, 7, 138, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2137,7 , 2, 1, 1, 6, 7 }, // French/Latin/Mayotte
+ { 37, 7, 142, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2144,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 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6613,61 , 6464,85 , 134,24 , 6613,61 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 64,4 , 61,4 , 359,6 , 174,17 , 191,23 , {77,65,68}, 226,3 , 7837,54 , 13,5 , 4,0 , 1857,8 , 2150,5 , 2, 1, 6, 5, 6 }, // French/Latin/Morocco
+ { 37, 7, 153, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,80,70}, 217,4 , 7514,35 , 13,5 , 4,0 , 1857,8 , 2155,18 , 0, 0, 1, 6, 7 }, // French/Latin/NewCaledonia
+ { 37, 7, 156, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 2173,5 , 0, 0, 1, 6, 7 }, // French/Latin/Niger
+ { 37, 7, 176, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2178,10 , 2, 1, 1, 6, 7 }, // French/Latin/Reunion
+ { 37, 7, 179, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {82,87,70}, 186,2 , 7891,50 , 13,5 , 4,0 , 1857,8 , 1419,6 , 0, 0, 1, 6, 7 }, // French/Latin/Rwanda
+ { 37, 7, 187, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 2188,7 , 0, 0, 1, 6, 7 }, // French/Latin/Senegal
+ { 37, 7, 188, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {83,67,82}, 191,2 , 7941,71 , 13,5 , 4,0 , 1857,8 , 1480,10 , 2, 1, 1, 6, 7 }, // French/Latin/Seychelles
+ { 37, 7, 200, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2195,24 , 2, 1, 1, 6, 7 }, // French/Latin/SaintPierreAndMiquelon
+ { 37, 7, 206, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 218,8 , 218,8 , 175,8 , 10,17 , 37,5 , 267,14 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {67,72,70}, 229,3 , 8012,45 , 13,5 , 4,0 , 2219,15 , 2234,6 , 2, 0, 1, 6, 7 }, // French/Latin/Switzerland
+ { 37, 7, 207, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {83,89,80}, 232,2 , 8057,51 , 13,5 , 4,0 , 1857,8 , 2240,5 , 0, 0, 6, 5, 6 }, // French/Latin/Syria
+ { 37, 7, 212, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,79,70}, 210,3 , 7131,59 , 13,5 , 4,0 , 1857,8 , 2245,4 , 0, 0, 1, 6, 7 }, // French/Latin/Togo
+ { 37, 7, 216, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {84,78,68}, 234,2 , 8108,51 , 13,5 , 4,0 , 1857,8 , 2249,7 , 3, 0, 7, 5, 6 }, // French/Latin/Tunisia
+ { 37, 7, 229, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 18,7 , 25,12 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {86,85,86}, 206,2 , 8159,51 , 13,5 , 4,0 , 1857,8 , 1708,7 , 0, 0, 1, 6, 7 }, // French/Latin/Vanuatu
+ { 37, 7, 235, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {88,80,70}, 217,4 , 7514,35 , 13,5 , 4,0 , 1857,8 , 2256,16 , 0, 0, 1, 6, 7 }, // French/Latin/WallisAndFutunaIslands
+ { 37, 7, 244, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2272,16 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Barthelemy
+ { 37, 7, 245, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 218,8 , 218,8 , 120,10 , 98,16 , 37,5 , 8,10 , 6401,63 , 6464,85 , 134,24 , 6401,63 , 6464,85 , 134,24 , 2967,35 , 3002,52 , 3054,14 , 2967,35 , 3002,52 , 3054,14 , 0,2 , 0,2 , 359,6 , 174,17 , 191,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 1857,8 , 2288,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 , 348,8 , 98,16 , 37,5 , 8,10 , 6674,48 , 6722,95 , 134,24 , 6674,48 , 6722,95 , 134,24 , 3068,21 , 3089,54 , 85,14 , 3068,21 , 3089,54 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3410,19 , 8,5 , 49,6 , 2300,10 , 2310,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 , 226,10 , 226,10 , 120,10 , 566,21 , 37,5 , 8,10 , 6817,61 , 6878,142 , 7020,24 , 6817,61 , 7044,167 , 7020,24 , 3143,28 , 3171,69 , 3240,14 , 3143,28 , 3171,69 , 3240,14 , 78,1 , 74,1 , 365,6 , 5,17 , 22,23 , {71,66,80}, 125,1 , 8210,86 , 4,4 , 4,0 , 2318,8 , 2326,22 , 2, 1, 1, 6, 7 }, // Gaelic/Latin/UnitedKingdom
+ { 40, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 7211,60 , 7271,87 , 7358,24 , 7382,60 , 7442,87 , 7529,36 , 3254,35 , 3289,49 , 3338,14 , 3352,35 , 3387,49 , 3436,21 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3865,20 , 13,5 , 4,0 , 2348,6 , 2354,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 , 243,8 , 243,8 , 175,8 , 614,19 , 37,5 , 8,10 , 7565,48 , 7613,99 , 7712,24 , 7565,48 , 7613,99 , 7712,24 , 3457,28 , 3485,62 , 3547,14 , 3457,28 , 3485,62 , 3547,14 , 0,2 , 0,2 , 371,5 , 376,33 , 22,23 , {71,69,76}, 236,1 , 8296,43 , 13,5 , 4,0 , 2360,7 , 2367,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 7784,83 , 134,24 , 7867,59 , 7784,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 13,5 , 4,0 , 2377,7 , 2384,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7926,48 , 7974,83 , 134,24 , 8057,59 , 7974,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 8,5 , 4,0 , 2395,24 , 2419,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 7784,83 , 134,24 , 7867,59 , 7784,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 13,5 , 4,0 , 2377,7 , 2429,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7926,48 , 7974,83 , 134,24 , 8057,59 , 7974,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 13,5 , 4,0 , 2377,7 , 2436,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 7784,83 , 134,24 , 7867,59 , 7784,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {67,72,70}, 229,3 , 8358,58 , 8,5 , 4,0 , 2377,7 , 2443,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 7784,83 , 134,24 , 7867,59 , 7784,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 13,5 , 4,0 , 2377,7 , 2456,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 7784,83 , 134,24 , 7867,59 , 7784,83 , 134,24 , 3561,21 , 3582,60 , 3642,14 , 3656,28 , 3582,60 , 3642,14 , 79,5 , 75,6 , 409,5 , 5,17 , 22,23 , {67,72,70}, 229,3 , 8358,58 , 8,5 , 36,5 , 2465,21 , 2486,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 , 260,9 , 260,9 , 278,6 , 10,17 , 18,7 , 25,12 , 8116,50 , 8166,115 , 8281,24 , 8305,50 , 8355,115 , 8281,24 , 3684,28 , 3712,55 , 3767,14 , 3684,28 , 3712,55 , 3767,14 , 84,4 , 81,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8416,19 , 13,5 , 4,0 , 2493,8 , 2501,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 , 260,9 , 260,9 , 278,6 , 10,17 , 18,7 , 25,12 , 8116,50 , 8166,115 , 8281,24 , 8305,50 , 8355,115 , 8281,24 , 3684,28 , 3712,55 , 3767,14 , 3684,28 , 3712,55 , 3767,14 , 84,4 , 81,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8416,19 , 13,5 , 4,0 , 2493,8 , 2507,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 , 269,11 , 269,11 , 53,10 , 633,17 , 18,7 , 25,12 , 8470,48 , 8518,96 , 134,24 , 8470,48 , 8518,96 , 134,24 , 3781,28 , 3809,98 , 3907,14 , 3781,28 , 3809,98 , 3907,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {68,75,75}, 154,3 , 8435,62 , 4,4 , 55,5 , 2513,11 , 2524,16 , 2, 1, 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}, 237,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 , 280,9 , 280,9 , 278,6 , 211,18 , 281,8 , 289,13 , 8614,67 , 8681,87 , 8768,31 , 8614,67 , 8681,87 , 8768,31 , 3921,32 , 3953,53 , 4006,19 , 3921,32 , 3953,53 , 4006,19 , 0,2 , 0,2 , 414,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 8497,46 , 4,4 , 4,0 , 2540,7 , 2547,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 , 0,6 , 0,6 , 278,6 , 211,18 , 37,5 , 8,10 , 8799,48 , 8847,85 , 8932,24 , 8799,48 , 8847,85 , 8932,24 , 4025,28 , 4053,52 , 4105,14 , 4025,28 , 4053,52 , 4105,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 184,1 , 8543,12 , 8,5 , 4,0 , 2551,5 , 2556,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}, 184,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 , 0,6 , 0,6 , 278,6 , 211,18 , 37,5 , 8,10 , 8799,48 , 8847,85 , 8932,24 , 8799,48 , 8847,85 , 8932,24 , 4025,28 , 4053,52 , 4105,14 , 4025,28 , 4053,52 , 4105,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,72,83}, 173,3 , 0,7 , 8,5 , 4,0 , 2551,5 , 2564,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 , 0,6 , 0,6 , 278,6 , 211,18 , 37,5 , 8,10 , 8799,48 , 8847,85 , 8932,24 , 8799,48 , 8847,85 , 8932,24 , 4025,28 , 4053,52 , 4105,14 , 4025,28 , 4053,52 , 4105,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 8555,36 , 8,5 , 4,0 , 2551,5 , 2568,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 , 289,6 , 289,6 , 550,8 , 650,18 , 55,4 , 59,9 , 8956,58 , 9014,72 , 158,27 , 8956,58 , 9014,72 , 158,27 , 4119,46 , 4165,65 , 4230,21 , 4119,46 , 4165,65 , 4230,21 , 88,6 , 85,5 , 418,4 , 5,17 , 22,23 , {73,76,83}, 54,1 , 8591,54 , 60,6 , 66,8 , 2573,5 , 2578,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 , 295,9 , 304,8 , 278,6 , 10,17 , 18,7 , 25,12 , 9086,59 , 9145,73 , 9218,30 , 9086,59 , 9145,73 , 9218,30 , 4251,32 , 4283,53 , 4336,19 , 4251,32 , 4283,53 , 4336,19 , 94,9 , 90,7 , 422,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 8645,42 , 4,4 , 4,0 , 2583,6 , 2589,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 , 312,8 , 312,8 , 668,13 , 681,19 , 55,4 , 59,9 , 9248,64 , 9312,98 , 9410,25 , 9248,64 , 9312,98 , 9410,25 , 4355,19 , 4374,52 , 4426,17 , 4355,19 , 4374,52 , 4426,17 , 103,3 , 97,3 , 426,4 , 5,17 , 22,23 , {72,85,70}, 238,2 , 8687,46 , 13,5 , 4,0 , 2593,6 , 2599,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 , 183,8 , 183,8 , 550,8 , 532,18 , 37,5 , 8,10 , 9435,59 , 9494,82 , 9576,24 , 9435,59 , 9494,82 , 9576,24 , 4443,35 , 4478,81 , 4559,14 , 4443,35 , 4478,81 , 4559,14 , 106,4 , 100,4 , 430,4 , 5,17 , 22,23 , {73,83,75}, 240,3 , 8733,49 , 13,5 , 4,0 , 2611,8 , 2619,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 , 320,10 , 330,9 , 27,8 , 80,18 , 200,5 , 205,10 , 9600,48 , 9648,87 , 134,24 , 9600,48 , 9648,87 , 134,24 , 4573,28 , 4601,43 , 4644,14 , 4573,28 , 4601,43 , 4644,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,68,82}, 243,2 , 8782,39 , 4,4 , 4,0 , 2625,9 , 2625,9 , 0, 0, 7, 6, 7 }, // Indonesian/Latin/Indonesia
+ { 53, 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 }, // Interlingua/Latin/France
+ { 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}, 245,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Inuktitut/CanadianAboriginal/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}, 245,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 , 339,11 , 226,10 , 120,10 , 98,16 , 37,5 , 8,10 , 9735,62 , 9797,107 , 9904,24 , 9735,62 , 9797,107 , 9904,24 , 4658,37 , 4695,75 , 4770,14 , 4658,37 , 4695,75 , 4770,14 , 64,4 , 61,4 , 434,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8821,31 , 4,4 , 4,0 , 2634,7 , 2641,4 , 2, 1, 7, 6, 7 }, // Irish/Latin/Ireland
+ { 58, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 98,16 , 37,5 , 8,10 , 9928,48 , 9976,94 , 10070,24 , 9928,48 , 9976,94 , 10070,24 , 4784,28 , 4812,57 , 4869,14 , 4784,28 , 4812,57 , 4869,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8852,19 , 13,5 , 4,0 , 2645,8 , 2653,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 , 236,7 , 236,7 , 27,8 , 98,16 , 37,5 , 8,10 , 9928,48 , 9976,94 , 10070,24 , 9928,48 , 9976,94 , 10070,24 , 4784,28 , 4812,57 , 4869,14 , 4784,28 , 4812,57 , 4869,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8852,19 , 13,5 , 4,0 , 2645,8 , 2659,10 , 2, 1, 1, 6, 7 }, // Italian/Latin/SanMarino
+ { 58, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 236,7 , 236,7 , 175,8 , 10,17 , 37,5 , 8,10 , 9928,48 , 9976,94 , 10070,24 , 9928,48 , 9976,94 , 10070,24 , 4784,28 , 4812,57 , 4869,14 , 4784,28 , 4812,57 , 4869,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 229,3 , 8871,53 , 8,5 , 36,5 , 2645,8 , 2669,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 , 236,7 , 236,7 , 27,8 , 98,16 , 37,5 , 8,10 , 9928,48 , 9976,94 , 10070,24 , 9928,48 , 9976,94 , 10070,24 , 4784,28 , 4812,57 , 4869,14 , 4784,28 , 4812,57 , 4869,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8852,19 , 13,5 , 4,0 , 2645,8 , 2677,18 , 2, 1, 1, 6, 7 }, // Italian/Latin/VaticanCityState
+ { 59, 19, 108, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 161,5 , 161,5 , 161,5 , 161,5 , 522,10 , 393,13 , 55,4 , 302,10 , 4697,39 , 4697,39 , 158,27 , 4697,39 , 4697,39 , 158,27 , 4883,14 , 4897,28 , 4883,14 , 4883,14 , 4897,28 , 4883,14 , 110,2 , 104,2 , 440,3 , 297,17 , 22,23 , {74,80,89}, 139,1 , 8924,11 , 4,4 , 4,0 , 2695,3 , 2698,2 , 0, 0, 7, 6, 7 }, // Japanese/Japanese/Japan
+ { 60, 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 , 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,68,82}, 243,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 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 , 350,12 , 362,11 , 278,6 , 35,18 , 281,8 , 289,13 , 10094,63 , 10157,87 , 10244,31 , 10094,63 , 10157,87 , 10244,31 , 4925,33 , 4958,54 , 5012,20 , 4925,33 , 4958,54 , 5012,20 , 112,9 , 106,7 , 443,8 , 451,33 , 22,23 , {73,78,82}, 127,1 , 8935,49 , 4,4 , 4,0 , 2700,5 , 2705,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 , 516,6 , 35,18 , 18,7 , 25,12 , 10275,72 , 10275,72 , 10347,24 , 10275,72 , 10275,72 , 10347,24 , 5032,54 , 5086,56 , 5142,14 , 5032,54 , 5086,56 , 5142,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 8984,23 , 8,5 , 4,0 , 2709,5 , 2714,10 , 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 , 373,10 , 175,8 , 700,22 , 37,5 , 8,10 , 10371,60 , 10431,83 , 10514,24 , 10538,60 , 10598,83 , 10514,24 , 5156,21 , 5177,56 , 5233,14 , 5156,21 , 5247,56 , 5233,14 , 0,2 , 0,2 , 484,4 , 488,17 , 505,23 , {75,90,84}, 248,1 , 9007,58 , 13,5 , 4,0 , 2724,10 , 2734,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 , 10681,60 , 10741,101 , 158,27 , 10681,60 , 10741,101 , 158,27 , 5303,35 , 5338,84 , 85,14 , 5303,35 , 5338,84 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,87,70}, 186,2 , 0,7 , 8,5 , 4,0 , 2743,11 , 1419,6 , 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 , 383,10 , 383,10 , 278,6 , 722,23 , 37,5 , 8,10 , 10842,48 , 10890,80 , 10970,24 , 10994,59 , 11053,80 , 10970,24 , 5422,38 , 5460,57 , 5517,14 , 5422,38 , 5460,57 , 5517,14 , 121,5 , 113,14 , 484,4 , 528,17 , 22,23 , {75,71,83}, 249,3 , 9065,52 , 13,5 , 4,0 , 2754,8 , 2762,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 , 393,7 , 393,7 , 745,9 , 754,16 , 312,7 , 319,13 , 11133,39 , 11133,39 , 11133,39 , 11133,39 , 11133,39 , 11133,39 , 5531,14 , 5545,28 , 5531,14 , 5531,14 , 5545,28 , 5531,14 , 126,2 , 127,2 , 545,3 , 5,17 , 22,23 , {75,82,87}, 252,1 , 9117,19 , 4,4 , 4,0 , 2772,3 , 2775,4 , 0, 0, 7, 6, 7 }, // Korean/Korean/SouthKorea
+ { 66, 22, 113, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 393,7 , 393,7 , 745,9 , 754,16 , 312,7 , 319,13 , 11133,39 , 11133,39 , 11133,39 , 11133,39 , 11133,39 , 11133,39 , 5531,14 , 5545,28 , 5531,14 , 5531,14 , 5545,28 , 5531,14 , 126,2 , 127,2 , 545,3 , 5,17 , 22,23 , {75,80,87}, 253,3 , 9136,39 , 4,4 , 4,0 , 2772,3 , 2779,11 , 0, 0, 1, 6, 7 }, // Korean/Korean/NorthKorea
+ { 67, 7, 217, 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,82,89}, 256,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 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 , 406,8 , 98,16 , 37,5 , 8,10 , 11172,60 , 11232,106 , 158,27 , 11172,60 , 11232,106 , 158,27 , 5573,34 , 5607,89 , 85,14 , 5573,34 , 5607,89 , 85,14 , 128,5 , 129,5 , 45,4 , 5,17 , 22,23 , {66,73,70}, 169,3 , 9175,27 , 0,4 , 4,0 , 2790,8 , 2798,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 , 400,9 , 406,8 , 770,19 , 55,4 , 332,24 , 11338,61 , 11399,75 , 158,27 , 11338,61 , 11399,75 , 158,27 , 5696,36 , 5732,57 , 5789,17 , 5696,36 , 5732,57 , 5789,17 , 133,8 , 134,8 , 45,4 , 5,17 , 22,23 , {76,65,75}, 257,1 , 9202,21 , 4,4 , 36,5 , 2806,3 , 2806,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 , 409,8 , 409,8 , 175,8 , 789,26 , 37,5 , 8,10 , 11474,65 , 11539,101 , 134,24 , 11474,65 , 11539,101 , 134,24 , 5806,51 , 5857,72 , 5929,14 , 5943,51 , 5994,72 , 5929,14 , 141,14 , 142,11 , 548,5 , 297,17 , 22,23 , {69,85,82}, 14,1 , 9223,23 , 13,5 , 4,0 , 2809,8 , 2817,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 , 417,9 , 417,9 , 406,8 , 98,16 , 37,5 , 8,10 , 11640,48 , 11688,203 , 11891,24 , 11640,48 , 11688,203 , 11891,24 , 6066,28 , 6094,100 , 6194,14 , 6066,28 , 6094,100 , 6194,14 , 155,8 , 153,6 , 45,4 , 5,17 , 22,23 , {67,68,70}, 215,2 , 9246,23 , 13,5 , 4,0 , 2824,7 , 2831,30 , 2, 1, 1, 6, 7 }, // Lingala/Latin/CongoKinshasa
+ { 72, 7, 6, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 417,9 , 417,9 , 406,8 , 98,16 , 37,5 , 8,10 , 11640,48 , 11688,203 , 11891,24 , 11640,48 , 11688,203 , 11891,24 , 6066,28 , 6094,100 , 6194,14 , 6066,28 , 6094,100 , 6194,14 , 155,8 , 153,6 , 45,4 , 5,17 , 22,23 , {65,79,65}, 258,2 , 9269,23 , 13,5 , 4,0 , 2824,7 , 2861,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 , 417,9 , 417,9 , 406,8 , 98,16 , 37,5 , 8,10 , 11640,48 , 11688,203 , 11891,24 , 11640,48 , 11688,203 , 11891,24 , 6066,28 , 6094,100 , 6194,14 , 6066,28 , 6094,100 , 6194,14 , 155,8 , 153,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 9292,23 , 13,5 , 4,0 , 2824,7 , 2867,26 , 0, 0, 1, 6, 7 }, // Lingala/Latin/CentralAfricanRepublic
+ { 72, 7, 50, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 417,9 , 417,9 , 406,8 , 98,16 , 37,5 , 8,10 , 11640,48 , 11688,203 , 11891,24 , 11640,48 , 11688,203 , 11891,24 , 6066,28 , 6094,100 , 6194,14 , 6066,28 , 6094,100 , 6194,14 , 155,8 , 153,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 9292,23 , 13,5 , 4,0 , 2824,7 , 2893,5 , 0, 0, 1, 6, 7 }, // Lingala/Latin/CongoBrazzaville
+ { 73, 7, 124, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 426,8 , 426,8 , 53,10 , 815,27 , 37,5 , 8,10 , 11915,70 , 11985,96 , 12081,24 , 11915,70 , 12105,98 , 12081,24 , 6208,21 , 6229,89 , 6318,14 , 6208,21 , 6229,89 , 6318,14 , 163,9 , 159,6 , 553,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9315,30 , 13,5 , 4,0 , 2898,8 , 2906,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 , 107,7 , 107,7 , 842,7 , 80,18 , 37,5 , 8,10 , 12203,61 , 12264,85 , 12349,24 , 12203,61 , 12264,85 , 12349,24 , 6332,35 , 6367,54 , 1649,14 , 6421,34 , 6367,54 , 1649,14 , 172,10 , 165,8 , 559,5 , 5,17 , 22,23 , {77,75,68}, 260,3 , 9345,56 , 13,5 , 4,0 , 2913,10 , 2923,10 , 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 , 98,16 , 37,5 , 8,10 , 12373,48 , 12421,92 , 134,24 , 12373,48 , 12421,92 , 134,24 , 6455,34 , 6489,60 , 6549,14 , 6455,34 , 6489,60 , 6549,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,71,65}, 176,2 , 9401,13 , 8,5 , 4,0 , 2933,8 , 2941,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 , 330,9 , 330,9 , 509,7 , 10,17 , 18,7 , 25,12 , 12513,48 , 12561,82 , 12643,24 , 12513,48 , 12561,82 , 12643,24 , 6563,28 , 6591,43 , 6634,14 , 6563,28 , 6591,43 , 6634,14 , 182,2 , 173,3 , 564,4 , 5,17 , 22,23 , {77,89,82}, 180,2 , 9414,39 , 4,4 , 4,0 , 2953,13 , 1211,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}, 180,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 , 330,9 , 330,9 , 509,7 , 849,12 , 18,7 , 25,12 , 12513,48 , 12561,82 , 12643,24 , 12513,48 , 12561,82 , 12643,24 , 6563,28 , 6591,43 , 6634,14 , 6563,28 , 6591,43 , 6634,14 , 182,2 , 173,3 , 564,4 , 5,17 , 22,23 , {66,78,68}, 6,1 , 9453,31 , 8,5 , 4,0 , 2953,13 , 2966,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 , 330,9 , 330,9 , 509,7 , 10,17 , 18,7 , 25,12 , 12513,48 , 12561,82 , 12643,24 , 12513,48 , 12561,82 , 12643,24 , 6563,28 , 6591,43 , 6634,14 , 6563,28 , 6591,43 , 6634,14 , 182,2 , 173,3 , 564,4 , 5,17 , 22,23 , {83,71,68}, 6,1 , 9484,37 , 4,4 , 4,0 , 2953,13 , 2972,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 , 434,13 , 447,12 , 278,6 , 861,18 , 18,7 , 25,12 , 12667,62 , 12729,88 , 12817,32 , 12667,62 , 12729,88 , 12849,31 , 6648,41 , 6689,77 , 6766,22 , 6648,41 , 6788,76 , 6864,21 , 0,2 , 0,2 , 568,6 , 574,31 , 22,23 , {73,78,82}, 127,1 , 9521,40 , 4,4 , 4,0 , 2981,6 , 2987,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 , 459,8 , 467,7 , 120,10 , 879,23 , 37,5 , 8,10 , 12880,48 , 12928,86 , 13014,36 , 12880,48 , 12928,86 , 13050,24 , 6885,28 , 6913,63 , 6976,21 , 6885,28 , 6913,63 , 6997,20 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9561,27 , 4,4 , 4,0 , 2993,5 , 1219,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 , 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,90,68}, 263,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Maori/Latin/NewZealand
+ { 80, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 474,9 , 474,9 , 278,6 , 211,18 , 18,7 , 25,12 , 13074,66 , 13140,86 , 13226,32 , 13074,66 , 13140,86 , 13226,32 , 7017,32 , 7049,53 , 4336,19 , 7017,32 , 7049,53 , 4336,19 , 184,5 , 176,4 , 422,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 9588,43 , 4,4 , 4,0 , 2998,5 , 2589,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 , 53,10 , 902,29 , 37,5 , 8,10 , 13258,99 , 13357,189 , 158,27 , 13258,99 , 13357,189 , 158,27 , 7102,21 , 7123,43 , 7102,21 , 7102,21 , 7123,43 , 7102,21 , 189,3 , 180,3 , 484,4 , 528,17 , 22,23 , {77,78,84}, 266,1 , 9631,25 , 8,5 , 4,0 , 3003,6 , 3009,6 , 0, 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}, 267,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, 483,5 , 0,6 , 488,7 , 488,7 , 53,10 , 63,17 , 37,5 , 8,10 , 13546,85 , 13546,85 , 13631,27 , 13546,85 , 13658,85 , 13631,27 , 7166,33 , 7199,54 , 7253,18 , 7166,33 , 7199,54 , 7253,18 , 94,9 , 90,7 , 422,4 , 5,17 , 22,23 , {78,80,82}, 270,4 , 9656,49 , 8,5 , 4,0 , 3015,6 , 3021,5 , 2, 1, 7, 6, 7 }, // Nepali/Devanagari/Nepal
+ { 84, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 483,5 , 0,6 , 488,7 , 488,7 , 53,10 , 63,17 , 18,7 , 25,12 , 13546,85 , 13546,85 , 13631,27 , 13546,85 , 13658,85 , 13631,27 , 7166,33 , 7199,54 , 7253,18 , 7166,33 , 7199,54 , 7253,18 , 94,9 , 90,7 , 422,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 9705,49 , 8,5 , 4,0 , 3015,6 , 2589,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 , 183,8 , 183,8 , 931,10 , 469,17 , 37,5 , 8,10 , 5791,48 , 13743,83 , 134,24 , 5922,59 , 13743,83 , 134,24 , 2367,35 , 2302,51 , 2353,14 , 2367,35 , 2302,51 , 2353,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {78,79,75}, 196,2 , 9754,44 , 8,5 , 4,0 , 3026,12 , 3038,5 , 2, 1, 1, 6, 7 }, // NorwegianBokmal/Latin/Norway
+ { 85, 7, 203, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 183,8 , 183,8 , 931,10 , 469,17 , 37,5 , 8,10 , 5791,48 , 13743,83 , 134,24 , 5922,59 , 13743,83 , 134,24 , 2367,35 , 2302,51 , 2353,14 , 2367,35 , 2302,51 , 2353,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {78,79,75}, 196,2 , 9754,44 , 8,5 , 4,0 , 3026,12 , 3043,21 , 2, 1, 1, 6, 7 }, // NorwegianBokmal/Latin/SvalbardAndJanMayenIslands
+ { 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 , 0,6 , 0,6 , 941,6 , 10,17 , 18,7 , 25,12 , 13826,86 , 13826,86 , 13912,32 , 13826,86 , 13826,86 , 13912,32 , 7271,33 , 7304,54 , 7358,18 , 7271,33 , 7304,54 , 7358,18 , 68,2 , 65,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 9798,11 , 8,5 , 4,0 , 3064,5 , 3069,4 , 2, 1, 7, 7, 7 }, // Oriya/Oriya/India
+ { 88, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 385,8 , 947,20 , 55,4 , 356,11 , 13944,68 , 13944,68 , 158,27 , 13944,68 , 13944,68 , 158,27 , 7376,49 , 7376,49 , 85,14 , 7376,49 , 7376,49 , 85,14 , 192,4 , 183,4 , 45,4 , 5,17 , 22,23 , {65,70,78}, 274,1 , 9809,25 , 13,5 , 4,0 , 3073,4 , 3077,9 , 0, 0, 6, 4, 5 }, // Pashto/Arabic/Afghanistan
+ { 89, 1, 102, 1643, 1644, 1563, 37, 1776, 45, 43, 101, 171, 187, 8249, 8250, 495,7 , 495,7 , 502,8 , 510,7 , 385,8 , 98,16 , 55,4 , 356,11 , 14012,70 , 14012,70 , 14082,24 , 14106,74 , 14106,74 , 14082,24 , 7376,49 , 7376,49 , 7425,14 , 7376,49 , 7376,49 , 7425,14 , 196,9 , 187,8 , 605,4 , 609,39 , 22,23 , {73,82,82}, 275,4 , 9834,37 , 74,5 , 4,0 , 3086,5 , 3091,5 , 0, 0, 6, 5, 5 }, // Persian/Arabic/Iran
+ { 89, 1, 1, 1643, 1644, 1563, 37, 1776, 45, 43, 101, 171, 187, 8249, 8250, 495,7 , 495,7 , 502,8 , 510,7 , 385,8 , 98,16 , 55,4 , 356,11 , 14180,68 , 14180,68 , 14248,24 , 14272,62 , 14180,68 , 14248,24 , 7376,49 , 7376,49 , 7425,14 , 7376,49 , 7376,49 , 7425,14 , 196,9 , 187,8 , 605,4 , 609,39 , 22,23 , {65,70,78}, 274,1 , 9871,55 , 8,5 , 4,0 , 3096,3 , 3077,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 , 154,7 , 154,7 , 931,10 , 10,17 , 37,5 , 8,10 , 14334,48 , 14382,97 , 14479,24 , 14334,48 , 14503,99 , 14602,24 , 7439,34 , 7473,59 , 7532,14 , 7439,34 , 7473,59 , 7546,14 , 0,2 , 0,2 , 283,5 , 5,17 , 22,23 , {80,76,78}, 279,2 , 9926,77 , 13,5 , 4,0 , 3099,6 , 3105,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 , 236,7 , 236,7 , 120,10 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7560,28 , 7588,79 , 7667,14 , 7560,28 , 7588,79 , 7667,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {66,82,76}, 281,2 , 10003,54 , 4,4 , 4,0 , 3111,9 , 3120,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 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {65,79,65}, 258,2 , 10057,54 , 13,5 , 4,0 , 3111,9 , 3126,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 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {67,86,69}, 283,1 , 10111,69 , 13,5 , 4,0 , 3111,9 , 3132,10 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/CapeVerde
+ { 91, 7, 62, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {85,83,68}, 165,3 , 10180,81 , 13,5 , 4,0 , 3111,9 , 3142,11 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/EastTimor
+ { 91, 7, 66, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 10261,59 , 13,5 , 4,0 , 3111,9 , 3153,16 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/EquatorialGuinea
+ { 91, 7, 92, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {88,79,70}, 210,3 , 10320,62 , 13,5 , 4,0 , 3111,9 , 3169,12 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/GuineaBissau
+ { 91, 7, 125, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 10382,20 , 13,5 , 4,0 , 3111,9 , 3181,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 , 236,7 , 236,7 , 27,8 , 587,27 , 18,7 , 25,12 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {77,79,80}, 143,4 , 10402,53 , 13,5 , 4,0 , 3111,9 , 3191,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 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {77,90,78}, 284,3 , 10455,72 , 13,5 , 4,0 , 3111,9 , 3210,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 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 10382,20 , 13,5 , 4,0 , 3220,17 , 3237,8 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Portugal
+ { 91, 7, 185, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {83,84,68}, 287,2 , 10527,92 , 13,5 , 4,0 , 3111,9 , 3245,19 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/SaoTomeAndPrincipe
+ { 91, 7, 206, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 236,7 , 236,7 , 27,8 , 587,27 , 37,5 , 8,10 , 14626,48 , 14674,89 , 134,24 , 14626,48 , 14674,89 , 134,24 , 7681,49 , 7588,79 , 7667,14 , 7681,49 , 7588,79 , 7667,14 , 205,8 , 195,8 , 0,5 , 5,17 , 22,23 , {67,72,70}, 229,3 , 10619,45 , 13,5 , 4,0 , 3111,9 , 3264,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 , 517,9 , 517,9 , 278,6 , 10,17 , 18,7 , 25,12 , 14763,50 , 14813,68 , 14881,28 , 14763,50 , 14813,68 , 14881,28 , 7730,36 , 7766,57 , 7823,23 , 7730,36 , 7766,57 , 7823,23 , 213,6 , 203,6 , 648,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 10664,39 , 4,4 , 4,0 , 3269,6 , 3275,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 , 120,10 , 80,18 , 18,7 , 25,12 , 14909,67 , 14909,67 , 158,27 , 14909,67 , 14909,67 , 158,27 , 7846,37 , 7846,37 , 85,14 , 7846,37 , 7846,37 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 289,1 , 10703,13 , 79,6 , 4,0 , 3279,6 , 3285,7 , 0, 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 , 120,10 , 211,18 , 37,5 , 8,10 , 14976,48 , 15024,128 , 158,27 , 14976,48 , 15024,128 , 158,27 , 7883,28 , 7911,53 , 7964,14 , 7883,28 , 7911,53 , 7964,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {80,69,78}, 290,2 , 0,7 , 8,5 , 4,0 , 3292,8 , 3300,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 , 120,10 , 211,18 , 37,5 , 8,10 , 14976,48 , 15024,128 , 158,27 , 14976,48 , 15024,128 , 158,27 , 7883,28 , 7911,53 , 7964,14 , 7883,28 , 7911,53 , 7964,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {66,79,66}, 292,2 , 0,7 , 8,5 , 4,0 , 3292,8 , 3304,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 , 120,10 , 211,18 , 37,5 , 8,10 , 14976,48 , 15024,128 , 158,27 , 14976,48 , 15024,128 , 158,27 , 7883,28 , 7911,53 , 7964,14 , 7883,28 , 7911,53 , 7964,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 8,5 , 4,0 , 3292,8 , 3311,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 , 348,8 , 967,28 , 37,5 , 8,10 , 15152,67 , 15219,92 , 15311,24 , 15152,67 , 15219,92 , 15311,24 , 7978,23 , 8001,56 , 8057,14 , 7978,23 , 8001,56 , 8057,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 229,3 , 10716,46 , 13,5 , 4,0 , 3318,9 , 3327,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 , 526,8 , 526,8 , 931,10 , 10,17 , 37,5 , 8,10 , 15335,60 , 15395,98 , 15493,24 , 15335,60 , 15395,98 , 15493,24 , 8071,34 , 8105,48 , 3054,14 , 8071,34 , 8105,48 , 3054,14 , 64,4 , 61,4 , 652,4 , 5,17 , 22,23 , {82,79,78}, 294,3 , 10762,57 , 13,5 , 4,0 , 3333,6 , 3339,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 , 526,8 , 526,8 , 931,10 , 10,17 , 37,5 , 8,10 , 15335,60 , 15395,98 , 15493,24 , 15335,60 , 15395,98 , 15493,24 , 8153,28 , 8105,48 , 8181,16 , 8153,28 , 8105,48 , 8181,16 , 64,4 , 61,4 , 652,4 , 5,17 , 22,23 , {77,68,76}, 297,1 , 10819,69 , 13,5 , 4,0 , 3346,13 , 3359,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 , 107,7 , 107,7 , 931,10 , 326,22 , 55,4 , 59,9 , 15517,62 , 11053,80 , 10970,24 , 15579,62 , 15641,82 , 10970,24 , 8197,21 , 8218,62 , 8280,14 , 8197,21 , 8218,62 , 8197,21 , 219,2 , 209,2 , 226,5 , 528,17 , 22,23 , {82,85,66}, 129,1 , 10888,89 , 13,5 , 4,0 , 3376,7 , 3383,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 , 107,7 , 107,7 , 931,10 , 326,22 , 55,4 , 59,9 , 15517,62 , 11053,80 , 10970,24 , 15579,62 , 15641,82 , 10970,24 , 8197,21 , 8218,62 , 8280,14 , 8197,21 , 8218,62 , 8197,21 , 219,2 , 209,2 , 226,5 , 528,17 , 22,23 , {66,89,78}, 0,2 , 10977,94 , 13,5 , 4,0 , 3376,7 , 472,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 , 107,7 , 107,7 , 931,10 , 326,22 , 55,4 , 59,9 , 15517,62 , 11053,80 , 10970,24 , 15579,62 , 15641,82 , 10970,24 , 8197,21 , 8218,62 , 8280,14 , 8197,21 , 8218,62 , 8197,21 , 219,2 , 209,2 , 226,5 , 528,17 , 22,23 , {75,90,84}, 248,1 , 11071,83 , 13,5 , 4,0 , 3376,7 , 3389,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 , 107,7 , 107,7 , 931,10 , 326,22 , 55,4 , 59,9 , 15517,62 , 11053,80 , 10970,24 , 15579,62 , 15641,82 , 10970,24 , 8197,21 , 8218,62 , 8280,14 , 8197,21 , 8218,62 , 8197,21 , 219,2 , 209,2 , 226,5 , 528,17 , 22,23 , {75,71,83}, 249,3 , 11154,82 , 13,5 , 4,0 , 3376,7 , 3398,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 , 107,7 , 107,7 , 931,10 , 326,22 , 55,4 , 59,9 , 15517,62 , 11053,80 , 10970,24 , 15579,62 , 15641,82 , 10970,24 , 8197,21 , 8218,62 , 8280,14 , 8197,21 , 8218,62 , 8197,21 , 219,2 , 209,2 , 226,5 , 528,17 , 22,23 , {77,68,76}, 297,1 , 11236,79 , 13,5 , 4,0 , 3376,7 , 3406,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 , 107,7 , 107,7 , 931,10 , 326,22 , 37,5 , 8,10 , 15517,62 , 11053,80 , 10970,24 , 15579,62 , 15641,82 , 10970,24 , 8197,21 , 8218,62 , 8280,14 , 8197,21 , 8218,62 , 8197,21 , 0,2 , 0,2 , 226,5 , 528,17 , 22,23 , {85,65,72}, 298,1 , 11315,92 , 13,5 , 4,0 , 3376,7 , 3413,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 , 406,8 , 98,16 , 37,5 , 8,10 , 15723,48 , 15771,91 , 15862,24 , 15723,48 , 15771,91 , 15862,24 , 8294,28 , 8322,66 , 8388,14 , 8294,28 , 8322,66 , 8388,14 , 221,2 , 211,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 11407,25 , 4,4 , 36,5 , 3420,5 , 3425,22 , 0, 0, 1, 6, 7 }, // Sango/Latin/CentralAfricanRepublic
+ { 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}, 127,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 , 107,7 , 107,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 15886,48 , 15934,81 , 12349,24 , 15886,48 , 15934,81 , 12349,24 , 8402,28 , 8430,52 , 8482,14 , 8402,28 , 8430,52 , 8482,14 , 223,9 , 213,8 , 656,7 , 5,17 , 22,23 , {82,83,68}, 299,3 , 11432,58 , 13,5 , 4,0 , 3447,6 , 3453,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 , 107,7 , 107,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16015,58 , 15934,81 , 12349,24 , 16015,58 , 15934,81 , 12349,24 , 8496,33 , 8529,55 , 8482,14 , 8496,33 , 8529,55 , 8482,14 , 232,11 , 213,8 , 656,7 , 5,17 , 22,23 , {66,65,77}, 302,2 , 11490,174 , 13,5 , 4,0 , 3447,6 , 3459,19 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/BosniaAndHerzegowina
+ { 100, 2, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 107,7 , 107,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16015,58 , 15934,81 , 12349,24 , 16015,58 , 15934,81 , 12349,24 , 8496,33 , 8529,55 , 8482,14 , 8496,33 , 8529,55 , 8482,14 , 232,11 , 213,8 , 656,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 11664,23 , 13,5 , 4,0 , 3447,6 , 3478,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 , 107,7 , 107,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16015,58 , 15934,81 , 12349,24 , 16015,58 , 15934,81 , 12349,24 , 8496,33 , 8430,52 , 8482,14 , 8496,33 , 8430,52 , 8482,14 , 223,9 , 213,8 , 656,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 11664,23 , 13,5 , 4,0 , 3447,6 , 3487,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 , 154,7 , 154,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16073,58 , 16131,81 , 16212,24 , 16073,58 , 16131,81 , 16212,24 , 8584,33 , 8617,57 , 2162,14 , 8584,33 , 8617,57 , 2162,14 , 243,11 , 221,8 , 276,7 , 5,17 , 22,23 , {66,65,77}, 150,2 , 11687,174 , 13,5 , 4,0 , 3493,6 , 591,19 , 2, 1, 1, 6, 7 }, // Serbian/Latin/BosniaAndHerzegowina
+ { 100, 7, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 154,7 , 154,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16073,58 , 16131,81 , 16212,24 , 16073,58 , 16131,81 , 16212,24 , 8584,33 , 8617,57 , 2162,14 , 8584,33 , 8617,57 , 2162,14 , 243,11 , 221,8 , 276,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 11861,23 , 13,5 , 4,0 , 3493,6 , 3499,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 , 154,7 , 154,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16236,48 , 16131,81 , 16212,24 , 16236,48 , 16131,81 , 16212,24 , 8674,28 , 8702,54 , 2162,14 , 8674,28 , 8702,54 , 2162,14 , 254,9 , 221,8 , 276,7 , 5,17 , 22,23 , {82,83,68}, 299,3 , 11884,58 , 13,5 , 4,0 , 3493,6 , 3508,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 , 154,7 , 154,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 16073,58 , 16131,81 , 16212,24 , 16073,58 , 16131,81 , 16212,24 , 8584,33 , 8702,54 , 2162,14 , 8584,33 , 8702,54 , 2162,14 , 254,9 , 221,8 , 276,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 11861,23 , 13,5 , 4,0 , 3493,6 , 3514,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 , 534,9 , 534,9 , 175,8 , 1022,23 , 37,5 , 8,10 , 16284,63 , 16347,82 , 10970,24 , 16429,60 , 16489,86 , 10970,24 , 8756,28 , 8784,61 , 8845,14 , 8859,28 , 8887,61 , 8845,14 , 263,15 , 229,15 , 45,4 , 5,17 , 22,23 , {71,69,76}, 236,1 , 11942,17 , 8,5 , 4,0 , 3520,4 , 3524,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 , 534,9 , 534,9 , 175,8 , 1022,23 , 37,5 , 8,10 , 16284,63 , 16347,82 , 10970,24 , 16429,60 , 16489,86 , 10970,24 , 8756,28 , 8784,61 , 8845,14 , 8859,28 , 8887,61 , 8845,14 , 263,15 , 229,15 , 45,4 , 5,17 , 22,23 , {82,85,66}, 129,1 , 11959,17 , 8,5 , 4,0 , 3520,4 , 3535,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/SouthAfrica
+ { 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/SouthAfrica
+ { 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 , 16575,48 , 16623,100 , 16723,24 , 16575,48 , 16623,100 , 16723,24 , 8948,28 , 8976,55 , 9031,14 , 8948,28 , 8976,55 , 9031,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 165,3 , 11976,22 , 4,4 , 4,0 , 3541,8 , 1762,8 , 2, 1, 7, 6, 7 }, // Shona/Latin/Zimbabwe
+ { 105, 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}, 182,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 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 , 543,9 , 552,8 , 53,10 , 63,17 , 200,5 , 205,10 , 16747,59 , 16806,96 , 16902,32 , 16934,61 , 16806,96 , 16902,32 , 9045,39 , 9084,62 , 9146,19 , 9045,39 , 9084,62 , 9146,19 , 278,5 , 244,4 , 663,5 , 668,37 , 22,23 , {76,75,82}, 304,3 , 11998,58 , 4,4 , 4,0 , 3549,5 , 3554,11 , 2, 1, 1, 6, 7 }, // Sinhala/Sinhala/SriLanka
+ { 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/SouthAfrica
+ { 108, 7, 191, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 176,7 , 560,7 , 1045,10 , 532,18 , 55,4 , 59,9 , 16995,48 , 17043,82 , 16212,24 , 16995,48 , 17125,89 , 16212,24 , 9165,21 , 9186,52 , 9238,14 , 9165,21 , 9186,52 , 9238,14 , 0,2 , 0,2 , 283,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12056,26 , 13,5 , 4,0 , 3565,10 , 3575,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 , 567,8 , 567,8 , 1055,9 , 1064,19 , 37,5 , 8,10 , 17214,59 , 17273,86 , 16212,24 , 17214,59 , 17273,86 , 16212,24 , 9252,35 , 9287,52 , 9339,14 , 9252,35 , 9287,52 , 9339,14 , 60,4 , 248,4 , 54,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12082,28 , 13,5 , 4,0 , 3584,11 , 3595,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 , 0,6 , 0,6 , 27,8 , 1083,19 , 18,7 , 25,12 , 17359,48 , 17407,189 , 17596,24 , 17359,48 , 17407,189 , 17596,24 , 9353,28 , 9381,47 , 9428,15 , 9353,28 , 9381,47 , 9428,15 , 283,3 , 252,3 , 45,4 , 5,17 , 22,23 , {83,79,83}, 100,1 , 12110,22 , 4,4 , 4,0 , 3604,8 , 3612,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 , 0,6 , 0,6 , 27,8 , 1083,19 , 18,7 , 25,12 , 17359,48 , 17407,189 , 17596,24 , 17359,48 , 17407,189 , 17596,24 , 9353,28 , 9381,47 , 9428,15 , 9353,28 , 9381,47 , 9428,15 , 283,3 , 252,3 , 45,4 , 5,17 , 22,23 , {68,74,70}, 43,3 , 12132,21 , 4,4 , 4,0 , 3604,8 , 3622,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 , 0,6 , 0,6 , 27,8 , 1083,19 , 18,7 , 25,12 , 17359,48 , 17407,189 , 17596,24 , 17359,48 , 17407,189 , 17596,24 , 9353,28 , 9381,47 , 9428,15 , 9353,28 , 9381,47 , 9428,15 , 283,3 , 252,3 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,2 , 12153,22 , 4,4 , 4,0 , 3604,8 , 3629,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 , 0,6 , 0,6 , 27,8 , 1083,19 , 37,5 , 8,10 , 17359,48 , 17407,189 , 17596,24 , 17359,48 , 17407,189 , 17596,24 , 9353,28 , 9381,47 , 9428,15 , 9353,28 , 9381,47 , 9428,15 , 283,3 , 252,3 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 0,7 , 4,4 , 4,0 , 3604,8 , 3637,7 , 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 , 575,7 , 575,7 , 278,6 , 587,27 , 55,4 , 356,11 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 7964,14 , 9443,35 , 9478,53 , 7964,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 3644,17 , 2354,6 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Spain
+ { 111, 7, 10, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 3054,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {65,82,83}, 6,1 , 12175,51 , 8,5 , 4,0 , 3661,7 , 3668,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Argentina
+ { 111, 7, 22, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {66,90,68}, 6,1 , 12226,52 , 4,4 , 4,0 , 3661,7 , 3677,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Belize
+ { 111, 7, 26, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {66,79,66}, 292,2 , 12278,35 , 4,4 , 4,0 , 3661,7 , 3304,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Bolivia
+ { 111, 7, 30, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {66,82,76}, 281,2 , 12313,52 , 4,4 , 4,0 , 3661,7 , 3120,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Brazil
+ { 111, 7, 43, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 348,8 , 587,27 , 37,5 , 8,10 , 17620,61 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,76,80}, 6,1 , 12365,45 , 4,4 , 36,5 , 3661,7 , 3683,5 , 0, 0, 1, 6, 7 }, // Spanish/Latin/Chile
+ { 111, 7, 47, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 509,7 , 587,27 , 18,7 , 25,12 , 17620,61 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 9531,14 , 9443,35 , 9478,53 , 3054,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,79,80}, 6,1 , 12410,54 , 8,5 , 4,0 , 3661,7 , 3688,8 , 0, 0, 7, 6, 7 }, // Spanish/Latin/Colombia
+ { 111, 7, 52, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,82,67}, 307,1 , 12464,67 , 4,4 , 4,0 , 3661,7 , 3696,10 , 2, 0, 1, 6, 7 }, // Spanish/Latin/CostaRica
+ { 111, 7, 55, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {67,85,80}, 6,1 , 12531,42 , 4,4 , 4,0 , 3661,7 , 3706,4 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Cuba
+ { 111, 7, 61, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 18,7 , 25,12 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 3054,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {68,79,80}, 308,3 , 12573,54 , 4,4 , 85,6 , 3661,7 , 3710,20 , 2, 1, 7, 6, 7 }, // Spanish/Latin/DominicanRepublic
+ { 111, 7, 63, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12627,70 , 4,4 , 36,5 , 3661,7 , 3311,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Ecuador
+ { 111, 7, 65, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12627,70 , 4,4 , 4,0 , 3661,7 , 3730,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/ElSalvador
+ { 111, 7, 66, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 55,4 , 356,11 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 7964,14 , 9443,35 , 9478,53 , 7964,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 12697,53 , 4,4 , 4,0 , 3661,7 , 3741,17 , 0, 0, 1, 6, 7 }, // Spanish/Latin/EquatorialGuinea
+ { 111, 7, 90, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 509,7 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {71,84,81}, 311,1 , 12750,30 , 18,5 , 4,0 , 3661,7 , 3758,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Guatemala
+ { 111, 7, 96, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 1102,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {72,78,76}, 297,1 , 12780,60 , 4,4 , 4,0 , 3661,7 , 3767,8 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Honduras
+ { 111, 7, 139, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 27,8 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17878,48 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 3054,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {77,88,78}, 6,1 , 12840,48 , 4,4 , 4,0 , 3775,17 , 3792,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Mexico
+ { 111, 7, 155, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {78,73,79}, 312,2 , 12888,69 , 4,4 , 4,0 , 3661,7 , 3798,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Nicaragua
+ { 111, 7, 166, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 1129,8 , 587,27 , 18,7 , 25,12 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,65,66}, 314,3 , 12957,54 , 4,4 , 4,0 , 3661,7 , 3807,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Panama
+ { 111, 7, 168, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,89,71}, 317,3 , 13011,61 , 8,5 , 23,6 , 3661,7 , 3813,8 , 0, 0, 7, 6, 7 }, // Spanish/Latin/Paraguay
+ { 111, 7, 169, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 509,7 , 587,27 , 37,5 , 8,10 , 17926,60 , 17986,88 , 17770,24 , 18074,60 , 18134,88 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,69,78}, 290,2 , 13072,43 , 4,4 , 4,0 , 3661,7 , 3300,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 , 575,7 , 575,7 , 278,6 , 587,27 , 18,7 , 25,12 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 7964,14 , 9443,35 , 9478,53 , 7964,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,72,80}, 185,1 , 13115,48 , 13,5 , 4,0 , 3661,7 , 3821,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Philippines
+ { 111, 7, 174, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 1129,8 , 587,27 , 18,7 , 25,12 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12627,70 , 4,4 , 4,0 , 3661,7 , 1408,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/PuertoRico
+ { 111, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 18,7 , 25,12 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12627,70 , 4,4 , 4,0 , 3661,7 , 3830,7 , 2, 1, 7, 6, 7 }, // Spanish/Latin/UnitedStates
+ { 111, 7, 227, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17926,60 , 17986,88 , 17770,24 , 18074,60 , 18134,88 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,89,85}, 6,1 , 13163,48 , 8,5 , 4,0 , 3661,7 , 3837,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Uruguay
+ { 111, 7, 231, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 18,7 , 25,12 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {86,69,70}, 320,3 , 13211,64 , 4,4 , 36,5 , 3661,7 , 3844,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 , 575,7 , 575,7 , 278,6 , 587,27 , 55,4 , 356,11 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 7964,14 , 9443,35 , 9478,53 , 7964,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 3661,7 , 3853,8 , 2, 1, 1, 6, 7 }, // Spanish/Latin/CanaryIslands
+ { 111, 7, 246, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 37,5 , 8,10 , 17794,60 , 17681,89 , 17770,24 , 17794,60 , 17681,89 , 17854,24 , 9443,35 , 9478,53 , 3054,14 , 9443,35 , 9478,53 , 9531,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 13275,0 , 4,4 , 4,0 , 3861,23 , 3884,13 , 2, 1, 1, 6, 7 }, // Spanish/Latin/LatinAmericaAndTheCaribbean
+ { 111, 7, 250, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 575,7 , 575,7 , 278,6 , 587,27 , 55,4 , 356,11 , 17620,61 , 17681,89 , 17770,24 , 17620,61 , 17681,89 , 17770,24 , 9443,35 , 9478,53 , 7964,14 , 9443,35 , 9478,53 , 7964,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 3661,7 , 3897,15 , 2, 1, 1, 6, 7 }, // Spanish/Latin/CeutaAndMelilla
+ { 113, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 582,8 , 582,8 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 18270,84 , 134,24 , 18222,48 , 18270,84 , 134,24 , 9545,60 , 9545,60 , 85,14 , 9545,60 , 9545,60 , 85,14 , 286,7 , 255,6 , 548,5 , 705,47 , 22,23 , {84,90,83}, 198,3 , 13275,67 , 4,4 , 4,0 , 3912,9 , 1587,8 , 0, 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 , 582,8 , 582,8 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 18270,84 , 134,24 , 18222,48 , 18270,84 , 134,24 , 9545,60 , 9545,60 , 85,14 , 9545,60 , 9545,60 , 85,14 , 286,7 , 255,6 , 548,5 , 705,47 , 22,23 , {67,68,70}, 215,2 , 13342,55 , 4,4 , 4,0 , 3921,8 , 3929,32 , 2, 1, 1, 6, 7 }, // Swahili/Latin/CongoKinshasa
+ { 113, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 582,8 , 582,8 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 18270,84 , 134,24 , 18222,48 , 18270,84 , 134,24 , 9545,60 , 9545,60 , 85,14 , 9545,60 , 9545,60 , 85,14 , 0,2 , 0,2 , 548,5 , 705,47 , 22,23 , {75,69,83}, 2,3 , 13397,58 , 4,4 , 4,0 , 3912,9 , 1153,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 , 582,8 , 582,8 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 18270,84 , 134,24 , 18222,48 , 18270,84 , 134,24 , 9545,60 , 9545,60 , 85,14 , 9545,60 , 9545,60 , 85,14 , 286,7 , 255,6 , 548,5 , 705,47 , 22,23 , {85,71,88}, 203,3 , 13455,61 , 4,4 , 4,0 , 3912,9 , 1652,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 , 590,9 , 590,9 , 53,10 , 98,16 , 37,5 , 367,16 , 18354,59 , 18413,86 , 134,24 , 18354,59 , 18413,86 , 134,24 , 9605,29 , 9634,50 , 2353,14 , 9605,29 , 9634,50 , 2353,14 , 293,2 , 261,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 196,2 , 13516,45 , 13,5 , 4,0 , 3961,7 , 3968,7 , 2, 1, 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 , 590,9 , 590,9 , 1137,10 , 98,16 , 37,5 , 367,16 , 18354,59 , 18413,86 , 134,24 , 18354,59 , 18413,86 , 134,24 , 9605,29 , 9634,50 , 2353,14 , 9605,29 , 9634,50 , 2353,14 , 293,2 , 261,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8852,19 , 13,5 , 4,0 , 3961,7 , 1050,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 , 590,9 , 590,9 , 53,10 , 98,16 , 37,5 , 367,16 , 18354,59 , 18413,86 , 134,24 , 18354,59 , 18413,86 , 134,24 , 9605,29 , 9634,50 , 2353,14 , 9605,29 , 9634,50 , 2353,14 , 293,2 , 261,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8852,19 , 13,5 , 4,0 , 3961,7 , 3975,5 , 2, 1, 1, 6, 7 }, // Swedish/Latin/AlandIslands
+ { 116, 2, 209, 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,74,83}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 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 , 599,13 , 599,13 , 278,6 , 211,18 , 312,7 , 383,12 , 18499,58 , 18557,86 , 18643,31 , 18499,58 , 18557,86 , 18643,31 , 9684,39 , 9723,49 , 9772,20 , 9684,39 , 9723,49 , 9772,20 , 295,8 , 263,8 , 752,7 , 5,17 , 22,23 , {73,78,82}, 127,1 , 13561,49 , 8,5 , 4,0 , 3980,5 , 3985,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 , 599,13 , 599,13 , 278,6 , 211,18 , 312,7 , 383,12 , 18499,58 , 18557,86 , 18643,31 , 18499,58 , 18557,86 , 18643,31 , 9684,39 , 9723,49 , 9772,20 , 9684,39 , 9723,49 , 9772,20 , 295,8 , 263,8 , 752,7 , 5,17 , 22,23 , {77,89,82}, 180,2 , 13610,61 , 8,5 , 4,0 , 3980,5 , 3992,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 , 599,13 , 599,13 , 278,6 , 211,18 , 312,7 , 383,12 , 18499,58 , 18557,86 , 18643,31 , 18499,58 , 18557,86 , 18643,31 , 9684,39 , 9723,49 , 9772,20 , 9684,39 , 9723,49 , 9772,20 , 295,8 , 263,8 , 752,7 , 5,17 , 22,23 , {83,71,68}, 6,1 , 13671,61 , 8,5 , 4,0 , 3980,5 , 3999,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 , 599,13 , 599,13 , 278,6 , 211,18 , 37,5 , 8,10 , 18499,58 , 18557,86 , 18643,31 , 18499,58 , 18557,86 , 18643,31 , 9684,39 , 9723,49 , 9772,20 , 9684,39 , 9723,49 , 9772,20 , 295,8 , 263,8 , 752,7 , 5,17 , 22,23 , {76,75,82}, 323,3 , 13732,49 , 8,5 , 4,0 , 3980,5 , 4010,6 , 2, 1, 1, 6, 7 }, // Tamil/Tamil/SriLanka
+ { 118, 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}, 129,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 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 , 612,11 , 612,11 , 348,8 , 1147,18 , 18,7 , 25,12 , 18674,66 , 18740,86 , 18826,31 , 18857,62 , 18740,86 , 18826,31 , 9792,32 , 9824,60 , 9884,18 , 9792,32 , 9824,60 , 9884,18 , 0,2 , 0,2 , 759,7 , 766,27 , 22,23 , {73,78,82}, 127,1 , 13781,26 , 4,4 , 4,0 , 4016,6 , 4022,9 , 2, 1, 7, 7, 7 }, // Telugu/Telugu/India
+ { 120, 30, 211, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 114,5 , 114,5 , 623,8 , 631,7 , 278,6 , 1165,19 , 37,5 , 395,28 , 18919,63 , 18982,98 , 18919,63 , 18919,63 , 18982,98 , 18919,63 , 9902,23 , 9925,68 , 9993,16 , 9902,23 , 9925,68 , 9993,16 , 303,10 , 271,10 , 793,4 , 5,17 , 22,23 , {84,72,66}, 326,3 , 13807,19 , 4,4 , 4,0 , 4031,3 , 4031,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 , 1184,23 , 18,7 , 25,12 , 2886,63 , 19080,159 , 158,27 , 2886,63 , 19239,147 , 158,27 , 10009,51 , 10060,79 , 10139,27 , 10009,51 , 10060,79 , 10139,27 , 313,7 , 281,8 , 45,4 , 5,17 , 22,23 , {67,78,89}, 329,1 , 13826,13 , 8,5 , 4,0 , 4034,8 , 4042,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 , 1184,23 , 18,7 , 25,12 , 2886,63 , 19080,159 , 158,27 , 2886,63 , 19239,147 , 158,27 , 10009,51 , 10060,79 , 10139,27 , 10009,51 , 10060,79 , 10139,27 , 313,7 , 281,8 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 13839,19 , 8,5 , 4,0 , 4034,8 , 4048,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 , 1207,23 , 18,7 , 25,12 , 19386,36 , 19422,54 , 19476,24 , 19386,36 , 19422,54 , 19476,24 , 10166,21 , 10187,29 , 10216,14 , 10166,21 , 10230,29 , 10259,14 , 320,7 , 289,7 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,2 , 13858,16 , 4,4 , 4,0 , 4055,4 , 82,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 , 1207,23 , 18,7 , 25,12 , 19386,36 , 19422,54 , 19476,24 , 19386,36 , 19422,54 , 19476,24 , 10166,21 , 10187,29 , 10259,14 , 10166,21 , 10230,29 , 10259,14 , 320,7 , 289,7 , 45,4 , 5,17 , 22,23 , {69,82,78}, 46,3 , 0,7 , 4,4 , 4,0 , 4055,4 , 4059,4 , 2, 1, 1, 6, 7 }, // Tigrinya/Ethiopic/Eritrea
+ { 123, 7, 214, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 638,8 , 638,8 , 638,8 , 638,8 , 278,6 , 98,16 , 18,7 , 25,12 , 19500,51 , 19551,87 , 19638,24 , 19500,51 , 19551,87 , 19638,24 , 10273,29 , 10302,60 , 10362,14 , 10273,29 , 10302,60 , 10362,14 , 327,10 , 296,6 , 797,5 , 802,59 , 861,65 , {84,79,80}, 201,2 , 13874,41 , 8,5 , 4,0 , 4063,13 , 1602,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/SouthAfrica
+ { 125, 7, 217, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 646,8 , 646,8 , 1230,9 , 1239,16 , 37,5 , 8,10 , 19662,48 , 19710,75 , 19785,24 , 19662,48 , 19710,75 , 19785,24 , 10376,28 , 10404,54 , 10458,14 , 10376,28 , 10404,54 , 10458,14 , 337,2 , 302,2 , 152,4 , 5,17 , 22,23 , {84,82,89}, 256,1 , 13915,40 , 4,4 , 4,0 , 4076,6 , 4082,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 , 646,8 , 646,8 , 1230,9 , 1239,16 , 18,7 , 25,12 , 19662,48 , 19710,75 , 19785,24 , 19662,48 , 19710,75 , 19785,24 , 10376,28 , 10404,54 , 10458,14 , 10376,28 , 10404,54 , 10458,14 , 337,2 , 302,2 , 152,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 4,4 , 4,0 , 4076,6 , 4089,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 , 654,8 , 654,8 , 931,10 , 1239,16 , 37,5 , 8,10 , 19809,51 , 19860,77 , 19937,24 , 19809,51 , 19860,77 , 19937,24 , 10472,21 , 10493,54 , 10547,14 , 10472,21 , 10493,54 , 10547,14 , 0,2 , 0,2 , 926,4 , 5,17 , 22,23 , {84,77,84}, 330,3 , 13955,49 , 13,5 , 4,0 , 4095,9 , 4104,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 , 191,10 , 201,9 , 53,10 , 1255,17 , 18,7 , 25,12 , 19961,84 , 19961,84 , 158,27 , 19961,84 , 19961,84 , 158,27 , 10561,21 , 10582,55 , 10637,14 , 10561,21 , 10582,55 , 10637,14 , 339,12 , 304,12 , 45,4 , 5,17 , 22,23 , {67,78,89}, 139,1 , 14004,40 , 4,4 , 4,0 , 4116,8 , 4124,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 , 129,7 , 129,7 , 175,8 , 1272,22 , 37,5 , 8,10 , 20045,48 , 20093,95 , 20188,24 , 20212,67 , 20279,87 , 20366,24 , 1573,21 , 10651,56 , 10707,14 , 1573,21 , 10651,56 , 10707,14 , 351,2 , 316,2 , 930,5 , 528,17 , 22,23 , {85,65,72}, 298,1 , 14044,49 , 13,5 , 4,0 , 4129,10 , 4139,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 , 662,10 , 672,9 , 278,6 , 157,18 , 18,7 , 25,12 , 20390,68 , 20390,68 , 134,24 , 20390,68 , 20390,68 , 134,24 , 10721,39 , 10721,39 , 85,14 , 10721,39 , 10721,39 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 182,2 , 14093,49 , 4,4 , 4,0 , 4146,4 , 3285,7 , 0, 0, 7, 6, 7 }, // Urdu/Arabic/Pakistan
+ { 130, 1, 100, 46, 44, 59, 37, 1776, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 681,6 , 681,6 , 278,6 , 157,18 , 18,7 , 25,12 , 20390,68 , 20390,68 , 134,24 , 20390,68 , 20390,68 , 134,24 , 10760,36 , 10760,36 , 85,14 , 10760,36 , 10760,36 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 14142,42 , 8,5 , 4,0 , 4146,4 , 4150,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 , 687,8 , 687,8 , 27,8 , 1294,18 , 37,5 , 356,11 , 20458,48 , 20506,75 , 20581,24 , 20605,48 , 20653,75 , 20581,24 , 10796,32 , 10828,61 , 10889,14 , 10796,32 , 10828,61 , 10889,14 , 353,2 , 318,2 , 152,4 , 297,17 , 22,23 , {85,90,83}, 333,4 , 14184,58 , 13,5 , 4,0 , 4155,6 , 4161,11 , 0, 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 , 385,8 , 1312,33 , 55,4 , 356,11 , 20728,47 , 14180,68 , 158,27 , 20728,47 , 14180,68 , 158,27 , 10903,21 , 7376,49 , 85,14 , 10903,21 , 7376,49 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {65,70,78}, 274,1 , 14242,13 , 13,5 , 4,0 , 4172,6 , 3077,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 , 614,19 , 37,5 , 88,12 , 10842,48 , 20775,71 , 10970,24 , 20846,48 , 20894,71 , 10970,24 , 10924,28 , 10952,53 , 11005,14 , 11019,28 , 11047,53 , 11005,14 , 355,2 , 320,2 , 45,4 , 5,17 , 22,23 , {85,90,83}, 337,3 , 14255,49 , 13,5 , 4,0 , 4178,7 , 4185,10 , 0, 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 , 695,8 , 695,8 , 120,10 , 211,18 , 37,5 , 8,10 , 20965,75 , 21040,99 , 158,27 , 21139,75 , 21214,99 , 158,27 , 11100,33 , 11133,55 , 11188,21 , 11100,33 , 11133,55 , 11188,21 , 357,2 , 322,2 , 45,4 , 5,17 , 22,23 , {86,78,68}, 340,1 , 14304,33 , 8,5 , 4,0 , 4195,10 , 4205,8 , 0, 0, 1, 6, 7 }, // Vietnamese/Latin/Vietnam
+ { 134, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 10,17 , 37,5 , 8,10 , 21313,52 , 21365,87 , 21452,26 , 21478,59 , 21365,87 , 21452,26 , 11209,29 , 11238,77 , 11315,15 , 11330,30 , 11238,77 , 11315,15 , 359,2 , 324,2 , 935,7 , 5,17 , 22,23 , {71,66,80}, 125,1 , 14337,92 , 4,4 , 4,0 , 4213,7 , 4220,16 , 2, 1, 1, 6, 7 }, // Welsh/Latin/UnitedKingdom
+ { 135, 7, 187, 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}, 210,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Wolof/Latin/Senegal
+ { 136, 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 }, // Xhosa/Latin/SouthAfrica
+ { 138, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 37,5 , 8,10 , 21537,73 , 21610,121 , 158,27 , 21537,73 , 21610,121 , 158,27 , 11360,44 , 11404,69 , 85,14 , 11360,44 , 11404,69 , 85,14 , 361,5 , 326,5 , 45,4 , 5,17 , 22,23 , {78,71,78}, 184,1 , 14429,34 , 4,4 , 4,0 , 4236,10 , 4246,18 , 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 , 120,10 , 10,17 , 37,5 , 8,10 , 21731,74 , 21805,134 , 158,27 , 21731,74 , 21805,134 , 158,27 , 11473,44 , 11517,69 , 85,14 , 11473,44 , 11517,69 , 85,14 , 366,5 , 331,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 14463,34 , 4,4 , 4,0 , 4236,10 , 4264,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 , 703,9 , 712,8 , 516,6 , 35,18 , 37,5 , 8,10 , 21939,48 , 21987,91 , 134,24 , 21939,48 , 22078,93 , 22171,24 , 11586,28 , 11614,74 , 11688,14 , 11586,28 , 11614,74 , 11688,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 14497,67 , 4,4 , 4,0 , 4280,7 , 4287,14 , 2, 1, 7, 6, 7 }, // Zulu/Latin/SouthAfrica
+ { 141, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 183,8 , 183,8 , 931,10 , 469,17 , 37,5 , 367,16 , 5791,48 , 13743,83 , 134,24 , 22195,59 , 13743,83 , 134,24 , 11702,28 , 11730,51 , 2353,14 , 11781,28 , 11730,51 , 2353,14 , 371,9 , 336,11 , 45,4 , 5,17 , 22,23 , {78,79,75}, 196,2 , 14564,42 , 13,5 , 4,0 , 4301,7 , 4308,5 , 2, 1, 1, 6, 7 }, // NorwegianNynorsk/Latin/Norway
+ { 142, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 8216, 8217, 0,6 , 0,6 , 154,7 , 154,7 , 995,7 , 441,19 , 37,5 , 8,10 , 16236,48 , 22254,83 , 16212,24 , 16236,48 , 22254,83 , 16212,24 , 2076,28 , 2104,58 , 2162,14 , 2076,28 , 2104,58 , 2176,14 , 380,10 , 347,7 , 276,7 , 5,17 , 22,23 , {66,65,77}, 150,2 , 14606,170 , 13,5 , 4,0 , 4313,8 , 591,19 , 2, 1, 1, 6, 7 }, // Bosnian/Latin/BosniaAndHerzegowina
+ { 142, 2, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 107,7 , 107,7 , 995,7 , 1002,20 , 37,5 , 8,10 , 15886,48 , 22337,83 , 12349,24 , 15886,48 , 22337,83 , 12349,24 , 11809,28 , 11837,54 , 8482,14 , 11809,28 , 11837,54 , 8482,14 , 223,9 , 354,7 , 45,4 , 5,17 , 22,23 , {66,65,77}, 302,2 , 14776,151 , 13,5 , 4,0 , 4321,8 , 3459,19 , 2, 1, 1, 6, 7 }, // Bosnian/Cyrillic/BosniaAndHerzegowina
+ { 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 , 633,17 , 37,5 , 8,10 , 22420,102 , 22522,140 , 158,27 , 22420,102 , 22522,140 , 158,27 , 11891,30 , 11921,57 , 85,14 , 11891,30 , 11921,57 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {71,66,80}, 125,1 , 0,7 , 4,4 , 4,0 , 4329,5 , 4334,12 , 2, 1, 1, 6, 7 }, // Manx/Latin/IsleOfMan
+ { 145, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 98,16 , 37,5 , 8,10 , 22662,46 , 22708,130 , 158,27 , 22662,46 , 22708,130 , 158,27 , 11978,28 , 12006,61 , 85,14 , 11978,28 , 12006,61 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {71,66,80}, 125,1 , 0,7 , 4,4 , 4,0 , 4346,8 , 4354,14 , 2, 1, 1, 6, 7 }, // Cornish/Latin/UnitedKingdom
+ { 146, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1345,8 , 1353,18 , 18,7 , 25,12 , 22838,48 , 22886,192 , 158,27 , 22838,48 , 22886,192 , 158,27 , 12067,28 , 12095,49 , 12144,14 , 12067,28 , 12095,49 , 12144,14 , 390,2 , 361,2 , 45,4 , 5,17 , 22,23 , {71,72,83}, 173,3 , 14927,17 , 4,4 , 4,0 , 4368,4 , 4372,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 , 941,6 , 98,16 , 18,7 , 25,12 , 23078,87 , 23078,87 , 158,27 , 23078,87 , 23078,87 , 158,27 , 7017,32 , 12158,55 , 85,14 , 7017,32 , 12158,55 , 85,14 , 184,5 , 363,5 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 0,7 , 8,5 , 4,0 , 4377,6 , 2589,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 , 0,6 , 0,6 , 120,10 , 10,17 , 37,5 , 8,10 , 23165,48 , 23213,86 , 158,27 , 23165,48 , 23213,86 , 158,27 , 12213,29 , 12242,57 , 85,14 , 12213,29 , 12242,57 , 85,14 , 38,4 , 368,4 , 45,4 , 5,17 , 22,23 , {78,71,78}, 184,1 , 14944,12 , 4,4 , 4,0 , 4383,4 , 1303,7 , 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 , 120,10 , 10,17 , 37,5 , 8,10 , 23299,48 , 23347,189 , 23536,24 , 23299,48 , 23347,189 , 23536,24 , 12299,28 , 12327,74 , 12401,14 , 12299,28 , 12327,74 , 12401,14 , 392,9 , 372,7 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 14956,23 , 4,4 , 4,0 , 4387,7 , 1153,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}, 184,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}, 184,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 , 236,7 , 236,7 , 27,8 , 1371,27 , 37,5 , 8,10 , 23560,48 , 23608,77 , 23685,24 , 23560,48 , 23608,77 , 23685,24 , 12415,28 , 12443,50 , 3054,14 , 12415,28 , 12443,50 , 3054,14 , 401,2 , 379,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 8,5 , 4,0 , 4394,6 , 4400,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/SouthAfrica
+ { 161, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 720,11 , 731,10 , 516,6 , 1398,23 , 423,12 , 435,17 , 23709,48 , 23757,87 , 23844,24 , 23709,48 , 23757,87 , 23844,24 , 12493,28 , 12521,44 , 12565,14 , 12493,28 , 12521,44 , 12565,14 , 403,3 , 381,5 , 45,4 , 5,17 , 22,23 , {71,72,83}, 173,3 , 14979,37 , 4,4 , 4,0 , 4406,6 , 4412,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 , 720,11 , 731,10 , 516,6 , 1398,23 , 37,5 , 8,10 , 23709,48 , 23757,87 , 23844,24 , 23709,48 , 23757,87 , 23844,24 , 12493,28 , 12521,44 , 12565,14 , 12493,28 , 12521,44 , 12565,14 , 403,3 , 381,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 15016,106 , 4,4 , 4,0 , 4406,6 , 4424,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 , 278,6 , 10,17 , 18,7 , 25,12 , 23868,59 , 23927,95 , 158,27 , 23868,59 , 23927,95 , 158,27 , 12579,21 , 12600,57 , 85,14 , 12579,21 , 12600,57 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 4,4 , 4,0 , 4435,14 , 4449,19 , 2, 1, 7, 6, 7 }, // Hawaiian/Latin/UnitedStates
+ { 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}, 184,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 , 741,9 , 750,8 , 516,6 , 35,18 , 18,7 , 25,12 , 24022,48 , 24070,88 , 24158,38 , 24022,48 , 24070,88 , 24022,48 , 12657,28 , 12685,55 , 12657,28 , 12657,28 , 12685,55 , 12657,28 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {80,72,80}, 185,1 , 15122,58 , 4,4 , 4,0 , 4468,8 , 4476,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 24196,86 , 134,24 , 7736,48 , 24196,86 , 134,24 , 12740,28 , 12768,63 , 3642,14 , 12740,28 , 12768,63 , 3642,14 , 406,12 , 386,11 , 45,4 , 5,17 , 22,23 , {67,72,70}, 229,3 , 15180,55 , 13,5 , 4,0 , 4485,16 , 4501,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 24196,86 , 134,24 , 7736,48 , 24196,86 , 134,24 , 12740,28 , 12768,63 , 3642,14 , 12740,28 , 12768,63 , 3642,14 , 406,12 , 386,11 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 13,5 , 4,0 , 4485,16 , 4508,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 , 251,9 , 251,9 , 175,8 , 532,18 , 37,5 , 8,10 , 7736,48 , 24196,86 , 134,24 , 7736,48 , 24196,86 , 134,24 , 12740,28 , 12768,63 , 3642,14 , 12740,28 , 12768,63 , 3642,14 , 406,12 , 386,11 , 45,4 , 5,17 , 22,23 , {67,72,70}, 229,3 , 15180,55 , 13,5 , 4,0 , 4485,16 , 4518,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 , 24282,38 , 24282,38 , 158,27 , 24282,38 , 24282,38 , 158,27 , 12831,21 , 12852,28 , 12880,14 , 12831,21 , 12852,28 , 12880,14 , 418,2 , 397,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 329,1 , 0,7 , 8,5 , 4,0 , 4531,3 , 4534,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 , 409,8 , 409,8 , 356,7 , 1421,23 , 452,10 , 462,19 , 7867,59 , 24320,85 , 134,24 , 7867,59 , 24320,85 , 134,24 , 12894,28 , 12922,65 , 3642,14 , 12894,28 , 12922,65 , 3642,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15235,15 , 13,5 , 4,0 , 4536,14 , 4550,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 , 409,8 , 409,8 , 356,7 , 1421,23 , 452,10 , 462,19 , 7867,59 , 24320,85 , 134,24 , 7867,59 , 24320,85 , 134,24 , 12894,28 , 12922,65 , 3642,14 , 12894,28 , 12922,65 , 3642,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15235,15 , 13,5 , 4,0 , 4536,14 , 4561,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/SouthAfrica
+ { 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/SouthAfrica
+ { 173, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 210,8 , 210,8 , 53,10 , 63,17 , 37,5 , 8,10 , 24405,59 , 24464,145 , 24609,24 , 24405,59 , 24464,145 , 24609,24 , 12987,33 , 13020,75 , 13095,14 , 12987,33 , 13020,75 , 13095,14 , 420,11 , 399,13 , 45,4 , 5,17 , 22,23 , {78,79,75}, 196,2 , 15250,63 , 13,5 , 4,0 , 4573,15 , 4588,5 , 2, 1, 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 , 210,8 , 210,8 , 53,10 , 63,17 , 37,5 , 8,10 , 24405,59 , 24464,145 , 24609,24 , 24405,59 , 24464,145 , 24609,24 , 12987,33 , 13020,75 , 13109,14 , 12987,33 , 13123,79 , 13109,14 , 420,11 , 399,13 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15313,23 , 13,5 , 4,0 , 4573,15 , 4593,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 , 210,8 , 210,8 , 53,10 , 63,17 , 37,5 , 8,10 , 24405,59 , 24464,145 , 24609,24 , 24405,59 , 24464,145 , 24609,24 , 12987,33 , 13020,75 , 13095,14 , 12987,33 , 13020,75 , 13095,14 , 420,11 , 399,13 , 45,4 , 5,17 , 22,23 , {83,69,75}, 196,2 , 15336,63 , 13,5 , 4,0 , 4573,15 , 4599,6 , 2, 1, 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}, 341,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 , 120,10 , 10,17 , 37,5 , 8,10 , 24633,48 , 24681,88 , 24769,24 , 24633,48 , 24681,88 , 24769,24 , 13202,28 , 13230,62 , 13292,14 , 13202,28 , 13230,62 , 13292,14 , 431,6 , 412,3 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15399,24 , 4,4 , 4,0 , 4605,8 , 1153,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 , 120,10 , 10,17 , 37,5 , 8,10 , 24793,48 , 24841,221 , 25062,24 , 24793,48 , 24841,221 , 25062,24 , 13306,28 , 13334,105 , 13439,14 , 13306,28 , 13334,105 , 13439,14 , 437,10 , 415,10 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15399,24 , 4,4 , 4,0 , 4613,7 , 1153,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 , 406,8 , 98,16 , 37,5 , 8,10 , 25086,48 , 25134,77 , 25211,24 , 25086,48 , 25134,77 , 25211,24 , 13453,28 , 13481,59 , 13540,14 , 13453,28 , 13481,59 , 13540,14 , 447,6 , 425,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 15423,26 , 13,5 , 4,0 , 4620,6 , 4626,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Senegal
+ { 177, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 406,8 , 98,16 , 37,5 , 8,10 , 25086,48 , 25134,77 , 25211,24 , 25086,48 , 25134,77 , 25211,24 , 13453,28 , 13481,59 , 13540,14 , 13453,28 , 13481,59 , 13540,14 , 447,6 , 425,7 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 15449,25 , 13,5 , 4,0 , 4620,6 , 4634,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Cameroon
+ { 177, 7, 91, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 406,8 , 98,16 , 37,5 , 8,10 , 25086,48 , 25134,77 , 25211,24 , 25086,48 , 25134,77 , 25211,24 , 13453,28 , 13481,59 , 13540,14 , 13453,28 , 13481,59 , 13540,14 , 447,6 , 425,7 , 45,4 , 5,17 , 22,23 , {71,78,70}, 221,2 , 0,7 , 13,5 , 4,0 , 4620,6 , 4642,4 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Guinea
+ { 177, 7, 136, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 406,8 , 98,16 , 18,7 , 25,12 , 25086,48 , 25134,77 , 25211,24 , 25086,48 , 25134,77 , 25211,24 , 13453,28 , 13481,59 , 13540,14 , 13453,28 , 13481,59 , 13540,14 , 447,6 , 425,7 , 45,4 , 5,17 , 22,23 , {77,82,79}, 224,2 , 15474,22 , 13,5 , 4,0 , 4620,6 , 4646,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Mauritania
+ { 178, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 37,5 , 8,10 , 25235,48 , 25283,185 , 25468,24 , 25235,48 , 25283,185 , 25468,24 , 13554,28 , 13582,63 , 13645,14 , 13554,28 , 13582,63 , 13645,14 , 453,6 , 432,8 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15496,23 , 4,4 , 4,0 , 4654,6 , 1153,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 , 120,10 , 10,17 , 37,5 , 8,10 , 25492,48 , 25540,173 , 25713,24 , 25492,48 , 25540,173 , 25713,24 , 13659,28 , 13687,105 , 13792,14 , 13659,28 , 13687,105 , 13792,14 , 459,7 , 440,5 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15519,25 , 4,4 , 4,0 , 4660,8 , 1153,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 , 406,8 , 587,27 , 37,5 , 8,10 , 25737,48 , 25785,88 , 134,24 , 25737,48 , 25785,88 , 134,24 , 13806,28 , 13834,55 , 13889,14 , 13806,28 , 13834,55 , 13889,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,90,78}, 284,3 , 15544,28 , 0,4 , 4,0 , 4668,4 , 3210,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 , 120,10 , 10,17 , 37,5 , 8,10 , 25873,52 , 25925,112 , 26037,24 , 25873,52 , 25925,112 , 26037,24 , 13903,28 , 13931,50 , 13981,14 , 13903,28 , 13931,50 , 13981,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 165,3 , 15572,24 , 4,4 , 4,0 , 4672,10 , 1762,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26061,39 , 26100,194 , 26294,24 , 26061,39 , 26100,194 , 26294,24 , 13995,29 , 14024,65 , 14089,14 , 13995,29 , 14024,65 , 14089,14 , 466,8 , 445,7 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15596,25 , 4,4 , 4,0 , 4682,9 , 1587,8 , 0, 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 , 406,8 , 98,16 , 37,5 , 8,10 , 26318,48 , 26366,81 , 26447,24 , 26318,48 , 26366,81 , 26447,24 , 14103,30 , 14133,47 , 85,14 , 14103,30 , 14133,47 , 85,14 , 474,6 , 452,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 15621,21 , 0,4 , 4,0 , 4691,7 , 4698,6 , 2, 1, 6, 5, 6 }, // 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 , 406,8 , 98,16 , 37,5 , 8,10 , 26471,48 , 26519,81 , 26600,24 , 26471,48 , 26519,81 , 26600,24 , 14180,30 , 14210,48 , 85,14 , 14180,30 , 14210,48 , 85,14 , 480,6 , 460,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 15642,21 , 0,4 , 4,0 , 4704,10 , 4714,6 , 2, 1, 6, 5, 6 }, // Tachelhit/Latin/Morocco
+ { 184, 7, 3, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 406,8 , 98,16 , 18,7 , 25,12 , 26624,48 , 26672,84 , 26756,24 , 26624,48 , 26672,84 , 26756,24 , 14258,30 , 14288,51 , 14339,14 , 14258,30 , 14288,51 , 14339,14 , 486,7 , 468,9 , 45,4 , 5,17 , 22,23 , {68,90,68}, 208,2 , 15663,21 , 0,4 , 4,0 , 4720,9 , 4729,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26780,48 , 26828,152 , 134,24 , 26780,48 , 26828,152 , 134,24 , 14353,28 , 14381,74 , 14455,14 , 14353,28 , 14381,74 , 14455,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 203,3 , 15684,26 , 4,4 , 4,0 , 4737,10 , 1652,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26980,48 , 27028,254 , 27282,24 , 26980,48 , 27028,254 , 27282,24 , 14469,28 , 14497,82 , 14579,14 , 14469,28 , 14497,82 , 14579,14 , 493,7 , 477,7 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15710,29 , 0,4 , 4,0 , 4747,6 , 4753,10 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 27306,87 , 134,24 , 18222,48 , 27306,87 , 134,24 , 14593,28 , 14621,62 , 14683,14 , 14593,28 , 14621,62 , 14683,14 , 500,5 , 484,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15739,27 , 4,4 , 4,0 , 4763,8 , 1587,8 , 0, 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 , 406,8 , 98,16 , 37,5 , 8,10 , 27393,47 , 27440,92 , 27532,24 , 27393,47 , 27440,92 , 27532,24 , 14697,28 , 14725,44 , 14769,14 , 14697,28 , 14725,44 , 14769,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 15766,24 , 4,4 , 4,0 , 4771,9 , 2106,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}, 210,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 , 120,10 , 10,17 , 37,5 , 8,10 , 27556,48 , 27604,207 , 27811,24 , 27556,48 , 27604,207 , 27811,24 , 14783,28 , 14811,64 , 14875,14 , 14783,28 , 14811,64 , 14875,14 , 505,2 , 493,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15399,24 , 4,4 , 4,0 , 4780,6 , 1153,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 , 758,8 , 758,8 , 516,6 , 35,18 , 18,7 , 25,12 , 27835,36 , 27871,58 , 27929,24 , 27835,36 , 27871,58 , 27929,24 , 14889,28 , 14917,49 , 14966,14 , 14889,28 , 14917,49 , 14966,14 , 507,3 , 495,6 , 942,6 , 5,17 , 22,23 , {85,83,68}, 6,1 , 15790,25 , 4,4 , 4,0 , 4786,3 , 4789,15 , 2, 1, 7, 6, 7 }, // Cherokee/Cherokee/UnitedStates
+ { 191, 7, 137, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 406,8 , 98,16 , 37,5 , 8,10 , 27953,47 , 28000,68 , 28068,24 , 27953,47 , 28000,68 , 28068,24 , 14980,27 , 15007,48 , 15055,14 , 14980,27 , 15007,48 , 15055,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,85,82}, 182,2 , 15815,21 , 79,6 , 4,0 , 4804,14 , 4818,5 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 28092,264 , 134,24 , 18222,48 , 28092,264 , 134,24 , 15069,28 , 15097,133 , 14089,14 , 15069,28 , 15097,133 , 14089,14 , 510,4 , 501,5 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15739,27 , 4,4 , 4,0 , 4823,10 , 1587,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 28356,83 , 28439,111 , 28550,24 , 28356,83 , 28439,111 , 28550,24 , 15230,36 , 15266,63 , 15329,14 , 15230,36 , 15266,63 , 15329,14 , 514,3 , 506,3 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15836,29 , 79,6 , 4,0 , 4833,8 , 4841,9 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 28574,48 , 28622,97 , 134,24 , 28574,48 , 28622,97 , 134,24 , 15343,28 , 15371,66 , 15437,14 , 15343,28 , 15371,66 , 15437,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 203,3 , 15865,26 , 0,4 , 4,0 , 4850,7 , 4857,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 , 120,10 , 10,17 , 18,7 , 25,12 , 28719,48 , 28767,83 , 28850,24 , 28719,48 , 28767,83 , 28850,24 , 15451,80 , 15451,80 , 85,14 , 15451,80 , 15451,80 , 85,14 , 517,8 , 509,7 , 45,4 , 5,17 , 22,23 , {90,77,87}, 137,1 , 0,7 , 4,4 , 4,0 , 4864,9 , 1756,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 , 154,7 , 154,7 , 406,8 , 1444,27 , 37,5 , 8,10 , 28874,48 , 28922,85 , 134,24 , 28874,48 , 28922,85 , 134,24 , 15531,28 , 15559,73 , 15632,14 , 15531,28 , 15646,73 , 15632,14 , 68,2 , 65,2 , 45,4 , 297,17 , 22,23 , {67,86,69}, 283,1 , 15891,43 , 13,5 , 4,0 , 4873,12 , 4885,10 , 2, 1, 1, 6, 7 }, // Kabuverdianu/Latin/CapeVerde
+ { 197, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 120,10 , 10,17 , 37,5 , 8,10 , 29007,48 , 29055,86 , 29141,24 , 29007,48 , 29055,86 , 29141,24 , 15719,28 , 15747,51 , 15798,14 , 15719,28 , 15747,51 , 15798,14 , 525,2 , 516,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15399,24 , 4,4 , 4,0 , 4895,6 , 1153,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29165,49 , 29214,121 , 29335,24 , 29165,49 , 29214,121 , 29335,24 , 15812,28 , 15840,53 , 15893,14 , 15812,28 , 15840,53 , 15893,14 , 527,6 , 518,10 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15934,26 , 4,4 , 4,0 , 4901,8 , 4909,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 , 120,10 , 10,17 , 18,7 , 25,12 , 0,48 , 29359,136 , 134,24 , 0,48 , 29359,136 , 134,24 , 15907,23 , 15930,92 , 16022,14 , 15907,23 , 15930,92 , 16022,14 , 533,7 , 528,5 , 45,4 , 5,17 , 22,23 , {78,65,68}, 6,1 , 15960,22 , 4,4 , 4,0 , 4921,13 , 4934,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 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 27306,87 , 134,24 , 18222,48 , 27306,87 , 134,24 , 14593,28 , 14621,62 , 14683,14 , 14593,28 , 14621,62 , 14683,14 , 500,5 , 484,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15739,27 , 4,4 , 4,0 , 4942,9 , 1587,8 , 0, 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 , 409,8 , 409,8 , 1045,10 , 1471,23 , 37,5 , 8,10 , 29495,59 , 29554,87 , 12643,24 , 29641,48 , 29554,87 , 12643,24 , 16036,28 , 16064,72 , 3642,14 , 16036,28 , 16064,72 , 3642,14 , 540,16 , 533,16 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15982,11 , 13,5 , 4,0 , 4951,6 , 4957,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29689,51 , 29740,132 , 158,27 , 29689,51 , 29740,132 , 158,27 , 14593,28 , 16136,58 , 14089,14 , 14593,28 , 16136,58 , 14089,14 , 556,9 , 549,6 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15993,25 , 4,4 , 4,0 , 4968,3 , 1153,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29689,51 , 29740,132 , 158,27 , 29689,51 , 29740,132 , 158,27 , 14593,28 , 16136,58 , 14089,14 , 14593,28 , 16136,58 , 14089,14 , 556,9 , 549,6 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 16018,28 , 4,4 , 4,0 , 4968,3 , 4971,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 28574,48 , 28622,97 , 134,24 , 28574,48 , 28622,97 , 134,24 , 16194,35 , 16229,65 , 16294,14 , 16194,35 , 16229,65 , 16294,14 , 565,6 , 555,6 , 45,4 , 5,17 , 22,23 , {85,71,88}, 203,3 , 15865,26 , 13,5 , 4,0 , 4979,7 , 4857,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29872,48 , 18270,84 , 134,24 , 29872,48 , 18270,84 , 134,24 , 16308,21 , 16329,75 , 85,14 , 16308,21 , 16329,75 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16046,23 , 4,4 , 91,6 , 4986,7 , 1153,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29920,48 , 18270,84 , 134,24 , 29920,48 , 18270,84 , 134,24 , 16404,28 , 9545,60 , 14683,14 , 16404,28 , 9545,60 , 14683,14 , 571,9 , 561,8 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 16069,28 , 13,5 , 4,0 , 4993,6 , 4999,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 29968,48 , 30016,94 , 30110,24 , 29968,48 , 30016,94 , 30110,24 , 16432,28 , 16460,69 , 16529,14 , 16432,28 , 16460,69 , 16529,14 , 580,9 , 569,6 , 45,4 , 5,17 , 22,23 , {85,71,88}, 203,3 , 16097,28 , 4,4 , 4,0 , 5007,6 , 1652,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 , 120,10 , 10,17 , 37,5 , 8,10 , 29968,48 , 30016,94 , 30110,24 , 29968,48 , 30016,94 , 30110,24 , 16432,28 , 16460,69 , 16529,14 , 16432,28 , 16460,69 , 16529,14 , 580,9 , 569,6 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16125,27 , 4,4 , 4,0 , 5007,6 , 5013,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 , 406,8 , 98,16 , 37,5 , 8,10 , 30134,46 , 30180,88 , 30268,24 , 30134,46 , 30180,88 , 30268,24 , 16543,28 , 16571,53 , 16624,14 , 16543,28 , 16571,53 , 16624,14 , 589,6 , 575,6 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 16152,23 , 0,4 , 4,0 , 5018,11 , 5029,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 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 27306,87 , 134,24 , 18222,48 , 27306,87 , 134,24 , 14593,28 , 14621,62 , 14683,14 , 14593,28 , 14621,62 , 14683,14 , 500,5 , 484,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 15739,27 , 0,4 , 4,0 , 5034,6 , 1587,8 , 0, 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 , 120,10 , 10,17 , 37,5 , 8,10 , 30292,48 , 30340,186 , 30526,24 , 30292,48 , 30340,186 , 30526,24 , 16638,28 , 16666,69 , 16735,14 , 16638,28 , 16666,69 , 16735,14 , 595,2 , 581,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16175,23 , 0,4 , 4,0 , 5040,6 , 1153,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 , 120,10 , 10,17 , 37,5 , 8,10 , 26780,48 , 26828,152 , 134,24 , 26780,48 , 26828,152 , 134,24 , 14353,28 , 14381,74 , 14455,14 , 14353,28 , 14381,74 , 14455,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 203,3 , 15684,26 , 4,4 , 4,0 , 5046,6 , 1652,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 , 120,10 , 10,17 , 37,5 , 8,10 , 30550,48 , 30598,86 , 30684,24 , 30550,48 , 30598,86 , 30684,24 , 16749,28 , 16777,48 , 16825,14 , 16749,28 , 16777,48 , 16825,14 , 597,9 , 583,10 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16198,22 , 13,5 , 4,0 , 5052,17 , 5069,6 , 2, 1, 6, 5, 6 }, // 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 , 406,8 , 98,16 , 37,5 , 8,10 , 30134,46 , 30180,88 , 30268,24 , 30134,46 , 30180,88 , 30268,24 , 16839,28 , 16867,54 , 16624,14 , 16839,28 , 16867,54 , 16624,14 , 589,6 , 575,6 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 16152,23 , 0,4 , 4,0 , 5075,15 , 5029,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 , 120,10 , 10,17 , 37,5 , 8,10 , 18222,48 , 30708,84 , 134,24 , 18222,48 , 30708,84 , 134,24 , 16921,28 , 16949,63 , 17012,14 , 16921,28 , 16949,63 , 17012,14 , 606,5 , 593,8 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 16220,27 , 0,4 , 4,0 , 5090,9 , 1587,8 , 0, 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 , 516,6 , 35,18 , 18,7 , 25,12 , 30792,88 , 30792,88 , 30880,31 , 30792,88 , 30792,88 , 30880,31 , 17026,33 , 17059,54 , 17113,19 , 17026,33 , 17059,54 , 17113,19 , 611,3 , 601,6 , 45,4 , 5,17 , 22,23 , {73,78,82}, 127,1 , 16247,10 , 8,5 , 4,0 , 5099,4 , 2589,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 , 20846,48 , 11053,80 , 158,27 , 20846,48 , 11053,80 , 158,27 , 17132,74 , 17132,74 , 85,14 , 17132,74 , 17132,74 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 129,1 , 16257,43 , 13,5 , 4,0 , 5103,7 , 5110,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 , 766,8 , 766,8 , 1494,10 , 1504,23 , 37,5 , 8,10 , 30911,65 , 30976,117 , 31093,30 , 30911,65 , 31123,117 , 31093,30 , 17206,37 , 17243,68 , 10707,14 , 17206,37 , 17243,68 , 10707,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 129,1 , 16300,44 , 13,5 , 4,0 , 5115,19 , 5134,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}, 129,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 , 406,8 , 98,16 , 37,5 , 8,10 , 31240,49 , 31289,99 , 31388,24 , 31240,49 , 31289,99 , 31388,24 , 17311,28 , 17339,50 , 17389,14 , 17311,28 , 17339,50 , 17389,14 , 614,5 , 607,6 , 45,4 , 5,17 , 22,23 , {67,68,70}, 215,2 , 16344,24 , 0,4 , 4,0 , 5141,8 , 5149,16 , 2, 1, 1, 6, 7 }, // LubaKatanga/Latin/CongoKinshasa
+ { 231, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 774,10 , 774,10 , 175,8 , 532,18 , 37,5 , 8,10 , 31412,48 , 31460,85 , 134,24 , 31545,59 , 31460,85 , 134,24 , 17403,28 , 17431,65 , 3642,14 , 17496,35 , 17431,65 , 3642,14 , 619,5 , 613,8 , 409,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8339,19 , 13,5 , 4,0 , 5165,14 , 5179,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 , 406,8 , 98,16 , 37,5 , 8,10 , 31604,48 , 31652,195 , 31847,24 , 31604,48 , 31652,195 , 31847,24 , 17531,28 , 17559,72 , 17631,14 , 17531,28 , 17559,72 , 17631,14 , 624,3 , 621,3 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16368,21 , 0,4 , 4,0 , 5189,5 , 5194,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 , 406,8 , 98,16 , 37,5 , 8,10 , 31871,48 , 31919,90 , 32009,24 , 31871,48 , 31919,90 , 32009,24 , 17645,28 , 17673,70 , 17743,14 , 17645,28 , 17673,70 , 17743,14 , 627,10 , 624,9 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16389,22 , 13,5 , 4,0 , 5201,5 , 5206,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 , 406,8 , 98,16 , 37,5 , 8,10 , 30134,46 , 30180,88 , 30268,24 , 30134,46 , 30180,88 , 30268,24 , 16839,28 , 17757,53 , 17810,14 , 16839,28 , 17757,53 , 17810,14 , 637,8 , 633,10 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 16152,23 , 0,4 , 4,0 , 5214,10 , 5224,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 , 406,8 , 98,16 , 37,5 , 8,10 , 32033,49 , 32082,99 , 32181,24 , 32033,49 , 32082,99 , 32181,24 , 17824,28 , 17852,45 , 17897,14 , 17824,28 , 17852,45 , 17897,14 , 645,5 , 643,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5229,5 , 1903,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 , 406,8 , 98,16 , 37,5 , 8,10 , 32205,36 , 32241,82 , 32323,24 , 32205,36 , 32241,82 , 32323,24 , 17911,28 , 17939,50 , 17989,14 , 17911,28 , 17939,50 , 17989,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 16411,23 , 13,5 , 4,0 , 5234,5 , 5239,7 , 0, 0, 1, 6, 7 }, // JolaFonyi/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 , 406,8 , 98,16 , 37,5 , 8,10 , 32347,50 , 32397,141 , 32538,24 , 32347,50 , 32397,141 , 32538,24 , 18003,30 , 18033,85 , 18118,14 , 18003,30 , 18033,85 , 18118,14 , 650,7 , 649,9 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16434,23 , 13,5 , 4,0 , 5246,6 , 5252,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 , 406,8 , 98,16 , 37,5 , 8,10 , 32562,39 , 32601,191 , 158,27 , 32562,39 , 32601,191 , 158,27 , 18132,29 , 18161,45 , 18206,14 , 18132,29 , 18161,45 , 18206,14 , 657,6 , 658,7 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16457,11 , 13,5 , 4,0 , 5259,5 , 5264,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 , 120,10 , 10,17 , 37,5 , 8,10 , 32792,48 , 32840,213 , 33053,24 , 32792,48 , 32840,213 , 33053,24 , 18220,28 , 18248,59 , 18307,14 , 18220,28 , 18248,59 , 18307,14 , 663,8 , 665,10 , 45,4 , 5,17 , 22,23 , {77,90,78}, 284,3 , 0,7 , 79,6 , 4,0 , 5271,5 , 5276,10 , 2, 1, 7, 6, 7 }, // MakhuwaMeetto/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 , 406,8 , 98,16 , 37,5 , 8,10 , 33077,48 , 33125,139 , 33264,24 , 33077,48 , 33125,139 , 33264,24 , 18321,28 , 18349,74 , 18423,14 , 18321,28 , 18349,74 , 18423,14 , 671,5 , 675,5 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16468,17 , 4,4 , 4,0 , 5286,6 , 5292,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 , 406,8 , 98,16 , 37,5 , 8,10 , 33288,51 , 33339,143 , 158,27 , 33288,51 , 33339,143 , 158,27 , 18437,30 , 18467,89 , 18556,14 , 18437,30 , 18467,89 , 18556,14 , 676,4 , 680,4 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16485,20 , 13,5 , 4,0 , 5299,6 , 5305,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 , 1527,9 , 98,16 , 18,7 , 481,12 , 33482,54 , 33536,96 , 33632,24 , 33482,54 , 33536,96 , 33632,24 , 18570,38 , 18608,79 , 18687,14 , 18570,38 , 18608,79 , 18687,14 , 680,2 , 684,2 , 45,4 , 5,17 , 22,23 , {83,83,80}, 125,1 , 0,7 , 4,4 , 4,0 , 5312,9 , 0,0 , 2, 1, 1, 6, 7 }, // Nuer/Latin/SouthSudan
+ { 248, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 784,11 , 784,11 , 246,6 , 1536,30 , 37,5 , 8,10 , 33656,50 , 33706,116 , 33822,24 , 33656,50 , 33846,121 , 33822,24 , 18701,21 , 18722,71 , 18793,14 , 18701,21 , 18722,71 , 18793,14 , 682,2 , 686,2 , 948,5 , 953,17 , 22,23 , {82,85,66}, 129,1 , 16505,47 , 13,5 , 4,0 , 5321,9 , 5330,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 , 120,10 , 10,17 , 37,5 , 8,10 , 33967,48 , 34015,117 , 158,27 , 33967,48 , 34015,117 , 158,27 , 18807,28 , 18835,60 , 18895,14 , 18807,28 , 18835,60 , 18895,14 , 684,9 , 688,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 198,3 , 16552,25 , 0,4 , 4,0 , 5339,9 , 5348,9 , 0, 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 , 406,8 , 98,16 , 37,5 , 8,10 , 30134,46 , 30180,88 , 30268,24 , 30134,46 , 30180,88 , 30268,24 , 16839,28 , 16867,54 , 16624,14 , 16839,28 , 16867,54 , 16624,14 , 637,8 , 633,10 , 45,4 , 5,17 , 22,23 , {88,79,70}, 210,3 , 16152,23 , 0,4 , 4,0 , 5357,13 , 5224,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 , 120,10 , 10,17 , 18,7 , 25,12 , 34132,50 , 34132,50 , 158,27 , 34132,50 , 34132,50 , 158,27 , 18909,30 , 18909,30 , 85,14 , 18909,30 , 18909,30 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 16577,15 , 4,4 , 4,0 , 5370,2 , 5372,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 , 120,10 , 10,17 , 18,7 , 25,12 , 34182,81 , 34182,81 , 158,27 , 34182,81 , 34182,81 , 158,27 , 18939,48 , 18939,48 , 85,14 , 18939,48 , 18939,48 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 16592,20 , 4,4 , 4,0 , 5376,3 , 5379,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 , 251,9 , 251,9 , 53,10 , 532,18 , 37,5 , 8,10 , 34263,48 , 34311,99 , 34410,24 , 34263,48 , 34311,99 , 34410,24 , 18987,28 , 19015,53 , 19068,14 , 18987,28 , 19015,53 , 19068,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 0,0 , 0,7 , 79,6 , 4,0 , 5387,6 , 5393,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 , 406,8 , 98,16 , 37,5 , 8,10 , 34434,51 , 34485,191 , 158,27 , 34434,51 , 34485,191 , 158,27 , 19082,21 , 19103,71 , 19174,14 , 19082,21 , 19103,71 , 19174,14 , 693,8 , 697,8 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5399,6 , 5405,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 , 575,7 , 575,7 , 278,6 , 363,22 , 37,5 , 8,10 , 34676,48 , 34724,85 , 34809,24 , 34833,48 , 34881,117 , 34809,24 , 19188,28 , 19216,54 , 3338,14 , 19188,28 , 19216,54 , 3338,14 , 701,12 , 705,11 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3057,20 , 13,5 , 4,0 , 5412,9 , 2354,6 , 2, 1, 1, 6, 7 }, // Asturian/Latin/Spain
+ { 257, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 795,11 , 795,11 , 806,16 , 822,9 , 53,10 , 1353,18 , 37,5 , 8,10 , 34998,174 , 34998,174 , 158,27 , 34998,174 , 34998,174 , 158,27 , 19270,60 , 19270,60 , 19330,25 , 19270,60 , 19270,60 , 19330,25 , 713,8 , 716,13 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16612,12 , 8,5 , 4,0 , 5421,5 , 5426,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 , 1566,10 , 633,17 , 37,5 , 8,10 , 35172,102 , 35172,102 , 158,27 , 35172,102 , 35172,102 , 158,27 , 19355,54 , 19355,54 , 19409,21 , 19355,54 , 19355,54 , 19409,21 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16624,16 , 79,6 , 4,0 , 5433,4 , 5437,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 , 1353,18 , 37,5 , 8,10 , 35274,137 , 35411,142 , 35553,36 , 35274,137 , 35411,142 , 35553,36 , 19430,49 , 19430,49 , 19479,21 , 19430,49 , 19430,49 , 19479,21 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16640,12 , 8,5 , 4,0 , 5444,5 , 5449,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 , 1576,32 , 37,5 , 8,10 , 35589,165 , 35589,165 , 158,27 , 35589,165 , 35589,165 , 158,27 , 19500,111 , 19500,111 , 85,14 , 19500,111 , 19500,111 , 85,14 , 721,9 , 729,8 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16652,16 , 8,5 , 4,0 , 5456,16 , 5472,7 , 0, 0, 1, 6, 7 }, // Ngiemboon/Latin/Cameroon
+ { 272, 46, 18, 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 , {66,68,84}, 130,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 5, 6, 7 }, // Chakma/Chakma/Bangladesh
+ { 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}, 127,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}, 340,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // TaiDam/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 , 516,6 , 35,18 , 18,7 , 25,12 , 35754,180 , 35754,180 , 158,27 , 35754,180 , 35754,180 , 158,27 , 19611,87 , 19611,87 , 85,14 , 19611,87 , 19611,87 , 19698,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 79,6 , 4,0 , 5479,12 , 5491,22 , 2, 1, 7, 6, 7 }, // Lakota/Latin/UnitedStates
+ { 314, 9, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 406,8 , 98,16 , 37,5 , 8,10 , 26318,48 , 26366,81 , 26447,24 , 26318,48 , 26366,81 , 26447,24 , 14103,30 , 19712,48 , 85,14 , 14103,30 , 19712,48 , 85,14 , 474,6 , 452,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 15621,21 , 0,4 , 4,0 , 5513,8 , 4698,6 , 2, 1, 6, 5, 6 }, // 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 , 35934,105 , 35934,105 , 36039,24 , 35934,105 , 35934,105 , 36039,24 , 19760,58 , 19760,58 , 19818,14 , 19760,58 , 19760,58 , 19818,14 , 730,3 , 737,3 , 45,4 , 5,17 , 22,23 , {73,81,68}, 0,0 , 16668,20 , 13,5 , 4,0 , 5521,14 , 5535,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 , 35934,105 , 35934,105 , 36039,24 , 35934,105 , 35934,105 , 36039,24 , 19760,58 , 19760,58 , 19818,14 , 19760,58 , 19760,58 , 19818,14 , 730,3 , 737,3 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 16688,19 , 13,5 , 4,0 , 5521,14 , 5540,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 , 176,7 , 176,7 , 114,6 , 532,18 , 55,4 , 59,9 , 36063,48 , 36111,85 , 16212,24 , 36196,60 , 36256,93 , 16212,24 , 19832,28 , 19860,53 , 19913,14 , 19832,28 , 19860,53 , 19913,14 , 733,9 , 740,10 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16707,27 , 13,5 , 4,0 , 5545,14 , 5559,6 , 2, 1, 1, 6, 7 }, // LowerSorbian/Latin/Germany
+ { 318, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 176,7 , 176,7 , 114,6 , 532,18 , 493,12 , 59,9 , 36349,48 , 36397,86 , 16212,24 , 36483,60 , 36543,93 , 16212,24 , 19927,28 , 19955,53 , 20008,14 , 19927,28 , 19955,53 , 20008,14 , 733,9 , 750,9 , 970,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16734,29 , 13,5 , 4,0 , 5565,15 , 5580,6 , 2, 1, 1, 6, 7 }, // UpperSorbian/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}, 245,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}, 221,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Nko/Nko/Guinea
+ { 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}, 311,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}, 196,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 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}, 196,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 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 , 550,8 , 1608,18 , 222,4 , 226,9 , 36636,77 , 36713,140 , 36853,25 , 36636,77 , 36713,140 , 36853,25 , 20022,28 , 20050,70 , 85,14 , 20022,28 , 20120,73 , 20193,14 , 742,3 , 759,3 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16763,11 , 13,5 , 4,0 , 5586,11 , 5597,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}, 344,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 , 14012,70 , 14012,70 , 158,27 , 14012,70 , 14012,70 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 605,4 , 609,39 , 22,23 , {73,82,82}, 346,3 , 16774,27 , 8,5 , 4,0 , 5602,7 , 3091,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 , 36878,77 , 36878,77 , 158,27 , 36878,77 , 36878,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 , 5609,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 , 36878,77 , 36878,77 , 158,27 , 36878,77 , 36878,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}, 0,0 , 0,7 , 8,5 , 4,0 , 5609,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, 161,5 , 161,5 , 831,5 , 831,5 , 385,8 , 414,14 , 170,6 , 187,13 , 4697,39 , 4697,39 , 158,27 , 4697,39 , 4697,39 , 158,27 , 2055,21 , 2013,28 , 2041,14 , 2055,21 , 2013,28 , 2041,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {72,75,68}, 140,3 , 16801,11 , 4,4 , 4,0 , 5620,2 , 5622,14 , 2, 1, 7, 6, 7 }, // Cantonese/Traditional Han/HongKong
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 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[] = {
@@ -1814,45 +1819,44 @@ static const ushort list_pattern_part_data[] = {
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, 0x76, 0x259, 0x20, 0x25, 0x32,
-0x25, 0x31, 0x20, 0x65, 0x74, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x98f, 0x9ac, 0x982, 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, 0x104a, 0x20, 0x25, 0x32, 0x25, 0x31, 0x104a, 0x20, 0x1014, 0x103e, 0x1004, 0x1037, 0x103a, 0x25,
-0x32, 0x25, 0x31, 0x1014, 0x103e, 0x1004, 0x1037, 0x103a, 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, 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, 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, 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, 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, 0x20, 0x930, 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, 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, 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, 0xc2e, 0xc30, 0xc3f, 0xc2f, 0xc41, 0x20, 0x25, 0x32, 0x25,
-0x31, 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, 0x6e, 0x65, 0x2d, 0x25, 0x32, 0x49, 0x2d, 0x25, 0x31, 0x20, 0x6e, 0x65,
-0x2d, 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, 0x20, 0x438, 0x486, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x28, 0x6e, 0x29, 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, 0x540c, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x6e, 0x65, 0x2d, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6e, 0x65, 0x2d, 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,
+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, 0x540c, 0x25, 0x32
};
static const ushort date_format_data[] = {
@@ -1865,108 +1869,108 @@ static const ushort date_format_data[] = {
0x64, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x1363, 0x64, 0x20, 0x4d, 0x4d,
0x4d, 0x4d, 0x20, 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, 0x60c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2e, 0x4d, 0x4d,
-0x2e, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 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, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20,
-0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2f, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x28, 0x27,
-0x65, 0x27, 0x29, 0x27, 0x6b, 0x6f, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 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, 0x64, 0x64,
-0x64, 0x64, 0x104a, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 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, 0x4d, 0x4d, 0x2e, 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, 0x64, 0x64, 0x64, 0x20, 0x64, 0x2e, 0x20, 0x4d,
-0x4d, 0x4d, 0x4d, 0x20, 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, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x4d, 0x2f,
-0x64, 0x2f, 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, 0x79, 0x79, 0x2d, 0x4d, 0x4d, 0x2d, 0x64, 0x64, 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, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 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, 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, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x436, 0x27, 0x2e, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d,
-0x4d, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 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, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64,
-0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2d, 0x27, 0x436, 0x27, 0x2e, 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, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x79,
-0x79, 0x79, 0x79, 0x20, 0x27, 0x43e, 0x43d, 0x44b, 0x27, 0x20, 0x4d, 0x4d, 0x20, 0x27, 0x441, 0x430, 0x440, 0x44b, 0x43d, 0x27,
-0x20, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2d, 0x4d, 0x2d, 0x79, 0x79, 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, 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, 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, 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, 0x64, 0x2d, 0x4d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 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, 0x64,
-0x64, 0x64, 0x1361, 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, 0x64, 0x64, 0x64, 0x64, 0x60c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x60c, 0x20,
-0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79,
-0x79, 0x20, 0x27, 0x440, 0x27, 0x2e, 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, 0x64,
-0x64, 0x64, 0x64, 0x2c, 0x20, 0x27, 0x6e, 0x67, 0xe0, 0x79, 0x27, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20,
-0x27, 0x6e, 0x103, 0x6d, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x2e, 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, 0x64, 0x20, 0x27, 0x64, 0x69,
-0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x69, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x20, 0x4d,
-0x2e, 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, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x4d, 0x4d, 0x2e, 0x64, 0x64, 0x64,
-0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x43b, 0x27, 0x2e, 0x20, 0x79, 0x79, 0x79,
-0x79, 0x2e, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2f, 0x4d, 0x2f, 0x64, 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
+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, 0x20, 0x64, 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, 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, 0x64, 0x64, 0x20, 0x27, 0x64, 0x65, 0x6e, 0x27, 0x20, 0x64, 0x2e, 0x20,
+0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x4d, 0x2f, 0x64, 0x2f,
+0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2f, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 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, 0x79, 0x79,
+0x2d, 0x4d, 0x4d, 0x2d, 0x64, 0x64, 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, 0x64,
+0x20, 0x4d, 0x4d, 0x4d, 0x4d, 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,
+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, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x43e, 0x43d, 0x44b, 0x27, 0x20, 0x4d,
+0x4d, 0x20, 0x27, 0x441, 0x430, 0x440, 0x44b, 0x43d, 0x27, 0x20, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x79,
+0x79, 0x64, 0x2d, 0x4d, 0x2d, 0x79, 0x79, 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, 0x64, 0x2d,
+0x4d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 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, 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, 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, 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, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x4d,
+0x4d, 0x2e, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x43b, 0x27,
+0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 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, 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, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x2e,
-0x6d, 0x6d, 0x2e, 0x20, 0x41, 0x50, 0x68, 0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x41, 0x50, 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,
-0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x48, 0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 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, 0x68, 0x2e, 0x6d, 0x6d, 0x20, 0x41, 0x50, 0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x2e, 0x6d, 0x6d, 0x2e,
-0x73, 0x73, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x6d, 0x2e, 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, 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, 0x27, 0x6b, 0x6c, 0x27, 0x2e, 0x20, 0x48, 0x48,
-0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74, 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, 0x74, 0x20, 0x68,
-0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x48, 0x3a, 0x6d, 0x6d, 0x20, 0x27, 0x68, 0x6f, 0x64, 0x17a, 0x27,
-0x2e
+0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x68, 0x2e, 0x6d, 0x6d, 0x2e, 0x20, 0x41, 0x50, 0x68, 0x2e, 0x6d, 0x6d,
+0x2e, 0x73, 0x73, 0x20, 0x41, 0x50, 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, 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, 0x68, 0x2e, 0x6d, 0x6d, 0x20,
+0x41, 0x50, 0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x2e, 0x6d, 0x6d, 0x2e, 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, 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, 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[] = {
@@ -1987,202 +1991,219 @@ static const ushort months_data[] = {
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, 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, 0x4a, 0x61, 0x6e, 0x3b, 0x53, 0x68, 0x6b, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x50, 0x72, 0x69, 0x3b, 0x4d,
-0x61, 0x6a, 0x3b, 0x51, 0x65, 0x72, 0x3b, 0x4b, 0x6f, 0x72, 0x3b, 0x47, 0x73, 0x68, 0x3b, 0x53, 0x68, 0x74, 0x3b, 0x54,
-0x65, 0x74, 0x3b, 0x4e, 0xeb, 0x6e, 0x3b, 0x44, 0x68, 0x6a, 0x3b, 0x4a, 0x61, 0x6e, 0x61, 0x72, 0x3b, 0x53, 0x68, 0x6b,
-0x75, 0x72, 0x74, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x50, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x4d, 0x61, 0x6a, 0x3b, 0x51,
-0x65, 0x72, 0x73, 0x68, 0x6f, 0x72, 0x3b, 0x4b, 0x6f, 0x72, 0x72, 0x69, 0x6b, 0x3b, 0x47, 0x75, 0x73, 0x68, 0x74, 0x3b,
-0x53, 0x68, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x3b, 0x54, 0x65, 0x74, 0x6f, 0x72, 0x3b, 0x4e, 0xeb, 0x6e, 0x74, 0x6f, 0x72,
-0x3b, 0x44, 0x68, 0x6a, 0x65, 0x74, 0x6f, 0x72, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x51,
-0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4e, 0x3b, 0x44, 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, 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,
+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, 0x4a, 0x61, 0x6e, 0x3b, 0x53, 0x68, 0x6b, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x50,
+0x72, 0x69, 0x3b, 0x4d, 0x61, 0x6a, 0x3b, 0x51, 0x65, 0x72, 0x3b, 0x4b, 0x6f, 0x72, 0x3b, 0x47, 0x73, 0x68, 0x3b, 0x53,
+0x68, 0x74, 0x3b, 0x54, 0x65, 0x74, 0x3b, 0x4e, 0xeb, 0x6e, 0x3b, 0x44, 0x68, 0x6a, 0x3b, 0x4a, 0x61, 0x6e, 0x61, 0x72,
+0x3b, 0x53, 0x68, 0x6b, 0x75, 0x72, 0x74, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x50, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x4d,
+0x61, 0x6a, 0x3b, 0x51, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x72, 0x3b, 0x4b, 0x6f, 0x72, 0x72, 0x69, 0x6b, 0x3b, 0x47, 0x75,
+0x73, 0x68, 0x74, 0x3b, 0x53, 0x68, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x3b, 0x54, 0x65, 0x74, 0x6f, 0x72, 0x3b, 0x4e, 0xeb,
+0x6e, 0x74, 0x6f, 0x72, 0x3b, 0x44, 0x68, 0x6a, 0x65, 0x74, 0x6f, 0x72, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x50,
+0x3b, 0x4d, 0x3b, 0x51, 0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4e, 0x3b, 0x44, 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, 0x3b, 0x67, 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, 0x3b, 0x6d, 0x3b, 0x70, 0x3b, 0x6d, 0x3b, 0x71, 0x3b, 0x6b, 0x3b, 0x67, 0x3b, 0x73,
+0x3b, 0x74, 0x3b, 0x6e, 0x3b, 0x64, 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, 0x6cc, 0x646, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x62a,
+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, 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, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1,
-0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x3b, 0x9b8, 0x9c7, 0x9aa, 0x9cd, 0x99f, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x3b, 0x9a8,
-0x9ad, 0x9c7, 0x3b, 0x9a1, 0x9bf, 0x9b8, 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, 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, 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, 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, 0x55, 0x72, 0x74, 0x2e, 0x3b,
-0x4f, 0x74, 0x73, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x41, 0x70, 0x69, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x2e, 0x3b,
-0x45, 0x6b, 0x61, 0x2e, 0x3b, 0x55, 0x7a, 0x74, 0x2e, 0x3b, 0x41, 0x62, 0x75, 0x2e, 0x3b, 0x49, 0x72, 0x61, 0x2e, 0x3b,
-0x55, 0x72, 0x72, 0x2e, 0x3b, 0x41, 0x7a, 0x61, 0x2e, 0x3b, 0x41, 0x62, 0x65, 0x2e, 0x3b, 0x55, 0x72, 0x74, 0x61, 0x72,
-0x72, 0x69, 0x6c, 0x61, 0x3b, 0x4f, 0x74, 0x73, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x78, 0x6f, 0x61,
-0x3b, 0x41, 0x70, 0x69, 0x72, 0x69, 0x6c, 0x61, 0x3b, 0x4d, 0x61, 0x69, 0x61, 0x74, 0x7a, 0x61, 0x3b, 0x45, 0x6b, 0x61,
-0x69, 0x6e, 0x61, 0x3b, 0x55, 0x7a, 0x74, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x41, 0x62, 0x75, 0x7a, 0x74, 0x75, 0x61, 0x3b,
-0x49, 0x72, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x55, 0x72, 0x72, 0x69, 0x61, 0x3b, 0x41, 0x7a, 0x61, 0x72, 0x6f, 0x61, 0x3b,
-0x41, 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, 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, 0x6b, 0x3b, 0x6f, 0x74, 0x73, 0x61, 0x69, 0x6c, 0x61, 0x6b, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x78, 0x6f, 0x61, 0x6b,
-0x3b, 0x61, 0x70, 0x69, 0x72, 0x69, 0x6c, 0x61, 0x6b, 0x3b, 0x6d, 0x61, 0x69, 0x61, 0x74, 0x7a, 0x61, 0x6b, 0x3b, 0x65,
-0x6b, 0x61, 0x69, 0x6e, 0x61, 0x6b, 0x3b, 0x75, 0x7a, 0x74, 0x61, 0x69, 0x6c, 0x61, 0x6b, 0x3b, 0x61, 0x62, 0x75, 0x7a,
-0x74, 0x75, 0x61, 0x6b, 0x3b, 0x69, 0x72, 0x61, 0x69, 0x6c, 0x61, 0x6b, 0x3b, 0x75, 0x72, 0x72, 0x69, 0x61, 0x6b, 0x3b,
-0x61, 0x7a, 0x61, 0x72, 0x6f, 0x61, 0x6b, 0x3b, 0x61, 0x62, 0x65, 0x6e, 0x64, 0x75, 0x61, 0x6b, 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,
-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, 0x65, 0x72, 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, 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, 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, 0x1015, 0x103c, 0x102e, 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, 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, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x20, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72,
+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, 0x6cc, 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,
+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, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be, 0x987, 0x3b,
+0x986, 0x997, 0x3b, 0x9b8, 0x9c7, 0x9aa, 0x9cd, 0x99f, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x3b, 0x9a8, 0x9ad, 0x9c7, 0x3b, 0x9a1,
+0x9bf, 0x9b8, 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, 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, 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, 0x4f, 0x74, 0x73, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x78, 0x6f,
+0x61, 0x3b, 0x41, 0x70, 0x69, 0x72, 0x69, 0x6c, 0x61, 0x3b, 0x4d, 0x61, 0x69, 0x61, 0x74, 0x7a, 0x61, 0x3b, 0x45, 0x6b,
+0x61, 0x69, 0x6e, 0x61, 0x3b, 0x55, 0x7a, 0x74, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x41, 0x62, 0x75, 0x7a, 0x74, 0x75, 0x61,
+0x3b, 0x49, 0x72, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x55, 0x72, 0x72, 0x69, 0x61, 0x3b, 0x41, 0x7a, 0x61, 0x72, 0x6f, 0x61,
+0x3b, 0x41, 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, 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, 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, 0x65, 0x72, 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, 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, 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,
@@ -2216,392 +2237,387 @@ static const ushort months_data[] = {
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, 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, 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, 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, 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, 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, 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, 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, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x72, 0x74, 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, 0x6e, 0x65, 0x77, 0x61,
-0x72, 0x69, 0x73, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x77, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x6d, 0x61, 0x61, 0x72, 0x74,
-0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x61, 0x69, 0x65, 0x3b, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x6a, 0x75,
-0x6c, 0x79, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x62, 0x65,
-0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x69, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64,
-0x65, 0x73, 0x69, 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, 0x61, 0x69, 0x2e, 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, 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, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61,
-0x69, 0x3b, 0x58, 0x75, 0xf1, 0x3b, 0x58, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x75,
-0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x63, 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, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x69,
-0x3b, 0x78, 0x75, 0xf1, 0x3b, 0x78, 0x75, 0x6c, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x3b, 0x6f, 0x75, 0x74,
-0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 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, 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,
-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, 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,
+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, 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, 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, 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, 0x74, 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, 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, 0x47,
-0x65, 0x6e, 0x6e, 0x61, 0x69, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x62, 0x72, 0x61, 0x69, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x7a,
-0x6f, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x65, 0x3b, 0x4d, 0x61, 0x67, 0x67, 0x69, 0x6f, 0x3b, 0x47, 0x69, 0x75, 0x67,
-0x6e, 0x6f, 0x3b, 0x4c, 0x75, 0x67, 0x6c, 0x69, 0x6f, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74,
-0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x4f, 0x74, 0x74, 0x6f, 0x62, 0x72, 0x65, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d,
-0x62, 0x72, 0x65, 0x3b, 0x44, 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, 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, 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, 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, 0x49a, 0x430, 0x4a3, 0x2e, 0x3b, 0x410, 0x49b, 0x43f, 0x2e, 0x3b, 0x41d, 0x430,
-0x443, 0x2e, 0x3b, 0x421, 0x4d9, 0x443, 0x2e, 0x3b, 0x41c, 0x430, 0x43c, 0x2e, 0x3b, 0x41c, 0x430, 0x443, 0x2e, 0x3b, 0x428, 0x456,
-0x43b, 0x2e, 0x3b, 0x422, 0x430, 0x43c, 0x2e, 0x3b, 0x49a, 0x44b, 0x440, 0x2e, 0x3b, 0x49a, 0x430, 0x437, 0x2e, 0x3b, 0x49a, 0x430,
-0x440, 0x2e, 0x3b, 0x416, 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, 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, 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, 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, 0x4a, 0x61, 0x6e, 0x76, 0x2e, 0x3b, 0x46, 0x65, 0x62,
-0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x73, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x6a, 0x73, 0x3b,
-0x4a, 0x16b, 0x6e, 0x2e, 0x3b, 0x4a, 0x16b, 0x6c, 0x2e, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x2e,
-0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x63, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x76,
-0x101, 0x72, 0x69, 0x73, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x101, 0x72, 0x69, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x73,
-0x3b, 0x41, 0x70, 0x72, 0x12b, 0x6c, 0x69, 0x73, 0x3b, 0x4d, 0x61, 0x69, 0x6a, 0x73, 0x3b, 0x4a, 0x16b, 0x6e, 0x69, 0x6a,
-0x73, 0x3b, 0x4a, 0x16b, 0x6c, 0x69, 0x6a, 0x73, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x73, 0x3b, 0x53, 0x65, 0x70,
-0x74, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x4e, 0x6f, 0x76,
-0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 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, 0x3b, 0xd1c, 0xd42, 0x3b, 0xd13,
-0x3b, 0xd38, 0xd46, 0x3b, 0xd12, 0x3b, 0xd28, 0x3b, 0xd21, 0xd3f, 0x3b, 0xd1c, 0x3b, 0xd2b, 0x3b, 0xd2e, 0xd3e, 0x3b, 0xd0f, 0x3b,
-0xd2e, 0xd46, 0x3b, 0xd1c, 0xd42, 0x3b, 0xd1c, 0xd42, 0x3b, 0xd13, 0x3b, 0xd38, 0x3b, 0xd12, 0x3b, 0xd28, 0x3b, 0xd21, 0xd3f, 0x3b,
+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, 0x74, 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, 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, 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, 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, 0x49a, 0x430, 0x4a3, 0x2e, 0x3b, 0x410, 0x49b, 0x43f, 0x2e,
+0x3b, 0x41d, 0x430, 0x443, 0x2e, 0x3b, 0x421, 0x4d9, 0x443, 0x2e, 0x3b, 0x41c, 0x430, 0x43c, 0x2e, 0x3b, 0x41c, 0x430, 0x443, 0x2e,
+0x3b, 0x428, 0x456, 0x43b, 0x2e, 0x3b, 0x422, 0x430, 0x43c, 0x2e, 0x3b, 0x49a, 0x44b, 0x440, 0x2e, 0x3b, 0x49a, 0x430, 0x437, 0x2e,
+0x3b, 0x49a, 0x430, 0x440, 0x2e, 0x3b, 0x416, 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, 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, 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, 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, 0xd1c, 0x3b, 0xd2b, 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,
@@ -2656,7 +2672,7 @@ static const ushort months_data[] = {
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, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x6cc,
+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, 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,
@@ -2667,105 +2683,112 @@ static const ushort months_data[] = {
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, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x627, 0x3b, 0x645, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x627, 0x3b,
-0x646, 0x3b, 0x62f, 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,
+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, 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, 0x73, 0x74, 0x79, 0x3b, 0x6c, 0x75,
+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, 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, 0x73,
-0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x63, 0x3b, 0x6c, 0x3b, 0x73, 0x3b, 0x77, 0x3b, 0x70, 0x3b, 0x6c,
-0x3b, 0x67, 0x3b, 0x73, 0x74, 0x79, 0x63, 0x7a, 0x6e, 0x69, 0x61, 0x3b, 0x6c, 0x75, 0x74, 0x65, 0x67, 0x6f, 0x3b, 0x6d,
+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, 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, 0x51, 0x75, 0x6c, 0x3b, 0x48, 0x61, 0x74, 0x3b,
-0x50, 0x61, 0x75, 0x3b, 0x41, 0x79, 0x72, 0x3b, 0x41, 0x79, 0x6d, 0x3b, 0x49, 0x6e, 0x74, 0x3b, 0x41, 0x6e, 0x74, 0x3b,
-0x51, 0x68, 0x61, 0x3b, 0x55, 0x6d, 0x61, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x41, 0x79, 0x61, 0x3b, 0x4b, 0x61, 0x70, 0x3b,
-0x51, 0x75, 0x6c, 0x6c, 0x61, 0x20, 0x70, 0x75, 0x71, 0x75, 0x79, 0x3b, 0x48, 0x61, 0x74, 0x75, 0x6e, 0x20, 0x70, 0x75,
-0x71, 0x75, 0x79, 0x3b, 0x50, 0x61, 0x75, 0x71, 0x61, 0x72, 0x20, 0x77, 0x61, 0x72, 0x61, 0x79, 0x3b, 0x41, 0x79, 0x72,
-0x69, 0x77, 0x61, 0x3b, 0x41, 0x79, 0x6d, 0x75, 0x72, 0x61, 0x79, 0x3b, 0x49, 0x6e, 0x74, 0x69, 0x20, 0x72, 0x61, 0x79,
-0x6d, 0x69, 0x3b, 0x41, 0x6e, 0x74, 0x61, 0x20, 0x53, 0x69, 0x74, 0x77, 0x61, 0x3b, 0x51, 0x68, 0x61, 0x70, 0x61, 0x71,
-0x20, 0x53, 0x69, 0x74, 0x77, 0x61, 0x3b, 0x55, 0x6d, 0x61, 0x20, 0x72, 0x61, 0x79, 0x6d, 0x69, 0x3b, 0x4b, 0x61, 0x6e,
-0x74, 0x61, 0x72, 0x61, 0x79, 0x3b, 0x41, 0x79, 0x61, 0x6d, 0x61, 0x72, 0x71, 0x2bc, 0x61, 0x3b, 0x4b, 0x61, 0x70, 0x61,
-0x71, 0x20, 0x52, 0x61, 0x79, 0x6d, 0x69, 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, 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, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x6a, 0x3b, 0x61, 0x3b, 0x73, 0x3b, 0x6f, 0x3b,
-0x6e, 0x3b, 0x64, 0x3b, 0x42f, 0x43d, 0x432, 0x2e, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x2e,
+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, 0x51, 0x75, 0x6c, 0x3b,
+0x48, 0x61, 0x74, 0x3b, 0x50, 0x61, 0x75, 0x3b, 0x41, 0x79, 0x72, 0x3b, 0x41, 0x79, 0x6d, 0x3b, 0x49, 0x6e, 0x74, 0x3b,
+0x41, 0x6e, 0x74, 0x3b, 0x51, 0x68, 0x61, 0x3b, 0x55, 0x6d, 0x61, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x41, 0x79, 0x61, 0x3b,
+0x4b, 0x61, 0x70, 0x3b, 0x51, 0x75, 0x6c, 0x6c, 0x61, 0x20, 0x70, 0x75, 0x71, 0x75, 0x79, 0x3b, 0x48, 0x61, 0x74, 0x75,
+0x6e, 0x20, 0x70, 0x75, 0x71, 0x75, 0x79, 0x3b, 0x50, 0x61, 0x75, 0x71, 0x61, 0x72, 0x20, 0x77, 0x61, 0x72, 0x61, 0x79,
+0x3b, 0x41, 0x79, 0x72, 0x69, 0x77, 0x61, 0x3b, 0x41, 0x79, 0x6d, 0x75, 0x72, 0x61, 0x79, 0x3b, 0x49, 0x6e, 0x74, 0x69,
+0x20, 0x72, 0x61, 0x79, 0x6d, 0x69, 0x3b, 0x41, 0x6e, 0x74, 0x61, 0x20, 0x53, 0x69, 0x74, 0x77, 0x61, 0x3b, 0x51, 0x68,
+0x61, 0x70, 0x61, 0x71, 0x20, 0x53, 0x69, 0x74, 0x77, 0x61, 0x3b, 0x55, 0x6d, 0x61, 0x20, 0x72, 0x61, 0x79, 0x6d, 0x69,
+0x3b, 0x4b, 0x61, 0x6e, 0x74, 0x61, 0x72, 0x61, 0x79, 0x3b, 0x41, 0x79, 0x61, 0x6d, 0x61, 0x72, 0x71, 0x2bc, 0x61, 0x3b,
+0x4b, 0x61, 0x70, 0x61, 0x71, 0x20, 0x52, 0x61, 0x79, 0x6d, 0x69, 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, 0x458, 0x430, 0x43d, 0x2e, 0x3b,
+0x444, 0x435, 0x431, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458,
+0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x2e, 0x3b, 0x43e, 0x43a,
+0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x432, 0x2e, 0x3b, 0x434, 0x435, 0x446, 0x2e, 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, 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, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b,
+0x6d, 0x3b, 0x6a, 0x3b, 0x6a, 0x3b, 0x61, 0x3b, 0x73, 0x3b, 0x6f, 0x3b, 0x6e, 0x3b, 0x64, 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, 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,
@@ -2781,239 +2804,224 @@ static const ushort months_data[] = {
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, 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, 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,
+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, 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, 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, 0x75, 0x61, 0x72, 0x3b,
+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, 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, 0x4b, 0x6f,
-0x62, 0x3b, 0x4c, 0x61, 0x62, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x41, 0x66, 0x72, 0x3b, 0x53, 0x68, 0x61, 0x3b, 0x4c, 0x69,
-0x78, 0x3b, 0x54, 0x6f, 0x64, 0x3b, 0x53, 0x69, 0x64, 0x3b, 0x53, 0x61, 0x67, 0x3b, 0x54, 0x6f, 0x62, 0x3b, 0x4b, 0x49,
-0x54, 0x3b, 0x4c, 0x49, 0x54, 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, 0x4b, 0x3b, 0x4c, 0x3b, 0x53,
-0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4c, 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, 0x65, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61,
-0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x6a, 0x3b, 0x61, 0x3b, 0x73, 0x3b, 0x6f, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x65, 0x6e, 0x65,
-0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x6a, 0x75, 0x6e,
-0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x63, 0x74, 0x3b, 0x6e, 0x6f, 0x76,
-0x3b, 0x64, 0x69, 0x63, 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, 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, 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, 0x6b, 0x3b, 0x70, 0x3b, 0x74, 0x3b, 0x69,
-0x3b, 0x74, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x74, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x6b, 0x77,
-0x3b, 0x6d, 0x70, 0x69, 0x3b, 0x6d, 0x74, 0x75, 0x3b, 0x6d, 0x69, 0x6e, 0x3b, 0x6d, 0x74, 0x6e, 0x3b, 0x6d, 0x73, 0x74,
-0x3b, 0x6d, 0x73, 0x62, 0x3b, 0x6d, 0x75, 0x6e, 0x3b, 0x6d, 0x74, 0x73, 0x3b, 0x6d, 0x6b, 0x75, 0x3b, 0x6d, 0x6b, 0x6d,
-0x3b, 0x6d, 0x6b, 0x62, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x6b, 0x77, 0x61, 0x6e, 0x6a, 0x61,
-0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x70, 0x69, 0x6c, 0x69, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69,
-0x20, 0x79, 0x61, 0x20, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x69, 0x6e,
-0x65, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x6d, 0x77, 0x65, 0x7a,
-0x69, 0x20, 0x79, 0x61, 0x20, 0x73, 0x69, 0x74, 0x61, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x73,
-0x61, 0x62, 0x61, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x6d, 0x75, 0x6e, 0x61, 0x6e, 0x65, 0x3b,
-0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x74, 0x69, 0x73, 0x61, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20,
-0x79, 0x61, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x6b, 0x75, 0x6d,
-0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x79, 0x61, 0x3b, 0x6d, 0x77, 0x65, 0x7a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x6b,
-0x75, 0x6d, 0x69, 0x20, 0x79, 0x61, 0x20, 0x6d, 0x62, 0x69, 0x6c, 0x69, 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, 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, 0xbc1, 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, 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, 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, 0xc38, 0xc4d, 0xc1f, 0xc41,
-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, 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, 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, 0x1303, 0x1295, 0x12e9, 0x3b, 0x134c, 0x1265, 0x1229, 0x3b, 0x121b,
-0x122d, 0x127d, 0x3b, 0x12a4, 0x1355, 0x1228, 0x3b, 0x121c, 0x12ed, 0x3b, 0x1301, 0x1295, 0x3b, 0x1301, 0x120b, 0x12ed, 0x3b, 0x12a6, 0x1308, 0x1235,
-0x3b, 0x1234, 0x1355, 0x1274, 0x3b, 0x12a6, 0x12ad, 0x1270, 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, 0x1228, 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, 0x1270, 0x12cd, 0x1260, 0x122d, 0x3b, 0x1296, 0x126c, 0x121d, 0x1260, 0x122d, 0x3b, 0x12f2, 0x1234, 0x121d, 0x1260, 0x122d, 0x3b, 0x1325,
-0x122a, 0x3b, 0x1208, 0x12ab, 0x1272, 0x3b, 0x1218, 0x130b, 0x1262, 0x3b, 0x121a, 0x12eb, 0x12dd, 0x3b, 0x130d, 0x1295, 0x1266, 0x3b, 0x1230, 0x1290,
-0x3b, 0x1213, 0x121d, 0x1208, 0x3b, 0x1290, 0x1213, 0x1230, 0x3b, 0x1218, 0x1235, 0x12a8, 0x3b, 0x1325, 0x1245, 0x121d, 0x3b, 0x1215, 0x12f3, 0x122d,
-0x3b, 0x1273, 0x1215, 0x1233, 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, 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, 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, 0xdd, 0x3b, 0x46, 0x3b,
-0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 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, 0x421, 0x456, 0x447, 0x3b, 0x41b, 0x44e, 0x442, 0x3b, 0x411, 0x435, 0x440, 0x3b, 0x41a, 0x432, 0x456, 0x3b,
-0x422, 0x440, 0x430, 0x3b, 0x427, 0x435, 0x440, 0x3b, 0x41b, 0x438, 0x43f, 0x3b, 0x421, 0x435, 0x440, 0x3b, 0x412, 0x435, 0x440, 0x3b,
-0x416, 0x43e, 0x432, 0x3b, 0x41b, 0x438, 0x441, 0x3b, 0x413, 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, 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, 0x76, 0x3b, 0x46, 0x65,
-0x76, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x49, 0x79, 0x75, 0x6e, 0x3b, 0x49,
-0x79, 0x75, 0x6c, 0x3b, 0x41, 0x76, 0x67, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x79, 0x61,
-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, 0x53, 0x65,
-0x6e, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x4f, 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, 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,
+0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4b,
+0x6f, 0x62, 0x3b, 0x4c, 0x61, 0x62, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x41, 0x66, 0x72, 0x3b, 0x53, 0x68, 0x61, 0x3b, 0x4c,
+0x69, 0x78, 0x3b, 0x54, 0x6f, 0x64, 0x3b, 0x53, 0x69, 0x64, 0x3b, 0x53, 0x61, 0x67, 0x3b, 0x54, 0x6f, 0x62, 0x3b, 0x4b,
+0x49, 0x54, 0x3b, 0x4c, 0x49, 0x54, 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, 0x4b, 0x3b, 0x4c, 0x3b,
+0x53, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4c, 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, 0x65, 0x3b, 0x66, 0x3b, 0x6d, 0x3b,
+0x61, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x6a, 0x3b, 0x61, 0x3b, 0x73, 0x3b, 0x6f, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x65, 0x6e,
+0x65, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x6a, 0x75,
+0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x63, 0x74, 0x3b, 0x6e, 0x6f,
+0x76, 0x3b, 0x64, 0x69, 0x63, 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, 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, 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, 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, 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, 0xc38, 0xc4d, 0xc1f, 0xc41, 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, 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, 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, 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, 0xdd, 0x3b, 0x46,
+0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44,
+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, 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, 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,
@@ -3069,699 +3077,707 @@ static const ushort months_data[] = {
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, 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, 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, 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, 0x948, 0x3b, 0x913, 0x917, 0x938, 0x94d, 0x91f, 0x3b, 0x938, 0x947, 0x92a, 0x94d,
-0x91f, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x913, 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, 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, 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, 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, 0x61, 0x6a,
-0x61, 0x67, 0x65, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x76, 0x61, 0x3b, 0x6e, 0x6a, 0x75, 0x6b, 0x10d, 0x61, 0x3b, 0x63, 0x75,
-0x6f, 0x14b, 0x6f, 0x3b, 0x6d, 0x69, 0x65, 0x73, 0x73, 0x65, 0x3b, 0x67, 0x65, 0x61, 0x73, 0x73, 0x65, 0x3b, 0x73, 0x75,
-0x6f, 0x69, 0x64, 0x6e, 0x65, 0x3b, 0x62, 0x6f, 0x72, 0x67, 0x65, 0x3b, 0x10d, 0x61, 0x6b, 0x10d, 0x61, 0x3b, 0x67, 0x6f,
-0x6c, 0x67, 0x67, 0x6f, 0x74, 0x3b, 0x73, 0x6b, 0xe1, 0x62, 0x6d, 0x61, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x6c, 0x61, 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, 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, 0x4d, 0x3b, 0x59, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x194, 0x3b, 0x43,
-0x3b, 0x54, 0x3b, 0x4e, 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,
+0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x55, 0x4d,
+0x61, 0x73, 0x69, 0x6e, 0x67, 0x61, 0x6e, 0x61, 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, 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, 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, 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,
+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, 0x948, 0x3b, 0x913, 0x917, 0x938, 0x94d, 0x91f, 0x3b, 0x938, 0x947, 0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x913,
+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, 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, 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, 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, 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, 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,
+0x4d, 0x3b, 0x59, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x194, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x4e, 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, 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, 0xe4, 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, 0xe4, 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, 0x6f, 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, 0xe4, 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, 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, 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, 0x5f, 0x442, 0x442, 0x440, 0x3b, 0x41c, 0x443, 0x441, 0x5f, 0x443, 0x441, 0x442, 0x3b, 0x42b, 0x430, 0x43c,
-0x5f, 0x439, 0x43d, 0x3b, 0x411, 0x44d, 0x441, 0x5f, 0x439, 0x43d, 0x3b, 0x41e, 0x442, 0x5f, 0x439, 0x43d, 0x3b, 0x410, 0x442, 0x440,
-0x434, 0x44c, 0x5f, 0x439, 0x43d, 0x3b, 0x411, 0x43b, 0x495, 0x43d, 0x5f, 0x439, 0x43d, 0x3b, 0x410, 0x43b, 0x442, 0x3b, 0x421, 0x44d,
-0x442, 0x3b, 0x410, 0x445, 0x441, 0x3b, 0x422, 0x43e, 0x445, 0x441, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x3b, 0x41e, 0x43b, 0x443, 0x43d,
+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, 0x410, 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, 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, 0xa56a, 0xa583, 0x20,
-0xa51e, 0xa56e, 0x3b, 0xa552, 0xa561, 0xa59d, 0xa595, 0x3b, 0xa57e, 0xa5ba, 0x3b, 0xa5a2, 0xa595, 0x3b, 0xa591, 0xa571, 0x3b, 0x36, 0x3b, 0x37,
-0x3b, 0xa5db, 0xa515, 0x3b, 0xa562, 0xa54c, 0x3b, 0xa56d, 0xa583, 0x3b, 0xa51e, 0xa60b, 0xa554, 0xa57f, 0x20, 0xa578, 0xa583, 0xa5cf, 0x3b, 0xa5a8,
-0xa56a, 0xa571, 0x20, 0xa5cf, 0xa56e, 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, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x11b, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d,
+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, 0xa56a, 0xa583, 0x20, 0xa51e, 0xa56e, 0x3b, 0xa552,
+0xa561, 0xa59d, 0xa595, 0x3b, 0xa57e, 0xa5ba, 0x3b, 0xa5a2, 0xa595, 0x3b, 0xa591, 0xa571, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0xa5db, 0xa515, 0x3b,
+0xa562, 0xa54c, 0x3b, 0xa56d, 0xa583, 0x3b, 0xa51e, 0xa60b, 0xa554, 0xa57f, 0x20, 0xa578, 0xa583, 0xa5cf, 0x3b, 0xa5a8, 0xa56a, 0xa571, 0x20, 0xa5cf,
+0xa56e, 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,
@@ -3789,18 +3805,23 @@ static const ushort months_data[] = {
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, 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, 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
+0x77, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x61, 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[] = {
@@ -3813,169 +3834,170 @@ static const ushort days_data[] = {
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, 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, 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, 0x45, 0x20, 0x64, 0x69, 0x65, 0x6c, 0x3b, 0x45, 0x20, 0x68, 0xeb, 0x6e, 0xeb, 0x3b, 0x45, 0x20,
-0x6d, 0x61, 0x72, 0x74, 0xeb, 0x3b, 0x45, 0x20, 0x6d, 0xeb, 0x72, 0x6b, 0x75, 0x72, 0xeb, 0x3b, 0x45, 0x20, 0x65, 0x6e,
-0x6a, 0x74, 0x65, 0x3b, 0x45, 0x20, 0x70, 0x72, 0x65, 0x6d, 0x74, 0x65, 0x3b, 0x45, 0x20, 0x73, 0x68, 0x74, 0x75, 0x6e,
-0xeb, 0x3b, 0x44, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x50, 0x3b, 0x53, 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, 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,
-0x580, 0x3b, 0x535, 0x56f, 0x3b, 0x535, 0x580, 0x3b, 0x549, 0x580, 0x3b, 0x540, 0x563, 0x3b, 0x548, 0x582, 0x3b, 0x547, 0x562, 0x3b,
-0x53f, 0x3b, 0x535, 0x3b, 0x535, 0x3b, 0x549, 0x3b, 0x540, 0x3b, 0x548, 0x582, 0x3b, 0x547, 0x3b, 0x9f0, 0x9ac, 0x9bf, 0x3b, 0x9b8,
-0x9cb, 0x9ae, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x9b7, 0x9cd, 0x9aa, 0x9a4,
-0x9bf, 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, 0x9b7, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9f0, 0x9ac,
-0x9be, 0x9f0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x9ac, 0x9be, 0x9f0, 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, 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, 0x49, 0x67, 0x2e, 0x3b, 0x41, 0x6c, 0x2e, 0x3b, 0x41,
-0x72, 0x2e, 0x3b, 0x41, 0x7a, 0x2e, 0x3b, 0x4f, 0x67, 0x2e, 0x3b, 0x4f, 0x72, 0x2e, 0x3b, 0x4c, 0x72, 0x2e, 0x3b, 0x49,
-0x67, 0x61, 0x6e, 0x64, 0x65, 0x61, 0x3b, 0x41, 0x73, 0x74, 0x65, 0x6c, 0x65, 0x68, 0x65, 0x6e, 0x61, 0x3b, 0x41, 0x73,
-0x74, 0x65, 0x61, 0x72, 0x74, 0x65, 0x61, 0x3b, 0x41, 0x73, 0x74, 0x65, 0x61, 0x7a, 0x6b, 0x65, 0x6e, 0x61, 0x3b, 0x4f,
-0x73, 0x74, 0x65, 0x67, 0x75, 0x6e, 0x61, 0x3b, 0x4f, 0x73, 0x74, 0x69, 0x72, 0x61, 0x6c, 0x61, 0x3b, 0x4c, 0x61, 0x72,
-0x75, 0x6e, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x4f, 0x3b, 0x4f, 0x3b, 0x4c,
-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, 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, 0x9b7, 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, 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, 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,
-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, 0x17a2, 0x17b6,
-0x3b, 0x1785, 0x3b, 0x17a2, 0x3b, 0x1796, 0x17bb, 0x3b, 0x1796, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17bb, 0x3b, 0x179f, 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, 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, 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, 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, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b,
-0x4d, 0xe9, 0x72, 0x3b, 0x58, 0x6f, 0x76, 0x3b, 0x56, 0x65, 0x6e, 0x3b, 0x53, 0xe1, 0x62, 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, 0x3b, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0xe9, 0x72, 0x3b, 0x78, 0x6f, 0x76, 0x3b,
-0x76, 0x65, 0x6e, 0x3b, 0x73, 0xe1, 0x62, 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, 0x10d9, 0x10d5, 0x10d8,
+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, 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, 0x45, 0x20,
+0x64, 0x69, 0x65, 0x6c, 0x3b, 0x45, 0x20, 0x68, 0xeb, 0x6e, 0xeb, 0x3b, 0x45, 0x20, 0x6d, 0x61, 0x72, 0x74, 0xeb, 0x3b,
+0x45, 0x20, 0x6d, 0xeb, 0x72, 0x6b, 0x75, 0x72, 0xeb, 0x3b, 0x45, 0x20, 0x65, 0x6e, 0x6a, 0x74, 0x65, 0x3b, 0x45, 0x20,
+0x70, 0x72, 0x65, 0x6d, 0x74, 0x65, 0x3b, 0x45, 0x20, 0x73, 0x68, 0x74, 0x75, 0x6e, 0xeb, 0x3b, 0x44, 0x3b, 0x48, 0x3b,
+0x4d, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x50, 0x3b, 0x53, 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, 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, 0x9f0, 0x9ac, 0x9bf, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2,
+0x3b, 0x9ac, 0x9c1, 0x9a7, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x9b7, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 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, 0x9b7, 0x9cd, 0x9aa,
+0x9a4, 0x9bf, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9f0, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x9ac, 0x9be,
+0x9f0, 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, 0x49, 0x67,
+0x61, 0x6e, 0x64, 0x65, 0x61, 0x3b, 0x41, 0x73, 0x74, 0x65, 0x6c, 0x65, 0x68, 0x65, 0x6e, 0x61, 0x3b, 0x41, 0x73, 0x74,
+0x65, 0x61, 0x72, 0x74, 0x65, 0x61, 0x3b, 0x41, 0x73, 0x74, 0x65, 0x61, 0x7a, 0x6b, 0x65, 0x6e, 0x61, 0x3b, 0x4f, 0x73,
+0x74, 0x65, 0x67, 0x75, 0x6e, 0x61, 0x3b, 0x4f, 0x73, 0x74, 0x69, 0x72, 0x61, 0x6c, 0x61, 0x3b, 0x4c, 0x61, 0x72, 0x75,
+0x6e, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x4f, 0x3b, 0x4f, 0x3b, 0x4c, 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, 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, 0x9b7, 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, 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, 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, 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, 0x17a2, 0x3b, 0x1785, 0x3b, 0x17a2, 0x3b, 0x1796, 0x3b, 0x1796, 0x3b, 0x179f,
+0x3b, 0x179f, 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, 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, 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, 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,
@@ -4004,266 +4026,277 @@ static const ushort days_data[] = {
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, 0x68, 0x3b, 0x4c, 0x69, 0x3b, 0x54, 0x61, 0x3b, 0x4c, 0x72, 0x3b, 0x41, 0x6c, 0x3b,
-0x4a, 0x75, 0x3b, 0x41, 0x73, 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, 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, 0x44, 0x6f, 0x6d, 0x65, 0x6e, 0x69, 0x63, 0x61, 0x3b, 0x4c, 0x75, 0x6e, 0x65, 0x64, 0xec,
-0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65, 0x64, 0xec, 0x3b, 0x4d, 0x65, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x64, 0xec, 0x3b, 0x47,
-0x69, 0x6f, 0x76, 0x65, 0x64, 0xec, 0x3b, 0x56, 0x65, 0x6e, 0x65, 0x72, 0x64, 0xec, 0x3b, 0x53, 0x61, 0x62, 0x61, 0x74,
-0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x56, 0x3b, 0x53, 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, 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, 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, 0x65b, 0x62f, 0x655, 0x631, 0x648, 0x627, 0x631, 0x3b,
-0x628, 0x648, 0x65a, 0x645, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x631, 0x65b, 0x66e, 0x6ea,
-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, 0x65b, 0x62f, 0x631, 0x655, 0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x65a, 0x645,
-0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x631, 0x65b, 0x66e, 0x6ea, 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, 0x416, 0x441, 0x3b, 0x414, 0x441, 0x3b, 0x421, 0x441, 0x3b, 0x421, 0x440, 0x3b, 0x411, 0x441,
-0x3b, 0x416, 0x43c, 0x3b, 0x421, 0x431, 0x3b, 0x416, 0x435, 0x43a, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x414, 0x4af, 0x439, 0x441,
-0x435, 0x43d, 0x431, 0x456, 0x3b, 0x421, 0x435, 0x439, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x421, 0x4d9, 0x440, 0x441, 0x435, 0x43d,
-0x431, 0x456, 0x3b, 0x411, 0x435, 0x439, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x416, 0x4b1, 0x43c, 0x430, 0x3b, 0x421, 0x435, 0x43d,
-0x431, 0x456, 0x3b, 0x416, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x421, 0x3b, 0x411, 0x3b, 0x416, 0x3b, 0x421, 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, 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, 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,
-0x3b, 0xe88, 0x3b, 0xead, 0x3b, 0xe9e, 0x3b, 0xe9e, 0xeab, 0x3b, 0xeaa, 0xeb8, 0x3b, 0xeaa, 0x3b, 0x31, 0x3b, 0x32, 0x3b, 0x33,
-0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x53, 0x76, 0x3b, 0x50, 0x72, 0x3b, 0x4f, 0x74, 0x3b, 0x54, 0x72,
-0x3b, 0x43, 0x65, 0x3b, 0x50, 0x6b, 0x3b, 0x53, 0x65, 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, 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, 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, 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, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x45, 0x3b, 0x126, 0x3b, 0x120, 0x3b, 0x53, 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, 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, 0x940, 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, 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, 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, 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, 0x69, 0x70, 0x3b, 0x43, 0x68, 0x69, 0x74, 0x3b, 0x43, 0x68, 0x69, 0x6e, 0x3b,
-0x43, 0x68, 0x69, 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, 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, 0x3b, 0x70, 0x6f, 0x6e, 0x3b, 0x74, 0x6f, 0x72, 0x3b, 0x73, 0x72, 0x65,
-0x3b, 0x10d, 0x65, 0x74, 0x3b, 0x70, 0x65, 0x74, 0x3b, 0x73, 0x6f, 0x62, 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, 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, 0x41, 0x78, 0x64, 0x3b, 0x49, 0x73,
-0x6e, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0x41, 0x72, 0x62, 0x3b, 0x4b, 0x68, 0x61, 0x3b, 0x4a, 0x69, 0x6d, 0x3b, 0x53, 0x61,
-0x62, 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, 0x3b, 0x4a,
+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, 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, 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, 0x65b, 0x62f, 0x655, 0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x65a, 0x645, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648,
+0x62f, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x631, 0x65b, 0x66e, 0x6ea, 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, 0x65b, 0x62f, 0x631,
+0x655, 0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x65a, 0x645, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648, 0x627, 0x631,
+0x3b, 0x628, 0x631, 0x65b, 0x66e, 0x6ea, 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, 0x416, 0x441, 0x3b, 0x414,
+0x441, 0x3b, 0x421, 0x441, 0x3b, 0x421, 0x440, 0x3b, 0x411, 0x441, 0x3b, 0x416, 0x43c, 0x3b, 0x421, 0x431, 0x3b, 0x416, 0x435, 0x43a,
+0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x414, 0x4af, 0x439, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x421, 0x435, 0x439, 0x441, 0x435,
+0x43d, 0x431, 0x456, 0x3b, 0x421, 0x4d9, 0x440, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x411, 0x435, 0x439, 0x441, 0x435, 0x43d, 0x431,
+0x456, 0x3b, 0x416, 0x4b1, 0x43c, 0x430, 0x3b, 0x421, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x416, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x421,
+0x3b, 0x411, 0x3b, 0x416, 0x3b, 0x421, 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, 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, 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, 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, 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, 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, 0x43d, 0x435, 0x434, 0x2e,
+0x3b, 0x43f, 0x43e, 0x43d, 0x2e, 0x3b, 0x443, 0x442, 0x2e, 0x3b, 0x441, 0x440, 0x2e, 0x3b, 0x447, 0x435, 0x442, 0x2e, 0x3b, 0x43f,
+0x435, 0x442, 0x2e, 0x3b, 0x441, 0x443, 0x431, 0x2e, 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, 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,
+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, 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, 0x61, 0x6c, 0x3b, 0x41, 0x72, 0x62, 0x3b, 0x4b, 0x68, 0x61, 0x3b, 0x4a, 0x69, 0x6d, 0x3b, 0x53, 0x61, 0x62,
+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,
@@ -4272,45 +4305,40 @@ static const ushort days_data[] = {
0x3b, 0x76, 0x3b, 0x73, 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, 0x79, 0x3b, 0x6b, 0x3b, 0x70, 0x3b, 0x74, 0x3b, 0x69, 0x3b, 0x74, 0x3b, 0x73, 0x3b, 0x79,
-0x65, 0x6e, 0x3b, 0x6b, 0x77, 0x61, 0x3b, 0x70, 0x69, 0x6c, 0x3b, 0x74, 0x61, 0x74, 0x3b, 0x69, 0x6e, 0x65, 0x3b, 0x74,
-0x61, 0x6e, 0x3b, 0x73, 0x69, 0x74, 0x3b, 0x73, 0x69, 0x6b, 0x75, 0x20, 0x79, 0x61, 0x20, 0x79, 0x65, 0x6e, 0x67, 0x61,
-0x3b, 0x73, 0x69, 0x6b, 0x75, 0x20, 0x79, 0x61, 0x20, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x73, 0x69, 0x6b, 0x75,
-0x20, 0x79, 0x61, 0x20, 0x70, 0x69, 0x6c, 0x69, 0x3b, 0x73, 0x69, 0x6b, 0x75, 0x20, 0x79, 0x61, 0x20, 0x74, 0x61, 0x74,
-0x75, 0x3b, 0x73, 0x69, 0x6b, 0x75, 0x20, 0x79, 0x61, 0x20, 0x69, 0x6e, 0x65, 0x3b, 0x73, 0x69, 0x6b, 0x75, 0x20, 0x79,
-0x61, 0x20, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x73, 0x69, 0x6b, 0x75, 0x20, 0x79, 0x61, 0x20, 0x73, 0x69, 0x74, 0x61, 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, 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, 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, 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, 0x1283, 0x3b,
-0x12d3, 0x3b, 0x1240, 0x3b, 0x1230, 0x1295, 0x1260, 0x1275, 0x3b, 0x1230, 0x1291, 0x12ed, 0x3b, 0x1230, 0x1209, 0x1235, 0x3b, 0x1228, 0x1261, 0x12d5,
-0x3b, 0x1213, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d, 0x1262, 0x3b, 0x1240, 0x12f3, 0x121d, 0x3b, 0x53, 0x101, 0x70, 0x3b, 0x4d, 0x14d, 0x6e,
+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, 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, 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, 0x1230, 0x1209, 0x1235, 0x3b,
+0x1228, 0x1261, 0x12d5, 0x3b, 0x1213, 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, 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, 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,
@@ -4329,554 +4357,620 @@ static const ushort days_data[] = {
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, 0x41d, 0x434, 0x3b, 0x41f, 0x43d, 0x3b, 0x412, 0x442, 0x3b,
-0x421, 0x440, 0x3b, 0x427, 0x442, 0x3b, 0x41f, 0x442, 0x3b, 0x421, 0x431, 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, 0x633, 0x648, 0x645, 0x648, 0x627, 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, 0x3b, 0x44, 0x75, 0x3b, 0x53, 0x65, 0x3b, 0x43, 0x68, 0x3b, 0x50, 0x61, 0x3b, 0x4a, 0x75, 0x3b, 0x53,
-0x68, 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, 0x42f, 0x43a,
-0x448, 0x3b, 0x414, 0x443, 0x448, 0x3b, 0x421, 0x435, 0x448, 0x3b, 0x427, 0x43e, 0x440, 0x3b, 0x41f, 0x430, 0x439, 0x3b, 0x416, 0x443,
-0x43c, 0x3b, 0x428, 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, 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, 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, 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, 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, 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, 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, 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, 0x926, 0x93f, 0x924, 0x94d, 0x92f, 0x935, 0x93e, 0x930,
-0x3b, 0x938, 0x94b, 0x92e, 0x935, 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, 0x935, 0x93e, 0x930, 0x3b, 0x936,
-0x928, 0x93f, 0x935, 0x93e, 0x930, 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, 0x4d, 0x62, 0x1ecd, 0x73, 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, 0x73, 0x6f, 0x74, 0x6e, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x3b, 0x6d, 0x61, 0x14b,
+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, 0x633, 0x648, 0x645, 0x648, 0x627, 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,
+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, 0x42f, 0x43a, 0x448, 0x3b, 0x414, 0x443, 0x448, 0x3b, 0x421, 0x435, 0x448, 0x3b, 0x427, 0x43e, 0x440, 0x3b,
+0x41f, 0x430, 0x439, 0x3b, 0x416, 0x443, 0x43c, 0x3b, 0x428, 0x430, 0x43d, 0x3b, 0x42f, 0x43a, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b,
+0x414, 0x443, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x421, 0x435, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x427, 0x43e, 0x440, 0x448,
+0x430, 0x43d, 0x431, 0x430, 0x3b, 0x41f, 0x430, 0x439, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x416, 0x443, 0x43c, 0x430, 0x3b, 0x428,
+0x430, 0x43d, 0x431, 0x430, 0x3b, 0x42f, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x416, 0x3b, 0x428, 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,
+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, 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,
+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, 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, 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, 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,
+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, 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, 0x926,
+0x93f, 0x924, 0x94d, 0x92f, 0x935, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x935, 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, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x935, 0x93e, 0x930, 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, 0x4d, 0x62, 0x1ecd, 0x73, 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, 0x61, 0x65, 0x6a, 0x6c, 0x65, 0x67, 0x65, 0x3b, 0x6d, 0xe5, 0x61,
-0x6e, 0x74, 0x61, 0x3b, 0x64, 0xe4, 0x6a, 0x73, 0x74, 0x61, 0x3b, 0x67, 0x61, 0x73, 0x6b, 0x65, 0x76, 0x61, 0x68, 0x6b,
-0x6f, 0x65, 0x3b, 0x64, 0xe5, 0x61, 0x72, 0x73, 0x74, 0x61, 0x3b, 0x62, 0x65, 0x61, 0x72, 0x6a, 0x61, 0x64, 0x61, 0x68,
-0x6b, 0x65, 0x3b, 0x6c, 0x61, 0x61, 0x76, 0x61, 0x64, 0x61, 0x68, 0x6b, 0x65, 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, 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, 0x59, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 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, 0x61, 0x62, 0x61, 0x64, 0x75, 0x3b, 0x64, 0x3b,
-0x73, 0x3b, 0x74, 0x3b, 0x6b, 0x3b, 0x6b, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4b, 0x3b,
-0x4b, 0x3b, 0x53, 0x3b, 0x53, 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, 0x6f, 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, 0x440, 0x430, 0x43d, 0x430, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x43e, 0x440, 0x448, 0x43e, 0x442, 0x430, 0x43d, 0x20, 0x434,
-0x435, 0x3b, 0x448, 0x438, 0x43d, 0x430, 0x440, 0x438, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x43a, 0x445, 0x430, 0x430, 0x440, 0x438, 0x43d,
-0x20, 0x434, 0x435, 0x3b, 0x435, 0x430, 0x440, 0x438, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x43f, 0x4c0, 0x435, 0x440, 0x430, 0x441, 0x43a,
-0x430, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x448, 0x43e, 0x442, 0x20, 0x434, 0x435, 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, 0x411, 0x441, 0x3b, 0x411, 0x43d, 0x3b, 0x41e, 0x43f, 0x3b, 0x421, 0x44d, 0x3b,
-0x427, 0x43f, 0x3b, 0x411, 0x44d, 0x3b, 0x421, 0x431, 0x3b, 0x411, 0x430, 0x441, 0x43a, 0x44b, 0x4bb, 0x44b, 0x430, 0x43d, 0x43d, 0x44c,
-0x430, 0x3b, 0x411, 0x44d, 0x43d, 0x438, 0x434, 0x438, 0x44d, 0x43b, 0x438, 0x43d, 0x43d, 0x44c, 0x438, 0x43a, 0x3b, 0x41e, 0x43f, 0x442,
-0x443, 0x43e, 0x440, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x43a, 0x3b, 0x421, 0x44d, 0x440, 0x44d, 0x434, 0x44d, 0x3b, 0x427, 0x44d, 0x43f,
-0x43f, 0x438, 0x44d, 0x440, 0x3b, 0x411, 0x44d, 0x44d, 0x442, 0x438, 0x4a5, 0x441, 0x44d, 0x3b, 0x421, 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, 0x70, 0x61, 0x3b, 0x76, 0x75, 0x3b, 0x6d, 0x61, 0x3b,
-0x6b, 0x6f, 0x3b, 0x74, 0x75, 0x3b, 0x76, 0xe1, 0x3b, 0x6c, 0xe1, 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, 0x50, 0x3b, 0x56, 0x3b, 0x4d,
-0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x56, 0x3b, 0x4c, 0x3b
+0x3b, 0x47, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x44, 0x3b, 0x42,
+0x3b, 0x4c, 0x3b, 0x73, 0x6f, 0x74, 0x6e, 0x61, 0x62, 0x65, 0x61, 0x69, 0x76, 0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x73,
+0xe1, 0x72, 0x67, 0x67, 0x61, 0x3b, 0x6d, 0x61, 0x14b, 0x14b, 0x65, 0x62, 0xe1, 0x72, 0x67, 0x67, 0x61, 0x3b, 0x67, 0x61,
+0x73, 0x6b, 0x61, 0x76, 0x61, 0x68, 0x6b, 0x75, 0x3b, 0x64, 0x75, 0x6f, 0x72, 0x61, 0x73, 0x74, 0x61, 0x67, 0x61, 0x3b,
+0x62, 0x65, 0x61, 0x72, 0x6a, 0x61, 0x64, 0x61, 0x67, 0x61, 0x3b, 0x6c, 0xe1, 0x76, 0x76, 0x61, 0x72, 0x64, 0x61, 0x67,
+0x61, 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, 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, 0x59,
+0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 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, 0x440, 0x430, 0x43d, 0x430, 0x43d,
+0x20, 0x434, 0x435, 0x3b, 0x43e, 0x440, 0x448, 0x43e, 0x442, 0x430, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x448, 0x438, 0x43d, 0x430, 0x440,
+0x438, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x43a, 0x445, 0x430, 0x430, 0x440, 0x438, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x435, 0x430, 0x440,
+0x438, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x43f, 0x4c0, 0x435, 0x440, 0x430, 0x441, 0x43a, 0x430, 0x43d, 0x20, 0x434, 0x435, 0x3b, 0x448,
+0x43e, 0x442, 0x20, 0x434, 0x435, 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, 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, 0x50,
+0x42, 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, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x562, 0x561, 0x575, 0x569, 0x565, 0x580, 0x56f, 0x532, 0x3b, 0x544, 0x532,
+0x3b, 0x533, 0x532, 0x3b, 0x54f, 0x532, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x62, 0x61, 0x79, 0x74, 0x62, 0x79, 0x74, 0x65,
+0x2d, 0x61, 0x6b, 0x9ac, 0x9be, 0x987, 0x99f, 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, 0x50, 0x42, 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, 0x69, 0x64, 0x69, 0x64, 0x62, 0xfd, 0x74, 0x4b, 0x42, 0x3b,
+0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 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, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x42, 0x79, 0x74, 0x65, 0x73, 0xaac, 0xabe, 0xa87, 0xa9f, 0x5d1, 0x5ea,
+0x5d9, 0x5dd, 0x92c, 0x93e, 0x907, 0x91f, 0x62, 0xe1, 0x6a, 0x74, 0x62, 0xe6, 0x74, 0x69, 0x62, 0x65, 0x61, 0x72, 0x74, 0x61,
+0x30d0, 0x30a4, 0x30c8, 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, 0x50,
+0x42, 0x3b, 0x45, 0x42, 0x431, 0x430, 0x439, 0x442, 0x43a, 0x411, 0x3b, 0x4d, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x54, 0x411, 0x3b,
+0x50, 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,
+0x50, 0x42, 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, 0xd3f, 0x2e, 0xd2c, 0xd3f, 0x2e,
+0x3b, 0xd2e, 0xd46, 0x2e, 0xd2c, 0xd48, 0x2e, 0x3b, 0xd1c, 0xd3f, 0x2e, 0xd2c, 0xd48, 0x2e, 0x3b, 0xd1f, 0xd3f, 0xd2c, 0xd3f, 0x3b,
+0x50, 0x42, 0x3b, 0x45, 0x42, 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, 0x50, 0x42, 0x3b, 0x45, 0x42, 0xa2c, 0xa3e, 0xa07, 0xa1f, 0x62, 0x79, 0x21b, 0x69, 0x431, 0x430, 0x458, 0x442,
+0x43e, 0x432, 0x438, 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,
+0x50, 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, 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, 0x50, 0x42, 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, 0x62, 0x65, 0x69, 0x74, 0x69,
+0x61, 0x75, 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
};
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, 0x9a3, 0x9aa, 0x9c2, 0x9b0, 0x9cd, 0x9ac, 0x9be, 0x9b9, 0x9cd, 0x9a3,
-0xf66, 0xf94, 0xf0b, 0xf46, 0xf0b, 0x41, 0x2e, 0x4d, 0x2e, 0x43f, 0x440, 0x2e, 0x43e, 0x431, 0x2e, 0x1014, 0x1036, 0x1014, 0x1000, 0x103a,
-0x434, 0x430, 0x20, 0x43f, 0x430, 0x45e, 0x434, 0x43d, 0x44f, 0x1796, 0x17d2, 0x179a, 0x17b9, 0x1780, 0x61, 0x2e, 0x20, 0x6d, 0x2e, 0x4e0a,
-0x5348, 0x64, 0x6f, 0x70, 0x2e, 0x61, 0x2e, 0x6d, 0x2e, 0x61, 0x6d, 0x61, 0x70, 0x2e, 0x6d, 0x76, 0x6f, 0x72, 0x6d, 0x2e,
-0x3c0, 0x2e, 0x3bc, 0x2e, 0x5dc, 0x5e4, 0x5e0, 0x5d4, 0x5f4, 0x5e6, 0x92a, 0x942, 0x930, 0x94d, 0x935, 0x93e, 0x939, 0x94d, 0x928, 0x64,
-0x65, 0x2e, 0x66, 0x2e, 0x68, 0x2e, 0x5348, 0x524d, 0xcaa, 0xcc2, 0xcb0, 0xccd, 0xcb5, 0xcbe, 0xcb9, 0xccd, 0xca8, 0x442, 0x430, 0x4a3,
-0x493, 0x44b, 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, 0x4ae, 0x4e8, 0x63a, 0x2e, 0x645, 0x2e, 0x642, 0x628, 0x644, 0x200c,
+0x1275, 0x635, 0x9aa, 0x9c2, 0x9f0, 0x9cd, 0x9ac, 0x9be, 0x9b9, 0x9cd, 0x9a3, 0x410, 0x41c, 0xf66, 0xf94, 0xf0b, 0xf46, 0xf0b, 0x41, 0x2e,
+0x4d, 0x2e, 0x43f, 0x440, 0x2e, 0x43e, 0x431, 0x2e, 0x1014, 0x1036, 0x1014, 0x1000, 0x103a, 0x61, 0x2e, 0x20, 0x6d, 0x2e, 0x4e0a, 0x5348,
+0x64, 0x6f, 0x70, 0x2e, 0x61, 0x2e, 0x6d, 0x2e, 0x61, 0x6d, 0x61, 0x70, 0x2e, 0x6d, 0x61, 0x74, 0x69, 0x6e, 0x6d, 0x76,
+0x6f, 0x72, 0x6d, 0x2e, 0x3c0, 0x2e, 0x3bc, 0x2e, 0x5dc, 0x5e4, 0x5e0, 0x5d4, 0x5f4, 0x5e6, 0x92a, 0x942, 0x930, 0x94d, 0x935, 0x93e,
+0x939, 0x94d, 0x928, 0x64, 0x65, 0x2e, 0x66, 0x2e, 0x68, 0x2e, 0x5348, 0x524d, 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, 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, 0x414,
-0x41f, 0x4e, 0x44, 0x43f, 0x440, 0x435, 0x20, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x70, 0x72, 0x65, 0x20, 0x70, 0x6f, 0x64, 0x6e,
-0x65, 0x4d5, 0x43c, 0x431, 0x438, 0x441, 0x431, 0x43e, 0x43d, 0x44b, 0x20, 0x440, 0x430, 0x437, 0x43c, 0x4d5, 0xdb4, 0xdd9, 0x2e, 0xdc0,
-0x2e, 0x73, 0x6e, 0x2e, 0x79, 0x61, 0x20, 0x61, 0x73, 0x75, 0x62, 0x75, 0x79, 0x69, 0x66, 0x6d, 0xbae, 0xbc1, 0xbb1, 0xbcd,
-0xbaa, 0xb95, 0xbb2, 0xbcd, 0x5b, 0x41, 0x4d, 0x5d, 0xe01, 0xe48, 0xe2d, 0xe19, 0xe40, 0xe17, 0xe35, 0xe48, 0xe22, 0xe07, 0xf66, 0xf94,
-0xf0b, 0xf51, 0xfb2, 0xf7c, 0xf0b, 0x1295, 0x1309, 0x1206, 0x20, 0x1230, 0x12d3, 0x1270, 0xd6, 0xd6, 0x686, 0x6c8, 0x634, 0x62a, 0x649, 0x646,
-0x20, 0x628, 0x6c7, 0x631, 0x6c7, 0x646, 0x434, 0x43f, 0x642, 0x628, 0x644, 0x20, 0x62f, 0x648, 0x67e, 0x6c1, 0x631, 0x54, 0x4f, 0x53,
-0x41, 0xc0, 0xe1, 0x72, 0x1ecd, 0x300, 0xc0, 0xe1, 0x72, 0x254, 0x300, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x64, 0x64, 0x61, 0x67,
-0x70, 0x72, 0x69, 0x6a, 0x65, 0x20, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x41, 0x4e, 0x128, 0x79, 0x61, 0x6b, 0x77, 0x61, 0x6b,
-0x79, 0x61, 0x61, 0x2e, 0x14b, 0x64, 0x69, 0xa3b8, 0xa111, 0x69, 0x111, 0x69, 0x74, 0x62, 0x65, 0x61, 0x69, 0x76, 0x65, 0x74,
-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, 0x64,
-0x6f, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x61
+0x41f, 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, 0xdb4, 0xdd9,
+0x2e, 0xdc0, 0x2e, 0x73, 0x6e, 0x2e, 0x41, 0x73, 0x75, 0x62, 0x75, 0x68, 0x69, 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, 0x686,
+0x6c8, 0x634, 0x62a, 0x649, 0x646, 0x20, 0x628, 0x6c7, 0x631, 0x6c7, 0x646, 0x434, 0x43f, 0x54, 0x4f, 0x422, 0x41e, 0x53, 0x41, 0x79,
+0x62, 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, 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, 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, 0x9a3, 0x985, 0x9aa, 0x9b0, 0x9be, 0x9b9, 0x9cd, 0x9a3, 0xf55, 0xfb1, 0xf72, 0xf0b,
-0xf46, 0xf0b, 0x47, 0x2e, 0x4d, 0x2e, 0x441, 0x43b, 0x2e, 0x43e, 0x431, 0x2e, 0x100a, 0x1014, 0x1031, 0x43f, 0x430, 0x441, 0x43b, 0x44f,
-0x20, 0x43f, 0x430, 0x45e, 0x434, 0x43d, 0x44f, 0x179b, 0x17d2, 0x1784, 0x17b6, 0x1785, 0x70, 0x2e, 0x20, 0x6d, 0x2e, 0x4e0b, 0x5348, 0x6f,
-0x64, 0x70, 0x2e, 0x70, 0x2e, 0x6d, 0x2e, 0x70, 0x6d, 0x69, 0x70, 0x2e, 0x66, 0x6e, 0x61, 0x63, 0x68, 0x6d, 0x2e, 0x3bc,
-0x2e, 0x3bc, 0x2e, 0x5d0, 0x5d7, 0x5d4, 0x5f4, 0x5e6, 0x905, 0x92a, 0x930, 0x93e, 0x939, 0x94d, 0x928, 0x64, 0x75, 0x2e, 0x65, 0x2e,
-0x68, 0x2e, 0x5348, 0x5f8c, 0xc85, 0xcaa, 0xcb0, 0xcbe, 0xcb9, 0xccd, 0xca8, 0x442, 0x4af, 0x441, 0x43a, 0x456, 0x2f, 0x43a, 0x435, 0x448,
-0x43a, 0x456, 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, 0x4ae, 0x425, 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, 0x73, 0x6d, 0x41f,
-0x41f, 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, 0xdb4, 0x2e, 0xdc0, 0x2e, 0x70, 0x6f,
-0x70, 0x2e, 0x67, 0x6e, 0x2e, 0x79, 0x61, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x61, 0x6e, 0x61, 0x65, 0x6d, 0xbaa, 0xbbf, 0xbb1,
-0xbcd, 0xbaa, 0xb95, 0xbb2, 0xbcd, 0x5b, 0x50, 0x4d, 0x5d, 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, 0xd6, 0x53, 0x686, 0x6c8, 0x634, 0x62a,
-0x649, 0x646, 0x20, 0x643, 0x6d0, 0x64a, 0x649, 0x646, 0x43f, 0x43f, 0x628, 0x639, 0x62f, 0x20, 0x62f, 0x648, 0x67e, 0x6c1, 0x631, 0x54,
-0x4b, 0x43, 0x48, 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, 0x50, 0x2e, 0x4d, 0x2e, 0x128, 0x79, 0x61, 0x77, 0x129, 0x6f, 0x6f, 0x70, 0x2e, 0x263, 0x65,
-0x74, 0x72, 0x254, 0x6e, 0x61, 0x6d, 0x2e, 0xa06f, 0xa2d2, 0x65, 0x61, 0x68, 0x6b, 0x65, 0x74, 0x62, 0x65, 0x61, 0x69, 0x76,
-0x65, 0x74, 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, 0x69, 0x14b, 0x6b, 0x61, 0x20, 0x6d, 0x62, 0x254, 0x301, 0x74, 0x20, 0x6e, 0x6a, 0x69, 0x6e,
-0x63, 0x77, 0xf2, 0x6e, 0x7a, 0xe9, 0x6d, 0x77, 0xf3, 0x74, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x61, 0x70, 0x6f, 0x70,
-0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x75
+0x1275, 0x645, 0x985, 0x9aa, 0x9f0, 0x9be, 0x9b9, 0x9cd, 0x9a3, 0x41f, 0x41c, 0xf55, 0xfb1, 0xf72, 0xf0b, 0xf46, 0xf0b, 0x47, 0x2e, 0x4d,
+0x2e, 0x441, 0x43b, 0x2e, 0x43e, 0x431, 0x2e, 0x100a, 0x1014, 0x1031, 0x70, 0x2e, 0x20, 0x6d, 0x2e, 0x4e0b, 0x5348, 0x6f, 0x64, 0x70,
+0x2e, 0x70, 0x2e, 0x6d, 0x2e, 0x70, 0x6d, 0x69, 0x70, 0x2e, 0x73, 0x6f, 0x69, 0x72, 0x66, 0x6e, 0x61, 0x63, 0x68, 0x6d,
+0x2e, 0x3bc, 0x2e, 0x3bc, 0x2e, 0x5d0, 0x5d7, 0x5d4, 0x5f4, 0x5e6, 0x905, 0x92a, 0x930, 0x93e, 0x939, 0x94d, 0x928, 0x64, 0x75, 0x2e,
+0x65, 0x2e, 0x68, 0x2e, 0x5348, 0x5f8c, 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, 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, 0x41f, 0x41f, 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, 0xdb4, 0x2e, 0xdc0, 0x2e, 0x70, 0x6f, 0x70, 0x2e, 0x67, 0x6e, 0x2e, 0x4d, 0x63, 0x68, 0x61, 0x6e,
+0x61, 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, 0x686, 0x6c8, 0x634, 0x62a, 0x649, 0x646, 0x20, 0x643, 0x6d0, 0x64a, 0x649, 0x646, 0x43f, 0x43f, 0x54, 0x4b,
+0x422, 0x41a, 0x43, 0x48, 0x79, 0x68, 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, 0x50, 0x2e, 0x4d, 0x2e, 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, 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[] = {
@@ -4886,18 +4980,18 @@ static const ushort currency_symbol_data[] = {
0x62f, 0x2e, 0x643, 0x2e, 0x200f, 0x644, 0x2e, 0x644, 0x2e, 0x200f, 0x62f, 0x2e, 0x644, 0x2e, 0x200f, 0x623, 0x2e, 0x645, 0x2e, 0x200f,
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, 0x440, 0x2e,
-0x17db, 0xffe5, 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, 0x56, 0x54, 0x44, 0x41, 0x43, 0x46, 0x41, 0x43, 0x46, 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, 0x20b8, 0x441, 0x43e, 0x43c, 0x20a9, 0x4b, 0x50, 0x57, 0x20ba, 0x20ad,
-0x4b, 0x7a, 0x434, 0x435, 0x43d, 0x4e, 0x5a, 0x24, 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, 0x2e, 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, 0x52, 0x73, 0x2e, 0x54, 0x48, 0x42, 0xa5, 0x54, 0x4d, 0x54, 0x73, 0x6f, 0x2bb, 0x6d,
-0x441, 0x45e, 0x43c, 0x20ab, 0x4e, 0x54, 0x24, 0x41, 0x24, 0x49, 0x52, 0x52
+0x631, 0x2e, 0x64a, 0x2e, 0x200f, 0xa3, 0x58f, 0x20b9, 0x20bc, 0x20bd, 0x9f3, 0x4e, 0x75, 0x2e, 0x43b, 0x432, 0x2e, 0x4b, 0x17db, 0xffe5,
+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, 0x56, 0x54, 0x44, 0x41, 0x43, 0x46, 0x41, 0x43, 0x46, 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, 0x20b8, 0x441, 0x43e, 0x43c, 0x20a9, 0x4b, 0x50, 0x57, 0x20ba, 0x20ad, 0x4b, 0x7a,
+0x434, 0x435, 0x43d, 0x4e, 0x5a, 0x24, 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, 0x52, 0x73, 0x2e, 0x54, 0x48, 0x42, 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[] = {
@@ -4928,770 +5022,770 @@ static const ushort currency_display_name_data[] = {
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, 0x627, 0x62a, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x629, 0x3b, 0x62f, 0x64a,
-0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x64b, 0x627, 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, 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,
-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, 0x627, 0x62a, 0x20, 0x639, 0x631, 0x627, 0x642,
-0x64a, 0x629, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x64b, 0x627, 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, 0x627, 0x62a, 0x20,
-0x623, 0x631, 0x62f, 0x646, 0x64a, 0x629, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a,
-0x64b, 0x627, 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, 0x627, 0x62a, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x629, 0x3b, 0x62f, 0x64a,
-0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x64b, 0x627, 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,
+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, 0x629, 0x20, 0x644,
+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,
+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, 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, 0x627, 0x62a, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x627,
-0x64b, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x64b, 0x627, 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, 0x627, 0x62a, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x629, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x627, 0x64b,
-0x20, 0x642, 0x637, 0x631, 0x64a, 0x64b, 0x627, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a,
+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, 0x627, 0x62a, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x629, 0x3b, 0x631, 0x64a, 0x627, 0x644,
-0x627, 0x64b, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x64b, 0x627, 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,
+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, 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,
+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, 0x627, 0x62a, 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, 0x627, 0x647, 0x645,
-0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x629, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x64b, 0x627, 0x20, 0x625, 0x645, 0x627,
-0x631, 0x627, 0x62a, 0x64a, 0x64b, 0x627, 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, 0x627, 0x62a, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x629, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x627, 0x64b, 0x20,
-0x64a, 0x645, 0x646, 0x64a, 0x64b, 0x627, 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, 0x540, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580,
-0x561, 0x574, 0x3b, 0x3b, 0x540, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b, 0x3b, 0x3b,
-0x3b, 0x540, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 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, 0x45, 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, 0x1000, 0x103b, 0x1015, 0x103a, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019, 0x102c, 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, 0x5143, 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, 0x44, 0x61, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f,
-0x6e, 0x65, 0x3b, 0x3b, 0x44, 0x61, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x44,
-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, 0x71, 0x65, 0x6c,
-0x3b, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x68, 0x65, 0x71, 0x65, 0x6c,
-0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x68, 0x65, 0x71,
-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, 0x65, 0x73, 0x6f,
-0x3b, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x65, 0x73, 0x6f, 0x3b, 0x3b, 0x3b,
-0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x65, 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, 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, 0x5f4, 0x5d7, 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, 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,
+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, 0x540, 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, 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, 0x1000, 0x103b,
+0x1015, 0x103a, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019, 0x102c, 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, 0x65, 0x73, 0x6f, 0x3b, 0x3b, 0x50,
+0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x65, 0x73, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x68,
+0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x65, 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, 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, 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, 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, 0xb1f, 0xb19, 0xb15, 0xb3e, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 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, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c,
-0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f,
-0x3b, 0x3b, 0x3b, 0x3b, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f,
-0x73, 0x3b, 0x45, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61,
-0x6e, 0x6f, 0x3b, 0x3b, 0x45, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64,
-0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x73, 0x20, 0x63, 0x61, 0x62, 0x6f,
-0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x44, 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, 0x44, 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, 0x44, 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, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43,
-0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20,
-0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73,
-0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x45,
-0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x73, 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, 0x4d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x6f, 0xe7,
-0x61, 0x6d, 0x62, 0x69, 0x71, 0x75, 0x65, 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, 0x4d, 0x65, 0x74, 0x69, 0x63, 0x61,
-0x6c, 0x65, 0x73, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x71, 0x75, 0x65, 0x3b, 0x44, 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, 0x44, 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,
-0x44, 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, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x75, 0xed,
-0xe7, 0x6f, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x75, 0xed, 0xe7, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
-0x46, 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, 0x420,
-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, 0x411, 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, 0x41a, 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, 0x41a, 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, 0x430, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x43e, 0x433, 0x43e,
-0x20, 0x441, 0x43e, 0x43c, 0x430, 0x3b, 0x41c, 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, 0x423, 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, 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, 0x20, 0x73, 0x6f, 0x6f, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x46, 0x61, 0x72, 0x61, 0x6e, 0x20, 0x4a, 0x61, 0x62, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x42, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74, 0x6f, 0x6f, 0x62, 0x62, 0x69, 0x79, 0x61, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 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, 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, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43,
-0x46, 0x41, 0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43,
-0x46, 0x41, 0x20, 0x42, 0x45, 0x41, 0x43, 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, 0x6e, 0x75, 0x65, 0x76, 0x6f, 0x20, 0x73, 0x6f, 0x6c, 0x20,
-0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x6e, 0x75, 0x65, 0x76, 0x6f, 0x20, 0x73, 0x6f, 0x6c, 0x20, 0x70,
-0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x6e, 0x75, 0x65, 0x76, 0x6f, 0x73, 0x20, 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, 0x76, 0x65, 0x6e, 0x65,
-0x7a, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x20, 0x76, 0x65, 0x6e, 0x65,
-0x7a, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x65, 0x73, 0x20,
-0x76, 0x65, 0x6e, 0x65, 0x7a, 0x6f, 0x6c, 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, 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, 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, 0xe44, 0xe17, 0xe22, 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, 0x74, 0x79, 0x3b, 0x3b, 0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61,
-0x74, 0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x74, 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, 0x2bb, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2bb, 0x6d, 0x69, 0x3b, 0x3b,
-0x4f, 0x2bb, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2bb, 0x6d, 0x69, 0x3b, 0x3b, 0x3b,
-0x3b, 0x4f, 0x2bb, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2bb, 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, 0x4e, 0x61, 0x69, 0x72, 0x61, 0x20, 0x74, 0x69, 0x20, 0x4f, 0x72, 0xed, 0x6c, 0x1eb9,
-0x301, 0xe8, 0x64, 0x65, 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, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 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, 0x42, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x2d, 0x48, 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,
+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, 0xb1f, 0xb19,
+0xb15, 0xb3e, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 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, 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, 0x4b, 0x77, 0x61,
+0x6e, 0x7a, 0x61, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61,
+0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x73,
+0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x45, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x61,
+0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x45, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x20,
+0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x73, 0x63,
+0x75, 0x64, 0x6f, 0x73, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x73, 0x3b,
+0x44, 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, 0x44, 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, 0x44, 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, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b,
+0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b,
+0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b,
+0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b,
+0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b,
+0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f,
+0x29, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f,
+0x73, 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, 0x4d, 0x65, 0x74, 0x69, 0x63,
+0x61, 0x6c, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x71, 0x75, 0x65, 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, 0x4d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x65, 0x73, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x6f, 0xe7, 0x61,
+0x6d, 0x62, 0x69, 0x71, 0x75, 0x65, 0x3b, 0x44, 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, 0x44, 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, 0x44, 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, 0x46,
+0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x75, 0xed, 0xe7, 0x6f, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20,
+0x73, 0x75, 0xed, 0xe7, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 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, 0x420, 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, 0x411, 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, 0x41a, 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, 0x41a, 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, 0x41c, 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, 0x423, 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, 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, 0x20, 0x73, 0x6f, 0x6f,
+0x6d, 0x61, 0x61, 0x6c, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x61, 0x72, 0x61, 0x6e, 0x20, 0x4a, 0x61,
+0x62, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49,
+0x74, 0x6f, 0x6f, 0x62, 0x62, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 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, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f,
+0x20, 0x43, 0x46, 0x41, 0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73,
+0x20, 0x43, 0x46, 0x41, 0x20, 0x42, 0x45, 0x41, 0x43, 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, 0x76,
+0x65, 0x6e, 0x65, 0x7a, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x20, 0x76,
+0x65, 0x6e, 0x65, 0x7a, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72,
+0x65, 0x73, 0x20, 0x76, 0x65, 0x6e, 0x65, 0x7a, 0x6f, 0x6c, 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, 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, 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, 0xe44, 0xe17, 0xe22, 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, 0x74, 0x79, 0x3b, 0x3b, 0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d,
+0x61, 0x6e, 0x61, 0x74, 0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e,
+0x61, 0x74, 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, 0x4e, 0x61, 0x69, 0x72, 0x61, 0x20, 0x74, 0x69, 0x20, 0x4f, 0x72,
+0xed, 0x6c, 0x1eb9, 0x301, 0xe8, 0x64, 0x65, 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, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 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, 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,
-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, 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, 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,
+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, 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,
-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, 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,
-0x55, 0x67, 0x69, 0x79, 0x79, 0x61, 0x20, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 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, 0x3b, 0x3b, 0x3b, 0x3b, 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, 0x13a4, 0x13c3, 0x13cd, 0x13d7,
-0x3b, 0x3b, 0x13a4, 0x13c3, 0x13cd, 0x13d7, 0x3b, 0x3b, 0x3b, 0x3b, 0x13e7, 0x13c3, 0x13cd, 0x13d7, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69,
+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, 0x55, 0x67, 0x69, 0x79, 0x79, 0x61,
+0x20, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 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, 0x3b,
+0x3b, 0x3b, 0x3b, 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,
@@ -5726,28 +5820,32 @@ static const ushort currency_display_name_data[] = {
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, 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
+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, 0x31, 0xa0, 0x6d, 0x6e, 0xa0, 0x25, 0x32, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x2d, 0x25, 0x32, 0xa0, 0x25, 0x31,
-0x4b, 0x200e, 0x25, 0x32, 0x25, 0x31, 0x28, 0x25, 0x32, 0x25, 0x31, 0x29, 0x25, 0x32, 0x2d, 0xa0, 0x25, 0x31
+0x31, 0x25, 0x31, 0xa0, 0x6d, 0x6e, 0xa0, 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, 0x25,
+0x32, 0xa0, 0x25, 0x31, 0x4b, 0x28, 0x25, 0x32, 0x25, 0x31, 0x29, 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,
@@ -5766,271 +5864,271 @@ static const ushort endonyms_data[] = {
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, 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, 0x20, 0x64, 0x69, 0x6c, 0x69, 0x41, 0x7a, 0x259,
-0x72, 0x62, 0x61, 0x79, 0x63, 0x61, 0x6e, 0x430, 0x437, 0x4d9, 0x440, 0x431, 0x430, 0x458, 0x4b9, 0x430, 0x43d, 0x20, 0x434, 0x438,
-0x43b, 0x438, 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, 0x1017, 0x1019, 0x102c, 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, 0x83ef, 0x4eba, 0x6c11, 0x5171, 0x548c, 0x570b, 0x9999, 0x6e2f, 0x7279, 0x5225, 0x884c,
-0x653f, 0x5340, 0x4e2d, 0x83ef, 0x4eba, 0x6c11, 0x5171, 0x548c, 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, 0xe1, 0x20, 0x72, 0x65, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x6b, 0x61, 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, 0x56,
-0x6c, 0x61, 0x61, 0x6d, 0x73, 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, 0x75, 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,
-0x53, 0x77, 0x61, 0x7a, 0x69, 0x6c, 0x61, 0x6e, 0x64, 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, 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, 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, 0x57,
-0x65, 0x73, 0x74, 0x2d, 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, 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, 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, 0x65e5, 0x672c, 0x8a9e, 0x65e5, 0x672c, 0xc95, 0xca8, 0xccd, 0xca8, 0xca1, 0xcad,
-0xcbe, 0xcb0, 0xca4, 0x6a9, 0x672, 0x634, 0x64f, 0x631, 0x6c1, 0x650, 0x646, 0x65b, 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, 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, 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, 0x69, 0x62, 0x69, 0x6b, 0x69, 0x20, 0x64, 0x65, 0x6d, 0x6f, 0x6b, 0x72,
-0x61, 0x74, 0x69, 0x6b, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0xf3, 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, 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, 0x42, 0x61, 0x68, 0x61, 0x73, 0x61, 0x20, 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, 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, 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, 0x20, 0x64, 0x6f, 0x20, 0x42, 0x72, 0x61,
-0x73, 0x69, 0x6c, 0x42, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x67, 0x75, 0xea, 0x73, 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, 0x67e, 0x6a9, 0x633,
-0x62a, 0x627, 0x646, 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, 0x6d, 0x6f, 0x6c,
-0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x61, 0x73, 0x63, 0x103, 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,
-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, 0x4b, 0x69, 0x69, 0x6e, 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, 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, 0x4b, 0x69, 0x73, 0x77, 0x61, 0x68, 0x69,
-0x6c, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 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, 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, 0xc24, 0xc46,
-0xc32, 0xc41, 0xc17, 0xc41, 0xc2d, 0xc3e, 0xc30, 0xc24, 0x20, 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, 0xe7, 0x65, 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, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 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, 0x40e, 0x437, 0x431, 0x435, 0x43a, 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,
-0x43, 0x79, 0x6d, 0x72, 0x61, 0x65, 0x67, 0x59, 0x20, 0x44, 0x65, 0x79, 0x72, 0x6e, 0x61, 0x73, 0x20, 0x55, 0x6e, 0x65,
-0x64, 0x69, 0x67, 0xc8, 0x64, 0xe8, 0x20, 0x59, 0x6f, 0x72, 0xf9, 0x62, 0xe1, 0x4f, 0x72, 0xed, 0x6c, 0x1eb9, 0x301, 0xe8,
-0x64, 0x65, 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, 0x2d, 0x53, 0x6f, 0x75, 0x74,
-0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 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, 0x49, 0x67, 0x62, 0x6f, 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, 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, 0x53, 0x65, 0x6e, 0x65,
-0x67, 0x61, 0x61, 0x6c, 0x4b, 0x61, 0x6d, 0x65, 0x72, 0x75, 0x75, 0x6e, 0x47, 0x69, 0x6e, 0x65, 0x4d, 0x75, 0x72, 0x69,
-0x74, 0x61, 0x6e, 0x69, 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, 0x13a0,
-0x13b9, 0x13f0, 0x13df, 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, 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
+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, 0x75, 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, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x6c, 0x61, 0x6e, 0x64, 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, 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, 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,
+0x57, 0x65, 0x73, 0x74, 0x2d, 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, 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,
+0xc95, 0xca8, 0xccd, 0xca8, 0xca1, 0xcad, 0xcbe, 0xcb0, 0xca4, 0x6a9, 0x672, 0x634, 0x64f, 0x631, 0x6c1, 0x650, 0x646, 0x65b, 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, 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, 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, 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, 0x42, 0x61, 0x68, 0x61, 0x73, 0x61, 0x20,
+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, 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, 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, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 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, 0x6d, 0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x61, 0x73, 0x63, 0x103, 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, 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, 0x4b, 0x69, 0x69,
+0x6e, 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, 0x45, 0x2e, 0x20, 0x55, 0x55, 0x2e, 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, 0x4b, 0x69, 0x6e, 0x67, 0x77, 0x61, 0x6e, 0x61, 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,
+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, 0xc24, 0xc46, 0xc32, 0xc41,
+0xc17, 0xc41, 0xc2d, 0xc3e, 0xc30, 0xc24, 0x20, 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, 0xe7, 0x65, 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, 0x43, 0x79, 0x6d, 0x72, 0x61, 0x65, 0x67,
+0x59, 0x20, 0x44, 0x65, 0x79, 0x72, 0x6e, 0x61, 0x73, 0x20, 0x55, 0x6e, 0x65, 0x64, 0x69, 0x67, 0xc8, 0x64, 0xe8, 0x20,
+0x59, 0x6f, 0x72, 0xf9, 0x62, 0xe1, 0x4f, 0x72, 0xed, 0x6c, 0x1eb9, 0x301, 0xe8, 0x64, 0x65, 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, 0x2d, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63,
+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, 0x49, 0x67, 0x62, 0x6f, 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, 0x53, 0x65, 0x6e, 0x65, 0x67, 0x61, 0x61, 0x6c, 0x4b, 0x61, 0x6d, 0x65, 0x72, 0x75,
+0x75, 0x6e, 0x47, 0x69, 0x6e, 0x65, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 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, 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
};
static const char language_name_list[] =
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index c5519bfabf..edbaaf5d18 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -150,7 +150,7 @@ static QString macTimeToString(const QTime &time, bool short_format)
// See also qtbase/util/local_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(const QString &sys_fmt)
+static QString macToQtFormat(QStringView sys_fmt)
{
QString result;
int i = 0;
@@ -166,7 +166,7 @@ static QString macToQtFormat(const QString &sys_fmt)
}
QChar c = sys_fmt.at(i);
- int repeat = qt_repeatCount(sys_fmt, i);
+ int repeat = qt_repeatCount(sys_fmt.mid(i));
switch (c.unicode()) {
// Qt does not support the following options
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index f7adb021b6..7eb8b7372c 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -254,25 +254,21 @@ public:
return float(d);
}
- double stringToDouble(const QChar *begin, int len, bool *ok,
- QLocale::NumberOptions number_options) const;
- qint64 stringToLongLong(const QChar *begin, int len, int base, bool *ok,
- QLocale::NumberOptions number_options) const;
- quint64 stringToUnsLongLong(const QChar *begin, int len, int base, bool *ok,
- QLocale::NumberOptions number_options) const;
-
- // these functions are used in QIntValidator (QtGui)
- Q_CORE_EXPORT static double bytearrayToDouble(const char *num, bool *ok, bool *overflow = 0);
- Q_CORE_EXPORT static qint64 bytearrayToLongLong(const char *num, int base, bool *ok, bool *overflow = 0);
- Q_CORE_EXPORT static quint64 bytearrayToUnsLongLong(const char *num, int base, bool *ok);
-
- bool numberToCLocale(const QChar *str, int len, QLocale::NumberOptions number_options,
+ double stringToDouble(QStringView str, bool *ok, QLocale::NumberOptions options) const;
+ qint64 stringToLongLong(QStringView str, int base, bool *ok, QLocale::NumberOptions options) const;
+ quint64 stringToUnsLongLong(QStringView str, int base, bool *ok, QLocale::NumberOptions options) const;
+
+ static double bytearrayToDouble(const char *num, bool *ok);
+ // this function is used in QIntValidator (QtGui)
+ Q_CORE_EXPORT static qint64 bytearrayToLongLong(const char *num, int base, bool *ok);
+ static quint64 bytearrayToUnsLongLong(const char *num, int base, bool *ok);
+
+ bool numberToCLocale(QStringView s, QLocale::NumberOptions number_options,
CharBuff *result) const;
inline char digitToCLocale(QChar c) const;
// this function is used in QIntValidator (QtGui)
- Q_CORE_EXPORT bool validateChars(
- const QString &str, NumberMode numMode, QByteArray *buff, int decDigits = -1,
+ Q_CORE_EXPORT bool validateChars(QStringView str, NumberMode numMode, QByteArray *buff, int decDigits = -1,
QLocale::NumberOptions number_options = QLocale::DefaultNumberOptions) const;
public:
@@ -304,6 +300,9 @@ public:
quint16 m_narrow_day_names_idx, m_narrow_day_names_size;
quint16 m_am_idx, m_am_size;
quint16 m_pm_idx, m_pm_size;
+ quint16 m_byte_idx, m_byte_size;
+ quint16 m_byte_si_quantified_idx, m_byte_si_quantified_size;
+ quint16 m_byte_iec_quantified_idx, m_byte_iec_quantified_size;
char m_currency_iso_code[3];
quint16 m_currency_symbol_idx, m_currency_symbol_size;
quint16 m_currency_display_name_idx, m_currency_display_name_size;
@@ -349,23 +348,16 @@ public:
QByteArray bcp47Name(char separator = '-') const;
- // ### QByteArray::fromRawData would be more optimal
- inline QString languageCode() const { return QLocalePrivate::languageToCode(QLocale::Language(m_data->m_language_id)); }
- inline QString scriptCode() const { return QLocalePrivate::scriptToCode(QLocale::Script(m_data->m_script_id)); }
- inline QString countryCode() const { return QLocalePrivate::countryToCode(QLocale::Country(m_data->m_country_id)); }
-
- static QString languageToCode(QLocale::Language language);
- static QString scriptToCode(QLocale::Script script);
- static QString countryToCode(QLocale::Country country);
- static QLocale::Language codeToLanguage(const QChar *code, int len) Q_DECL_NOTHROW;
- static QLocale::Language codeToLanguage(const QString &code) Q_DECL_NOTHROW { return codeToLanguage(code.data(), code.size()); }
- static QLocale::Language codeToLanguage(const QStringRef &code) Q_DECL_NOTHROW { return codeToLanguage(code.data(), code.size()); }
- static QLocale::Script codeToScript(const QChar *code, int len) Q_DECL_NOTHROW;
- static QLocale::Script codeToScript(const QString &code) Q_DECL_NOTHROW { return codeToScript(code.data(), code.size()); }
- static QLocale::Script codeToScript(const QStringRef &code) Q_DECL_NOTHROW { return codeToScript(code.data(), code.size()); }
- static QLocale::Country codeToCountry(const QChar *code, int len) Q_DECL_NOTHROW;
- static QLocale::Country codeToCountry(const QString &code) Q_DECL_NOTHROW { return codeToCountry(code.data(), code.size()); }
- static QLocale::Country codeToCountry(const QStringRef &code) Q_DECL_NOTHROW { return codeToCountry(code.data(), code.size()); }
+ 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)); }
+
+ 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 void getLangAndCountry(const QString &name, QLocale::Language &lang,
QLocale::Script &script, QLocale::Country &cntry);
@@ -373,7 +365,7 @@ public:
static void updateSystemPrivate();
- QString dateTimeToString(const QString &format, const QDateTime &datetime,
+ QString dateTimeToString(QStringView format, const QDateTime &datetime,
const QDate &dateOnly, const QTime &timeOnly,
const QLocale *q) const;
@@ -423,9 +415,9 @@ inline char QLocaleData::digitToCLocale(QChar in) const
return 0;
}
-QString qt_readEscapedFormatString(const QString &format, int *idx);
+QString qt_readEscapedFormatString(QStringView format, int *idx);
bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QString &cntry);
-int qt_repeatCount(const QString &s, int i);
+int qt_repeatCount(QStringView s);
enum { AsciiSpaceMask = (1 << (' ' - 1)) |
(1 << ('\t' - 1)) | // 9: HT - horizontal tab
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 2475859abd..1d80320d8e 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -160,7 +160,7 @@ private:
SubstitutionType substitution();
QString &substituteDigits(QString &string);
- static QString winToQtFormat(const QString &sys_fmt);
+ static QString winToQtFormat(QStringView sys_fmt);
};
Q_GLOBAL_STATIC(QSystemLocalePrivate, systemLocalePrivate)
@@ -680,7 +680,7 @@ void QSystemLocalePrivate::update()
zero = QChar();
}
-QString QSystemLocalePrivate::winToQtFormat(const QString &sys_fmt)
+QString QSystemLocalePrivate::winToQtFormat(QStringView sys_fmt)
{
QString result;
int i = 0;
@@ -696,7 +696,7 @@ QString QSystemLocalePrivate::winToQtFormat(const QString &sys_fmt)
}
QChar c = sys_fmt.at(i);
- int repeat = qt_repeatCount(sys_fmt, i);
+ int repeat = qt_repeatCount(sys_fmt.mid(i));
switch (c.unicode()) {
// Date
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 29534bdeee..afdd30e5c8 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -908,6 +908,61 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyBegin(), lastKey()
*/
+
+/*! \fn QMap::key_value_iterator QMap::keyValueBegin()
+ \since 5.10
+
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first entry
+ in the map.
+
+ \sa keyValueEnd()
+*/
+
+/*! \fn QMap::key_value_iterator QMap::keyValueEnd()
+ \since 5.10
+
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ entry after the last entry in the map.
+
+ \sa keyValueBegin()
+*/
+
+/*! \fn QMap::const_key_value_iterator QMap::keyValueBegin() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry
+ in the map.
+
+ \sa keyValueEnd()
+*/
+
+/*! \fn QMap::const_key_value_iterator QMap::constKeyValueBegin() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry
+ in the map.
+
+ \sa keyValueBegin()
+*/
+
+/*! \fn QMap::const_key_value_iterator QMap::keyValueEnd() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ entry after the last entry in the map.
+
+ \sa keyValueBegin()
+*/
+
+/*! \fn QMap::const_key_value_iterator QMap::constKeyValueEnd() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ entry after the last entry in the map.
+
+ \sa constKeyValueBegin()
+*/
+
/*! \fn const Key &QMap::firstKey() const
\since 5.2
@@ -1782,6 +1837,18 @@ void QMapDataBase::freeData(QMapDataBase *d)
Returns the underlying const_iterator this key_iterator is based on.
*/
+/*! \typedef QMap::key_value_iterator
+ \inmodule QtCore
+ \since 5.10
+ \brief The QMap::key_value_iterator typedef provides an STL-style iterator for QMap and QMultiMap.
+
+ QMap::key_value_iterator is essentially the same as QMap::iterator
+ with the difference that operator*() returns a key/value pair instead of a
+ value.
+
+ \sa QKeyValueIterator
+*/
+
/*! \fn QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
\relates QMap
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 37ed24000d..16442014ff 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -548,6 +548,8 @@ public:
const_iterator base() const { return i; }
};
+ typedef QKeyValueIterator<const Key&, const T&, const_iterator> const_key_value_iterator;
+ typedef QKeyValueIterator<const Key&, T&, iterator> key_value_iterator;
// STL style
inline iterator begin() { detach(); return iterator(d->begin()); }
@@ -560,6 +562,12 @@ public:
inline const_iterator cend() const { return const_iterator(d->end()); }
inline key_iterator keyBegin() const { return key_iterator(begin()); }
inline key_iterator keyEnd() const { return key_iterator(end()); }
+ inline key_value_iterator keyValueBegin() { return key_value_iterator(begin()); }
+ inline key_value_iterator keyValueEnd() { return key_value_iterator(end()); }
+ inline const_key_value_iterator keyValueBegin() const { return const_key_value_iterator(begin()); }
+ inline const_key_value_iterator constKeyValueBegin() const { return const_key_value_iterator(begin()); }
+ inline const_key_value_iterator keyValueEnd() const { return const_key_value_iterator(end()); }
+ inline const_key_value_iterator constKeyValueEnd() const { return const_key_value_iterator(end()); }
iterator erase(iterator it);
// more Qt
@@ -948,7 +956,7 @@ Q_OUTOFLINE_TEMPLATE T QMap<Key, T>::take(const Key &akey)
Node *node = d->findNode(akey);
if (node) {
- T t = node->value;
+ T t = std::move(node->value);
d->deleteNode(node);
return t;
}
diff --git a/src/corelib/tools/qmessageauthenticationcode.cpp b/src/corelib/tools/qmessageauthenticationcode.cpp
index 9a84191452..5dd9591bc6 100644
--- a/src/corelib/tools/qmessageauthenticationcode.cpp
+++ b/src/corelib/tools/qmessageauthenticationcode.cpp
@@ -100,12 +100,16 @@ static int qt_hash_block_size(QCryptographicHash::Algorithm method)
case QCryptographicHash::Sha512:
return SHA512_Message_Block_Size;
case QCryptographicHash::Sha3_224:
+ case QCryptographicHash::Keccak_224:
return 144;
case QCryptographicHash::Sha3_256:
+ case QCryptographicHash::Keccak_256:
return 136;
case QCryptographicHash::Sha3_384:
+ case QCryptographicHash::Keccak_384:
return 104;
case QCryptographicHash::Sha3_512:
+ case QCryptographicHash::Keccak_512:
return 72;
}
return 0;
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index 19ff87b420..3b40055b5a 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -870,7 +870,7 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &r1, const QRectF &r2) Q_DE
Q_DECL_CONSTEXPR inline QRect QRectF::toRect() const Q_DECL_NOTHROW
{
- return QRect(qRound(xp), qRound(yp), qRound(w), qRound(h));
+ 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
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 88b696f53a..86bc99716d 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -871,7 +871,7 @@ struct QRegularExpressionPrivate : QSharedData
CheckSubjectStringOption checkSubjectStringOption = CheckSubjectString,
const QRegularExpressionMatchPrivate *previous = 0) const;
- int captureIndexForName(const QString &name) const;
+ int captureIndexForName(QStringView name) const;
// sizeof(QSharedData) == 4, so start our members with an enum
QRegularExpression::PatternOptions patternOptions;
@@ -1173,14 +1173,14 @@ void QRegularExpressionPrivate::optimizePattern(OptimizePatternOption option)
Returns the capturing group number for the given name. Duplicated names for
capturing groups are not supported.
*/
-int QRegularExpressionPrivate::captureIndexForName(const QString &name) const
+int QRegularExpressionPrivate::captureIndexForName(QStringView name) const
{
Q_ASSERT(!name.isEmpty());
if (!compiledPattern)
return -1;
- int index = pcre2_substring_number_from_name_16(compiledPattern, name.utf16());
+ int index = pcre2_substring_number_from_name_16(compiledPattern, reinterpret_cast<PCRE2_SPTR16>(name.utf16()));
if (index >= 0)
return index;
@@ -2054,11 +2054,12 @@ int QRegularExpressionMatch::lastCapturedIndex() const
}
/*!
- Returns the substring captured by the \a nth capturing group. If the \a nth
- capturing group did not capture a string or doesn't exist, returns a null
- QString.
+ Returns the substring captured by the \a nth capturing group.
- \sa capturedRef(), lastCapturedIndex(), capturedStart(), capturedEnd(),
+ If the \a nth capturing group did not capture a string, or if there is no
+ such capturing group, returns a null QString.
+
+ \sa capturedRef(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(),
capturedLength(), QString::isNull()
*/
QString QRegularExpressionMatch::captured(int nth) const
@@ -2076,10 +2077,11 @@ QString QRegularExpressionMatch::captured(int nth) const
/*!
Returns a reference to the substring captured by the \a nth capturing group.
- If the \a nth capturing group did not capture a string or doesn't exist,
- returns a null QStringRef.
- \sa captured(), lastCapturedIndex(), capturedStart(), capturedEnd(),
+ If the \a nth capturing group did not capture a string, or if there is no
+ such capturing group, returns a null QStringRef.
+
+ \sa captured(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(),
capturedLength(), QStringRef::isNull()
*/
QStringRef QRegularExpressionMatch::capturedRef(int nth) const
@@ -2096,15 +2098,65 @@ QStringRef QRegularExpressionMatch::capturedRef(int nth) const
}
/*!
- Returns the substring captured by the capturing group named \a name. If the
- capturing group named \a name did not capture a string or doesn't exist,
- returns a null QString.
+ \since 5.10
+
+ Returns a view of the substring captured by the \a nth capturing group.
+
+ If the \a nth capturing group did not capture a string, or if there is no
+ such capturing group, returns a null QStringView.
+
+ \sa captured(), capturedRef(), lastCapturedIndex(), capturedStart(), capturedEnd(),
+ capturedLength(), QStringView::isNull()
+*/
+QStringView QRegularExpressionMatch::capturedView(int nth) const
+{
+ return capturedRef(nth);
+}
+
+#if QT_STRINGVIEW_LEVEL < 2
+/*!
+ Returns the substring captured by the capturing group named \a name.
- \sa capturedRef(), capturedStart(), capturedEnd(), capturedLength(),
+ If the named capturing group \a name did not capture a string, or if
+ there is no capturing group named \a name, returns a null QString.
+
+ \sa capturedRef(), capturedView(), capturedStart(), capturedEnd(), capturedLength(),
QString::isNull()
*/
QString QRegularExpressionMatch::captured(const QString &name) const
{
+ return captured(qToStringViewIgnoringNull(name));
+}
+
+/*!
+ Returns a reference to the string captured by the capturing group named \a
+ name.
+
+ If the named capturing group \a name did not capture a string, or if
+ there is no capturing group named \a name, returns a null QStringRef.
+
+ \sa captured(), capturedView(), capturedStart(), capturedEnd(), capturedLength(),
+ QStringRef::isNull()
+*/
+QStringRef QRegularExpressionMatch::capturedRef(const QString &name) const
+{
+ return capturedRef(qToStringViewIgnoringNull(name));
+}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ \since 5.10
+
+ Returns the substring captured by the capturing group named \a name.
+
+ If the named capturing group \a name did not capture a string, or if
+ there is no capturing group named \a name, returns a null QString.
+
+ \sa capturedRef(), capturedView(), capturedStart(), capturedEnd(), capturedLength(),
+ QString::isNull()
+*/
+QString QRegularExpressionMatch::captured(QStringView name) const
+{
if (name.isEmpty()) {
qWarning("QRegularExpressionMatch::captured: empty capturing group name passed");
return QString();
@@ -2116,14 +2168,18 @@ QString QRegularExpressionMatch::captured(const QString &name) const
}
/*!
+ \since 5.10
+
Returns a reference to the string captured by the capturing group named \a
- name. If the capturing group named \a name did not capture a string or
- doesn't exist, returns a null QStringRef.
+ name.
+
+ If the named capturing group \a name did not capture a string, or if
+ there is no capturing group named \a name, returns a null QStringRef.
- \sa captured(), capturedStart(), capturedEnd(), capturedLength(),
+ \sa captured(), capturedView(), capturedStart(), capturedEnd(), capturedLength(),
QStringRef::isNull()
*/
-QStringRef QRegularExpressionMatch::capturedRef(const QString &name) const
+QStringRef QRegularExpressionMatch::capturedRef(QStringView name) const
{
if (name.isEmpty()) {
qWarning("QRegularExpressionMatch::capturedRef: empty capturing group name passed");
@@ -2136,6 +2192,30 @@ QStringRef QRegularExpressionMatch::capturedRef(const QString &name) const
}
/*!
+ \since 5.10
+
+ Returns a view of the string captured by the capturing group named \a
+ name.
+
+ If the named capturing group \a name did not capture a string, or if
+ there is no capturing group named \a name, returns a null QStringView.
+
+ \sa captured(), capturedRef(), capturedStart(), capturedEnd(), capturedLength(),
+ QStringRef::isNull()
+*/
+QStringView QRegularExpressionMatch::capturedView(QStringView name) const
+{
+ if (name.isEmpty()) {
+ qWarning("QRegularExpressionMatch::capturedView: empty capturing group name passed");
+ return QStringView();
+ }
+ int nth = d->regularExpression.d->captureIndexForName(name);
+ if (nth == -1)
+ return QStringView();
+ return capturedView(nth);
+}
+
+/*!
Returns a list of all strings captured by capturing groups, in the order
the groups themselves appear in the pattern string.
*/
@@ -2193,6 +2273,7 @@ int QRegularExpressionMatch::capturedEnd(int nth) const
return d->capturedOffsets.at(nth * 2 + 1);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns the offset inside the subject string corresponding to the starting
position of the substring captured by the capturing group named \a name.
@@ -2203,6 +2284,49 @@ int QRegularExpressionMatch::capturedEnd(int nth) const
*/
int QRegularExpressionMatch::capturedStart(const QString &name) const
{
+ return capturedStart(qToStringViewIgnoringNull(name));
+}
+
+/*!
+ Returns the length of the substring captured by the capturing group named
+ \a name.
+
+ \note This function returns 0 if the capturing group named \a name did not
+ capture a string or doesn't exist.
+
+ \sa capturedStart(), capturedEnd(), captured()
+*/
+int QRegularExpressionMatch::capturedLength(const QString &name) const
+{
+ return capturedLength(qToStringViewIgnoringNull(name));
+}
+
+/*!
+ Returns the offset inside the subject string immediately after the ending
+ position of the substring captured by the capturing group named \a name. If
+ the capturing group named \a name did not capture a string or doesn't
+ exist, returns -1.
+
+ \sa capturedStart(), capturedLength(), captured()
+*/
+int QRegularExpressionMatch::capturedEnd(const QString &name) const
+{
+ return capturedEnd(qToStringViewIgnoringNull(name));
+}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ \since 5.10
+
+ Returns the offset inside the subject string corresponding to the starting
+ position of the substring captured by the capturing group named \a name.
+ If the capturing group named \a name did not capture a string or doesn't
+ exist, returns -1.
+
+ \sa capturedEnd(), capturedLength(), captured()
+*/
+int QRegularExpressionMatch::capturedStart(QStringView name) const
+{
if (name.isEmpty()) {
qWarning("QRegularExpressionMatch::capturedStart: empty capturing group name passed");
return -1;
@@ -2214,15 +2338,17 @@ int QRegularExpressionMatch::capturedStart(const QString &name) const
}
/*!
- Returns the offset inside the subject string corresponding to the starting
- position of the substring captured by the capturing group named \a name.
+ \since 5.10
+
+ Returns the length of the substring captured by the capturing group named
+ \a name.
\note This function returns 0 if the capturing group named \a name did not
capture a string or doesn't exist.
\sa capturedStart(), capturedEnd(), captured()
*/
-int QRegularExpressionMatch::capturedLength(const QString &name) const
+int QRegularExpressionMatch::capturedLength(QStringView name) const
{
if (name.isEmpty()) {
qWarning("QRegularExpressionMatch::capturedLength: empty capturing group name passed");
@@ -2235,6 +2361,8 @@ int QRegularExpressionMatch::capturedLength(const QString &name) const
}
/*!
+ \since 5.10
+
Returns the offset inside the subject string immediately after the ending
position of the substring captured by the capturing group named \a name. If
the capturing group named \a name did not capture a string or doesn't
@@ -2242,7 +2370,7 @@ int QRegularExpressionMatch::capturedLength(const QString &name) const
\sa capturedStart(), capturedLength(), captured()
*/
-int QRegularExpressionMatch::capturedEnd(const QString &name) const
+int QRegularExpressionMatch::capturedEnd(QStringView name) const
{
if (name.isEmpty()) {
qWarning("QRegularExpressionMatch::capturedEnd: empty capturing group name passed");
diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h
index fa1cc5660a..050841e70e 100644
--- a/src/corelib/tools/qregularexpression.h
+++ b/src/corelib/tools/qregularexpression.h
@@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE
+class QStringView;
+
class QRegularExpressionMatch;
class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate;
@@ -197,9 +199,16 @@ public:
QString captured(int nth = 0) const;
QStringRef capturedRef(int nth = 0) const;
+ QStringView capturedView(int nth = 0) const;
+#if QT_STRINGVIEW_LEVEL < 2
QString captured(const QString &name) const;
QStringRef capturedRef(const QString &name) const;
+#endif
+
+ QString captured(QStringView name) const;
+ QStringRef capturedRef(QStringView name) const;
+ QStringView capturedView(QStringView name) const;
QStringList capturedTexts() const;
@@ -207,9 +216,15 @@ public:
int capturedLength(int nth = 0) const;
int capturedEnd(int nth = 0) const;
+#if QT_STRINGVIEW_LEVEL < 2
int capturedStart(const QString &name) const;
int capturedLength(const QString &name) const;
int capturedEnd(const QString &name) const;
+#endif
+
+ int capturedStart(QStringView name) const;
+ int capturedLength(QStringView name) const;
+ int capturedEnd(QStringView name) const;
private:
friend class QRegularExpression;
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index 325b71f267..558a456515 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -159,6 +159,8 @@ private:
qint64 bufferSize;
};
+Q_DECLARE_TYPEINFO(QRingBuffer, Q_MOVABLE_TYPE);
+
QT_END_NAMESPACE
#endif // QRINGBUFFER_P_H
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 0e8eba2a0f..8d84b3beca 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -303,10 +303,10 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QScopedArrayPointer::QScopedArrayPointer(D * p, QtPrivate::QScopedArrayEnsureSameType<T, D>::Type = 0)
- \internal
+ \fn QScopedArrayPointer::QScopedArrayPointer(D * p)
- Constructs a QScopedArrayPointer and stores the array of objects.
+ Constructs a QScopedArrayPointer and stores the array of objects
+ pointed to by \a p.
*/
/*!
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 92d7df6e5d..141a3f8c70 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -215,21 +215,16 @@ template <class T, class Cleanup>
inline void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) Q_DECL_NOTHROW
{ p1.swap(p2); }
-
-namespace QtPrivate {
- template <typename X, typename Y> struct QScopedArrayEnsureSameType;
- template <typename X> struct QScopedArrayEnsureSameType<X,X> { typedef X* Type; };
- template <typename X> struct QScopedArrayEnsureSameType<const X, X> { typedef X* Type; };
-}
-
template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
{
+ template <typename Ptr>
+ using if_same_type = typename std::enable_if<std::is_same<typename std::remove_cv<T>::type, Ptr>::value, bool>::type;
public:
inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(Q_NULLPTR) {}
- template <typename D>
- explicit inline QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = Q_NULLPTR)
+ template <typename D, if_same_type<D> = true>
+ explicit QScopedArrayPointer(D *p)
: QScopedPointer<T, Cleanup>(p)
{
}
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 05f118a9eb..181da4f7de 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -262,7 +262,7 @@
# endif
#endif
-#if defined(__AES__) || defined(__PCLMUL__)
+#if defined(__AES__) || defined(__PCLMUL__) || (defined(QT_COMPILER_SUPPORTS_AES) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS))
# include <wmmintrin.h>
#endif
@@ -287,7 +287,7 @@
#define QT_FUNCTION_TARGET_STRING_PCLMUL "pclmul,sse4.2"
#define QT_FUNCTION_TARGET_STRING_POPCNT "popcnt"
#define QT_FUNCTION_TARGET_STRING_F16C "f16c,avx"
-#define QT_FUNCTION_TARGET_STRING_RDRAND "rdrnd"
+#define QT_FUNCTION_TARGET_STRING_RDRND "rdrnd"
#define QT_FUNCTION_TARGET_STRING_BMI "bmi"
#define QT_FUNCTION_TARGET_STRING_BMI2 "bmi2"
#define QT_FUNCTION_TARGET_STRING_RDSEED "rdseed"
@@ -333,8 +333,6 @@
# include <arm_acle.h>
#endif
-#undef QT_COMPILER_SUPPORTS_SIMD_ALWAYS
-
QT_BEGIN_NAMESPACE
@@ -360,7 +358,7 @@ enum CPUFeatures {
CpuFeatureAES = (0 + 25),
CpuFeatureAVX = (0 + 28),
CpuFeatureF16C = (0 + 29),
- CpuFeatureRDRAND = (0 + 30),
+ CpuFeatureRDRND = (0 + 30),
// 31 is always zero and we've used it for the QSimdInitialized
// in level 7, leaf 0, EBX
@@ -399,7 +397,7 @@ static const quint64 qCompilerCpuFeatures = 0
| (Q_UINT64_C(1) << CpuFeatureRTM)
#endif
#ifdef __RDRND__
- | (Q_UINT64_C(1) << CpuFeatureRDRAND)
+ | (Q_UINT64_C(1) << CpuFeatureRDRND)
#endif
#ifdef __RDSEED__
| (Q_UINT64_C(1) << CpuFeatureRDSEED)
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 941532658b..3826d7531a 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -152,21 +152,19 @@ 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);
-static inline bool qt_starts_with(const QChar *haystack, int haystackLen,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs);
-static inline bool qt_starts_with(const QChar *haystack, int haystackLen,
- QLatin1String needle, Qt::CaseSensitivity cs);
-static inline bool qt_ends_with(const QChar *haystack, int haystackLen,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs);
-static inline bool qt_ends_with(const QChar *haystack, int haystackLen,
- QLatin1String 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);
+static inline bool qt_ends_with(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs);
+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);
#if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)
namespace {
template <uint MaxCount> struct UnrollTailLoop
{
- template <typename RetType, typename Functor1, typename Functor2>
- static inline RetType exec(int count, RetType returnIfExited, Functor1 loopCheck, Functor2 returnIfFailed, int i = 0)
+ template <typename RetType, typename Functor1, typename Functor2, typename Number>
+ static inline RetType exec(Number count, RetType returnIfExited, Functor1 loopCheck, Functor2 returnIfFailed, Number i = 0)
{
/* equivalent to:
* while (count--) {
@@ -188,18 +186,18 @@ template <uint MaxCount> struct UnrollTailLoop
return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
}
- template <typename Functor>
- static inline void exec(int count, Functor code)
+ template <typename Functor, typename Number>
+ static inline void exec(Number count, Functor code)
{
/* equivalent to:
- * for (int i = 0; i < count; ++i)
+ * for (Number i = 0; i < count; ++i)
* code(i);
*/
- exec(count, 0, [=](int i) -> bool { code(i); return false; }, [](int) { return 0; });
+ exec(count, 0, [=](Number i) -> bool { code(i); return false; }, [](Number) { return 0; });
}
};
-template <> template <typename RetType, typename Functor1, typename Functor2>
-inline RetType UnrollTailLoop<0>::exec(int, RetType returnIfExited, Functor1, Functor2, int)
+template <> template <typename RetType, typename Functor1, typename Functor2, typename Number>
+inline RetType UnrollTailLoop<0>::exec(Number, RetType returnIfExited, Functor1, Functor2, Number)
{
return returnIfExited;
}
@@ -374,16 +372,16 @@ static void qt_to_latin1(uchar *dst, const ushort *src, int length)
}
// Unicode case-insensitive comparison
-static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be)
+static int ucstricmp(const QChar *a, const QChar *ae, const QChar *b, const QChar *be)
{
if (a == b)
return (ae - be);
if (a == 0)
- return 1;
+ return be - b;
if (b == 0)
- return -1;
+ return a - ae;
- const ushort *e = ae;
+ const QChar *e = ae;
if (be - b < ae - a)
e = a + (be - b);
@@ -393,7 +391,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const u
// qDebug() << hex << alast << blast;
// qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast);
// qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast);
- int diff = foldCase(*a, alast) - foldCase(*b, blast);
+ int diff = foldCase(a->unicode(), alast) - foldCase(b->unicode(), blast);
if ((diff))
return diff;
++a;
@@ -408,22 +406,19 @@ static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const u
}
// Case-insensitive comparison between a Unicode string and a QLatin1String
-static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b, const uchar *be)
+static int ucstricmp(const QChar *a, const QChar *ae, const char *b, const char *be)
{
- if (a == 0) {
- if (b == 0)
- return 0;
- return 1;
- }
- if (b == 0)
- return -1;
+ if (!a)
+ return be - b;
+ if (!b)
+ return a - ae;
- const ushort *e = ae;
+ auto e = ae;
if (be - b < ae - a)
e = a + (be - b);
while (a < e) {
- int diff = foldCase(*a) - foldCase(*b);
+ int diff = foldCase(a->unicode()) - foldCase(uchar(*b));
if ((diff))
return diff;
++a;
@@ -445,7 +440,7 @@ extern "C" int qt_ucstrncmp_mips_dsp_asm(const ushort *a,
#endif
// Unicode case-sensitive compare two same-sized strings
-static int ucstrncmp(const QChar *a, const QChar *b, int l)
+static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
{
#ifdef __OPTIMIZE_SIZE__
const QChar *end = a + l;
@@ -458,6 +453,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
return 0;
#else
#if defined(__mips_dsp)
+ Q_STATIC_ASSERT(sizeof(uint) == sizeof(size_t));
if (l >= 8) {
return qt_ucstrncmp_mips_dsp_asm(reinterpret_cast<const ushort*>(a),
reinterpret_cast<const ushort*>(b),
@@ -484,13 +480,11 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
- reinterpret_cast<const QChar *>(ptr + distance + idx)->unicode();
}
}
-# if defined(Q_COMPILER_LAMBDA)
- const auto &lambda = [=](int i) -> int {
+ const auto lambda = [=](size_t i) -> int {
return reinterpret_cast<const QChar *>(ptr)[i].unicode()
- reinterpret_cast<const QChar *>(ptr + distance)[i].unicode();
};
return UnrollTailLoop<7>::exec(l, 0, lambda, lambda);
-# endif
#endif
#if defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64) // vaddv is only available on Aarch64
if (l >= 8) {
@@ -511,7 +505,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
}
l &= 7;
}
- const auto &lambda = [=](int i) -> int {
+ const auto lambda = [=](size_t i) -> int {
return a[i].unicode() - b[i].unicode();
};
return UnrollTailLoop<7>::exec(l, 0, lambda, lambda);
@@ -565,7 +559,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
#endif
}
-static int ucstrncmp(const QChar *a, const uchar *c, int l)
+static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
{
const ushort *uc = reinterpret_cast<const ushort *>(a);
const ushort *e = uc + l;
@@ -640,8 +634,8 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
uc += offset;
c += offset;
-# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)
- const auto &lambda = [=](int i) { return uc[i] - ushort(c[i]); };
+# if !defined(__OPTIMIZE_SIZE__)
+ const auto lambda = [=](size_t i) { return uc[i] - ushort(c[i]); };
return UnrollTailLoop<MaxTailLength>::exec(e - uc, 0, lambda, lambda);
# endif
#endif
@@ -656,35 +650,140 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
return 0;
}
+template <typename Number>
+Q_DECL_CONSTEXPR int lencmp(Number lhs, Number rhs) Q_DECL_NOTHROW
+{
+ return lhs == rhs ? 0 :
+ lhs > rhs ? 1 :
+ /* else */ -1 ;
+}
+
// Unicode case-sensitive comparison
-static int ucstrcmp(const QChar *a, int alen, const QChar *b, int blen)
+static int ucstrcmp(const QChar *a, size_t alen, const QChar *b, size_t blen)
{
if (a == b && alen == blen)
return 0;
- int l = qMin(alen, blen);
+ const size_t l = qMin(alen, blen);
int cmp = ucstrncmp(a, b, l);
- return cmp ? cmp : (alen-blen);
+ return cmp ? cmp : lencmp(alen, blen);
}
-// Unicode case-insensitive compare two same-sized strings
-static int ucstrnicmp(const ushort *a, const ushort *b, int l)
+static int ucstrcmp(const QChar *a, size_t alen, const char *b, size_t blen)
{
- return ucstricmp(a, a + l, b, b + l);
+ const size_t l = qMin(alen, blen);
+ const int cmp = ucstrncmp(a, reinterpret_cast<const uchar*>(b), l);
+ return cmp ? cmp : lencmp(alen, blen);
}
-static bool qMemEquals(const quint16 *a, const quint16 *b, int length)
+static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{
- if (a == b || !length)
- return true;
+ if (cs == Qt::CaseSensitive)
+ return ucstrcmp(lhs.begin(), lhs.size(), rhs.begin(), rhs.size());
+ else
+ 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
+{
+ if (cs == Qt::CaseSensitive)
+ return ucstrcmp(lhs.begin(), lhs.size(), rhs.begin(), rhs.size());
+ else
+ return ucstricmp(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
+}
- return ucstrncmp(reinterpret_cast<const QChar *>(a), reinterpret_cast<const QChar *>(b), length) == 0;
+static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return -qt_compare_strings(rhs, lhs, cs);
}
-static int ucstrcmp(const QChar *a, int alen, const uchar *b, int blen)
+static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{
- int l = qMin(alen, blen);
- int cmp = ucstrncmp(a, b, l);
- return cmp ? cmp : (alen-blen);
+ if (lhs.isEmpty())
+ return lencmp(0, rhs.size());
+ const auto l = std::min(lhs.size(), rhs.size());
+ int r;
+ if (cs == Qt::CaseSensitive)
+ r = qstrncmp(lhs.data(), rhs.data(), l);
+ else
+ r = qstrnicmp(lhs.data(), rhs.data(), l);
+ return r ? r : lencmp(lhs.size(), rhs.size());
+}
+
+/*!
+ \relates QStringView
+ \since 5.10
+
+ Returns an integer that compares to 0 as \a lhs compares to \a rhs.
+
+ If \a cs is Qt::CaseSensitive (the default), the comparison is case-sensitive;
+ otherwise the comparison is case-insensitive.
+
+ Case-sensitive comparison is based exclusively on the numeric Unicode values
+ of the characters and is very fast, but is not what a human would expect.
+ Consider sorting user-visible strings with QString::localeAwareCompare().
+
+ \snippet qstring/main.cpp qCompareStrings-QSV-QSV
+*/
+int qCompareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_compare_strings(lhs, rhs, cs);
+}
+
+/*!
+ \relates QStringView
+ \since 5.10
+ \overload
+
+ Returns an integer that compares to 0 as \a lhs compares to \a rhs.
+
+ If \a cs is Qt::CaseSensitive (the default), the comparison is case-sensitive;
+ otherwise the comparison is case-insensitive.
+
+ Case-sensitive comparison is based exclusively on the numeric Unicode values
+ of the characters and is very fast, but is not what a human would expect.
+ Consider sorting user-visible strings with QString::localeAwareCompare().
+*/
+int qCompareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_compare_strings(lhs, rhs, cs);
+}
+
+/*!
+ \relates QStringView
+ \since 5.10
+ \overload
+
+ Returns an integer that compares to 0 as \a lhs compares to \a rhs.
+
+ If \a cs is Qt::CaseSensitive (the default), the comparison is case-sensitive;
+ otherwise the comparison is case-insensitive.
+
+ Case-sensitive comparison is based exclusively on the numeric Unicode values
+ of the characters and is very fast, but is not what a human would expect.
+ Consider sorting user-visible strings with QString::localeAwareCompare().
+*/
+int qCompareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_compare_strings(lhs, rhs, cs);
+}
+
+/*!
+ \relates QStringView
+ \since 5.10
+ \overload
+
+ Returns an integer that compares to 0 as \a lhs compares to \a rhs.
+
+ If \a cs is Qt::CaseSensitive (the default), the comparison is case-sensitive;
+ otherwise the comparison is case-insensitive.
+
+ Case-sensitive comparison is based exclusively on the numeric Latin-1 values
+ of the characters and is very fast, but is not what a human would expect.
+ Consider sorting user-visible strings with QString::localeAwareCompare().
+*/
+int qCompareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_compare_strings(lhs, rhs, cs);
}
/*!
@@ -1502,7 +1601,7 @@ int QString::toUcs4_helper(const ushort *uc, int length, uint *out)
{
int count = 0;
- QStringIterator i(reinterpret_cast<const QChar *>(uc), reinterpret_cast<const QChar *>(uc + length));
+ QStringIterator i(QStringView(uc, length));
while (i.hasNext())
out[count++] = i.next();
@@ -2789,7 +2888,7 @@ bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW
if (s1.d->size != s2.d->size)
return false;
- return qMemEquals(s1.d->data(), s2.d->data(), s1.d->size);
+ return qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
/*!
@@ -2802,10 +2901,7 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
if (d->size != other.size())
return false;
- if (!other.size())
- return isEmpty();
-
- return compare_helper(data(), size(), other, Qt::CaseSensitive) == 0;
+ return qt_compare_strings(*this, other, Qt::CaseSensitive) == 0;
}
/*! \fn bool QString::operator==(const QByteArray &other) const
@@ -2850,8 +2946,9 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
*/
bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW
{
- return ucstrcmp(s1.constData(), s1.length(), s2.constData(), s2.length()) < 0;
+ return qt_compare_strings(s1, s2, Qt::CaseSensitive) < 0;
}
+
/*!
\overload operator<()
@@ -2860,11 +2957,7 @@ bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW
*/
bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
{
- const uchar *c = (const uchar *) other.latin1();
- if (!c || *c == 0)
- return false;
-
- return compare_helper(data(), size(), other, Qt::CaseSensitive) < 0;
+ return qt_compare_strings(*this, other, Qt::CaseSensitive) < 0;
}
/*! \fn bool QString::operator<(const QByteArray &other) const
@@ -2965,11 +3058,7 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
*/
bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
{
- const uchar *c = (const uchar *) other.latin1();
- if (!c || *c == '\0')
- return !isEmpty();
-
- return compare_helper(data(), size(), other, Qt::CaseSensitive) > 0;
+ return qt_compare_strings(*this, other, Qt::CaseSensitive) > 0;
}
/*! \fn bool QString::operator>(const QByteArray &other) const
@@ -3166,11 +3255,12 @@ int qFindString(
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
- ucstrncmp() or ucstrnicmp().
+ qt_string_compare().
*/
const ushort *needle = (const ushort *)needle0;
const ushort *haystack = (const ushort *)haystack0 + from;
@@ -3189,7 +3279,7 @@ int qFindString(
while (haystack <= end) {
hashHaystack += haystack[sl_minus_1];
if (hashHaystack == hashNeedle
- && ucstrncmp((const QChar *)needle, (const QChar *)haystack, sl) == 0)
+ && qt_compare_strings(sv(needle), sv(haystack), Qt::CaseSensitive) == 0)
return haystack - (const ushort *)haystack0;
REHASH(*haystack);
@@ -3205,7 +3295,8 @@ int qFindString(
while (haystack <= end) {
hashHaystack += foldCase(haystack + sl_minus_1, haystack_start);
- if (hashHaystack == hashNeedle && ucstrnicmp(needle, haystack, sl) == 0)
+ if (hashHaystack == hashNeedle
+ && qt_compare_strings(sv(needle), sv(haystack), Qt::CaseInsensitive) == 0)
return haystack - (const ushort *)haystack0;
REHASH(foldCase(haystack, haystack_start));
@@ -3250,6 +3341,8 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee
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;
@@ -3268,7 +3361,7 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee
while (haystack >= end) {
hashHaystack += *haystack;
if (hashHaystack == hashNeedle
- && ucstrncmp((const QChar *)needle, (const QChar *)haystack, sl) == 0)
+ && qt_compare_strings(sv(needle), sv(haystack), Qt::CaseSensitive) == 0)
return haystack - end;
--haystack;
REHASH(haystack[sl]);
@@ -3282,7 +3375,8 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee
while (haystack >= end) {
hashHaystack += foldCase(haystack, end);
- if (hashHaystack == hashNeedle && ucstrnicmp(needle, haystack, sl) == 0)
+ if (hashHaystack == hashNeedle
+ && qt_compare_strings(sv(haystack), sv(needle), Qt::CaseInsensitive) == 0)
return haystack - end;
--haystack;
REHASH(foldCase(haystack + sl, end));
@@ -4366,7 +4460,7 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti
\snippet qstring/main.cpp 31
- \sa right(), mid(), startsWith()
+ \sa right(), mid(), startsWith(), chopped(), chop(), truncate()
*/
QString QString::left(int n) const
{
@@ -4384,7 +4478,7 @@ QString QString::left(int n) const
\snippet qstring/main.cpp 48
- \sa left(), mid(), endsWith()
+ \sa left(), mid(), endsWith(), chopped(), chop(), truncate()
*/
QString QString::right(int n) const
{
@@ -4407,7 +4501,7 @@ QString QString::right(int n) const
\snippet qstring/main.cpp 34
- \sa left(), right()
+ \sa left(), right(), chopped(), chop(), truncate()
*/
QString QString::mid(int position, int n) const
@@ -4431,6 +4525,19 @@ QString QString::mid(int position, int n) const
}
/*!
+ \fn QString::chopped(int len) const
+ \since 5.10
+
+ Returns a substring that contains the size() - \a len leftmost characters
+ of this string.
+
+ \note The behavior is undefined if \a len is negative or greater than size().
+
+ \sa endsWith(), left(), right(), mid(), chop(), truncate()
+*/
+
+#if QT_STRINGVIEW_LEVEL < 2
+/*!
Returns \c true if the string starts with \a s; otherwise returns
\c false.
@@ -4443,16 +4550,16 @@ QString QString::mid(int position, int n) const
*/
bool QString::startsWith(const QString& s, Qt::CaseSensitivity cs) const
{
- return qt_starts_with(isNull() ? 0 : unicode(), size(),
- s.isNull() ? 0 : s.unicode(), s.size(), cs);
+ return qt_starts_with(*this, s, cs);
}
+#endif
/*!
\overload startsWith()
*/
bool QString::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const
{
- return qt_starts_with(isNull() ? 0 : unicode(), size(), s, cs);
+ return qt_starts_with(*this, s, cs);
}
/*!
@@ -4463,12 +4570,10 @@ bool QString::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const
*/
bool QString::startsWith(QChar c, Qt::CaseSensitivity cs) const
{
- return d->size
- && (cs == Qt::CaseSensitive
- ? d->data()[0] == c
- : foldCase(d->data()[0]) == foldCase(c.unicode()));
+ return qt_starts_with(*this, c, cs);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
\overload
@@ -4482,10 +4587,25 @@ bool QString::startsWith(QChar c, Qt::CaseSensitivity cs) const
*/
bool QString::startsWith(const QStringRef &s, Qt::CaseSensitivity cs) const
{
- return qt_starts_with(isNull() ? 0 : unicode(), size(),
- s.isNull() ? 0 : s.unicode(), s.size(), cs);
+ return qt_starts_with(*this, s, cs);
}
+#endif
+
+/*!
+ \fn bool QString::startsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \overload
+
+ Returns \c true if the string starts with 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 endsWith()
+*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns \c true if the string ends with \a s; otherwise returns
\c false.
@@ -4499,8 +4619,7 @@ bool QString::startsWith(const QStringRef &s, Qt::CaseSensitivity cs) const
*/
bool QString::endsWith(const QString &s, Qt::CaseSensitivity cs) const
{
- return qt_ends_with(isNull() ? 0 : unicode(), size(),
- s.isNull() ? 0 : s.unicode(), s.size(), cs);
+ return qt_ends_with(*this, s, cs);
}
/*!
@@ -4516,17 +4635,29 @@ bool QString::endsWith(const QString &s, Qt::CaseSensitivity cs) const
*/
bool QString::endsWith(const QStringRef &s, Qt::CaseSensitivity cs) const
{
- return qt_ends_with(isNull() ? 0 : unicode(), size(),
- s.isNull() ? 0 : s.unicode(), s.size(), cs);
+ return qt_ends_with(*this, s, cs);
}
+#endif // QT_STRINGVIEW_LEVEL < 2
+/*!
+ \fn bool QString::endsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \overload endsWith()
+ Returns \c true if the string ends with 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 startsWith()
+*/
/*!
\overload endsWith()
*/
bool QString::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const
{
- return qt_ends_with(isNull() ? 0 : unicode(), size(), s, cs);
+ return qt_ends_with(*this, s, cs);
}
/*!
@@ -4537,35 +4668,54 @@ bool QString::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const
*/
bool QString::endsWith(QChar c, Qt::CaseSensitivity cs) const
{
- return d->size
- && (cs == Qt::CaseSensitive
- ? d->data()[d->size - 1] == c
- : foldCase(d->data()[d->size - 1]) == foldCase(c.unicode()));
+ return qt_ends_with(*this, c, cs);
}
+static QByteArray qt_convert_to_latin1(QStringView string);
+
QByteArray QString::toLatin1_helper(const QString &string)
{
- if (Q_UNLIKELY(string.isNull()))
- return QByteArray();
-
- return toLatin1_helper(string.constData(), string.length());
+ return qt_convert_to_latin1(string);
}
QByteArray QString::toLatin1_helper(const QChar *data, int length)
{
- QByteArray ba(length, Qt::Uninitialized);
+ return qt_convert_to_latin1(QStringView(data, length));
+}
+
+/*!
+ \since 5.10
+ \relates QStringView
+
+ Returns a Latin-1 representation of \a string as a QByteArray.
+
+ The behavior is undefined if \a string contains non-Latin1 characters.
+
+ \sa QString::toLatin1(), QStringView::toLatin1(), qConvertToUtf8(), qConvertToLocal8Bit(), qConvertToUcs4()
+*/
+QByteArray qConvertToLatin1(QStringView string)
+{
+ return qt_convert_to_latin1(string);
+}
+
+static QByteArray qt_convert_to_latin1(QStringView string)
+{
+ if (Q_UNLIKELY(string.isNull()))
+ return QByteArray();
+
+ QByteArray ba(string.length(), Qt::Uninitialized);
// since we own the only copy, we're going to const_cast the constData;
// that avoids an unnecessary call to detach() and expansion code that will never get used
qt_to_latin1(reinterpret_cast<uchar *>(const_cast<char *>(ba.constData())),
- reinterpret_cast<const ushort *>(data), length);
+ reinterpret_cast<const ushort *>(string.data()), string.length());
return ba;
}
QByteArray QString::toLatin1_helper_inplace(QString &s)
{
if (!s.isDetached())
- return s.toLatin1();
+ return qt_convert_to_latin1(s);
// We can return our own buffer to the caller.
// Conversion to Latin-1 always shrinks the buffer by half.
@@ -4601,7 +4751,7 @@ QByteArray QString::toLatin1_helper_inplace(QString &s)
characters. Those characters may be suppressed or replaced with a
question mark.
- \sa fromLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
+ \sa fromLatin1(), toUtf8(), toLocal8Bit(), QTextCodec, qConvertToLatin1()
*/
/*!
@@ -4617,6 +4767,8 @@ QByteArray QString::toLatin1_helper_inplace(QString &s)
\sa fromAscii(), toLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
*/
+static QByteArray qt_convert_to_local_8bit(QStringView string);
+
/*!
\fn QByteArray QString::toLocal8Bit() const
@@ -4632,21 +4784,47 @@ QByteArray QString::toLatin1_helper_inplace(QString &s)
locale, the returned byte array is undefined. Those characters may be
suppressed or replaced by another.
- \sa fromLocal8Bit(), toLatin1(), toUtf8(), QTextCodec
+ \sa fromLocal8Bit(), toLatin1(), toUtf8(), QTextCodec, qConvertToLocal8Bit()
*/
QByteArray QString::toLocal8Bit_helper(const QChar *data, int size)
{
- if (!data)
+ return qt_convert_to_local_8bit(QStringView(data, size));
+}
+
+static QByteArray qt_convert_to_local_8bit(QStringView string)
+{
+ if (string.isNull())
return QByteArray();
#ifndef QT_NO_TEXTCODEC
QTextCodec *localeCodec = QTextCodec::codecForLocale();
if (localeCodec)
- return localeCodec->fromUnicode(data, size);
+ return localeCodec->fromUnicode(string);
#endif // QT_NO_TEXTCODEC
- return toLatin1_helper(data, size);
+ return qt_convert_to_latin1(string);
}
+/*!
+ \since 5.10
+ \relates QStringView
+
+ Returns a local 8-bit representation of \a string as a QByteArray.
+
+ QTextCodec::codecForLocale() is used to perform the conversion from
+ Unicode. If the locale's encoding could not be determined, this function
+ does the same as qConvertToLatin1().
+
+ The behavior is undefined if \a string contains characters not
+ supported by the locale's 8-bit encoding.
+
+ \sa QString::toLocal8Bit(), QStringView::toLocal8Bit(), qConvertToLatin1(), qConvertToUtf8(), qConvertToUcs4()
+*/
+QByteArray qConvertToLocal8Bit(QStringView string)
+{
+ return qt_convert_to_local_8bit(string);
+}
+
+static QByteArray qt_convert_to_utf8(QStringView str);
/*!
\fn QByteArray QString::toUtf8() const
@@ -4656,18 +4834,41 @@ QByteArray QString::toLocal8Bit_helper(const QChar *data, int size)
UTF-8 is a Unicode codec and can represent all characters in a Unicode
string like QString.
- \sa fromUtf8(), toLatin1(), toLocal8Bit(), QTextCodec
+ \sa fromUtf8(), toLatin1(), toLocal8Bit(), QTextCodec, qConvertToUtf8()
*/
QByteArray QString::toUtf8_helper(const QString &str)
{
+ return qt_convert_to_utf8(str);
+}
+
+static QByteArray qt_convert_to_utf8(QStringView str)
+{
if (str.isNull())
return QByteArray();
- return QUtf8::convertFromUnicode(str.constData(), str.length());
+ return QUtf8::convertFromUnicode(str.data(), str.length());
}
/*!
+ \since 5.10
+ \relates QStringView
+
+ Returns a UTF-8 representation of \a string as a QByteArray.
+
+ UTF-8 is a Unicode codec and can represent all characters in a Unicode
+ string like QStringView.
+
+ \sa QString::toUtf8(), QStringView::toUtf8(), qConvertToLatin1(), qConvertToLocal8Bit(), qConvertToUcs4()
+*/
+QByteArray qConvertToUtf8(QStringView string)
+{
+ return qt_convert_to_utf8(string);
+}
+
+static QVector<uint> qt_convert_to_ucs4(QStringView string);
+
+/*!
\since 4.2
Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
@@ -4679,17 +4880,44 @@ QByteArray QString::toUtf8_helper(const QString &str)
The returned vector is not NUL terminated.
- \sa fromUtf8(), toUtf8(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray()
+ \sa fromUtf8(), toUtf8(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray(), qConvertToUcs4()
*/
QVector<uint> QString::toUcs4() const
{
- QVector<uint> v(length());
- uint *a = v.data();
- int len = toUcs4_helper(d->data(), length(), a);
- v.resize(len);
+ return qt_convert_to_ucs4(*this);
+}
+
+static QVector<uint> qt_convert_to_ucs4(QStringView string)
+{
+ QVector<uint> v(string.length());
+ uint *a = const_cast<uint*>(v.constData());
+ QStringIterator it(string);
+ while (it.hasNext())
+ *a++ = it.next();
+ v.resize(a - v.constData());
return v;
}
+/*!
+ \since 5.10
+ \relates QStringView
+
+ Returns a UCS-4/UTF-32 representation of \a string as a QVector<uint>.
+
+ UCS-4 is a Unicode codec and therefore it is lossless. All characters from
+ this string will be encoded in UCS-4. Any invalid sequence of code units in
+ this string is replaced by the Unicode's replacement character
+ (QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
+
+ The returned vector is not NUL terminated.
+
+ \sa QString::toUcs4(), QStringView::toUcs4(), qConvertToLatin1(), qConvertToLocal8Bit(), qConvertToUtf8()
+*/
+QVector<uint> qConvertToUcs4(QStringView string)
+{
+ return qt_convert_to_ucs4(string);
+}
+
QString::Data *QString::fromLatin1_helper(const char *str, int size)
{
Data *d;
@@ -4980,6 +5208,41 @@ QString QString::simplified_helper(QString &str)
return QStringAlgorithms<QString>::simplified_helper(str);
}
+namespace {
+ template <typename StringView>
+ StringView qt_trimmed(StringView s) Q_DECL_NOTHROW
+ {
+ auto begin = s.begin();
+ auto end = s.end();
+ QStringAlgorithms<const StringView>::trimmed_helper_positions(begin, end);
+ return StringView{begin, end};
+ }
+}
+
+/*!
+ \fn QStringView qTrimmed(QStringView s)
+ \fn QLatin1String qTrimmed(QLatin1String s)
+ \relates QStringView
+ \since 5.10
+
+ Returns \a s with whitespace removed from the start and the end.
+
+ Whitespace means any character for which QChar::isSpace() returns
+ \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
+ '\\f', '\\r', and ' '.
+
+ \sa QString::trimmed(), QStringView::trimmed(), QLatin1String::trimmed()
+*/
+QStringView qTrimmed(QStringView s) Q_DECL_NOTHROW
+{
+ return qt_trimmed(s);
+}
+
+QLatin1String qTrimmed(QLatin1String s) Q_DECL_NOTHROW
+{
+ return qt_trimmed(s);
+}
+
/*!
\fn QString QString::trimmed() const
@@ -5057,6 +5320,66 @@ modifiable reference.
*/
/*!
+ \fn QChar QString::front() const
+ \since 5.10
+
+ Returns the first character in the string.
+ Same as \c{at(0)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa back(), at(), operator[]()
+*/
+
+/*!
+ \fn QChar QString::back() const
+ \since 5.10
+
+ Returns the last character in the string.
+ Same as \c{at(size() - 1)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa front(), at(), operator[]()
+*/
+
+/*!
+ \fn QCharRef QString::front()
+ \since 5.10
+
+ Returns a reference to the first character in the string.
+ Same as \c{operator[](0)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa back(), at(), operator[]()
+*/
+
+/*!
+ \fn QCharRef QString::back()
+ \since 5.10
+
+ Returns a reference to the last character in the string.
+ Same as \c{operator[](size() - 1)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa front(), at(), operator[]()
+*/
+
+/*!
\fn void QString::truncate(int position)
Truncates the string at the given \a position index.
@@ -5277,7 +5600,7 @@ QString& QString::fill(QChar ch, int size)
Equivalent to \c {s1 != 0 && compare(s1, s2) == 0}.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -5290,7 +5613,7 @@ QString& QString::fill(QChar ch, int size)
For \a s1 != 0, this is equivalent to \c {compare(} \a s1, \a s2
\c {) != 0}. Note that no string is equal to \a s1 being 0.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -5306,7 +5629,7 @@ QString& QString::fill(QChar ch, int size)
expect. Consider sorting user-interface strings using the
QString::localeAwareCompare() function.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -5322,7 +5645,7 @@ QString& QString::fill(QChar ch, int size)
expect. Consider sorting user-interface strings with
QString::localeAwareCompare().
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -5337,7 +5660,7 @@ QString& QString::fill(QChar ch, int size)
expect. Consider sorting user-interface strings using the
QString::localeAwareCompare() function.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -5418,7 +5741,7 @@ QString& QString::fill(QChar ch, int size)
\snippet qstring/main.cpp 16
- \sa operator==(), operator<(), operator>()
+ \sa qCompareStrings(), operator==(), operator<(), operator>()
*/
/*!
@@ -5428,6 +5751,8 @@ QString& QString::fill(QChar ch, int size)
Performs a comparison of \a s1 and \a s2, using the case
sensitivity setting \a cs.
+
+ \sa qCompareStrings()
*/
/*!
@@ -5438,6 +5763,8 @@ QString& QString::fill(QChar ch, int size)
Performs a comparison of \a s1 and \a s2, using the case
sensitivity setting \a cs.
+
+ \sa qCompareStrings()
*/
@@ -5451,12 +5778,12 @@ QString& QString::fill(QChar ch, int size)
string.
Same as compare(*this, \a other, \a cs).
+
+ \sa qCompareStrings()
*/
int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
{
- if (cs == Qt::CaseSensitive)
- return ucstrcmp(constData(), length(), other.constData(), other.length());
- return ucstricmp(d->data(), d->data() + d->size, other.d->data(), other.d->data() + other.d->size);
+ return qt_compare_strings(*this, other, cs);
}
/*!
@@ -5466,11 +5793,11 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_
int QString::compare_helper(const QChar *data1, int length1, const QChar *data2, int length2,
Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{
- if (cs == Qt::CaseSensitive)
- return ucstrcmp(data1, length1, data2, length2);
- const ushort *s1 = reinterpret_cast<const ushort *>(data1);
- const ushort *s2 = reinterpret_cast<const ushort *>(data2);
- return ucstricmp(s1, s1 + length1, s2, s2 + length2);
+ Q_ASSERT(length1 >= 0);
+ Q_ASSERT(length2 >= 0);
+ Q_ASSERT(data1 || length1 == 0);
+ Q_ASSERT(data2 || length2 == 0);
+ return qt_compare_strings(QStringView(data1, length1), QStringView(data2, length2), cs);
}
/*!
@@ -5478,10 +5805,12 @@ int QString::compare_helper(const QChar *data1, int length1, const QChar *data2,
\since 4.2
Same as compare(*this, \a other, \a cs).
+
+ \sa qCompareStrings()
*/
int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
{
- return compare_helper(unicode(), length(), other, cs);
+ return qt_compare_strings(*this, other, cs);
}
/*!
@@ -5491,6 +5820,8 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N
Compares the string reference, \a ref, with the string and returns
an integer less than, equal to, or greater than zero if the string
is less than, equal to, or greater than \a ref.
+
+ \sa qCompareStrings()
*/
/*!
@@ -5500,6 +5831,8 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N
int QString::compare_helper(const QChar *data1, int length1, const char *data2, int length2,
Qt::CaseSensitivity cs)
{
+ Q_ASSERT(length1 >= 0);
+ Q_ASSERT(data1 || length1 == 0);
if (!data2)
return length1;
if (Q_UNLIKELY(length2 < 0))
@@ -5508,12 +5841,14 @@ int QString::compare_helper(const QChar *data1, int length1, const char *data2,
QVarLengthArray<ushort> s2(length2);
const auto beg = reinterpret_cast<QChar *>(s2.data());
const auto end = QUtf8::convertToUnicode(beg, data2, length2);
- return compare_helper(data1, length1, beg, end - beg, cs);
+ return qt_compare_strings(QStringView(data1, length1), QStringView(beg, end - beg), cs);
}
/*!
\fn int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
\overload compare()
+
+ \sa qCompareStrings()
*/
/*!
@@ -5523,18 +5858,9 @@ int QString::compare_helper(const QChar *data1, int length1, const char *data2,
int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2,
Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{
- const ushort *uc = reinterpret_cast<const ushort *>(data1);
- const ushort *uce = uc + length1;
- const uchar *c = (const uchar *)s2.latin1();
-
- if (!c)
- return length1;
-
- if (cs == Qt::CaseSensitive) {
- return ucstrcmp(data1, length1, c, s2.size());
- } else {
- return ucstricmp(uc, uce, c, c + s2.size());
- }
+ Q_ASSERT(length1 >= 0);
+ Q_ASSERT(data1 || length1 == 0);
+ return qt_compare_strings(QStringView(data1, length1), s2, cs);
}
/*!
@@ -5620,9 +5946,15 @@ Q_GLOBAL_STATIC(QThreadStorage<QCollator>, defaultCollator)
int QString::localeAwareCompare_helper(const QChar *data1, int length1,
const QChar *data2, int length2)
{
+ Q_ASSERT(length1 >= 0);
+ Q_ASSERT(data1 || length1 == 0);
+ Q_ASSERT(length2 >= 0);
+ Q_ASSERT(data2 || length2 == 0);
+
// do the right thing for null and empty
if (length1 == 0 || length2 == 0)
- return ucstrcmp(data1, length1, data2, length2);
+ return qt_compare_strings(QStringView(data1, length1), QStringView(data2, length2),
+ Qt::CaseSensitive);
#if defined(Q_OS_WIN)
# ifndef Q_OS_WINRT
@@ -5663,10 +5995,12 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1,
// declared in <string.h>
int delta = strcoll(toLocal8Bit_helper(data1, length1).constData(), toLocal8Bit_helper(data2, length2).constData());
if (delta == 0)
- delta = ucstrcmp(data1, length1, data2, length2);
+ delta = qt_compare_strings(QStringView(data1, length1), QStringView(data2, length2),
+ Qt::CaseSensitive);
return delta;
#else
- return ucstrcmp(data1, length1, data2, length2);
+ return qt_compare_strings(QStringView(data1, length1), QStringView(data2, length2),
+ Qt::CaseSensitive);
#endif
}
@@ -6363,7 +6697,7 @@ qlonglong QString::toIntegral_helper(const QChar *data, int len, bool *ok, int b
}
#endif
- return QLocaleData::c()->stringToLongLong(data, len, base, ok, QLocale::RejectGroupSeparator);
+ return QLocaleData::c()->stringToLongLong(QStringView(data, len), base, ok, QLocale::RejectGroupSeparator);
}
@@ -6403,7 +6737,7 @@ qulonglong QString::toIntegral_helper(const QChar *data, uint len, bool *ok, int
}
#endif
- return QLocaleData::c()->stringToUnsLongLong(data, len, base, ok,
+ return QLocaleData::c()->stringToUnsLongLong(QStringView(data, len), base, ok,
QLocale::RejectGroupSeparator);
}
@@ -6605,7 +6939,7 @@ ushort QString::toUShort(bool *ok, int base) const
double QString::toDouble(bool *ok) const
{
- return QLocaleData::c()->stringToDouble(constData(), size(), ok, QLocale::RejectGroupSeparator);
+ return QLocaleData::c()->stringToDouble(*this, ok, QLocale::RejectGroupSeparator);
}
/*!
@@ -7263,10 +7597,10 @@ struct ArgEscapeData
int escape_len; // total length of escape sequences which will be replaced
};
-static ArgEscapeData findArgEscapes(const QString &s)
+static ArgEscapeData findArgEscapes(QStringView s)
{
- const QChar *uc_begin = s.unicode();
- const QChar *uc_end = uc_begin + s.length();
+ const QChar *uc_begin = s.begin();
+ const QChar *uc_end = s.end();
ArgEscapeData d;
@@ -7325,11 +7659,11 @@ static ArgEscapeData findArgEscapes(const QString &s)
return d;
}
-static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int field_width,
- const QString &arg, const QString &larg, QChar fillChar = QLatin1Char(' '))
+static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, int field_width,
+ QStringView arg, QStringView larg, QChar fillChar)
{
- const QChar *uc_begin = s.unicode();
- const QChar *uc_end = uc_begin + s.length();
+ const QChar *uc_begin = s.begin();
+ const QChar *uc_end = s.end();
int abs_field_width = qAbs(field_width);
int result_len = s.length()
@@ -7393,11 +7727,11 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
}
if (locale_arg) {
- memcpy(rc, larg.unicode(), larg.length()*sizeof(QChar));
+ memcpy(rc, larg.data(), larg.length()*sizeof(QChar));
rc += larg.length();
}
else {
- memcpy(rc, arg.unicode(), arg.length()*sizeof(QChar));
+ memcpy(rc, arg.data(), arg.length()*sizeof(QChar));
rc += arg.length();
}
@@ -7419,6 +7753,7 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
return result;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a copy of this string with the lowest numbered place marker
replaced by string \a a, i.e., \c %1, \c %2, ..., \c %99.
@@ -7450,17 +7785,86 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
*/
QString QString::arg(const QString &a, int fieldWidth, QChar fillChar) const
{
+ return arg(qToStringViewIgnoringNull(a), fieldWidth, fillChar);
+}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ \overload
+ \since 5.10
+
+ Returns a copy of this string with the lowest-numbered place-marker
+ replaced by string \a a, i.e., \c %1, \c %2, ..., \c %99.
+
+ \a fieldWidth specifies the minimum amount of space that \a a
+ shall occupy. If \a a requires less space than \a fieldWidth, it
+ is padded to \a fieldWidth with character \a fillChar. A positive
+ \a fieldWidth produces right-aligned text. A negative \a fieldWidth
+ produces left-aligned text.
+
+ This example shows how we might create a \c status string for
+ reporting progress while processing a list of files:
+
+ \snippet qstring/main.cpp 11-qstringview
+
+ First, \c arg(i) replaces \c %1. Then \c arg(total) replaces \c
+ %2. Finally, \c arg(fileName) replaces \c %3.
+
+ One advantage of using arg() over asprintf() is that the order of the
+ numbered place markers can change, if the application's strings are
+ translated into other languages, but each arg() will still replace
+ the lowest-numbered unreplaced place-marker, no matter where it
+ appears. Also, if place-marker \c %i appears more than once in the
+ string, arg() replaces all of them.
+
+ If there is no unreplaced place-marker remaining, a warning message
+ is printed and the result is undefined. Place-marker numbers must be
+ in the range 1 to 99.
+*/
+QString QString::arg(QStringView a, int fieldWidth, QChar fillChar) const
+{
ArgEscapeData d = findArgEscapes(*this);
- if (d.occurrences == 0) {
- qWarning("QString::arg: Argument missing: %s, %s", toLocal8Bit().data(),
- a.toLocal8Bit().data());
+ if (Q_UNLIKELY(d.occurrences == 0)) {
+ qWarning("QString::arg: Argument missing: %ls, %ls", qUtf16Printable(*this),
+ qUtf16Printable(a.toString()));
return *this;
}
return replaceArgEscapes(*this, d, fieldWidth, a, a, fillChar);
}
/*!
+ \overload
+ \since 5.10
+
+ Returns a copy of this string with the lowest-numbered place-marker
+ replaced by string \a a, i.e., \c %1, \c %2, ..., \c %99.
+
+ \a fieldWidth specifies the minimum amount of space that \a a
+ shall occupy. If \a a requires less space than \a fieldWidth, it
+ is padded to \a fieldWidth with character \a fillChar. A positive
+ \a fieldWidth produces right-aligned text. A negative \a fieldWidth
+ produces left-aligned text.
+
+ One advantage of using arg() over asprintf() is that the order of the
+ numbered place markers can change, if the application's strings are
+ translated into other languages, but each arg() will still replace
+ the lowest-numbered unreplaced place-marker, no matter where it
+ appears. Also, if place-marker \c %i appears more than once in the
+ string, arg() replaces all of them.
+
+ If there is no unreplaced place-marker remaining, a warning message
+ is printed and the result is undefined. Place-marker numbers must be
+ in the range 1 to 99.
+*/
+QString QString::arg(QLatin1String a, int fieldWidth, QChar fillChar) const
+{
+ QVarLengthArray<ushort> utf16(a.size());
+ qt_from_latin1(utf16.data(), a.data(), a.size());
+ return arg(QStringView(utf16.data(), utf16.size()), fieldWidth, fillChar);
+}
+
+/*!
\fn QString QString::arg(const QString& a1, const QString& a2) const
\overload arg()
@@ -8139,6 +8543,15 @@ bool QString::isRightToLeft() const
Appends the given \a ch character onto the end of this string.
*/
+/*! \fn void QString::shrink_to_fit()
+ \since 5.10
+
+ This function is provided for STL compatibility. It is
+ equivalent to squeeze().
+
+ \sa squeeze()
+*/
+
/*!
\fn std::string QString::toStdString() const
@@ -8316,6 +8729,76 @@ QString &QString::setRawData(const QChar *unicode, int size)
\sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}
*/
+/*!
+ \typedef QLatin1String::value_type
+ \since 5.10
+
+ Alias for \c{const char}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QLatin1String::difference_type
+ \since 5.10
+
+ Alias for \c{int}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QLatin1String::size_type
+ \since 5.10
+
+ Alias for \c{int}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QLatin1String::reference
+ \since 5.10
+
+ Alias for \c{value_type &}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QLatin1String::iterator
+ \since 5.10
+
+ This typedef provides an STL-style const iterator for QLatin1String.
+
+ QLatin1String does not support mutable iterators, so this is the same
+ as const_iterator.
+
+ \sa const_iterator, reverse_iterator
+*/
+
+/*!
+ \typedef QLatin1String::const_iterator
+ \since 5.10
+
+ This typedef provides an STL-style const iterator for QLatin1String.
+
+ \sa iterator, const_reverse_iterator
+*/
+
+/*!
+ \typedef QLatin1String::reverse_iterator
+ \since 5.10
+
+ This typedef provides an STL-style const reverse iterator for QLatin1String.
+
+ QLatin1String does not support mutable reverse iterators, so this is the
+ same as const_reverse_iterator.
+
+ \sa const_reverse_iterator, iterator
+*/
+
+/*!
+ \typedef QLatin1String::const_reverse_iterator
+ \since 5.10
+
+ This typedef provides an STL-style const reverse iterator for QLatin1String.
+
+ \sa reverse_iterator, const_iterator
+*/
+
/*! \fn QLatin1String::QLatin1String()
\since 5.6
@@ -8344,6 +8827,24 @@ QString &QString::setRawData(const QChar *unicode, int size)
\sa latin1()
*/
+/*!
+ \fn QLatin1String::QLatin1String(const char *first, const char *last)
+ \since 5.10
+
+ Constructs a QLatin1String object that stores \a first with length
+ (\a last - \a first).
+
+ The range \c{[first,last)} must remain valid for the lifetime of
+ this Latin-1 string object.
+
+ Passing \c nullptr as \a first is safe if \a last is \c nullptr,
+ too, and results in a null Latin-1 string.
+
+ The behavior is undefined if \a last precedes \a first, \a first
+ is \c nullptr and \a last is not, or if \c{last - first >
+ INT_MAX}.
+*/
+
/*! \fn QLatin1String::QLatin1String(const QByteArray &str)
Constructs a QLatin1String object that stores \a str.
@@ -8370,6 +8871,24 @@ QString &QString::setRawData(const QChar *unicode, int size)
Returns the size of the Latin-1 string stored in this object.
*/
+/*! \fn bool QLatin1String::isNull() const
+ \since 5.10
+
+ Returns whether the Latin-1 string stored in this object is null
+ (\c{data() == nullptr}) or not.
+
+ \sa isEmpty(), data()
+*/
+
+/*! \fn bool QLatin1String::isEmpty() const
+ \since 5.10
+
+ Returns whether the Latin-1 string stored in this object is empty
+ (\c{size() == 0}) or not.
+
+ \sa isNull(), size()
+*/
+
/*! \fn QLatin1Char QLatin1String::at(int pos) const
\since 5.8
@@ -8392,6 +8911,167 @@ QString &QString::setRawData(const QChar *unicode, int size)
\sa at()
*/
+/*!
+ \fn QLatin1Char QLatin1String::front() const
+ \since 5.10
+
+ Returns the first character in the string.
+ Same as \c{at(0)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa back(), at(), operator[]()
+*/
+
+/*!
+ \fn QLatin1Char QLatin1String::back() const
+ \since 5.10
+
+ Returns the last character in the string.
+ Same as \c{at(size() - 1)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa front(), at(), operator[]()
+*/
+
+/*!
+ \fn bool QLatin1String::startsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \fn bool QLatin1String::startsWith(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \fn bool QLatin1String::startsWith(QChar ch) const
+ \since 5.10
+ \fn bool QLatin1String::startsWith(QChar ch, Qt::CaseSensitivity cs) const
+ \since 5.10
+
+ Returns \c true if this Latin-1 string starts with string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively;
+ otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive;
+ otherwise the search is case-insensitive.
+
+ \sa endsWith(), qStartsWith()
+*/
+
+/*!
+ \fn bool QLatin1String::endsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \fn bool QLatin1String::endsWith(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \fn bool QLatin1String::endsWith(QChar ch) const
+ \since 5.10
+ \fn bool QLatin1String::endsWith(QChar ch, Qt::CaseSensitivity cs) const
+ \since 5.10
+
+ Returns \c true if this Latin-1 string ends with string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively;
+ otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive;
+ otherwise the search is case-insensitive.
+
+ \sa startsWith(), qEndsWith()
+*/
+
+/*!
+ \fn QLatin1String::const_iterator QLatin1String::begin() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in
+ the string.
+
+ This function is provided for STL compatibility.
+
+ \sa end(), cbegin(), rbegin(), data()
+*/
+
+/*!
+ \fn QLatin1String::const_iterator QLatin1String::cbegin() const
+ \since 5.10
+
+ Same as begin().
+
+ This function is provided for STL compatibility.
+
+ \sa cend(), begin(), crbegin(), data()
+*/
+
+/*!
+ \fn QLatin1String::const_iterator QLatin1String::end() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ character after the last character in the list.
+
+ This function is provided for STL compatibility.
+
+ \sa begin(), cend(), rend()
+*/
+
+/*! \fn QLatin1String::const_iterator QLatin1String::cend() const
+ \since 5.10
+
+ Same as end().
+
+ This function is provided for STL compatibility.
+
+ \sa cbegin(), end(), crend()
+*/
+
+/*!
+ \fn QLatin1String::const_reverse_iterator QLatin1String::rbegin() const
+ \since 5.10
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ character in the string, in reverse order.
+
+ This function is provided for STL compatibility.
+
+ \sa rend(), crbegin(), begin()
+*/
+
+/*!
+ \fn QLatin1String::const_reverse_iterator QLatin1String::crbegin() const
+ \since 5.10
+
+ Same as rbegin().
+
+ This function is provided for STL compatibility.
+
+ \sa crend(), rbegin(), cbegin()
+*/
+
+/*!
+ \fn QLatin1String::const_reverse_iterator QLatin1String::rend() const
+ \since 5.10
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last character in the string, in reverse order.
+
+ This function is provided for STL compatibility.
+
+ \sa rbegin(), crend(), end()
+*/
+
+/*!
+ \fn QLatin1String::const_reverse_iterator QLatin1String::crend() const
+ \since 5.10
+
+ Same as rend().
+
+ This function is provided for STL compatibility.
+
+ \sa crbegin(), rend(), cend()
+*/
+
/*! \fn QLatin1String QLatin1String::mid(int start) const
\since 5.8
@@ -8401,7 +9081,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
\note This function performs no error checking.
The behavior is undefined when \a start < 0 or \a start > size().
- \sa left(), right()
+ \sa left(), right(), chopped(), chop(), truncate()
*/
/*! \fn QLatin1String QLatin1String::mid(int start, int length) const
@@ -8415,7 +9095,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
The behavior is undefined when \a start < 0, \a length < 0,
or \a start + \a length > size().
- \sa left(), right()
+ \sa left(), right(), chopped(), chop(), truncate()
*/
/*! \fn QLatin1String QLatin1String::left(int length) const
@@ -8427,7 +9107,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
\note This function performs no error checking.
The behavior is undefined when \a length < 0 or \a length > size().
- \sa mid(), right()
+ \sa mid(), right(), chopped(), chop(), truncate()
*/
/*! \fn QLatin1String QLatin1String::right(int length) const
@@ -8439,7 +9119,60 @@ QString &QString::setRawData(const QChar *unicode, int size)
\note This function performs no error checking.
The behavior is undefined when \a length < 0 or \a length > size().
- \sa mid(), left()
+ \sa mid(), left(), chopped(), chop(), truncate()
+*/
+
+/*!
+ \fn QLatin1String QLatin1String::chopped(int length) const
+ \since 5.10
+
+ Returns the substring of length size() - \a length starting at the
+ beginning of this object.
+
+ Same as \c{left(size() - length)}.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), right(), chop(), truncate()
+*/
+
+/*!
+ \fn void QLatin1String::truncate(int length)
+ \since 5.10
+
+ Truncates this string to length \a length.
+
+ Same as \c{*this = left(length)}.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), right(), chopped(), chop()
+*/
+
+/*!
+ \fn void QLatin1String::chop(int length)
+ \since 5.10
+
+ Truncates this string by \a length characters.
+
+ Same as \c{*this = left(size() - length)}.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), right(), chopped(), truncate()
+*/
+
+/*!
+ \fn QLatin1String QLatin1String::trimmed() const
+ \since 5.10
+
+ Strips leading and trailing whitespace and returns the result.
+
+ Whitespace means any character for which QChar::isSpace() returns
+ \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
+ '\\f', '\\r', and ' '.
+
+ \sa qTrimmed()
*/
/*! \fn bool QLatin1String::operator==(const QString &other) const
@@ -9137,8 +9870,8 @@ QString QStringRef::toString() const {
returns \c false.
*/
bool operator==(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
-{ return (s1.size() == s2.size() &&
- qMemEquals((const ushort *)s1.unicode(), (const ushort *)s2.unicode(), s1.size()));
+{
+ return s1.size() == s2.size() && qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
/*! \relates QStringRef
@@ -9147,8 +9880,8 @@ bool operator==(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
returns \c false.
*/
bool operator==(const QString &s1,const QStringRef &s2) Q_DECL_NOTHROW
-{ return (s1.size() == s2.size() &&
- qMemEquals((const ushort *)s1.unicode(), (const ushort *)s2.unicode(), s1.size()));
+{
+ return s1.size() == s2.size() && qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
/*! \relates QStringRef
@@ -9161,10 +9894,7 @@ bool operator==(QLatin1String s1, const QStringRef &s2) Q_DECL_NOTHROW
if (s1.size() != s2.size())
return false;
- const uchar *c = reinterpret_cast<const uchar *>(s1.latin1());
- if (!c)
- return s2.isEmpty();
- return ucstrncmp(s2.unicode(), c, s2.size()) == 0;
+ return qt_compare_strings(s2, s1, Qt::CaseSensitive) == 0;
}
/*!
@@ -9180,7 +9910,7 @@ bool operator==(QLatin1String s1, const QStringRef &s2) Q_DECL_NOTHROW
*/
bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
{
- return ucstrcmp(s1.constData(), s1.length(), s2.constData(), s2.length()) < 0;
+ return qt_compare_strings(s1, s2, Qt::CaseSensitive) < 0;
}
/*!\fn bool operator<=(const QStringRef &s1,const QStringRef &s2)
@@ -9247,6 +9977,36 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
*/
/*!
+ \fn QChar QStringRef::front() const
+ \since 5.10
+
+ Returns the first character in the string.
+ Same as \c{at(0)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa back(), at(), operator[]()
+*/
+
+/*!
+ \fn QChar QStringRef::back() const
+ \since 5.10
+
+ Returns the last character in the string.
+ Same as \c{at(size() - 1)}.
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string constitutes
+ undefined behavior.
+
+ \sa front(), at(), operator[]()
+*/
+
+/*!
\fn void QStringRef::clear()
Clears the contents of the string reference by making it null and empty.
@@ -9411,6 +10171,8 @@ QStringRef QStringRef::appendTo(QString *string) const
If \a cs is Qt::CaseSensitive, the comparison is case sensitive;
otherwise the comparison is case insensitive.
+
+ \sa qCompareStrings()
*/
/*!
@@ -9424,6 +10186,8 @@ QStringRef QStringRef::appendTo(QString *string) const
If \a cs is Qt::CaseSensitive, the comparison is case sensitive;
otherwise the comparison is case insensitive.
+
+ \sa qCompareStrings()
*/
/*!
@@ -9437,6 +10201,8 @@ QStringRef QStringRef::appendTo(QString *string) const
If \a cs is Qt::CaseSensitive, the comparison is case sensitive;
otherwise the comparison is case insensitive.
+
+ \sa qCompareStrings()
*/
/*!
@@ -9453,7 +10219,7 @@ QStringRef QStringRef::appendTo(QString *string) const
Equivalent to \c {compare(*this, other, cs)}.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -9470,7 +10236,7 @@ QStringRef QStringRef::appendTo(QString *string) const
Equivalent to \c {compare(*this, other, cs)}.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -9487,7 +10253,7 @@ QStringRef QStringRef::appendTo(QString *string) const
Equivalent to \c {compare(*this, other, cs)}.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -9505,7 +10271,7 @@ QStringRef QStringRef::appendTo(QString *string) const
Equivalent to \c {compare(*this, other, cs)}.
- \sa QString::compare()
+ \sa qCompareStrings()
*/
/*!
@@ -9597,7 +10363,7 @@ QString &QString::append(const QStringRef &str)
If \a n is greater than or equal to size(), or less than zero,
a reference to the entire string is returned.
- \sa right(), mid(), startsWith()
+ \sa right(), mid(), startsWith(), chopped(), chop(), truncate()
*/
QStringRef QStringRef::left(int n) const
{
@@ -9634,7 +10400,7 @@ QStringRef QString::leftRef(int n) const
If \a n is greater than or equal to size(), or less than zero,
a reference to the entire string is returned.
- \sa left(), mid(), endsWith()
+ \sa left(), mid(), endsWith(), chopped(), chop(), truncate()
*/
QStringRef QStringRef::right(int n) const
{
@@ -9676,7 +10442,7 @@ QStringRef QString::rightRef(int n) const
function returns all characters from the specified \a position
onwards.
- \sa left(), right()
+ \sa left(), right(), chopped(), chop(), truncate()
*/
QStringRef QStringRef::mid(int pos, int n) const
{
@@ -9696,6 +10462,18 @@ QStringRef QStringRef::mid(int pos, int n) const
}
/*!
+ \fn QStringRef::chopped(int len) const
+ \since 5.10
+
+ Returns a substring reference to the size() - \a len leftmost characters
+ of this string.
+
+ \note The behavior is undefined if \a len is negative or greater than size().
+
+ \sa endsWith(), left(), right(), mid(), chop(), truncate()
+*/
+
+/*!
\since 4.4
Returns a substring reference to \a n characters of this string,
@@ -10011,8 +10789,7 @@ bool QStringRef::isRightToLeft() const
*/
bool QStringRef::startsWith(const QString &str, Qt::CaseSensitivity cs) const
{
- return qt_starts_with(isNull() ? 0 : unicode(), size(),
- str.isNull() ? 0 : str.unicode(), str.size(), cs);
+ return qt_starts_with(*this, str, cs);
}
/*!
@@ -10022,18 +10799,24 @@ bool QStringRef::startsWith(const QString &str, Qt::CaseSensitivity cs) const
*/
bool QStringRef::startsWith(QLatin1String str, Qt::CaseSensitivity cs) const
{
- return qt_starts_with(isNull() ? 0 : unicode(), size(), str, cs);
+ return qt_starts_with(*this, str, cs);
}
/*!
+ \fn bool QStringRef::startsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \overload startsWith()
+ \sa QString::startsWith(), endsWith()
+*/
+
+/*!
\since 4.8
\overload startsWith()
\sa QString::startsWith(), endsWith()
*/
bool QStringRef::startsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
{
- return qt_starts_with(isNull() ? 0 : unicode(), size(),
- str.isNull() ? 0 : str.unicode(), str.size(), cs);
+ return qt_starts_with(*this, str, cs);
}
/*!
@@ -10050,14 +10833,7 @@ bool QStringRef::startsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
*/
bool QStringRef::startsWith(QChar ch, Qt::CaseSensitivity cs) const
{
- if (!isEmpty()) {
- const ushort *data = reinterpret_cast<const ushort*>(unicode());
- return (cs == Qt::CaseSensitive
- ? data[0] == ch
- : foldCase(data[0]) == foldCase(ch.unicode()));
- } else {
- return false;
- }
+ return qt_starts_with(*this, ch, cs);
}
/*!
@@ -10072,8 +10848,7 @@ bool QStringRef::startsWith(QChar ch, Qt::CaseSensitivity cs) const
*/
bool QStringRef::endsWith(const QString &str, Qt::CaseSensitivity cs) const
{
- return qt_ends_with(isNull() ? 0 : unicode(), size(),
- str.isNull() ? 0 : str.unicode(), str.size(), cs);
+ return qt_ends_with(*this, str, cs);
}
/*!
@@ -10090,15 +10865,7 @@ bool QStringRef::endsWith(const QString &str, Qt::CaseSensitivity cs) const
*/
bool QStringRef::endsWith(QChar ch, Qt::CaseSensitivity cs) const
{
- if (!isEmpty()) {
- const ushort *data = reinterpret_cast<const ushort*>(unicode());
- const int size = length();
- return (cs == Qt::CaseSensitive
- ? data[size - 1] == ch
- : foldCase(data[size - 1]) == foldCase(ch.unicode()));
- } else {
- return false;
- }
+ return qt_ends_with(*this, ch, cs);
}
/*!
@@ -10108,18 +10875,24 @@ bool QStringRef::endsWith(QChar ch, Qt::CaseSensitivity cs) const
*/
bool QStringRef::endsWith(QLatin1String str, Qt::CaseSensitivity cs) const
{
- return qt_ends_with(isNull() ? 0 : unicode(), size(), str, cs);
+ return qt_ends_with(*this, str, cs);
}
/*!
+ \fn bool QStringRef::endsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \since 5.10
+ \overload endsWith()
+ \sa QString::endsWith(), startsWith()
+*/
+
+/*!
\since 4.8
\overload endsWith()
\sa QString::endsWith(), endsWith()
*/
bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
{
- return qt_ends_with(isNull() ? 0 : unicode(), size(),
- str.isNull() ? 0 : str.unicode(), str.size(), cs);
+ return qt_ends_with(*this, str, cs);
}
@@ -10254,101 +11027,148 @@ static inline int qt_find_latin1_string(const QChar *haystack, int size,
reinterpret_cast<const QChar*>(s.constData()), len, cs);
}
-static inline bool qt_starts_with(const QChar *haystack, int haystackLen,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs)
+template <typename Haystack, typename Needle>
+bool qt_starts_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{
- if (!haystack)
- return !needle;
+ if (haystack.isNull())
+ return needle.isNull(); // historical behavior, consider changing in ### Qt 6.
+ const auto haystackLen = haystack.size();
+ const auto needleLen = needle.size();
if (haystackLen == 0)
return needleLen == 0;
if (needleLen > haystackLen)
return false;
- const ushort *h = reinterpret_cast<const ushort*>(haystack);
- const ushort *n = reinterpret_cast<const ushort*>(needle);
+ return qt_compare_strings(haystack.left(needleLen), needle, cs) == 0;
+}
- if (cs == Qt::CaseSensitive) {
- return qMemEquals(h, n, needleLen);
- } else {
- uint last = 0;
- uint olast = 0;
- for (int i = 0; i < needleLen; ++i)
- if (foldCase(h[i], last) != foldCase(n[i], olast))
- return false;
- }
- return true;
+static inline bool qt_starts_with(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs)
+{
+ return qt_starts_with_impl(haystack, needle, cs);
}
-static inline bool qt_starts_with(const QChar *haystack, int haystackLen,
- QLatin1String needle, Qt::CaseSensitivity cs)
+static inline bool qt_starts_with(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs)
{
- if (!haystack)
- return !needle.latin1();
- if (haystackLen == 0)
- return !needle.latin1() || *needle.latin1() == 0;
- const int slen = needle.size();
- if (slen > haystackLen)
- return false;
- const ushort *data = reinterpret_cast<const ushort*>(haystack);
- const uchar *latin = reinterpret_cast<const uchar*>(needle.latin1());
- if (cs == Qt::CaseSensitive) {
- return ucstrncmp(haystack, latin, slen) == 0;
- } else {
- for (int i = 0; i < slen; ++i)
- if (foldCase(data[i]) != foldCase((ushort)latin[i]))
- return false;
- }
- return true;
+ return qt_starts_with_impl(haystack, needle, cs);
}
-static inline bool qt_ends_with(const QChar *haystack, int haystackLen,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs)
+static inline bool qt_starts_with(QStringView haystack, QChar needle, Qt::CaseSensitivity cs)
{
- if (!haystack)
- return !needle;
+ return haystack.size()
+ && (cs == Qt::CaseSensitive ? haystack.front() == needle
+ : foldCase(haystack.front()) == foldCase(needle));
+}
+
+/*!
+ \fn bool qStartsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \fn bool qStartsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \fn bool qStartsWith(QLatin1String haystack, QStringview needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \fn bool qStartsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \relates QStringView
+
+ Returns \c true if \a haystack starts with \a needle,
+ otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive;
+ otherwise the search is case-insensitive.
+
+ \sa qEndsWith(), QString::endsWith(), QStringView::endsWith(), QLatin1String::endsWith()
+*/
+
+bool qStartsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_starts_with_impl(haystack, needle, cs);
+}
+
+bool qStartsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_starts_with_impl(haystack, needle, cs);
+}
+
+bool qStartsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_starts_with_impl(haystack, needle, cs);
+}
+
+bool qStartsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ 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
+{
+ if (haystack.isNull())
+ return needle.isNull(); // historical behavior, consider changing in ### Qt 6.
+ const auto haystackLen = haystack.size();
+ const auto needleLen = needle.size();
if (haystackLen == 0)
return needleLen == 0;
- const int pos = haystackLen - needleLen;
- if (pos < 0)
+ if (haystackLen < needleLen)
return false;
- const ushort *h = reinterpret_cast<const ushort*>(haystack);
- const ushort *n = reinterpret_cast<const ushort*>(needle);
+ return qt_compare_strings(haystack.right(needleLen), needle, cs) == 0;
+}
- if (cs == Qt::CaseSensitive) {
- return qMemEquals(h + pos, n, needleLen);
- } else {
- uint last = 0;
- uint olast = 0;
- for (int i = 0; i < needleLen; i++)
- if (foldCase(h[pos+i], last) != foldCase(n[i], olast))
- return false;
- }
- return true;
+static inline bool qt_ends_with(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs)
+{
+ return qt_ends_with_impl(haystack, needle, cs);
+}
+
+static inline bool qt_ends_with(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs)
+{
+ return qt_ends_with_impl(haystack, needle, cs);
}
+static inline bool qt_ends_with(QStringView haystack, QChar needle, Qt::CaseSensitivity cs)
+{
+ return haystack.size()
+ && (cs == Qt::CaseSensitive ? haystack.back() == needle
+ : foldCase(haystack.back()) == foldCase(needle));
+}
+
+/*!
+ \fn bool qEndsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \fn bool qEndsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \fn bool qEndsWith(QLatin1String haystack, QStringview needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \fn bool qEndsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs)
+ \since 5.10
+ \relates QStringView
-static inline bool qt_ends_with(const QChar *haystack, int haystackLen,
- QLatin1String needle, Qt::CaseSensitivity cs)
+ Returns \c true if \a haystack ends with \a needle,
+ otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive;
+ otherwise the search is case-insensitive.
+
+ \sa qEndsWith(), QString::endsWith(), QStringView::endsWith(), QLatin1String::endsWith()
+*/
+
+bool qEndsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{
- if (!haystack)
- return !needle.latin1();
- if (haystackLen == 0)
- return !needle.latin1() || *needle.latin1() == 0;
- const int slen = needle.size();
- int pos = haystackLen - slen;
- if (pos < 0)
- return false;
- const uchar *latin = reinterpret_cast<const uchar*>(needle.latin1());
- const ushort *data = reinterpret_cast<const ushort*>(haystack);
- if (cs == Qt::CaseSensitive) {
- return ucstrncmp(haystack + pos, latin, slen) == 0;
- } else {
- for (int i = 0; i < slen; i++)
- if (foldCase(data[pos+i]) != foldCase((ushort)latin[i]))
- return false;
- }
- return true;
+ return qt_ends_with_impl(haystack, needle, cs);
+}
+
+bool qEndsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_ends_with_impl(haystack, needle, cs);
+}
+
+bool qEndsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_ends_with_impl(haystack, needle, cs);
+}
+
+bool qEndsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+{
+ return qt_ends_with_impl(haystack, needle, cs);
}
/*!
@@ -10364,9 +11184,7 @@ static inline bool qt_ends_with(const QChar *haystack, int haystackLen,
*/
QByteArray QStringRef::toLatin1() const
{
- if (isNull())
- return QByteArray();
- return QString::toLatin1_helper(unicode(), length());
+ return qt_convert_to_latin1(*this);
}
/*!
@@ -10403,14 +11221,7 @@ QByteArray QStringRef::toLatin1() const
*/
QByteArray QStringRef::toLocal8Bit() const
{
-#ifndef QT_NO_TEXTCODEC
- if (!isNull()) {
- QTextCodec *localeCodec = QTextCodec::codecForLocale();
- if (localeCodec)
- return localeCodec->fromUnicode(unicode(), length());
- }
-#endif // QT_NO_TEXTCODEC
- return toLatin1();
+ return qt_convert_to_local_8bit(*this);
}
/*!
@@ -10425,10 +11236,7 @@ QByteArray QStringRef::toLocal8Bit() const
*/
QByteArray QStringRef::toUtf8() const
{
- if (isNull())
- return QByteArray();
-
- return QUtf8::convertFromUnicode(constData(), length());
+ return qt_convert_to_utf8(*this);
}
/*!
@@ -10447,11 +11255,7 @@ QByteArray QStringRef::toUtf8() const
*/
QVector<uint> QStringRef::toUcs4() const
{
- QVector<uint> v(length());
- uint *a = v.data();
- int len = QString::toUcs4_helper(reinterpret_cast<const ushort *>(unicode()), length(), a);
- v.resize(len);
- return v;
+ return qt_convert_to_ucs4(*this);
}
/*!
@@ -10475,8 +11279,6 @@ QStringRef QStringRef::trimmed() const
QStringAlgorithms<const QStringRef>::trimmed_helper_positions(begin, end);
if (begin == cbegin() && end == cend())
return *this;
- if (begin == end)
- return QStringRef();
int position = m_position + (begin - cbegin());
return QStringRef(m_string, position, end - begin);
}
@@ -10709,7 +11511,7 @@ ushort QStringRef::toUShort(bool *ok, int base) const
double QStringRef::toDouble(bool *ok) const
{
- return QLocaleData::c()->stringToDouble(constData(), size(), ok, QLocale::RejectGroupSeparator);
+ return QLocaleData::c()->stringToDouble(*this, ok, QLocale::RejectGroupSeparator);
}
/*!
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 8f957a7b22..16472ff6b9 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -49,6 +49,9 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qrefcount.h>
#include <QtCore/qnamespace.h>
+#include <QtCore/qstringliteral.h>
+#include <QtCore/qstringalgorithms.h>
+#include <QtCore/qstringview.h>
#include <string>
#include <iterator>
@@ -90,6 +93,8 @@ class QLatin1String
public:
Q_DECL_CONSTEXPR inline QLatin1String() Q_DECL_NOTHROW : m_size(0), m_data(Q_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 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()) {}
@@ -97,17 +102,72 @@ public:
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 QLatin1Char at(int i) const { return QLatin1Char(m_data[i]); }
+ 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 QLatin1Char at(int i) const
+ { return Q_ASSERT(i >= 0), Q_ASSERT(i < size()), QLatin1Char(m_data[i]); }
Q_DECL_CONSTEXPR QLatin1Char operator[](int i) const { return at(i); }
+ 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
+ { return qStartsWith(*this, s, cs); }
+ Q_REQUIRED_RESULT bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qStartsWith(*this, s, cs); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool startsWith(QChar c) const Q_DECL_NOTHROW
+ { return !isEmpty() && front() == c; }
+ Q_REQUIRED_RESULT inline bool startsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ { return qStartsWith(*this, QStringView(&c, 1), cs); }
+
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qEndsWith(*this, s, cs); }
+ Q_REQUIRED_RESULT bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qEndsWith(*this, s, cs); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool endsWith(QChar c) const Q_DECL_NOTHROW
+ { return !isEmpty() && back() == c; }
+ Q_REQUIRED_RESULT inline bool endsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ { return qEndsWith(*this, QStringView(&c, 1), cs); }
+
+ using value_type = const char;
+ using reference = value_type&;
+ using const_reference = reference;
+ using iterator = value_type*;
+ using const_iterator = iterator;
+ 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(); }
+
+ 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()); }
+
Q_DECL_CONSTEXPR QLatin1String mid(int pos) const
- { return QLatin1String(m_data + pos, m_size - pos); }
+ { return Q_ASSERT(pos >= 0), Q_ASSERT(pos <= size()), QLatin1String(m_data + pos, m_size - pos); }
Q_DECL_CONSTEXPR QLatin1String mid(int pos, int n) const
- { return QLatin1String(m_data + pos, n); }
+ { return Q_ASSERT(pos >= 0), Q_ASSERT(n >= 0), Q_ASSERT(pos + n <= size()), QLatin1String(m_data + pos, n); }
Q_DECL_CONSTEXPR QLatin1String left(int n) const
- { return QLatin1String(m_data, n); }
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QLatin1String(m_data, n); }
Q_DECL_CONSTEXPR QLatin1String right(int n) const
- { return QLatin1String(m_data + m_size - n, n); }
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QLatin1String(m_data + m_size - n, n); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1String chopped(int n) const
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QLatin1String(m_data, m_size - n); }
+
+ Q_DECL_RELAXED_CONSTEXPR void chop(int n)
+ { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size -= n; }
+ 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 qTrimmed(*this); }
inline bool operator==(const QString &s) const Q_DECL_NOTHROW;
inline bool operator!=(const QString &s) const Q_DECL_NOTHROW;
@@ -141,73 +201,13 @@ Q_DECLARE_TYPEINFO(QLatin1String, Q_MOVABLE_TYPE);
// Qt 4.x compatibility
typedef QLatin1String QLatin1Literal;
-
-typedef QTypedArrayData<ushort> QStringData;
-
-#if defined(Q_OS_WIN) && !defined(Q_COMPILER_UNICODE_STRINGS)
-// fall back to wchar_t if the a Windows compiler does not
-// support Unicode string literals, assuming wchar_t is 2 bytes
-// on that platform (sanity-checked by static_assert further below)
-
-#if defined(Q_CC_MSVC)
-# define QT_UNICODE_LITERAL_II(str) L##str
-#else
-# define QT_UNICODE_LITERAL_II(str) L"" str
-#endif
-typedef wchar_t qunicodechar;
-
-#else
-// all our supported compilers support Unicode string literals,
-// even if their Q_COMPILER_UNICODE_STRING has been revoked due
-// to lacking stdlib support. But QStringLiteral only needs the
-// core language feature, so just use u"" here unconditionally:
-
-#define QT_UNICODE_LITERAL_II(str) u"" str
-typedef char16_t qunicodechar;
-
-#endif
-
-Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2,
- "qunicodechar must typedef an integral type of size 2");
-
-#define QT_UNICODE_LITERAL(str) QT_UNICODE_LITERAL_II(str)
-#define QStringLiteral(str) \
- ([]() Q_DECL_NOEXCEPT -> QString { \
- enum { Size = sizeof(QT_UNICODE_LITERAL(str))/2 - 1 }; \
- static const QStaticStringData<Size> qstring_literal = { \
- Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \
- QT_UNICODE_LITERAL(str) }; \
- QStringDataPtr holder = { qstring_literal.data_ptr() }; \
- const QString qstring_literal_temp(holder); \
- return qstring_literal_temp; \
- }()) \
- /**/
-
-#define Q_STATIC_STRING_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset) \
- { Q_REFCOUNT_INITIALIZE_STATIC, size, 0, 0, offset } \
- /**/
-
-#define Q_STATIC_STRING_DATA_HEADER_INITIALIZER(size) \
- Q_STATIC_STRING_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, sizeof(QStringData)) \
- /**/
-
-template <int N>
-struct QStaticStringData
-{
- QArrayData str;
- qunicodechar data[N + 1];
-
- QStringData *data_ptr() const
- {
- Q_ASSERT(str.ref.isStatic());
- return const_cast<QStringData *>(static_cast<const QStringData*>(&str));
- }
-};
-
-struct QStringDataPtr
-{
- QStringData *ptr;
-};
+//
+// QStringView members that require QLatin1String:
+//
+bool QStringView::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+{ return qStartsWith(*this, s, cs); }
+bool QStringView::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+{ return qEndsWith(*this, s, cs); }
class Q_CORE_EXPORT QString
{
@@ -261,6 +261,11 @@ public:
const QChar operator[](uint i) const;
QCharRef operator[](uint i);
+ Q_REQUIRED_RESULT inline QChar front() const { return at(0); }
+ Q_REQUIRED_RESULT inline QCharRef front();
+ Q_REQUIRED_RESULT inline QChar back() const { return at(size() - 1); }
+ Q_REQUIRED_RESULT inline QCharRef back();
+
Q_REQUIRED_RESULT QString arg(qlonglong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(qulonglong a, int fieldwidth=0, int base=10,
@@ -283,8 +288,14 @@ public:
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(QChar a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
+#if QT_STRINGVIEW_LEVEL < 2
Q_REQUIRED_RESULT QString arg(const QString &a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
+#endif
+ Q_REQUIRED_RESULT QString arg(QStringView a, int fieldWidth = 0,
+ QChar fillChar = QLatin1Char(' ')) const;
+ Q_REQUIRED_RESULT QString arg(QLatin1String a, int fieldWidth = 0,
+ QChar fillChar = QLatin1Char(' ')) const;
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,
@@ -366,16 +377,29 @@ public:
Q_REQUIRED_RESULT QString left(int n) const;
Q_REQUIRED_RESULT QString right(int n) const;
Q_REQUIRED_RESULT QString mid(int position, int n = -1) const;
+ Q_REQUIRED_RESULT QString chopped(int n) const
+ { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return left(size() - n); }
+
+
Q_REQUIRED_RESULT QStringRef leftRef(int n) const;
Q_REQUIRED_RESULT QStringRef rightRef(int n) const;
Q_REQUIRED_RESULT QStringRef midRef(int position, int n = -1) const;
+#if QT_STRINGVIEW_LEVEL < 2
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
+ { return qStartsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+
+#if QT_STRINGVIEW_LEVEL < 2
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
+ { return qEndsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -652,7 +676,7 @@ public:
{}
template <int N>
inline QString &operator=(const char (&ch)[N])
- { return (*this = fromLatin1(ch, N - 1)); }
+ { return (*this = fromUtf8(ch, N - 1)); }
#endif
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
inline QT_ASCII_CAST_WARN QString(const char *ch)
@@ -750,6 +774,7 @@ public:
inline void push_back(const QString &s) { append(s); }
inline void push_front(QChar c) { prepend(c); }
inline void push_front(const QString &s) { prepend(s); }
+ void shrink_to_fit() { squeeze(); }
static inline QString fromStdString(const std::string &s);
inline std::string toStdString() const;
@@ -850,6 +875,7 @@ private:
friend class QCharRef;
friend class QTextCodec;
friend class QStringRef;
+ friend class QStringView;
friend class QByteArray;
friend class QCollator;
friend struct QAbstractConcatenable;
@@ -877,6 +903,15 @@ public:
inline DataPtr &data_ptr() { return d; }
};
+//
+// QStringView inline members that require QString:
+//
+QString QStringView::toString() const
+{ return Q_ASSERT(size() == length()), QString(data(), length()); }
+
+//
+// QString inline members
+//
inline QString::QString(QLatin1String aLatin1) : d(fromLatin1_helper(aLatin1.latin1(), aLatin1.size()))
{ }
inline int QString::length() const
@@ -1112,6 +1147,8 @@ inline QCharRef QString::operator[](int i)
{ Q_ASSERT(i >= 0); return QCharRef(*this, i); }
inline QCharRef QString::operator[](uint i)
{ return QCharRef(*this, i); }
+inline QCharRef QString::front() { return operator[](0); }
+inline QCharRef QString::back() { return operator[](size() - 1); }
inline QString::iterator QString::begin()
{ detach(); return reinterpret_cast<QChar*>(d->data()); }
inline QString::const_iterator QString::begin() const
@@ -1433,6 +1470,8 @@ public:
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
@@ -1445,15 +1484,23 @@ public:
bool isRightToLeft() const;
- bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qStartsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#if QT_STRINGVIEW_LEVEL < 2
+ bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
- bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qEndsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#if QT_STRINGVIEW_LEVEL < 2
+ bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
inline QStringRef &operator=(const QString *string);
@@ -1496,6 +1543,8 @@ public:
inline const QChar at(int i) const
{ Q_ASSERT(uint(i) < uint(size())); return m_string->at(i + m_position); }
QChar operator[](int i) const { return at(i); }
+ Q_REQUIRED_RESULT QChar front() const { return at(0); }
+ Q_REQUIRED_RESULT QChar back() const { return at(size() - 1); }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
// ASCII compatibility
@@ -1610,7 +1659,7 @@ inline bool operator>=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW
// QChar <> QString
inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
-{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) == 0; }
+{ return rhs.size() == 1 && lhs == rhs.front(); }
inline bool operator< (QChar lhs, const QString &rhs) Q_DECL_NOTHROW
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) < 0; }
inline bool operator> (QChar lhs, const QString &rhs) Q_DECL_NOTHROW
@@ -1629,7 +1678,7 @@ inline bool operator>=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(
// QChar <> QStringRef
inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
-{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) == 0; }
+{ return rhs.size() == 1 && lhs == rhs.front(); }
inline bool operator< (QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) < 0; }
inline bool operator> (QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
@@ -1648,7 +1697,7 @@ inline bool operator>=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return
// QChar <> QLatin1String
inline bool operator==(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
-{ return QString::compare_helper(&lhs, 1, rhs) == 0; }
+{ return rhs.size() == 1 && lhs == rhs.front(); }
inline bool operator< (QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
{ return QString::compare_helper(&lhs, 1, rhs) < 0; }
inline bool operator> (QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
@@ -1665,6 +1714,44 @@ inline bool operator> (QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return r
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); }
+// QStringView <> QStringView
+inline bool operator==(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && qCompareStrings(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 qCompareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return qCompareStrings(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; }
+
+// QStringView <> QLatin1String
+inline bool operator==(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && qCompareStrings(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 qCompareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) >= 0; }
+
+inline bool operator==(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && qCompareStrings(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 qCompareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return qCompareStrings(lhs, rhs) >= 0; }
+
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
// QStringRef <> QByteArray
inline QT_ASCII_CAST_WARN bool operator==(const QStringRef &lhs, const QByteArray &rhs) { return lhs.compare(rhs) == 0; }
diff --git a/src/corelib/tools/qstringalgorithms.h b/src/corelib/tools/qstringalgorithms.h
new file mode 100644
index 0000000000..e1b8b90428
--- /dev/null
+++ b/src/corelib/tools/qstringalgorithms.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QSTRINGALGORITHMS_H
+#define QSTRINGALGORITHMS_H
+
+#include <QtCore/qnamespace.h>
+
+#if 0
+#pragma qt_class(QStringAlgorithms)
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QByteArray;
+class QLatin1String;
+class QStringView;
+template <typename T> class QVector;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int qCompareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int qCompareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int qCompareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int qCompareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qStartsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qStartsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qStartsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qStartsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qEndsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qEndsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qEndsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool qEndsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QStringView qTrimmed(QStringView s) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QLatin1String qTrimmed(QLatin1String s) Q_DECL_NOTHROW;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray qConvertToLatin1(QStringView str);
+Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray qConvertToUtf8(QStringView str);
+Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray qConvertToLocal8Bit(QStringView str);
+Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<uint> qConvertToUcs4(QStringView str);
+
+QT_END_NAMESPACE
+
+#endif // QSTRINGALGORTIHMS_H
diff --git a/src/corelib/tools/qstringalgorithms_p.h b/src/corelib/tools/qstringalgorithms_p.h
index c5470bc7ad..4bcf697f78 100644
--- a/src/corelib/tools/qstringalgorithms_p.h
+++ b/src/corelib/tools/qstringalgorithms_p.h
@@ -89,14 +89,12 @@ template <typename StringType> struct QStringAlgorithms
static inline void trimmed_helper_positions(const Char *&begin, const Char *&end)
{
+ // skip white space from end
+ while (begin < end && isSpace(end[-1]))
+ --end;
// skip white space from start
while (begin < end && isSpace(*begin))
begin++;
- // skip white space from end
- if (begin < end) {
- while (begin < end && isSpace(end[-1]))
- end--;
- }
}
static inline StringType trimmed_helper(StringType &str)
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 9a40abcfed..5c6d990314 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -303,7 +303,7 @@ template <int N> struct QConcatenable<char[N]> : QConcatenable<const char[N]>
template <> struct QConcatenable<const char *> : private QAbstractConcatenable
{
- typedef char const *type;
+ typedef const char *type;
typedef QByteArray ConvertTo;
enum { ExactSize = false };
static int size(const char *a) { return qstrlen(a); }
@@ -320,6 +320,11 @@ template <> struct QConcatenable<const char *> : private QAbstractConcatenable
}
};
+template <> struct QConcatenable<char *> : QConcatenable<const char*>
+{
+ typedef char *type;
+};
+
template <> struct QConcatenable<QByteArray> : private QAbstractConcatenable
{
typedef QByteArray type;
diff --git a/src/corelib/tools/qstringiterator.qdoc b/src/corelib/tools/qstringiterator.qdoc
index ff759b6f0e..95c2247bc1 100644
--- a/src/corelib/tools/qstringiterator.qdoc
+++ b/src/corelib/tools/qstringiterator.qdoc
@@ -55,7 +55,7 @@
that may be present in a QString, and return the individual Unicode code points.
You can create a QStringIterator that iterates over a given
- QString by passing the string to the QStringIterator's constructor:
+ QStringView by passing the string to the QStringIterator's constructor:
\snippet code/src_corelib_tools_qstringiterator.cpp 0
@@ -120,12 +120,12 @@
*/
/*!
- \fn QStringIterator::QStringIterator(const QString &string)
+ \fn QStringIterator::QStringIterator(QStringView string, qssize_t idx)
Constructs an iterator over the contents of \a string. The iterator will point
- before the first position in the string.
+ before position \a idx in the string.
- The string \a string must remain valid while the iterator is being used.
+ The string view \a string must remain valid while the iterator is being used.
*/
/*!
diff --git a/src/corelib/tools/qstringiterator_p.h b/src/corelib/tools/qstringiterator_p.h
index 7cf59ae42f..8b1a6a1cd3 100644
--- a/src/corelib/tools/qstringiterator_p.h
+++ b/src/corelib/tools/qstringiterator_p.h
@@ -60,12 +60,12 @@ QT_BEGIN_NAMESPACE
class QStringIterator
{
QString::const_iterator i, pos, e;
-
+ Q_STATIC_ASSERT((std::is_same<QString::const_iterator, const QChar *>::value));
public:
- inline explicit QStringIterator(const QString &string)
- : i(string.constBegin()),
- pos(string.constBegin()),
- e(string.constEnd())
+ explicit QStringIterator(QStringView string, qssize_t idx = 0)
+ : i(string.begin()),
+ pos(i + idx),
+ e(string.end())
{
}
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 75ff934f15..d65563f76d 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -299,6 +299,16 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QString
return res;
}
+template<typename T>
+static bool stringList_contains(const QStringList &stringList, const T &str, Qt::CaseSensitivity cs)
+{
+ for (const auto &string : stringList) {
+ if (string.size() == str.size() && string.compare(str, cs) == 0)
+ return true;
+ }
+ return false;
+}
+
/*!
\fn bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
@@ -312,12 +322,24 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QString
bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs)
{
- for (int i = 0; i < that->size(); ++i) {
- const QString & string = that->at(i);
- if (string.length() == str.length() && str.compare(string, cs) == 0)
- return true;
- }
- return false;
+ return stringList_contains(*that, str, cs);
+}
+
+/*!
+ \fn bool QStringList::contains(QLatin1String str, Qt::CaseSensitivity cs) const
+ \overload
+ \since 5.10
+
+ Returns \c true if the list contains the string \a str; otherwise
+ returns \c false. The search is case insensitive if \a cs is
+ Qt::CaseInsensitive; the search is case sensitive by default.
+
+ \sa indexOf(), lastIndexOf(), QString::contains()
+ */
+bool QtPrivate::QStringList_contains(const QStringList *that, QLatin1String str,
+ Qt::CaseSensitivity cs)
+{
+ return stringList_contains(*that, str, cs);
}
#ifndef QT_NO_REGEXP
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index 720d7d7419..b11856d9be 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -120,6 +120,7 @@ public:
#endif
inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline QStringList operator+(const QStringList &other) const
{ QStringList n = *this; n += other; return n; }
@@ -165,6 +166,7 @@ namespace QtPrivate {
Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &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, const QString &before, const QString &after,
Qt::CaseSensitivity cs);
@@ -222,6 +224,11 @@ inline bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) co
return QtPrivate::QStringList_contains(this, str, cs);
}
+inline bool QStringList::contains(QLatin1String str, Qt::CaseSensitivity cs) const
+{
+ return QtPrivate::QStringList_contains(this, str, cs);
+}
+
inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
{
QtPrivate::QStringList_replaceInStrings(self(), before, after, cs);
diff --git a/src/corelib/tools/qstringliteral.h b/src/corelib/tools/qstringliteral.h
new file mode 100644
index 0000000000..6a1a74a80e
--- /dev/null
+++ b/src/corelib/tools/qstringliteral.h
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 Intel Corporation.
+** 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 QSTRINGLITERAL_H
+#define QSTRINGLITERAL_H
+
+#include <QtCore/qarraydata.h>
+
+#if 0
+#pragma qt_class(QStringLiteral)
+#endif
+
+QT_BEGIN_NAMESPACE
+
+typedef QTypedArrayData<ushort> QStringData;
+
+#if defined(Q_OS_WIN) && !defined(Q_COMPILER_UNICODE_STRINGS)
+// fall back to wchar_t if the a Windows compiler does not
+// support Unicode string literals, assuming wchar_t is 2 bytes
+// on that platform (sanity-checked by static_assert further below)
+
+#if defined(Q_CC_MSVC)
+# define QT_UNICODE_LITERAL_II(str) L##str
+#else
+# define QT_UNICODE_LITERAL_II(str) L"" str
+#endif
+typedef wchar_t qunicodechar;
+
+#else
+// all our supported compilers support Unicode string literals,
+// even if their Q_COMPILER_UNICODE_STRING has been revoked due
+// to lacking stdlib support. But QStringLiteral only needs the
+// core language feature, so just use u"" here unconditionally:
+
+#define QT_UNICODE_LITERAL_II(str) u"" str
+typedef char16_t qunicodechar;
+
+#endif
+
+Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2,
+ "qunicodechar must typedef an integral type of size 2");
+
+#define QT_UNICODE_LITERAL(str) QT_UNICODE_LITERAL_II(str)
+#define QStringLiteral(str) \
+ ([]() Q_DECL_NOEXCEPT -> QString { \
+ enum { Size = sizeof(QT_UNICODE_LITERAL(str))/2 - 1 }; \
+ static const QStaticStringData<Size> qstring_literal = { \
+ Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \
+ QT_UNICODE_LITERAL(str) }; \
+ QStringDataPtr holder = { qstring_literal.data_ptr() }; \
+ const QString qstring_literal_temp(holder); \
+ return qstring_literal_temp; \
+ }()) \
+ /**/
+
+#define Q_STATIC_STRING_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset) \
+ { Q_REFCOUNT_INITIALIZE_STATIC, size, 0, 0, offset } \
+ /**/
+
+#define Q_STATIC_STRING_DATA_HEADER_INITIALIZER(size) \
+ 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))
+#endif
+
+template <int N>
+struct QStaticStringData
+{
+ QArrayData str;
+ qunicodechar data[N + 1];
+
+ QStringData *data_ptr() const
+ {
+ Q_ASSERT(str.ref.isStatic());
+ return const_cast<QStringData *>(static_cast<const QStringData*>(&str));
+ }
+};
+
+struct QStringDataPtr
+{
+ QStringData *ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QSTRINGLITERAL_H
diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/tools/qstringview.cpp
new file mode 100644
index 0000000000..8eefc6d814
--- /dev/null
+++ b/src/corelib/tools/qstringview.cpp
@@ -0,0 +1,777 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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.
+**
+** $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 "qstringview.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QStringView
+ \inmodule QtCore
+ \since 5.10
+ \brief The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.
+ \reentrant
+ \ingroup tools
+ \ingroup string-processing
+
+ A QStringView references a contiguous portion of a UTF-16 string it does
+ not own. It acts as an interface type to all kinds of UTF-16 string,
+ without the need to construct a QString first.
+
+ 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.
+
+ QStringView is designed as an interface type; its main use-case is
+ as a function parameter type. When QStringViews are used as automatic
+ variables or data members, care must be taken to ensure that the referenced
+ string data (for example, owned by a QString) outlives the QStringView on all code paths,
+ lest the string view ends up referencing deleted data.
+
+ When used as an interface type, QStringView allows a single function to accept
+ a wide variety of UTF-16 string data sources. One function accepting QStringView
+ thus replaces three function overloads (taking QString, QStringRef, and
+ \c{(const QChar*, int)}), while at the same time enabling even more string data
+ sources to be passed to the function, such as \c{u"Hello World"}, a \c char16_t
+ string literal.
+
+ QStringViews should be passed by value, not by reference-to-const:
+ \code
+ void myfun1(QStringView sv); // preferred
+ void myfun2(const QStringView &sv); // compiles and works, but slower
+ \endcode
+
+ If you want to give your users maximum freedom in what strings they can pass
+ to your function, accompany the QStringView overload with overloads for
+
+ \list
+ \li \e QChar: this overload can delegate to the QStringView version:
+ \code
+ void fun(QChar ch) { fun(QStringView(&ch, 1)); }
+ \endcode
+ even though, for technical reasons, QStringView cannot provide a
+ QChar constructor by itself.
+ \li \e QString: if you store an unmodified copy of the string and thus would
+ like to take advantage of QString's implicit sharing.
+ \li QLatin1String: if you can implement the function without converting the
+ QLatin1String to UTF-16 first; users expect a function overloaded on
+ QLatin1String to perform strictly less memory allocations than the
+ semantically equivalent call of the QStringView version, involving
+ construction of a QString from the QLatin1String.
+ \endlist
+
+ QStringView can also be used as the return value of a function. If you call a
+ function returning QStringView, take extra care to not keep the QStringView
+ around longer than the function promises to keep the referenced string data alive.
+ If in doubt, obtain a strong reference to the data by calling toString() to convert
+ the QStringView into a QString.
+
+ QStringView is a \e{Literal Type}, but since it stores data as \c{char16_t}, iteration
+ is not \c constexpr (casts from \c{const char16_t*} to \c{const QChar*}, which is not
+ allowed in \c constexpr functions). You can use an indexed loop and/or utf16() in
+ \c constexpr contexts instead.
+
+ \note We strongly discourage the use of QList<QStringView>,
+ because QList is a very inefficient container for QStringViews (it would heap-allocate
+ every element). Use QVector (or std::vector) to hold QStringViews instead.
+
+ \sa QString, QStringRef
+*/
+
+/*!
+ \typedef QStringView::value_type
+
+ Alias for \c{const QChar}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QStringView::difference_type
+
+ Alias for \c{std::ptrdiff_t}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QStringView::size_type
+
+ Alias for qssize_t. Provided for compatibility with the STL.
+
+ Unlike other Qt classes, QStringView uses qssize_t as its \c size_type, to allow
+ accepting data from \c{std::basic_string} without truncation. The Qt API functions,
+ for example length(), return \c int, while the STL-compatible functions, for example
+ size(), return \c size_type.
+*/
+
+/*!
+ \typedef QStringView::reference
+
+ Alias for \c{value_type &}. Provided for compatibility with the STL.
+
+ QStringView does not support mutable references, so this is the same
+ as const_reference.
+*/
+
+/*!
+ \typedef QStringView::const_reference
+
+ Alias for \c{value_type &}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QStringView::pointer
+
+ Alias for \c{value_type *}. Provided for compatibility with the STL.
+
+ QStringView does not support mutable pointers, so this is the same
+ as const_pointer.
+*/
+
+/*!
+ \typedef QStringView::const_pointer
+
+ Alias for \c{value_type *}. Provided for compatibility with the STL.
+*/
+
+/*!
+ \typedef QStringView::iterator
+
+ This typedef provides an STL-style const iterator for QStringView.
+
+ QStringView does not support mutable iterators, so this is the same
+ as const_iterator.
+
+ \sa const_iterator, reverse_iterator
+*/
+
+/*!
+ \typedef QStringView::const_iterator
+
+ This typedef provides an STL-style const iterator for QStringView.
+
+ \sa iterator, const_reverse_iterator
+*/
+
+/*!
+ \typedef QStringView::reverse_iterator
+
+ This typedef provides an STL-style const reverse iterator for QStringView.
+
+ QStringView does not support mutable reverse iterators, so this is the
+ same as const_reverse_iterator.
+
+ \sa const_reverse_iterator, iterator
+*/
+
+/*!
+ \typedef QStringView::const_reverse_iterator
+
+ This typedef provides an STL-style const reverse iterator for QStringView.
+
+ \sa reverse_iterator, const_iterator
+*/
+
+/*!
+ \fn QStringView::QStringView()
+
+ Constructs a null string view.
+
+ \sa isNull()
+*/
+
+/*!
+ \fn QStringView::QStringView(std::nullptr_t)
+
+ Constructs a null string view.
+
+ \sa isNull()
+*/
+
+/*!
+ \fn QStringView::QStringView(const Char *str, qssize_t len)
+
+ Constructs a string view on \a str with length \a len.
+
+ The range \c{[str,len)} must remain valid for the lifetime of this string view object.
+
+ Passing \c nullptr as \a str is safe if \a len is 0, too, and results in a null string view.
+
+ The behavior is undefined if \a len is negative or, when positive, if \a str is \c nullptr.
+
+ This constructor only participates in overload resolution if \c Char is a compatible
+ character type. The compatible character types are: \c QChar, \c ushort, \c char16_t and
+ (on platforms, such as Windows, where it is a 16-bit type) \c wchar_t.
+*/
+
+/*!
+ \fn QStringView::QStringView(const Char *first, const Char *last)
+
+ Constructs a string view on \a first with length (\a last - \a first).
+
+ The range \c{[first,last)} must remain valid for the lifetime of
+ this string view object.
+
+ Passing \c nullptr as \a first is safe if \a last is nullptr, too,
+ and results in a null string view.
+
+ The behavior is undefined if \a last precedes \a first, or \a first
+ is \c nullptr and \a last is not.
+
+ This constructor only participates in overload resolution if \c Char
+ is a compatible character type. The compatible character types
+ are: \c QChar, \c ushort, \c char16_t and (on platforms, such as
+ Windows, where it is a 16-bit type) \c wchar_t.
+*/
+
+/*!
+ \fn QStringView::QStringView(const Char *str)
+
+ Constructs a string view on \a str. The length is determined
+ by scanning for the first \c{Char(0)}.
+
+ \a str must remain valid for the lifetime of this string view object.
+
+ Passing \c nullptr as \a str is safe and results in a null string view.
+
+ This constructor only participates in overload resolution if \a
+ str is not an array and if \c Char is a compatible character
+ type. The compatible character types are: \c QChar, \c ushort, \c
+ char16_t and (on platforms, such as Windows, where it is a 16-bit
+ type) \c wchar_t.
+*/
+
+/*!
+ \fn QStringView::QStringView(const Char (&string)[N])
+
+ Constructs a string view on the character string literal \a string.
+ The length is set to \c{N-1}, excluding the trailing \{Char(0)}.
+ If you need the full array, use the constructor from pointer and
+ size instead:
+
+ \code
+ auto sv = QStringView(array, std::size(array)); // using C++17 std::size()
+ \endcode
+
+ \a string must remain valid for the lifetime of this string view
+ object.
+
+ This constructor only participates in overload resolution if \a
+ string is an actual array and \c Char is a compatible character
+ type. The compatible character types are: \c QChar, \c ushort, \c
+ char16_t and (on platforms, such as Windows, where it is a 16-bit
+ type) \c wchar_t.
+*/
+
+/*!
+ \fn QStringView::QStringView(const QString &str)
+
+ Constructs a string view on \a str.
+
+ \c{str.data()} must remain valid for the lifetime of this string view object.
+
+ The string view will be null if and only if \c{str.isNull()}.
+*/
+
+/*!
+ \fn QStringView::QStringView(const QStringRef &str)
+
+ Constructs a string view on \a str.
+
+ \c{str.data()} must remain valid for the lifetime of this string view object.
+
+ The string view will be null if and only if \c{str.isNull()}.
+*/
+
+/*!
+ \fn QStringView::QStringView(const StdBasicString &str)
+
+ Constructs a string view on \a str. The length is taken from \c{str.size()}.
+
+ \c{str.data()} must remain valid for the lifetime of this string view object.
+
+ This constructor only participates in overload resolution if \c StdBasicString is an
+ instantiation of \c std::basic_string with a compatible character type. The
+ compatible character types are: \c QChar, \c ushort, \c char16_t and
+ (on platforms, such as Windows, where it is a 16-bit type) \c wchar_t.
+
+ The string view will be empty if and only if \c{str.empty()}. It is unspecified
+ whether this constructor can result in a null string view (\c{str.data()} would
+ have to return \c nullptr for this).
+
+ \sa isNull(), isEmpty()
+*/
+
+/*!
+ \fn QString QStringView::toString() const
+
+ Returns a deep copy of this string view's data as a QString.
+
+ The return value will be the null QString if and only if this string view is null.
+
+ \warning QStringView can store strings with more than 2\sup{30} characters
+ while QString cannot. Calling this function on a string view for which size()
+ returns a value greater than \c{INT_MAX / 2} constitutes undefined behavior.
+*/
+
+/*!
+ \fn const QChar *QStringView::data() const
+
+ Returns a const pointer to the first character in the string.
+
+ \note The character array represented by the return value is \e not null-terminated.
+
+ \sa begin(), end(), utf16()
+*/
+
+/*!
+ \fn const storage_type *QStringView::utf16() const
+
+ Returns a const pointer to the first character in the string.
+
+ \c{storage_type} is \c{char16_t}, except on MSVC 2013 (which lacks \c char16_t support),
+ where it is \c{wchar_t} instead.
+
+ \note The character array represented by the return value is \e not null-terminated.
+
+ \sa begin(), end(), data()
+*/
+
+/*!
+ \fn QStringView::const_iterator QStringView::begin() const
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in
+ the string.
+
+ This function is provided for STL compatibility.
+
+ \sa end(), cbegin(), rbegin(), data()
+*/
+
+/*!
+ \fn QStringView::const_iterator QStringView::cbegin() const
+
+ Same as begin().
+
+ This function is provided for STL compatibility.
+
+ \sa cend(), begin(), crbegin(), data()
+*/
+
+/*!
+ \fn QStringView::const_iterator QStringView::end() const
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ character after the last character in the list.
+
+ This function is provided for STL compatibility.
+
+ \sa begin(), cend(), rend()
+*/
+
+/*! \fn QStringView::const_iterator QStringView::cend() const
+
+ Same as end().
+
+ This function is provided for STL compatibility.
+
+ \sa cbegin(), end(), crend()
+*/
+
+/*!
+ \fn QStringView::const_reverse_iterator QStringView::rbegin() const
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ character in the string, in reverse order.
+
+ This function is provided for STL compatibility.
+
+ \sa rend(), crbegin(), begin()
+*/
+
+/*!
+ \fn QStringView::const_reverse_iterator QStringView::crbegin() const
+
+ Same as rbegin().
+
+ This function is provided for STL compatibility.
+
+ \sa crend(), rbegin(), cbegin()
+*/
+
+/*!
+ \fn QStringView::const_reverse_iterator QStringView::rend() const
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last character in the string, in reverse order.
+
+ This function is provided for STL compatibility.
+
+ \sa rbegin(), crend(), end()
+*/
+
+/*!
+ \fn QStringView::const_reverse_iterator QStringView::crend() const
+
+ Same as rend().
+
+ This function is provided for STL compatibility.
+
+ \sa crbegin(), rend(), cend()
+*/
+
+/*!
+ \fn bool QStringView::empty() const
+
+ Returns whether this string view is empty - that is, whether \c{size() == 0}.
+
+ This function is provided for STL compatibility.
+
+ \sa isEmpty(), isNull(), size(), length()
+*/
+
+/*!
+ \fn bool QStringView::isEmpty() const
+
+ Returns whether this string view is empty - that is, whether \c{size() == 0}.
+
+ This function is provided for compatibility with other Qt containers.
+
+ \sa empty(), isNull(), size(), length()
+*/
+
+/*!
+ \fn bool QStringView::isNull() const
+
+ Returns whether this string view is null - that is, whether \c{data() == nullptr}.
+
+ This functions is provided for compatibility with other Qt containers.
+
+ \sa empty(), isEmpty(), size(), length()
+*/
+
+/*!
+ \fn qssize_t QStringView::size() const
+
+ Returns the size of this string view, in UTF-16 code points (that is,
+ surrogate pairs count as two for the purposes of this function, the same
+ as in QString and QStringRef).
+
+ \sa empty(), isEmpty(), isNull(), length()
+*/
+
+/*!
+ \fn int QStringView::length() const
+
+ Same as size(), except returns the result as an \c int.
+
+ This function is provided for compatibility with other Qt containers.
+
+ \warning QStringView can represent strings with more than 2\sup{31} characters.
+ Calling this function on a string view for which size() returns a value greater
+ than \c{INT_MAX} constitutes undefined behavior.
+
+ \sa empty(), isEmpty(), isNull(), size()
+*/
+
+/*!
+ \fn QChar QStringView::operator[](qssize_t n) const
+
+ Returns the character at position \a n in this string view.
+
+ The behavior is undefined if \a n is negative or not less than size().
+
+ \sa at(), front(), back()
+*/
+
+/*!
+ \fn QChar QStringView::at(qssize_t n) const
+
+ Returns the character at position \a n in this string view.
+
+ The behavior is undefined if \a n is negative or not less than size().
+
+ \sa operator[](), front(), back()
+*/
+
+/*!
+ \fn QChar QStringView::front() const
+
+ Returns the first character in the string. Same as first().
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string view constitutes
+ undefined behavior.
+
+ \sa back(), first(), last()
+*/
+
+/*!
+ \fn QChar QStringView::back() const
+
+ Returns the last character in the string. Same as last().
+
+ This function is provided for STL compatibility.
+
+ \warning Calling this function on an empty string view constitutes
+ undefined behavior.
+
+ \sa front(), first(), last()
+*/
+
+/*!
+ \fn QChar QStringView::first() const
+
+ Returns the first character in the string. Same as front().
+
+ This function is provided for compatibility with other Qt containers.
+
+ \warning Calling this function on an empty string view constitutes
+ undefined behavior.
+
+ \sa front(), back(), last()
+*/
+
+/*!
+ \fn QChar QStringView::last() const
+
+ Returns the last character in the string. Same as back().
+
+ This function is provided for compatibility with other Qt containers.
+
+ \warning Calling this function on an empty string view constitutes
+ undefined behavior.
+
+ \sa back(), front(), first()
+*/
+
+/*!
+ \fn QStringView QStringView::mid(qssize_t start) const
+
+ Returns the substring starting at position \a start in this object,
+ and extending to the end of the string.
+
+ \note The behavior is undefined when \a start < 0 or \a start > size().
+
+ \sa left(), right(), chopped(), chop(), truncate()
+*/
+
+/*!
+ \fn QStringView QStringView::mid(qssize_t start, qssize_t length) const
+ \overload
+
+ Returns the substring of length \a length starting at position
+ \a start in this object.
+
+ \note The behavior is undefined when \a start < 0, \a length < 0,
+ or \a start + \a length > size().
+
+ \sa left(), right(), chopped(), chop(), truncate()
+*/
+
+/*!
+ \fn QStringView QStringView::left(qssize_t length) const
+
+ Returns the substring of length \a length starting at position
+ 0 in this object.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), right(), chopped(), chop(), truncate()
+*/
+
+/*!
+ \fn QStringView QStringView::right(qssize_t length) const
+
+ Returns the substring of length \a length starting at position
+ size() - \a length in this object.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), chopped(), chop(), truncate()
+*/
+
+/*!
+ \fn QStringView QStringView::chopped(qssize_t length) const
+
+ Returns the substring of length size() - \a length starting at the
+ beginning of this object.
+
+ Same as \c{left(size() - length)}.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), right(), chop(), truncate()
+*/
+
+/*!
+ \fn void QStringView::truncate(qssize_t length)
+
+ Truncates this string view to length \a length.
+
+ Same as \c{*this = left(length)}.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), right(), chopped(), chop()
+*/
+
+/*!
+ \fn void QStringView::chop(qssize_t length)
+
+ Truncates this string view by \a length characters.
+
+ Same as \c{*this = left(size() - length)}.
+
+ \note The behavior is undefined when \a length < 0 or \a length > size().
+
+ \sa mid(), left(), right(), chopped(), truncate()
+*/
+
+/*!
+ \fn QStringView QStringView::trimmed() const
+
+ Strips leading and trailing whitespace and returns the result.
+
+ Whitespace means any character for which QChar::isSpace() returns
+ \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
+ '\\f', '\\r', and ' '.
+
+ \sa qTrimmed()
+*/
+
+/*!
+ \fn bool QStringView::startsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \fn bool QStringView::startsWith(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \fn bool QStringView::startsWith(QChar ch) const
+ \fn bool QStringView::startsWith(QChar ch, Qt::CaseSensitivity cs) const
+
+ Returns \c true if this string-view starts with string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively;
+ otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive;
+ otherwise the search is case-insensitive.
+
+ \sa endsWith(), qStartsWith()
+*/
+
+/*!
+ \fn bool QStringView::endsWith(QStringView str, Qt::CaseSensitivity cs) const
+ \fn bool QStringView::endsWith(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \fn bool QStringView::endsWith(QChar ch) const
+ \fn bool QStringView::endsWith(QChar ch, Qt::CaseSensitivity cs) const
+
+ Returns \c true if this string-view ends with string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively;
+ otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is case-sensitive;
+ otherwise the search is case-insensitive.
+
+ \sa startsWith(), qEndsWith()
+*/
+
+/*!
+ \fn QByteArray QStringView::toLatin1() const
+
+ Returns a Latin-1 representation of the string as a QByteArray.
+
+ The behavior is undefined if the string contains non-Latin1 characters.
+
+ \sa toUtf8(), toLocal8Bit(), QTextCodec, qConvertToLatin1()
+*/
+
+/*!
+ \fn QByteArray QStringView::toLocal8Bit() const
+
+ Returns a local 8-bit representation of the string as a QByteArray.
+
+ QTextCodec::codecForLocale() is used to perform the conversion from
+ Unicode. If the locale's encoding could not be determined, this function
+ does the same as toLatin1().
+
+ The behavior is undefined if the string contains characters not
+ supported by the locale's 8-bit encoding.
+
+ \sa toLatin1(), toUtf8(), QTextCodec, qConvertToLocal8Bit()
+*/
+
+/*!
+ \fn QByteArray QStringView::toUtf8() const
+
+ Returns a UTF-8 representation of the string as a QByteArray.
+
+ UTF-8 is a Unicode codec and can represent all characters in a Unicode
+ string like QString.
+
+ \sa toLatin1(), toLocal8Bit(), QTextCodec, qConvertToUtf8()
+*/
+
+/*!
+ \fn QVector<uint> QStringView::toUcs4() const
+
+ Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
+
+ UCS-4 is a Unicode codec and therefore it is lossless. All characters from
+ this string will be encoded in UCS-4. Any invalid sequence of code units in
+ this string is replaced by the Unicode replacement character
+ (QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
+
+ The returned vector is not 0-terminated.
+
+ \sa toUtf8(), toLatin1(), toLocal8Bit(), QTextCodec
+*/
+
+/*!
+ \fn qToStringViewIgnoringNull(const QStringLike &s);
+ \since 5.10
+ \internal
+
+ Convert \a s to a QStringView ignoring \c{s.isNull()}.
+
+ Returns a string-view that references \a{s}' data, but is never null.
+
+ This is a faster way to convert a QString or QStringRef to a QStringView,
+ if null QStrings can legitimately be treated as empty ones.
+
+ \sa QString::isNull(), QStringRef::isNull(), QStringView
+*/
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstringview.h b/src/corelib/tools/qstringview.h
new file mode 100644
index 0000000000..24be441b00
--- /dev/null
+++ b/src/corelib/tools/qstringview.h
@@ -0,0 +1,305 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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.
+**
+** $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 QSTRINGVIEW_H
+#define QSTRINGVIEW_H
+
+#ifndef QT_STRINGVIEW_LEVEL
+# define QT_STRINGVIEW_LEVEL 1
+#endif
+
+#include <QtCore/qchar.h>
+#include <QtCore/qbytearray.h>
+#include <QtCore/qstringliteral.h>
+#include <QtCore/qstringalgorithms.h>
+
+#include <string>
+
+QT_BEGIN_NAMESPACE
+
+class QString;
+class QStringRef;
+
+namespace QtPrivate {
+template <typename Char>
+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
+ : IsCompatibleCharTypeHelper<typename std::remove_cv<typename std::remove_reference<Char>::type>::type> {};
+
+template <typename Array>
+struct IsCompatibleArrayHelper : std::false_type {};
+template <typename Char, size_t N>
+struct IsCompatibleArrayHelper<Char[N]>
+ : IsCompatibleCharType<Char> {};
+template <typename Array>
+struct IsCompatibleArray
+ : IsCompatibleArrayHelper<typename std::remove_cv<typename std::remove_reference<Array>::type>::type> {};
+
+template <typename Pointer>
+struct IsCompatiblePointerHelper : std::false_type {};
+template <typename Char>
+struct IsCompatiblePointerHelper<Char*>
+ : IsCompatibleCharType<Char> {};
+template <typename Pointer>
+struct IsCompatiblePointer
+ : IsCompatiblePointerHelper<typename std::remove_cv<typename std::remove_reference<Pointer>::type>::type> {};
+
+template <typename T>
+struct IsCompatibleStdBasicStringHelper : std::false_type {};
+template <typename Char, typename...Args>
+struct IsCompatibleStdBasicStringHelper<std::basic_string<Char, Args...> >
+ : IsCompatibleCharType<Char> {};
+
+template <typename T>
+struct IsCompatibleStdBasicString
+ : IsCompatibleStdBasicStringHelper<
+ typename std::remove_cv<typename std::remove_reference<T>::type>::type
+ > {};
+
+} // namespace QtPrivate
+
+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 qssize_t size_type;
+ typedef value_type &reference;
+ typedef value_type &const_reference;
+ typedef value_type *pointer;
+ typedef value_type *const_pointer;
+
+ typedef pointer iterator;
+ typedef const_pointer const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+private:
+ template <typename Char>
+ using if_compatible_char = typename std::enable_if<QtPrivate::IsCompatibleCharType<Char>::value, bool>::type;
+
+ template <typename Array>
+ using if_compatible_array = typename std::enable_if<QtPrivate::IsCompatibleArray<Array>::value, bool>::type;
+
+ template <typename Pointer>
+ using if_compatible_pointer = typename std::enable_if<QtPrivate::IsCompatiblePointer<Pointer>::value, bool>::type;
+
+ template <typename T>
+ using if_compatible_string = typename std::enable_if<QtPrivate::IsCompatibleStdBasicString<T>::value, bool>::type;
+
+ template <typename T>
+ 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 qssize_t lengthHelperArray(const Char (&)[N]) Q_DECL_NOTHROW
+ {
+ return qssize_t(N - 1);
+ }
+ template <typename Char>
+ static Q_DECL_RELAXED_CONSTEXPR qssize_t lengthHelperPointer(const Char *str) Q_DECL_NOTHROW
+ {
+ qssize_t result = 0;
+ while (*str++)
+ ++result;
+ return result;
+ }
+ static Q_DECL_RELAXED_CONSTEXPR qssize_t lengthHelperPointer(const QChar *str) Q_DECL_NOTHROW
+ {
+ qssize_t result = 0;
+ while (!str++->isNull())
+ ++result;
+ return result;
+ }
+
+ template <typename Char>
+ static const storage_type *castHelper(const Char *str) Q_DECL_NOTHROW
+ { return reinterpret_cast<const storage_type*>(str); }
+ static Q_DECL_CONSTEXPR const storage_type *castHelper(const storage_type *str) Q_DECL_NOTHROW
+ { return str; }
+
+public:
+ Q_DECL_CONSTEXPR QStringView() Q_DECL_NOTHROW
+ : m_size(0), m_data(nullptr) {}
+ Q_DECL_CONSTEXPR QStringView(std::nullptr_t) Q_DECL_NOTHROW
+ : QStringView() {}
+
+ template <typename Char, if_compatible_char<Char> = true>
+ Q_DECL_CONSTEXPR QStringView(const Char *str, qssize_t len)
+ : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)),
+ m_data(castHelper(str)) {}
+
+ template <typename Char, if_compatible_char<Char> = true>
+ Q_DECL_CONSTEXPR QStringView(const Char *f, const Char *l)
+ : QStringView(f, l - f) {}
+
+#ifdef Q_QDOC
+ template <typename Char, size_t N>
+ Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) Q_DECL_NOTHROW;
+
+ template <typename Char>
+ Q_DECL_CONSTEXPR QStringView(const Char *str) Q_DECL_NOTHROW;
+#else
+ template <typename Array, if_compatible_array<Array> = true>
+ Q_DECL_CONSTEXPR QStringView(const Array &str) Q_DECL_NOTHROW
+ : QStringView(str, lengthHelperArray(str)) {}
+
+ template <typename Pointer, if_compatible_pointer<Pointer> = true>
+ Q_DECL_CONSTEXPR QStringView(const Pointer &str) Q_DECL_NOTHROW
+ : QStringView(str, str ? lengthHelperPointer(str) : 0) {}
+#endif
+
+#ifdef Q_QDOC
+ QStringView(const QString &str) Q_DECL_NOTHROW;
+ QStringView(const QStringRef &str) Q_DECL_NOTHROW;
+#else
+ template <typename String, if_compatible_qstring_like<String> = true>
+ QStringView(const String &str) Q_DECL_NOTHROW
+ : QStringView(str.isNull() ? nullptr : str.data(), qssize_t(str.size())) {}
+#endif
+
+ template <typename StdBasicString, if_compatible_string<StdBasicString> = true>
+ QStringView(const StdBasicString &str) Q_DECL_NOTHROW
+ : QStringView(str.data(), qssize_t(str.size())) {}
+
+ Q_REQUIRED_RESULT inline QString toString() const; // defined in qstring.h
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR qssize_t 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 QChar operator[](qssize_t n) const
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n < size()), QChar(m_data[n]); }
+
+ //
+ // QString API
+ //
+
+ Q_REQUIRED_RESULT QByteArray toLatin1() const { return qConvertToLatin1(*this); }
+ Q_REQUIRED_RESULT QByteArray toUtf8() const { return qConvertToUtf8(*this); }
+ Q_REQUIRED_RESULT QByteArray toLocal8Bit() const { return qConvertToLocal8Bit(*this); }
+ Q_REQUIRED_RESULT inline QVector<uint> toUcs4() const; // defined in qvector.h
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar at(qssize_t n) const { return (*this)[n]; }
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QStringView mid(qssize_t pos) const
+ { return Q_ASSERT(pos >= 0), Q_ASSERT(pos <= size()), QStringView(m_data + pos, m_size - pos); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QStringView mid(qssize_t pos, qssize_t n) const
+ { return Q_ASSERT(pos >= 0), Q_ASSERT(n >= 0), Q_ASSERT(pos + n <= size()), QStringView(m_data + pos, n); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QStringView left(qssize_t n) const
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QStringView(m_data, n); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QStringView right(qssize_t n) const
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QStringView(m_data + m_size - n, n); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QStringView chopped(qssize_t n) const
+ { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QStringView(m_data, m_size - n); }
+
+ Q_DECL_RELAXED_CONSTEXPR void truncate(qssize_t n)
+ { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size = n; }
+ Q_DECL_RELAXED_CONSTEXPR void chop(qssize_t n)
+ { Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size -= n; }
+
+ Q_REQUIRED_RESULT QStringView trimmed() const Q_DECL_NOTHROW { return qTrimmed(*this); }
+
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qStartsWith(*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
+ { return !empty() && front() == c; }
+ Q_REQUIRED_RESULT bool startsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ { return qStartsWith(*this, QStringView(&c, 1), cs); }
+
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ { return qEndsWith(*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
+ { return !empty() && back() == c; }
+ Q_REQUIRED_RESULT bool endsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ { return qEndsWith(*this, QStringView(&c, 1), cs); }
+
+ //
+ // 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 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 int length() const /* not nothrow! */
+ { return Q_ASSERT(int(size()) == size()), int(size()); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar first() const { return front(); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar last() const { return back(); }
+private:
+ qssize_t m_size;
+ const storage_type *m_data;
+};
+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
+{ return QStringView(s.data(), s.size()); }
+
+QT_END_NAMESPACE
+
+#endif /* QSTRINGVIEW_H */
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index c4cd76c59c..6a26993549 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -338,12 +338,9 @@ QTimeZone::QTimeZone(const QByteArray &ianaId)
*/
QTimeZone::QTimeZone(int offsetSeconds)
+ : d((offsetSeconds >= MinUtcOffsetSecs && offsetSeconds <= MaxUtcOffsetSecs)
+ ? new QUtcTimeZonePrivate(offsetSeconds) : nullptr)
{
- // offsetSeconds must fall between -14:00 and +14:00 hours
- if (offsetSeconds >= -50400 && offsetSeconds <= 50400)
- d = new QUtcTimeZonePrivate(offsetSeconds);
- else
- d = 0;
}
/*!
diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/tools/qtimezone.h
index bd87139f5b..29d8a4dbe5 100644
--- a/src/corelib/tools/qtimezone.h
+++ b/src/corelib/tools/qtimezone.h
@@ -59,6 +59,14 @@ class QTimeZonePrivate;
class Q_CORE_EXPORT QTimeZone
{
public:
+ // Sane UTC offsets range from -14 to +14 hours:
+ enum {
+ // No known zone > 12 hrs West of Greenwich (Baker Island, USA)
+ MinUtcOffsetSecs = -14 * 3600,
+ // No known zone > 14 hrs East of Greenwich (Kiritimati, Christmas Island, Kiribati)
+ MaxUtcOffsetSecs = +14 * 3600
+ };
+
enum TimeType {
StandardTime = 0,
DaylightTime = 1,
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp
index 7b780ecf7d..e45dd48de0 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/tools/qtimezoneprivate.cpp
@@ -258,6 +258,8 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs,
brackets the correct time and at most one DST transition.
*/
const qint64 sixteenHoursInMSecs(16 * 3600 * 1000);
+ Q_STATIC_ASSERT(-sixteenHoursInMSecs / 1000 < QTimeZone::MinUtcOffsetSecs
+ && sixteenHoursInMSecs / 1000 > QTimeZone::MaxUtcOffsetSecs);
/*
Offsets are Local - UTC, positive to the east of Greenwich, negative to
the west; DST offset always exceeds standard offset, when DST applies.
diff --git a/src/corelib/tools/qtimezoneprivate_data_p.h b/src/corelib/tools/qtimezoneprivate_data_p.h
index 6bbcb0e2cd..69b9417f19 100644
--- a/src/corelib/tools/qtimezoneprivate_data_p.h
+++ b/src/corelib/tools/qtimezoneprivate_data_p.h
@@ -114,12 +114,13 @@ struct QUtcData {
// GENERATED PART STARTS HERE
/*
- This part of the file was generated on 2016-03-19 from the
+ 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 change this data, only generate it using cldr2qtimezone.py.
+ 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
diff --git a/src/corelib/tools/qtimezoneprivate_icu.cpp b/src/corelib/tools/qtimezoneprivate_icu.cpp
index a7226f2720..5570ce7571 100644
--- a/src/corelib/tools/qtimezoneprivate_icu.cpp
+++ b/src/corelib/tools/qtimezoneprivate_icu.cpp
@@ -477,9 +477,10 @@ QList<QByteArray> QIcuTimeZonePrivate::availableTimeZoneIds() const
QList<QByteArray> QIcuTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const
{
- QByteArray regionCode = QLocalePrivate::countryToCode(country).toUtf8();
+ const QLatin1String regionCode = QLocalePrivate::countryToCode(country);
+ const QByteArray regionCodeUtf8 = QString(regionCode).toUtf8();
UErrorCode status = U_ZERO_ERROR;
- UEnumeration *uenum = ucal_openCountryTimeZones(regionCode, &status);
+ UEnumeration *uenum = ucal_openCountryTimeZones(regionCodeUtf8.data(), &status);
QList<QByteArray> result;
if (U_SUCCESS(status))
result = uenumToIdList(uenum);
diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/tools/qtimezoneprivate_mac.mm
index 4e9a432fbf..876dc2d877 100644
--- a/src/corelib/tools/qtimezoneprivate_mac.mm
+++ b/src/corelib/tools/qtimezoneprivate_mac.mm
@@ -226,27 +226,79 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
QTimeZonePrivate::Data QMacTimeZonePrivate::previousTransition(qint64 beforeMSecsSinceEpoch) const
{
- // No direct Mac API, so get all transitions since epoch and return the last one
- QList<int> secsList;
- if (beforeMSecsSinceEpoch > 0) {
- const int endSecs = beforeMSecsSinceEpoch / 1000.0;
- NSTimeInterval prevSecs = 0;
- NSTimeInterval nextSecs = 0;
- NSDate *nextDate = [NSDate dateWithTimeIntervalSince1970:nextSecs];
- // If invalid may return a nil date or an Epoch date
+ // The native API only lets us search forward, so we need to find an early-enough start:
+ const NSTimeInterval lowerBound = std::numeric_limits<NSTimeInterval>::min();
+ const qint64 endSecs = beforeMSecsSinceEpoch / 1000;
+ const int year = 366 * 24 * 3600; // a (long) year, in seconds
+ NSTimeInterval prevSecs = endSecs; // sentinel for later check
+ NSTimeInterval nextSecs = prevSecs - year;
+ NSTimeInterval tranSecs = lowerBound; // time at a transition; may be > endSecs
+
+ NSDate *nextDate = [NSDate dateWithTimeIntervalSince1970:nextSecs];
+ nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate];
+ if (nextDate != nil
+ && (tranSecs = [nextDate timeIntervalSince1970]) < endSecs) {
+ // There's a transition within the last year before endSecs:
+ nextSecs = tranSecs;
+ } else {
+ // Need to start our search earlier:
+ nextDate = [NSDate dateWithTimeIntervalSince1970:lowerBound];
nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate];
- nextSecs = [nextDate timeIntervalSince1970];
- while (nextDate != nil && nextSecs > prevSecs && nextSecs < endSecs) {
- secsList.append(nextSecs);
- prevSecs = nextSecs;
- nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate];
+ if (nextDate != nil) {
+ NSTimeInterval lateSecs = nextSecs;
nextSecs = [nextDate timeIntervalSince1970];
- }
+ Q_ASSERT(nextSecs <= endSecs - year || nextSecs == tranSecs);
+ /*
+ We're looking at the first ever transition for our zone, at
+ nextSecs (and our zone *does* have at least one transition). If
+ it's later than endSecs - year, then we must have found it on the
+ initial check and therefore set tranSecs to the same transition
+ time (which, we can infer here, is >= endSecs). In this case, we
+ won't enter the binary-chop loop, below.
+
+ In the loop, nextSecs < lateSecs < endSecs: we have a transition
+ at nextSecs and there is no transition between lateSecs and
+ endSecs. The loop narrows the interval between nextSecs and
+ lateSecs by looking for a transition after their mid-point; if it
+ finds one < endSecs, nextSecs moves to this transition; otherwise,
+ lateSecs moves to the mid-point. This soon enough narrows the gap
+ to within a year, after which walking forward one transition at a
+ time (the "Wind through" loop, below) is good enough.
+ */
+
+ // Binary chop to within a year of last transition before endSecs:
+ while (nextSecs + year < lateSecs) {
+ // Careful about overflow, not fussy about rounding errors:
+ NSTimeInterval middle = nextSecs / 2 + lateSecs / 2;
+ NSDate *split = [NSDate dateWithTimeIntervalSince1970:middle];
+ split = [m_nstz nextDaylightSavingTimeTransitionAfterDate:split];
+ if (split != nil
+ && (tranSecs = [split timeIntervalSince1970]) < endSecs) {
+ nextDate = split;
+ nextSecs = tranSecs;
+ } else {
+ lateSecs = middle;
+ }
+ }
+ Q_ASSERT(nextDate != nil);
+ // ... and nextSecs < endSecs unless first transition ever was >= endSecs.
+ } // else: we have no data - prevSecs is still endSecs, nextDate is still nil
}
- if (secsList.size() >= 1)
- return data(qint64(secsList.constLast()) * 1000);
- else
- return invalidData();
+ // Either nextDate is nil or nextSecs is at its transition.
+
+ // Wind through remaining transitions (spanning at most a year), one at a time:
+ while (nextDate != nil && nextSecs < endSecs) {
+ prevSecs = nextSecs;
+ nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate];
+ nextSecs = [nextDate timeIntervalSince1970];
+ if (nextSecs <= prevSecs) // presumably no later data available
+ break;
+ }
+ if (prevSecs < endSecs) // i.e. we did make it into that while loop
+ return data(qint64(prevSecs) * 1000);
+
+ // No transition data; or first transition later than requested time.
+ return invalidData();
}
QByteArray QMacTimeZonePrivate::systemTimeZoneId() const
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 1714c9802f..521475c2dd 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -134,8 +134,6 @@ struct QTzType {
int tz_gmtoff; // UTC offset in seconds
bool tz_isdst; // Is DST
quint8 tz_abbrind; // abbreviation list index
- bool tz_ttisgmt; // Is in UTC time
- bool tz_ttisstd; // Is in Standard time
};
Q_DECLARE_TYPEINFO(QTzType, Q_PRIMITIVE_TYPE);
@@ -234,9 +232,6 @@ static QVector<QTzType> parseTzTypes(QDataStream &ds, int tzh_typecnt)
// Parse Abbreviation Array Index, 1 byte
if (ds.status() == QDataStream::Ok)
ds >> type.tz_abbrind;
- // Set defaults in case not populated later
- type.tz_ttisgmt = false;
- type.tz_ttisstd = false;
if (ds.status() != QDataStream::Ok)
types.resize(i);
}
@@ -302,20 +297,24 @@ static QVector<QTzType> parseTzIndicators(QDataStream &ds, const QVector<QTzType
{
QVector<QTzType> result = types;
bool temp;
-
- // Parse tzh_ttisstdcnt x 1-byte standard/wall indicators
- for (int i = 0; i < tzh_ttisstdcnt && ds.status() == QDataStream::Ok; ++i) {
+ /*
+ Scan and discard indicators.
+
+ These indicators are only of use (by the date program) when "handling
+ POSIX-style time zone environment variables". The flags here say whether
+ the *specification* of the zone gave the time in UTC, local standard time
+ or local wall time; but whatever was specified has been digested for us,
+ already, by the zone-info compiler (zic), so that the tz_time values read
+ from the file (by parseTzTransitions) are all in UTC.
+ */
+
+ // Scan tzh_ttisstdcnt x 1-byte standard/wall indicators
+ for (int i = 0; i < tzh_ttisstdcnt && ds.status() == QDataStream::Ok; ++i)
ds >> temp;
- if (ds.status() == QDataStream::Ok)
- result[i].tz_ttisstd = temp;
- }
- // Parse tzh_ttisgmtcnt x 1-byte UTC/local indicators
- for (int i = 0; i < tzh_ttisgmtcnt && ds.status() == QDataStream::Ok; ++i) {
+ // Scan tzh_ttisgmtcnt x 1-byte UTC/local indicators
+ for (int i = 0; i < tzh_ttisgmtcnt && ds.status() == QDataStream::Ok; ++i)
ds >> temp;
- if (ds.status() == QDataStream::Ok)
- result[i].tz_ttisgmt = temp;
- }
return result;
}
@@ -790,14 +789,7 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
tran.ruleIndex = ruleIndex;
}
- // TODO convert to UTC if not in UTC
- if (tz_type.tz_ttisgmt)
- tran.atMSecsSinceEpoch = tz_tran.tz_time * 1000;
- else if (tz_type.tz_ttisstd)
- tran.atMSecsSinceEpoch = tz_tran.tz_time * 1000;
- else
- tran.atMSecsSinceEpoch = tz_tran.tz_time * 1000;
-
+ tran.atMSecsSinceEpoch = tz_tran.tz_time * 1000;
m_tranTimes.append(tran);
}
diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp
index f963e10333..a50227d3cc 100644
--- a/src/corelib/tools/qtimezoneprivate_win.cpp
+++ b/src/corelib/tools/qtimezoneprivate_win.cpp
@@ -386,7 +386,7 @@ static QLocale::Country userCountry()
const GEOID id = GetUserGeoID(GEOCLASS_NATION);
wchar_t code[3];
const int size = GetGeoInfo(id, GEO_ISO2, code, 3, 0);
- return (size == 3) ? QLocalePrivate::codeToCountry(reinterpret_cast<const QChar*>(code), size)
+ return (size == 3) ? QLocalePrivate::codeToCountry(QStringView(code, size))
: QLocale::AnyCountry;
}
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index d99eebd4b9..90311ac55b 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -56,9 +56,6 @@
QT_BEGIN_NAMESPACE
-template<class T, int Prealloc>
-class QPodList;
-
// Prealloc = 256 by default, specified in qcontainerfwd.h
template<class T, int Prealloc>
class QVarLengthArray
@@ -234,9 +231,9 @@ public:
inline const T &front() const { return first(); }
inline T &back() { return last(); }
inline const T &back() const { return last(); }
+ void shrink_to_fit() { squeeze(); }
private:
- friend class QPodList<T, Prealloc>;
void realloc(int size, int alloc);
int a; // capacity
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 127afcd069..be2bdeda07 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -190,6 +190,12 @@
\overload
*/
+/*! \fn void QVarLengthArray::shrink_to_fit()
+ \since 5.10
+
+ Same as squeeze(). Provided for STL-compatibility.
+*/
+
/*! \fn bool QVarLengthArray::isEmpty() const
Returns \c true if the array has size 0; otherwise returns \c false.
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index da15d401e3..f00cecbc83 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -147,8 +147,8 @@ public:
void remove(int i, int n);
inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(d->begin()); }
inline void removeLast();
- inline T takeFirst() { Q_ASSERT(!isEmpty()); T r = first(); removeFirst(); return r; }
- inline T takeLast() { Q_ASSERT(!isEmpty()); T r = last(); removeLast(); return r; }
+ T takeFirst() { Q_ASSERT(!isEmpty()); T r = std::move(first()); removeFirst(); return r; }
+ T takeLast() { Q_ASSERT(!isEmpty()); T r = std::move(last()); removeLast(); return r; }
QVector<T> &fill(const T &t, int size = -1);
@@ -180,7 +180,7 @@ public:
return true;
}
int length() const { return size(); }
- T takeAt(int i) { T t = at(i); remove(i); return t; }
+ T takeAt(int i) { T t = std::move((*this)[i]); remove(i); return t; }
void move(int from, int to)
{
Q_ASSERT_X(from >= 0 && from < size(), "QVector::move(int,int)", "'from' is out-of-range");
@@ -268,6 +268,7 @@ public:
inline const_reference front() const { return first(); }
inline reference back() { return last(); }
inline const_reference back() const { return last(); }
+ void shrink_to_fit() { squeeze(); }
// comfort
QVector<T> &operator+=(const QVector<T> &l);
@@ -1003,6 +1004,8 @@ Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector<QPointF>;
Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector<QPoint>;
#endif
+QVector<uint> QStringView::toUcs4() const { return qConvertToUcs4(*this); }
+
QT_END_NAMESPACE
#endif // QVECTOR_H
diff --git a/src/corelib/tools/qvector.qdoc b/src/corelib/tools/qvector.qdoc
index 0ea47b1a1a..61fb3d494d 100644
--- a/src/corelib/tools/qvector.qdoc
+++ b/src/corelib/tools/qvector.qdoc
@@ -1124,6 +1124,13 @@
\overload
*/
+/*! \fn void QVector::shrink_to_fit()
+ \since 5.10
+
+ This function is provided for STL compatibility. It is equivalent
+ to squeeze().
+*/
+
/*! \fn bool QVector::empty() const
This function is provided for STL compatibility. It is equivalent
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp
index 97e5da8b3c..0f237bce87 100644
--- a/src/corelib/tools/qversionnumber.cpp
+++ b/src/corelib/tools/qversionnumber.cpp
@@ -406,10 +406,8 @@ QString QVersionNumber::toString() const
return version;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
- \fn QVersionNumber QVersionNumber::fromString(const QString &string,
- int *suffixIndex)
-
Constructs a QVersionNumber from a specially formatted \a string of
non-negative decimal numbers delimited by '.'.
@@ -423,14 +421,53 @@ QString QVersionNumber::toString() const
*/
QVersionNumber QVersionNumber::fromString(const QString &string, int *suffixIndex)
{
- QVector<int> seg;
+ return fromString(QLatin1String(string.toLatin1()), suffixIndex);
+}
+#endif
+
+/*!
+ \since 5.10
+ \overload
+
+ Constructs a QVersionNumber from a specially formatted \a string of
+ non-negative decimal numbers delimited by '.'.
+
+ Once the numerical segments have been parsed, the remainder of the string
+ is considered to be the suffix string. The start index of that string will be
+ stored in \a suffixIndex if it is not null.
+
+ \snippet qversionnumber/main.cpp 3
+
+ \sa isNull()
+*/
+QVersionNumber QVersionNumber::fromString(QStringView string, int *suffixIndex)
+{
+ return fromString(QLatin1String(string.toLatin1()), suffixIndex);
+}
+
+/*!
+ \since 5.10
+ \overload
- const QByteArray cString(string.toLatin1());
+ Constructs a QVersionNumber from a specially formatted \a string of
+ non-negative decimal numbers delimited by '.'.
+
+ Once the numerical segments have been parsed, the remainder of the string
+ is considered to be the suffix string. The start index of that string will be
+ stored in \a suffixIndex if it is not null.
+
+ \snippet qversionnumber/main.cpp 3-latin1-1
+
+ \sa isNull()
+*/
+QVersionNumber QVersionNumber::fromString(QLatin1String string, int *suffixIndex)
+{
+ QVector<int> seg;
- const char *start = cString.constData();
+ const char *start = string.begin();
const char *end = start;
const char *lastGoodEnd = start;
- const char *endOfString = cString.constData() + cString.size();
+ const char *endOfString = string.end();
do {
bool ok = false;
@@ -443,7 +480,7 @@ QVersionNumber QVersionNumber::fromString(const QString &string, int *suffixInde
} while (start < endOfString && (end < endOfString && *end == '.'));
if (suffixIndex)
- *suffixIndex = int(lastGoodEnd - cString.constData());
+ *suffixIndex = int(lastGoodEnd - string.begin());
return QVersionNumber(qMove(seg));
}
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h
index d3cf743a67..3836bc2119 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber.h
@@ -280,7 +280,11 @@ public:
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2);
Q_REQUIRED_RESULT Q_CORE_EXPORT QString toString() const;
+#if QT_STRINGVIEW_LEVEL < 2
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR);
+#endif
+ Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QLatin1String string, int *suffixIndex = nullptr);
+ Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QStringView string, int *suffixIndex = nullptr);
private:
#ifndef QT_NO_DATASTREAM
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index b705d4221a..aa545497a2 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -39,7 +39,6 @@ HEADERS += \
tools/qmargins.h \
tools/qmessageauthenticationcode.h \
tools/qcontiguouscache.h \
- tools/qpodlist_p.h \
tools/qpair.h \
tools/qpoint.h \
tools/qqueue.h \
@@ -58,11 +57,14 @@ HEADERS += \
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 \
@@ -107,6 +109,7 @@ SOURCES += \
tools/qstring.cpp \
tools/qstringbuilder.cpp \
tools/qstringlist.cpp \
+ tools/qstringview.cpp \
tools/qtextboundaryfinder.cpp \
tools/qtimeline.cpp \
tools/qunicodetools.cpp \
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index af35193b13..f6ae3571ab 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -775,8 +775,8 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
tagStackStringStorage.reserve(32);
tagStackStringStorageSize = 0;
NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();
- namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml"));
- namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace"));
+ namespaceDeclaration.prefix = addToStringStorage(QStringViewLiteral("xml"));
+ namespaceDeclaration.namespaceUri = addToStringStorage(QStringViewLiteral("http://www.w3.org/XML/1998/namespace"));
initialTagStackStringStorageSize = tagStackStringStorageSize;
}
@@ -796,11 +796,17 @@ QXmlStreamReaderPrivate::QXmlStreamReaderPrivate(QXmlStreamReader *q)
reallocateStack();
entityResolver = 0;
init();
- entityHash.insert(QLatin1String("lt"), Entity::createLiteral(QLatin1String("<")));
- entityHash.insert(QLatin1String("gt"), Entity::createLiteral(QLatin1String(">")));
- entityHash.insert(QLatin1String("amp"), Entity::createLiteral(QLatin1String("&")));
- entityHash.insert(QLatin1String("apos"), Entity::createLiteral(QLatin1String("'")));
- entityHash.insert(QLatin1String("quot"), Entity::createLiteral(QLatin1String("\"")));
+#define ADD_PREDEFINED(n, v) \
+ do { \
+ Entity e = Entity::createLiteral(QLatin1String(n), QLatin1String(v)); \
+ entityHash.insert(qToStringViewIgnoringNull(e.name), std::move(e)); \
+ } while (false)
+ ADD_PREDEFINED("lt", "<");
+ ADD_PREDEFINED("gt", ">");
+ ADD_PREDEFINED("amp", "&");
+ ADD_PREDEFINED("apos", "'");
+ ADD_PREDEFINED("quot", "\"");
+#undef ADD_PREDEFINED
}
void QXmlStreamReaderPrivate::init()
@@ -1558,7 +1564,7 @@ QStringRef QXmlStreamReaderPrivate::namespaceForPrefix(const QStringRef &prefix)
#if 1
if (namespaceProcessing && !prefix.isEmpty())
- raiseWellFormedError(QXmlStream::tr("Namespace prefix '%1' not declared").arg(prefix.toString()));
+ raiseWellFormedError(QXmlStream::tr("Namespace prefix '%1' not declared").arg(prefix));
#endif
return QStringRef();
@@ -1636,7 +1642,7 @@ void QXmlStreamReaderPrivate::resolveTag()
if (attributes[j].name() == attribute.name()
&& attributes[j].namespaceUri() == attribute.namespaceUri()
&& (namespaceProcessing || attributes[j].qualifiedName() == attribute.qualifiedName()))
- raiseWellFormedError(QXmlStream::tr("Attribute '%1' redefined.").arg(attribute.qualifiedName().toString()));
+ raiseWellFormedError(QXmlStream::tr("Attribute '%1' redefined.").arg(attribute.qualifiedName()));
}
}
@@ -1798,20 +1804,19 @@ void QXmlStreamReaderPrivate::startDocument()
QStringRef value(symString(attrib.value));
if (prefix.isEmpty() && key == QLatin1String("encoding")) {
- const QString name(value.toString());
documentEncoding = value;
if(hasStandalone)
err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding.");
- if(!QXmlUtils::isEncName(name))
- err = QXmlStream::tr("%1 is an invalid encoding name.").arg(name);
+ if (!QXmlUtils::isEncName(value))
+ err = QXmlStream::tr("%1 is an invalid encoding name.").arg(value);
else {
#ifdef QT_NO_TEXTCODEC
readBuffer = QString::fromLatin1(rawReadBuffer.data(), nbytesread);
#else
- QTextCodec *const newCodec = QTextCodec::codecForName(name.toLatin1());
+ QTextCodec *const newCodec = QTextCodec::codecForName(value.toLatin1());
if (!newCodec)
- err = QXmlStream::tr("Encoding %1 is unsupported").arg(name);
+ err = QXmlStream::tr("Encoding %1 is unsupported").arg(value);
else if (newCodec != codec && !lockEncoding) {
codec = newCodec;
delete decoder;
@@ -1881,32 +1886,25 @@ void QXmlStreamReaderPrivate::parseError()
}
}
- error_message.clear ();
if (nexpected && nexpected < nmax) {
- bool first = true;
-
- for (int s = 0; s < nexpected; ++s) {
- if (first)
- error_message += QXmlStream::tr ("Expected ");
- else if (s == nexpected - 1)
- error_message += QLatin1String (nexpected > 2 ? ", or " : " or ");
- else
- error_message += QLatin1String (", ");
-
- first = false;
- error_message += QLatin1String("\'");
- error_message += QLatin1String (spell [expected[s]]);
- error_message += QLatin1String("\'");
+ //: '<first option>'
+ QString exp_str = QXmlStream::tr("'%1'", "expected").arg(QLatin1String(spell[expected[0]]));
+ if (nexpected == 2) {
+ //: <first option>, '<second option>'
+ exp_str = QXmlStream::tr("%1 or '%2'", "expected").arg(exp_str, QLatin1String(spell[expected[1]]));
+ } else if (nexpected > 2) {
+ int s = 1;
+ for (; s < nexpected - 1; ++s) {
+ //: <options so far>, '<next option>'
+ exp_str = QXmlStream::tr("%1, '%2'", "expected").arg(exp_str, QLatin1String(spell[expected[s]]));
+ }
+ //: <options so far>, or '<final option>'
+ exp_str = QXmlStream::tr("%1, or '%2'", "expected").arg(exp_str, QLatin1String(spell[expected[s]]));
}
- error_message += QXmlStream::tr(", but got \'");
- error_message += QLatin1String(spell [token]);
- error_message += QLatin1String("\'");
+ error_message = QXmlStream::tr("Expected %1, but got '%2'.").arg(exp_str, QLatin1String(spell[token]));
} else {
- error_message += QXmlStream::tr("Unexpected \'");
- error_message += QLatin1String(spell [token]);
- error_message += QLatin1String("\'");
+ error_message = QXmlStream::tr("Unexpected '%1'.").arg(QLatin1String(spell[token]));
}
- error_message += QLatin1Char('.');
raiseWellFormedError(error_message);
}
diff --git a/src/corelib/xml/qxmlstream.g b/src/corelib/xml/qxmlstream.g
index 567d36d4b9..fd69a6e4af 100644
--- a/src/corelib/xml/qxmlstream.g
+++ b/src/corelib/xml/qxmlstream.g
@@ -201,23 +201,22 @@ public:
QXmlStreamSimpleStack<NamespaceDeclaration> namespaceDeclarations;
QString tagStackStringStorage;
int tagStackStringStorageSize;
+ int initialTagStackStringStorageSize;
bool tagsDone;
inline QStringRef addToStringStorage(const QStringRef &s) {
- int pos = tagStackStringStorageSize;
- int sz = s.size();
- if (pos != tagStackStringStorage.size())
- tagStackStringStorage.resize(pos);
- tagStackStringStorage.insert(pos, s.unicode(), sz);
- tagStackStringStorageSize += sz;
- return QStringRef(&tagStackStringStorage, pos, sz);
+ return addToStringStorage(qToStringViewIgnoringNull(s));
}
inline QStringRef addToStringStorage(const QString &s) {
+ return addToStringStorage(qToStringViewIgnoringNull(s));
+ }
+ QStringRef addToStringStorage(QStringView s)
+ {
int pos = tagStackStringStorageSize;
int sz = s.size();
if (pos != tagStackStringStorage.size())
tagStackStringStorage.resize(pos);
- tagStackStringStorage.insert(pos, s.unicode(), sz);
+ tagStackStringStorage.append(s.data(), sz);
tagStackStringStorageSize += sz;
return QStringRef(&tagStackStringStorage, pos, sz);
}
@@ -259,20 +258,24 @@ public:
int readBufferPos;
QXmlStreamSimpleStack<uint> putStack;
struct Entity {
- Entity(const QString& str = QString())
- :value(str), external(false), unparsed(false), literal(false),
+ Entity() = default;
+ Entity(const QString &name, const QString &value)
+ : name(name), value(value), external(false), unparsed(false), literal(false),
hasBeenParsed(false), isCurrentlyReferenced(false){}
- static inline Entity createLiteral(const QString &entity)
- { Entity result(entity); result.literal = result.hasBeenParsed = true; return result; }
- QString value;
+ static inline Entity createLiteral(QLatin1String name, QLatin1String value)
+ { Entity result(name, value); result.literal = result.hasBeenParsed = true; return result; }
+ QString name, value;
uint external : 1;
uint unparsed : 1;
uint literal : 1;
uint hasBeenParsed : 1;
uint isCurrentlyReferenced : 1;
};
- QHash<QString, Entity> entityHash;
- QHash<QString, Entity> parameterEntityHash;
+ // these hash tables use a QStringView as a key to avoid creating QStrings
+ // just for lookup. The keys are usually views into Entity::name and thus
+ // are guaranteed to have the same lifetime as the referenced data:
+ QHash<QStringView, Entity> entityHash;
+ QHash<QStringView, Entity> parameterEntityHash;
QXmlStreamSimpleStack<Entity *>entityReferenceStack;
inline bool referenceEntity(Entity &entity) {
if (entity.isCurrentlyReferenced) {
@@ -425,6 +428,11 @@ public:
const Value &symbol = sym(index);
return QStringRef(&textBuffer, symbol.pos + symbol.prefix, symbol.len - symbol.prefix);
}
+ QStringView symView(int index) const
+ {
+ const Value &symbol = sym(index);
+ return QStringView(textBuffer.data() + symbol.pos, symbol.len).mid(symbol.prefix);
+ }
inline QStringRef symName(int index) {
const Value &symbol = sym(index);
return QStringRef(&textBuffer, symbol.pos, symbol.len);
@@ -455,7 +463,7 @@ public:
short token;
- ushort token_char;
+ uint token_char;
uint filterCarriageReturn();
inline uint getChar();
@@ -466,7 +474,7 @@ public:
void putStringLiteral(const QString &s);
void putReplacement(const QString &s);
void putReplacementInAttributeValue(const QString &s);
- ushort getChar_helper();
+ uint getChar_helper();
bool scanUntil(const char *str, short tokenToInject = -1);
bool scanString(const char *str, short tokenToInject, bool requireSpace = true);
@@ -525,10 +533,8 @@ bool QXmlStreamReaderPrivate::parse()
prefix.clear();
qualifiedName.clear();
namespaceUri.clear();
- if (publicNamespaceDeclarations.size())
- publicNamespaceDeclarations.clear();
- if (attributes.size())
- attributes.resize(0);
+ publicNamespaceDeclarations.clear();
+ attributes.clear();
if (isEmptyElement) {
setType(QXmlStreamReader::EndElement);
Tag &tag = tagStack_pop();
@@ -553,7 +559,7 @@ bool QXmlStreamReaderPrivate::parse()
dtdName.clear();
dtdPublicId.clear();
dtdSystemId.clear();
- // fall through
+ Q_FALLTHROUGH();
case QXmlStreamReader::Comment:
case QXmlStreamReader::Characters:
isCDATA = false;
@@ -579,13 +585,13 @@ bool QXmlStreamReaderPrivate::parse()
documentVersion.clear();
documentEncoding.clear();
#ifndef QT_NO_TEXTCODEC
- if (decoder->hasFailure()) {
+ if (decoder && decoder->hasFailure()) {
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
readBuffer.clear();
return false;
}
#endif
- // fall through
+ Q_FALLTHROUGH();
default:
clearTextBuffer();
;
@@ -610,8 +616,8 @@ bool QXmlStreamReaderPrivate::parse()
if (token == -1 && - TERMINAL_COUNT != action_index[act]) {
uint cu = getChar();
token = NOTOKEN;
- token_char = cu;
- if (cu & 0xff0000) {
+ token_char = cu == ~0U ? cu : ushort(cu);
+ if ((cu != ~0U) && (cu & 0xff0000)) {
token = cu >> 16;
} else switch (token_char) {
case 0xfffe:
@@ -629,8 +635,8 @@ bool QXmlStreamReaderPrivate::parse()
} else {
break;
}
- // fall through
- case '\0': {
+ Q_FALLTHROUGH();
+ case ~0U: {
token = EOF_SYMBOL;
if (!tagsDone && !inParseEntity) {
int a = t_action(act, token);
@@ -644,6 +650,7 @@ bool QXmlStreamReaderPrivate::parse()
case '\n':
++lineNumber;
lastLineStart = characterOffset + readBufferPos;
+ Q_FALLTHROUGH();
case ' ':
case '\t':
token = SPACE;
@@ -1127,7 +1134,7 @@ entity_decl ::= entity_decl_external NDATA name space_opt RANGLE;
if (entityDeclaration.parameter)
raiseWellFormedError(QXmlStream::tr("NDATA in parameter entity declaration."));
}
- //fall through
+ Q_FALLTHROUGH();
./
entity_decl ::= entity_decl_external space_opt RANGLE;
@@ -1144,13 +1151,13 @@ entity_decl ::= entity_decl_start entity_value space_opt RANGLE;
EntityDeclaration &entityDeclaration = entityDeclarations.top();
if (!entityDeclaration.external)
entityDeclaration.value = symString(2);
- QString entityName = entityDeclaration.name.toString();
- QHash<QString, Entity> &hash = entityDeclaration.parameter ? parameterEntityHash : entityHash;
- if (!hash.contains(entityName)) {
- Entity entity(entityDeclaration.value.toString());
+ auto &hash = entityDeclaration.parameter ? parameterEntityHash : entityHash;
+ if (!hash.contains(qToStringViewIgnoringNull(entityDeclaration.name))) {
+ Entity entity(entityDeclaration.name.toString(),
+ entityDeclaration.value.toString());
entity.unparsed = (!entityDeclaration.notationName.isNull());
entity.external = entityDeclaration.external;
- hash.insert(entityName, entity);
+ hash.insert(qToStringViewIgnoringNull(entity.name), entity);
}
} break;
./
@@ -1164,12 +1171,12 @@ processing_instruction ::= LANGLE QUESTIONMARK name space;
processingInstructionTarget = symString(3);
if (scanUntil("?>")) {
processingInstructionData = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 2);
- const QString piTarget(processingInstructionTarget.toString());
- if (!piTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive)) {
+ if (!processingInstructionTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive)) {
raiseWellFormedError(QXmlStream::tr("XML declaration not at start of document."));
}
- else if(!QXmlUtils::isNCName(piTarget))
- raiseWellFormedError(QXmlStream::tr("%1 is an invalid processing instruction name.").arg(piTarget));
+ else if (!QXmlUtils::isNCName(processingInstructionTarget))
+ raiseWellFormedError(QXmlStream::tr("%1 is an invalid processing instruction name.")
+ .arg(processingInstructionTarget));
} else if (type != QXmlStreamReader::Invalid){
resume($rule_number);
return false;
@@ -1182,7 +1189,7 @@ processing_instruction ::= LANGLE QUESTIONMARK name QUESTIONMARK RANGLE;
case $rule_number:
setType(QXmlStreamReader::ProcessingInstruction);
processingInstructionTarget = symString(3);
- if (!processingInstructionTarget.toString().compare(QLatin1String("xml"), Qt::CaseInsensitive))
+ if (!processingInstructionTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive))
raiseWellFormedError(QXmlStream::tr("Invalid processing instruction name."));
break;
./
@@ -1281,7 +1288,7 @@ scan_content_char ::= content_char;
/.
case $rule_number:
isWhitespace = false;
- // fall through
+ Q_FALLTHROUGH();
./
scan_content_char ::= SPACE;
@@ -1379,8 +1386,8 @@ literal_content ::= literal_content_start;
public_literal ::= literal;
/.
case $rule_number: {
- if (!QXmlUtils::isPublicID(symString(1).toString())) {
- raiseWellFormedError(QXmlStream::tr("%1 is an invalid PUBLIC identifier.").arg(symString(1).toString()));
+ if (!QXmlUtils::isPublicID(symString(1))) {
+ raiseWellFormedError(QXmlStream::tr("%1 is an invalid PUBLIC identifier.").arg(symString(1)));
resume($rule_number);
return false;
}
@@ -1567,7 +1574,7 @@ empty_element_tag ::= stag_start attribute_list_opt SLASH RANGLE;
/.
case $rule_number:
isEmptyElement = true;
- // fall through
+ Q_FALLTHROUGH();
./
@@ -1614,7 +1621,7 @@ entity_ref ::= AMPERSAND name SEMICOLON;
/.
case $rule_number: {
sym(1).len += sym(2).len + 1;
- QString reference = symString(2).toString();
+ QStringView reference = symView(2);
if (entityHash.contains(reference)) {
Entity &entity = entityHash[reference];
if (entity.unparsed) {
@@ -1635,7 +1642,7 @@ entity_ref ::= AMPERSAND name SEMICOLON;
}
if (entityResolver) {
- QString replacementText = resolveUndeclaredEntity(reference);
+ QString replacementText = resolveUndeclaredEntity(reference.toString());
if (!replacementText.isNull()) {
putReplacement(replacementText);
textBuffer.chop(2 + sym(2).len);
@@ -1656,7 +1663,7 @@ pereference ::= PERCENT name SEMICOLON;
/.
case $rule_number: {
sym(1).len += sym(2).len + 1;
- QString reference = symString(2).toString();
+ QStringView reference = symView(2);
if (parameterEntityHash.contains(reference)) {
referenceToParameterEntityDetected = true;
Entity &entity = parameterEntityHash[reference];
@@ -1669,7 +1676,7 @@ pereference ::= PERCENT name SEMICOLON;
clearSym();
}
} else if (entitiesMustBeDeclared()) {
- raiseWellFormedError(QXmlStream::tr("Entity '%1' not declared.").arg(symString(2).toString()));
+ raiseWellFormedError(QXmlStream::tr("Entity '%1' not declared.").arg(symString(2)));
}
} break;
./
@@ -1687,7 +1694,7 @@ entity_ref_in_attribute_value ::= AMPERSAND name SEMICOLON;
/.
case $rule_number: {
sym(1).len += sym(2).len + 1;
- QString reference = symString(2).toString();
+ QStringView reference = symView(2);
if (entityHash.contains(reference)) {
Entity &entity = entityHash[reference];
if (entity.unparsed || entity.value.isNull()) {
@@ -1708,7 +1715,7 @@ entity_ref_in_attribute_value ::= AMPERSAND name SEMICOLON;
}
if (entityResolver) {
- QString replacementText = resolveUndeclaredEntity(reference);
+ QString replacementText = resolveUndeclaredEntity(reference.toString());
if (!replacementText.isNull()) {
putReplacement(replacementText);
textBuffer.chop(2 + sym(2).len);
diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h
index 9ef95c1fbe..5645d812eb 100644
--- a/src/corelib/xml/qxmlstream_p.h
+++ b/src/corelib/xml/qxmlstream_p.h
@@ -701,20 +701,18 @@ public:
bool tagsDone;
inline QStringRef addToStringStorage(const QStringRef &s) {
- int pos = tagStackStringStorageSize;
- int sz = s.size();
- if (pos != tagStackStringStorage.size())
- tagStackStringStorage.resize(pos);
- tagStackStringStorage.insert(pos, s.unicode(), sz);
- tagStackStringStorageSize += sz;
- return QStringRef(&tagStackStringStorage, pos, sz);
+ return addToStringStorage(qToStringViewIgnoringNull(s));
}
inline QStringRef addToStringStorage(const QString &s) {
+ return addToStringStorage(qToStringViewIgnoringNull(s));
+ }
+ QStringRef addToStringStorage(QStringView s)
+ {
int pos = tagStackStringStorageSize;
int sz = s.size();
if (pos != tagStackStringStorage.size())
tagStackStringStorage.resize(pos);
- tagStackStringStorage.insert(pos, s.unicode(), sz);
+ tagStackStringStorage.append(s.data(), sz);
tagStackStringStorageSize += sz;
return QStringRef(&tagStackStringStorage, pos, sz);
}
@@ -756,20 +754,24 @@ public:
int readBufferPos;
QXmlStreamSimpleStack<uint> putStack;
struct Entity {
- Entity(const QString& str = QString())
- :value(str), external(false), unparsed(false), literal(false),
+ Entity() = default;
+ Entity(const QString &name, const QString &value)
+ : name(name), value(value), external(false), unparsed(false), literal(false),
hasBeenParsed(false), isCurrentlyReferenced(false){}
- static inline Entity createLiteral(const QString &entity)
- { Entity result(entity); result.literal = result.hasBeenParsed = true; return result; }
- QString value;
+ static inline Entity createLiteral(QLatin1String name, QLatin1String value)
+ { Entity result(name, value); result.literal = result.hasBeenParsed = true; return result; }
+ QString name, value;
uint external : 1;
uint unparsed : 1;
uint literal : 1;
uint hasBeenParsed : 1;
uint isCurrentlyReferenced : 1;
};
- QHash<QString, Entity> entityHash;
- QHash<QString, Entity> parameterEntityHash;
+ // these hash tables use a QStringView as a key to avoid creating QStrings
+ // just for lookup. The keys are usually views into Entity::name and thus
+ // are guaranteed to have the same lifetime as the referenced data:
+ QHash<QStringView, Entity> entityHash;
+ QHash<QStringView, Entity> parameterEntityHash;
QXmlStreamSimpleStack<Entity *>entityReferenceStack;
inline bool referenceEntity(Entity &entity) {
if (entity.isCurrentlyReferenced) {
@@ -922,6 +924,11 @@ public:
const Value &symbol = sym(index);
return QStringRef(&textBuffer, symbol.pos + symbol.prefix, symbol.len - symbol.prefix);
}
+ QStringView symView(int index) const
+ {
+ const Value &symbol = sym(index);
+ return QStringView(textBuffer.data() + symbol.pos, symbol.len).mid(symbol.prefix);
+ }
inline QStringRef symName(int index) {
const Value &symbol = sym(index);
return QStringRef(&textBuffer, symbol.pos, symbol.len);
@@ -1492,13 +1499,13 @@ bool QXmlStreamReaderPrivate::parse()
EntityDeclaration &entityDeclaration = entityDeclarations.top();
if (!entityDeclaration.external)
entityDeclaration.value = symString(2);
- QString entityName = entityDeclaration.name.toString();
- QHash<QString, Entity> &hash = entityDeclaration.parameter ? parameterEntityHash : entityHash;
- if (!hash.contains(entityName)) {
- Entity entity(entityDeclaration.value.toString());
+ auto &hash = entityDeclaration.parameter ? parameterEntityHash : entityHash;
+ if (!hash.contains(qToStringViewIgnoringNull(entityDeclaration.name))) {
+ Entity entity(entityDeclaration.name.toString(),
+ entityDeclaration.value.toString());
entity.unparsed = (!entityDeclaration.notationName.isNull());
entity.external = entityDeclaration.external;
- hash.insert(entityName, entity);
+ hash.insert(qToStringViewIgnoringNull(entity.name), entity);
}
} break;
@@ -1508,12 +1515,12 @@ bool QXmlStreamReaderPrivate::parse()
processingInstructionTarget = symString(3);
if (scanUntil("?>")) {
processingInstructionData = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 2);
- const QString piTarget(processingInstructionTarget.toString());
- if (!piTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive)) {
+ if (!processingInstructionTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive)) {
raiseWellFormedError(QXmlStream::tr("XML declaration not at start of document."));
}
- else if(!QXmlUtils::isNCName(piTarget))
- raiseWellFormedError(QXmlStream::tr("%1 is an invalid processing instruction name.").arg(piTarget));
+ else if (!QXmlUtils::isNCName(processingInstructionTarget))
+ raiseWellFormedError(QXmlStream::tr("%1 is an invalid processing instruction name.")
+ .arg(processingInstructionTarget));
} else if (type != QXmlStreamReader::Invalid){
resume(96);
return false;
@@ -1523,7 +1530,7 @@ bool QXmlStreamReaderPrivate::parse()
case 97:
setType(QXmlStreamReader::ProcessingInstruction);
processingInstructionTarget = symString(3);
- if (!processingInstructionTarget.toString().compare(QLatin1String("xml"), Qt::CaseInsensitive))
+ if (!processingInstructionTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive))
raiseWellFormedError(QXmlStream::tr("Invalid processing instruction name."));
break;
@@ -1637,8 +1644,8 @@ bool QXmlStreamReaderPrivate::parse()
break;
case 175: {
- if (!QXmlUtils::isPublicID(symString(1).toString())) {
- raiseWellFormedError(QXmlStream::tr("%1 is an invalid PUBLIC identifier.").arg(symString(1).toString()));
+ if (!QXmlUtils::isPublicID(symString(1))) {
+ raiseWellFormedError(QXmlStream::tr("%1 is an invalid PUBLIC identifier.").arg(symString(1)));
resume(175);
return false;
}
@@ -1793,7 +1800,7 @@ bool QXmlStreamReaderPrivate::parse()
case 240: {
sym(1).len += sym(2).len + 1;
- QString reference = symString(2).toString();
+ QStringView reference = symView(2);
if (entityHash.contains(reference)) {
Entity &entity = entityHash[reference];
if (entity.unparsed) {
@@ -1814,7 +1821,7 @@ bool QXmlStreamReaderPrivate::parse()
}
if (entityResolver) {
- QString replacementText = resolveUndeclaredEntity(reference);
+ QString replacementText = resolveUndeclaredEntity(reference.toString());
if (!replacementText.isNull()) {
putReplacement(replacementText);
textBuffer.chop(2 + sym(2).len);
@@ -1832,7 +1839,7 @@ bool QXmlStreamReaderPrivate::parse()
case 241: {
sym(1).len += sym(2).len + 1;
- QString reference = symString(2).toString();
+ QStringView reference = symView(2);
if (parameterEntityHash.contains(reference)) {
referenceToParameterEntityDetected = true;
Entity &entity = parameterEntityHash[reference];
@@ -1845,7 +1852,7 @@ bool QXmlStreamReaderPrivate::parse()
clearSym();
}
} else if (entitiesMustBeDeclared()) {
- raiseWellFormedError(QXmlStream::tr("Entity '%1' not declared.").arg(symString(2).toString()));
+ raiseWellFormedError(QXmlStream::tr("Entity '%1' not declared.").arg(symString(2)));
}
} break;
@@ -1855,7 +1862,7 @@ bool QXmlStreamReaderPrivate::parse()
case 243: {
sym(1).len += sym(2).len + 1;
- QString reference = symString(2).toString();
+ QStringView reference = symView(2);
if (entityHash.contains(reference)) {
Entity &entity = entityHash[reference];
if (entity.unparsed || entity.value.isNull()) {
@@ -1876,7 +1883,7 @@ bool QXmlStreamReaderPrivate::parse()
}
if (entityResolver) {
- QString replacementText = resolveUndeclaredEntity(reference);
+ QString replacementText = resolveUndeclaredEntity(reference.toString());
if (!replacementText.isNull()) {
putReplacement(replacementText);
textBuffer.chop(2 + sym(2).len);
diff --git a/src/corelib/xml/qxmlutils.cpp b/src/corelib/xml/qxmlutils.cpp
index 23caae2935..01c84251fd 100644
--- a/src/corelib/xml/qxmlutils.cpp
+++ b/src/corelib/xml/qxmlutils.cpp
@@ -227,19 +227,22 @@ bool QXmlUtils::isBaseChar(const QChar c)
\sa {http://www.w3.org/TR/REC-xml/#NT-EncName},
{Extensible Markup Language (XML) 1.0 (Fourth Edition), [81] EncName}
*/
-bool QXmlUtils::isEncName(const QString &encName)
+bool QXmlUtils::isEncName(QStringView encName)
{
// Valid encoding names are given by "[A-Za-z][A-Za-z0-9._\\-]*"
- const ushort *c = encName.utf16();
- int l = encName.length();
- if (l < 1 || !((c[0] >= 'a' && c[0] <= 'z') || (c[0] >= 'A' && c[0] <= 'Z')))
+ if (encName.isEmpty())
return false;
- for (int i = 1; i < l; ++i) {
- if ((c[i] >= 'a' && c[i] <= 'z')
- || (c[i] >= 'A' && c[i] <= 'Z')
- || (c[i] >= '0' && c[i] <= '9')
- || c[i] == '.' || c[i] == '_' || c[i] == '-')
+ const auto first = encName.front().unicode();
+ if (!((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z')))
+ return false;
+ for (QChar ch : encName.mid(1)) {
+ const auto cp = ch.unicode();
+ if ((cp >= 'a' && cp <= 'z')
+ || (cp >= 'A' && cp <= 'Z')
+ || (cp >= '0' && cp <= '9')
+ || cp == '.' || cp == '_' || cp == '-') {
continue;
+ }
return false;
}
return true;
@@ -310,13 +313,10 @@ bool QXmlUtils::isNameChar(const QChar c)
\sa {http://www.w3.org/TR/REC-xml/#NT-PubidLiteral},
{Extensible Markup Language (XML) 1.0 (Fourth Edition), [12] PubidLiteral}
*/
-bool QXmlUtils::isPublicID(const QString &candidate)
+bool QXmlUtils::isPublicID(QStringView candidate)
{
- const int len = candidate.length();
-
- for(int i = 0; i < len; ++i)
- {
- const ushort cp = candidate.at(i).unicode();
+ for (QChar ch : candidate) {
+ const ushort cp = ch.unicode();
if ((cp >= 'a' && cp <= 'z')
|| (cp >= 'A' && cp <= 'Z')
@@ -369,7 +369,7 @@ bool QXmlUtils::isPublicID(const QString &candidate)
\sa {http://www.w3.org/TR/REC-xml-names/#NT-NCName},
{W3CNamespaces in XML 1.0 (Second Edition), [4] NCName}
*/
-bool QXmlUtils::isNCName(const QStringRef &ncName)
+bool QXmlUtils::isNCName(QStringView ncName)
{
if(ncName.isEmpty())
return false;
@@ -379,10 +379,7 @@ bool QXmlUtils::isNCName(const QStringRef &ncName)
if(!QXmlUtils::isLetter(first) && first.unicode() != '_' && first.unicode() != ':')
return false;
- const int len = ncName.size();
- for(int i = 0; i < len; ++i)
- {
- const QChar at = ncName.at(i);
+ for (QChar at : ncName) {
if(!QXmlUtils::isNameChar(at) || at == QLatin1Char(':'))
return false;
}
diff --git a/src/corelib/xml/qxmlutils_p.h b/src/corelib/xml/qxmlutils_p.h
index 6db347b3ee..db6bddd5be 100644
--- a/src/corelib/xml/qxmlutils_p.h
+++ b/src/corelib/xml/qxmlutils_p.h
@@ -68,13 +68,12 @@ class QXmlCharRange;
class Q_CORE_EXPORT QXmlUtils
{
public:
- static bool isEncName(const QString &encName);
+ static bool isEncName(QStringView encName);
static bool isChar(const QChar c);
static bool isNameChar(const QChar c);
static bool isLetter(const QChar c);
- static bool isNCName(const QStringRef &ncName);
- static inline bool isNCName(const QString &ncName) { return isNCName(QStringRef(&ncName)); }
- static bool isPublicID(const QString &candidate);
+ static bool isNCName(QStringView ncName);
+ static bool isPublicID(QStringView candidate);
private:
typedef const QXmlCharRange *RangeIter;
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
index b1f9be2c2a..ce55297abb 100644
--- a/src/dbus/qdbusserver.cpp
+++ b/src/dbus/qdbusserver.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
\a parent.
*/
QDBusServer::QDBusServer(const QString &address, QObject *parent)
- : QObject(parent), d(0)
+ : QObject(parent), d(nullptr)
{
if (address.isEmpty())
return;
@@ -83,7 +83,7 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
localhost (elsewhere).
*/
QDBusServer::QDBusServer(QObject *parent)
- : QObject(parent)
+ : QObject(parent), d(nullptr)
{
#ifdef Q_OS_UNIX
// Use Unix sockets on Unix systems only
@@ -92,10 +92,8 @@ QDBusServer::QDBusServer(QObject *parent)
const QString address = QStringLiteral("tcp:");
#endif
- if (!qdbus_loadLibDBus()) {
- d = 0;
+ if (!qdbus_loadLibDBus())
return;
- }
QDBusConnectionManager *instance = QDBusConnectionManager::instance();
if (!instance)
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 6fdeefe14a..17b4c3df2c 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -39,7 +39,9 @@
"qpa-platform-guard": "boolean",
"sm": { "type": "boolean", "name": "sessionmanager" },
"tslib": "boolean",
+ "vulkan": "boolean",
"xcb": { "type": "enum", "values": [ "no", "yes", "qt", "system" ] },
+ "xcb-native-painting": "boolean",
"xcb-xlib": "boolean",
"xinput2": "boolean",
"xkb": "boolean",
@@ -393,6 +395,14 @@
"-lts"
]
},
+ "vulkan": {
+ "label": "Vulkan",
+ "test": "qpa/vulkan",
+ "sources": [
+ { "type": "pkgConfig", "args": "vulkan" },
+ { "type": "makeSpec", "spec": "VULKAN" }
+ ]
+ },
"wayland_server": {
"label": "Wayland Server",
"test": {
@@ -582,6 +592,13 @@
"sources": [
{ "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" }
]
+ },
+ "xrender": {
+ "label": "XRender for native painting",
+ "test": "x11/xrender",
+ "sources": [
+ "-lXrender"
+ ]
}
},
@@ -798,6 +815,12 @@
},
"use": "opengl_es2"
},
+ "opengles32": {
+ "label": "OpenGL ES 3.2",
+ "type": "compile",
+ "test": "unix/opengles32",
+ "use": "opengl_es2"
+ },
"qpa_default_platform": {
"label": "default QPA platform",
"type": "qpaDefaultPlatform",
@@ -1014,6 +1037,14 @@
{ "type": "define", "name": "QT_OPENGL_ES_3_1" }
]
},
+ "opengles32": {
+ "label": "OpenGL ES 3.2",
+ "condition": "features.opengles31 && tests.opengles32",
+ "output": [
+ "publicFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_3_2" }
+ ]
+ },
"opengl-desktop": {
"label": "Desktop OpenGL",
"enable": "input.opengl == 'desktop'",
@@ -1036,6 +1067,11 @@
"condition": "features.opengl-desktop || features.opengl-dynamic || features.opengles2",
"output": [ "publicFeature", "feature" ]
},
+ "vulkan": {
+ "label": "Vulkan",
+ "condition": "libs.vulkan",
+ "output": [ "publicFeature" ]
+ },
"openvg": {
"label": "OpenVG",
"condition": "libs.openvg",
@@ -1178,6 +1214,18 @@
"condition": "libs.xcb_glx",
"output": [ "privateFeature" ]
},
+ "xcb-native-painting": {
+ "label": "Native painting (experimental)",
+ "emitIf": "features.xcb",
+ "condition": "features.xcb-xlib && features.fontconfig && libs.xrender",
+ "output": [ "privateFeature" ]
+ },
+ "xrender": {
+ "label": "XRender for native painting",
+ "emitIf": "features.xcb && features.xcb-native-painting",
+ "condition": "features.xcb-native-painting",
+ "output": [ "privateFeature" ]
+ },
"xcb-render": {
"label": "XCB render",
"emitIf": "features.xcb",
@@ -1533,9 +1581,11 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
},
"opengles2",
"opengles3",
- "opengles31"
+ "opengles31",
+ "opengles32"
]
},
+ "vulkan",
"sessionmanager"
]
},
@@ -1578,7 +1628,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"section": "X11",
"condition": "features.xcb",
"entries": [
- "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system"
+ "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system", "xcb-native-painting"
]
},
{
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index bac93af775..3b3ebafc2d 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -49,6 +49,7 @@ sourcedirs += .. \
src/includes
exampledirs += ../../../examples/gui \
+ ../../../examples/vulkan \
snippets
imagedirs += images \
diff --git a/src/gui/doc/src/external-resources.qdoc b/src/gui/doc/src/external-resources.qdoc
index 480a4057be..0addbb21cd 100644
--- a/src/gui/doc/src/external-resources.qdoc
+++ b/src/gui/doc/src/external-resources.qdoc
@@ -60,3 +60,13 @@
\externalpage https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout
\title Icon Theme Specification - Directory Layout
*/
+
+/*!
+ \externalpage https://www.khronos.org/vulkan/
+ \title Vulkan
+*/
+
+/*!
+ \externalpage https://www.lunarg.com/vulkan-sdk/
+ \title LunarG Vulkan SDK
+*/
diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc
index a9fe520d5e..da3d419735 100644
--- a/src/gui/doc/src/qtgui.qdoc
+++ b/src/gui/doc/src/qtgui.qdoc
@@ -35,11 +35,11 @@
applications written with Qt.
The Qt GUI module provides classes for windowing system
- integration, event handling, OpenGL and OpenGL ES integration, 2D
- graphics, imaging, fonts and typography. These classes are used
- internally by Qt's user interface technologies and can also be
- used directly, for instance to write applications using low-level
- OpenGL ES graphics APIs.
+ integration, event handling, OpenGL and OpenGL ES integration,
+ Vulkan integration, 2D graphics, imaging, fonts and typography.
+ These classes are used internally by Qt's user interface technologies
+ and can also be used directly, for instance to write applications using
+ low-level OpenGL ES graphics APIs.
To include the definitions of the module's classes, use the
following directive:
@@ -170,6 +170,31 @@
+ \section1 Vulkan Integration
+
+ Qt 5.10 added support for \l {Vulkan}. This requires
+ the presence of the \l{LunarG Vulkan SDK}.
+
+ On Windows, the SDK sets the environment variable \c {VULKAN_SDK},
+ which will be detected by the \c {configure} script.
+
+ On Android, Vulkan headers were added in API level 24 of the NDK.
+
+ Relevant classes:
+
+ \list
+ \li QVulkanDeviceFunctions
+ \li QVulkanExtension
+ \li QVulkanFunctions
+ \li QVulkanInfoVector
+ \li QVulkanInstance
+ \li QVulkanWindow
+ \li QVulkanWindowRenderer
+ \endlist
+
+ For more information, see the \l{Hello Vulkan Widget Example}
+ and the \l {Hello Vulkan Window Example}.
+
\section1 Qt GUI Prior to Qt 5.0
Prior to Qt 5.0, the Qt GUI module was the monolithic container
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index f7d077e656..f8cec00b82 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -47,6 +47,7 @@ include(math3d/math3d.pri)
include(opengl/opengl.pri)
include(animation/animation.pri)
include(itemmodels/itemmodels.pri)
+include(vulkan/vulkan.pri)
QMAKE_LIBS += $$QMAKE_LIBS_GUI
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 4350a5c192..c232a84e4f 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -49,10 +49,10 @@ QT_BEGIN_NAMESPACE
static void swapPixel01(QImage *image) // 1-bpp: swap 0 and 1 pixels
{
- int i;
+ qssize_t i;
if (image->depth() == 1 && image->colorCount() == 2) {
uint *p = (uint *)image->bits();
- int nbytes = image->byteCount();
+ qssize_t nbytes = static_cast<qssize_t>(image->sizeInBytes());
for (i=0; i<nbytes/4; i++) {
*p = ~*p;
p++;
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index fa4b4e01af..9b2e96d4b0 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -1469,8 +1469,13 @@ QString qt_findAtNxFile(const QString &baseFileName, qreal targetDevicePixelRati
return baseFileName;
int dotIndex = baseFileName.lastIndexOf(QLatin1Char('.'));
- if (dotIndex == -1) /* no dot */
+ if (dotIndex == -1) { /* no dot */
dotIndex = baseFileName.size(); /* append */
+ } else if (dotIndex >= 2 && baseFileName[dotIndex - 1] == QLatin1Char('9')
+ && baseFileName[dotIndex - 2] == QLatin1Char('.')) {
+ // If the file has a .9.* (9-patch image) extension, we must ensure that the @nx goes before it.
+ dotIndex -= 2;
+ }
QString atNxfileName = baseFileName;
atNxfileName.insert(dotIndex, QLatin1String("@2x"));
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index 349e0dfbe3..3cb6f46bd6 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -609,18 +609,18 @@ static int directorySizeDistance(const QIconDirInfo &dir, int iconsize, int icon
return INT_MAX;
}
-QIconLoaderEngineEntry *QIconLoaderEngine::entryForSize(const QSize &size, int scale)
+QIconLoaderEngineEntry *QIconLoaderEngine::entryForSize(const QThemeIconInfo &info, const QSize &size, int scale)
{
int iconsize = qMin(size.width(), size.height());
// Note that m_info.entries are sorted so that png-files
// come first
- const int numEntries = m_info.entries.size();
+ const int numEntries = info.entries.size();
// Search for exact matches first
for (int i = 0; i < numEntries; ++i) {
- QIconLoaderEngineEntry *entry = m_info.entries.at(i);
+ QIconLoaderEngineEntry *entry = info.entries.at(i);
if (directoryMatchesSize(entry->dir, iconsize, scale)) {
return entry;
}
@@ -630,7 +630,7 @@ QIconLoaderEngineEntry *QIconLoaderEngine::entryForSize(const QSize &size, int s
int minimalSize = INT_MAX;
QIconLoaderEngineEntry *closestMatch = 0;
for (int i = 0; i < numEntries; ++i) {
- QIconLoaderEngineEntry *entry = m_info.entries.at(i);
+ QIconLoaderEngineEntry *entry = info.entries.at(i);
int distance = directorySizeDistance(entry->dir, iconsize, scale);
if (distance < minimalSize) {
minimalSize = distance;
@@ -654,7 +654,7 @@ QSize QIconLoaderEngine::actualSize(const QSize &size, QIcon::Mode mode,
ensureLoaded();
- QIconLoaderEngineEntry *entry = entryForSize(size);
+ QIconLoaderEngineEntry *entry = entryForSize(m_info, size);
if (entry) {
const QIconDirInfo &dir = entry->dir;
if (dir.type == QIconDirInfo::Scalable)
@@ -718,7 +718,7 @@ QPixmap QIconLoaderEngine::pixmap(const QSize &size, QIcon::Mode mode,
{
ensureLoaded();
- QIconLoaderEngineEntry *entry = entryForSize(size);
+ QIconLoaderEngineEntry *entry = entryForSize(m_info, size);
if (entry)
return entry->pixmap(size, mode, state);
@@ -767,7 +767,7 @@ void QIconLoaderEngine::virtual_hook(int id, void *data)
QIconEngine::ScaledPixmapArgument &arg = *reinterpret_cast<QIconEngine::ScaledPixmapArgument*>(data);
// QIcon::pixmap() multiplies size by the device pixel ratio.
const int integerScale = qCeil(arg.scale);
- QIconLoaderEngineEntry *entry = entryForSize(arg.size / integerScale, integerScale);
+ QIconLoaderEngineEntry *entry = entryForSize(m_info, arg.size / integerScale, integerScale);
arg.pixmap = entry ? entry->pixmap(arg.size, arg.mode, arg.state) : QPixmap();
}
break;
diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h
index 5f3a3ef948..9398bca585 100644
--- a/src/gui/image/qiconloader_p.h
+++ b/src/gui/image/qiconloader_p.h
@@ -132,12 +132,13 @@ public:
bool read(QDataStream &in) Q_DECL_OVERRIDE;
bool write(QDataStream &out) const Q_DECL_OVERRIDE;
+ Q_GUI_EXPORT static QIconLoaderEngineEntry *entryForSize(const QThemeIconInfo &info, const QSize &size, int scale = 1);
+
private:
QString key() const Q_DECL_OVERRIDE;
bool hasIcon() const;
void ensureLoaded();
void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
- QIconLoaderEngineEntry *entryForSize(const QSize &size, int scale = 1);
QIconLoaderEngine(const QIconLoaderEngine &other);
QThemeIconInfo m_info;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index b2e5ac93b1..4412e722f6 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -127,11 +127,11 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format)
const int bytes_per_line = ((width * depth + 31) >> 5) << 2; // bytes per scanline (must be multiple of 4)
// sanity check for potential overflows
- if (INT_MAX/depth < width
+ if (std::numeric_limits<int>::max()/depth < width
|| bytes_per_line <= 0
|| height <= 0
- || INT_MAX/uint(bytes_per_line) < height
- || INT_MAX/sizeof(uchar *) < uint(height))
+ || std::numeric_limits<qssize_t>::max()/uint(bytes_per_line) < height
+ || std::numeric_limits<int>::max()/sizeof(uchar *) < uint(height))
return 0;
QScopedPointer<QImageData> d(new QImageData);
@@ -452,7 +452,7 @@ bool QImageData::checkForAlphaPixels() const
used. For more information see the
\l {QImage#Image Formats}{Image Formats} section.
- The format(), bytesPerLine(), and byteCount() functions provide
+ The format(), bytesPerLine(), and sizeInBytes() functions provide
low-level information about the data stored in the image.
The cacheKey() function returns a number that uniquely
@@ -1448,26 +1448,43 @@ void QImage::setDevicePixelRatio(qreal scaleFactor)
/*!
\since 4.6
+ \obsolete
Returns the number of bytes occupied by the image data.
- \sa bytesPerLine(), bits(), {QImage#Image Information}{Image
+ Note this method should never be called on an image larger than 2 gigabytes.
+ Instead use sizeInBytes().
+
+ \sa sizeInBytes(), bytesPerLine(), bits(), {QImage#Image Information}{Image
Information}
*/
int QImage::byteCount() const
{
+ Q_ASSERT(!d || d->nbytes < std::numeric_limits<int>::max());
+ return d ? int(d->nbytes) : 0;
+}
+
+/*!
+ \since 5.10
+ Returns the image data size in bytes.
+
+ \sa byteCount(), bytesPerLine(), bits(), {QImage#Image Information}{Image
+ Information}
+*/
+qssize_t QImage::sizeInBytes() const
+{
return d ? d->nbytes : 0;
}
/*!
Returns the number of bytes per image scanline.
- This is equivalent to byteCount() / height().
+ This is equivalent to sizeInBytes() / height() if height() is non-zero.
\sa scanLine()
*/
int QImage::bytesPerLine() const
{
- return (d && d->height) ? d->nbytes / d->height : 0;
+ return d ? d->bytes_per_line : 0;
}
@@ -1594,7 +1611,7 @@ const uchar *QImage::constScanLine(int i) const
data, thus ensuring that this QImage is the only one using the
current return value.
- \sa scanLine(), byteCount(), constBits()
+ \sa scanLine(), sizeInBytes(), constBits()
*/
uchar *QImage::bits()
{
@@ -4675,12 +4692,12 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode
if (dImage.d->colortable.size() < 256) {
// colors are left in the color table, so pick that one as transparent
dImage.d->colortable.append(0x0);
- memset(dImage.bits(), dImage.d->colortable.size() - 1, dImage.byteCount());
+ memset(dImage.bits(), dImage.d->colortable.size() - 1, dImage.d->nbytes);
} else {
- memset(dImage.bits(), 0, dImage.byteCount());
+ memset(dImage.bits(), 0, dImage.d->nbytes);
}
} else
- memset(dImage.bits(), 0x00, dImage.byteCount());
+ memset(dImage.bits(), 0x00, dImage.d->nbytes);
if (target_format >= QImage::Format_RGB32) {
// Prevent QPainter from applying devicePixelRatio corrections
@@ -4785,7 +4802,7 @@ QDebug operator<<(QDebug dbg, const QImage &i)
if (i.colorCount())
dbg << ",colorCount=" << i.colorCount();
dbg << ",devicePixelRatio=" << i.devicePixelRatio()
- << ",bytesPerLine=" << i.bytesPerLine() << ",byteCount=" << i.byteCount();
+ << ",bytesPerLine=" << i.bytesPerLine() << ",sizeInBytes=" << i.sizeInBytes();
}
dbg << ')';
return dbg;
@@ -4807,7 +4824,7 @@ QDebug operator<<(QDebug dbg, const QImage &i)
Returns the number of bytes occupied by the image data.
- \sa byteCount()
+ \sa sizeInBytes()
*/
/*!
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 225ef3d2e8..eccff480bb 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -214,7 +214,10 @@ public:
const uchar *bits() const;
const uchar *constBits() const;
- int byteCount() const;
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED int byteCount() const;
+#endif
+ qssize_t sizeInBytes() const;
uchar *scanLine(int);
const uchar *scanLine(int) const;
@@ -468,7 +471,7 @@ inline void QImage::setNumColors(int n)
inline int QImage::numBytes() const
{
- return byteCount();
+ return int(sizeInBytes());
}
#endif
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 50fad1566c..6abaa2887e 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -40,6 +40,7 @@
#include <private/qdrawhelper_p.h>
#include <private/qguiapplication_p.h>
#include <private/qcolorprofile_p.h>
+#include <private/qendian_p.h>
#include <private/qsimd_p.h>
#include <private/qimage_p.h>
#include <qendian.h>
@@ -126,8 +127,8 @@ static const uint *QT_FASTCALL convertRGB32FromARGB32PM(uint *buffer, const uint
return buffer;
}
-static const uint *QT_FASTCALL convertRGB32ToARGB32PM(uint *buffer, const uint *src, int count,
- const QVector<QRgb> *, QDitherInfo *)
+static const uint *QT_FASTCALL maskRGB32(uint *buffer, const uint *src, int count,
+ const QVector<QRgb> *, QDitherInfo *)
{
for (int i = 0; i < count; ++i)
buffer[i] = 0xff000000 |src[i];
@@ -160,8 +161,9 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio
// If the source doesn't have an alpha channel, we can use the faster convertFromRGB32 method.
convertFromARGB32PM = destLayout->convertFromRGB32;
} else {
+ // The drawhelpers do not mask the alpha value in RGB32, we want to here.
if (src->format == QImage::Format_RGB32)
- convertToARGB32PM = convertRGB32ToARGB32PM;
+ convertToARGB32PM = maskRGB32;
if (dest->format == QImage::Format_RGB32) {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
@@ -171,6 +173,15 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio
convertFromARGB32PM = convertRGB32FromARGB32PM;
}
}
+ if ((src->format == QImage::Format_ARGB32 || src->format == QImage::Format_RGBA8888) &&
+ destLayout->alphaWidth == 0 && destLayout->convertFromRGB32) {
+ // Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format.
+ convertToARGB32PM = qPixelLayouts[src->format + 1].convertToARGB32PM;
+ if (dest->format == QImage::Format_RGB32)
+ convertFromARGB32PM = maskRGB32;
+ else
+ convertFromARGB32PM = destLayout->convertFromRGB32;
+ }
QDitherInfo dither;
QDitherInfo *ditherPtr = 0;
if ((flags & Qt::PreferDither) && (flags & Qt::Dither_Mask) != Qt::ThresholdDither)
@@ -221,7 +232,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
convertFromARGB32PM = destLayout->convertFromRGB32;
} else {
if (data->format == QImage::Format_RGB32)
- convertToARGB32PM = convertRGB32ToARGB32PM;
+ convertToARGB32PM = maskRGB32;
if (dst_format == QImage::Format_RGB32) {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
@@ -231,6 +242,15 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
convertFromARGB32PM = convertRGB32FromARGB32PM;
}
}
+ if ((data->format == QImage::Format_ARGB32 || data->format == QImage::Format_RGBA8888) &&
+ destLayout->alphaWidth == 0 && destLayout->convertFromRGB32) {
+ // Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format.
+ convertToARGB32PM = qPixelLayouts[data->format + 1].convertToARGB32PM;
+ if (dst_format == QImage::Format_RGB32)
+ convertFromARGB32PM = maskRGB32;
+ else
+ convertFromARGB32PM = destLayout->convertFromRGB32;
+ }
QDitherInfo dither;
QDitherInfo *ditherPtr = 0;
if ((flags & Qt::PreferDither) && (flags & Qt::Dither_Mask) != Qt::ThresholdDither)
@@ -322,10 +342,10 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32(quint32 *dest_data, con
// Handle 4 pixels at a time 12 bytes input to 16 bytes output.
for (; pixel + 3 < len; pixel += 4) {
- const quint32 *src_packed = (const quint32 *) src_data;
- const quint32 src1 = qFromBigEndian(src_packed[0]);
- const quint32 src2 = qFromBigEndian(src_packed[1]);
- const quint32 src3 = qFromBigEndian(src_packed[2]);
+ const quint32_be *src_packed = reinterpret_cast<const quint32_be *>(src_data);
+ const quint32 src1 = src_packed[0];
+ const quint32 src2 = src_packed[1];
+ const quint32 src3 = src_packed[2];
dest_data[0] = 0xff000000 | (src1 >> 8);
dest_data[1] = 0xff000000 | (src1 << 16) | (src2 >> 16);
@@ -803,8 +823,8 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
const int depth = 32;
- const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
- const int nbytes = dst_bytes_per_line * data->height;
+ const qssize_t dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
+ const qssize_t nbytes = dst_bytes_per_line * data->height;
uchar *const newData = (uchar *)realloc(data->data, nbytes);
if (!newData)
return false;
@@ -857,8 +877,8 @@ static bool convert_indexed8_to_ARGB_inplace(QImageData *data, Qt::ImageConversi
const int depth = 32;
- const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
- const int nbytes = dst_bytes_per_line * data->height;
+ const qssize_t dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
+ const qssize_t nbytes = dst_bytes_per_line * data->height;
uchar *const newData = (uchar *)realloc(data->data, nbytes);
if (!newData)
return false;
@@ -925,8 +945,8 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
const int depth = 16;
- const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
- const int nbytes = dst_bytes_per_line * data->height;
+ const qssize_t dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
+ const qssize_t nbytes = dst_bytes_per_line * data->height;
uchar *const newData = (uchar *)realloc(data->data, nbytes);
if (!newData)
return false;
@@ -982,8 +1002,8 @@ static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFl
const int depth = 16;
- const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
- const int src_bytes_per_line = data->bytes_per_line;
+ const qssize_t dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
+ const qssize_t src_bytes_per_line = data->bytes_per_line;
quint32 *src_data = (quint32 *) data->data;
quint16 *dst_data = (quint16 *) data->data;
@@ -1237,9 +1257,9 @@ void dither_to_Mono(QImageData *dst, const QImageData *src,
}
uchar *dst_data = dst->data;
- int dst_bpl = dst->bytes_per_line;
+ qssize_t dst_bpl = dst->bytes_per_line;
const uchar *src_data = src->data;
- int src_bpl = src->bytes_per_line;
+ qssize_t src_bpl = src->bytes_per_line;
switch (dithermode) {
case Diffuse: {
@@ -1892,8 +1912,8 @@ static void convert_Indexed8_to_Alpha8(QImageData *dest, const QImageData *src,
if (simpleCase)
memcpy(dest->data, src->data, src->bytes_per_line * src->height);
else {
- int size = src->bytes_per_line * src->height;
- for (int i = 0; i < size; ++i) {
+ qssize_t size = src->bytes_per_line * src->height;
+ for (qssize_t i = 0; i < size; ++i) {
dest->data[i] = translate[src->data[i]];
}
}
@@ -1916,8 +1936,8 @@ static void convert_Indexed8_to_Grayscale8(QImageData *dest, const QImageData *s
if (simpleCase)
memcpy(dest->data, src->data, src->bytes_per_line * src->height);
else {
- int size = src->bytes_per_line * src->height;
- for (int i = 0; i < size; ++i) {
+ qssize_t size = src->bytes_per_line * src->height;
+ for (qssize_t i = 0; i < size; ++i) {
dest->data[i] = translate[src->data[i]];
}
}
diff --git a/src/gui/image/qimage_darwin.mm b/src/gui/image/qimage_darwin.mm
index 3764bef06b..a5c391ad21 100644
--- a/src/gui/image/qimage_darwin.mm
+++ b/src/gui/image/qimage_darwin.mm
@@ -130,7 +130,7 @@ CGImageRef QImage::toCGImage() const
auto deleter = [](void *image, const void *, size_t)
{ delete static_cast<QImage *>(image); };
QCFType<CGDataProviderRef> dataProvider =
- CGDataProviderCreateWithData(new QImage(*this), bits(), byteCount(), deleter);
+ CGDataProviderCreateWithData(new QImage(*this), bits(), sizeInBytes(), deleter);
QCFType<CGColorSpaceRef> colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index 775ab6d541..9ba4945dc5 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -71,12 +71,12 @@ struct Q_GUI_EXPORT QImageData { // internal image data
int width;
int height;
int depth;
- int nbytes; // number of bytes data
+ qssize_t nbytes; // number of bytes data
qreal devicePixelRatio;
QVector<QRgb> colortable;
uchar *data;
QImage::Format format;
- int bytes_per_line;
+ qssize_t bytes_per_line;
int ser_no; // serial number
int detach_no;
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 381ddb5b45..7a5a630495 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -565,6 +565,16 @@ bool QImageReaderPrivate::initHandler()
// probe the file extension
if (deleteDevice && !device->isOpen() && !device->open(QIODevice::ReadOnly) && autoDetectImageFormat) {
+ Q_ASSERT(qobject_cast<QFile*>(device) != 0); // future-proofing; for now this should always be the case, so...
+ QFile *file = static_cast<QFile *>(device);
+
+ if (file->error() == QFileDevice::ResourceError) {
+ // this is bad. we should abort the open attempt and note the failure.
+ imageReaderError = QImageReader::DeviceError;
+ errorString = file->errorString();
+ return false;
+ }
+
QList<QByteArray> extensions = QImageReader::supportedImageFormats();
if (!format.isEmpty()) {
// Try the most probable extension first
@@ -575,7 +585,6 @@ bool QImageReaderPrivate::initHandler()
int currentExtension = 0;
- QFile *file = static_cast<QFile *>(device);
QString fileName = file->fileName();
do {
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index ab15d8ee29..a39d204677 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -87,6 +87,9 @@
\value UnsupportedFormatError Qt does not support the requested
image format.
+ \value InvalidImageError An attempt was made to write an invalid QImage. An
+ example of an invalid image would be a null QImage.
+
\value UnknownError An unknown error occurred. If you get this
value after calling write(), it is most likely caused by a bug in
QImageWriter.
@@ -736,6 +739,13 @@ extern void qt_imageTransform(QImage &src, QImageIOHandler::Transformations orie
*/
bool QImageWriter::write(const QImage &image)
{
+ // Do this before canWrite, so it doesn't create a file if this fails.
+ if (Q_UNLIKELY(image.isNull())) {
+ d->imageWriterError = QImageWriter::InvalidImageError;
+ d->errorString = QImageWriter::tr("Image is empty");
+ return false;
+ }
+
if (!canWrite())
return false;
diff --git a/src/gui/image/qimagewriter.h b/src/gui/image/qimagewriter.h
index 58f8c51472..fd1fdd07e8 100644
--- a/src/gui/image/qimagewriter.h
+++ b/src/gui/image/qimagewriter.h
@@ -60,7 +60,8 @@ public:
enum ImageWriterError {
UnknownError,
DeviceError,
- UnsupportedFormatError
+ UnsupportedFormatError,
+ InvalidImageError
};
QImageWriter();
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index fbbf6e9802..d5e8b1b974 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -161,6 +161,8 @@
This signal is emitted by QMovie when the error \a error occurred during
playback. QMovie will stop the movie, and enter QMovie::NotRunning state.
+
+ \sa lastError(), lastErrorString()
*/
/*! \fn void QMovie::finished()
@@ -328,6 +330,8 @@ int QMoviePrivate::speedAdjustedDelay(int delay) const
*/
QFrameInfo QMoviePrivate::infoForFrame(int frameNumber)
{
+ Q_Q(QMovie);
+
if (frameNumber < 0)
return QFrameInfo(); // Invalid
@@ -356,7 +360,8 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber)
reader = new QImageReader(device, format);
else
reader = new QImageReader(absoluteFilePath, format);
- (void)reader->canRead(); // Provoke a device->open() call
+ if (!reader->canRead()) // Provoke a device->open() call
+ emit q->error(reader->error());
reader->device()->seek(initialDevicePos);
reader->setBackgroundColor(bgColor);
reader->setScaledSize(scaledSize);
@@ -523,8 +528,20 @@ void QMoviePrivate::_q_loadNextFrame(bool starting)
*/
bool QMoviePrivate::isValid() const
{
- return (greatestFrameNumber >= 0) // have we seen valid data
- || reader->canRead(); // or does the reader see valid data
+ Q_Q(const QMovie);
+
+ if (greatestFrameNumber >= 0)
+ return true; // have we seen valid data
+ bool canRead = reader->canRead();
+ if (!canRead) {
+ // let the consumer know it's broken
+ //
+ // ### the const_cast here is ugly, but 'const' of this method is
+ // technically wrong right now, since it may cause the underlying device
+ // to open.
+ emit const_cast<QMovie*>(q)->error(reader->error());
+ }
+ return canRead;
}
/*!
@@ -775,6 +792,8 @@ QImage QMovie::currentImage() const
/*!
Returns \c true if the movie is valid (e.g., the image data is readable and
the image format is supported); otherwise returns \c false.
+
+ For information about why the movie is not valid, see lastError().
*/
bool QMovie::isValid() const
{
@@ -783,6 +802,29 @@ bool QMovie::isValid() const
}
/*!
+ Returns the most recent error that occurred while attempting to read image data.
+
+ \sa lastErrorString()
+*/
+QImageReader::ImageReaderError QMovie::lastError() const
+{
+ Q_D(const QMovie);
+ return d->reader->error();
+}
+
+/*!
+ Returns a human-readable representation of the most recent error that occurred
+ while attempting to read image data.
+
+ \sa lastError()
+*/
+QString QMovie::lastErrorString() const
+{
+ Q_D(const QMovie);
+ return d->reader->errorString();
+}
+
+/*!
Returns the number of frames in the movie.
Certain animation formats do not support this feature, in which
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index 930d502892..ca559d491b 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -105,6 +105,8 @@ public:
QPixmap currentPixmap() const;
bool isValid() const;
+ QImageReader::ImageReaderError lastError() const;
+ QString lastErrorString() const;
bool jumpToFrame(int frameNumber);
int loopCount() const;
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 010f5ecf67..bf628e7571 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1194,6 +1194,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qpictureformatplugin.h"
QT_END_INCLUDE_NAMESPACE
+#if QT_DEPRECATED_SINCE(5, 10)
/*!
\obsolete
@@ -1284,6 +1285,7 @@ QList<QByteArray> QPicture::outputFormats()
{
return QPictureIO::outputFormats();
}
+#endif // QT_DEPRECATED_SINCE(5, 10)
/*****************************************************************************
QPictureIO member functions
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index 8da11caee4..db2b767efe 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -90,11 +90,13 @@ public:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QPicture &p);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QPicture &p);
- static const char* pictureFormat(const QString &fileName);
- static QList<QByteArray> inputFormats();
- static QList<QByteArray> outputFormats();
- static QStringList inputFormatList();
- static QStringList outputFormatList();
+#if QT_DEPRECATED_SINCE(5, 10)
+ static QT_DEPRECATED const char* pictureFormat(const QString &fileName);
+ static QT_DEPRECATED QList<QByteArray> inputFormats();
+ static QT_DEPRECATED QList<QByteArray> outputFormats();
+ static QT_DEPRECATED QStringList inputFormatList();
+ static QT_DEPRECATED QStringList outputFormatList();
+#endif // QT_DEPRECATED_SINCE(5, 10)
QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 0aa05a04e2..5b3e3985a7 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -596,44 +596,7 @@ void QPixmap::setMask(const QBitmap &mask)
return;
detach();
-
- QImage image = data->toImage();
- if (mask.size().isEmpty()) {
- if (image.depth() != 1) { // hw: ????
- image = image.convertToFormat(QImage::Format_RGB32);
- }
- } else {
- const int w = image.width();
- const int h = image.height();
-
- switch (image.depth()) {
- case 1: {
- const QImage imageMask = mask.toImage().convertToFormat(image.format());
- for (int y = 0; y < h; ++y) {
- const uchar *mscan = imageMask.scanLine(y);
- uchar *tscan = image.scanLine(y);
- int bytesPerLine = image.bytesPerLine();
- for (int i = 0; i < bytesPerLine; ++i)
- tscan[i] &= mscan[i];
- }
- break;
- }
- default: {
- const QImage imageMask = mask.toImage().convertToFormat(QImage::Format_MonoLSB);
- image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
- for (int y = 0; y < h; ++y) {
- const uchar *mscan = imageMask.scanLine(y);
- QRgb *tscan = (QRgb *)image.scanLine(y);
- for (int x = 0; x < w; ++x) {
- if (!(mscan[x>>3] & (1 << (x&7))))
- tscan[x] = 0;
- }
- }
- break;
- }
- }
- }
- data->fromImage(image, Qt::AutoColor);
+ data->setMask(mask);
}
/*!
@@ -1496,37 +1459,7 @@ QPaintEngine *QPixmap::paintEngine() const
*/
QBitmap QPixmap::mask() const
{
- if (!data || !hasAlphaChannel())
- return QBitmap();
-
- const QImage img = toImage();
- bool shouldConvert = (img.format() != QImage::Format_ARGB32 && img.format() != QImage::Format_ARGB32_Premultiplied);
- const QImage image = (shouldConvert ? img.convertToFormat(QImage::Format_ARGB32_Premultiplied) : img);
- const int w = image.width();
- const int h = image.height();
-
- QImage mask(w, h, QImage::Format_MonoLSB);
- if (mask.isNull()) // allocation failed
- return QBitmap();
-
- mask.setColorCount(2);
- mask.setColor(0, QColor(Qt::color0).rgba());
- mask.setColor(1, QColor(Qt::color1).rgba());
-
- const int bpl = mask.bytesPerLine();
-
- for (int y = 0; y < h; ++y) {
- const QRgb *src = reinterpret_cast<const QRgb*>(image.scanLine(y));
- uchar *dest = mask.scanLine(y);
- memset(dest, 0, bpl);
- for (int x = 0; x < w; ++x) {
- if (qAlpha(*src) > 0)
- dest[x >> 3] |= (1 << (x & 7));
- ++src;
- }
- }
-
- return QBitmap::fromImage(mask);
+ return data ? data->mask() : QBitmap();
}
/*!
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index 950695a9d7..de32327071 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -190,8 +190,8 @@ void QBlittablePlatformPixmap::fromImage(const QImage &image,
uchar *mem = thisImg->bits();
const uchar *bits = correctFormatPic.constBits();
- int bytesCopied = 0;
- while (bytesCopied < correctFormatPic.byteCount()) {
+ qssize_t bytesCopied = 0;
+ while (bytesCopied < correctFormatPic.sizeInBytes()) {
memcpy(mem,bits,correctFormatPic.bytesPerLine());
mem += thisImg->bytesPerLine();
bits += correctFormatPic.bytesPerLine();
diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp
index 00c21a5f54..b123afb4db 100644
--- a/src/gui/image/qplatformpixmap.cpp
+++ b/src/gui/image/qplatformpixmap.cpp
@@ -160,6 +160,82 @@ bool QPlatformPixmap::scroll(int dx, int dy, const QRect &rect)
return false;
}
+QBitmap QPlatformPixmap::mask() const
+{
+ if (!hasAlphaChannel())
+ return QBitmap();
+
+ const QImage img = toImage();
+ bool shouldConvert = (img.format() != QImage::Format_ARGB32 && img.format() != QImage::Format_ARGB32_Premultiplied);
+ const QImage image = (shouldConvert ? img.convertToFormat(QImage::Format_ARGB32_Premultiplied) : img);
+ const int w = image.width();
+ const int h = image.height();
+
+ QImage mask(w, h, QImage::Format_MonoLSB);
+ if (mask.isNull()) // allocation failed
+ return QBitmap();
+
+ mask.setColorCount(2);
+ mask.setColor(0, QColor(Qt::color0).rgba());
+ mask.setColor(1, QColor(Qt::color1).rgba());
+
+ const int bpl = mask.bytesPerLine();
+
+ for (int y = 0; y < h; ++y) {
+ const QRgb *src = reinterpret_cast<const QRgb*>(image.scanLine(y));
+ uchar *dest = mask.scanLine(y);
+ memset(dest, 0, bpl);
+ for (int x = 0; x < w; ++x) {
+ if (qAlpha(*src) > 0)
+ dest[x >> 3] |= (1 << (x & 7));
+ ++src;
+ }
+ }
+
+ return QBitmap::fromImage(mask);
+}
+
+void QPlatformPixmap::setMask(const QBitmap &mask)
+{
+ QImage image = toImage();
+ if (mask.size().isEmpty()) {
+ if (image.depth() != 1) { // hw: ????
+ image = image.convertToFormat(QImage::Format_RGB32);
+ }
+ } else {
+ const int w = image.width();
+ const int h = image.height();
+
+ switch (image.depth()) {
+ case 1: {
+ const QImage imageMask = mask.toImage().convertToFormat(image.format());
+ for (int y = 0; y < h; ++y) {
+ const uchar *mscan = imageMask.scanLine(y);
+ uchar *tscan = image.scanLine(y);
+ int bytesPerLine = image.bytesPerLine();
+ for (int i = 0; i < bytesPerLine; ++i)
+ tscan[i] &= mscan[i];
+ }
+ break;
+ }
+ default: {
+ const QImage imageMask = mask.toImage().convertToFormat(QImage::Format_MonoLSB);
+ image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ for (int y = 0; y < h; ++y) {
+ const uchar *mscan = imageMask.scanLine(y);
+ QRgb *tscan = (QRgb *)image.scanLine(y);
+ for (int x = 0; x < w; ++x) {
+ if (!(mscan[x>>3] & (1 << (x&7))))
+ tscan[x] = 0;
+ }
+ }
+ break;
+ }
+ }
+ }
+ fromImage(image, Qt::AutoColor);
+}
+
QPixmap QPlatformPixmap::transformed(const QTransform &matrix,
Qt::TransformationMode mode) const
{
diff --git a/src/gui/image/qplatformpixmap.h b/src/gui/image/qplatformpixmap.h
index 8513755cca..7635ac2949 100644
--- a/src/gui/image/qplatformpixmap.h
+++ b/src/gui/image/qplatformpixmap.h
@@ -69,7 +69,7 @@ public:
enum ClassId { RasterClass, DirectFBClass,
BlitterClass, Direct2DClass,
- CustomClass = 1024 };
+ X11Class, CustomClass = 1024 };
QPlatformPixmap(PixelType pixelType, int classId);
virtual ~QPlatformPixmap();
@@ -99,6 +99,9 @@ public:
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const = 0;
virtual void fill(const QColor &color) = 0;
+ virtual QBitmap mask() const;
+ virtual void setMask(const QBitmap &mask);
+
virtual bool hasAlphaChannel() const = 0;
virtual QPixmap transformed(const QTransform &matrix,
Qt::TransformationMode mode) const;
@@ -144,6 +147,7 @@ protected:
private:
friend class QPixmap;
+ friend class QX11PlatformPixmap;
friend class QImagePixmapCleanupHooks; // Needs to set is_cached
friend class QOpenGLTextureCache; //Needs to check the reference count
friend class QExplicitlySharedDataPointer<QPlatformPixmap>;
@@ -159,7 +163,7 @@ private:
# define QT_XFORM_TYPE_MSBFIRST 0
# define QT_XFORM_TYPE_LSBFIRST 1
-extern bool qt_xForm_helper(const QTransform&, int, int, int, uchar*, int, int, int, const uchar*, int, int, int);
+Q_GUI_EXPORT bool qt_xForm_helper(const QTransform&, int, int, int, uchar*, int, int, int, const uchar*, int, int, int);
QT_END_NAMESPACE
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index ce7f7b8a0f..9c54b9ada4 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -42,6 +42,7 @@
#ifndef QT_NO_IMAGEFORMAT_XPM
#include <private/qcolor_p.h>
+#include <qbytearraymatcher.h>
#include <qimage.h>
#include <qmap.h>
#include <qtextstream.h>
@@ -1041,7 +1042,9 @@ bool qt_read_xpm_image_or_array(QIODevice *device, const char * const * source,
if ((readBytes = device->readLine(buf.data(), buf.size())) < 0)
return false;
- if (buf.indexOf("/* XPM") != 0) {
+ static Q_RELAXED_CONSTEXPR auto matcher = qMakeStaticByteArrayMatcher("/* XPM");
+
+ if (matcher.indexIn(buf) != 0) {
while (readBytes > 0) {
device->ungetChar(buf.at(readBytes - 1));
--readBytes;
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index cd8406b8dc..771f0fe93d 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -487,7 +487,7 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard();
if (!clipboard->supportsMode(mode)) {
if (src != 0) {
- qWarning("Data set on unsupported clipboard mode. QMimeData object will be deleted.");
+ qDebug("Data set on unsupported clipboard mode. QMimeData object will be deleted.");
src->deleteLater();
}
} else {
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index b7035d47c4..8ae9085d9f 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -471,6 +471,54 @@ QCursor::QCursor(Qt::CursorShape shape)
setShape(shape);
}
+/*!
+ \fn bool operator==(const QCursor &lhs, const QCursor &rhs)
+ \relates QCursor
+ \since 5.10
+
+ Equality operator. Returns \c true if \a lhs and \a rhs
+ have the same \l{QCursor::}{shape()} and, in the case of
+ \l{Qt::BitmapCursor}{bitmap cursors}, the same \l{QCursor::}{hotSpot()}
+ and either the same \l{QCursor::}{pixmap()} or the same
+ \l{QCursor::}{bitmap()} and \l{QCursor::}{mask()}.
+
+ \note When comparing bitmap cursors, this function only
+ compares the bitmaps' \l{QPixmap::cacheKey()}{cache keys},
+ not each pixel.
+
+ \sa operator!=(const QCursor &lhs, const QCursor &rhs)
+*/
+bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW
+{
+ if (lhs.d == rhs.d)
+ return true; // Copy or same shape
+
+ // Check pixmaps or bitmaps cache keys. Notice that having BitmapCursor
+ // shape implies either non-null pixmap or non-null bitmap and mask
+ if (lhs.shape() == Qt::BitmapCursor && rhs.shape() == Qt::BitmapCursor
+ && lhs.hotSpot() == rhs.hotSpot()) {
+ if (!lhs.d->pixmap.isNull())
+ return lhs.d->pixmap.cacheKey() == rhs.d->pixmap.cacheKey();
+
+ if (!rhs.d->pixmap.isNull())
+ return false;
+
+ return lhs.d->bm->cacheKey() == rhs.d->bm->cacheKey()
+ && lhs.d->bmm->cacheKey() == rhs.d->bmm->cacheKey();
+ }
+
+ return false;
+}
+
+/*!
+ \fn bool operator!=(const QCursor &lhs, const QCursor &rhs)
+ \relates QCursor
+ \since 5.10
+
+ Inequality operator. Returns the equivalent of !(\a lhs == \a rhs).
+
+ \sa operator==(const QCursor &lhs, const QCursor &rhs)
+*/
/*!
Returns the cursor shape identifier. The return value is one of
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index c7e9188e5b..ccce3d84ef 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -112,10 +112,14 @@ 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;
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); }
+
/*****************************************************************************
QCursor stream functions
*****************************************************************************/
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index a59612474b..3af7f5c181 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -71,14 +71,11 @@ QDragManager *QDragManager::m_instance = 0;
QDragManager::QDragManager()
- : QObject(qApp), m_platformDropData(0), m_currentDropTarget(0),
+ : QObject(qApp), m_currentDropTarget(0),
m_platformDrag(QGuiApplicationPrivate::platformIntegration()->drag()),
m_object(0)
{
Q_ASSERT(!m_instance);
-
- if (m_platformDrag)
- m_platformDropData = m_platformDrag->platformDropData();
}
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index 6f2ec46252..eaf6c74fd4 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -134,7 +134,6 @@ public:
QObject *source() const;
private:
- QMimeData *m_platformDropData;
QObject *m_currentDropTarget;
QPlatformDrag *m_platformDrag;
QDrag *m_object;
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 680acb16e7..5000cc35dd 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1525,7 +1525,11 @@ QMoveEvent::~QMoveEvent()
\ingroup events
Expose events are sent to windows when an area of the window is invalidated
- or window visibility in the windowing system changes.
+ or window exposure in the windowing system changes.
+
+ A Window with a client area that is completely covered by another window, or
+ is otherwise not visible may be considered obscured by Qt and may in such
+ cases not receive expose events.
The event handler QWindow::exposeEvent() receives expose events.
*/
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f43329afd0..a29ddbe44e 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -164,8 +164,6 @@ QString *QGuiApplicationPrivate::desktopFileName = 0;
QPalette *QGuiApplicationPrivate::app_pal = 0; // default application palette
-Qt::MouseButtons QGuiApplicationPrivate::buttons = Qt::NoButton;
-
ulong QGuiApplicationPrivate::mousePressTime = 0;
Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton;
int QGuiApplicationPrivate::mousePressX = 0;
@@ -570,6 +568,15 @@ static QWindowGeometrySpecification windowGeometrySpecification = Q_WINDOW_GEOME
\li \c {dialogs=[xp|none]}, \c xp uses XP-style native dialogs and
\c none disables them.
\li \c {fontengine=freetype}, uses the FreeType font engine.
+ \li \c {menus=[native|none]}, controls the use of native menus.
+
+ Native menus are implemented using Win32 API and are simpler than
+ QMenu-based menus in for example that they do allow for placing
+ widgets on them or changing properties like fonts and do not
+ provide hover signals. They are mainly intended for Qt Quick.
+ By default, they will be used if the application is not an
+ instance of QApplication or for Qt Quick Controls 2
+ applications.
\endlist
For more information about the platform-specific arguments available for
@@ -1838,7 +1845,7 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e)
{
QEvent::Type type;
- Qt::MouseButtons stateChange = e->buttons ^ buttons;
+ Qt::MouseButtons stateChange = e->buttons ^ mouse_buttons;
if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition && (stateChange != Qt::NoButton)) {
// A mouse event should not change both position and buttons at the same time. Instead we
// should first send a move event followed by a button changed event. Since this is not the case
@@ -1847,7 +1854,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers, e->source);
if (e->flags & QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic)
mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
- e->buttons = buttons;
+ e->buttons = mouse_buttons;
processMouseEvent(e);
processMouseEvent(&mouseButtonEvent);
return;
@@ -1901,7 +1908,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
// Ignore mouse events that don't change the current state.
return;
}
- mouse_buttons = buttons = e->buttons;
+ mouse_buttons = e->buttons;
if (button & e->buttons) {
ulong doubleClickInterval = static_cast<ulong>(QGuiApplication::styleHints()->mouseDoubleClickInterval());
doubleClick = e->timestamp - mousePressTime < doubleClickInterval && button == mousePressButton;
@@ -1926,14 +1933,14 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
const QPointF nativeLocalPoint = QHighDpi::toNativePixels(localPoint, screen);
const QPointF nativeGlobalPoint = QHighDpi::toNativePixels(globalPoint, screen);
QMouseEvent ev(type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint,
- button, buttons, e->modifiers, e->source);
+ button, mouse_buttons, e->modifiers, e->source);
ev.setTimestamp(e->timestamp);
cursor->pointerEvent(ev);
}
}
#endif
- QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source);
+ QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, mouse_buttons, e->modifiers, e->source);
ev.setTimestamp(e->timestamp);
if (window->d_func()->blockedByModalWindow && !qApp->d_func()->popupActive()) {
@@ -1967,7 +1974,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
point.state = Qt::TouchPointPressed;
} else if (type == QEvent::MouseButtonRelease && button == Qt::LeftButton) {
point.state = Qt::TouchPointReleased;
- } else if (type == QEvent::MouseMove && (buttons & Qt::LeftButton)) {
+ } else if (type == QEvent::MouseMove && (mouse_buttons & Qt::LeftButton)) {
point.state = Qt::TouchPointMoved;
} else {
return;
@@ -1988,7 +1995,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
if (!e->window.isNull() || e->nullWindow()) { // QTBUG-36364, check if window closed in response to press
const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
- button, buttons, e->modifiers, e->source);
+ button, mouse_buttons, e->modifiers, e->source);
dblClickEvent.setTimestamp(e->timestamp);
QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent);
}
@@ -2022,7 +2029,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
}
QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation,
- buttons, e->modifiers, e->phase, e->source, e->inverted);
+ mouse_buttons, e->modifiers, e->phase, e->source, e->inverted);
ev.setTimestamp(e->timestamp);
QGuiApplication::sendSpontaneousEvent(window, &ev);
#else
@@ -2206,7 +2213,7 @@ void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterf
}
// we may have changed scaling, so trigger resize event if needed
if (window->handle()) {
- QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window), QRect());
+ QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window));
processGeometryChangeEvent(&gce);
}
}
@@ -2231,35 +2238,46 @@ void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePr
if (!window)
return;
- QRect newRect = e->newGeometry;
- QRect oldRect = e->oldGeometry.isNull() ? window->d_func()->geometry : e->oldGeometry;
-
- bool isResize = oldRect.size() != newRect.size();
- bool isMove = oldRect.topLeft() != newRect.topLeft();
-
- window->d_func()->geometry = newRect;
+ const QRect lastReportedGeometry = window->d_func()->geometry;
+ const QRect requestedGeometry = e->requestedGeometry;
+ const QRect actualGeometry = e->newGeometry;
+
+ // We send size and move events only if the geometry has changed from
+ // what was last reported, or if the user tried to set a new geometry,
+ // but the window manager responded by keeping the old geometry. In the
+ // latter case we send move/resize events with the same geometry as the
+ // last reported geometry, to indicate that the window wasn't moved or
+ // resized. Note that this logic does not apply to the property changes
+ // of the window, as we don't treat them as part of this request/response
+ // protocol of QWindow/QPA.
+ const bool isResize = actualGeometry.size() != lastReportedGeometry.size()
+ || requestedGeometry.size() != actualGeometry.size();
+ const bool isMove = actualGeometry.topLeft() != lastReportedGeometry.topLeft()
+ || requestedGeometry.topLeft() != actualGeometry.topLeft();
+
+ window->d_func()->geometry = actualGeometry;
if (isResize || window->d_func()->resizeEventPending) {
- QResizeEvent e(newRect.size(), oldRect.size());
+ QResizeEvent e(actualGeometry.size(), lastReportedGeometry.size());
QGuiApplication::sendSpontaneousEvent(window, &e);
window->d_func()->resizeEventPending = false;
- if (oldRect.width() != newRect.width())
- window->widthChanged(newRect.width());
- if (oldRect.height() != newRect.height())
- window->heightChanged(newRect.height());
+ if (actualGeometry.width() != lastReportedGeometry.width())
+ window->widthChanged(actualGeometry.width());
+ if (actualGeometry.height() != lastReportedGeometry.height())
+ window->heightChanged(actualGeometry.height());
}
if (isMove) {
//### frame geometry
- QMoveEvent e(newRect.topLeft(), oldRect.topLeft());
+ QMoveEvent e(actualGeometry.topLeft(), lastReportedGeometry.topLeft());
QGuiApplication::sendSpontaneousEvent(window, &e);
- if (oldRect.x() != newRect.x())
- window->xChanged(newRect.x());
- if (oldRect.y() != newRect.y())
- window->yChanged(newRect.y());
+ if (actualGeometry.x() != lastReportedGeometry.x())
+ window->xChanged(actualGeometry.x());
+ if (actualGeometry.y() != lastReportedGeometry.y())
+ window->yChanged(actualGeometry.y());
}
}
@@ -2479,7 +2497,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
e->timestamp,
synthIt->pos,
synthIt->screenPos,
- buttons & ~Qt::LeftButton,
+ mouse_buttons & ~Qt::LeftButton,
e->modifiers,
Qt::MouseEventSynthesizedByQt);
fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
@@ -2694,7 +2712,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,
touchPoint.pos(),
touchPoint.screenPos(),
- b | (buttons & ~Qt::LeftButton),
+ b | (mouse_buttons & ~Qt::LeftButton),
e->modifiers,
Qt::MouseEventSynthesizedByQt);
fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
@@ -3534,6 +3552,22 @@ static inline void applyCursor(const QList<QWindow *> &l, const QCursor &c)
}
}
+static inline void applyOverrideCursor(const QList<QScreen *> &screens, const QCursor &c)
+{
+ for (QScreen *screen : screens) {
+ if (QPlatformCursor *cursor = screen->handle()->cursor())
+ cursor->setOverrideCursor(c);
+ }
+}
+
+static inline void clearOverrideCursor(const QList<QScreen *> &screens)
+{
+ for (QScreen *screen : screens) {
+ if (QPlatformCursor *cursor = screen->handle()->cursor())
+ cursor->clearOverrideCursor();
+ }
+}
+
static inline void applyWindowCursor(const QList<QWindow *> &l)
{
for (int i = 0; i < l.size(); ++i) {
@@ -3578,7 +3612,10 @@ void QGuiApplication::setOverrideCursor(const QCursor &cursor)
{
CHECK_QAPP_INSTANCE()
qGuiApp->d_func()->cursor_list.prepend(cursor);
- applyCursor(QGuiApplicationPrivate::window_list, cursor);
+ if (QPlatformCursor::capabilities().testFlag(QPlatformCursor::OverrideCursor))
+ applyOverrideCursor(QGuiApplicationPrivate::screen_list, cursor);
+ else
+ applyCursor(QGuiApplicationPrivate::window_list, cursor);
}
/*!
@@ -3600,9 +3637,15 @@ void QGuiApplication::restoreOverrideCursor()
qGuiApp->d_func()->cursor_list.removeFirst();
if (qGuiApp->d_func()->cursor_list.size() > 0) {
QCursor c(qGuiApp->d_func()->cursor_list.value(0));
- applyCursor(QGuiApplicationPrivate::window_list, c);
+ if (QPlatformCursor::capabilities().testFlag(QPlatformCursor::OverrideCursor))
+ applyOverrideCursor(QGuiApplicationPrivate::screen_list, c);
+ else
+ applyCursor(QGuiApplicationPrivate::window_list, c);
} else {
- applyWindowCursor(QGuiApplicationPrivate::window_list);
+ if (QPlatformCursor::capabilities().testFlag(QPlatformCursor::OverrideCursor))
+ clearOverrideCursor(QGuiApplicationPrivate::screen_list);
+ else
+ applyWindowCursor(QGuiApplicationPrivate::window_list);
}
}
#endif// QT_NO_CURSOR
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 3804667ef3..014ed861df 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -201,7 +201,6 @@ public:
virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const;
virtual bool popupActive() { return false; }
- static Qt::MouseButtons buttons;
static ulong mousePressTime;
static Qt::MouseButton mousePressButton;
static int mousePressX;
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 01a308372e..9a3d1b0d3a 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -56,7 +56,6 @@
#if defined(Q_OS_MACX)
#include <QtCore/private/qcore_mac_p.h>
-#include <Carbon/Carbon.h>
#endif
#include <algorithm>
@@ -70,6 +69,13 @@ struct MacSpecialKey {
ushort macSymbol;
};
+// Unicode code points for the glyphs associated with these keys
+// Defined by Carbon headers but not anywhere in Cocoa
+static const int kShiftUnicode = 0x21E7;
+static const int kControlUnicode = 0x2303;
+static const int kOptionUnicode = 0x2325;
+static const int kCommandUnicode = 0x2318;
+
static const int NumEntries = 21;
static const MacSpecialKey entries[NumEntries] = {
{ Qt::Key_Escape, 0x238B },
@@ -1002,7 +1008,6 @@ int QKeySequence::assign(const QString &ks)
int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format)
{
QString keyseq = ks;
- QString part;
int n = 0;
int p = 0, diff = 0;
@@ -1027,9 +1032,9 @@ int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format)
}
}
}
- part = keyseq.left(-1 == p ? keyseq.length() : p - diff);
+ QString part = keyseq.left(-1 == p ? keyseq.length() : p - diff);
keyseq = keyseq.right(-1 == p ? 0 : keyseq.length() - (p + 1));
- d->key[n] = QKeySequencePrivate::decodeString(part, format);
+ d->key[n] = QKeySequencePrivate::decodeString(std::move(part), format);
++n;
}
return n;
@@ -1055,10 +1060,10 @@ int QKeySequence::decodeString(const QString &str)
return QKeySequencePrivate::decodeString(str, NativeText);
}
-int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::SequenceFormat format)
+int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceFormat format)
{
int ret = 0;
- QString accel = str.toLower();
+ accel = std::move(accel).toLower();
bool nativeText = (format == QKeySequence::NativeText);
QVector<QModifKeyName> *gmodifs;
@@ -1094,7 +1099,6 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
<< QModifKeyName(Qt::KeypadModifier, QLatin1String("num+"));
}
}
- if (!gmodifs) return ret;
QVector<QModifKeyName> modifs;
diff --git a/src/gui/kernel/qkeysequence_p.h b/src/gui/kernel/qkeysequence_p.h
index 8ba86c31b8..fbcab5d34e 100644
--- a/src/gui/kernel/qkeysequence_p.h
+++ b/src/gui/kernel/qkeysequence_p.h
@@ -85,7 +85,7 @@ public:
static QString encodeString(int key, QKeySequence::SequenceFormat format);
// used in dbusmenu
Q_GUI_EXPORT static QString keyName(int key, QKeySequence::SequenceFormat format);
- static int decodeString(const QString &keyStr, QKeySequence::SequenceFormat format);
+ static int decodeString(QString accel, QKeySequence::SequenceFormat format);
};
#endif // QT_NO_SHORTCUT
diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp
index 4d79db8ab2..ae027af627 100644
--- a/src/gui/kernel/qoffscreensurface.cpp
+++ b/src/gui/kernel/qoffscreensurface.cpp
@@ -121,14 +121,16 @@ public:
/*!
- Creates an offscreen surface for the \a targetScreen.
+ \since 5.10
+
+ Creates an offscreen surface for the \a targetScreen with the given \a parent.
The underlying platform surface is not created until create() is called.
\sa setScreen(), create()
*/
-QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen)
- : QObject(*new QOffscreenSurfacePrivate(), 0)
+QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen, QObject *parent)
+ : QObject(*new QOffscreenSurfacePrivate(), parent)
, QSurface(Offscreen)
{
Q_D(QOffscreenSurface);
@@ -143,6 +145,18 @@ QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen)
connect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(screenDestroyed(QObject*)));
}
+/*!
+ Creates an offscreen surface for the \a targetScreen.
+
+ The underlying platform surface is not created until create() is called.
+
+ \sa setScreen(), create()
+*/
+QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen)
+ : QOffscreenSurface(targetScreen, nullptr)
+{
+}
+
/*!
Destroys the offscreen surface.
diff --git a/src/gui/kernel/qoffscreensurface.h b/src/gui/kernel/qoffscreensurface.h
index 35c498c89a..3295ae0d40 100644
--- a/src/gui/kernel/qoffscreensurface.h
+++ b/src/gui/kernel/qoffscreensurface.h
@@ -57,7 +57,8 @@ class Q_GUI_EXPORT QOffscreenSurface : public QObject, public QSurface
Q_DECLARE_PRIVATE(QOffscreenSurface)
public:
-
+ // ### Qt 6: merge overloads
+ explicit QOffscreenSurface(QScreen *screen, QObject *parent);
explicit QOffscreenSurface(QScreen *screen = Q_NULLPTR);
virtual ~QOffscreenSurface();
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 3dc06ae60e..406fcdd226 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1676,6 +1676,61 @@ void QOpenGLMultiGroupSharedResource::cleanup(QOpenGLContextGroup *group, QOpenG
m_groups.removeOne(group);
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QOpenGLVersionProfile(";
+ if (vp.isValid()) {
+ debug << vp.version().first << '.' << vp.version().second
+ << ", profile=" << vp.profile();
+ } else {
+ debug << "invalid";
+ }
+ debug << ')';
+ return debug;
+}
+
+QDebug operator<<(QDebug debug, const QOpenGLContext *ctx)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug.noquote();
+ debug << "QOpenGLContext(";
+ if (ctx) {
+ debug << static_cast<const void *>(ctx);
+ if (ctx->isValid()) {
+ debug << ", nativeHandle=" << ctx->nativeHandle()
+ << ", format=" << ctx->format();
+ if (const QSurface *sf = ctx->surface())
+ debug << ", surface=" << sf;
+ if (const QScreen *s = ctx->screen())
+ debug << ", screen=\"" << s->name() << '"';
+ } else {
+ debug << ", invalid";
+ }
+ } else {
+ debug << '0';
+ }
+ debug << ')';
+ return debug;
+}
+
+QDebug operator<<(QDebug debug, const QOpenGLContextGroup *cg)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QOpenGLContextGroup(";
+ if (cg)
+ debug << cg->shares();
+ else
+ debug << '0';
+ debug << ')';
+ return debug;
+}
+#endif // QT_NO_DEBUG_STREAM
+
#include "moc_qopenglcontext.cpp"
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index 3ec9ce3188..07153db84e 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -69,6 +69,7 @@
QT_BEGIN_NAMESPACE
+class QDebug;
class QOpenGLContextPrivate;
class QOpenGLContextGroupPrivate;
class QOpenGLFunctions;
@@ -249,6 +250,12 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_screenDestroyed(QObject *object))
};
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp);
+Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QOpenGLContext *ctx);
+Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QOpenGLContextGroup *cg);
+#endif // !QT_NO_DEBUG_STREAM
+
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index a992793246..665cc430cc 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -388,7 +388,7 @@ static void qt_palette_from_color(QPalette &pal, const QColor &button)
\warning Some styles do not use the palette for all drawing, for
instance, if they make use of native theme engines. This is the
- case for both the Windows XP, Windows Vista, and the \macos
+ case for both the Windows Vista and the \macos
styles.
\sa QApplication::setPalette(), QWidget::setPalette(), QColor
@@ -1115,14 +1115,14 @@ void QPalette::setColorGroup(ColorGroup cg, const QBrush &foreground, const QBru
Q_GUI_EXPORT QPalette qt_fusionPalette()
{
- QColor backGround(239, 235, 231);
+ QColor backGround(239, 239, 239);
QColor light = backGround.lighter(150);
QColor mid(backGround.darker(130));
QColor midLight = mid.lighter(110);
QColor base = Qt::white;
QColor disabledBase(backGround);
QColor dark = backGround.darker(150);
- QColor darkDisabled = QColor(209, 200, 191).darker(110);
+ QColor darkDisabled = QColor(209, 209, 209).darker(110);
QColor text = Qt::black;
QColor hightlightedText = Qt::white;
QColor disabledText = QColor(190, 190, 190);
@@ -1145,7 +1145,7 @@ Q_GUI_EXPORT QPalette qt_fusionPalette()
fusionPalette.setBrush(QPalette::Active, QPalette::Highlight, QColor(48, 140, 198));
fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(48, 140, 198));
- fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 141, 126));
+ fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 145, 145));
return fusionPalette;
}
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index af0214e016..e6cf6a8216 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -95,6 +95,17 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \enum QPlatformCursor::Capability
+ \since 5.10
+
+ \value OverrideCursor Indicates that the platform implements
+ QPlatformCursor::setOverrideCursor() and
+ QPlatformCursor::clearOverrideCursor().
+*/
+
+QPlatformCursor::Capabilities QPlatformCursor::m_capabilities = 0;
+
+/*!
\fn QPlatformCursor::QPlatformCursor()
Constructs a QPlatformCursor.
@@ -659,4 +670,34 @@ void QPlatformCursorImage::set(const uchar *data, const uchar *mask,
\brief Return the cursor's hotspot
*/
+#ifndef QT_NO_CURSOR
+/*!
+ Reimplement this function in subclass to set an override cursor
+ on the associated screen and return true to indicate success.
+
+ This function can be implemented on platforms where the cursor is a
+ property of the application or the screen rather than a property
+ of the window. On these platforms, the OverrideCursor capability
+ should be set.
+
+ \sa QGuiApplication::setOverrideCursor(), Capabilities
+
+ \since 5.10
+*/
+void QPlatformCursor::setOverrideCursor(const QCursor &)
+{
+}
+
+/*!
+ Reimplement this function in subclass to clear the override cursor.
+
+ \sa QGuiApplication::clearOverrideCursor(), Capabilities
+
+ \since 5.10
+*/
+void QPlatformCursor::clearOverrideCursor()
+{
+}
+#endif // QT_NO_CURSOR
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformcursor.h b/src/gui/kernel/qplatformcursor.h
index dddd9e5831..40e8a562f8 100644
--- a/src/gui/kernel/qplatformcursor.h
+++ b/src/gui/kernel/qplatformcursor.h
@@ -78,21 +78,36 @@ private:
class Q_GUI_EXPORT QPlatformCursor : public QObject {
public:
+ enum Capability {
+ OverrideCursor = 0x1
+ };
+ Q_DECLARE_FLAGS(Capabilities, Capability)
+
QPlatformCursor();
// input methods
virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); }
#ifndef QT_NO_CURSOR
virtual void changeCursor(QCursor * windowCursor, QWindow * window) = 0;
-#endif
+ virtual void setOverrideCursor(const QCursor &);
+ virtual void clearOverrideCursor();
+#endif // QT_NO_CURSOR
virtual QPoint pos() const;
virtual void setPos(const QPoint &pos);
+ static Capabilities capabilities() { return m_capabilities; }
+ static void setCapabilities(Capabilities c) { m_capabilities = c; }
+ static void setCapability(Capability c) { m_capabilities.setFlag(c); }
+
private:
friend void qt_qpa_set_cursor(QWidget * w, bool force);
friend class QApplicationPrivate;
+
+ static Capabilities m_capabilities;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformCursor::Capabilities)
+
QT_END_NAMESPACE
#endif // QPLATFORMCURSOR_H
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 01cf98c7c9..ad134ebe7f 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
*/
-static const int buttonRoleLayouts[2][5][14] =
+static const int buttonRoleLayouts[2][6][14] =
{
// Qt::Horizontal
{
@@ -92,7 +92,15 @@ static const int buttonRoleLayouts[2][5][14] =
// MacModelessLayout
{ QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::Stretch,
QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL,
- QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }
+ QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },
+
+ // AndroidLayout (neutral, stretch, dismissive, affirmative)
+ // https://material.io/guidelines/components/dialogs.html#dialogs-specs
+ { QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ActionRole,
+ QPlatformDialogHelper::Stretch, QPlatformDialogHelper::RejectRole | QPlatformDialogHelper::Reverse,
+ QPlatformDialogHelper::NoRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::DestructiveRole | QPlatformDialogHelper::Reverse,
+ QPlatformDialogHelper::AlternateRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::AcceptRole | QPlatformDialogHelper::Reverse,
+ QPlatformDialogHelper::YesRole | QPlatformDialogHelper::Reverse, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }
},
// Qt::Vertical
@@ -120,10 +128,20 @@ static const int buttonRoleLayouts[2][5][14] =
// MacModelessLayout
{ QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::ApplyRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Stretch,
QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL,
- QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }
+ QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL },
+
+ // AndroidLayout
+ // (affirmative
+ // dismissive
+ // neutral)
+ // https://material.io/guidelines/components/dialogs.html#dialogs-specs
+ { QPlatformDialogHelper::YesRole, QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::DestructiveRole,
+ QPlatformDialogHelper::NoRole, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::Stretch, QPlatformDialogHelper::ActionRole, QPlatformDialogHelper::ApplyRole,
+ QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::EOL, QPlatformDialogHelper::EOL }
}
};
+
QPlatformDialogHelper::QPlatformDialogHelper()
{
qRegisterMetaType<StandardButton>();
@@ -917,6 +935,8 @@ const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, Butt
policy = MacLayout;
#elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX)
policy = KdeLayout;
+#elif defined (Q_OS_ANDROID)
+ policy = AndroidLayout;
#else
policy = WinLayout;
#endif
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index ed88c19c84..f58dcf17f0 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -141,13 +141,14 @@ public:
Q_ENUM(ButtonRole)
enum ButtonLayout {
- // keep this in sync with QDialogButtonBox::ButtonLayout and QMessageBox::ButtonLayout
+ // keep this in sync with QDialogButtonBox::ButtonLayout
UnknownLayout = -1,
WinLayout,
MacLayout,
KdeLayout,
GnomeLayout,
- MacModelessLayout
+ MacModelessLayout,
+ AndroidLayout
};
QPlatformDialogHelper();
diff --git a/src/gui/kernel/qplatformdrag.h b/src/gui/kernel/qplatformdrag.h
index 560f984a5b..54e6a667fe 100644
--- a/src/gui/kernel/qplatformdrag.h
+++ b/src/gui/kernel/qplatformdrag.h
@@ -95,7 +95,6 @@ public:
virtual ~QPlatformDrag();
QDrag *currentDrag() const;
- virtual QMimeData *platformDropData() = 0;
virtual Qt::DropAction drag(QDrag *m_drag) = 0;
virtual void cancelDrag();
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index fe1861e08b..873ec3a33b 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -237,6 +237,10 @@ QPlatformServices *QPlatformIntegration::services() const
is required to have this capability.
\value ApplicationIcon The platform supports setting the application icon. (since 5.5)
+
+ \value TopStackedNativeChildWindows The platform supports native child windows via
+ QWindowContainer without having to punch a transparent hole in the
+ backingstore. (since 5.10)
*/
/*!
@@ -260,7 +264,8 @@ QPlatformServices *QPlatformIntegration::services() const
bool QPlatformIntegration::hasCapability(Capability cap) const
{
- return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement;
+ return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement
+ || cap == TopStackedNativeChildWindows;
}
QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
@@ -387,6 +392,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return false;
case ShowIsMaximized:
return false;
+ case ShowShortcutsInContextMenus:
+ return QPlatformTheme::defaultThemeHint(QPlatformTheme::ShowShortcutsInContextMenus);
case PasswordMaskDelay:
return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay);
case PasswordMaskCharacter:
@@ -622,4 +629,26 @@ void QPlatformIntegration::setApplicationIcon(const QIcon &icon) const
Q_UNUSED(icon);
}
+#if QT_CONFIG(vulkan)
+
+/*!
+ Factory function for QPlatformVulkanInstance. The \a instance parameter is a
+ pointer to the instance for which a platform-specific backend needs to be
+ created.
+
+ Returns a pointer to a QPlatformOpenGLContext instance or \c NULL if the context could
+ not be created.
+
+ \sa QVulkanInstance
+ \since 5.10
+*/
+QPlatformVulkanInstance *QPlatformIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const
+{
+ Q_UNUSED(instance);
+ qWarning("This plugin does not support createPlatformVulkanInstance");
+ return nullptr;
+}
+
+#endif // QT_CONFIG(vulkan)
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 0449e0b4c8..eeaa7574f7 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -78,6 +78,8 @@ class QPlatformSessionManager;
class QKeyEvent;
class QPlatformOffscreenSurface;
class QOffscreenSurface;
+class QPlatformVulkanInstance;
+class QVulkanInstance;
class Q_GUI_EXPORT QPlatformIntegration
{
@@ -99,7 +101,8 @@ public:
RasterGLSurface,
AllGLFunctionsQueryable,
ApplicationIcon,
- SwitchableWidgetComposition
+ SwitchableWidgetComposition,
+ TopStackedNativeChildWindows
};
virtual ~QPlatformIntegration() { }
@@ -160,6 +163,7 @@ public:
ItemViewActivateItemOnSingleClick,
UiEffects,
WheelScrollLines,
+ ShowShortcutsInContextMenus,
};
virtual QVariant styleHint(StyleHint hint) const;
@@ -188,6 +192,10 @@ public:
virtual void beep() const;
+#if QT_CONFIG(vulkan)
+ virtual QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const;
+#endif
+
protected:
void screenAdded(QPlatformScreen *screen, bool isPrimary = false);
void destroyScreen(QPlatformScreen *screen);
diff --git a/src/gui/kernel/qplatformmenu.cpp b/src/gui/kernel/qplatformmenu.cpp
index 1eb146dd0f..0d76f2039d 100644
--- a/src/gui/kernel/qplatformmenu.cpp
+++ b/src/gui/kernel/qplatformmenu.cpp
@@ -45,6 +45,37 @@
QT_BEGIN_NAMESPACE
+QPlatformMenuItem::QPlatformMenuItem()
+{
+ m_tag = reinterpret_cast<quintptr>(this);
+}
+
+void QPlatformMenuItem::setTag(quintptr tag)
+{
+ m_tag = tag;
+}
+
+quintptr QPlatformMenuItem::tag() const
+{
+ return m_tag;
+}
+
+QPlatformMenu::QPlatformMenu()
+{
+ m_tag = reinterpret_cast<quintptr>(this);
+}
+
+void QPlatformMenu::setTag(quintptr tag)
+{
+ m_tag = tag;
+}
+
+quintptr QPlatformMenu::tag() const
+{
+ return m_tag;
+
+}
+
QPlatformMenuItem *QPlatformMenu::createMenuItem() const
{
return QGuiApplicationPrivate::platformTheme()->createPlatformMenuItem();
diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h
index f8561445b1..e3fa5c71b1 100644
--- a/src/gui/kernel/qplatformmenu.h
+++ b/src/gui/kernel/qplatformmenu.h
@@ -62,6 +62,8 @@ class Q_GUI_EXPORT QPlatformMenuItem : public QObject
{
Q_OBJECT
public:
+ QPlatformMenuItem();
+
// copied from, and must stay in sync with, QAction menu roles.
enum MenuRole { NoRole = 0, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole,
AboutRole, PreferencesRole, QuitRole,
@@ -71,8 +73,8 @@ public:
RoleCount };
Q_ENUM(MenuRole)
- virtual void setTag(quintptr tag) = 0;
- virtual quintptr tag()const = 0;
+ virtual void setTag(quintptr tag);
+ virtual quintptr tag() const;
virtual void setText(const QString &text) = 0;
virtual void setIcon(const QIcon &icon) = 0;
@@ -94,12 +96,17 @@ public:
Q_SIGNALS:
void activated();
void hovered();
+
+private:
+ quintptr m_tag;
};
class Q_GUI_EXPORT QPlatformMenu : public QObject
{
Q_OBJECT
public:
+ QPlatformMenu();
+
enum MenuType { DefaultMenu = 0, EditMenu };
Q_ENUM(MenuType)
@@ -108,8 +115,8 @@ public:
virtual void syncMenuItem(QPlatformMenuItem *menuItem) = 0;
virtual void syncSeparatorsCollapsible(bool enable) = 0;
- virtual void setTag(quintptr tag) = 0;
- virtual quintptr tag()const = 0;
+ virtual void setTag(quintptr tag);
+ virtual quintptr tag() const;
virtual void setText(const QString &text) = 0;
virtual void setIcon(const QIcon &icon) = 0;
@@ -138,6 +145,9 @@ public:
Q_SIGNALS:
void aboutToShow();
void aboutToHide();
+
+private:
+ quintptr m_tag;
};
class Q_GUI_EXPORT QPlatformMenuBar : public QObject
diff --git a/src/gui/kernel/qplatformoffscreensurface.h b/src/gui/kernel/qplatformoffscreensurface.h
index 7f2e0d475b..be15a98e28 100644
--- a/src/gui/kernel/qplatformoffscreensurface.h
+++ b/src/gui/kernel/qplatformoffscreensurface.h
@@ -64,13 +64,13 @@ class Q_GUI_EXPORT QPlatformOffscreenSurface : public QPlatformSurface
Q_DECLARE_PRIVATE(QPlatformOffscreenSurface)
public:
explicit QPlatformOffscreenSurface(QOffscreenSurface *offscreenSurface);
- virtual ~QPlatformOffscreenSurface();
+ ~QPlatformOffscreenSurface() override;
QOffscreenSurface *offscreenSurface() const;
QPlatformScreen *screen() const;
- virtual QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ virtual QSurfaceFormat format() const override;
virtual bool isValid() const;
protected:
diff --git a/src/gui/kernel/qplatformsystemtrayicon.cpp b/src/gui/kernel/qplatformsystemtrayicon.cpp
index 5481997b3c..296beda0f9 100644
--- a/src/gui/kernel/qplatformsystemtrayicon.cpp
+++ b/src/gui/kernel/qplatformsystemtrayicon.cpp
@@ -140,10 +140,19 @@ QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon()
*/
/*!
+ \fn void QPlatformSystemTrayIcon::contextMenuRequested(QPoint globalPos, const QPlatformScreen *screen)
+ This signal is emitted when the context menu is requested.
+ In particular, on platforms where createMenu() returns nullptr,
+ its emission will cause QSystemTrayIcon to show a QMenu-based menu.
+ \sa activated()
+ \since 5.10
+*/
+
+/*!
\fn void QPlatformSystemTrayIcon::activated(QPlatformSystemTrayIcon::ActivationReason reason)
This signal is emitted when the user activates the system tray icon.
\a reason specifies the reason for activation.
- \sa QSystemTrayIcon::ActivationReason
+ \sa QSystemTrayIcon::ActivationReason, contextMenuRequested()
*/
/*!
diff --git a/src/gui/kernel/qplatformsystemtrayicon.h b/src/gui/kernel/qplatformsystemtrayicon.h
index c52dbfbd78..948a6c099d 100644
--- a/src/gui/kernel/qplatformsystemtrayicon.h
+++ b/src/gui/kernel/qplatformsystemtrayicon.h
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
class QPlatformMenu;
+class QPlatformScreen;
class QIcon;
class QString;
class QRect;
@@ -88,6 +89,7 @@ public:
Q_SIGNALS:
void activated(QPlatformSystemTrayIcon::ActivationReason reason);
+ void contextMenuRequested(QPoint globalPos, const QPlatformScreen *screen);
void messageClicked();
};
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index 878f656f2e..ebf65eda12 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -161,6 +161,8 @@ QT_BEGIN_NAMESPACE
The default value is double the MouseDoubleClickDistance, or 10 logical pixels
if that is not specified.
+ \value ShowShortcutsInContextMenus (bool) Whether to display shortcut key sequences in context menus.
+
\sa themeHint(), QStyle::pixelMetric()
*/
@@ -516,6 +518,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint)
return QVariant(QStringList());
case QPlatformTheme::StyleNames:
return QVariant(QStringList());
+ case QPlatformTheme::ShowShortcutsInContextMenus:
+ return QVariant(false);
case TextCursorWidth:
return QVariant(1);
case DropShadow:
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h
index 2ba2f8669f..f4ff418db6 100644
--- a/src/gui/kernel/qplatformtheme.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -115,7 +115,8 @@ public:
MousePressAndHoldInterval,
MouseDoubleClickDistance,
WheelScrollLines,
- TouchDoubleTapDistance
+ TouchDoubleTapDistance,
+ ShowShortcutsInContextMenus
};
enum DialogType {
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 5062bd1e77..ae39411729 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -71,6 +71,17 @@ QPlatformWindow::~QPlatformWindow()
}
/*!
+ Called as part of QWindow::create(), after constructing
+ the window. Platforms should prefer to do initialization
+ here instead of in the constructor, as the platform window
+ object will be fully constructed, and associated to the
+ corresponding QWindow, allowing synchronous event delivery.
+*/
+void QPlatformWindow::initialize()
+{
+}
+
+/*!
Returns the window which belongs to the QPlatformWindow
*/
QWindow *QPlatformWindow::window() const
@@ -105,10 +116,18 @@ QSurfaceFormat QPlatformWindow::format() const
}
/*!
- This function is called by Qt whenever a window is moved or the window is resized. The resize
- can happen programatically(from ie. user application) or by the window manager. This means that
- there is no need to call this function specifically from the window manager callback, instead
- call QWindowSystemInterface::handleGeometryChange(QWindow *w, const QRect &newRect);
+ This function is called by Qt whenever a window is moved or resized using the QWindow API.
+
+ Unless you also override QPlatformWindow::geometry(), you need to call the baseclass
+ implementation of this function in any override of QPlatformWindow::setGeometry(), as
+ QWindow::geometry() is expected to report back the set geometry until a confirmation
+ (or rejection) of the new geometry comes back from the window manager and is reported
+ via QWindowSystemInterface::handleGeometryChange().
+
+ Window move/resizes can also be triggered spontaneously by the window manager, or as a
+ response to an earlier requested move/resize via the Qt APIs. There is no need to call
+ this function from the window manager callback, instead call
+ QWindowSystemInterface::handleGeometryChange().
The position(x, y) part of the rect might be inclusive or exclusive of the window frame
as returned by frameMargins(). You can detect this in the plugin by checking
@@ -261,7 +280,7 @@ QPoint QPlatformWindow::mapFromGlobal(const QPoint &pos) const
Qt::WindowActive can be ignored.
*/
-void QPlatformWindow::setWindowState(Qt::WindowState)
+void QPlatformWindow::setWindowState(Qt::WindowStates)
{
}
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 8af8791bb4..dff8f618e2 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -72,14 +72,16 @@ class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface
Q_DECLARE_PRIVATE(QPlatformWindow)
public:
explicit QPlatformWindow(QWindow *window);
- virtual ~QPlatformWindow();
+ ~QPlatformWindow() override;
+
+ virtual void initialize();
QWindow *window() const;
QPlatformWindow *parent() const;
QPlatformScreen *screen() const;
- virtual QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ virtual QSurfaceFormat format() const override;
virtual void setGeometry(const QRect &rect);
virtual QRect geometry() const;
@@ -89,7 +91,7 @@ public:
virtual void setVisible(bool visible);
virtual void setWindowFlags(Qt::WindowFlags flags);
- virtual void setWindowState(Qt::WindowState state);
+ virtual void setWindowState(Qt::WindowStates state);
virtual WId winId() const;
virtual void setParent(const QPlatformWindow *window);
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index 96f75f37eb..479e228e27 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -384,6 +384,10 @@ QRect QScreen::geometry() const
The available geometry is the geometry excluding window manager reserved areas
such as task bars and system menus.
+
+ Note, on X11 this will return the true available geometry only on systems with one monitor and
+ if window manager has set _NET_WORKAREA atom. In all other cases this is equal to geometry().
+ This is a limitation in X11 window manager specification.
*/
QRect QScreen::availableGeometry() const
{
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index a1e25dc53c..99aaed0444 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -353,13 +353,6 @@ QSimpleDrag::QSimpleDrag() : m_current_window(0)
{
}
-QMimeData *QSimpleDrag::platformDropData()
-{
- if (drag())
- return drag()->mimeData();
- return 0;
-}
-
void QSimpleDrag::startDrag()
{
QBasicDrag::startDrag();
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 0b8a0bc703..45c13e43b2 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -125,7 +125,6 @@ class Q_GUI_EXPORT QSimpleDrag : public QBasicDrag
{
public:
QSimpleDrag();
- virtual QMimeData *platformDropData() Q_DECL_OVERRIDE;
protected:
virtual void startDrag() Q_DECL_OVERRIDE;
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 85c0768e35..0850228ee5 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -365,6 +365,17 @@ bool QStyleHints::showIsMaximized() const
}
/*!
+ \property QStyleHints::showShortcutsInContextMenus
+ \since 5.10
+ \brief \c true if the platform normally shows shortcut key sequences in
+ context menus, otherwise \c false.
+*/
+bool QStyleHints::showShortcutsInContextMenus() const
+{
+ return themeableHint(QPlatformTheme::ShowShortcutsInContextMenus, QPlatformIntegration::ShowShortcutsInContextMenus).toBool();
+}
+
+/*!
\property QStyleHints::passwordMaskDelay
\brief the time, in milliseconds, a typed letter is displayed unshrouded
in a text input field in password mode.
diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h
index b9bf428edd..2c2e048b15 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -64,6 +64,7 @@ class Q_GUI_EXPORT QStyleHints : public QObject
Q_PROPERTY(bool setFocusOnTouchRelease READ setFocusOnTouchRelease STORED false CONSTANT FINAL)
Q_PROPERTY(bool showIsFullScreen READ showIsFullScreen STORED false CONSTANT FINAL)
Q_PROPERTY(bool showIsMaximized READ showIsMaximized STORED false CONSTANT FINAL)
+ Q_PROPERTY(bool showShortcutsInContextMenus READ showShortcutsInContextMenus STORED false CONSTANT FINAL)
Q_PROPERTY(int startDragDistance READ startDragDistance NOTIFY startDragDistanceChanged FINAL)
Q_PROPERTY(int startDragTime READ startDragTime NOTIFY startDragTimeChanged FINAL)
Q_PROPERTY(int startDragVelocity READ startDragVelocity STORED false CONSTANT FINAL)
@@ -90,6 +91,7 @@ public:
int cursorFlashTime() const;
bool showIsFullScreen() const;
bool showIsMaximized() const;
+ bool showShortcutsInContextMenus() const;
int passwordMaskDelay() const;
QChar passwordMaskCharacter() const;
qreal fontSmoothingGamma() const;
diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp
index 3cdd11de8c..63651ee822 100644
--- a/src/gui/kernel/qsurface.cpp
+++ b/src/gui/kernel/qsurface.cpp
@@ -78,6 +78,8 @@ QT_BEGIN_NAMESPACE
requires the use of private API.
\value OpenVGSurface The surface is an OpenVG compatible surface and can be used
in conjunction with OpenVG contexts.
+ \value VulkanSurface The surface is a Vulkan compatible surface and can be used
+ in conjunction with the Vulkan graphics API.
*/
diff --git a/src/gui/kernel/qsurface.h b/src/gui/kernel/qsurface.h
index a96b7a6422..7e09449d12 100644
--- a/src/gui/kernel/qsurface.h
+++ b/src/gui/kernel/qsurface.h
@@ -66,6 +66,7 @@ public:
OpenGLSurface,
RasterGLSurface,
OpenVGSurface,
+ VulkanSurface
};
virtual ~QSurface();
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 000d727380..574310f554 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -73,6 +73,7 @@ public:
, major(2)
, minor(0)
, swapInterval(1) // default to vsync
+ , colorSpace(QSurfaceFormat::DefaultColorSpace)
{
}
@@ -91,7 +92,8 @@ public:
profile(other->profile),
major(other->major),
minor(other->minor),
- swapInterval(other->swapInterval)
+ swapInterval(other->swapInterval),
+ colorSpace(other->colorSpace)
{
}
@@ -110,6 +112,7 @@ public:
int major;
int minor;
int swapInterval;
+ QSurfaceFormat::ColorSpace colorSpace;
};
/*!
@@ -124,6 +127,12 @@ public:
contains surface configuration parameters such as OpenGL profile and
version for rendering, whether or not to enable stereo buffers, and swap
behaviour.
+
+ \note When troubleshooting context or window format issues, it can be
+ helpful to enable the logging category \c{qt.qpa.gl}. Depending on the
+ platform, this may print useful debug information when it comes to OpenGL
+ initialization and the native visual or framebuffer configurations which
+ QSurfaceFormat gets mapped to.
*/
/*!
@@ -199,6 +208,22 @@ public:
*/
/*!
+ \enum QSurfaceFormat::ColorSpace
+
+ This enum is used to specify the preferred color space, controlling if the
+ window's associated default framebuffer is able to do updates and blending
+ in a given encoding instead of the standard linear operations.
+
+ \value DefaultColorSpace The default, unspecified color space.
+
+ \value sRGBColorSpace When \c{GL_ARB_framebuffer_sRGB} or
+ \c{GL_EXT_framebuffer_sRGB} is supported by the platform and this value is
+ set, the window will be created with an sRGB-capable default
+ framebuffer. Note that some platforms may return windows with a sRGB-capable
+ default framebuffer even when not requested explicitly.
+ */
+
+/*!
Constructs a default initialized QSurfaceFormat.
\note By default OpenGL 2.0 is requested since this provides the highest
@@ -736,6 +761,47 @@ int QSurfaceFormat::swapInterval() const
return d->swapInterval;
}
+/*!
+ Sets the preferred \a colorSpace.
+
+ For example, this allows requesting windows with default framebuffers that
+ are sRGB-capable on platforms that support it.
+
+ \note When the requested color space is not supported by the platform, the
+ request is ignored. Query the QSurfaceFormat after window creation to verify
+ if the color space request could be honored or not.
+
+ \note This setting controls if the default framebuffer of the window is
+ capable of updates and blending in a given color space. It does not change
+ applications' output by itself. The applications' rendering code will still
+ have to opt in via the appropriate OpenGL calls to enable updates and
+ blending to be performed in the given color space instead of using the
+ standard linear operations.
+
+ \since 5.10
+
+ \sa colorSpace()
+ */
+void QSurfaceFormat::setColorSpace(ColorSpace colorSpace)
+{
+ if (d->colorSpace != colorSpace) {
+ detach();
+ d->colorSpace = colorSpace;
+ }
+}
+
+/*!
+ \return the color space.
+
+ \since 5.10
+
+ \sa setColorSpace()
+*/
+QSurfaceFormat::ColorSpace QSurfaceFormat::colorSpace() const
+{
+ return d->colorSpace;
+}
+
Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format)
/*!
@@ -841,6 +907,7 @@ QDebug operator<<(QDebug dbg, const QSurfaceFormat &f)
<< ", samples " << d->numSamples
<< ", swapBehavior " << d->swapBehavior
<< ", swapInterval " << d->swapInterval
+ << ", colorSpace " << d->colorSpace
<< ", profile " << d->profile
<< ')';
diff --git a/src/gui/kernel/qsurfaceformat.h b/src/gui/kernel/qsurfaceformat.h
index 246163609e..ed63eb8bbf 100644
--- a/src/gui/kernel/qsurfaceformat.h
+++ b/src/gui/kernel/qsurfaceformat.h
@@ -85,6 +85,12 @@ public:
};
Q_ENUM(OpenGLContextProfile)
+ enum ColorSpace {
+ DefaultColorSpace,
+ sRGBColorSpace
+ };
+ Q_ENUM(ColorSpace)
+
QSurfaceFormat();
/*implicit*/ QSurfaceFormat(FormatOptions options);
QSurfaceFormat(const QSurfaceFormat &other);
@@ -145,6 +151,9 @@ public:
int swapInterval() const;
void setSwapInterval(int interval);
+ ColorSpace colorSpace() const;
+ void setColorSpace(ColorSpace colorSpace);
+
static void setDefaultFormat(const QSurfaceFormat &format);
static QSurfaceFormat defaultFormat();
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 43b201e9b0..5b5c1bd0e3 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -116,7 +116,7 @@ QT_BEGIN_NAMESPACE
application, isExposed() will simply return the same value as isVisible().
QWindow::Visibility queried through visibility() is a convenience API
- combining the functions of visible() and windowState().
+ combining the functions of visible() and windowStates().
\section1 Rendering
@@ -317,34 +317,102 @@ void QWindow::setVisibility(Visibility v)
}
}
-void QWindowPrivate::updateVisibility()
+/*
+ Subclasses may override this function to run custom setVisible
+ logic. Subclasses that do so must call the base class implementation
+ at some point to make the native window visible, and must not
+ call QWindow::setVisble() since that will recurse back here.
+*/
+void QWindowPrivate::setVisible(bool visible)
{
Q_Q(QWindow);
- QWindow::Visibility old = visibility;
+ if (this->visible != visible) {
+ this->visible = visible;
+ emit q->visibleChanged(visible);
+ updateVisibility();
+ } else if (platformWindow) {
+ // Visibility hasn't changed, and the platform window is in sync
+ return;
+ }
+
+ if (!platformWindow) {
+ // If we have a parent window, but the parent hasn't been created yet, we
+ // can defer creation until the parent is created or we're re-parented.
+ if (parentWindow && !parentWindow->handle())
+ return;
+
+ // We only need to create the window if it's being shown
+ if (visible)
+ q->create();
+ }
if (visible) {
- switch (windowState) {
- case Qt::WindowMinimized:
- visibility = QWindow::Minimized;
- break;
- case Qt::WindowMaximized:
- visibility = QWindow::Maximized;
- break;
- case Qt::WindowFullScreen:
- visibility = QWindow::FullScreen;
- break;
- case Qt::WindowNoState:
- visibility = QWindow::Windowed;
- break;
- default:
- Q_ASSERT(false);
- break;
+ // remove posted quit events when showing a new window
+ QCoreApplication::removePostedEvents(qApp, QEvent::Quit);
+
+ if (q->type() == Qt::Window) {
+ QGuiApplicationPrivate *app_priv = QGuiApplicationPrivate::instance();
+ QString &firstWindowTitle = app_priv->firstWindowTitle;
+ if (!firstWindowTitle.isEmpty()) {
+ q->setTitle(firstWindowTitle);
+ firstWindowTitle = QString();
+ }
+ if (!app_priv->forcedWindowIcon.isNull())
+ q->setIcon(app_priv->forcedWindowIcon);
+
+ // Handling of the -qwindowgeometry, -geometry command line arguments
+ static bool geometryApplied = false;
+ if (!geometryApplied) {
+ geometryApplied = true;
+ QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(q);
+ }
}
- } else {
- visibility = QWindow::Hidden;
+
+ QShowEvent showEvent;
+ QGuiApplication::sendEvent(q, &showEvent);
}
+ if (q->isModal()) {
+ if (visible)
+ QGuiApplicationPrivate::showModalWindow(q);
+ else
+ QGuiApplicationPrivate::hideModalWindow(q);
+ } else if (visible && QGuiApplication::modalWindow()) {
+ QGuiApplicationPrivate::updateBlockedStatus(q);
+ }
+
+#ifndef QT_NO_CURSOR
+ if (visible && (hasCursor || QGuiApplication::overrideCursor()))
+ applyCursor();
+#endif
+
+ if (platformWindow)
+ platformWindow->setVisible(visible);
+
+ if (!visible) {
+ QHideEvent hideEvent;
+ QGuiApplication::sendEvent(q, &hideEvent);
+ }
+}
+
+void QWindowPrivate::updateVisibility()
+{
+ Q_Q(QWindow);
+
+ QWindow::Visibility old = visibility;
+
+ if (!visible)
+ visibility = QWindow::Hidden;
+ else if (windowState & Qt::WindowMinimized)
+ visibility = QWindow::Minimized;
+ else if (windowState & Qt::WindowFullScreen)
+ visibility = QWindow::FullScreen;
+ else if (windowState & Qt::WindowMaximized)
+ visibility = QWindow::Maximized;
+ else
+ visibility = QWindow::Windowed;
+
if (visibility != old)
emit q->visibilityChanged(visibility);
}
@@ -443,6 +511,8 @@ void QWindowPrivate::create(bool recursive, WId nativeHandle)
return;
}
+ platformWindow->initialize();
+
QObjectList childObjects = q->children();
for (int i = 0; i < childObjects.size(); i ++) {
QObject *object = childObjects.at(i);
@@ -525,73 +595,7 @@ void QWindow::setVisible(bool visible)
{
Q_D(QWindow);
- if (d->visible != visible) {
- d->visible = visible;
- emit visibleChanged(visible);
- d->updateVisibility();
- } else if (d->platformWindow) {
- // Visibility hasn't changed, and the platform window is in sync
- return;
- }
-
- if (!d->platformWindow) {
- // If we have a parent window, but the parent hasn't been created yet, we
- // can defer creation until the parent is created or we're re-parented.
- if (parent() && !parent()->handle())
- return;
-
- // We only need to create the window if it's being shown
- if (visible)
- create();
- }
-
- if (visible) {
- // remove posted quit events when showing a new window
- QCoreApplication::removePostedEvents(qApp, QEvent::Quit);
-
- if (type() == Qt::Window) {
- QGuiApplicationPrivate *app_priv = QGuiApplicationPrivate::instance();
- QString &firstWindowTitle = app_priv->firstWindowTitle;
- if (!firstWindowTitle.isEmpty()) {
- setTitle(firstWindowTitle);
- firstWindowTitle = QString();
- }
- if (!app_priv->forcedWindowIcon.isNull())
- setIcon(app_priv->forcedWindowIcon);
-
- // Handling of the -qwindowgeometry, -geometry command line arguments
- static bool geometryApplied = false;
- if (!geometryApplied) {
- geometryApplied = true;
- QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(this);
- }
- }
-
- QShowEvent showEvent;
- QGuiApplication::sendEvent(this, &showEvent);
- }
-
- if (isModal()) {
- if (visible)
- QGuiApplicationPrivate::showModalWindow(this);
- else
- QGuiApplicationPrivate::hideModalWindow(this);
- } else if (visible && QGuiApplication::modalWindow()) {
- QGuiApplicationPrivate::updateBlockedStatus(this);
- }
-
-#ifndef QT_NO_CURSOR
- if (visible && (d->hasCursor || QGuiApplication::overrideCursor()))
- d->applyCursor();
-#endif
-
- if (d->platformWindow)
- d->platformWindow->setVisible(visible);
-
- if (!visible) {
- QHideEvent hideEvent;
- QGuiApplication::sendEvent(this, &hideEvent);
- }
+ d->setVisible(visible);
}
bool QWindow::isVisible() const
@@ -1062,15 +1066,12 @@ qreal QWindow::opacity() const
The window manager may or may not choose to display any areas of the window
not included in the mask, thus it is the application's responsibility to
clear to transparent the areas that are not part of the mask.
-
- Setting the mask before the window has been created has no effect.
*/
void QWindow::setMask(const QRegion &region)
{
Q_D(QWindow);
- if (!d->platformWindow)
- return;
- d->platformWindow->setMask(QHighDpi::toNativeLocalRegion(region, this));
+ if (d->platformWindow)
+ d->platformWindow->setMask(QHighDpi::toNativeLocalRegion(region, this));
d->mask = region;
}
@@ -1217,6 +1218,17 @@ qreal QWindow::devicePixelRatio() const
return d->platformWindow->devicePixelRatio() * QHighDpiScaling::factor(this);
}
+Qt::WindowState QWindowPrivate::effectiveState(Qt::WindowStates state)
+{
+ if (state & Qt::WindowMinimized)
+ return Qt::WindowMinimized;
+ else if (state & Qt::WindowFullScreen)
+ return Qt::WindowFullScreen;
+ else if (state & Qt::WindowMaximized)
+ return Qt::WindowMaximized;
+ return Qt::WindowNoState;
+}
+
/*!
\brief set the screen-occupation state of the window
@@ -1225,31 +1237,69 @@ qreal QWindow::devicePixelRatio() const
The enum value Qt::WindowActive is not an accepted parameter.
- \sa showNormal(), showFullScreen(), showMinimized(), showMaximized()
+ \sa showNormal(), showFullScreen(), showMinimized(), showMaximized(), setWindowStates()
*/
void QWindow::setWindowState(Qt::WindowState state)
{
- if (state == Qt::WindowActive) {
- qWarning("QWindow::setWindowState does not accept Qt::WindowActive");
- return;
- }
+ setWindowStates(state);
+}
+
+/*!
+ \brief set the screen-occupation state of the window
+ \since 5.10
+
+ The window \a state represents whether the window appears in the
+ windowing system as maximized, minimized and/or fullscreen.
+
+ The window can be in a combination of several states. For example, if
+ the window is both minimized and maximized, the window will appear
+ minimized, but clicking on the task bar entry will restore it to the
+ maximized state.
+
+ The enum value Qt::WindowActive should not be set.
+ \sa showNormal(), showFullScreen(), showMinimized(), showMaximized()
+ */
+void QWindow::setWindowStates(Qt::WindowStates state)
+{
Q_D(QWindow);
+ if (state & Qt::WindowActive) {
+ qWarning("QWindow::setWindowStates does not accept Qt::WindowActive");
+ state &= ~Qt::WindowActive;
+ }
+
if (d->platformWindow)
d->platformWindow->setWindowState(state);
d->windowState = state;
- emit windowStateChanged(d->windowState);
+ emit windowStateChanged(QWindowPrivate::effectiveState(d->windowState));
d->updateVisibility();
}
/*!
\brief the screen-occupation state of the window
- \sa setWindowState()
+ \sa setWindowState(), windowStates()
*/
Qt::WindowState QWindow::windowState() const
{
Q_D(const QWindow);
+ return QWindowPrivate::effectiveState(d->windowState);
+}
+
+/*!
+ \brief the screen-occupation state of the window
+ \since 5.10
+
+ The window can be in a combination of several states. For example, if
+ the window is both minimized and maximized, the window will appear
+ minimized, but clicking on the task bar entry will restore it to
+ the maximized state.
+
+ \sa setWindowStates()
+*/
+Qt::WindowStates QWindow::windowStates() const
+{
+ Q_D(const QWindow);
return d->windowState;
}
@@ -1257,7 +1307,7 @@ Qt::WindowState QWindow::windowState() const
\fn QWindow::windowStateChanged(Qt::WindowState windowState)
This signal is emitted when the \a windowState changes, either
- by being set explicitly with setWindowState(), or automatically when
+ by being set explicitly with setWindowStates(), or automatically when
the user clicks one of the titlebar buttons or by other means.
*/
@@ -2003,42 +2053,42 @@ void QWindow::hide()
/*!
Shows the window as minimized.
- Equivalent to calling setWindowState(Qt::WindowMinimized) and then
+ Equivalent to calling setWindowStates(Qt::WindowMinimized) and then
setVisible(true).
- \sa setWindowState(), setVisible()
+ \sa setWindowStates(), setVisible()
*/
void QWindow::showMinimized()
{
- setWindowState(Qt::WindowMinimized);
+ setWindowStates(Qt::WindowMinimized);
setVisible(true);
}
/*!
Shows the window as maximized.
- Equivalent to calling setWindowState(Qt::WindowMaximized) and then
+ Equivalent to calling setWindowStates(Qt::WindowMaximized) and then
setVisible(true).
- \sa setWindowState(), setVisible()
+ \sa setWindowStates(), setVisible()
*/
void QWindow::showMaximized()
{
- setWindowState(Qt::WindowMaximized);
+ setWindowStates(Qt::WindowMaximized);
setVisible(true);
}
/*!
Shows the window as fullscreen.
- Equivalent to calling setWindowState(Qt::WindowFullScreen) and then
+ Equivalent to calling setWindowStates(Qt::WindowFullScreen) and then
setVisible(true).
- \sa setWindowState(), setVisible()
+ \sa setWindowStates(), setVisible()
*/
void QWindow::showFullScreen()
{
- setWindowState(Qt::WindowFullScreen);
+ setWindowStates(Qt::WindowFullScreen);
setVisible(true);
#if !defined Q_OS_QNX // On QNX this window will be activated anyway from libscreen
// activating it here before libscreen activates it causes problems
@@ -2049,14 +2099,14 @@ void QWindow::showFullScreen()
/*!
Shows the window as normal, i.e. neither maximized, minimized, nor fullscreen.
- Equivalent to calling setWindowState(Qt::WindowNoState) and then
+ Equivalent to calling setWindowStates(Qt::WindowNoState) and then
setVisible(true).
- \sa setWindowState(), setVisible()
+ \sa setWindowStates(), setVisible()
*/
void QWindow::showNormal()
{
- setWindowState(Qt::WindowNoState);
+ setWindowStates(Qt::WindowNoState);
setVisible(true);
}
@@ -2252,7 +2302,7 @@ bool QWindow::event(QEvent *ev)
case QEvent::WindowStateChange: {
Q_D(QWindow);
- emit windowStateChanged(d->windowState);
+ emit windowStateChanged(QWindowPrivate::effectiveState(d->windowState));
d->updateVisibility();
break;
}
@@ -2768,6 +2818,30 @@ QDebug operator<<(QDebug debug, const QWindow *window)
}
#endif // !QT_NO_DEBUG_STREAM
+#if QT_CONFIG(vulkan)
+
+/*!
+ Associates this window with the specified Vulkan \a instance.
+
+ \a instance must stay valid as long as this QWindow instance exists.
+ */
+void QWindow::setVulkanInstance(QVulkanInstance *instance)
+{
+ Q_D(QWindow);
+ d->vulkanInstance = instance;
+}
+
+/*!
+ \return the associrated Vulkan instance or \c null if there is none.
+ */
+QVulkanInstance *QWindow::vulkanInstance() const
+{
+ Q_D(const QWindow);
+ return d->vulkanInstance;
+}
+
+#endif // QT_CONFIG(vulkan)
+
QT_END_NAMESPACE
#include "moc_qwindow.cpp"
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index db8e828e70..4a874caacb 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -88,6 +88,9 @@ class QWindowContainer;
#ifndef QT_NO_DEBUG_STREAM
class QDebug;
#endif
+#if QT_CONFIG(vulkan)
+class QVulkanInstance;
+#endif
class Q_GUI_EXPORT QWindow : public QObject, public QSurface
{
@@ -189,7 +192,9 @@ public:
qreal devicePixelRatio() const;
Qt::WindowState windowState() const;
+ Qt::WindowStates windowStates() const;
void setWindowState(Qt::WindowState state);
+ void setWindowStates(Qt::WindowStates states);
void setTransientParent(QWindow *parent);
QWindow *transientParent() const;
@@ -267,6 +272,11 @@ public:
static QWindow *fromWinId(WId id);
+#if QT_CONFIG(vulkan)
+ void setVulkanInstance(QVulkanInstance *instance);
+ QVulkanInstance *vulkanInstance() const;
+#endif
+
public Q_SLOTS:
Q_REVISION(1) void requestActivate();
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index dd282a671d..9b8e2c47e4 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -105,6 +105,9 @@ public:
, hasCursor(false)
#endif
, compositing(false)
+#if QT_CONFIG(vulkan)
+ , vulkanInstance(nullptr)
+#endif
{
isWindow = true;
}
@@ -129,6 +132,7 @@ public:
virtual QWindow *eventReceiver() { Q_Q(QWindow); return q; }
+ virtual void setVisible(bool visible);
void updateVisibility();
void _q_clearAlert();
@@ -151,6 +155,8 @@ public:
static QWindowPrivate *get(QWindow *window) { return window->d_func(); }
+ static Qt::WindowState effectiveState(Qt::WindowStates);
+
QWindow::SurfaceType surfaceType;
Qt::WindowFlags windowFlags;
QWindow *parentWindow;
@@ -163,7 +169,7 @@ public:
QString windowFilePath;
QIcon windowIcon;
QRect geometry;
- Qt::WindowState windowState;
+ Qt::WindowStates windowState;
QWindow::Visibility visibility;
bool resizeEventPending;
bool receivedExpose;
@@ -194,6 +200,10 @@ public:
bool compositing;
QElapsedTimer lastComposeTime;
+
+#if QT_CONFIG(vulkan)
+ QVulkanInstance *vulkanInstance;
+#endif
};
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 34519cd91b..85b2aae7dd 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -66,7 +66,7 @@ extern QPointer<QWindow> qt_last_mouse_receiver;
// ------------------- QWindowSystemInterfacePrivate -------------------
-/*!
+/*
Handles a window system event asynchronously by posting the event to Qt Gui.
This function posts the event on the window system event queue and wakes the
@@ -82,7 +82,7 @@ bool QWindowSystemInterfacePrivate::handleWindowSystemEvent<QWindowSystemInterfa
return true;
}
-/*!
+/*
Handles a window system event synchronously.
Qt Gui will process the event immediately. The return value indicates if Qt
@@ -112,7 +112,7 @@ bool QWindowSystemInterfacePrivate::handleWindowSystemEvent<QWindowSystemInterfa
return accepted;
}
-/*!
+/*
Handles a window system event.
By default this function posts the event on the window system event queue and
@@ -247,14 +247,14 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleWindowActivated, QWindow *window, Qt::Fo
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
-QT_DEFINE_QPA_EVENT_HANDLER(void, handleWindowStateChanged, QWindow *window, Qt::WindowState newState, int oldState)
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleWindowStateChanged, QWindow *window, Qt::WindowStates newState, int oldState)
{
Q_ASSERT(window);
if (oldState < Qt::WindowNoState)
oldState = window->windowState();
QWindowSystemInterfacePrivate::WindowStateChangedEvent *e =
- new QWindowSystemInterfacePrivate::WindowStateChangedEvent(window, newState, Qt::WindowState(oldState));
+ new QWindowSystemInterfacePrivate::WindowStateChangedEvent(window, newState, Qt::WindowStates(oldState));
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
@@ -273,12 +273,25 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-/*!
- If \a oldRect is null, Qt will use the previously reported geometry instead.
- */
-QT_DEFINE_QPA_EVENT_HANDLER(void, handleGeometryChange, QWindow *window, const QRect &newRect, const QRect &oldRect)
+QWindowSystemInterfacePrivate::GeometryChangeEvent::GeometryChangeEvent(QWindow *window, const QRect &newGeometry)
+ : WindowSystemEvent(GeometryChange)
+ , window(window)
+ , requestedGeometry(window->handle() ? window->handle()->QPlatformWindow::geometry() : QRect())
+ , newGeometry(newGeometry)
{
- QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(window, QHighDpi::fromNativePixels(newRect, window), QHighDpi::fromNativePixels(oldRect, window));
+}
+
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleGeometryChange, QWindow *window, const QRect &newRect)
+{
+ Q_ASSERT(window);
+ QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(window, QHighDpi::fromNativePixels(newRect, window));
+ if (window->handle()) {
+ // Persist the new geometry so that QWindow::geometry() can be queried in the resize event
+ window->handle()->QPlatformWindow::setGeometry(newRect);
+ // FIXME: This does not work during platform window creation, where the QWindow does not
+ // have its handle set up yet. Platforms that deliver events during window creation need
+ // to handle the persistence manually, e.g. by overriding geometry().
+ }
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
@@ -290,6 +303,23 @@ QWindowSystemInterfacePrivate::ExposeEvent::ExposeEvent(QWindow *window, const Q
{
}
+/*! \internal
+ Handles an expose event.
+
+ The platform plugin sends expose events when an area of the window
+ is invalidated or window exposure changes. \a region is in window
+ local coordinates. An empty region indicates that the window is
+ obscured, but note that the exposed property of the QWindow will be set
+ based on what QPlatformWindow::isExposed() returns at the time of this call,
+ not based on what the region is. // FIXME: this should probably be fixed.
+
+ The platform plugin may omit sending expose events (or send obscure
+ events) for windows that are on screen but where the client area is
+ completely covered by other windows or otherwise not visible. Expose
+ event consumers can then use this to disable updates for such windows.
+ This is required behavior on platforms where OpenGL swapbuffers stops
+ blocking for obscured windows (like macOS).
+*/
QT_DEFINE_QPA_EVENT_HANDLER(void, handleExposeEvent, QWindow *window, const QRegion &region)
{
QWindowSystemInterfacePrivate::ExposeEvent *e =
@@ -445,9 +475,13 @@ QWindowSystemInterfacePrivate::WheelEvent::WheelEvent(QWindow *window, ulong tim
{
}
+#if QT_DEPRECATED_SINCE(5, 10)
void QWindowSystemInterface::handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods) {
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
handleWheelEvent(window, time, local, global, d, o, mods);
+QT_WARNING_POP
}
void QWindowSystemInterface::handleWheelEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods)
@@ -455,6 +489,7 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *window, ulong timestamp,
QPoint point = (o == Qt::Vertical) ? QPoint(0, d) : QPoint(d, 0);
handleWheelEvent(window, timestamp, local, global, QPoint(), point, mods);
}
+#endif // QT_DEPRECATED_SINCE(5, 10)
void QWindowSystemInterface::handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, Qt::ScrollPhase phase, Qt::MouseEventSource source)
{
@@ -768,6 +803,7 @@ void QWindowSystemInterface::handleTabletEvent(QWindow *window, const QPointF &l
xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
}
+#if QT_DEPRECATED_SINCE(5, 10)
void QWindowSystemInterface::handleTabletEvent(QWindow *window, ulong timestamp, bool down, const QPointF &local, const QPointF &global,
int device, int pointerType, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
@@ -785,6 +821,7 @@ void QWindowSystemInterface::handleTabletEvent(QWindow *window, bool down, const
handleTabletEvent(window, local, global, device, pointerType, (down ? Qt::LeftButton : Qt::NoButton), pressure,
xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
}
+#endif // QT_DEPRECATED_SINCE(5, 10)
void QWindowSystemInterface::handleTabletEnterProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid)
{
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index e582787dd9..7ea7b072f0 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -121,9 +121,10 @@ public:
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized,
bool inverted = false);
- // Wheel event compatibility functions. Will be removed: do not use.
- static void handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
- static void handleWheelEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED static void handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
+ QT_DEPRECATED static void handleWheelEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
+#endif
struct TouchPoint {
TouchPoint() : id(0), uniqueId(-1), pressure(0), rotation(0), state(Qt::TouchPointStationary) { }
@@ -159,7 +160,7 @@ public:
// rect is relative to parent
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
- static void handleGeometryChange(QWindow *window, const QRect &newRect, const QRect &oldRect = QRect());
+ static void handleGeometryChange(QWindow *window, const QRect &newRect);
// region is in local coordinates, do not confuse with geometry which is parent-relative
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
@@ -176,7 +177,7 @@ public:
static void handleWindowActivated(QWindow *window, Qt::FocusReason r = Qt::OtherFocusReason);
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
- static void handleWindowStateChanged(QWindow *window, Qt::WindowState newState, int oldState = -1);
+ static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState = -1);
static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen);
static void handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate = false);
@@ -208,14 +209,16 @@ public:
int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Qt::KeyboardModifiers modifiers = Qt::NoModifier);
- static void handleTabletEvent(QWindow *window, ulong timestamp, bool down, const QPointF &local, const QPointF &global,
- int device, int pointerType, qreal pressure, int xTilt, int yTilt,
- qreal tangentialPressure, qreal rotation, int z, qint64 uid,
- Qt::KeyboardModifiers modifiers = Qt::NoModifier); // ### remove in Qt 6
- static void handleTabletEvent(QWindow *window, bool down, const QPointF &local, const QPointF &global,
- int device, int pointerType, qreal pressure, int xTilt, int yTilt,
- qreal tangentialPressure, qreal rotation, int z, qint64 uid,
- Qt::KeyboardModifiers modifiers = Qt::NoModifier); // ### remove in Qt 6
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED static void handleTabletEvent(QWindow *window, ulong timestamp, bool down, const QPointF &local, const QPointF &global,
+ int device, int pointerType, qreal pressure, int xTilt, int yTilt,
+ qreal tangentialPressure, qreal rotation, int z, qint64 uid,
+ Qt::KeyboardModifiers modifiers = Qt::NoModifier);
+ QT_DEPRECATED static void handleTabletEvent(QWindow *window, bool down, const QPointF &local, const QPointF &global,
+ int device, int pointerType, qreal pressure, int xTilt, int yTilt,
+ qreal tangentialPressure, qreal rotation, int z, qint64 uid,
+ Qt::KeyboardModifiers modifiers = Qt::NoModifier);
+#endif
static void handleTabletEnterProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid);
static void handleTabletEnterProximityEvent(int device, int pointerType, qint64 uid);
static void handleTabletLeaveProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid);
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index 0f350fb2d2..ef993501f8 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -131,12 +131,10 @@ public:
class GeometryChangeEvent : public WindowSystemEvent {
public:
- GeometryChangeEvent(QWindow *window, const QRect &newGeometry, const QRect &oldGeometry)
- : WindowSystemEvent(GeometryChange), window(window), newGeometry(newGeometry), oldGeometry(oldGeometry)
- { }
+ GeometryChangeEvent(QWindow *window, const QRect &newGeometry);
QPointer<QWindow> window;
+ QRect requestedGeometry;
QRect newGeometry;
- QRect oldGeometry;
};
class EnterEvent : public WindowSystemEvent {
@@ -168,13 +166,13 @@ public:
class WindowStateChangedEvent : public WindowSystemEvent {
public:
- WindowStateChangedEvent(QWindow *_window, Qt::WindowState _newState, Qt::WindowState _oldState)
+ WindowStateChangedEvent(QWindow *_window, Qt::WindowStates _newState, Qt::WindowStates _oldState)
: WindowSystemEvent(WindowStateChanged), window(_window), newState(_newState), oldState(_oldState)
{ }
QPointer<QWindow> window;
- Qt::WindowState newState;
- Qt::WindowState oldState;
+ Qt::WindowStates newState;
+ Qt::WindowStates oldState;
};
class WindowScreenChangedEvent : public WindowSystemEvent {
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index 6b18e1ab03..d016f07522 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -1128,7 +1128,7 @@ void QMatrix4x4::rotate(float angle, float x, float y, float z)
s = 0.0f;
c = -1.0f;
} else {
- float a = angle * M_PI / 180.0f;
+ float a = qDegreesToRadians(angle);
c = std::cos(a);
s = std::sin(a);
}
@@ -1237,7 +1237,7 @@ void QMatrix4x4::projectedRotate(float angle, float x, float y, float z)
s = 0.0f;
c = -1.0f;
} else {
- float a = angle * M_PI / 180.0f;
+ float a = qDegreesToRadians(angle);
c = std::cos(a);
s = std::sin(a);
}
@@ -1496,7 +1496,7 @@ void QMatrix4x4::perspective(float verticalAngle, float aspectRatio, float nearP
// Construct the projection.
QMatrix4x4 m(1);
- float radians = (verticalAngle / 2.0f) * M_PI / 180.0f;
+ float radians = qDegreesToRadians(verticalAngle / 2.0f);
float sine = std::sin(radians);
if (sine == 0.0f)
return;
diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp
index e3262c8830..fe1b0425a8 100644
--- a/src/gui/math3d/qquaternion.cpp
+++ b/src/gui/math3d/qquaternion.cpp
@@ -408,7 +408,7 @@ QQuaternion QQuaternion::fromAxisAndAngle(const QVector3D& axis, float angle)
// http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q56
// We normalize the result just in case the values are close
// to zero, as suggested in the above FAQ.
- float a = (angle / 2.0f) * M_PI / 180.0f;
+ float a = qDegreesToRadians(angle / 2.0f);
float s = std::sin(a);
float c = std::cos(a);
QVector3D ax = axis.normalized();
@@ -467,7 +467,7 @@ QQuaternion QQuaternion::fromAxisAndAngle
y /= length;
z /= length;
}
- float a = (angle / 2.0f) * M_PI / 180.0f;
+ float a = qDegreesToRadians(angle / 2.0f);
float s = std::sin(a);
float c = std::cos(a);
return QQuaternion(c, x * s, y * s, z * s).normalized();
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index b5df68a3aa..f6c350ba0b 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -101,7 +101,9 @@ typedef void* GLeglImageOES;
# define QGL_TEMP_GLEXT_PROTO
# endif
-# if defined(QT_OPENGL_ES_3_1)
+# if defined(QT_OPENGL_ES_3_2)
+# include <GLES3/gl32.h>
+# elif defined(QT_OPENGL_ES_3_1)
# include <GLES3/gl31.h>
# elif defined(QT_OPENGL_ES_3)
# include <GLES3/gl3.h>
diff --git a/src/gui/opengl/qopenglextrafunctions.h b/src/gui/opengl/qopenglextrafunctions.h
index 1b36068588..81716fb8d3 100644
--- a/src/gui/opengl/qopenglextrafunctions.h
+++ b/src/gui/opengl/qopenglextrafunctions.h
@@ -52,6 +52,11 @@
#undef MemoryBarrier
#endif
+// GLES build without having included gl32.h -> GLDEBUGPROC is still need for the protos, define it here
+#if defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_3_2)
+typedef void (QOPENGLF_APIENTRYP *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+#endif
+
QT_BEGIN_NAMESPACE
class QOpenGLExtraFunctionsPrivate;
@@ -230,6 +235,50 @@ class QOpenGLExtraFunctionsPrivate;
#undef glVertexAttribBinding
#undef glVertexBindingDivisor
+#undef glBlendBarrier
+#undef glCopyImageSubData
+#undef glDebugMessageControl
+#undef glDebugMessageInsert
+#undef glDebugMessageCallback
+#undef glGetDebugMessageLog
+#undef glPushDebugGroup
+#undef glPopDebugGroup
+#undef glObjectLabel
+#undef glGetObjectLabel
+#undef glGetObjectPtrLabel
+#undef glGetPointerv
+#undef glEnablei
+#undef glDisablei
+#undef glBlendEquationi
+#undef glBlendEquationSeparatei
+#undef glBlendFunci
+#undef glBlendFuncSeparatei
+#undef glColorMaski
+#undef glIsEnabledi
+#undef glDrawElementsBaseVertex
+#undef glDrawRangeElementsBaseVertex
+#undef glDrawElementsInstancedBaseVertex
+#undef glFrameBufferTexture
+#undef glPrimitiveBoundingBox
+#undef glGetGraphicsResetStatus
+#undef glReadnPixels
+#undef glGetnUniformfv
+#undef glGetnUniformiv
+#undef glGetnUniformuiv
+#undef glMinSampleShading
+#undef glPatchParameteri
+#undef glTexParameterIiv
+#undef glTexParameterIuiv
+#undef glGetTexParameterIiv
+#undef glGetTexParameterIuiv
+#undef glSamplerParameterIiv
+#undef glSamplerParameterIuiv
+#undef glGetSamplerParameterIiv
+#undef glGetSamplerParameterIuiv
+#undef glTexBuffer
+#undef glTexBufferRange
+#undef glTexStorage3DMultisample
+
class Q_GUI_EXPORT QOpenGLExtraFunctions : public QOpenGLFunctions
{
Q_DECLARE_PRIVATE(QOpenGLExtraFunctions)
@@ -415,6 +464,52 @@ public:
void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
+ // GLES 3.2
+ void glBlendBarrier(void);
+ void glCopyImageSubData(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);
+ void glDebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+ void glDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+ void glDebugMessageCallback(GLDEBUGPROC callback, const void *userParam);
+ GLuint glGetDebugMessageLog(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+ void glPushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar *message);
+ void glPopDebugGroup(void);
+ void glObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+ void glGetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+ void glObjectPtrLabel(const void *ptr, GLsizei length, const GLchar *label);
+ void glGetObjectPtrLabel(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+ void glGetPointerv(GLenum pname, void **params);
+ void glEnablei(GLenum target, GLuint index);
+ void glDisablei(GLenum target, GLuint index);
+ void glBlendEquationi(GLuint buf, GLenum mode);
+ void glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+ void glBlendFunci(GLuint buf, GLenum src, GLenum dst);
+ void glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+ void glColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+ GLboolean glIsEnabledi(GLenum target, GLuint index);
+ void glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+ void glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+ void glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+ void glFramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level);
+ void glPrimitiveBoundingBox(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+ GLenum glGetGraphicsResetStatus(void);
+ void glReadnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+ void glGetnUniformfv(GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+ void glGetnUniformiv(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+ void glGetnUniformuiv(GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+ void glMinSampleShading(GLfloat value);
+ void glPatchParameteri(GLenum pname, GLint value);
+ void glTexParameterIiv(GLenum target, GLenum pname, const GLint *params);
+ void glTexParameterIuiv(GLenum target, GLenum pname, const GLuint *params);
+ void glGetTexParameterIiv(GLenum target, GLenum pname, GLint *params);
+ void glGetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params);
+ void glSamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *param);
+ void glSamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *param);
+ void glGetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params);
+ void glGetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params);
+ void glTexBuffer(GLenum target, GLenum internalformat, GLuint buffer);
+ void glTexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+ void glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+
private:
static bool isInitialized(const QOpenGLExtraFunctionsPrivate *d) { return d != Q_NULLPTR; }
};
@@ -615,6 +710,50 @@ public:
F(void, VertexAttribIFormat, (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)) \
F(void, VertexAttribBinding, (GLuint attribindex, GLuint bindingindex)) \
F(void, VertexBindingDivisor, (GLuint bindingindex, GLuint divisor)) \
+ F(void, BlendBarrier, (void)) \
+ F(void, BlendEquationSeparatei, (GLuint buf, GLenum modeRGB, GLenum modeAlpha)) \
+ F(void, BlendEquationi, (GLuint buf, GLenum mode)) \
+ F(void, BlendFuncSeparatei, (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)) \
+ F(void, BlendFunci, (GLuint buf, GLenum src, GLenum dst)) \
+ F(void, ColorMaski, (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)) \
+ F(void, CopyImageSubData, (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)) \
+ F(void, DebugMessageCallback, (GLDEBUGPROC callback, const void * userParam)) \
+ F(void, DebugMessageControl, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled)) \
+ F(void, DebugMessageInsert, (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf)) \
+ F(void, Disablei, (GLenum target, GLuint index)) \
+ F(void, DrawElementsBaseVertex, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex)) \
+ F(void, DrawElementsInstancedBaseVertex, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex)) \
+ F(void, DrawRangeElementsBaseVertex, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex)) \
+ F(void, Enablei, (GLenum target, GLuint index)) \
+ F(void, FramebufferTexture, (GLenum target, GLenum attachment, GLuint texture, GLint level)) \
+ F(GLuint, GetDebugMessageLog, (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog)) \
+ F(GLenum, GetGraphicsResetStatus, (void)) \
+ F(void, GetObjectLabel, (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label)) \
+ F(void, GetObjectPtrLabel, (const void * ptr, GLsizei bufSize, GLsizei* length, GLchar* label)) \
+ F(void, GetPointerv, (GLenum pname, void ** params)) \
+ F(void, GetSamplerParameterIiv, (GLuint sampler, GLenum pname, GLint* params)) \
+ F(void, GetSamplerParameterIuiv, (GLuint sampler, GLenum pname, GLuint* params)) \
+ F(void, GetTexParameterIiv, (GLenum target, GLenum pname, GLint* params)) \
+ F(void, GetTexParameterIuiv, (GLenum target, GLenum pname, GLuint* params)) \
+ F(void, GetnUniformfv, (GLuint program, GLint location, GLsizei bufSize, GLfloat* params)) \
+ F(void, GetnUniformiv, (GLuint program, GLint location, GLsizei bufSize, GLint* params)) \
+ F(void, GetnUniformuiv, (GLuint program, GLint location, GLsizei bufSize, GLuint* params)) \
+ F(GLboolean, IsEnabledi, (GLenum target, GLuint index)) \
+ F(void, MinSampleShading, (GLfloat value)) \
+ F(void, ObjectLabel, (GLenum identifier, GLuint name, GLsizei length, const GLchar * label)) \
+ F(void, ObjectPtrLabel, (const void * ptr, GLsizei length, const GLchar * label)) \
+ F(void, PatchParameteri, (GLenum pname, GLint value)) \
+ F(void, PopDebugGroup, (void)) \
+ F(void, PrimitiveBoundingBox, (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)) \
+ F(void, PushDebugGroup, (GLenum source, GLuint id, GLsizei length, const GLchar * message)) \
+ F(void, ReadnPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data)) \
+ F(void, SamplerParameterIiv, (GLuint sampler, GLenum pname, const GLint * param)) \
+ F(void, SamplerParameterIuiv, (GLuint sampler, GLenum pname, const GLuint * param)) \
+ F(void, TexBuffer, (GLenum target, GLenum internalformat, GLuint buffer)) \
+ F(void, TexBufferRange, (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)) \
+ F(void, TexParameterIiv, (GLenum target, GLenum pname, const GLint * params)) \
+ F(void, TexParameterIuiv, (GLenum target, GLenum pname, const GLuint * params)) \
+ F(void, TexStorage3DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)) \
QT_OPENGL_DECLARE(QT_OPENGL_EXTRA_FUNCTIONS)
};
@@ -2013,6 +2152,363 @@ inline void QOpenGLExtraFunctions::glVertexBindingDivisor(GLuint bindingindex, G
Q_OPENGL_FUNCTIONS_DEBUG
}
+// GLES 3.2
+
+inline void QOpenGLExtraFunctions::glBlendBarrier()
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.BlendBarrier();
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.BlendEquationSeparatei(buf, modeRGB, modeAlpha);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBlendEquationi(GLuint buf, GLenum mode)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.BlendEquationi(buf, mode);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.BlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBlendFunci(GLuint buf, GLenum src, GLenum dst)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.BlendFunci(buf, src, dst);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.ColorMaski(index, r, g, b, a);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glCopyImageSubData(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)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.CopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDebugMessageCallback(GLDEBUGPROC callback, const void * userParam)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.DebugMessageCallback(callback, userParam);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.DebugMessageControl(source, type, severity, count, ids, enabled);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.DebugMessageInsert(source, type, id, severity, length, buf);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDisablei(GLenum target, GLuint index)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.Disablei(target, index);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.DrawElementsBaseVertex(mode, count, type, indices, basevertex);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.DrawElementsInstancedBaseVertex(mode, count, type, indices, instancecount, basevertex);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.DrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glEnablei(GLenum target, GLuint index)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.Enablei(target, index);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glFramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.FramebufferTexture(target, attachment, texture, level);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLuint QOpenGLExtraFunctions::glGetDebugMessageLog(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLuint result = d->f.GetDebugMessageLog(count, bufSize, sources, types, ids, severities, lengths, messageLog);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline GLenum QOpenGLExtraFunctions::glGetGraphicsResetStatus()
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLenum result = d->f.GetGraphicsResetStatus();
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glGetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetObjectLabel(identifier, name, bufSize, length, label);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetObjectPtrLabel(const void * ptr, GLsizei bufSize, GLsizei* length, GLchar* label)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetObjectPtrLabel(ptr, bufSize, length, label);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetPointerv(GLenum pname, void ** params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetPointerv(pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetSamplerParameterIiv(sampler, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetSamplerParameterIuiv(sampler, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetTexParameterIiv(GLenum target, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetTexParameterIiv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetTexParameterIuiv(GLenum target, GLenum pname, GLuint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetTexParameterIuiv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetnUniformfv(GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetnUniformfv(program, location, bufSize, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetnUniformiv(GLuint program, GLint location, GLsizei bufSize, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetnUniformiv(program, location, bufSize, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetnUniformuiv(GLuint program, GLint location, GLsizei bufSize, GLuint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.GetnUniformuiv(program, location, bufSize, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsEnabledi(GLenum target, GLuint index)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->f.IsEnabledi(target, index);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glMinSampleShading(GLfloat value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.MinSampleShading(value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar * label)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.ObjectLabel(identifier, name, length, label);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glObjectPtrLabel(const void * ptr, GLsizei length, const GLchar * label)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.ObjectPtrLabel(ptr, length, label);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glPatchParameteri(GLenum pname, GLint value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.PatchParameteri(pname, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glPopDebugGroup()
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.PopDebugGroup();
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glPrimitiveBoundingBox(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.PrimitiveBoundingBox(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glPushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar * message)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.PushDebugGroup(source, id, length, message);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glReadnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.ReadnPixels(x, y, width, height, format, type, bufSize, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSamplerParameterIiv(GLuint sampler, GLenum pname, const GLint * param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.SamplerParameterIiv(sampler, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint * param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.SamplerParameterIuiv(sampler, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexBuffer(GLenum target, GLenum internalformat, GLuint buffer)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.TexBuffer(target, internalformat, buffer);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.TexBufferRange(target, internalformat, buffer, offset, size);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexParameterIiv(GLenum target, GLenum pname, const GLint * params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.TexParameterIiv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexParameterIuiv(GLenum target, GLenum pname, const GLuint * params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.TexParameterIuiv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->f.TexStorage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
QT_END_NAMESPACE
#undef QT_OPENGL_DECLARE_FUNCTIONS
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index e724efab37..5e3537e47b 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -2213,17 +2213,17 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS)
/*!
\class QOpenGLExtraFunctions
- \brief The QOpenGLExtraFunctions class provides cross-platform access to the OpenGL ES 3.0 and 3.1 API.
+ \brief The QOpenGLExtraFunctions class provides cross-platform access to the OpenGL ES 3.0, 3.1 and 3.2 API.
\since 5.6
\ingroup painting-3D
\inmodule QtGui
- This subclass of QOpenGLFunctions includes the OpenGL ES 3.0 and 3.1
- functions. These will only work when an OpenGL ES 3.0 or 3.1 context, or an
+ This subclass of QOpenGLFunctions includes the OpenGL ES 3.0, 3.1 and 3.2
+ functions. These will only work when an OpenGL ES 3.x context, or an
OpenGL context of a version containing the functions in question either in
- core or as extension, is in use. This allows developing GLES 3.0 and 3.1
+ core or as extension, is in use. This allows developing GLES 3.x
applications in a cross-platform manner: development can happen on a desktop
- platform with OpenGL 3.x or 4.x, deploying to a real GLES 3.1 device later
+ platform with OpenGL 3.x or 4.x, deploying to a true GLES 3.x device later
on will require no or minimal changes to the application.
\note This class is different from the versioned OpenGL wrappers, for
@@ -4469,6 +4469,578 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS)
*/
/*!
+ \fn void QOpenGLExtraFunctions::glBlendBarrier(void)
+
+ Convenience function that calls glBlendBarrier().
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glBlendBarrier.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
+
+ Convenience function that calls glBlendEquationSeparatei(\a buf, \a modeRGB, \a modeAlpha).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glBlendEquationSeparatei.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBlendEquationi(GLuint buf, GLenum mode)
+
+ Convenience function that calls glBlendEquationi(\a buf, \a mode).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glBlendEquationi.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+
+ Convenience function that calls glBlendFuncSeparatei(\a buf, \a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glBlendFuncSeparatei.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBlendFunci(GLuint buf, GLenum src, GLenum dst)
+
+ Convenience function that calls glBlendFunci(\a buf, \a src, \a dst).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glBlendFunci.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glColorMaski(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+
+ Convenience function that calls glColorMaski(\a index, \a r, \a g, \a b, \a a).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glColorMaski.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glCopyImageSubData(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)
+
+ Convenience function that calls glCopyImageSubData(\a srcName, \a srcTarget, \a srcLevel, \a srcX, \a srcY, \a srcZ, \a dstName, \a dstTarget, \a dstLevel, \a dstX, \a dstY, \a dstZ, \a srcWidth, \a srcHeight, \a srcDepth).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glCopyImageSubData.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDebugMessageCallback(GLDEBUGPROC callback, const void * userParam)
+
+ Convenience function that calls glDebugMessageCallback(\a callback, \a userParam).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDebugMessageCallback.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled)
+
+ Convenience function that calls glDebugMessageControl(\a source, \a type, \a severity, \a count, \a ids, \a enabled).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDebugMessageControl.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf)
+
+ Convenience function that calls glDebugMessageInsert(\a source, \a type, \a id, \a severity, \a length, \a buf).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDebugMessageInsert.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDisablei(GLenum target, GLuint index)
+
+ Convenience function that calls glDisablei(\a target, \a index).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDisablei.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex)
+
+ Convenience function that calls glDrawElementsBaseVertex(\a mode, \a count, \a type, \a indices, \a basevertex).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDrawElementsBaseVertex.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex)
+
+ Convenience function that calls glDrawElementsInstancedBaseVertex(\a mode, \a count, \a type, \a indices, \a instancecount, \a basevertex).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDrawElementsInstancedBaseVertex.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex)
+
+ Convenience function that calls glDrawRangeElementsBaseVertex(\a mode, \a start, \a end, \a count, \a type, \a indices, \a basevertex).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glDrawRangeElementsBaseVertex.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glEnablei(GLenum target, GLuint index)
+
+ Convenience function that calls glEnablei(\a target, \a index).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glEnablei.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glFramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
+
+ Convenience function that calls glFramebufferTexture(\a target, \a attachment, \a texture, \a level).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glFramebufferTexture.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetDebugMessageLog(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog)
+
+ Convenience function that calls glGetDebugMessageLog(\a count, \a bufSize, \a sources, \a types, \a ids, \a severities, \a lengths, \a messageLog).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetDebugMessageLog.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetGraphicsResetStatus(void)
+
+ Convenience function that calls glGetGraphicsResetStatus().
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetGraphicsResetStatus.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label)
+
+ Convenience function that calls glGetObjectLabel(\a identifier, \a name, \a bufSize, \a length, \a label).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetObjectLabel.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetObjectPtrLabel(const void * ptr, GLsizei bufSize, GLsizei* length, GLchar* label)
+
+ Convenience function that calls glGetObjectPtrLabel(\a ptr, \a bufSize, \a length, \a label).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetObjectPtrLabel.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetPointerv(GLenum pname, void ** params)
+
+ Convenience function that calls glGetPointerv(\a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetPointerv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetSamplerParameterIiv(\a sampler, \a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetSamplerParameterIiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint* params)
+
+ Convenience function that calls glGetSamplerParameterIuiv(\a sampler, \a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetSamplerParameterIuiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetTexParameterIiv(GLenum target, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetTexParameterIiv(\a target, \a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetTexParameterIiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetTexParameterIuiv(GLenum target, GLenum pname, GLuint* params)
+
+ Convenience function that calls glGetTexParameterIuiv(\a target, \a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetTexParameterIuiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetnUniformfv(GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
+
+ Convenience function that calls glGetnUniformfv(\a program, \a location, \a bufSize, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetnUniformfv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetnUniformiv(GLuint program, GLint location, GLsizei bufSize, GLint* params)
+
+ Convenience function that calls glGetnUniformiv(\a program, \a location, \a bufSize, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetnUniformiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetnUniformuiv(GLuint program, GLint location, GLsizei bufSize, GLuint* params)
+
+ Convenience function that calls glGetnUniformuiv(\a program, \a location, \a bufSize, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glGetnUniformuiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glIsEnabledi(GLenum target, GLuint index)
+
+ Convenience function that calls glIsEnabledi(\a target, \a index).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glIsEnabledi.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glMinSampleShading(GLfloat value)
+
+ Convenience function that calls glMinSampleShading(\a value).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glMinSampleShading.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar * label)
+
+ Convenience function that calls glObjectLabel(\a identifier, \a name, \a length, \a label).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glObjectLabel.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glObjectPtrLabel(const void * ptr, GLsizei length, const GLchar * label)
+
+ Convenience function that calls glObjectPtrLabel(\a ptr, \a length, \a label).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glObjectPtrLabel.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glPatchParameteri(GLenum pname, GLint value)
+
+ Convenience function that calls glPatchParameteri(\a pname, \a value).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glPatchParameteri.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glPopDebugGroup(void)
+
+ Convenience function that calls glPopDebugGroup().
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glPopDebugGroup.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glPrimitiveBoundingBox(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
+
+ Convenience function that calls glPrimitiveBoundingBox(\a minX, \a minY, \a minZ, \a minW, \a maxX, \a maxY, \a maxZ, \a maxW).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glPrimitiveBoundingBox.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glPushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar * message)
+
+ Convenience function that calls glPushDebugGroup(\a source, \a id, \a length, \a message).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glPushDebugGroup.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glReadnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data)
+
+ Convenience function that calls glReadnPixels(\a x, \a y, \a width, \a height, \a format, \a type, \a bufSize, \a data).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glReadnPixels.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSamplerParameterIiv(GLuint sampler, GLenum pname, const GLint * param)
+
+ Convenience function that calls glSamplerParameterIiv(\a sampler, \a pname, \a param).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glSamplerParameterIiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint * param)
+
+ Convenience function that calls glSamplerParameterIuiv(\a sampler, \a pname, \a param).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glSamplerParameterIuiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexBuffer(GLenum target, GLenum internalformat, GLuint buffer)
+
+ Convenience function that calls glTexBuffer(\a target, \a internalformat, \a buffer).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glTexBuffer.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+
+ Convenience function that calls glTexBufferRange(\a target, \a internalformat, \a buffer, \a offset, \a size).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glTexBufferRange.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexParameterIiv(GLenum target, GLenum pname, const GLint * params)
+
+ Convenience function that calls glTexParameterIiv(\a target, \a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glTexParameterIiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexParameterIuiv(GLenum target, GLenum pname, const GLuint * params)
+
+ Convenience function that calls glTexParameterIuiv(\a target, \a pname, \a params).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glTexParameterIuiv.xml}{${NAME}()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
+
+ Convenience function that calls glTexStorage3DMultisample(\a target, \a samples, \a internalformat, \a width, \a height, \a depth, \a fixedsamplelocations).
+
+ This function is only available in OpenGL ES 3.x, or OpenGL 3.x or 4.x contexts. When running
+ with plain OpenGL, the function is only usable when the given profile and version contains the
+ function either in core or as an extension.
+
+ For more information, see the OpenGL ES 3.2 documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man32/glTexStorage3DMultisample.xml}{${NAME}()}.
+*/
+
+/*!
\fn bool QOpenGLExtraFunctions::isInitialized(const QOpenGLExtraFunctionsPrivate *d)
\internal
*/
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 766d4a327a..3563f1b5d3 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -43,6 +43,7 @@
#include "qopenglfunctions.h"
#include <QtGui/qcolor.h>
#include <QtGui/qopenglcontext.h>
+#include <QtCore/qdebug.h>
#include <private/qobject_p.h>
#include <private/qopenglcontext_p.h>
@@ -190,11 +191,20 @@ void QOpenGLTexturePrivate::destroy()
return;
}
QOpenGLContext *currentContext = QOpenGLContext::currentContext();
- if (!currentContext || !QOpenGLContext::areSharing(currentContext, context)) {
- qWarning("Texture is not valid in the current context.\n"
+ if (!currentContext) {
+ qWarning("QOpenGLTexturePrivate::destroy() called without a current context.\n"
"Texture has not been destroyed");
return;
}
+ if (!QOpenGLContext::areSharing(currentContext, context)) {
+
+ qWarning("QOpenGLTexturePrivate::destroy() called but texture context %p"
+ " is not shared with current context %p.\n"
+ "Texture has not been destroyed",
+ static_cast<const void *>(context),
+ static_cast<const void *>(currentContext));
+ return;
+ }
functions->glDeleteTextures(1, &textureId);
@@ -4661,4 +4671,40 @@ float QOpenGLTexture::levelofDetailBias() const
return d->levelOfDetailBias;
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QOpenGLTexture *t)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QOpenGLTexture(";
+ if (t) {
+ const QOpenGLTexturePrivate *d = t->d_ptr.data();
+ debug << d->target << ", bindingTarget=" << d->bindingTarget
+ << ", size=[" << d->dimensions[0]
+ << ", " << d->dimensions[1];
+ if (d->target == QOpenGLTexture::Target3D)
+ debug << ", " << d->dimensions[2];
+ debug << "], format=" << d->format << ", formatClass=" << d->formatClass;
+ if (t->isCreated())
+ debug << ", textureId=" << d->textureId;
+ if (t->isBound())
+ debug << ", [bound]";
+ if (t->isTextureView())
+ debug << ", [view]";
+ if (d->fixedSamplePositions)
+ debug << ", [fixedSamplePositions]";
+ debug << ", mipLevels=" << d->requestedMipLevels << ", layers=" << d->layers
+ << ", faces=" << d->faces << ", samples=" << d->samples
+ << ", depthStencilMode=" << d->depthStencilMode << ", comparisonFunction="
+ << d->comparisonFunction << ", comparisonMode=" << d->comparisonMode
+ << ", features=" << d->features << ", minificationFilter=" << d->minFilter
+ << ", magnificationFilter=" << d->magFilter << ", wrapMode=" << d->wrapModes[0];
+ } else {
+ debug << '0';
+ }
+ debug << ')';
+ return debug;
+}
+#endif // QT_NO_DEBUG_STREAM
+
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index 6e6f7ef1f2..12d9b91603 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -50,6 +50,7 @@
QT_BEGIN_NAMESPACE
+class QDebug;
class QOpenGLTexturePrivate;
class QOpenGLPixelTransferOptions;
@@ -613,6 +614,10 @@ public:
void setLevelofDetailBias(float bias);
float levelofDetailBias() const;
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QOpenGLTexture *t);
+#endif
+
private:
Q_DISABLE_COPY(QOpenGLTexture)
Q_DECLARE_PRIVATE(QOpenGLTexture)
@@ -621,6 +626,10 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLTexture::Features)
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QOpenGLTexture *t);
+#endif
+
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 63e345545c..9ff0b5f5e5 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -99,6 +99,9 @@ SOURCES += \
painting/qplatformbackingstore.cpp \
painting/qpathsimplifier.cpp
+RESOURCES += \
+ painting/qpdf.qrc
+
darwin {
HEADERS += painting/qcoregraphics_p.h
SOURCES += painting/qcoregraphics.mm
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 53349dcef4..d2c0912878 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -90,50 +90,6 @@ public:
*/
/*!
- Flushes the given \a region from the specified window \a win onto the
- screen.
-
- Note that the \a offset parameter is currently unused.
-*/
-void QBackingStore::flush(const QRegion &region, QWindow *win, const QPoint &offset)
-{
- if (!win)
- win = window();
- if (!win->handle()) {
- qWarning() << "QBackingStore::flush() called for "
- << win << " which does not have a handle.";
- return;
- }
-
-#ifdef QBACKINGSTORE_DEBUG
- if (win && win->isTopLevel() && !qt_window_private(win)->receivedExpose) {
- qWarning().nospace() << "QBackingStore::flush() called with non-exposed window "
- << win << ", behavior is undefined";
- }
-#endif
-
- Q_ASSERT(win == this->window() || this->window()->isAncestorOf(win, QWindow::ExcludeTransients));
-
- d_ptr->platformBackingStore->flush(win, QHighDpi::toNativeLocalRegion(region, win),
- QHighDpi::toNativeLocalPosition(offset, win));
-}
-
-/*!
- \fn QPaintDevice* QBackingStore::paintDevice()
-
- Implement this function to return the appropriate paint device.
-*/
-QPaintDevice *QBackingStore::paintDevice()
-{
- QPaintDevice *device = d_ptr->platformBackingStore->paintDevice();
-
- if (QHighDpiScaling::isActive() && device->devType() == QInternal::Image)
- return d_ptr->highDpiBackingstore.data();
-
- return device;
-}
-
-/*!
Constructs an empty surface for the given top-level \a window.
*/
QBackingStore::QBackingStore(QWindow *window)
@@ -161,8 +117,10 @@ QWindow* QBackingStore::window() const
}
/*!
- This function is called before painting onto the surface begins,
- with the \a region in which the painting will occur.
+ Begins painting on the backing store surface in the given \a region.
+
+ You should call this function before using the paintDevice() to
+ paint.
\sa endPaint(), paintDevice()
*/
@@ -203,7 +161,26 @@ void QBackingStore::beginPaint(const QRegion &region)
}
/*!
- This function is called after painting onto the surface has ended.
+ Returns the paint device for this surface.
+
+ \warning The device is only valid between calls to beginPaint() and
+ endPaint(). You should not cache the returned value.
+*/
+QPaintDevice *QBackingStore::paintDevice()
+{
+ QPaintDevice *device = d_ptr->platformBackingStore->paintDevice();
+
+ if (QHighDpiScaling::isActive() && device->devType() == QInternal::Image)
+ return d_ptr->highDpiBackingstore.data();
+
+ return device;
+}
+
+/*!
+ Ends painting.
+
+ You should call this function after painting with the paintDevice()
+ has ended.
\sa beginPaint(), paintDevice()
*/
@@ -213,9 +190,50 @@ void QBackingStore::endPaint()
}
/*!
- Sets the size of the windowsurface to be \a size.
+ Flushes the given \a region from the specified \a window onto the
+ screen.
+
+ The \a window must either be the top level window represented by
+ this backingstore, or a non-transient child of that window. Passing
+ \c nullptr falls back to using the backingstore's top level window.
+
+ If the \a window is a child window, the \a region should be in child window
+ coordinates, and the \a offset should be the child window's offset in relation
+ to the backingstore's top level window.
+
+ You should call this function after ending painting with endPaint().
+
+ \sa QWindow::transientParent()
+*/
+void QBackingStore::flush(const QRegion &region, QWindow *window, const QPoint &offset)
+{
+ QWindow *topLevelWindow = this->window();
+
+ if (!window)
+ window = topLevelWindow;
+ if (!window->handle()) {
+ qWarning() << "QBackingStore::flush() called for "
+ << window << " which does not have a handle.";
+ return;
+ }
+
+#ifdef QBACKINGSTORE_DEBUG
+ if (window && window->isTopLevel() && !qt_window_private(window)->receivedExpose) {
+ qWarning().nospace() << "QBackingStore::flush() called with non-exposed window "
+ << window << ", behavior is undefined";
+ }
+#endif
+
+ Q_ASSERT(window == topLevelWindow || topLevelWindow->isAncestorOf(window, QWindow::ExcludeTransients));
+
+ d_ptr->platformBackingStore->flush(window, QHighDpi::toNativeLocalRegion(region, window),
+ QHighDpi::toNativeLocalPosition(offset, window));
+}
+
+/*!
+ Sets the size of the window surface to \a size.
- \sa size()
+ \sa size()
*/
void QBackingStore::resize(const QSize &size)
{
@@ -224,7 +242,7 @@ void QBackingStore::resize(const QSize &size)
}
/*!
- Returns the current size of the windowsurface.
+ Returns the current size of the window surface.
*/
QSize QBackingStore::size() const
{
@@ -252,7 +270,7 @@ bool QBackingStore::scroll(const QRegion &area, int dx, int dy)
}
/*!
- Set \a region as the static contents of this window.
+ Set \a region as the static contents of this window.
*/
void QBackingStore::setStaticContents(const QRegion &region)
{
@@ -260,8 +278,8 @@ void QBackingStore::setStaticContents(const QRegion &region)
}
/*!
- Returns a pointer to the QRegion that has the static contents
- of this window.
+ Returns a QRegion representing the area of the window that
+ has static contents.
*/
QRegion QBackingStore::staticContents() const
{
@@ -269,8 +287,7 @@ QRegion QBackingStore::staticContents() const
}
/*!
- Returns a boolean indicating if this window
- has static contents or not.
+ Returns a boolean indicating if this window has static contents or not.
*/
bool QBackingStore::hasStaticContents() const
{
@@ -325,7 +342,7 @@ void Q_GUI_EXPORT qt_scrollRectInImage(QImage &img, const QRect &rect, const QPo
}
/*!
- Returns a pointer to the QPlatformBackingStore implementation
+ Returns a pointer to the QPlatformBackingStore implementation
*/
QPlatformBackingStore *QBackingStore::handle() const
{
diff --git a/src/gui/painting/qbackingstore.h b/src/gui/painting/qbackingstore.h
index 2ba6e1c906..ed37e11a5b 100644
--- a/src/gui/painting/qbackingstore.h
+++ b/src/gui/painting/qbackingstore.h
@@ -66,9 +66,7 @@ public:
QPaintDevice *paintDevice();
- // 'window' can be a child window, in which case 'region' is in child window coordinates and
- // offset is the (child) window's offset in relation to the window surface.
- void flush(const QRegion &region, QWindow *window = Q_NULLPTR, const QPoint &offset = QPoint());
+ void flush(const QRegion &region, QWindow *window = nullptr, const QPoint &offset = QPoint());
void resize(const QSize &size);
QSize size() const;
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index cc3ee76f0d..5c13308d94 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -100,7 +100,7 @@ const uchar *qt_patternForBrush(int brushStyle, bool invert)
return pat_tbl[brushStyle - Qt::Dense1Pattern][invert];
}
-QPixmap qt_pixmapForBrush(int brushStyle, bool invert)
+Q_GUI_EXPORT QPixmap qt_pixmapForBrush(int brushStyle, bool invert)
{
QPixmap pm;
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 9e1785c11d..855f245396 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -79,7 +79,7 @@ static inline int hex2int(char s)
return h < 0 ? h : (h << 4) | h;
}
-static bool get_hex_rgb(const char *name, int len, QRgb *rgb)
+static bool get_hex_rgb(const char *name, size_t len, QRgb *rgb)
{
if (name[0] != '#')
return false;
@@ -124,12 +124,12 @@ bool qt_get_hex_rgb(const char *name, QRgb *rgb)
return get_hex_rgb(name, qstrlen(name), rgb);
}
-static bool get_hex_rgb(const QChar *str, int len, QRgb *rgb)
+static bool get_hex_rgb(const QChar *str, size_t len, QRgb *rgb)
{
if (len > 13)
return false;
char tmp[16];
- for (int i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
tmp[i] = str[i].toLatin1();
tmp[len] = 0;
return get_hex_rgb(tmp, len, rgb);
@@ -858,6 +858,7 @@ QString QColor::name(NameFormat format) const
return QString();
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Sets the RGB value of this QColor to \a name, which may be in one
of these formats:
@@ -883,6 +884,17 @@ QString QColor::name(NameFormat format) const
void QColor::setNamedColor(const QString &name)
{
+ setColorFromString(qToStringViewIgnoringNull(name));
+}
+#endif
+
+/*!
+ \overload
+ \since 5.10
+*/
+
+void QColor::setNamedColor(QStringView name)
+{
setColorFromString(name);
}
@@ -896,6 +908,7 @@ void QColor::setNamedColor(QLatin1String name)
setColorFromString(name);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.7
@@ -909,7 +922,17 @@ void QColor::setNamedColor(QLatin1String name)
*/
bool QColor::isValidColor(const QString &name)
{
- return !name.isEmpty() && QColor().setColorFromString(name);
+ return isValidColor(qToStringViewIgnoringNull(name));
+}
+#endif
+
+/*!
+ \overload
+ \since 5.10
+*/
+bool QColor::isValidColor(QStringView name) Q_DECL_NOTHROW
+{
+ return name.size() && QColor().setColorFromString(name);
}
/*!
@@ -922,7 +945,7 @@ bool QColor::isValidColor(QLatin1String name) Q_DECL_NOTHROW
}
template <typename String>
-bool QColor::setColorFromString(const String &name)
+bool QColor::setColorFromString(String name)
{
if (!name.size()) {
invalidate();
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index 83a93e25ea..0c5ebcbda9 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -72,7 +72,10 @@ public:
inline QColor(int r, int g, int b, int a = 255);
QColor(QRgb rgb) Q_DECL_NOTHROW;
QColor(QRgba64 rgba64) Q_DECL_NOTHROW;
+#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;
@@ -95,7 +98,10 @@ public:
QString name() const;
QString name(NameFormat format) const;
+#if QT_STRINGVIEW_LEVEL < 2
void setNamedColor(const QString& name);
+#endif
+ void setNamedColor(QStringView name);
void setNamedColor(QLatin1String name);
static QStringList colorNames();
@@ -221,14 +227,17 @@ public:
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;
private:
void invalidate() Q_DECL_NOTHROW;
template <typename String>
- bool setColorFromString(const String &name);
+ bool setColorFromString(String name);
Spec cspec;
union {
@@ -280,8 +289,13 @@ inline QColor::QColor(int r, int g, int b, int a)
inline QColor::QColor(QLatin1String aname)
{ setNamedColor(aname); }
+inline QColor::QColor(QStringView aname)
+{ setNamedColor(aname); }
+
+#if QT_STRINGVIEW_LEVEL < 2
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
diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp
index 6d2cb9aadb..ee05f810f1 100644
--- a/src/gui/painting/qcompositionfunctions.cpp
+++ b/src/gui/painting/qcompositionfunctions.cpp
@@ -855,6 +855,10 @@ struct QFullCoverage {
{
*dest = src;
}
+ inline void store(QRgba64 *dest, const QRgba64 src) const
+ {
+ *dest = src;
+ }
};
struct QPartialCoverage {
@@ -868,6 +872,10 @@ struct QPartialCoverage {
{
*dest = INTERPOLATE_PIXEL_255(src, ca, *dest, ica);
}
+ inline void store(QRgba64 *dest, const QRgba64 src) const
+ {
+ *dest = interpolate255(src, ca, *dest, ica);
+ }
private:
const uint ca;
@@ -879,6 +887,11 @@ static inline int mix_alpha(int da, int sa)
return 255 - ((255 - sa) * (255 - da) >> 8);
}
+static inline uint mix_alpha_rgb64(uint da, uint sa)
+{
+ return 65535 - ((65535 - sa) * (65535 - da) >> 16);
+}
+
/*
Dca' = Sca.Da + Dca.Sa + Sca.(1 - Da) + Dca.(1 - Sa)
= Sca + Dca
@@ -897,17 +910,6 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int
}
}
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl_rgb64(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
-{
- QRgba64 s = color;
- for (int i = 0; i < length; ++i) {
- QRgba64 d = dest[i];
- d = comp_func_Plus_one_pixel(d, s);
- coverage.store(&dest[i], d);
- }
-}
-
void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -986,6 +988,11 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1011,6 +1018,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest,
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) multiply_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1019,6 +1049,14 @@ void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, ui
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)
+ comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1042,6 +1080,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(uint *Q_DECL_REST
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) multiply_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1050,6 +1109,14 @@ void QT_FASTCALL comp_func_Multiply(uint *Q_DECL_RESTRICT dest, const uint *Q_DE
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)
+ comp_func_Multiply_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
Dca' = (Sca.Da + Dca.Sa - Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)
= Sca + Dca - Sca.Dca
@@ -1079,6 +1146,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, i
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) 65535 - qt_div_65535((65535-a) * (65535-b))
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1087,6 +1177,14 @@ void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint
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)
+ comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1110,6 +1208,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(uint *Q_DECL_RESTRI
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) 65535 - (((65535-a) * (65535-b)) >> 16)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1118,6 +1237,14 @@ void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint
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)
+ comp_func_Screen_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
if 2.Dca < Da
Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1133,6 +1260,15 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1158,6 +1294,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(uint *dest,
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) overlay_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1166,6 +1325,14 @@ void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uin
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)
+ comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1189,6 +1356,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(uint *Q_DECL_RESTR
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) overlay_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1197,6 +1385,14 @@ void QT_FASTCALL comp_func_Overlay(uint *Q_DECL_RESTRICT dest, const uint *Q_DEC
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)
+ comp_func_Overlay_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
Dca' = min(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
Da' = Sa + Da - Sa.Da
@@ -1206,6 +1402,11 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1231,6 +1432,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, i
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) darken_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1239,6 +1463,14 @@ void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint
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)
+ comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1262,6 +1494,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(uint *Q_DECL_RESTRI
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) darken_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1270,6 +1523,14 @@ void QT_FASTCALL comp_func_Darken(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL
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)
+ comp_func_Darken_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
Dca' = max(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
Da' = Sa + Da - Sa.Da
@@ -1279,6 +1540,11 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1304,6 +1570,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest,
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) lighten_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1312,6 +1601,14 @@ void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uin
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)
+ comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1335,6 +1632,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(uint *Q_DECL_RESTR
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) lighten_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1343,6 +1661,14 @@ void QT_FASTCALL comp_func_Lighten(uint *Q_DECL_RESTRICT dest, const uint *Q_DEC
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)
+ comp_func_Lighten_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
if Sca.Da + Dca.Sa >= Sa.Da
Dca' = Sa.Da + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1362,6 +1688,19 @@ 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
+ return qt_div_65535(65535 * dst_sa / (65535 - 65535 * src / sa) + temp);
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1387,6 +1726,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(uint *des
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a,b) color_dodge_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1395,6 +1757,14 @@ void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color,
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)
+ comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1418,6 +1788,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(uint *Q_DECL_RE
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) color_dodge_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1426,6 +1817,14 @@ void QT_FASTCALL comp_func_ColorDodge(uint *Q_DECL_RESTRICT dest, const uint *Q_
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)
+ comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
if Sca.Da + Dca.Sa <= Sa.Da
Dca' = Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1445,6 +1844,19 @@ 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 == 0 || src_da + dst_sa <= sa_da)
+ return qt_div_65535(temp);
+ return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1470,6 +1882,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(uint *dest
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) color_burn_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1478,6 +1913,14 @@ void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, u
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)
+ comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1501,6 +1944,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(uint *Q_DECL_RES
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) color_burn_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1509,6 +1973,14 @@ void QT_FASTCALL comp_func_ColorBurn(uint *Q_DECL_RESTRICT dest, const uint *Q_D
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)
+ comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
if 2.Sca < Sa
Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1525,6 +1997,16 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1550,6 +2032,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(uint *dest
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) hardlight_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1558,6 +2063,14 @@ void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, u
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)
+ comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1581,6 +2094,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(uint *Q_DECL_RES
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) hardlight_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1589,6 +2123,14 @@ void QT_FASTCALL comp_func_HardLight(uint *Q_DECL_RESTRICT dest, const uint *Q_D
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)
+ comp_func_HardLight_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
if 2.Sca <= Sa
Dca' = Dca.(Sa + (2.Sca - Sa).(1 - Dca/Da)) + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1612,6 +2154,22 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1637,6 +2195,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) soft_light_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1645,6 +2226,14 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1668,6 +2257,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(uint *Q_DECL_RES
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) soft_light_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1676,6 +2286,14 @@ void QT_FASTCALL comp_func_SoftLight(uint *Q_DECL_RESTRICT dest, const uint *Q_D
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)
+ comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
Dca' = abs(Dca.Sa - Sca.Da) + Sca.(1 - Da) + Dca.(1 - Sa)
= Sca + Dca - 2.min(Sca.Da, Dca.Sa)
@@ -1685,6 +2303,11 @@ 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>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1710,6 +2333,29 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *des
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) difference_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1718,6 +2364,14 @@ void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color,
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)
+ comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1741,6 +2395,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(uint *Q_DECL_RE
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) difference_op_rgb64(a, b, da, sa)
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1749,6 +2424,14 @@ void QT_FASTCALL comp_func_Difference(uint *Q_DECL_RESTRICT dest, const uint *Q_
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)
+ comp_func_Difference_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
/*
Dca' = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)
*/
@@ -1777,6 +2460,30 @@ Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_imp
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
+{
+ uint sa = color.alpha();
+ uint sr = color.red();
+ uint sg = color.green();
+ uint sb = color.blue();
+
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ uint da = d.alpha();
+
+#define OP(a, b) (a + b - qt_div_65535(2*(qint64(a)*b)))
+ uint r = OP( d.red(), sr);
+ uint b = OP( d.blue(), sb);
+ uint g = OP(d.green(), sg);
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
+
void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1785,6 +2492,14 @@ void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, u
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)
+ comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1808,6 +2523,27 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(uint *Q_DECL_RES
}
}
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+
+ uint da = d.alpha();
+ uint sa = s.alpha();
+
+#define OP(a, b) (a + b - ((qint64(a)*b) >> 15))
+ uint r = OP( d.red(), s.red());
+ uint b = OP( d.blue(), s.blue());
+ uint g = OP(d.green(), s.green());
+ uint a = mix_alpha_rgb64(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba64(r, g, b, a));
+ }
+}
+
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)
@@ -1816,6 +2552,14 @@ void QT_FASTCALL comp_func_Exclusion(uint *Q_DECL_RESTRICT dest, const uint *Q_D
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)
+ comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,
int length,
uint color,
@@ -2177,8 +2921,17 @@ CompositionFunctionSolid64 qt_functionForModeSolid64_C[] = {
comp_func_solid_DestinationAtop_rgb64,
comp_func_solid_XOR_rgb64,
comp_func_solid_Plus_rgb64,
- 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
+ comp_func_solid_Multiply_rgb64,
+ comp_func_solid_Screen_rgb64,
+ comp_func_solid_Overlay_rgb64,
+ comp_func_solid_Darken_rgb64,
+ comp_func_solid_Lighten_rgb64,
+ comp_func_solid_ColorDodge_rgb64,
+ comp_func_solid_ColorBurn_rgb64,
+ comp_func_solid_HardLight_rgb64,
+ comp_func_solid_SoftLight_rgb64,
+ comp_func_solid_Difference_rgb64,
+ comp_func_solid_Exclusion_rgb64,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
@@ -2238,8 +2991,17 @@ CompositionFunction64 qt_functionForMode64_C[] = {
comp_func_DestinationAtop_rgb64,
comp_func_XOR_rgb64,
comp_func_Plus_rgb64,
- 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
+ comp_func_Multiply_rgb64,
+ comp_func_Screen_rgb64,
+ comp_func_Overlay_rgb64,
+ comp_func_Darken_rgb64,
+ comp_func_Lighten_rgb64,
+ comp_func_ColorDodge_rgb64,
+ comp_func_ColorBurn_rgb64,
+ comp_func_HardLight_rgb64,
+ comp_func_SoftLight_rgb64,
+ comp_func_Difference_rgb64,
+ comp_func_Exclusion_rgb64,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm
index c4fb8afc64..a234a12bf0 100644
--- a/src/gui/painting/qcoregraphics.mm
+++ b/src/gui/painting/qcoregraphics.mm
@@ -66,7 +66,7 @@ CGImageRef qt_mac_toCGImageMask(const QImage &image)
static const auto deleter = [](void *image, const void *, size_t) { delete static_cast<QImage *>(image); };
QCFType<CGDataProviderRef> dataProvider =
CGDataProviderCreateWithData(new QImage(image), image.bits(),
- image.byteCount(), deleter);
+ image.sizeInBytes(), deleter);
return CGImageMaskCreate(image.width(), image.height(), 8, image.depth(),
image.bytesPerLine(), dataProvider, NULL, false);
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index bcb243db6a..436a62d486 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -292,7 +292,7 @@ void QCosmeticStroker::setup()
color = multiplyAlpha256(state->penData.solid.color, opacity).toArgb32();
QRasterBuffer *buffer = state->penData.rasterBuffer;
pixels = (uint *)buffer->buffer();
- ppl = buffer->bytesPerLine()>>2;
+ ppl = buffer->stride<quint32>();
}
// line drawing produces different results with different clips, so
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index c78fdfe62e..5207e861e6 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -55,10 +55,13 @@
#endif
#include <private/qguiapplication_p.h>
#include <private/qrgba64_p.h>
+#include <qloggingcategory.h>
#include <qmath.h>
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcQtGuiDrawHelper, "qt.gui.drawhelper")
+
#define MASK(src, a) src = BYTE_MUL(src, a)
/*
@@ -1042,7 +1045,7 @@ QPixelLayout qPixelLayouts[QImage::NImageFormats] = {
{ 10, 20, 10, 10, 10, 0, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertA2RGB30PMFromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR>, convertA2RGB30PMToARGB64PM<PixelOrderBGR> }, // Format_A2BGR30_Premultiplied
{ 10, 0, 10, 10, 10, 20, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertRGB30FromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB>, convertA2RGB30PMToARGB64PM<PixelOrderRGB> }, // Format_RGB30
{ 10, 0, 10, 10, 10, 20, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertA2RGB30PMFromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB>, convertA2RGB30PMToARGB64PM<PixelOrderRGB> }, // Format_A2RGB30_Premultiplied
- { 0, 0, 0, 0, 0, 0, 8, 0, false, QPixelLayout::BPP8, convertAlpha8ToRGB32, convertAlpha8FromARGB32PM, 0, convertAlpha8ToRGB64 }, // Format_Alpha8
+ { 0, 0, 0, 0, 0, 0, 8, 0, true, QPixelLayout::BPP8, convertAlpha8ToRGB32, convertAlpha8FromARGB32PM, 0, convertAlpha8ToRGB64 }, // Format_Alpha8
{ 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertGrayscale8ToRGB32, convertGrayscale8FromARGB32PM, convertGrayscale8FromRGB32, convertGrayscale8ToRGB64 } // Format_Grayscale8
};
@@ -1942,10 +1945,14 @@ static void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper(u
const uint *s1 = (const uint *)image.scanLine(y1);
const uint *s2 = (const uint *)image.scanLine(y2);
- int disty = (fy & 0x0000ffff) >> 8;
- int idisty = 256 - disty;
- int x = fx >> 16;
- int length = end - b;
+ const int disty = (fy & 0x0000ffff) >> 8;
+ const int idisty = 256 - disty;
+ const int length = end - b;
+
+ // The intermediate buffer is generated in the positive direction
+ const int adjust = (fdx < 0) ? fdx * length : 0;
+ const int offset = (fx + adjust) >> 16;
+ int x = offset;
// The idea is first to do the interpolation between the row s1 and the row s2
// into an intermediate buffer, then we interpolate between two pixel of this buffer.
@@ -1955,7 +1962,7 @@ static void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper(u
// +1 for the last pixel to interpolate with, and +1 for rounding errors.
quint32 intermediate_buffer[2][buffer_size + 2];
// count is the size used in the intermediate_buffer.
- int count = (qint64(length) * fdx + fixed_scale - 1) / fixed_scale + 2;
+ int count = (qint64(length) * qAbs(fdx) + fixed_scale - 1) / fixed_scale + 2;
Q_ASSERT(count <= buffer_size + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case
int f = 0;
int lim = count;
@@ -2056,9 +2063,10 @@ static void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper(u
intermediate_buffer[1][f] = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
x++;
}
+
// Now interpolate the values from the intermediate_buffer to get the final result.
- fx &= fixed_scale - 1;
- Q_ASSERT((fx >> 16) == 0);
+ fx -= offset * fixed_scale; // Switch to intermediate buffer coordinates
+
while (b < end) {
int x1 = (fx >> 16);
int x2 = x1 + 1;
@@ -2375,7 +2383,7 @@ static void QT_FASTCALL fetchTransformedBilinearARGB32PM_fast_rotate_helper(uint
__m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy);
const uchar *textureData = image.imageData;
- const int bytesPerLine = image.bytesPerLine;
+ const qssize_t bytesPerLine = image.bytesPerLine;
const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
while (b < boundedEnd - 3) {
@@ -2588,14 +2596,14 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
fy -= half_point;
if (fdy == 0) { // simple scale, no rotation or shear
- if (fdx <= fixed_scale && fdx > 0) {
- // simple scale up on X without mirroring
+ if (qAbs(fdx) <= fixed_scale) {
+ // simple scale up on X
bilinearFastTransformHelperARGB32PM[tiled][SimpleUpscaleTransform](b, end, data->texture, fx, fy, fdx, fdy);
- } else if ((fdx < 0 && fdx > -(fixed_scale / 8)) || qAbs(data->m22) < qreal(1./8.)) {
- // scale up more than 8x (on either Y or on X mirrored)
+ } else if (qAbs(data->m22) < qreal(1./8.)) {
+ // scale up more than 8x (on Y)
bilinearFastTransformHelperARGB32PM[tiled][UpscaleTransform](b, end, data->texture, fx, fy, fdx, fdy);
} else {
- // scale down on X (or up on X mirrored less than 8x)
+ // scale down on X
bilinearFastTransformHelperARGB32PM[tiled][DownscaleTransform](b, end, data->texture, fx, fy, fdx, fdy);
}
} else { // rotation or shear
@@ -2658,6 +2666,245 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
return buffer;
}
+template<TextureBlendType blendType, QPixelLayout::BPP bpp>
+static void QT_FASTCALL fetchTransformedBilinear_simple_upscale_helper(uint *b, uint *end, const QTextureData &image,
+ int &fx, int &fy, int fdx, int /*fdy*/)
+{
+ const QPixelLayout *layout = &qPixelLayouts[image.format];
+ const QVector<QRgb> *clut = image.colorTable;
+ Q_ASSERT(bpp == QPixelLayout::BPPNone || bpp == layout->bpp);
+ // When templated 'fetch' should be inlined at compile time:
+ const FetchPixelsFunc fetch = (bpp == QPixelLayout::BPPNone) ? qFetchPixels[layout->bpp] : fetchPixels<bpp>;
+ const ConvertFunc convertToARGB32PM = layout->convertToARGB32PM;
+
+ int y1 = (fy >> 16);
+ int y2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);
+ const uchar *s1 = image.scanLine(y1);
+ const uchar *s2 = image.scanLine(y2);
+
+ const int disty = (fy & 0x0000ffff) >> 8;
+ const int idisty = 256 - disty;
+ const int length = end - b;
+
+ // The intermediate buffer is generated in the positive direction
+ const int adjust = (fdx < 0) ? fdx * length : 0;
+ const int offset = (fx + adjust) >> 16;
+ int x = offset;
+
+ // The idea is first to do the interpolation between the row s1 and the row s2
+ // into an intermediate buffer, then we interpolate between two pixel of this buffer.
+ // +1 for the last pixel to interpolate with, and +1 for rounding errors.
+ uint buf1[buffer_size + 2];
+ uint buf2[buffer_size + 2];
+ const uint *ptr1;
+ const uint *ptr2;
+
+ int count = (qint64(length) * qAbs(fdx) + fixed_scale - 1) / fixed_scale + 2;
+ Q_ASSERT(count <= buffer_size + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case
+
+ if (blendType == BlendTransformedBilinearTiled) {
+ x %= image.width;
+ if (x < 0)
+ x += image.width;
+ int len1 = qMin(count, image.width - x);
+ int len2 = qMin(x, count - len1);
+
+ ptr1 = fetch(buf1, s1, x, len1);
+ ptr1 = convertToARGB32PM(buf1, ptr1, len1, clut, 0);
+ ptr2 = fetch(buf2, s2, x, len1);
+ ptr2 = convertToARGB32PM(buf2, ptr2, len1, clut, 0);
+ for (int i = 0; i < len1; ++i) {
+ uint t = ptr1[i];
+ uint b = ptr2[i];
+ buf1[i] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
+ buf2[i] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
+ }
+
+ if (len2) {
+ ptr1 = fetch(buf1 + len1, s1, 0, len2);
+ ptr1 = convertToARGB32PM(buf1 + len1, ptr1, len2, clut, 0);
+ ptr2 = fetch(buf2 + len1, s2, 0, len2);
+ ptr2 = convertToARGB32PM(buf2 + len1, ptr2, len2, clut, 0);
+ for (int i = 0; i < len2; ++i) {
+ uint t = ptr1[i];
+ uint b = ptr2[i];
+ buf1[i + len1] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
+ buf2[i + len1] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
+ }
+ }
+ for (int i = image.width; i < count; ++i) {
+ buf1[i] = buf1[i - image.width];
+ buf2[i] = buf2[i - image.width];
+ }
+ } else {
+ int start = qMax(x, image.x1);
+ int end = qMin(x + count, image.x2);
+ int len = qMax(1, end - start);
+ int leading = start - x;
+
+ ptr1 = fetch(buf1 + leading, s1, start, len);
+ ptr1 = convertToARGB32PM(buf1 + leading, ptr1, len, clut, 0);
+ ptr2 = fetch(buf2 + leading, s2, start, len);
+ ptr2 = convertToARGB32PM(buf2 + leading, ptr2, len, clut, 0);
+
+ for (int i = 0; i < len; ++i) {
+ uint t = ptr1[i];
+ uint b = ptr2[i];
+ buf1[i + leading] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
+ buf2[i + leading] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
+ }
+
+ for (int i = 0; i < leading; ++i) {
+ buf1[i] = buf1[leading];
+ buf2[i] = buf2[leading];
+ }
+ for (int i = leading + len; i < count; ++i) {
+ buf1[i] = buf1[i - 1];
+ buf2[i] = buf2[i - 1];
+ }
+ }
+
+ // Now interpolate the values from the intermediate_buffer to get the final result.
+ fx -= offset * fixed_scale; // Switch to intermediate buffer coordinates
+
+ while (b < end) {
+ int x1 = (fx >> 16);
+ int x2 = x1 + 1;
+ Q_ASSERT(x1 >= 0);
+ Q_ASSERT(x2 < count);
+
+ int distx = (fx & 0x0000ffff) >> 8;
+ int idistx = 256 - distx;
+ int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff;
+ int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00;
+ *b++ = rb | ag;
+ fx += fdx;
+ }
+}
+
+
+typedef void (QT_FASTCALL *BilinearFastTransformFetcher)(uint *buf1, uint *buf2, const int len, const QTextureData &image,
+ int fx, int fy, const int fdx, const int fdy);
+
+template<TextureBlendType blendType, QPixelLayout::BPP bpp>
+static void QT_FASTCALL fetchTransformedBilinear_fetcher(uint *buf1, uint *buf2, const int len, const QTextureData &image,
+ int fx, int fy, const int fdx, const int fdy)
+{
+ const QPixelLayout &layout = qPixelLayouts[image.format];
+ Q_ASSERT(bpp == QPixelLayout::BPPNone || bpp == layout.bpp);
+ // When templated 'fetch1' should be inlined at compile time:
+ const FetchPixelFunc fetch1 = (bpp == QPixelLayout::BPPNone) ? qFetchPixel[layout.bpp] : fetchPixel<bpp>;
+ if (fdy == 0) {
+ int y1 = (fy >> 16);
+ int y2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);
+ const uchar *s1 = image.scanLine(y1);
+ const uchar *s2 = image.scanLine(y2);
+
+ int i = 0;
+ if (blendType == BlendTransformedBilinear) {
+ for (; i < len; ++i) {
+ int x1 = (fx >> 16);
+ int x2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
+ if (x1 != x2)
+ break;
+ buf1[i * 2 + 0] = buf1[i * 2 + 1] = fetch1(s1, x1);
+ buf2[i * 2 + 0] = buf2[i * 2 + 1] = fetch1(s2, x1);
+ fx += fdx;
+ }
+ int fastLen = len;
+ if (fdx > 0)
+ fastLen = qMin(fastLen, int((qint64(image.x2 - 1) * fixed_scale - fx) / fdx));
+ else if (fdx < 0)
+ fastLen = qMin(fastLen, int((qint64(image.x1) * fixed_scale - fx) / fdx));
+
+ for (; i < fastLen; ++i) {
+ int x = (fx >> 16);
+ buf1[i * 2 + 0] = fetch1(s1, x);
+ buf1[i * 2 + 1] = fetch1(s1, x + 1);
+ buf2[i * 2 + 0] = fetch1(s2, x);
+ buf2[i * 2 + 1] = fetch1(s2, x + 1);
+ fx += fdx;
+ }
+ }
+
+ for (; i < len; ++i) {
+ int x1 = (fx >> 16);
+ int x2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
+ buf1[i * 2 + 0] = fetch1(s1, x1);
+ buf1[i * 2 + 1] = fetch1(s1, x2);
+ buf2[i * 2 + 0] = fetch1(s2, x1);
+ buf2[i * 2 + 1] = fetch1(s2, x2);
+ fx += fdx;
+ }
+ } else {
+ int i = 0;
+ if (blendType == BlendTransformedBilinear) {
+ for (; i < len; ++i) {
+ int x1 = (fx >> 16);
+ int x2;
+ int y1 = (fy >> 16);
+ int y2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
+ fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);
+ if (x1 != x2 && y1 != y2)
+ break;
+ const uchar *s1 = image.scanLine(y1);
+ const uchar *s2 = image.scanLine(y2);
+ buf1[i * 2 + 0] = fetch1(s1, x1);
+ buf1[i * 2 + 1] = fetch1(s1, x2);
+ buf2[i * 2 + 0] = fetch1(s2, x1);
+ buf2[i * 2 + 1] = fetch1(s2, x2);
+ fx += fdx;
+ fy += fdy;
+ }
+ int fastLen = len;
+ if (fdx > 0)
+ fastLen = qMin(fastLen, int((qint64(image.x2 - 1) * fixed_scale - fx) / fdx));
+ else if (fdx < 0)
+ fastLen = qMin(fastLen, int((qint64(image.x1) * fixed_scale - fx) / fdx));
+ if (fdy > 0)
+ fastLen = qMin(fastLen, int((qint64(image.y2 - 1) * fixed_scale - fy) / fdy));
+ else if (fdy < 0)
+ fastLen = qMin(fastLen, int((qint64(image.y1) * fixed_scale - fy) / fdy));
+
+ for (; i < fastLen; ++i) {
+ int x = (fx >> 16);
+ int y = (fy >> 16);
+ const uchar *s1 = image.scanLine(y);
+ const uchar *s2 = s1 + image.bytesPerLine;
+ buf1[i * 2 + 0] = fetch1(s1, x);
+ buf1[i * 2 + 1] = fetch1(s1, x + 1);
+ buf2[i * 2 + 0] = fetch1(s2, x);
+ buf2[i * 2 + 1] = fetch1(s2, x + 1);
+ fx += fdx;
+ fy += fdy;
+ }
+ }
+
+ for (; i < len; ++i) {
+ int x1 = (fx >> 16);
+ int x2;
+ int y1 = (fy >> 16);
+ int y2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
+ fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);
+
+ const uchar *s1 = image.scanLine(y1);
+ const uchar *s2 = image.scanLine(y2);
+ buf1[i * 2 + 0] = fetch1(s1, x1);
+ buf1[i * 2 + 1] = fetch1(s1, x2);
+ buf2[i * 2 + 0] = fetch1(s2, x1);
+ buf2[i * 2 + 1] = fetch1(s2, x2);
+ fx += fdx;
+ fy += fdy;
+ }
+ }
+}
+
// blendType = BlendTransformedBilinear or BlendTransformedBilinearTiled
template<TextureBlendType blendType, QPixelLayout::BPP bpp>
static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *,
@@ -2665,19 +2912,7 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
{
const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
const QVector<QRgb> *clut = data->texture.colorTable;
- if (bpp != QPixelLayout::BPPNone) // Like this to not ICE on GCC 5.3.1
- Q_ASSERT(layout->bpp == bpp);
- // When templated 'fetch' should be inlined at compile time:
- const FetchPixelsFunc fetch = (bpp == QPixelLayout::BPPNone) ? qFetchPixels[layout->bpp] : FetchPixelsFunc(fetchPixels<bpp>);
- const FetchPixelFunc fetch1 = (bpp == QPixelLayout::BPPNone) ? qFetchPixel[layout->bpp] : FetchPixelFunc(fetchPixel<bpp>);
-
- int image_width = data->texture.width;
- int image_height = data->texture.height;
-
- int image_x1 = data->texture.x1;
- int image_y1 = data->texture.y1;
- int image_x2 = data->texture.x2 - 1;
- int image_y2 = data->texture.y2 - 1;
+ Q_ASSERT(bpp == QPixelLayout::BPPNone || layout->bpp == bpp);
const qreal cx = x + qreal(0.5);
const qreal cy = y + qreal(0.5);
@@ -2693,203 +2928,80 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
fx -= half_point;
fy -= half_point;
- if (fdy == 0) { //simple scale, no rotation
- int y1 = (fy >> 16);
- int y2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
- const uchar *s1 = data->texture.scanLine(y1);
- const uchar *s2 = data->texture.scanLine(y2);
-
- if (fdx <= fixed_scale && fdx > 0) { // scale up on X
- int disty = (fy & 0x0000ffff) >> 8;
- int idisty = 256 - disty;
- int x = fx >> 16;
-
- // The idea is first to do the interpolation between the row s1 and the row s2
- // into an intermediate buffer, then we interpolate between two pixel of this buffer.
- // +1 for the last pixel to interpolate with, and +1 for rounding errors.
- uint buf1[buffer_size + 2];
- uint buf2[buffer_size + 2];
- const uint *ptr1;
- const uint *ptr2;
-
- int count = (qint64(length) * fdx + fixed_scale - 1) / fixed_scale + 2;
- Q_ASSERT(count <= buffer_size + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case
-
- if (blendType == BlendTransformedBilinearTiled) {
- x %= image_width;
- if (x < 0)
- x += image_width;
- int len1 = qMin(count, image_width - x);
- int len2 = qMin(x, count - len1);
-
- ptr1 = fetch(buf1, s1, x, len1);
- ptr1 = layout->convertToARGB32PM(buf1, ptr1, len1, clut, 0);
- ptr2 = fetch(buf2, s2, x, len1);
- ptr2 = layout->convertToARGB32PM(buf2, ptr2, len1, clut, 0);
- for (int i = 0; i < len1; ++i) {
- uint t = ptr1[i];
- uint b = ptr2[i];
- buf1[i] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
- buf2[i] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
- }
-
- if (len2) {
- ptr1 = fetch(buf1 + len1, s1, 0, len2);
- ptr1 = layout->convertToARGB32PM(buf1 + len1, ptr1, len2, clut, 0);
- ptr2 = fetch(buf2 + len1, s2, 0, len2);
- ptr2 = layout->convertToARGB32PM(buf2 + len1, ptr2, len2, clut, 0);
- for (int i = 0; i < len2; ++i) {
- uint t = ptr1[i];
- uint b = ptr2[i];
- buf1[i + len1] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
- buf2[i + len1] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
- }
- }
- for (int i = image_width; i < count; ++i) {
- buf1[i] = buf1[i - image_width];
- buf2[i] = buf2[i - image_width];
- }
- } else {
- int start = qMax(x, image_x1);
- int end = qMin(x + count, image_x2 + 1);
- int len = qMax(1, end - start);
- int leading = start - x;
-
- ptr1 = fetch(buf1 + leading, s1, start, len);
- ptr1 = layout->convertToARGB32PM(buf1 + leading, ptr1, len, clut, 0);
- ptr2 = fetch(buf2 + leading, s2, start, len);
- ptr2 = layout->convertToARGB32PM(buf2 + leading, ptr2, len, clut, 0);
-
- for (int i = 0; i < len; ++i) {
- uint t = ptr1[i];
- uint b = ptr2[i];
- buf1[i + leading] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
- buf2[i + leading] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
- }
-
- for (int i = 0; i < leading; ++i) {
- buf1[i] = buf1[leading];
- buf2[i] = buf2[leading];
- }
- for (int i = leading + len; i < count; ++i) {
- buf1[i] = buf1[i - 1];
- buf2[i] = buf2[i - 1];
- }
- }
-
- // Now interpolate the values from the intermediate_buffer to get the final result.
- fx &= fixed_scale - 1;
- Q_ASSERT((fx >> 16) == 0);
- for (int i = 0; i < length; ++i) {
- int x1 = (fx >> 16);
- int x2 = x1 + 1;
- Q_ASSERT(x1 >= 0);
- Q_ASSERT(x2 < count);
-
- int distx = (fx & 0x0000ffff) >> 8;
- int idistx = 256 - distx;
- int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff;
- int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00;
- buffer[i] = rb | ag;
- fx += fdx;
- }
+ if (fdy == 0) { // simple scale, no rotation or shear
+ if (qAbs(fdx) <= fixed_scale) { // scale up on X
+ fetchTransformedBilinear_simple_upscale_helper<blendType, bpp>(buffer, buffer + length, data->texture, fx, fy, fdx, fdy);
} else {
+ const BilinearFastTransformFetcher fetcher = fetchTransformedBilinear_fetcher<blendType,bpp>;
+
uint buf1[buffer_size];
uint buf2[buffer_size];
uint *b = buffer;
while (length) {
int len = qMin(length, buffer_size / 2);
- int fracX = fx;
- for (int i = 0; i < len; ++i) {
- int x1 = (fx >> 16);
- int x2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- buf1[i * 2 + 0] = fetch1(s1, x1);
- buf1[i * 2 + 1] = fetch1(s1, x2);
- buf2[i * 2 + 0] = fetch1(s2, x1);
- buf2[i * 2 + 1] = fetch1(s2, x2);
- fx += fdx;
- }
+ fetcher(buf1, buf2, len, data->texture, fx, fy, fdx, 0);
layout->convertToARGB32PM(buf1, buf1, len * 2, clut, 0);
layout->convertToARGB32PM(buf2, buf2, len * 2, clut, 0);
- if ((fdx < 0 && fdx > -(fixed_scale / 8)) || qAbs(data->m22) < qreal(1./8.)) { // scale up more than 8x
+ if (qAbs(data->m22) < qreal(1./8.)) { // scale up more than 8x (on Y)
int disty = (fy & 0x0000ffff) >> 8;
for (int i = 0; i < len; ++i) {
- int distx = (fracX & 0x0000ffff) >> 8;
+ int distx = (fx & 0x0000ffff) >> 8;
b[i] = interpolate_4_pixels(buf1 + i * 2, buf2 + i * 2, distx, disty);
- fracX += fdx;
+ fx += fdx;
}
- } else { //scale down
+ } else {
int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
for (int i = 0; i < len; ++i) {
uint tl = buf1[i * 2 + 0];
uint tr = buf1[i * 2 + 1];
uint bl = buf2[i * 2 + 0];
uint br = buf2[i * 2 + 1];
- int distx = ((fracX & 0x0000ffff) + 0x0800) >> 12;
+ int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
- fracX += fdx;
+ fx += fdx;
}
}
length -= len;
b += len;
}
}
- } else { //rotation
+ } else { // rotation or shear
+ const BilinearFastTransformFetcher fetcher = fetchTransformedBilinear_fetcher<blendType,bpp>;
+
uint buf1[buffer_size];
uint buf2[buffer_size];
uint *b = buffer;
-
while (length) {
int len = qMin(length, buffer_size / 2);
- int fracX = fx;
- int fracY = fy;
- for (int i = 0; i < len; ++i) {
- int x1 = (fx >> 16);
- int x2;
- int y1 = (fy >> 16);
- int y2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
-
- const uchar *s1 = data->texture.scanLine(y1);
- const uchar *s2 = data->texture.scanLine(y2);
- buf1[i * 2 + 0] = fetch1(s1, x1);
- buf1[i * 2 + 1] = fetch1(s1, x2);
- buf2[i * 2 + 0] = fetch1(s2, x1);
- buf2[i * 2 + 1] = fetch1(s2, x2);
- fx += fdx;
- fy += fdy;
- }
+ fetcher(buf1, buf2, len, data->texture, fx, fy, fdx, fdy);
layout->convertToARGB32PM(buf1, buf1, len * 2, clut, 0);
layout->convertToARGB32PM(buf2, buf2, len * 2, clut, 0);
- if (qAbs(data->m11) < qreal(1./8.) || qAbs(data->m22) < qreal(1./8.) ) {
- //if we are zooming more than 8 times, we use 8bit precision for the position.
+ if (qAbs(data->m11) < qreal(1./8.)|| qAbs(data->m22) < qreal(1./8.)) {
+ // If we are zooming more than 8 times, we use 8bit precision for the position.
for (int i = 0; i < len; ++i) {
- int distx = (fracX & 0x0000ffff) >> 8;
- int disty = (fracY & 0x0000ffff) >> 8;
+ int distx = (fx & 0x0000ffff) >> 8;
+ int disty = (fy & 0x0000ffff) >> 8;
b[i] = interpolate_4_pixels(buf1 + i * 2, buf2 + i * 2, distx, disty);
- fracX += fdx;
- fracY += fdy;
+ fx += fdx;
+ fy += fdy;
}
} else {
- //we are zooming less than 8x, use 4bit precision
+ // We are zooming less than 8x, use 4bit precision
for (int i = 0; i < len; ++i) {
uint tl = buf1[i * 2 + 0];
uint tr = buf1[i * 2 + 1];
uint bl = buf2[i * 2 + 0];
uint br = buf2[i * 2 + 1];
- int distx = ((fracX & 0x0000ffff) + 0x0800) >> 12;
- int disty = ((fracY & 0x0000ffff) + 0x0800) >> 12;
+ int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
+ int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
- fracX += fdx;
- fracY += fdy;
+ fx += fdx;
+ fy += fdy;
}
}
@@ -2898,6 +3010,11 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
}
}
} else {
+ // When templated 'fetch' should be inlined at compile time:
+ const FetchPixelFunc fetch1 = (bpp == QPixelLayout::BPPNone) ? qFetchPixel[layout->bpp] : fetchPixel<bpp>;
+
+ const QTextureData &image = data->texture;
+
const qreal fdx = data->m11;
const qreal fdy = data->m12;
const qreal fdw = data->m13;
@@ -2928,8 +3045,8 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
distxs[i] = int((px - x1) * 256);
distys[i] = int((py - y1) * 256);
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
+ fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
+ fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);
const uchar *s1 = data->texture.scanLine(y1);
const uchar *s2 = data->texture.scanLine(y2);
@@ -2970,21 +3087,9 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
const QVector<QRgb> *clut = data->texture.colorTable;
- int image_width = data->texture.width;
- int image_height = data->texture.height;
-
- int image_x1 = data->texture.x1;
- int image_y1 = data->texture.y1;
- int image_x2 = data->texture.x2 - 1;
- int image_y2 = data->texture.y2 - 1;
-
const qreal cx = x + qreal(0.5);
const qreal cy = y + qreal(0.5);
- const qreal fdx = data->m11;
- const qreal fdy = data->m12;
- const qreal fdw = data->m13;
-
if (data->fast_matrix) {
// The increment pr x in the scanline
int fdx = (int)(data->m11 * fixed_scale);
@@ -2996,14 +3101,13 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
fx -= half_point;
fy -= half_point;
+ const BilinearFastTransformFetcher fetcher =
+ (layout->bpp == QPixelLayout::BPP32)
+ ? fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32>
+ : fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPPNone>;
+
if (fdy == 0) { //simple scale, no rotation
- int y1 = (fy >> 16);
- int y2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
- const uchar *s1 = data->texture.scanLine(y1);
- const uchar *s2 = data->texture.scanLine(y2);
- FetchPixelFunc fetch = qFetchPixel[layout->bpp];
uint sbuf1[buffer_size];
uint sbuf2[buffer_size];
quint64 buf1[buffer_size];
@@ -3011,84 +3115,19 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
QRgba64 *b = buffer;
while (length) {
int len = qMin(length, buffer_size / 2);
- int fracX = fx;
- int i = 0;
int disty = (fy & 0x0000ffff);
#if defined(__SSE2__)
const __m128i vdy = _mm_set1_epi16(disty);
const __m128i vidy = _mm_set1_epi16(0x10000 - disty);
- if (blendType != BlendTransformedBilinearTiled && layout->bpp == QPixelLayout::BPP32) {
- for (; i < len; ++i) {
- int x1 = (fx >> 16);
- int x2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- if (x1 != x2)
- break;
- sbuf1[i * 2 + 0] = sbuf1[i * 2 + 1] = ((const uint*)s1)[x1];
- sbuf2[i * 2 + 0] = sbuf2[i * 2 + 1] = ((const uint*)s2)[x1];
- fx += fdx;
- }
- int fastLen;
- if (fdx > 0)
- fastLen = qMin(len, int((image_x2 - (fx >> 16)) / data->m11));
- else
- fastLen = qMin(len, int((image_x1 - (fx >> 16)) / data->m11));
- fastLen -= 3;
-
- const __m128i v_fdx = _mm_set1_epi32(fdx*4);
- __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
- for (; i < fastLen; i += 4) {
- int offset = _mm_extract_epi16(v_fx, 1);
- sbuf1[i * 2 + 0] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 0] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 1] = ((const uint*)s2)[offset + 1];
- offset = _mm_extract_epi16(v_fx, 3);
- sbuf1[i * 2 + 2] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 3] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 2] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 3] = ((const uint*)s2)[offset + 1];
- offset = _mm_extract_epi16(v_fx, 5);
- sbuf1[i * 2 + 4] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 5] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 4] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 5] = ((const uint*)s2)[offset + 1];
- offset = _mm_extract_epi16(v_fx, 7);
- sbuf1[i * 2 + 6] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 7] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 6] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 7] = ((const uint*)s2)[offset + 1];
- v_fx = _mm_add_epi32(v_fx, v_fdx);
- }
- fx = _mm_cvtsi128_si32(v_fx);
- }
#endif
- for (; i < len; ++i) {
- int x1 = (fx >> 16);
- int x2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
-
- if (layout->bpp == QPixelLayout::BPP32) {
- sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];
- sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];
- sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];
- sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];
-
- } else {
- sbuf1[i * 2 + 0] = fetch(s1, x1);
- sbuf1[i * 2 + 1] = fetch(s1, x2);
- sbuf2[i * 2 + 0] = fetch(s2, x1);
- sbuf2[i * 2 + 1] = fetch(s2, x2);
- }
+ fetcher(sbuf1, sbuf2, len, data->texture, fx, fy, fdx, fdy);
- fx += fdx;
- }
layout->convertToARGB64PM((QRgba64 *)buf1, sbuf1, len * 2, clut, 0);
if (disty)
layout->convertToARGB64PM((QRgba64 *)buf2, sbuf2, len * 2, clut, 0);
for (int i = 0; i < len; ++i) {
- int distx = (fracX & 0x0000ffff);
+ int distx = (fx & 0x0000ffff);
#if defined(__SSE2__)
__m128i vt = _mm_loadu_si128((const __m128i*)(buf1 + i*2));
if (disty) {
@@ -3107,13 +3146,12 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
#else
b[i] = interpolate_4_pixels_rgb64((QRgba64 *)buf1 + i*2, (QRgba64 *)buf2 + i*2, distx, disty);
#endif
- fracX += fdx;
+ fx += fdx;
}
length -= len;
b += len;
}
} else { //rotation
- FetchPixelFunc fetch = qFetchPixel[layout->bpp];
uint sbuf1[buffer_size];
uint sbuf2[buffer_size];
quint64 buf1[buffer_size];
@@ -3123,117 +3161,18 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
while (b < end) {
int len = qMin(length, buffer_size / 2);
- int fracX = fx;
- int fracY = fy;
- int i = 0;
-#if defined(__SSE2__)
- if (blendType != BlendTransformedBilinearTiled && layout->bpp == QPixelLayout::BPP32) {
- for (; i < len; ++i) {
- int x1 = (fx >> 16);
- int x2;
- int y1 = (fy >> 16);
- int y2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
- if (x1 != x2 && y1 != y2)
- break;
- const uchar *s1 = data->texture.scanLine(y1);
- const uchar *s2 = data->texture.scanLine(y2);
- sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];
- sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];
- sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];
- sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];
- fx += fdx;
- fy += fdy;
- }
- int fastLen = len;
- if (fdx > 0)
- fastLen = qMin(fastLen, int((qint64(image_x2) * fixed_scale - fx) / fdx));
- else if (fdx < 0)
- fastLen = qMin(fastLen, int((qint64(image_x1) * fixed_scale - fx) / fdx));
- if (fdy > 0)
- fastLen = qMin(fastLen, int((qint64(image_y2) * fixed_scale - fy) / fdy));
- else if (fdy < 0)
- fastLen = qMin(fastLen, int((qint64(image_y1) * fixed_scale - fy) / fdy));
- fastLen -= 3;
-
- const __m128i v_fdx = _mm_set1_epi32(fdx*4);
- const __m128i v_fdy = _mm_set1_epi32(fdy*4);
- __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
- __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy);
- const int bytesPerLine = data->texture.bytesPerLine;
- const uchar *s1 = data->texture.imageData;
- const uchar *s2 = s1 + bytesPerLine;
- const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
- for (; i < fastLen; i += 4) {
- const __m128i vy = _mm_packs_epi32(_mm_srai_epi32(v_fy, 16), _mm_setzero_si128());
- __m128i voffset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epu16(vy, vbpl));
- voffset = _mm_add_epi32(voffset, _mm_srli_epi32(v_fx, 16));
-
- int offset = _mm_cvtsi128_si32(voffset); voffset = _mm_srli_si128(voffset, 4);
- sbuf1[i * 2 + 0] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 0] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 1] = ((const uint*)s2)[offset + 1];
- offset = _mm_cvtsi128_si32(voffset); voffset = _mm_srli_si128(voffset, 4);
- sbuf1[i * 2 + 2] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 3] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 2] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 3] = ((const uint*)s2)[offset + 1];
- offset = _mm_cvtsi128_si32(voffset); voffset = _mm_srli_si128(voffset, 4);
- sbuf1[i * 2 + 4] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 5] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 4] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 5] = ((const uint*)s2)[offset + 1];
- offset = _mm_cvtsi128_si32(voffset);
- sbuf1[i * 2 + 6] = ((const uint*)s1)[offset];
- sbuf1[i * 2 + 7] = ((const uint*)s1)[offset + 1];
- sbuf2[i * 2 + 6] = ((const uint*)s2)[offset];
- sbuf2[i * 2 + 7] = ((const uint*)s2)[offset + 1];
-
- v_fx = _mm_add_epi32(v_fx, v_fdx);
- v_fy = _mm_add_epi32(v_fy, v_fdy);
- }
- fx = _mm_cvtsi128_si32(v_fx);
- fy = _mm_cvtsi128_si32(v_fy);
- }
-#endif
- for (; i < len; ++i) {
- int x1 = (fx >> 16);
- int x2;
- int y1 = (fy >> 16);
- int y2;
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
- const uchar *s1 = data->texture.scanLine(y1);
- const uchar *s2 = data->texture.scanLine(y2);
-
- if (layout->bpp == QPixelLayout::BPP32) {
- sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];
- sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];
- sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];
- sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];
-
- } else {
- sbuf1[i * 2 + 0] = fetch(s1, x1);
- sbuf1[i * 2 + 1] = fetch(s1, x2);
- sbuf2[i * 2 + 0] = fetch(s2, x1);
- sbuf2[i * 2 + 1] = fetch(s2, x2);
- }
+ fetcher(sbuf1, sbuf2, len, data->texture, fx, fy, fdx, fdy);
- fx += fdx;
- fy += fdy;
- }
layout->convertToARGB64PM((QRgba64 *)buf1, sbuf1, len * 2, clut, 0);
layout->convertToARGB64PM((QRgba64 *)buf2, sbuf2, len * 2, clut, 0);
for (int i = 0; i < len; ++i) {
- int distx = (fracX & 0x0000ffff);
- int disty = (fracY & 0x0000ffff);
+ int distx = (fx & 0x0000ffff);
+ int disty = (fy & 0x0000ffff);
b[i] = interpolate_4_pixels_rgb64((QRgba64 *)buf1 + i*2, (QRgba64 *)buf2 + i*2, distx, disty);
- fracX += fdx;
- fracY += fdy;
+ fx += fdx;
+ fy += fdy;
}
length -= len;
@@ -3241,6 +3180,12 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
}
}
} else {
+ const QTextureData &image = data->texture;
+
+ const qreal fdx = data->m11;
+ const qreal fdy = data->m12;
+ const qreal fdw = data->m13;
+
qreal fx = data->m21 * cy + data->m11 * cx + data->dx;
qreal fy = data->m22 * cy + data->m12 * cx + data->dy;
qreal fw = data->m23 * cy + data->m13 * cx + data->m33;
@@ -3270,8 +3215,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
distxs[i] = int((px - x1) * (1<<16));
distys[i] = int((py - y1) * (1<<16));
- fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
- fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
+ fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
+ fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);
const uchar *s1 = data->texture.scanLine(y1);
const uchar *s2 = data->texture.scanLine(y2);
@@ -3842,7 +3787,7 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
Operator op = getOperator(data, spans, count);
if (!op.funcSolid64) {
- qDebug("unsupported 64bit blend attempted");
+ qCDebug(lcQtGuiDrawHelper, "blend_color_generic_rgb64: unsupported 64bit blend attempted, falling back to 32-bit");
return blend_color_generic(count, spans, userData);
}
@@ -4080,7 +4025,7 @@ static void blend_src_generic_rgb64(int count, const QSpan *spans, void *userDat
if (blend64.isSupported())
handleSpans(count, spans, data, blend64);
else {
- qDebug("blend_src_generic_rgb64: unsupported 64-bit blend attempted");
+ qCDebug(lcQtGuiDrawHelper, "blend_src_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
BlendSrcGeneric blend32(data, op);
handleSpans(count, spans, data, blend32);
}
@@ -4137,7 +4082,7 @@ static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, voi
Operator op = getOperator(data, spans, count);
if (!op.func64) {
- qWarning("Unsupported blend");
+ qCDebug(lcQtGuiDrawHelper, "blend_untransformed_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
return blend_untransformed_generic(count, spans, userData);
}
quint64 buffer[buffer_size];
@@ -4378,7 +4323,7 @@ static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userD
Operator op = getOperator(data, spans, count);
if (!op.func64) {
- qDebug("unsupported rgb64 blend");
+ qCDebug(lcQtGuiDrawHelper, "blend_tiled_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
return blend_tiled_generic(count, spans, userData);
}
quint64 buffer[buffer_size];
@@ -5014,7 +4959,7 @@ static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *us
int image_width = data->texture.width;
int image_height = data->texture.height;
- const int scanline_offset = data->texture.bytesPerLine / 4;
+ const qssize_t scanline_offset = data->texture.bytesPerLine / 4;
if (data->fast_matrix) {
// The increment pr x in the scanline
@@ -5354,7 +5299,7 @@ inline void qt_bitmapblit_template(QRasterBuffer *rasterBuffer,
int mapWidth, int mapHeight, int mapStride)
{
DST *dest = reinterpret_cast<DST *>(rasterBuffer->scanLine(y)) + x;
- const int destStride = rasterBuffer->bytesPerLine() / sizeof(DST);
+ const int destStride = rasterBuffer->stride<DST>();
if (mapWidth > 8) {
while (mapHeight--) {
@@ -5668,7 +5613,7 @@ void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer,
if (!clip) {
quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x;
- const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);
+ const int destStride = rasterBuffer->stride<quint16>();
while (mapHeight--) {
for (int i = 0; i < mapWidth; ++i)
alphamapblend_quint16(map[i], dest, i, c);
@@ -5743,7 +5688,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,
const QClipData *clip, bool useGammaCorrection)
{
const quint32 c = color.toArgb32();
- const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32);
+ const int destStride = rasterBuffer->stride<quint32>();
if (color.isTransparent())
return;
@@ -5939,7 +5884,7 @@ static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer,
if (!clip) {
quint32 *dst = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x;
- const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32);
+ const int destStride = rasterBuffer->stride<quint32>();
while (mapHeight--) {
for (int i = 0; i < mapWidth; ++i) {
const uint coverage = src[i];
diff --git a/src/gui/painting/qdrawhelper_avx2.cpp b/src/gui/painting/qdrawhelper_avx2.cpp
index a7e03a7bb3..d6c3319c76 100644
--- a/src/gui/painting/qdrawhelper_avx2.cpp
+++ b/src/gui/painting/qdrawhelper_avx2.cpp
@@ -420,10 +420,14 @@ void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper_avx2(uin
const uint *s1 = (const uint *)image.scanLine(y1);
const uint *s2 = (const uint *)image.scanLine(y2);
- int disty = (fy & 0x0000ffff) >> 8;
- int idisty = 256 - disty;
- int x = fx >> 16;
- int length = end - b;
+ const int disty = (fy & 0x0000ffff) >> 8;
+ const int idisty = 256 - disty;
+ const int length = end - b;
+
+ // The intermediate buffer is generated in the positive direction
+ const int adjust = (fdx < 0) ? fdx * length : 0;
+ const int offset = (fx + adjust) >> 16;
+ int x = offset;
// The idea is first to do the interpolation between the row s1 and the row s2
// into an intermediate buffer, then we interpolate between two pixel of this buffer.
@@ -433,7 +437,7 @@ void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper_avx2(uin
// +1 for the last pixel to interpolate with, and +1 for rounding errors.
quint32 intermediate_buffer[2][BufferSize + 2];
// count is the size used in the intermediate_buffer.
- int count = (qint64(length) * fdx + FixedScale - 1) / FixedScale + 2;
+ int count = (qint64(length) * qAbs(fdx) + FixedScale - 1) / FixedScale + 2;
Q_ASSERT(count <= BufferSize + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case
int f = 0;
int lim = qMin(count, image.x2 - x);
@@ -492,8 +496,7 @@ void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper_avx2(uin
x++;
}
// Now interpolate the values from the intermediate_buffer to get the final result.
- fx &= FixedScale - 1;
- Q_ASSERT((fx >> 16) == 0);
+ fx -= offset * FixedScale;
const __m128i v_fdx = _mm_set1_epi32(fdx * 4);
const __m128i v_blend = _mm_set1_epi32(0x00800080);
@@ -682,7 +685,7 @@ void QT_FASTCALL fetchTransformedBilinearARGB32PM_fast_rotate_helper_avx2(uint *
v_fy = _mm256_add_epi32(v_fy, _mm256_mullo_epi32(_mm256_set1_epi32(fdy), v_index));
const uchar *textureData = image.imageData;
- const int bytesPerLine = image.bytesPerLine;
+ const qssize_t bytesPerLine = image.bytesPerLine;
const __m256i vbpl = _mm256_set1_epi16(bytesPerLine/4);
while (b < boundedEnd - 7) {
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index ccfc9a2889..2be10d2cfb 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -293,7 +293,7 @@ struct QTextureData
int y1;
int x2;
int y2;
- int bytesPerLine;
+ qssize_t bytesPerLine;
QImage::Format format;
const QVector<QRgb> *colorTable;
bool hasAlpha;
@@ -847,7 +847,7 @@ inline void qt_memfill(T *dest, T value, int count)
template <class T> Q_STATIC_TEMPLATE_FUNCTION
inline void qt_rectfill(T *dest, T value,
- int x, int y, int width, int height, int stride)
+ int x, int y, int width, int height, qssize_t stride)
{
char *d = reinterpret_cast<char*>(dest + x) + y * stride;
if (uint(stride) == (width * sizeof(T))) {
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 3013d2cf3e..bfe2080298 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -341,7 +341,7 @@ void qt_bitmapblit32_sse2_base(QRasterBuffer *rasterBuffer, int x, int y,
const uchar *src, int width, int height, int stride)
{
quint32 *dest = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x;
- const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32);
+ const int destStride = rasterBuffer->stride<quint32>();
const __m128i c128 = _mm_set1_epi32(color);
const __m128i maskmask1 = _mm_set_epi32(0x10101010, 0x20202020,
@@ -407,7 +407,7 @@ void qt_bitmapblit16_sse2(QRasterBuffer *rasterBuffer, int x, int y,
{
const quint16 c = qConvertRgb32To16(color.toArgb32());
quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x;
- const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);
+ const int destStride = rasterBuffer->stride<quint32>();
const __m128i c128 = _mm_set1_epi16(c);
QT_WARNING_DISABLE_MSVC(4309) // truncation of constant value
diff --git a/src/gui/painting/qemulationpaintengine.cpp b/src/gui/painting/qemulationpaintengine.cpp
index 586b71557e..e6686e3721 100644
--- a/src/gui/painting/qemulationpaintengine.cpp
+++ b/src/gui/painting/qemulationpaintengine.cpp
@@ -72,6 +72,14 @@ QPainterState *QEmulationPaintEngine::createState(QPainterState *orig) const
return real_engine->createState(orig);
}
+static inline void combineXForm(QBrush *brush, const QRectF &r)
+{
+ QTransform t = brush->transform();
+ t.translate(r.x(), r.y());
+ t.scale(r.width(), r.height());
+ brush->setTransform(t);
+}
+
void QEmulationPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
{
QPainterState *s = state();
@@ -84,26 +92,14 @@ void QEmulationPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
Qt::BrushStyle style = qbrush_style(brush);
if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
- const QGradient *g = brush.gradient();
-
- if (g->coordinateMode() > QGradient::LogicalMode) {
- if (g->coordinateMode() == QGradient::StretchToDeviceMode) {
- QBrush copy = brush;
- QTransform mat = copy.transform();
- mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height());
- copy.setTransform(mat);
- real_engine->fill(path, copy);
- return;
- } else if (g->coordinateMode() == QGradient::ObjectBoundingMode) {
- QBrush copy = brush;
- QTransform mat = copy.transform();
- QRectF r = path.controlPointRect();
- mat.translate(r.x(), r.y());
- mat.scale(r.width(), r.height());
- copy.setTransform(mat);
- real_engine->fill(path, copy);
- return;
- }
+ QGradient::CoordinateMode coMode = brush.gradient()->coordinateMode();
+ if (coMode > QGradient::LogicalMode) {
+ QBrush copy = brush;
+ const QPaintDevice *d = real_engine->painter()->device();
+ QRectF r = (coMode == QGradient::ObjectBoundingMode) ? path.controlPointRect() : QRectF(0, 0, d->width(), d->height());
+ combineXForm(&copy, r);
+ real_engine->fill(path, copy);
+ return;
}
}
@@ -124,27 +120,15 @@ void QEmulationPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
QBrush brush = pen.brush();
QPen copy = pen;
Qt::BrushStyle style = qbrush_style(brush);
- if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
- const QGradient *g = brush.gradient();
-
- if (g->coordinateMode() > QGradient::LogicalMode) {
- if (g->coordinateMode() == QGradient::StretchToDeviceMode) {
- QTransform mat = brush.transform();
- mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height());
- brush.setTransform(mat);
- copy.setBrush(brush);
- real_engine->stroke(path, copy);
- return;
- } else if (g->coordinateMode() == QGradient::ObjectBoundingMode) {
- QTransform mat = brush.transform();
- QRectF r = path.controlPointRect();
- mat.translate(r.x(), r.y());
- mat.scale(r.width(), r.height());
- brush.setTransform(mat);
- copy.setBrush(brush);
- real_engine->stroke(path, copy);
- return;
- }
+ if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern ) {
+ QGradient::CoordinateMode coMode = brush.gradient()->coordinateMode();
+ if (coMode > QGradient::LogicalMode) {
+ const QPaintDevice *d = real_engine->painter()->device();
+ QRectF r = (coMode == QGradient::ObjectBoundingMode) ? path.controlPointRect() : QRectF(0, 0, d->width(), d->height());
+ combineXForm(&brush, r);
+ copy.setBrush(brush);
+ real_engine->stroke(path, copy);
+ return;
}
}
@@ -179,18 +163,16 @@ void QEmulationPaintEngine::drawTextItem(const QPointF &p, const QTextItem &text
QGradient g = *s->pen.brush().gradient();
if (g.coordinateMode() > QGradient::LogicalMode) {
- QTransform mat = s->pen.brush().transform();
- if (g.coordinateMode() == QGradient::StretchToDeviceMode) {
- mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height());
- } else if (g.coordinateMode() == QGradient::ObjectBoundingMode) {
- const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
- QRectF r(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal());
- mat.translate(r.x(), r.y());
- mat.scale(r.width(), r.height());
- }
+ QBrush copy = s->pen.brush();
+ const QPaintDevice *d = real_engine->painter()->device();
+ const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
+ QRectF r = (g.coordinateMode() == QGradient::ObjectBoundingMode) ?
+ QRectF(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()) :
+ QRectF(0, 0, d->width(), d->height());
+ combineXForm(&copy, r);
g.setCoordinateMode(QGradient::LogicalMode);
QBrush brush(g);
- brush.setTransform(mat);
+ brush.setTransform(copy.transform());
s->pen.setBrush(brush);
penChanged();
real_engine->drawTextItem(p, textItem);
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 4a135e25d8..0143e9b602 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -43,7 +43,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003 by */
+/* Copyright 2000-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -119,10 +119,6 @@
/* */
/*************************************************************************/
-/* experimental support for gamma correction within the rasterizer */
-#define xxxGRAYS_USE_GAMMA
-
-
/*************************************************************************/
/* */
/* The macro QT_FT_COMPONENT is used in trace mode. It is an implicit */
@@ -133,6 +129,28 @@
#define QT_FT_COMPONENT trace_smooth
+/* Auxiliary macros for token concatenation. */
+#define QT_FT_ERR_XCAT( x, y ) x ## y
+#define QT_FT_ERR_CAT( x, y ) QT_FT_ERR_XCAT( x, y )
+
+#define QT_FT_BEGIN_STMNT do {
+#define QT_FT_END_STMNT } while ( 0 )
+
+#define QT_FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
+#define QT_FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
+
+
+/*
+ * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min'
+ * algorithm. We use alpha = 1, beta = 3/8, giving us results with a
+ * largest error less than 7% compared to the exact value.
+ */
+#define QT_FT_HYPOT( x, y ) \
+ ( x = QT_FT_ABS( x ), \
+ y = QT_FT_ABS( y ), \
+ x > y ? x + ( 3 * y >> 3 ) \
+ : y + ( 3 * x >> 3 ) )
+
#define ErrRaster_MemoryOverflow -4
#if defined(VXWORKS)
@@ -150,6 +168,9 @@
#define qt_ft_longjmp longjmp
#define qt_ft_jmp_buf jmp_buf
+#include <stddef.h>
+typedef ptrdiff_t QT_FT_PtrDist;
+
#define ErrRaster_Invalid_Mode -2
#define ErrRaster_Invalid_Outline -1
#define ErrRaster_Invalid_Argument -3
@@ -169,15 +190,10 @@
#define QT_FT_UNUSED( x ) (void) x
- /* Disable the tracing mechanism for simplicity -- developers can */
- /* activate it easily by redefining these two macros. */
-#ifndef QT_FT_ERROR
-#define QT_FT_ERROR( x ) do ; while ( 0 ) /* nothing */
-#endif
-
-#ifndef QT_FT_TRACE
-#define QT_FT_TRACE( x ) do ; while ( 0 ) /* nothing */
-#endif
+#define QT_FT_TRACE5( x ) do { } while ( 0 ) /* nothing */
+#define QT_FT_TRACE7( x ) do { } while ( 0 ) /* nothing */
+#define QT_FT_ERROR( x ) do { } while ( 0 ) /* nothing */
+#define QT_FT_THROW( e ) QT_FT_ERR_CAT( ErrRaster_, e )
#ifndef QT_FT_MEM_SET
#define QT_FT_MEM_SET( d, s, c ) qt_ft_memset( d, s, c )
@@ -187,9 +203,6 @@
#define QT_FT_MEM_ZERO( dest, count ) QT_FT_MEM_SET( dest, 0, count )
#endif
- /* define this to dump debugging information */
-#define xxxDEBUG_GRAYS
-
#define RAS_ARG PWorker worker
#define RAS_ARG_ PWorker worker,
@@ -199,26 +212,47 @@
#define ras (*worker)
-
/* must be at least 6 bits! */
#define PIXEL_BITS 8
#define ONE_PIXEL ( 1L << PIXEL_BITS )
-#define PIXEL_MASK ( -1L << PIXEL_BITS )
#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) )
-#define SUBPIXELS( x ) ( (TPos)(x) * ( 1 << PIXEL_BITS ) )
+#define SUBPIXELS( x ) ( (TPos)(x) * ONE_PIXEL )
#define FLOOR( x ) ( (x) & -ONE_PIXEL )
#define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )
#define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )
#if PIXEL_BITS >= 6
-#define UPSCALE( x ) ( (x) * ( 1 << ( PIXEL_BITS - 6 ) ) )
+#define UPSCALE( x ) ( (x) * ( ONE_PIXEL >> 6 ) )
#define DOWNSCALE( x ) ( (x) >> ( PIXEL_BITS - 6 ) )
#else
#define UPSCALE( x ) ( (x) >> ( 6 - PIXEL_BITS ) )
-#define DOWNSCALE( x ) ( (x) << ( 6 - PIXEL_BITS ) )
+#define DOWNSCALE( x ) ( (x) * ( 64 >> PIXEL_BITS ) )
#endif
+/* Compute `dividend / divisor' and return both its quotient and */
+/* remainder, cast to a specific type. This macro also ensures that */
+/* the remainder is always positive. */
+#define QT_FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \
+QT_FT_BEGIN_STMNT \
+ (quotient) = (type)( (dividend) / (divisor) ); \
+ (remainder) = (type)( (dividend) % (divisor) ); \
+ if ( (remainder) < 0 ) \
+ { \
+ (quotient)--; \
+ (remainder) += (type)(divisor); \
+ } \
+QT_FT_END_STMNT
+
+ /* These macros speed up repetitive divisions by replacing them */
+ /* with multiplications and right shifts. */
+#define QT_FT_UDIVPREP( b ) \
+ long b ## _r = (long)( ULONG_MAX >> PIXEL_BITS ) / ( b )
+#define QT_FT_UDIV( a, b ) \
+ ( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \
+ ( sizeof( long ) * CHAR_BIT - PIXEL_BITS ) )
+
+
/*************************************************************************/
/* */
/* TYPE DEFINITIONS */
@@ -228,28 +262,9 @@
/* need to define them to "float" or "double" when experimenting with */
/* new algorithms */
- typedef int TCoord; /* integer scanline/pixel coordinate */
- typedef int TPos; /* sub-pixel coordinate */
-
- /* determine the type used to store cell areas. This normally takes at */
- /* least PIXEL_BITS*2 + 1 bits. On 16-bit systems, we need to use */
- /* `long' instead of `int', otherwise bad things happen */
-
-#if PIXEL_BITS <= 7
-
- typedef int TArea;
-
-#else /* PIXEL_BITS >= 8 */
-
- /* approximately determine the size of integers using an ANSI-C header */
-#if QT_FT_UINT_MAX == 0xFFFFU
- typedef long TArea;
-#else
- typedef int TArea;
-#endif
-
-#endif /* PIXEL_BITS >= 8 */
-
+ typedef long TCoord; /* integer scanline/pixel coordinate */
+ typedef long TPos; /* sub-pixel coordinate */
+ typedef long TArea ; /* cell areas, coordinate products */
/* maximal number of gray spans in a call to the span callback */
#define QT_FT_MAX_GRAY_SPANS 256
@@ -279,17 +294,11 @@
int invalid;
PCell cells;
- int max_cells;
- int num_cells;
+ QT_FT_PtrDist max_cells;
+ QT_FT_PtrDist num_cells;
- TCoord cx, cy;
TPos x, y;
- TPos last_ey;
-
- QT_FT_Vector bez_stack[32 * 3 + 1];
- int lev_stack[32];
-
QT_FT_Outline outline;
QT_FT_Bitmap target;
QT_FT_BBox clip_box;
@@ -302,8 +311,6 @@
int band_size;
int band_shoot;
- int conic_level;
- int cubic_level;
qt_ft_jmp_buf jump_buffer;
@@ -311,7 +318,7 @@
long buffer_size;
PCell* ycells;
- int ycount;
+ TPos ycount;
int skip_spans;
} TWorker, *PWorker;
@@ -341,7 +348,7 @@
/* */
static void
gray_init_cells( RAS_ARG_ void* buffer,
- long byte_size )
+ long byte_size )
{
ras.buffer = buffer;
ras.buffer_size = byte_size;
@@ -404,31 +411,25 @@
/* */
/* Record the current cell in the table. */
/* */
- static void
- gray_record_cell( RAS_ARG )
+ static PCell
+ gray_find_cell( RAS_ARG )
{
PCell *pcell, cell;
- int x = ras.ex;
+ TPos x = ras.ex;
- if ( ras.invalid || !( ras.area | ras.cover ) )
- return;
- if ( x > ras.max_ex )
- x = ras.max_ex;
+ if ( x > ras.count_ex )
+ x = ras.count_ex;
pcell = &ras.ycells[ras.ey];
-
for (;;)
{
cell = *pcell;
if ( cell == NULL || cell->x > x )
break;
- if ( cell->x == x ) {
- cell->area += ras.area;
- cell->cover += ras.cover;
- return;
- }
+ if ( cell->x == x )
+ goto Exit;
pcell = &cell->next;
}
@@ -438,11 +439,28 @@
cell = ras.cells + ras.num_cells++;
cell->x = x;
- cell->area = ras.area;
- cell->cover = ras.cover;
+ cell->area = 0;
+ cell->cover = 0;
cell->next = *pcell;
*pcell = cell;
+
+ Exit:
+ return cell;
+ }
+
+
+ static void
+ gray_record_cell( RAS_ARG )
+ {
+ if ( ras.area | ras.cover )
+ {
+ PCell cell = gray_find_cell( RAS_VAR );
+
+
+ cell->area += ras.area;
+ cell->cover += ras.cover;
+ }
}
@@ -488,8 +506,8 @@
ras.ey = ey;
}
- ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey ||
- ex >= ras.count_ex );
+ ras.invalid = ( (unsigned int)ey >= (unsigned int)ras.count_ey ||
+ ex >= ras.count_ex );
}
@@ -511,12 +529,13 @@
ras.cover = 0;
ras.ex = ex - ras.min_ex;
ras.ey = ey - ras.min_ey;
- ras.last_ey = SUBPIXELS( ey );
ras.invalid = 0;
gray_set_cell( RAS_VAR_ ex, ey );
}
+// The new render-line implementation is not yet used
+#if 1
/*************************************************************************/
/* */
@@ -529,9 +548,9 @@
TPos x2,
TCoord y2 )
{
- TCoord ex1, ex2, fx1, fx2, delta;
+ TCoord ex1, ex2, fx1, fx2, delta, mod;
int p, first, dx;
- int incr, lift, mod, rem;
+ int incr;
dx = x2 - x1;
@@ -573,13 +592,7 @@
dx = -dx;
}
- delta = (TCoord)( p / dx );
- mod = (TCoord)( p % dx );
- if ( mod < 0 )
- {
- delta--;
- mod += (TCoord)dx;
- }
+ QT_FT_DIV_MOD( TCoord, p, dx, delta, mod );
ras.area += (TArea)( fx1 + first ) * delta;
ras.cover += delta;
@@ -590,14 +603,11 @@
if ( ex1 != ex2 )
{
- p = ONE_PIXEL * ( y2 - y1 + delta );
- lift = (TCoord)( p / dx );
- rem = (TCoord)( p % dx );
- if ( rem < 0 )
- {
- lift--;
- rem += (TCoord)dx;
- }
+ TCoord lift, rem;
+
+
+ p = ONE_PIXEL * ( y2 - y1 + delta );
+ QT_FT_DIV_MOD( TCoord, p, dx, lift, rem );
mod -= (int)dx;
@@ -633,38 +643,24 @@
gray_render_line( RAS_ARG_ TPos to_x,
TPos to_y )
{
- TCoord ey1, ey2, fy1, fy2;
+ TCoord ey1, ey2, fy1, fy2, mod;
TPos dx, dy, x, x2;
int p, first;
- int delta, rem, mod, lift, incr;
+ int delta, rem, lift, incr;
- ey1 = TRUNC( ras.last_ey );
+ ey1 = TRUNC( ras.y );
ey2 = TRUNC( to_y ); /* if (ey2 >= ras.max_ey) ey2 = ras.max_ey-1; */
- fy1 = (TCoord)( ras.y - ras.last_ey );
+ fy1 = (TCoord)( ras.y - SUBPIXELS( ey1 ) );
fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) );
dx = to_x - ras.x;
dy = to_y - ras.y;
- /* XXX: we should do something about the trivial case where dx == 0, */
- /* as it happens very often! */
-
/* perform vertical clipping */
- {
- TCoord min, max;
-
-
- min = ey1;
- max = ey2;
- if ( ey1 > ey2 )
- {
- min = ey2;
- max = ey1;
- }
- if ( min >= ras.max_ey || max < ras.min_ey )
- goto End;
- }
+ if ( ( ey1 >= ras.max_ey && ey2 >= ras.max_ey ) ||
+ ( ey1 < ras.min_ey && ey2 < ras.min_ey ) )
+ goto End;
/* everything is on a single scanline */
if ( ey1 == ey2 )
@@ -771,13 +767,7 @@
if ( ey1 != ey2 )
{
p = ONE_PIXEL * dx;
- lift = (int)( p / dy );
- rem = (int)( p % dy );
- if ( rem < 0 )
- {
- lift--;
- rem += (int)dy;
- }
+ QT_FT_DIV_MOD( int, p, dy, lift, rem );
mod -= (int)dy;
while ( ey1 != ey2 )
@@ -808,10 +798,147 @@
End:
ras.x = to_x;
ras.y = to_y;
- ras.last_ey = SUBPIXELS( ey2 );
}
+#else
+
+ /*************************************************************************/
+ /* */
+ /* Render a straight line across multiple cells in any direction. */
+ /* */
+ static void
+ gray_render_line( RAS_ARG_ TPos to_x,
+ TPos to_y )
+ {
+ TPos dx, dy, fx1, fy1, fx2, fy2;
+ TCoord ex1, ex2, ey1, ey2;
+
+
+ ex1 = TRUNC( ras.x );
+ ex2 = TRUNC( to_x );
+ ey1 = TRUNC( ras.y );
+ ey2 = TRUNC( to_y );
+
+ /* perform vertical clipping */
+ if ( ( ey1 >= ras.max_ey && ey2 >= ras.max_ey ) ||
+ ( ey1 < ras.min_ey && ey2 < ras.min_ey ) )
+ goto End;
+
+ dx = to_x - ras.x;
+ dy = to_y - ras.y;
+
+ fx1 = ras.x - SUBPIXELS( ex1 );
+ fy1 = ras.y - SUBPIXELS( ey1 );
+
+ if ( ex1 == ex2 && ey1 == ey2 ) /* inside one cell */
+ ;
+ else if ( dy == 0 ) /* ex1 != ex2 */ /* any horizontal line */
+ {
+ ex1 = ex2;
+ gray_set_cell( RAS_VAR_ ex1, ey1 );
+ }
+ else if ( dx == 0 )
+ {
+ if ( dy > 0 ) /* vertical line up */
+ do
+ {
+ fy2 = ONE_PIXEL;
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * fx1 * 2;
+ fy1 = 0;
+ ey1++;
+ gray_set_cell( RAS_VAR_ ex1, ey1 );
+ } while ( ey1 != ey2 );
+ else /* vertical line down */
+ do
+ {
+ fy2 = 0;
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * fx1 * 2;
+ fy1 = ONE_PIXEL;
+ ey1--;
+ gray_set_cell( RAS_VAR_ ex1, ey1 );
+ } while ( ey1 != ey2 );
+ }
+ else /* any other line */
+ {
+ TArea prod = dx * fy1 - dy * fx1;
+ QT_FT_UDIVPREP( dx );
+ QT_FT_UDIVPREP( dy );
+
+
+ /* The fundamental value `prod' determines which side and the */
+ /* exact coordinate where the line exits current cell. It is */
+ /* also easily updated when moving from one cell to the next. */
+ do
+ {
+ if ( prod <= 0 &&
+ prod - dx * ONE_PIXEL > 0 ) /* left */
+ {
+ fx2 = 0;
+ fy2 = (TPos)QT_FT_UDIV( -prod, -dx );
+ prod -= dy * ONE_PIXEL;
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
+ fx1 = ONE_PIXEL;
+ fy1 = fy2;
+ ex1--;
+ }
+ else if ( prod - dx * ONE_PIXEL <= 0 &&
+ prod - dx * ONE_PIXEL + dy * ONE_PIXEL > 0 ) /* up */
+ {
+ prod -= dx * ONE_PIXEL;
+ fx2 = (TPos)QT_FT_UDIV( -prod, dy );
+ fy2 = ONE_PIXEL;
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
+ fx1 = fx2;
+ fy1 = 0;
+ ey1++;
+ }
+ else if ( prod - dx * ONE_PIXEL + dy * ONE_PIXEL <= 0 &&
+ prod + dy * ONE_PIXEL >= 0 ) /* right */
+ {
+ prod += dy * ONE_PIXEL;
+ fx2 = ONE_PIXEL;
+ fy2 = (TPos)QT_FT_UDIV( prod, dx );
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
+ fx1 = 0;
+ fy1 = fy2;
+ ex1++;
+ }
+ else /* ( prod + dy * ONE_PIXEL < 0 &&
+ prod > 0 ) down */
+ {
+ fx2 = (TPos)QT_FT_UDIV( prod, -dy );
+ fy2 = 0;
+ prod += dx * ONE_PIXEL;
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
+ fx1 = fx2;
+ fy1 = ONE_PIXEL;
+ ey1--;
+ }
+
+ gray_set_cell( RAS_VAR_ ex1, ey1 );
+ } while ( ex1 != ex2 || ey1 != ey2 );
+ }
+
+ fx2 = to_x - SUBPIXELS( ex2 );
+ fy2 = to_y - SUBPIXELS( ey2 );
+
+ ras.cover += ( fy2 - fy1 );
+ ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
+
+ End:
+ ras.x = to_x;
+ ras.y = to_y;
+ }
+
+#endif
+
static void
gray_split_conic( QT_FT_Vector* base )
{
@@ -836,52 +963,11 @@
gray_render_conic( RAS_ARG_ const QT_FT_Vector* control,
const QT_FT_Vector* to )
{
+ QT_FT_Vector bez_stack[16 * 2 + 1]; /* enough to accommodate bisections */
+ QT_FT_Vector* arc = bez_stack;
TPos dx, dy;
- int top, level;
- int* levels;
- QT_FT_Vector* arc;
-
-
- dx = DOWNSCALE( ras.x ) + to->x - ( control->x << 1 );
- if ( dx < 0 )
- dx = -dx;
- dy = DOWNSCALE( ras.y ) + to->y - ( control->y << 1 );
- if ( dy < 0 )
- dy = -dy;
- if ( dx < dy )
- dx = dy;
-
- level = 1;
- dx = dx / ras.conic_level;
- while ( dx > 0 )
- {
- dx >>= 2;
- level++;
- }
+ int draw, split;
- /* a shortcut to speed things up */
- if ( level <= 1 )
- {
- /* we compute the mid-point directly in order to avoid */
- /* calling gray_split_conic() */
- TPos to_x, to_y, mid_x, mid_y;
-
-
- to_x = UPSCALE( to->x );
- to_y = UPSCALE( to->y );
- mid_x = ( ras.x + to_x + 2 * UPSCALE( control->x ) ) / 4;
- mid_y = ( ras.y + to_y + 2 * UPSCALE( control->y ) ) / 4;
-
- gray_render_line( RAS_VAR_ mid_x, mid_y );
- gray_render_line( RAS_VAR_ to_x, to_y );
-
- return;
- }
-
- arc = ras.bez_stack;
- levels = ras.lev_stack;
- top = 0;
- levels[0] = level;
arc[0].x = UPSCALE( to->x );
arc[0].y = UPSCALE( to->y );
@@ -890,54 +976,51 @@
arc[2].x = ras.x;
arc[2].y = ras.y;
- while ( top >= 0 )
+ /* short-cut the arc that crosses the current band */
+ if ( ( TRUNC( arc[0].y ) >= ras.max_ey &&
+ TRUNC( arc[1].y ) >= ras.max_ey &&
+ TRUNC( arc[2].y ) >= ras.max_ey ) ||
+ ( TRUNC( arc[0].y ) < ras.min_ey &&
+ TRUNC( arc[1].y ) < ras.min_ey &&
+ TRUNC( arc[2].y ) < ras.min_ey ) )
{
- level = levels[top];
- if ( level > 1 )
- {
- /* check that the arc crosses the current band */
- TPos min, max, y;
-
-
- min = max = arc[0].y;
-
- y = arc[1].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
+ ras.x = arc[0].x;
+ ras.y = arc[0].y;
+ return;
+ }
- y = arc[2].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
+ dx = QT_FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x );
+ dy = QT_FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y );
+ if ( dx < dy )
+ dx = dy;
- if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
- goto Draw;
+ /* We can calculate the number of necessary bisections because */
+ /* each bisection predictably reduces deviation exactly 4-fold. */
+ /* Even 32-bit deviation would vanish after 16 bisections. */
+ draw = 1;
+ while ( dx > ONE_PIXEL / 4 )
+ {
+ dx >>= 2;
+ draw <<= 1;
+ }
+ /* We use decrement counter to count the total number of segments */
+ /* to draw starting from 2^level. Before each draw we split as */
+ /* many times as there are trailing zeros in the counter. */
+ do
+ {
+ split = 1;
+ while ( ( draw & split ) == 0 )
+ {
gray_split_conic( arc );
arc += 2;
- top++;
- levels[top] = levels[top - 1] = level - 1;
- continue;
+ split <<= 1;
}
- Draw:
- {
- TPos to_x, to_y, mid_x, mid_y;
-
-
- to_x = arc[0].x;
- to_y = arc[0].y;
- mid_x = ( ras.x + to_x + 2 * arc[1].x ) / 4;
- mid_y = ( ras.y + to_y + 2 * arc[1].y ) / 4;
-
- gray_render_line( RAS_VAR_ mid_x, mid_y );
- gray_render_line( RAS_VAR_ to_x, to_y );
-
- top--;
- arc -= 2;
- }
- }
+ gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );
+ arc -= 2;
- return;
+ } while ( --draw );
}
@@ -974,60 +1057,13 @@
const QT_FT_Vector* control2,
const QT_FT_Vector* to )
{
- TPos dx, dy, da, db;
- int top, level;
- int* levels;
- QT_FT_Vector* arc;
+ QT_FT_Vector bez_stack[16 * 3 + 1]; /* enough to accommodate bisections */
+ QT_FT_Vector* arc = bez_stack;
+ TPos dx, dy, dx_, dy_;
+ TPos dx1, dy1, dx2, dy2;
+ TPos L, s, s_limit;
- dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 );
- if ( dx < 0 )
- dx = -dx;
- dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 );
- if ( dy < 0 )
- dy = -dy;
- if ( dx < dy )
- dx = dy;
- da = dx;
-
- dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x );
- if ( dx < 0 )
- dx = -dx;
- dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->y + control2->y );
- if ( dy < 0 )
- dy = -dy;
- if ( dx < dy )
- dx = dy;
- db = dx;
-
- level = 1;
- da = da / ras.cubic_level;
- db = db / ras.conic_level;
- while ( da > 0 || db > 0 )
- {
- da >>= 2;
- db >>= 3;
- level++;
- }
-
- if ( level <= 1 )
- {
- TPos to_x, to_y, mid_x, mid_y;
-
-
- to_x = UPSCALE( to->x );
- to_y = UPSCALE( to->y );
- mid_x = ( ras.x + to_x +
- 3 * UPSCALE( control1->x + control2->x ) ) / 8;
- mid_y = ( ras.y + to_y +
- 3 * UPSCALE( control1->y + control2->y ) ) / 8;
-
- gray_render_line( RAS_VAR_ mid_x, mid_y );
- gray_render_line( RAS_VAR_ to_x, to_y );
- return;
- }
-
- arc = ras.bez_stack;
arc[0].x = UPSCALE( to->x );
arc[0].y = UPSCALE( to->y );
arc[1].x = UPSCALE( control2->x );
@@ -1037,56 +1073,77 @@
arc[3].x = ras.x;
arc[3].y = ras.y;
- levels = ras.lev_stack;
- top = 0;
- levels[0] = level;
+ /* short-cut the arc that crosses the current band */
+ if ( ( TRUNC( arc[0].y ) >= ras.max_ey &&
+ TRUNC( arc[1].y ) >= ras.max_ey &&
+ TRUNC( arc[2].y ) >= ras.max_ey &&
+ TRUNC( arc[3].y ) >= ras.max_ey ) ||
+ ( TRUNC( arc[0].y ) < ras.min_ey &&
+ TRUNC( arc[1].y ) < ras.min_ey &&
+ TRUNC( arc[2].y ) < ras.min_ey &&
+ TRUNC( arc[3].y ) < ras.min_ey ) )
+ {
+ ras.x = arc[0].x;
+ ras.y = arc[0].y;
+ return;
+ }
- while ( top >= 0 )
+ for (;;)
{
- level = levels[top];
- if ( level > 1 )
- {
- /* check that the arc crosses the current band */
- TPos min, max, y;
-
-
- min = max = arc[0].y;
- y = arc[1].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
- y = arc[2].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
- y = arc[3].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
- if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < 0 )
- goto Draw;
- gray_split_cubic( arc );
- arc += 3;
- top ++;
- levels[top] = levels[top - 1] = level - 1;
- continue;
- }
+ /* Decide whether to split or draw. See `Rapid Termination */
+ /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */
+ /* F. Hain, at */
+ /* http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf */
- Draw:
- {
- TPos to_x, to_y, mid_x, mid_y;
+ /* dx and dy are x and y components of the P0-P3 chord vector. */
+ dx = dx_ = arc[3].x - arc[0].x;
+ dy = dy_ = arc[3].y - arc[0].y;
- to_x = arc[0].x;
- to_y = arc[0].y;
- mid_x = ( ras.x + to_x + 3 * ( arc[1].x + arc[2].x ) ) / 8;
- mid_y = ( ras.y + to_y + 3 * ( arc[1].y + arc[2].y ) ) / 8;
+ L = QT_FT_HYPOT( dx_, dy_ );
- gray_render_line( RAS_VAR_ mid_x, mid_y );
- gray_render_line( RAS_VAR_ to_x, to_y );
- top --;
- arc -= 3;
- }
- }
+ /* Avoid possible arithmetic overflow below by splitting. */
+ if ( L > 32767 )
+ goto Split;
+
+ /* Max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1). */
+ s_limit = L * (TPos)( ONE_PIXEL / 6 );
+
+ /* s is L * the perpendicular distance from P1 to the line P0-P3. */
+ dx1 = arc[1].x - arc[0].x;
+ dy1 = arc[1].y - arc[0].y;
+ s = QT_FT_ABS( dy * dx1 - dx * dy1 );
+
+ if ( s > s_limit )
+ goto Split;
+
+ /* s is L * the perpendicular distance from P2 to the line P0-P3. */
+ dx2 = arc[2].x - arc[0].x;
+ dy2 = arc[2].y - arc[0].y;
+ s = QT_FT_ABS( dy * dx2 - dx * dy2 );
+
+ if ( s > s_limit )
+ goto Split;
+
+ /* Split super curvy segments where the off points are so far
+ from the chord that the angles P0-P1-P3 or P0-P2-P3 become
+ acute as detected by appropriate dot products. */
+ if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 ||
+ dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 )
+ goto Split;
- return;
+ gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );
+
+ if ( arc == bez_stack )
+ return;
+
+ arc -= 3;
+ continue;
+
+ Split:
+ gray_split_cubic( arc );
+ arc += 3;
+ }
}
@@ -1099,7 +1156,8 @@
/* record current cell, if any */
- gray_record_cell( worker );
+ if ( !ras.invalid )
+ gray_record_cell( worker );
/* start to a new position */
x = UPSCALE( to->x );
@@ -1107,15 +1165,15 @@
gray_start_cell( worker, TRUNC( x ), TRUNC( y ) );
- worker->x = x;
- worker->y = y;
+ ras.x = x;
+ ras.y = y;
return 0;
}
static void
- gray_render_span( int count,
+ gray_render_span( int count,
const QT_FT_Span* spans,
- PWorker worker )
+ PWorker worker )
{
unsigned char* p;
QT_FT_Bitmap* map = &worker->target;
@@ -1127,34 +1185,30 @@
/* first of all, compute the scanline offset */
p = (unsigned char*)map->buffer - spans->y * map->pitch;
if ( map->pitch >= 0 )
- p += ( map->rows - 1 ) * map->pitch;
+ p += ( map->rows - 1 ) * (unsigned int)map->pitch;
if ( coverage )
{
+ unsigned char* q = p + spans->x;
+
+
/* For small-spans it is faster to do it by ourselves than
* calling `memset'. This is mainly due to the cost of the
* function call.
*/
- if ( spans->len >= 8 )
- QT_FT_MEM_SET( p + spans->x, (unsigned char)coverage, spans->len );
- else
+ switch ( spans->len )
{
- unsigned char* q = p + spans->x;
-
-
- switch ( spans->len )
- {
- case 7: *q++ = (unsigned char)coverage; Q_FALLTHROUGH();
- case 6: *q++ = (unsigned char)coverage; Q_FALLTHROUGH();
- case 5: *q++ = (unsigned char)coverage; Q_FALLTHROUGH();
- case 4: *q++ = (unsigned char)coverage; Q_FALLTHROUGH();
- case 3: *q++ = (unsigned char)coverage; Q_FALLTHROUGH();
- case 2: *q++ = (unsigned char)coverage; Q_FALLTHROUGH();
- case 1: *q = (unsigned char)coverage;
- default:
- ;
- }
+ case 7: *q++ = coverage; Q_FALLTHROUGH();
+ case 6: *q++ = coverage; Q_FALLTHROUGH();
+ case 5: *q++ = coverage; Q_FALLTHROUGH();
+ case 4: *q++ = coverage; Q_FALLTHROUGH();
+ case 3: *q++ = coverage; Q_FALLTHROUGH();
+ case 2: *q++ = coverage; Q_FALLTHROUGH();
+ case 1: *q = coverage; Q_FALLTHROUGH();
+ case 0: break;
+ default:
+ QT_FT_MEM_SET( q, coverage, spans->len );
}
}
}
@@ -1167,9 +1221,7 @@
TPos area,
int acount )
{
- QT_FT_Span* span;
- int coverage;
- int skip;
+ int coverage;
/* compute the coverage line's coverage, depending on the */
@@ -1202,14 +1254,24 @@
x += (TCoord)ras.min_ex;
/* QT_FT_Span.x is a 16-bit short, so limit our coordinates appropriately */
- if ( x >= 32768 )
+ if ( x >= 32767 )
x = 32767;
+ /* QT_FT_Span.y is a 16-bit short, so limit our coordinates appropriately */
+ if ( y >= 32767 )
+ y = 32767;
+
if ( coverage )
{
+ QT_FT_Span* span;
+ int count;
+ int skip;
+
+
/* see whether we can add this span to the current list */
- span = ras.gray_spans + ras.num_gray_spans - 1;
- if ( ras.num_gray_spans > 0 &&
+ count = ras.num_gray_spans;
+ span = ras.gray_spans + count - 1;
+ if ( count > 0 &&
span->y == y &&
(int)span->x + span->len == (int)x &&
span->coverage == coverage )
@@ -1218,9 +1280,9 @@
return;
}
- if ( ras.num_gray_spans >= QT_FT_MAX_GRAY_SPANS )
+ if ( count >= QT_FT_MAX_GRAY_SPANS )
{
- if ( ras.render_span && ras.num_gray_spans > ras.skip_spans )
+ if ( ras.render_span && count > ras.skip_spans )
{
skip = ras.skip_spans > 0 ? ras.skip_spans : 0;
ras.render_span( ras.num_gray_spans - skip,
@@ -1302,6 +1364,8 @@
if ( ras.num_cells == 0 )
return;
+ QT_FT_TRACE7(( "gray_sweep: start\n" ));
+
for ( yindex = 0; yindex < ras.ycount; yindex++ )
{
PCell cell = ras.ycells[yindex];
@@ -1331,6 +1395,8 @@
gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ),
ras.count_ex - x );
}
+
+ QT_FT_TRACE7(( "gray_sweep: end\n" ));
}
/*************************************************************************/
@@ -1364,7 +1430,7 @@
/* */
static
int QT_FT_Outline_Decompose( const QT_FT_Outline* outline,
- void* user )
+ void* user )
{
#undef SCALED
#define SCALED( x ) (x)
@@ -1382,6 +1448,9 @@
int error;
char tag; /* current point's state */
+ if ( !outline )
+ return ErrRaster_Invalid_Outline;
+
first = 0;
for ( n = 0; n < outline->n_contours; n++ )
@@ -1390,16 +1459,17 @@
last = outline->contours[n];
+ if ( last < 0 )
+ goto Invalid_Outline;
limit = outline->points + last;
- v_start = outline->points[first];
- v_last = outline->points[last];
-
+ v_start = outline->points[first];
v_start.x = SCALED( v_start.x );
v_start.y = SCALED( v_start.y );
- v_last.x = SCALED( v_last.x );
- v_last.y = SCALED( v_last.y );
+ v_last = outline->points[last];
+ v_last.x = SCALED( v_last.x );
+ v_last.y = SCALED( v_last.y );
v_control = v_start;
@@ -1435,6 +1505,8 @@
tags--;
}
+ QT_FT_TRACE5(( " move to (%.2f, %.2f)\n",
+ v_start.x / 64.0, v_start.y / 64.0 ));
error = gray_move_to( &v_start, user );
if ( error )
goto Exit;
@@ -1455,6 +1527,8 @@
vec.x = SCALED( point->x );
vec.y = SCALED( point->y );
+ QT_FT_TRACE5(( " line to (%.2f, %.2f)\n",
+ vec.x / 64.0, vec.y / 64.0 ));
gray_render_line(user, UPSCALE(vec.x), UPSCALE(vec.y));
continue;
}
@@ -1480,6 +1554,10 @@
if ( tag == QT_FT_CURVE_TAG_ON )
{
+ QT_FT_TRACE5(( " conic to (%.2f, %.2f)"
+ " with control (%.2f, %.2f)\n",
+ vec.x / 64.0, vec.y / 64.0,
+ v_control.x / 64.0, v_control.y / 64.0 ));
gray_render_conic(user, &v_control, &vec);
continue;
}
@@ -1490,11 +1568,20 @@
v_middle.x = ( v_control.x + vec.x ) / 2;
v_middle.y = ( v_control.y + vec.y ) / 2;
+ QT_FT_TRACE5(( " conic to (%.2f, %.2f)"
+ " with control (%.2f, %.2f)\n",
+ v_middle.x / 64.0, v_middle.y / 64.0,
+ v_control.x / 64.0, v_control.y / 64.0 ));
gray_render_conic(user, &v_control, &v_middle);
+
v_control = vec;
goto Do_Conic;
}
+ QT_FT_TRACE5(( " conic to (%.2f, %.2f)"
+ " with control (%.2f, %.2f)\n",
+ v_start.x / 64.0, v_start.y / 64.0,
+ v_control.x / 64.0, v_control.y / 64.0 ));
gray_render_conic(user, &v_control, &v_start);
goto Close;
}
@@ -1525,10 +1612,20 @@
vec.x = SCALED( point->x );
vec.y = SCALED( point->y );
+ QT_FT_TRACE5(( " cubic to (%.2f, %.2f)"
+ " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
+ vec.x / 64.0, vec.y / 64.0,
+ vec1.x / 64.0, vec1.y / 64.0,
+ vec2.x / 64.0, vec2.y / 64.0 ));
gray_render_cubic(user, &vec1, &vec2, &vec);
continue;
}
+ QT_FT_TRACE5(( " cubic to (%.2f, %.2f)"
+ " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
+ v_start.x / 64.0, v_start.y / 64.0,
+ vec1.x / 64.0, vec1.y / 64.0,
+ vec2.x / 64.0, vec2.y / 64.0 ));
gray_render_cubic(user, &vec1, &vec2, &v_start);
goto Close;
}
@@ -1536,15 +1633,19 @@
}
/* close the contour with a line segment */
+ QT_FT_TRACE5(( " line to (%.2f, %.2f)\n",
+ v_start.x / 64.0, v_start.y / 64.0 ));
gray_render_line(user, UPSCALE(v_start.x), UPSCALE(v_start.y));
Close:
first = last + 1;
}
+ QT_FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
return 0;
Exit:
+ QT_FT_TRACE5(( "FT_Outline_Decompose: Error %d\n", error ));
return error;
Invalid_Outline:
@@ -1557,7 +1658,6 @@
} TBand;
-
static int
gray_convert_glyph_inner( RAS_ARG )
{
@@ -1566,7 +1666,8 @@
if ( qt_ft_setjmp( ras.jump_buffer ) == 0 )
{
error = QT_FT_Outline_Decompose( &ras.outline, &ras );
- gray_record_cell( RAS_VAR );
+ if ( !ras.invalid )
+ gray_record_cell( RAS_VAR );
}
else
{
@@ -1608,29 +1709,12 @@
ras.count_ex = ras.max_ex - ras.min_ex;
ras.count_ey = ras.max_ey - ras.min_ey;
- /* simple heuristic used to speed-up the bezier decomposition -- see */
- /* the code in gray_render_conic() and gray_render_cubic() for more */
- /* details */
- ras.conic_level = 32;
- ras.cubic_level = 16;
-
- {
- int level = 0;
-
-
- if ( ras.count_ex > 24 || ras.count_ey > 24 )
- level++;
- if ( ras.count_ex > 120 || ras.count_ey > 120 )
- level++;
-
- ras.conic_level <<= level;
- ras.cubic_level <<= level;
- }
-
- /* setup vertical bands */
+ /* set up vertical bands */
num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size );
- if ( num_bands == 0 ) num_bands = 1;
- if ( num_bands >= 39 ) num_bands = 39;
+ if ( num_bands == 0 )
+ num_bands = 1;
+ if ( num_bands >= 39 )
+ num_bands = 39;
ras.band_shoot = 0;
@@ -1764,11 +1848,14 @@
if (raster->buffer_allocated_size < MINIMUM_POOL_SIZE )
return ErrRaster_OutOfMemory;
+ if ( !outline )
+ return ErrRaster_Invalid_Outline;
+
/* return immediately if the outline is empty */
if ( outline->n_points == 0 || outline->n_contours <= 0 )
return 0;
- if ( !outline || !outline->contours || !outline->points )
+ if ( !outline->contours || !outline->points )
return ErrRaster_Invalid_Outline;
if ( outline->n_points !=
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index 22ec981134..1c7d6471b6 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -243,6 +243,18 @@ QPagedPaintDevicePrivate *QPagedPaintDevice::dd()
Starts a new page. Returns \c true on success.
*/
+/*!
+ \enum QPagedPaintDevice::PdfVersion
+
+ The PdfVersion enum describes the version of the PDF file that
+ is produced by QPrinter or QPdfWriter.
+
+ \value PdfVersion_1_4 A PDF 1.4 compatible document is produced.
+
+ \value PdfVersion_A1b A PDF/A-1b compatible document is produced.
+
+ \since 5.10
+*/
/*!
Sets the size of the a page to \a size.
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
index c516f6a963..66dd6fa8cf 100644
--- a/src/gui/painting/qpagedpaintdevice.h
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -213,6 +213,8 @@ public:
Envelope10 = Comm10E
};
+ enum PdfVersion { PdfVersion_1_4, PdfVersion_A1b };
+
// ### Qt6 Make these virtual
bool setPageLayout(const QPageLayout &pageLayout);
bool setPageSize(const QPageSize &pageSize);
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index ddea168e72..f42fd4ff87 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -547,8 +547,8 @@ void qt_fill_tile(QPixmap *tile, const QPixmap &pixmap)
}
}
-void qt_draw_tile(QPaintEngine *gc, qreal x, qreal y, qreal w, qreal h,
- const QPixmap &pixmap, qreal xOffset, qreal yOffset)
+Q_GUI_EXPORT void qt_draw_tile(QPaintEngine *gc, qreal x, qreal y, qreal w, qreal h,
+ const QPixmap &pixmap, qreal xOffset, qreal yOffset)
{
qreal yPos, xPos, drawH, drawW, yOff, xOff;
yPos = y;
@@ -929,11 +929,11 @@ QPoint QPaintEngine::coordinateOffset() const
void QPaintEngine::setSystemClip(const QRegion &region)
{
Q_D(QPaintEngine);
- d->systemClip = region;
+ d->baseSystemClip = region;
// Be backward compatible and only call d->systemStateChanged()
// if we currently have a system transform/viewport set.
+ d->updateSystemClip();
if (d->hasSystemTransform || d->hasSystemViewport) {
- d->transformSystemClip();
d->systemStateChanged();
}
}
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index 9d511f9bad..8ac3fcff5c 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -71,6 +71,7 @@ public:
QPaintDevice *pdev;
QPaintEngine *q_ptr;
+ QRegion baseSystemClip;
QRegion systemClip;
QRect systemRect;
QRegion systemViewport;
@@ -79,8 +80,9 @@ public:
uint hasSystemTransform : 1;
uint hasSystemViewport : 1;
- inline void transformSystemClip()
+ inline void updateSystemClip()
{
+ systemClip = baseSystemClip;
if (systemClip.isEmpty())
return;
@@ -104,15 +106,30 @@ public:
inline void setSystemTransform(const QTransform &xform)
{
systemTransform = xform;
- if ((hasSystemTransform = !xform.isIdentity()) || hasSystemViewport)
- transformSystemClip();
- systemStateChanged();
+ hasSystemTransform = !xform.isIdentity();
+ updateSystemClip();
+ if (q_ptr->state)
+ systemStateChanged();
}
inline void setSystemViewport(const QRegion &region)
{
systemViewport = region;
hasSystemViewport = !systemViewport.isEmpty();
+ updateSystemClip();
+ if (q_ptr->state)
+ systemStateChanged();
+ }
+
+ inline void setSystemTransformAndViewport(const QTransform &xform, const QRegion &region)
+ {
+ systemTransform = xform;
+ hasSystemTransform = !xform.isIdentity();
+ systemViewport = region;
+ hasSystemViewport = !systemViewport.isEmpty();
+ updateSystemClip();
+ if (q_ptr->state)
+ systemStateChanged();
}
virtual void systemStateChanged() { }
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index ef58f96fbc..b4f717678d 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -993,7 +993,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
Q_ASSERT(img.depth() >= 8);
- int srcBPL = img.bytesPerLine();
+ qssize_t srcBPL = img.bytesPerLine();
const uchar *srcBits = img.bits();
int srcSize = img.depth() >> 3; // This is the part that is incompatible with lower than 8-bit..
int iw = img.width();
@@ -1042,7 +1042,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
// call the blend function...
int dstSize = rasterBuffer->bytesPerPixel();
- int dstBPL = rasterBuffer->bytesPerLine();
+ qssize_t dstBPL = rasterBuffer->bytesPerLine();
func(rasterBuffer->buffer() + x * dstSize + y * dstBPL, dstBPL,
srcBits, srcBPL,
iw, ih,
@@ -2317,8 +2317,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
clippedSourceRect = clippedSourceRect.intersected(img.rect());
- uint dbpl = d->rasterBuffer->bytesPerLine();
- uint sbpl = img.bytesPerLine();
+ const qssize_t dbpl = d->rasterBuffer->bytesPerLine();
+ const qssize_t sbpl = img.bytesPerLine();
uchar *dst = d->rasterBuffer->buffer();
uint bpp = img.depth() >> 3;
@@ -2827,7 +2827,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
cache->fillInPendingGlyphs();
const QImage &image = cache->image();
- int bpl = image.bytesPerLine();
+ qssize_t bpl = image.bytesPerLine();
int depth = image.depth();
int rightShift = 0;
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index d0b82b3a93..e2e0f821e3 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -457,6 +457,8 @@ public:
int height() const { return m_height; }
int bytesPerLine() const { return bytes_per_line; }
int bytesPerPixel() const { return bytes_per_pixel; }
+ template<typename T>
+ int stride() { return bytes_per_line / sizeof(T); }
uchar *buffer() const { return m_buffer; }
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index b186182c34..667c3b0fb5 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5850,6 +5850,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
if (!d->engine || str.isEmpty() || pen().style() == Qt::NoPen)
return;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (tf & Qt::TextBypassShaping) {
// Skip complex shaping, shape using glyph advances only
int len = str.length();
@@ -5863,6 +5864,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
drawTextItem(p, gf);
return;
}
+#endif
QStackTextEngine engine(str, d->state->font);
engine.option.setTextDirection(d->state->layoutDirection);
@@ -7417,7 +7419,7 @@ void qt_format_text(const QFont &fnt, const QRectF &_r,
if (option->flags() & QTextOption::IncludeTrailingSpaces)
tf |= Qt::TextIncludeTrailingSpaces;
- if (option->tabStop() >= 0 || !option->tabArray().isEmpty())
+ if (option->tabStopDistance() >= 0 || !option->tabArray().isEmpty())
tf |= Qt::TextExpandTabs;
}
@@ -7534,8 +7536,8 @@ start_lengthVariant:
engine.option = *option;
}
- if (engine.option.tabStop() < 0 && tabstops > 0)
- engine.option.setTabStop(tabstops);
+ if (engine.option.tabStopDistance() < 0 && tabstops > 0)
+ engine.option.setTabStopDistance(tabstops);
if (engine.option.tabs().isEmpty() && ta) {
QList<qreal> tabs;
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index afeb198953..2b892159c5 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -42,16 +42,20 @@
#ifndef QT_NO_PDF
#include "qplatformdefs.h"
-#include <qdebug.h>
-#include <qfile.h>
-#include <qtemporaryfile.h>
+
+#include <private/qfont_p.h>
#include <private/qmath_p.h>
#include <private/qpainter_p.h>
-#include <qnumeric.h>
-#include "private/qfont_p.h"
+
+#include <qbuffer.h>
+#include <qcryptographichash.h>
+#include <qdatetime.h>
+#include <qdebug.h>
+#include <qfile.h>
#include <qimagewriter.h>
-#include "qbuffer.h"
-#include "QtCore/qdatetime.h"
+#include <qnumeric.h>
+#include <qtemporaryfile.h>
+#include <quuid.h>
#ifndef QT_NO_COMPRESS
#include <zlib.h>
@@ -79,6 +83,45 @@ inline QPaintEngine::PaintEngineFeatures qt_pdf_decide_features()
return f;
}
+extern bool qt_isExtendedRadialGradient(const QBrush &brush);
+
+// helper function to remove transparency from brush in PDF/A-1b mode
+static void removeTransparencyFromBrush(QBrush &brush)
+{
+ if (brush.style() == Qt::SolidPattern) {
+ QColor color = brush.color();
+ if (color.alpha() != 255) {
+ color.setAlpha(255);
+ brush.setColor(color);
+ }
+
+ return;
+ }
+
+ if (qt_isExtendedRadialGradient(brush)) {
+ brush = QBrush(Qt::black); // the safest we can do so far...
+ return;
+ }
+
+ if (brush.style() == Qt::LinearGradientPattern
+ || brush.style() == Qt::RadialGradientPattern
+ || brush.style() == Qt::ConicalGradientPattern) {
+
+ QGradientStops stops = brush.gradient()->stops();
+ for (int i = 0; i < stops.size(); ++i) {
+ if (stops[i].second.alpha() != 255)
+ stops[i].second.setAlpha(255);
+ }
+
+ const_cast<QGradient*>(brush.gradient())->setStops(stops);
+ return;
+ }
+
+ if (brush.style() == Qt::TexturePattern) {
+ // handled inside QPdfEnginePrivate::addImage() already
+ return;
+ }
+}
/* also adds a space at the end of the number */
@@ -1042,7 +1085,22 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
d->stroker.matrix = state.transform();
if (flags & DirtyPen) {
- d->pen = state.pen();
+ if (d->pdfVersion == QPdfEngine::Version_A1b) {
+ QPen pen = state.pen();
+
+ QColor penColor = pen.color();
+ if (penColor.alpha() != 255)
+ penColor.setAlpha(255);
+ pen.setColor(penColor);
+
+ QBrush penBrush = pen.brush();
+ removeTransparencyFromBrush(penBrush);
+ pen.setBrush(penBrush);
+
+ d->pen = pen;
+ } else {
+ d->pen = state.pen();
+ }
d->hasPen = d->pen.style() != Qt::NoPen;
d->stroker.setPen(d->pen, state.renderHints());
QBrush penBrush = d->pen.brush();
@@ -1054,7 +1112,13 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
d->stroker.setPen(d->pen, state.renderHints());
}
if (flags & DirtyBrush) {
- d->brush = state.brush();
+ if (d->pdfVersion == QPdfEngine::Version_A1b) {
+ QBrush brush = state.brush();
+ removeTransparencyFromBrush(brush);
+ d->brush = brush;
+ } else {
+ d->brush = state.brush();
+ }
if (d->brush.color().alpha() == 0 && d->brush.style() == Qt::SolidPattern)
d->brush.setStyle(Qt::NoBrush);
d->hasBrush = d->brush.style() != Qt::NoBrush;
@@ -1286,6 +1350,12 @@ int QPdfEngine::resolution() const
return d->resolution;
}
+void QPdfEngine::setPdfVersion(PdfVersion version)
+{
+ Q_D(QPdfEngine);
+ d->pdfVersion = version;
+}
+
void QPdfEngine::setPageLayout(const QPageLayout &pageLayout)
{
Q_D(QPdfEngine);
@@ -1364,6 +1434,7 @@ int QPdfEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const
QPdfEnginePrivate::QPdfEnginePrivate()
: clipEnabled(false), allClipped(false), hasPen(true), hasBrush(false), simplePen(false),
+ pdfVersion(QPdfEngine::Version_1_4),
outDevice(0), ownsDevice(false),
embedFonts(true),
grayscale(false),
@@ -1465,16 +1536,38 @@ void QPdfEnginePrivate::writeHeader()
addXrefEntry(0,false);
xprintf("%%PDF-1.4\n");
+ xprintf("%%\303\242\303\243\n");
writeInfo();
+ int metaDataObj = -1;
+ int outputIntentObj = -1;
+ if (pdfVersion == QPdfEngine::Version_A1b) {
+ metaDataObj = writeXmpMetaData();
+ outputIntentObj = writeOutputIntent();
+ }
+
catalog = addXrefEntry(-1);
pageRoot = requestObject();
- xprintf("<<\n"
- "/Type /Catalog\n"
- "/Pages %d 0 R\n"
- ">>\n"
- "endobj\n", pageRoot);
+
+ // catalog
+ {
+ QByteArray catalog;
+ QPdf::ByteStream s(&catalog);
+ s << "<<\n"
+ << "/Type /Catalog\n"
+ << "/Pages " << pageRoot << "0 R\n";
+
+ if (pdfVersion == QPdfEngine::Version_A1b) {
+ s << "/OutputIntents [" << outputIntentObj << "0 R]\n";
+ s << "/Metadata " << metaDataObj << "0 R\n";
+ }
+
+ s << ">>\n"
+ << "endobj\n";
+
+ write(catalog);
+ }
// graphics state
graphicsState = addXrefEntry(-1);
@@ -1527,6 +1620,95 @@ void QPdfEnginePrivate::writeInfo()
"endobj\n");
}
+int QPdfEnginePrivate::writeXmpMetaData()
+{
+ const int metaDataObj = addXrefEntry(-1);
+
+ const QString producer(QString::fromLatin1("Qt " QT_VERSION_STR));
+
+ 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 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);
+ else if (offset > 0)
+ tzStr.sprintf("+%02d:%02d", hours , mins);
+ else
+ tzStr = QLatin1String("Z");
+
+ const QString metaDataDate = timeStr + tzStr;
+
+ QFile metaDataFile(QLatin1String(":/qpdf/qpdfa_metadata.xml"));
+ metaDataFile.open(QIODevice::ReadOnly);
+ const QByteArray metaDataContent = QString::fromUtf8(metaDataFile.readAll()).arg(producer.toHtmlEscaped(),
+ title.toHtmlEscaped(),
+ creator.toHtmlEscaped(),
+ metaDataDate).toUtf8();
+ xprintf("<<\n"
+ "/Type /Metadata /Subtype /XML\n"
+ "/Length %d\n"
+ ">>\n"
+ "stream\n", metaDataContent.size());
+ write(metaDataContent);
+ xprintf("\nendstream\n"
+ "endobj\n");
+
+ return metaDataObj;
+}
+
+int QPdfEnginePrivate::writeOutputIntent()
+{
+ const int colorProfile = addXrefEntry(-1);
+ {
+ QFile colorProfileFile(QLatin1String(":/qpdf/sRGB2014.icc"));
+ colorProfileFile.open(QIODevice::ReadOnly);
+ const QByteArray colorProfileData = colorProfileFile.readAll();
+
+ QByteArray data;
+ QPdf::ByteStream s(&data);
+ int length_object = requestObject();
+
+ s << "<<\n";
+ s << "/N 3\n";
+ s << "/Alternate /DeviceRGB\n";
+ s << "/Length " << length_object << "0 R\n";
+ s << "/Filter /FlateDecode\n";
+ s << ">>\n";
+ s << "stream\n";
+ write(data);
+ const int len = writeCompressed(colorProfileData);
+ write("\nendstream\n"
+ "endobj\n");
+ addXrefEntry(length_object);
+ xprintf("%d\n"
+ "endobj\n", len);
+ }
+
+ const int outputIntent = addXrefEntry(-1);
+ {
+ xprintf("<<\n");
+ xprintf("/Type /OutputIntent\n");
+ xprintf("/S/GTS_PDFA1\n");
+ xprintf("/OutputConditionIdentifier (sRGB_IEC61966-2-1_black_scaled)\n");
+ xprintf("/DestOutputProfile %d 0 R\n", colorProfile);
+ xprintf("/Info(sRGB IEC61966 v2.1 with black scaling)\n");
+ xprintf("/RegistryName(http://www.color.org)\n");
+ xprintf(">>\n");
+ xprintf("endobj\n");
+ }
+
+ return outputIntent;
+}
+
void QPdfEnginePrivate::writePageRoot()
{
addXrefEntry(pageRoot);
@@ -1568,6 +1750,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
int fontstream = requestObject();
int cidfont = requestObject();
int toUnicode = requestObject();
+ int cidset = requestObject();
QFontEngine::Properties properties = font->fontEngine->properties();
QByteArray postscriptName = properties.postscriptName.replace(' ', '_');
@@ -1597,7 +1780,8 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
"/CapHeight " << properties.capHeight.toReal()*scale << "\n"
"/StemV " << properties.lineWidth.toReal()*scale << "\n"
"/FontFile2 " << fontstream << "0 R\n"
- ">> endobj\n";
+ "/CIDSet " << cidset << "0 R\n"
+ ">>\nendobj\n";
write(descriptor);
}
{
@@ -1615,7 +1799,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
"stream\n";
write(header);
int len = writeCompressed(fontData);
- write("endstream\n"
+ write("\nendstream\n"
"endobj\n");
addXrefEntry(length_object);
xprintf("%d\n"
@@ -1642,7 +1826,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
xprintf("<< /Length %d >>\n"
"stream\n", touc.length());
write(touc);
- write("endstream\n"
+ write("\nendstream\n"
"endobj\n");
}
{
@@ -1659,6 +1843,29 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
"endobj\n";
write(font);
}
+ {
+ QByteArray cidSetStream(font->nGlyphs() / 8 + 1, 0);
+ int byteCounter = 0;
+ int bitCounter = 0;
+ for (int i = 0; i < font->nGlyphs(); ++i) {
+ cidSetStream.data()[byteCounter] |= (1 << (7 - bitCounter));
+
+ bitCounter++;
+ if (bitCounter == 8) {
+ bitCounter = 0;
+ byteCounter++;
+ }
+ }
+
+ addXrefEntry(cidset);
+ xprintf("<<\n");
+ xprintf("/Length %d\n", cidSetStream.size());
+ xprintf(">>\n");
+ xprintf("stream\n");
+ write(cidSetStream);
+ xprintf("\nendstream\n");
+ xprintf("endobj\n");
+ }
}
@@ -1748,7 +1955,7 @@ void QPdfEnginePrivate::writePage()
xprintf("stream\n");
QIODevice *content = currentPage->stream();
int len = writeCompressed(content);
- xprintf("endstream\n"
+ xprintf("\nendstream\n"
"endobj\n");
addXrefEntry(pageStreamLength);
@@ -1768,15 +1975,28 @@ void QPdfEnginePrivate::writeTail()
for (int i = 1; i < xrefPositions.size()-1; ++i)
xprintf("%010d 00000 n \n", xrefPositions[i]);
- xprintf("trailer\n"
- "<<\n"
- "/Size %d\n"
- "/Info %d 0 R\n"
- "/Root %d 0 R\n"
- ">>\n"
- "startxref\n%d\n"
- "%%%%EOF\n",
- xrefPositions.size()-1, info, catalog, xrefPositions.constLast());
+ {
+ QByteArray trailer;
+ QPdf::ByteStream s(&trailer);
+
+ s << "trailer\n"
+ << "<<\n"
+ << "/Size " << xrefPositions.size() - 1 << "\n"
+ << "/Info " << info << "0 R\n"
+ << "/Root " << catalog << "0 R\n";
+
+ if (pdfVersion == QPdfEngine::Version_A1b) {
+ const QString uniqueId = QUuid::createUuid().toString();
+ const QByteArray fileIdentifier = QCryptographicHash::hash(uniqueId.toLatin1(), QCryptographicHash::Md5).toHex();
+ s << "/ID [ <" << fileIdentifier << "> <" << fileIdentifier << "> ]\n";
+ }
+
+ s << ">>\n"
+ << "startxref\n" << xrefPositions.constLast() << "\n"
+ << "%%EOF\n";
+
+ write(trailer);
+ }
}
int QPdfEnginePrivate::addXrefEntry(int object, bool printostr)
@@ -1794,7 +2014,13 @@ int QPdfEnginePrivate::addXrefEntry(int object, bool printostr)
return object;
}
-void QPdfEnginePrivate::printString(const QString &string) {
+void QPdfEnginePrivate::printString(const QString &string)
+{
+ if (string.isEmpty()) {
+ write("()");
+ return;
+ }
+
// The 'text string' type in PDF is encoded either as PDFDocEncoding, or
// Unicode UTF-16 with a Unicode byte order mark as the first character
// (0xfeff), with the high-order byte first.
@@ -1976,7 +2202,7 @@ int QPdfEnginePrivate::writeImage(const QByteArray &data, int width, int height,
xprintf(">>\nstream\n");
len = writeCompressed(data);
}
- xprintf("endstream\n"
+ xprintf("\nendstream\n"
"endobj\n");
addXrefEntry(lenobj);
xprintf("%d\n"
@@ -2303,7 +2529,7 @@ int QPdfEnginePrivate::gradientBrush(const QBrush &b, const QTransform &matrix,
">>\n"
"stream\n"
<< content
- << "endstream\n"
+ << "\nendstream\n"
"endobj\n";
int softMaskFormObject = addXrefEntry(-1);
@@ -2412,7 +2638,7 @@ int QPdfEnginePrivate::addBrushPattern(const QTransform &m, bool *specifyColor,
">>\n"
"stream\n"
<< pattern
- << "endstream\n"
+ << "\nendstream\n"
"endobj\n";
int patternObj = addXrefEntry(-1);
@@ -2443,6 +2669,23 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n
QImage image = img;
QImage::Format format = image.format();
+
+ if (pdfVersion == QPdfEngine::Version_A1b) {
+ if (image.hasAlphaChannel()) {
+ // transparent images are not allowed in PDF/A-1b, so we convert it to
+ // a format without alpha channel first
+
+ QImage alphaLessImage(image.width(), image.height(), QImage::Format_RGB32);
+ alphaLessImage.fill(Qt::white);
+
+ QPainter p(&alphaLessImage);
+ p.drawImage(0, 0, image);
+
+ image = alphaLessImage;
+ format = image.format();
+ }
+ }
+
if (image.depth() == 1 && *bitmap && is_monochrome(img.colorTable())) {
if (format == QImage::Format_MonoLSB)
image = image.convertToFormat(QImage::Format_Mono);
diff --git a/src/gui/painting/qpdf.qrc b/src/gui/painting/qpdf.qrc
new file mode 100644
index 0000000000..56359c775b
--- /dev/null
+++ b/src/gui/painting/qpdf.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <qresource prefix="qpdf/">
+ <file>qpdfa_metadata.xml</file>
+ <file alias="sRGB2014.icc">../../3rdparty/icc/sRGB2014.icc</file>
+ </qresource>
+</RCC>
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index a6aa2940c8..f5bb4e17a8 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -168,6 +168,12 @@ class Q_GUI_EXPORT QPdfEngine : public QPaintEngine
Q_DECLARE_PRIVATE(QPdfEngine)
friend class QPdfWriter;
public:
+ enum PdfVersion
+ {
+ Version_1_4,
+ Version_A1b
+ };
+
QPdfEngine();
QPdfEngine(QPdfEnginePrivate &d);
~QPdfEngine() {}
@@ -177,6 +183,8 @@ public:
void setResolution(int resolution);
int resolution() const;
+ void setPdfVersion(PdfVersion version);
+
// reimplementations QPaintEngine
bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
bool end() Q_DECL_OVERRIDE;
@@ -258,6 +266,7 @@ public:
bool hasBrush;
bool simplePen;
qreal opacity;
+ QPdfEngine::PdfVersion pdfVersion;
QHash<QFontEngine::FaceId, QFontSubset *> fonts;
@@ -286,6 +295,8 @@ private:
int createShadingFunction(const QGradient *gradient, int from, int to, bool reflect, bool alpha);
void writeInfo();
+ int writeXmpMetaData();
+ int writeOutputIntent();
void writePageRoot();
void writeFonts();
void embedFont(QFontSubset *font);
diff --git a/src/gui/painting/qpdfa_metadata.xml b/src/gui/painting/qpdfa_metadata.xml
new file mode 100644
index 0000000000..5e5c57f1c6
--- /dev/null
+++ b/src/gui/painting/qpdfa_metadata.xml
@@ -0,0 +1,16 @@
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default">%2</rdf:li>
+ </rdf:Alt>
+ </dc:title>
+ </rdf:Description>
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="" xmp:CreatorTool="%3" xmp:CreateDate="%4" xmp:ModifyDate="%4"/>
+ <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="" pdf:Producer="%1"/>
+ <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" rdf:about="" pdfaid:part="1" pdfaid:conformance="B"/>
+ </rdf:RDF>
+</x:xmpmeta>
+<?xpacket end='w'?>
diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp
index edf2950a67..5af465edeb 100644
--- a/src/gui/painting/qpdfwriter.cpp
+++ b/src/gui/painting/qpdfwriter.cpp
@@ -56,6 +56,7 @@ public:
{
engine = new QPdfEngine();
output = 0;
+ pdfVersion = QPdfWriter::PdfVersion_1_4;
}
~QPdfWriterPrivate()
{
@@ -65,6 +66,7 @@ public:
QPdfEngine *engine;
QFile *output;
+ QPdfWriter::PdfVersion pdfVersion;
};
class QPdfPagedPaintDevicePrivate : public QPagedPaintDevicePrivate
@@ -177,6 +179,35 @@ QPdfWriter::~QPdfWriter()
}
/*!
+ \since 5.10
+
+ Sets the PDF version for this writer to \a version.
+
+ If \a version is the same value as currently set then no change will be made.
+*/
+void QPdfWriter::setPdfVersion(PdfVersion version)
+{
+ Q_D(QPdfWriter);
+
+ if (d->pdfVersion == version)
+ return;
+
+ d->pdfVersion = version;
+ d->engine->setPdfVersion(d->pdfVersion == QPdfWriter::PdfVersion_1_4 ? QPdfEngine::Version_1_4 : QPdfEngine::Version_A1b);
+}
+
+/*!
+ \since 5.10
+
+ Returns the PDF version for this writer. The default is \c PdfVersion_1_4.
+*/
+QPdfWriter::PdfVersion QPdfWriter::pdfVersion() const
+{
+ Q_D(const QPdfWriter);
+ return d->pdfVersion;
+}
+
+/*!
Returns the title of the document.
*/
QString QPdfWriter::title() const
diff --git a/src/gui/painting/qpdfwriter.h b/src/gui/painting/qpdfwriter.h
index 17c73dd480..b260805b2b 100644
--- a/src/gui/painting/qpdfwriter.h
+++ b/src/gui/painting/qpdfwriter.h
@@ -61,6 +61,9 @@ public:
explicit QPdfWriter(QIODevice *device);
~QPdfWriter();
+ void setPdfVersion(PdfVersion version);
+ PdfVersion pdfVersion() const;
+
QString title() const;
void setTitle(const QString &title);
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 8215255cf5..6cb115afba 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -70,6 +70,13 @@
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#endif
+#ifndef GL_FRAMEBUFFER_SRB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+#ifndef GL_FRAMEBUFFER_SRGB_CAPABLE
+#define GL_FRAMEBUFFER_SRGB_CAPABLE 0x8DBA
+#endif
+
QT_BEGIN_NAMESPACE
class QPlatformBackingStorePrivate
@@ -227,17 +234,6 @@ void QPlatformTextureList::clear()
windows.
*/
-/*!
- \fn void QPlatformBackingStore::flush(QWindow *window, const QRegion &region,
- const QPoint &offset)
-
- Flushes the given \a region from the specified \a window onto the
- screen.
-
- The \a offset parameter is relative to the origin of the backing
- store image.
-*/
-
#ifndef QT_NO_OPENGL
static inline QRect deviceRect(const QRect &rect, QWindow *window)
@@ -274,7 +270,7 @@ static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight)
}
static void blitTextureForWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect,
- QOpenGLTextureBlitter *blitter, const QPoint &offset)
+ QOpenGLTextureBlitter *blitter, const QPoint &offset, bool canUseSrgb)
{
const QRect clipRect = textures->clipRect(idx);
if (clipRect.isEmpty())
@@ -294,7 +290,15 @@ static void blitTextureForWidget(const QPlatformTextureList *textures, int idx,
deviceRect(rectInWindow, window).size(),
QOpenGLTextureBlitter::OriginBottomLeft);
+ QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
+ const bool srgb = textures->flags(idx).testFlag(QPlatformTextureList::TextureIsSrgb);
+ if (srgb && canUseSrgb)
+ funcs->glEnable(GL_FRAMEBUFFER_SRGB);
+
blitter->blit(textures->textureId(idx), target, source);
+
+ if (srgb && canUseSrgb)
+ funcs->glDisable(GL_FRAMEBUFFER_SRGB);
}
/*!
@@ -340,10 +344,23 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
const QRect deviceWindowRect = deviceRect(QRect(QPoint(), window->size()), window);
const QPoint deviceWindowOffset = deviceOffset(offset, window);
+ bool canUseSrgb = false;
+ // If there are any sRGB textures in the list, check if the destination
+ // framebuffer is sRGB capable.
+ for (int i = 0; i < textures->count(); ++i) {
+ if (textures->flags(i).testFlag(QPlatformTextureList::TextureIsSrgb)) {
+ GLint cap = 0;
+ funcs->glGetIntegerv(GL_FRAMEBUFFER_SRGB_CAPABLE, &cap);
+ if (cap)
+ canUseSrgb = true;
+ break;
+ }
+ }
+
// Textures for renderToTexture widgets.
for (int i = 0; i < textures->count(); ++i) {
if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))
- blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
+ blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset, canUseSrgb);
}
// Backingstore texture with the normal widgets.
@@ -412,7 +429,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
// Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set.
for (int i = 0; i < textures->count(); ++i) {
if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))
- blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
+ blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset, canUseSrgb);
}
funcs->glDisable(GL_BLEND);
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index ec56aaa002..9956c032a9 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -78,7 +78,8 @@ class Q_GUI_EXPORT QPlatformTextureList : public QObject
Q_DECLARE_PRIVATE(QPlatformTextureList)
public:
enum Flag {
- StacksOnTop = 0x01
+ StacksOnTop = 0x01,
+ TextureIsSrgb = 0x02
};
Q_DECLARE_FLAGS(Flags, Flag)
@@ -116,8 +117,6 @@ public:
virtual QPaintDevice *paintDevice() = 0;
- // 'window' can be a child window, in which case 'region' is in child window coordinates and
- // offset is the (child) window's offset in relation to the window surface.
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset) = 0;
#ifndef QT_NO_OPENGL
virtual void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp
index 126b752811..3bf6004fcc 100644
--- a/src/gui/painting/qpolygon.cpp
+++ b/src/gui/painting/qpolygon.cpp
@@ -909,6 +909,8 @@ QPolygon QPolygon::united(const QPolygon &r) const
Set operations on polygons will treat the polygons as
areas. Non-closed polygons will be treated as implicitly closed.
+
+ \sa intersects()
*/
QPolygon QPolygon::intersected(const QPolygon &r) const
@@ -938,6 +940,26 @@ QPolygon QPolygon::subtracted(const QPolygon &r) const
}
/*!
+ \since 5.10
+
+ Returns \c true if the current polygon intersects at any point the given polygon \a p.
+ Also returns \c true if the current polygon contains or is contained by any part of \a p.
+
+ Set operations on polygons will treat the polygons as
+ areas. Non-closed polygons will be treated as implicitly closed.
+
+ \sa intersected()
+*/
+
+bool QPolygon::intersects(const QPolygon &p) const
+{
+ QPainterPath subject; subject.addPolygon(*this);
+ QPainterPath clip; clip.addPolygon(p);
+
+ return subject.intersects(clip);
+}
+
+/*!
\since 4.3
Returns a polygon which is the union of this polygon and \a r.
@@ -964,6 +986,7 @@ QPolygonF QPolygonF::united(const QPolygonF &r) const
Set operations on polygons will treat the polygons as
areas. Non-closed polygons will be treated as implicitly closed.
+ \sa intersects()
*/
QPolygonF QPolygonF::intersected(const QPolygonF &r) const
@@ -992,6 +1015,26 @@ QPolygonF QPolygonF::subtracted(const QPolygonF &r) const
}
/*!
+ \since 5.10
+
+ Returns \c true if the current polygon intersects at any point the given polygon \a p.
+ Also returns \c true if the current polygon contains or is contained by any part of \a p.
+
+ Set operations on polygons will treat the polygons as
+ areas. Non-closed polygons will be treated as implicitly closed.
+
+ \sa intersected()
+*/
+
+bool QPolygonF::intersects(const QPolygonF &p) const
+{
+ QPainterPath subject; subject.addPolygon(*this);
+ QPainterPath clip; clip.addPolygon(p);
+
+ return subject.intersects(clip);
+}
+
+/*!
Returns the polygon as a QVariant.
*/
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index f192e8d10b..8e74a499fd 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -98,6 +98,8 @@ public:
Q_REQUIRED_RESULT QPolygon united(const QPolygon &r) const;
Q_REQUIRED_RESULT QPolygon intersected(const QPolygon &r) const;
Q_REQUIRED_RESULT QPolygon subtracted(const QPolygon &r) const;
+
+ bool intersects(const QPolygon &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygon)
@@ -175,6 +177,8 @@ public:
Q_REQUIRED_RESULT QPolygonF united(const QPolygonF &r) const;
Q_REQUIRED_RESULT QPolygonF intersected(const QPolygonF &r) const;
Q_REQUIRED_RESULT QPolygonF subtracted(const QPolygonF &r) const;
+
+ bool intersects(const QPolygonF &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygonF)
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp
index 064c2aca7f..af13b96c32 100644
--- a/src/gui/text/qdistancefield.cpp
+++ b/src/gui/text/qdistancefield.cpp
@@ -436,7 +436,7 @@ static void drawPolygons(qint32 *bits, int width, int height, const QPoint *vert
const quint32 *indices, int indexCount, qint32 value)
{
Q_ASSERT(indexCount != 0);
- typedef QVarLengthArray<quint8, 16> ScanLine;
+ typedef QVarLengthArray<quint16, 16> ScanLine;
QVarLengthArray<ScanLine, 128> scans(height);
int first = 0;
for (int i = 1; i < indexCount; ++i) {
@@ -461,16 +461,16 @@ static void drawPolygons(qint32 *bits, int width, int height, const QPoint *vert
for (int y = fromY; y < toY; ++y) {
quint32 c = quint32(x >> 8);
if (c < quint32(width))
- scans[y].append(quint8(c));
+ scans[y].append(quint16(c));
x += dx;
}
}
for (int i = 0; i < height; ++i) {
- quint8 *scanline = scans[i].data();
+ quint16 *scanline = scans[i].data();
int size = scans[i].size();
for (int j = 1; j < size; ++j) {
int k = j;
- quint8 value = scanline[k];
+ quint16 value = scanline[k];
for (; k != 0 && value < scanline[k - 1]; --k)
scanline[k] = scanline[k - 1];
scanline[k] = value;
@@ -478,7 +478,7 @@ static void drawPolygons(qint32 *bits, int width, int height, const QPoint *vert
qint32 *line = bits + i * width;
int j = 0;
for (; j + 1 < size; j += 2) {
- for (quint8 x = scanline[j]; x < scanline[j + 1]; ++x)
+ for (quint16 x = scanline[j]; x < scanline[j + 1]; ++x)
line[x] = value;
}
if (j < size) {
@@ -516,7 +516,7 @@ static void makeDistanceField(QDistanceFieldData *data, const QPainterPath &path
for (int i = 0; i < imgWidth * imgHeight; ++i)
bits[i] = exteriorColor;
- const qreal angleStep = qreal(15 * 3.141592653589793238 / 180);
+ const qreal angleStep = qDegreesToRadians(qreal(15));
const QPoint rotation(qRound(qCos(angleStep) * 0x4000),
qRound(qSin(angleStep) * 0x4000)); // 2:14 signed
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 7f3ed3adaa..f0a5053196 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1312,6 +1312,11 @@ QFont::StyleHint QFont::styleHint() const
looking font that contains the character. The NoFontMerging flag disables this feature.
Please note that enabling this flag will not prevent Qt from automatically picking a
suitable font when the selected font does not support the writing system of the text.
+ \value PreferNoShaping Sometimes, a font will apply complex rules to a set of characters in
+ order to display them correctly. In some writing systems, such as Brahmic scripts, this is
+ required in order for the text to be legible, but in e.g. Latin script, it is merely
+ a cosmetic feature. The PreferNoShaping flag will disable all such features when they
+ are not required, which will improve performance in most cases.
Any of these may be OR-ed with one of these flags:
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 6f0dd27fbe..9c250c82c3 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -68,6 +68,7 @@ public:
Monospace,
Fantasy
};
+ Q_ENUM(StyleHint)
enum StyleStrategy {
PreferDefault = 0x0001,
@@ -82,6 +83,7 @@ public:
OpenGLCompatible = 0x0200,
ForceIntegerMetrics = 0x0400,
NoSubpixelAntialias = 0x0800,
+ PreferNoShaping = 0x1000,
NoFontMerging = 0x8000
};
Q_ENUM(StyleStrategy)
@@ -92,6 +94,7 @@ public:
PreferVerticalHinting = 2,
PreferFullHinting = 3
};
+ Q_ENUM(HintingPreference)
// Mapping OpenType weight value.
enum Weight {
@@ -105,12 +108,14 @@ public:
ExtraBold = 81, // 800
Black = 87 // 900
};
+ Q_ENUM(Weight)
enum Style {
StyleNormal,
StyleItalic,
StyleOblique
};
+ Q_ENUM(Style)
enum Stretch {
AnyStretch = 0,
@@ -124,6 +129,7 @@ public:
ExtraExpanded = 150,
UltraExpanded = 200
};
+ Q_ENUM(Stretch)
enum Capitalization {
MixedCase,
@@ -132,11 +138,13 @@ public:
SmallCaps,
Capitalize
};
+ Q_ENUM(Capitalization)
enum SpacingType {
PercentageSpacing,
AbsoluteSpacing
};
+ Q_ENUM(SpacingType)
enum ResolveProperties {
FamilyResolved = 0x0001,
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 596c79fd05..e4f9b8b9d4 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -359,10 +359,8 @@ bool QFontEngine::supportsScript(QChar::Script script) const
// ### TODO: This only works for scripts that require OpenType. More generally
// for scripts that do not require OpenType we should just look at the list of
// supported writing systems in the font's OS/2 table.
- if (!((script >= QChar::Script_Syriac && script <= QChar::Script_Sinhala)
- || script == QChar::Script_Khmer || script == QChar::Script_Nko)) {
+ if (!scriptRequiresOpenType(script))
return true;
- }
#if QT_CONFIG(harfbuzz)
if (qt_useHarfbuzzNG()) {
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 514e9424b2..1ae2e86a93 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -242,6 +242,12 @@ public:
void *harfbuzzFace() const;
bool supportsScript(QChar::Script script) const;
+ inline static bool scriptRequiresOpenType(QChar::Script script)
+ {
+ return ((script >= QChar::Script_Syriac && script <= QChar::Script_Sinhala)
+ || script == QChar::Script_Khmer || script == QChar::Script_Nko);
+ }
+
virtual int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints);
void clearGlyphCache(const void *key);
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 8067969f56..5675d6921d 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -541,6 +541,7 @@ int QFontMetrics::width(const QString &text, int len, int flags) const
if (len == 0)
return 0;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (flags & Qt::TextBypassShaping) {
// Skip complex shaping, only use advances
int numGlyphs = len;
@@ -554,6 +555,7 @@ int QFontMetrics::width(const QString &text, int len, int flags) const
width += glyphs.advances[i];
return qRound(width);
}
+#endif
QStackTextEngine layout(text, QFont(d.data()));
return qRound(layout.width(0, len));
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index 92eeaf7919..f5fc562e13 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -136,7 +136,7 @@ QByteArray QFontSubset::widthArray() const
QByteArray width;
QPdf::ByteStream s(&width);
- QFixed scale = QFixed(1000)/emSquare;
+ const qreal scale = 1000.0/emSquare.toInt();
QFixed defWidth = widths[0];
//qDebug("defWidth=%d, scale=%f", defWidth.toInt(), scale.toReal());
@@ -145,7 +145,7 @@ QByteArray QFontSubset::widthArray() const
defWidth = 0;
}
if (defWidth > 0) {
- s << "/DW " << (defWidth*scale).toInt();
+ s << "/DW " << qRound(defWidth.toInt() * scale);
} else {
s << "/W [";
for (int g = 0; g < nGlyphs();) {
@@ -174,11 +174,11 @@ QByteArray QFontSubset::widthArray() const
if (endnonlinear > start) {
s << start << '[';
for (int i = start; i < endnonlinear; ++i)
- s << (widths[i]*scale).toInt();
+ s << qRound(widths[i].toInt() * scale);
s << "]\n";
}
if (startLinear)
- s << startLinear << g - 1 << (widths[startLinear]*scale).toInt() << '\n';
+ s << startLinear << g - 1 << qRound(widths[startLinear].toInt() * scale) << '\n';
}
s << "]\n";
}
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index 00dfccc144..e6a196d865 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -62,7 +62,7 @@ public:
};
QStaticText();
- QStaticText(const QString &text);
+ 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; }
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index f8215f92e9..db0650d154 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -71,7 +71,7 @@
QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT unsigned int qt_int_sqrt(unsigned int n);
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION unsigned int qt_int_sqrt(unsigned int n);
/*!
Returns \c true if the string \a text is likely to be rich text;
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 7341fa8e83..66e038122c 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -203,7 +203,7 @@ QTextDocumentPrivate::QTextDocumentPrivate()
inContentsChange = false;
blockCursorAdjustment = false;
- defaultTextOption.setTabStop(80); // same as in qtextengine.cpp
+ defaultTextOption.setTabStopDistance(80); // same as in qtextengine.cpp
defaultTextOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
defaultCursorMoveStyle = Qt::LogicalMoveStyle;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 4d24fb50af..faddb3552d 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1005,20 +1005,53 @@ void QTextEngine::shapeText(int item) const
QFontEngine *fontEngine = this->fontEngine(si, &si.ascent, &si.descent, &si.leading);
+ bool kerningEnabled;
+ bool letterSpacingIsAbsolute;
+ bool shapingEnabled;
+ QFixed letterSpacing, wordSpacing;
+#ifndef QT_NO_RAWFONT
+ if (useRawFont) {
+ QTextCharFormat f = format(&si);
+ kerningEnabled = f.fontKerning();
+ shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script))
+ || (f.fontStyleStrategy() & QFont::PreferNoShaping) == 0;
+ wordSpacing = QFixed::fromReal(f.fontWordSpacing());
+ letterSpacing = QFixed::fromReal(f.fontLetterSpacing());
+ letterSpacingIsAbsolute = true;
+ } else
+#endif
+ {
+ QFont font = this->font(si);
+ kerningEnabled = font.d->kerning;
+ shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script))
+ || (font.d->request.styleStrategy & QFont::PreferNoShaping) == 0;
+ letterSpacingIsAbsolute = font.d->letterSpacingIsAbsolute;
+ letterSpacing = font.d->letterSpacing;
+ wordSpacing = font.d->wordSpacing;
+
+ if (letterSpacingIsAbsolute && letterSpacing.value())
+ letterSpacing *= font.d->dpi / qt_defaultDpiY();
+ }
+
// split up the item into parts that come from different font engines
// k * 3 entries, array[k] == index in string, array[k + 1] == index in glyphs, array[k + 2] == engine index
QVector<uint> itemBoundaries;
itemBoundaries.reserve(24);
- if (fontEngine->type() == QFontEngine::Multi) {
+
+ QGlyphLayout initialGlyphs = availableGlyphs(&si);
+ int nGlyphs = initialGlyphs.numGlyphs;
+ if (fontEngine->type() == QFontEngine::Multi || !shapingEnabled) {
// ask the font engine to find out which glyphs (as an index in the specific font)
// to use for the text in one item.
- QGlyphLayout initialGlyphs = availableGlyphs(&si);
-
- int nGlyphs = initialGlyphs.numGlyphs;
- QFontEngine::ShaperFlags shaperFlags(QFontEngine::GlyphIndicesOnly);
+ QFontEngine::ShaperFlags shaperFlags =
+ shapingEnabled
+ ? QFontEngine::GlyphIndicesOnly
+ : QFontEngine::ShaperFlag(0);
if (!fontEngine->stringToCMap(reinterpret_cast<const QChar *>(string), itemLength, &initialGlyphs, &nGlyphs, shaperFlags))
Q_UNREACHABLE();
+ }
+ if (fontEngine->type() == QFontEngine::Multi) {
uint lastEngine = ~0u;
for (int i = 0, glyph_pos = 0; i < itemLength; ++i, ++glyph_pos) {
const uint engineIdx = initialGlyphs.glyphs[glyph_pos] >> 24;
@@ -1046,35 +1079,29 @@ void QTextEngine::shapeText(int item) const
itemBoundaries.append(0);
}
- bool kerningEnabled;
- bool letterSpacingIsAbsolute;
- QFixed letterSpacing, wordSpacing;
-#ifndef QT_NO_RAWFONT
- if (useRawFont) {
- QTextCharFormat f = format(&si);
- kerningEnabled = f.fontKerning();
- wordSpacing = QFixed::fromReal(f.fontWordSpacing());
- letterSpacing = QFixed::fromReal(f.fontLetterSpacing());
- letterSpacingIsAbsolute = true;
- } else
-#endif
- {
- QFont font = this->font(si);
- kerningEnabled = font.d->kerning;
- letterSpacingIsAbsolute = font.d->letterSpacingIsAbsolute;
- letterSpacing = font.d->letterSpacing;
- wordSpacing = font.d->wordSpacing;
+ if (Q_UNLIKELY(!shapingEnabled)) {
+ ushort *log_clusters = logClusters(&si);
- if (letterSpacingIsAbsolute && letterSpacing.value())
- letterSpacing *= font.d->dpi / qt_defaultDpiY();
- }
+ int glyph_pos = 0;
+ for (int i = 0; i < itemLength; ++i, ++glyph_pos) {
+ log_clusters[i] = glyph_pos;
+ initialGlyphs.attributes[glyph_pos].clusterStart = true;
+ if (QChar::isHighSurrogate(string[i])
+ && i + 1 < itemLength
+ && QChar::isLowSurrogate(string[i + 1])) {
+ ++i;
+ log_clusters[i] = glyph_pos;
+ }
+ }
+ si.num_glyphs = glyph_pos;
#if QT_CONFIG(harfbuzz)
- if (Q_LIKELY(qt_useHarfbuzzNG()))
+ } else if (Q_LIKELY(qt_useHarfbuzzNG())) {
si.num_glyphs = shapeTextWithHarfbuzzNG(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled, letterSpacing != 0);
- else
#endif
- si.num_glyphs = shapeTextWithHarfbuzz(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled);
+ } else {
+ si.num_glyphs = shapeTextWithHarfbuzz(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled);
+ }
if (Q_UNLIKELY(si.num_glyphs == 0)) {
Q_UNREACHABLE(); // ### report shaping errors somehow
return;
@@ -3016,7 +3043,7 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
}
}
}
- QFixed tab = QFixed::fromReal(option.tabStop());
+ QFixed tab = QFixed::fromReal(option.tabStopDistance());
if (tab <= 0)
tab = 80; // default
tab *= dpiScale;
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index f49e2638f5..89f1328241 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -323,13 +323,9 @@ public:
QFontEngine *fontEngine;
};
-struct Q_AUTOTEST_EXPORT QScriptItem
+struct QScriptItem
{
- inline QScriptItem()
- : position(0),
- num_glyphs(0), descent(-1), ascent(-1), leading(-1), width(-1),
- glyph_data_offset(0) {}
- inline QScriptItem(int p, const QScriptAnalysis &a)
+ Q_DECL_CONSTEXPR QScriptItem(int p, QScriptAnalysis a) Q_DECL_NOTHROW
: position(p), analysis(a),
num_glyphs(0), descent(-1), ascent(-1), leading(-1), width(-1),
glyph_data_offset(0) {}
@@ -342,11 +338,12 @@ struct Q_AUTOTEST_EXPORT QScriptItem
QFixed leading;
QFixed width;
int glyph_data_offset;
- QFixed height() const { return ascent + descent; }
+ Q_DECL_CONSTEXPR QFixed height() const Q_DECL_NOTHROW { return ascent + descent; }
+private:
+ friend class QVector<QScriptItem>;
+ QScriptItem() {}; // for QVector, don't use
};
-
-
-Q_DECLARE_TYPEINFO(QScriptItem, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QScriptItem, Q_PRIMITIVE_TYPE);
typedef QVector<QScriptItem> QScriptItemArray;
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 36e0a77bd0..1653ac8c33 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -164,24 +164,25 @@ QDataStream &operator>>(QDataStream &stream, QTextLength &length)
}
#endif // QT_NO_DATASTREAM
-class QTextFormatPrivate : public QSharedData
+namespace {
+struct Property
{
-public:
- QTextFormatPrivate() : hashDirty(true), fontDirty(true), hashValue(0) {}
+ inline Property(qint32 k, const QVariant &v) : key(k), value(v) {}
+ inline Property() {}
- struct Property
- {
- inline Property(qint32 k, const QVariant &v) : key(k), value(v) {}
- inline Property() {}
+ qint32 key = -1;
+ QVariant value;
- qint32 key;
- QVariant value;
+ inline bool operator==(const Property &other) const
+ { return key == other.key && value == other.value; }
+};
+}
+Q_DECLARE_TYPEINFO(Property, Q_MOVABLE_TYPE);
- inline bool operator==(const Property &other) const
- { return key == other.key && value == other.value; }
- inline bool operator!=(const Property &other) const
- { return key != other.key || value != other.value; }
- };
+class QTextFormatPrivate : public QSharedData
+{
+public:
+ QTextFormatPrivate() : hashDirty(true), fontDirty(true), hashValue(0) {}
inline uint hash() const
{
@@ -263,7 +264,6 @@ private:
friend QDataStream &operator<<(QDataStream &, const QTextFormat &);
friend QDataStream &operator>>(QDataStream &, QTextFormat &);
};
-Q_DECLARE_TYPEINFO(QTextFormatPrivate::Property, Q_MOVABLE_TYPE);
static inline uint hash(const QColor &color)
{
@@ -845,10 +845,10 @@ void QTextFormat::merge(const QTextFormat &other)
QTextFormatPrivate *d = this->d;
- const QVector<QTextFormatPrivate::Property> &otherProps = other.d->props;
+ const QVector<QT_PREPEND_NAMESPACE(Property)> &otherProps = other.d->props;
d->props.reserve(d->props.size() + otherProps.size());
for (int i = 0; i < otherProps.count(); ++i) {
- const QTextFormatPrivate::Property &p = otherProps.at(i);
+ const QT_PREPEND_NAMESPACE(Property) &p = otherProps.at(i);
d->insertProperty(p.key, p.value);
}
}
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index da4e21728f..be10efad8d 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -493,7 +493,7 @@ static QString quoteNewline(const QString &s)
QTextHtmlParserNode::QTextHtmlParserNode()
: parent(0), id(Html_unknown),
- cssFloat(QTextFrameFormat::InFlow), hasOwnListStyle(false), hasOwnLineHeightType(false),
+ cssFloat(QTextFrameFormat::InFlow), hasOwnListStyle(false), hasOwnLineHeightType(false), hasLineHeightMultiplier(false),
hasCssListIndent(false), isEmptyParagraph(false), isTextFrame(false), isRootFrame(false),
displayMode(QTextHtmlElement::DisplayInline), hasHref(false),
listStyle(QTextListFormat::ListStyleUndefined), imageWidth(-1), imageHeight(-1), tableBorder(0),
@@ -1216,6 +1216,11 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
else
lineHeightType = QTextBlockFormat::SingleHeight;
+ if (hasLineHeightMultiplier) {
+ qreal lineHeight = blockFormat.lineHeight() / 100.0;
+ blockFormat.setProperty(QTextBlockFormat::LineHeight, lineHeight);
+ }
+
blockFormat.setProperty(QTextBlockFormat::LineHeightType, lineHeightType);
hasOwnLineHeightType = true;
}
@@ -1227,9 +1232,14 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
lineHeightType = QTextBlockFormat::MinimumHeight;
} else {
bool ok;
- QString value = decl.d->values.first().toString();
+ QCss::Value cssValue = decl.d->values.first();
+ QString value = cssValue.toString();
lineHeight = value.toDouble(&ok);
if (ok) {
+ if (!hasOwnLineHeightType && cssValue.type == QCss::Value::Number) {
+ lineHeight *= 100.0;
+ hasLineHeightMultiplier = true;
+ }
lineHeightType = QTextBlockFormat::ProportionalHeight;
} else {
lineHeight = 0.0;
diff --git a/src/gui/text/qtexthtmlparser_p.h b/src/gui/text/qtexthtmlparser_p.h
index 77bfa685c0..73dac38b82 100644
--- a/src/gui/text/qtexthtmlparser_p.h
+++ b/src/gui/text/qtexthtmlparser_p.h
@@ -173,6 +173,7 @@ struct QTextHtmlParserNode {
uint cssFloat : 2;
uint hasOwnListStyle : 1;
uint hasOwnLineHeightType : 1;
+ uint hasLineHeightMultiplier : 1;
uint hasCssListIndent : 1;
uint isEmptyParagraph : 1;
uint isTextFrame : 1;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index cc91c107f9..066f258ea3 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -167,7 +167,7 @@ QRectF QTextInlineObject::rect() const
*/
qreal QTextInlineObject::width() const
{
- return eng->layoutData->items[itm].width.toReal();
+ return eng->layoutData->items.at(itm).width.toReal();
}
/*!
@@ -177,7 +177,7 @@ qreal QTextInlineObject::width() const
*/
qreal QTextInlineObject::ascent() const
{
- return eng->layoutData->items[itm].ascent.toReal();
+ return eng->layoutData->items.at(itm).ascent.toReal();
}
/*!
@@ -187,7 +187,7 @@ qreal QTextInlineObject::ascent() const
*/
qreal QTextInlineObject::descent() const
{
- return eng->layoutData->items[itm].descent.toReal();
+ return eng->layoutData->items.at(itm).descent.toReal();
}
/*!
@@ -198,7 +198,7 @@ qreal QTextInlineObject::descent() const
*/
qreal QTextInlineObject::height() const
{
- return eng->layoutData->items[itm].height().toReal();
+ return eng->layoutData->items.at(itm).height().toReal();
}
/*!
@@ -924,7 +924,7 @@ QRectF QTextLayout::boundingRect() const
QFixed ymin = d->lines.at(0).y;
for (int i = 0; i < d->lines.size(); ++i) {
- const QScriptLine &si = d->lines[i];
+ const QScriptLine &si = d->lines.at(i);
xmin = qMin(xmin, si.x);
ymin = qMin(ymin, si.y);
QFixed lineWidth = si.width < QFIXED_MAX ? qMax(si.width, si.textWidth) : si.textWidth;
@@ -1052,9 +1052,9 @@ QList<QGlyphRun> QTextLayout::glyphRuns(int from, int length) const
QHash<QPair<QFontEngine *, int>, QGlyphRun> glyphRunHash;
for (int i=0; i<d->lines.size(); ++i) {
- if (d->lines[i].from > from + length)
+ if (d->lines.at(i).from > from + length)
break;
- else if (d->lines[i].from + d->lines[i].length >= from) {
+ else if (d->lines.at(i).from + d->lines[i].length >= from) {
QList<QGlyphRun> glyphRuns = QTextLine(i, d).glyphRuns(from, length);
for (int j = 0; j < glyphRuns.size(); j++) {
@@ -1115,7 +1115,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVector<FormatRang
int lastLine = d->lines.size();
for (int i = 0; i < d->lines.size(); ++i) {
QTextLine l(i, d);
- const QScriptLine &sl = d->lines[i];
+ const QScriptLine &sl = d->lines.at(i);
if (sl.y > clipe) {
lastLine = i;
@@ -1137,7 +1137,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVector<FormatRang
region.setFillRule(Qt::WindingFill);
for (int line = firstLine; line < lastLine; ++line) {
- const QScriptLine &sl = d->lines[line];
+ const QScriptLine &sl = d->lines.at(line);
QTextLine tl(line, d);
QRectF lineRect(tl.naturalTextRect());
@@ -1302,7 +1302,7 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition
return;
QTextLine l(line, d);
- const QScriptLine &sl = d->lines[line];
+ const QScriptLine &sl = d->lines.at(line);
qreal x = position.x() + l.cursorToX(cursorPosition);
@@ -1415,7 +1415,7 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition
*/
QRectF QTextLine::rect() const
{
- const QScriptLine& sl = eng->lines[index];
+ const QScriptLine& sl = eng->lines.at(index);
return QRectF(sl.x.toReal(), sl.y.toReal(), sl.width.toReal(), sl.height().toReal());
}
@@ -1424,7 +1424,7 @@ QRectF QTextLine::rect() const
*/
QRectF QTextLine::naturalTextRect() const
{
- const QScriptLine& sl = eng->lines[index];
+ const QScriptLine& sl = eng->lines.at(index);
QFixed x = sl.x + eng->alignLine(sl);
QFixed width = sl.textWidth;
@@ -1441,7 +1441,7 @@ QRectF QTextLine::naturalTextRect() const
*/
qreal QTextLine::x() const
{
- return eng->lines[index].x.toReal();
+ return eng->lines.at(index).x.toReal();
}
/*!
@@ -1451,7 +1451,7 @@ qreal QTextLine::x() const
*/
qreal QTextLine::y() const
{
- return eng->lines[index].y.toReal();
+ return eng->lines.at(index).y.toReal();
}
/*!
@@ -1461,7 +1461,7 @@ qreal QTextLine::y() const
*/
qreal QTextLine::width() const
{
- return eng->lines[index].width.toReal();
+ return eng->lines.at(index).width.toReal();
}
@@ -1472,7 +1472,7 @@ qreal QTextLine::width() const
*/
qreal QTextLine::ascent() const
{
- return eng->lines[index].ascent.toReal();
+ return eng->lines.at(index).ascent.toReal();
}
/*!
@@ -1482,7 +1482,7 @@ qreal QTextLine::ascent() const
*/
qreal QTextLine::descent() const
{
- return eng->lines[index].descent.toReal();
+ return eng->lines.at(index).descent.toReal();
}
/*!
@@ -1494,7 +1494,7 @@ qreal QTextLine::descent() const
*/
qreal QTextLine::height() const
{
- return eng->lines[index].height().ceil().toReal();
+ return eng->lines.at(index).height().ceil().toReal();
}
/*!
@@ -1506,7 +1506,7 @@ qreal QTextLine::height() const
*/
qreal QTextLine::leading() const
{
- return eng->lines[index].leading.toReal();
+ return eng->lines.at(index).leading.toReal();
}
/*!
@@ -1541,7 +1541,7 @@ void QTextLine::setLeadingIncluded(bool included)
*/
bool QTextLine::leadingIncluded() const
{
- return eng->lines[index].leadingIncluded;
+ return eng->lines.at(index).leadingIncluded;
}
/*!
@@ -1551,7 +1551,7 @@ bool QTextLine::leadingIncluded() const
*/
qreal QTextLine::naturalTextWidth() const
{
- return eng->lines[index].textWidth.toReal();
+ return eng->lines.at(index).textWidth.toReal();
}
/*!
@@ -1566,7 +1566,7 @@ qreal QTextLine::naturalTextWidth() const
*/
qreal QTextLine::horizontalAdvance() const
{
- return eng->lines[index].textAdvance.toReal();
+ return eng->lines.at(index).textAdvance.toReal();
}
/*!
@@ -1832,7 +1832,7 @@ void QTextLine::layout_helper(int maxGlyphs)
lbh.softHyphenWidth = 0;
if (newItem != item) {
item = newItem;
- const QScriptItem &current = eng->layoutData->items[item];
+ const QScriptItem &current = eng->layoutData->items.at(item);
if (!current.num_glyphs) {
eng->shape(item);
attributes = eng->attributes();
@@ -1850,7 +1850,7 @@ void QTextLine::layout_helper(int maxGlyphs)
QFixed::fromReal(fontEngine->minRightBearing()));
}
}
- const QScriptItem &current = eng->layoutData->items[item];
+ const QScriptItem &current = eng->layoutData->items.at(item);
lbh.tmpData.leading = qMax(lbh.tmpData.leading + lbh.tmpData.ascent,
current.leading + current.ascent) - qMax(lbh.tmpData.ascent,
@@ -2093,7 +2093,7 @@ void QTextLine::setPosition(const QPointF &pos)
*/
QPointF QTextLine::position() const
{
- return QPointF(eng->lines[index].x.toReal(), eng->lines[index].y.toReal());
+ return QPointF(eng->lines.at(index).x.toReal(), eng->lines.at(index).y.toReal());
}
// ### DOC: I have no idea what this means/does.
@@ -2109,7 +2109,7 @@ QPointF QTextLine::position() const
*/
int QTextLine::textStart() const
{
- return eng->lines[index].from;
+ return eng->lines.at(index).from;
}
/*!
@@ -2121,9 +2121,9 @@ int QTextLine::textLength() const
{
if (eng->option.flags() & QTextOption::ShowLineAndParagraphSeparators
&& eng->block.isValid() && index == eng->lines.count()-1) {
- return eng->lines[index].length - 1;
+ return eng->lines.at(index).length - 1;
}
- return eng->lines[index].length + eng->lines[index].trailingSpaces;
+ return eng->lines.at(index).length + eng->lines.at(index).trailingSpaces;
}
static void setPenAndDrawBackground(QPainter *p, const QPen &defaultPen, const QTextCharFormat &chf, const QRectF &r)
@@ -2247,7 +2247,7 @@ static QGlyphRun glyphRunWithInfo(QFontEngine *fontEngine,
*/
QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
{
- const QScriptLine &line = eng->lines[index];
+ const QScriptLine &line = eng->lines.at(index);
if (line.length == 0)
return QList<QGlyphRun>();
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 87e31eeb2c..2a16f50f33 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -144,7 +144,7 @@ QTextOption &QTextOption::operator=(const QTextOption &o)
Sets the tab positions for the text layout to those specified by
\a tabStops.
- \sa tabArray(), setTabStop(), setTabs()
+ \sa tabArray(), setTabStopDistance(), setTabs()
*/
void QTextOption::setTabArray(const QList<qreal> &tabStops)
{
@@ -332,22 +332,45 @@ QList<QTextOption::Tab> QTextOption::tabs() const
\sa flags()
*/
+#if QT_DEPRECATED_SINCE(5, 10)
/*!
\fn qreal QTextOption::tabStop() const
+ \deprecated in Qt 5.10. Use tabStopDistance() instead.
Returns the distance in device units between tab stops.
Convenient function for the above method
- \sa setTabStop(), tabArray(), setTabs(), tabs()
+ \sa setTabStopDistance(), tabArray(), setTabs(), tabs()
*/
/*!
\fn void QTextOption::setTabStop(qreal tabStop)
+ \deprecated in Qt 5.10. Use setTabStopDistance() instead.
Sets the default distance in device units between tab stops to the value specified
by \a tabStop.
- \sa tabStop(), setTabArray(), setTabs(), tabs()
+ \sa tabStopDistance(), setTabArray(), setTabs(), tabs()
+*/
+#endif
+
+/*!
+ \fn qreal QTextOption::tabStopDistance() const
+ \since 5.10
+
+ Returns the distance in device units between tab stops.
+
+ \sa setTabStopDistance(), tabArray(), setTabs(), tabs()
+*/
+
+/*!
+ \fn void QTextOption::setTabStopDistance(qreal tabStopDistance)
+ \since 5.10
+
+ Sets the default distance in device units between tab stops to the value specified
+ by \a tabStopDistance.
+
+ \sa tabStopDistance(), setTabArray(), setTabs(), tabs()
*/
/*!
@@ -426,7 +449,7 @@ QList<QTextOption::Tab> QTextOption::tabs() const
\fn void setTabs(const QList<Tab> &tabStops)
Set the Tab properties to \a tabStops.
- \sa tabStop(), tabs()
+ \sa tabStopDistance(), tabs()
*/
/*!
@@ -434,7 +457,7 @@ QList<QTextOption::Tab> QTextOption::tabs() const
\fn QList<QTextOption::Tab> QTextOption::tabs() const
Returns a list of tab positions defined for the text layout.
- \sa tabStop(), setTabs(), setTabStop()
+ \sa tabStopDistance(), setTabs(), setTabStop()
*/
diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h
index 9ef9cee9bb..8b57278633 100644
--- a/src/gui/text/qtextoption.h
+++ b/src/gui/text/qtextoption.h
@@ -117,8 +117,13 @@ public:
inline void setFlags(Flags flags);
inline Flags flags() const { return Flags(f); }
- inline void setTabStop(qreal tabStop);
- inline qreal tabStop() const { return tab; }
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED inline void setTabStop(qreal tabStop);
+ QT_DEPRECATED inline qreal tabStop() const { return tabStopDistance(); }
+#endif
+
+ inline void setTabStopDistance(qreal tabStopDistance);
+ inline qreal tabStopDistance() const { return tab; }
void setTabArray(const QList<qreal> &tabStops);
QList<qreal> tabArray() const;
@@ -149,7 +154,12 @@ inline void QTextOption::setAlignment(Qt::Alignment aalignment)
inline void QTextOption::setFlags(Flags aflags)
{ f = aflags; }
+#if QT_DEPRECATED_SINCE(5, 10)
inline void QTextOption::setTabStop(qreal atabStop)
+{ setTabStopDistance(atabStop); }
+#endif
+
+inline void QTextOption::setTabStopDistance(qreal atabStop)
{ tab = atabStop; }
QT_END_NAMESPACE
diff --git a/src/gui/util/qshaderformat.cpp b/src/gui/util/qshaderformat.cpp
new file mode 100644
index 0000000000..373bfb9e7e
--- /dev/null
+++ b/src/gui/util/qshaderformat.cpp
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 "qshaderformat_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QShaderFormat::QShaderFormat() Q_DECL_NOTHROW
+ : m_api(NoApi)
+{
+}
+
+QShaderFormat::Api QShaderFormat::api() const Q_DECL_NOTHROW
+{
+ return m_api;
+}
+
+void QShaderFormat::setApi(QShaderFormat::Api api) Q_DECL_NOTHROW
+{
+ m_api = api;
+}
+
+QVersionNumber QShaderFormat::version() const Q_DECL_NOTHROW
+{
+ return m_version;
+}
+
+void QShaderFormat::setVersion(const QVersionNumber &version) Q_DECL_NOTHROW
+{
+ m_version = version;
+}
+
+QStringList QShaderFormat::extensions() const Q_DECL_NOTHROW
+{
+ return m_extensions;
+}
+
+void QShaderFormat::setExtensions(const QStringList &extensions) Q_DECL_NOTHROW
+{
+ m_extensions = extensions;
+ m_extensions.sort();
+}
+
+QString QShaderFormat::vendor() const Q_DECL_NOTHROW
+{
+ return m_vendor;
+}
+
+void QShaderFormat::setVendor(const QString &vendor) Q_DECL_NOTHROW
+{
+ m_vendor = vendor;
+}
+
+bool QShaderFormat::isValid() const Q_DECL_NOTHROW
+{
+ return m_api != NoApi && m_version.majorVersion() > 0;
+}
+
+bool QShaderFormat::supports(const QShaderFormat &other) const Q_DECL_NOTHROW
+{
+ if (!isValid() || !other.isValid())
+ return false;
+
+ if (m_api == OpenGLES && m_api != other.m_api)
+ return false;
+
+ if (m_api == OpenGLCoreProfile && m_api != other.m_api)
+ return false;
+
+ if (m_version < other.m_version)
+ return false;
+
+ const auto containsAllExtensionsFromOther = std::includes(m_extensions.constBegin(),
+ m_extensions.constEnd(),
+ other.m_extensions.constBegin(),
+ other.m_extensions.constEnd());
+ if (!containsAllExtensionsFromOther)
+ return false;
+
+ if (!other.m_vendor.isEmpty() && m_vendor != other.m_vendor)
+ return false;
+
+ return true;
+}
+
+bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW
+{
+ return lhs.api() == rhs.api()
+ && lhs.version() == rhs.version()
+ && lhs.extensions() == rhs.extensions()
+ && lhs.vendor() == rhs.vendor();
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshaderformat_p.h b/src/gui/util/qshaderformat_p.h
new file mode 100644
index 0000000000..064c2364a7
--- /dev/null
+++ b/src/gui/util/qshaderformat_p.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 QSHADERFORMAT_P_H
+#define QSHADERFORMAT_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/qstringlist.h>
+#include <QtCore/qversionnumber.h>
+
+QT_BEGIN_NAMESPACE
+
+class QShaderFormat
+{
+public:
+ enum Api : int {
+ NoApi,
+ OpenGLNoProfile,
+ OpenGLCoreProfile,
+ OpenGLCompatibilityProfile,
+ OpenGLES
+ };
+
+ Q_GUI_EXPORT QShaderFormat() Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT Api api() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setApi(Api api) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QVersionNumber version() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setVersion(const QVersionNumber &version) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QStringList extensions() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setExtensions(const QStringList &extensions) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QString vendor() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setVendor(const QString &vendor) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT bool isValid() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT bool supports(const QShaderFormat &other) const Q_DECL_NOTHROW;
+
+private:
+ Api m_api;
+ QVersionNumber m_version;
+ QStringList m_extensions;
+ QString m_vendor;
+};
+
+Q_GUI_EXPORT bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_DECLARE_TYPEINFO(QShaderFormat, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderFormat)
+
+#endif // QSHADERFORMAT_P_H
diff --git a/src/gui/util/qshadergenerator.cpp b/src/gui/util/qshadergenerator.cpp
new file mode 100644
index 0000000000..31c2f74746
--- /dev/null
+++ b/src/gui/util/qshadergenerator.cpp
@@ -0,0 +1,351 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 "qshadergenerator_p.h"
+
+#include "qshaderlanguage_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace
+{
+ QByteArray toGlsl(QShaderLanguage::StorageQualifier qualifier, const QShaderFormat &format)
+ {
+ if (format.version().majorVersion() <= 2) {
+ // Note we're assuming fragment shader only here, it'd be different
+ // values for vertex shader, will need to be fixed properly at some
+ // point but isn't necessary yet (this problem already exists in past
+ // commits anyway)
+ switch (qualifier) {
+ case QShaderLanguage::Const:
+ return "const";
+ case QShaderLanguage::Input:
+ return "varying";
+ case QShaderLanguage::Output:
+ return ""; // Although fragment shaders for <=2 only have fixed outputs
+ case QShaderLanguage::Uniform:
+ return "uniform";
+ }
+ } else {
+ switch (qualifier) {
+ case QShaderLanguage::Const:
+ return "const";
+ case QShaderLanguage::Input:
+ return "in";
+ case QShaderLanguage::Output:
+ return "out";
+ case QShaderLanguage::Uniform:
+ return "uniform";
+ }
+ }
+
+ Q_UNREACHABLE();
+ }
+
+ QByteArray toGlsl(QShaderLanguage::VariableType type)
+ {
+ switch (type) {
+ case QShaderLanguage::Bool:
+ return "bool";
+ case QShaderLanguage::Int:
+ return "int";
+ case QShaderLanguage::Uint:
+ return "uint";
+ case QShaderLanguage::Float:
+ return "float";
+ case QShaderLanguage::Double:
+ return "double";
+ case QShaderLanguage::Vec2:
+ return "vec2";
+ case QShaderLanguage::Vec3:
+ return "vec3";
+ case QShaderLanguage::Vec4:
+ return "vec4";
+ case QShaderLanguage::DVec2:
+ return "dvec2";
+ case QShaderLanguage::DVec3:
+ return "dvec3";
+ case QShaderLanguage::DVec4:
+ return "dvec4";
+ case QShaderLanguage::BVec2:
+ return "bvec2";
+ case QShaderLanguage::BVec3:
+ return "bvec3";
+ case QShaderLanguage::BVec4:
+ return "bvec4";
+ case QShaderLanguage::IVec2:
+ return "ivec2";
+ case QShaderLanguage::IVec3:
+ return "ivec3";
+ case QShaderLanguage::IVec4:
+ return "ivec4";
+ case QShaderLanguage::UVec2:
+ return "uvec2";
+ case QShaderLanguage::UVec3:
+ return "uvec3";
+ case QShaderLanguage::UVec4:
+ return "uvec4";
+ case QShaderLanguage::Mat2:
+ return "mat2";
+ case QShaderLanguage::Mat3:
+ return "mat3";
+ case QShaderLanguage::Mat4:
+ return "mat4";
+ case QShaderLanguage::Mat2x2:
+ return "mat2x2";
+ case QShaderLanguage::Mat2x3:
+ return "mat2x3";
+ case QShaderLanguage::Mat2x4:
+ return "mat2x4";
+ case QShaderLanguage::Mat3x2:
+ return "mat3x2";
+ case QShaderLanguage::Mat3x3:
+ return "mat3x3";
+ case QShaderLanguage::Mat3x4:
+ return "mat3x4";
+ case QShaderLanguage::Mat4x2:
+ return "mat4x2";
+ case QShaderLanguage::Mat4x3:
+ return "mat4x3";
+ case QShaderLanguage::Mat4x4:
+ return "mat4x4";
+ case QShaderLanguage::DMat2:
+ return "dmat2";
+ case QShaderLanguage::DMat3:
+ return "dmat3";
+ case QShaderLanguage::DMat4:
+ return "dmat4";
+ case QShaderLanguage::DMat2x2:
+ return "dmat2x2";
+ case QShaderLanguage::DMat2x3:
+ return "dmat2x3";
+ case QShaderLanguage::DMat2x4:
+ return "dmat2x4";
+ case QShaderLanguage::DMat3x2:
+ return "dmat3x2";
+ case QShaderLanguage::DMat3x3:
+ return "dmat3x3";
+ case QShaderLanguage::DMat3x4:
+ return "dmat3x4";
+ case QShaderLanguage::DMat4x2:
+ return "dmat4x2";
+ case QShaderLanguage::DMat4x3:
+ return "dmat4x3";
+ case QShaderLanguage::DMat4x4:
+ return "dmat4x4";
+ case QShaderLanguage::Sampler1D:
+ return "sampler1D";
+ case QShaderLanguage::Sampler2D:
+ return "sampler2D";
+ case QShaderLanguage::Sampler3D:
+ return "sampler3D";
+ case QShaderLanguage::SamplerCube:
+ return "samplerCube";
+ case QShaderLanguage::Sampler2DRect:
+ return "sampler2DRect";
+ case QShaderLanguage::Sampler2DMs:
+ return "sampler2DMS";
+ case QShaderLanguage::SamplerBuffer:
+ return "samplerBuffer";
+ case QShaderLanguage::Sampler1DArray:
+ return "sampler1DArray";
+ case QShaderLanguage::Sampler2DArray:
+ return "sampler2DArray";
+ case QShaderLanguage::Sampler2DMsArray:
+ return "sampler2DMSArray";
+ case QShaderLanguage::SamplerCubeArray:
+ return "samplerCubeArray";
+ case QShaderLanguage::Sampler1DShadow:
+ return "sampler1DShadow";
+ case QShaderLanguage::Sampler2DShadow:
+ return "sampler2DShadow";
+ case QShaderLanguage::Sampler2DRectShadow:
+ return "sampler2DRectShadow";
+ case QShaderLanguage::Sampler1DArrayShadow:
+ return "sampler1DArrayShadow";
+ case QShaderLanguage::Sampler2DArrayShadow:
+ return "sample2DArrayShadow";
+ case QShaderLanguage::SamplerCubeShadow:
+ return "samplerCubeShadow";
+ case QShaderLanguage::SamplerCubeArrayShadow:
+ return "samplerCubeArrayShadow";
+ case QShaderLanguage::ISampler1D:
+ return "isampler1D";
+ case QShaderLanguage::ISampler2D:
+ return "isampler2D";
+ case QShaderLanguage::ISampler3D:
+ return "isampler3D";
+ case QShaderLanguage::ISamplerCube:
+ return "isamplerCube";
+ case QShaderLanguage::ISampler2DRect:
+ return "isampler2DRect";
+ case QShaderLanguage::ISampler2DMs:
+ return "isampler2DMS";
+ case QShaderLanguage::ISamplerBuffer:
+ return "isamplerBuffer";
+ case QShaderLanguage::ISampler1DArray:
+ return "isampler1DArray";
+ case QShaderLanguage::ISampler2DArray:
+ return "isampler2DArray";
+ case QShaderLanguage::ISampler2DMsArray:
+ return "isampler2DMSArray";
+ case QShaderLanguage::ISamplerCubeArray:
+ return "isamplerCubeArray";
+ case QShaderLanguage::USampler1D:
+ return "usampler1D";
+ case QShaderLanguage::USampler2D:
+ return "usampler2D";
+ case QShaderLanguage::USampler3D:
+ return "usampler3D";
+ case QShaderLanguage::USamplerCube:
+ return "usamplerCube";
+ case QShaderLanguage::USampler2DRect:
+ return "usampler2DRect";
+ case QShaderLanguage::USampler2DMs:
+ return "usampler2DMS";
+ case QShaderLanguage::USamplerBuffer:
+ return "usamplerBuffer";
+ case QShaderLanguage::USampler1DArray:
+ return "usampler1DArray";
+ case QShaderLanguage::USampler2DArray:
+ return "usampler2DArray";
+ case QShaderLanguage::USampler2DMsArray:
+ return "usampler2DMSArray";
+ case QShaderLanguage::USamplerCubeArray:
+ return "usamplerCubeArray";
+ }
+
+ Q_UNREACHABLE();
+ }
+
+ QByteArray replaceParameters(const QByteArray &original, const QShaderNode &node, const QShaderFormat &format)
+ {
+ auto result = original;
+
+ for (const auto &parameterName : node.parameterNames()) {
+ const auto placeholder = QByteArray(QByteArrayLiteral("$") + parameterName.toUtf8());
+ const auto parameter = node.parameter(parameterName);
+ if (parameter.userType() == qMetaTypeId<QShaderLanguage::StorageQualifier>()) {
+ const auto qualifier = parameter.value<QShaderLanguage::StorageQualifier>();
+ const auto value = toGlsl(qualifier, format);
+ result.replace(placeholder, value);
+ } else if (parameter.userType() == qMetaTypeId<QShaderLanguage::VariableType>()) {
+ const auto type = parameter.value<QShaderLanguage::VariableType>();
+ const auto value = toGlsl(type);
+ result.replace(placeholder, value);
+ } else {
+ const auto value = parameter.toString().toUtf8();
+ result.replace(placeholder, value);
+ }
+ }
+
+ return result;
+ }
+}
+
+QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers) const
+{
+ auto code = QByteArrayList();
+
+ if (format.isValid()) {
+ const auto isGLES = format.api() == QShaderFormat::OpenGLES;
+ const auto major = format.version().majorVersion();
+ const auto minor = format.version().minorVersion();
+
+ const auto version = major == 2 && isGLES ? 100
+ : major == 3 && isGLES ? 300
+ : major == 2 ? 100 + 10 * (minor + 1)
+ : major == 3 && minor <= 2 ? 100 + 10 * (minor + 3)
+ : major * 100 + minor * 10;
+
+ const auto profile = isGLES && version > 100 ? QByteArrayLiteral(" es")
+ : version >= 150 && format.api() == QShaderFormat::OpenGLCoreProfile ? QByteArrayLiteral(" core")
+ : version >= 150 && format.api() == QShaderFormat::OpenGLCompatibilityProfile ? QByteArrayLiteral(" compatibility")
+ : QByteArray();
+
+ code << (QByteArrayLiteral("#version ") + QByteArray::number(version) + profile);
+ code << QByteArray();
+ }
+
+ const auto intersectsEnabledLayers = [enabledLayers] (const QStringList &layers) {
+ return layers.isEmpty()
+ || std::any_of(layers.cbegin(), layers.cend(),
+ [enabledLayers] (const QString &s) { return enabledLayers.contains(s); });
+ };
+
+ for (const auto &node : graph.nodes()) {
+ if (intersectsEnabledLayers(node.layers())) {
+ for (const auto &snippet : node.rule(format).headerSnippets) {
+ code << replaceParameters(snippet, node, format);
+ }
+ }
+ }
+
+ code << QByteArray();
+ code << QByteArrayLiteral("void main()");
+ code << QByteArrayLiteral("{");
+
+ for (const auto &statement : graph.createStatements(enabledLayers)) {
+ const auto node = statement.node;
+ auto line = node.rule(format).substitution;
+ for (const auto &port : node.ports()) {
+ const auto portName = port.name;
+ const auto portDirection = port.direction;
+ const auto isInput = port.direction == QShaderNodePort::Input;
+
+ const auto portIndex = statement.portIndex(portDirection, portName);
+ const auto variableIndex = isInput ? statement.inputs.at(portIndex)
+ : statement.outputs.at(portIndex);
+ if (variableIndex < 0)
+ continue;
+
+ const auto placeholder = QByteArray(QByteArrayLiteral("$") + portName.toUtf8());
+ const auto variable = QByteArray(QByteArrayLiteral("v") + QByteArray::number(variableIndex));
+ line.replace(placeholder, variable);
+ }
+
+ code << QByteArrayLiteral(" ") + replaceParameters(line, node, format);
+ }
+
+ code << QByteArrayLiteral("}");
+ code << QByteArray();
+ return code.join('\n');
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshadergenerator_p.h b/src/gui/util/qshadergenerator_p.h
new file mode 100644
index 0000000000..7bc8838b52
--- /dev/null
+++ b/src/gui/util/qshadergenerator_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 QSHADERGENERATOR_P_H
+#define QSHADERGENERATOR_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 <QtGui/private/qshadergraph_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QShaderGenerator
+{
+public:
+ Q_GUI_EXPORT QByteArray createShaderCode(const QStringList &enabledLayers = QStringList()) const;
+
+ QShaderGraph graph;
+ QShaderFormat format;
+};
+
+Q_DECLARE_TYPEINFO(QShaderGenerator, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderGenerator)
+
+#endif // QSHADERGENERATOR_P_H
diff --git a/src/gui/util/qshadergraph.cpp b/src/gui/util/qshadergraph.cpp
new file mode 100644
index 0000000000..828c709a12
--- /dev/null
+++ b/src/gui/util/qshadergraph.cpp
@@ -0,0 +1,262 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 "qshadergraph_p.h"
+
+QT_BEGIN_NAMESPACE
+
+
+namespace
+{
+ QVector<QShaderNode> copyOutputNodes(const QVector<QShaderNode> &nodes)
+ {
+ auto res = QVector<QShaderNode>();
+ std::copy_if(nodes.cbegin(), nodes.cend(),
+ std::back_inserter(res),
+ [] (const QShaderNode &node) {
+ return node.type() == QShaderNode::Output;
+ });
+ return res;
+ }
+
+ QVector<QShaderGraph::Edge> incomingEdges(const QVector<QShaderGraph::Edge> &edges, const QUuid &uuid)
+ {
+ auto res = QVector<QShaderGraph::Edge>();
+ std::copy_if(edges.cbegin(), edges.cend(),
+ std::back_inserter(res),
+ [uuid] (const QShaderGraph::Edge &edge) {
+ return edge.sourceNodeUuid == uuid;
+ });
+ return res;
+ }
+
+ QVector<QShaderGraph::Edge> outgoingEdges(const QVector<QShaderGraph::Edge> &edges, const QUuid &uuid)
+ {
+ auto res = QVector<QShaderGraph::Edge>();
+ std::copy_if(edges.cbegin(), edges.cend(),
+ std::back_inserter(res),
+ [uuid] (const QShaderGraph::Edge &edge) {
+ return edge.targetNodeUuid == uuid;
+ });
+ return res;
+ }
+
+ QShaderGraph::Statement nodeToStatement(const QShaderNode &node, int &nextVarId)
+ {
+ auto statement = QShaderGraph::Statement();
+ statement.node = node;
+
+ const auto ports = node.ports();
+ for (const auto &port : ports) {
+ if (port.direction == QShaderNodePort::Input) {
+ statement.inputs.append(-1);
+ } else {
+ statement.outputs.append(nextVarId);
+ nextVarId++;
+ }
+ }
+ return statement;
+ }
+
+ QShaderGraph::Statement completeStatement(const QHash<QUuid, QShaderGraph::Statement> &idHash,
+ const QVector<QShaderGraph::Edge> edges,
+ const QUuid &uuid)
+ {
+ auto targetStatement = idHash.value(uuid);
+ for (const auto &edge : edges) {
+ if (edge.targetNodeUuid != uuid)
+ continue;
+
+ const auto sourceStatement = idHash.value(edge.sourceNodeUuid);
+ const auto sourcePortIndex = sourceStatement.portIndex(QShaderNodePort::Output, edge.sourcePortName);
+ const auto targetPortIndex = targetStatement.portIndex(QShaderNodePort::Input, edge.targetPortName);
+
+ if (sourcePortIndex < 0 || targetPortIndex < 0)
+ continue;
+
+ const auto &sourceOutputs = sourceStatement.outputs;
+ auto &targetInputs = targetStatement.inputs;
+ targetInputs[targetPortIndex] = sourceOutputs[sourcePortIndex];
+ }
+ return targetStatement;
+ }
+}
+
+QUuid QShaderGraph::Statement::uuid() const Q_DECL_NOTHROW
+{
+ return node.uuid();
+}
+
+int QShaderGraph::Statement::portIndex(QShaderNodePort::Direction direction, const QString &portName) const Q_DECL_NOTHROW
+{
+ const auto ports = node.ports();
+ int index = 0;
+ for (const auto &port : ports) {
+ if (port.name == portName && port.direction == direction)
+ return index;
+ else if (port.direction == direction)
+ index++;
+ }
+ return -1;
+}
+
+void QShaderGraph::addNode(const QShaderNode &node)
+{
+ removeNode(node);
+ m_nodes.append(node);
+}
+
+void QShaderGraph::removeNode(const QShaderNode &node)
+{
+ const auto it = std::find_if(m_nodes.begin(), m_nodes.end(),
+ [node] (const QShaderNode &n) { return n.uuid() == node.uuid(); });
+ if (it != m_nodes.end())
+ m_nodes.erase(it);
+}
+
+QVector<QShaderNode> QShaderGraph::nodes() const Q_DECL_NOTHROW
+{
+ return m_nodes;
+}
+
+void QShaderGraph::addEdge(const QShaderGraph::Edge &edge)
+{
+ if (m_edges.contains(edge))
+ return;
+ m_edges.append(edge);
+}
+
+void QShaderGraph::removeEdge(const QShaderGraph::Edge &edge)
+{
+ m_edges.removeAll(edge);
+}
+
+QVector<QShaderGraph::Edge> QShaderGraph::edges() const Q_DECL_NOTHROW
+{
+ return m_edges;
+}
+
+QVector<QShaderGraph::Statement> QShaderGraph::createStatements(const QStringList &enabledLayers) const
+{
+ const auto intersectsEnabledLayers = [enabledLayers] (const QStringList &layers) {
+ return layers.isEmpty()
+ || std::any_of(layers.cbegin(), layers.cend(),
+ [enabledLayers] (const QString &s) { return enabledLayers.contains(s); });
+ };
+
+ const auto enabledNodes = [this, intersectsEnabledLayers] {
+ auto res = QVector<QShaderNode>();
+ std::copy_if(m_nodes.cbegin(), m_nodes.cend(),
+ std::back_inserter(res),
+ [intersectsEnabledLayers] (const QShaderNode &node) {
+ return intersectsEnabledLayers(node.layers());
+ });
+ return res;
+ }();
+
+ const auto enabledEdges = [this, intersectsEnabledLayers] {
+ auto res = QVector<Edge>();
+ std::copy_if(m_edges.cbegin(), m_edges.cend(),
+ std::back_inserter(res),
+ [intersectsEnabledLayers] (const Edge &edge) {
+ return intersectsEnabledLayers(edge.layers);
+ });
+ return res;
+ }();
+
+ const auto idHash = [enabledNodes] {
+ auto nextVarId = 0;
+ auto res = QHash<QUuid, Statement>();
+ for (const auto &node : enabledNodes)
+ res.insert(node.uuid(), nodeToStatement(node, nextVarId));
+ return res;
+ }();
+
+ auto result = QVector<Statement>();
+ auto currentEdges = enabledEdges;
+ auto currentUuids = [enabledNodes] {
+ const auto inputs = copyOutputNodes(enabledNodes);
+ auto res = QVector<QUuid>();
+ std::transform(inputs.cbegin(), inputs.cend(),
+ std::back_inserter(res),
+ [](const QShaderNode &node) { return node.uuid(); });
+ return res;
+ }();
+
+ // Implements Kahn's algorithm to flatten the graph
+ // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
+ //
+ // We implement it with a small twist though, we follow the edges backward
+ // because we want to track the dependencies from the output nodes and not the
+ // input nodes
+ while (!currentUuids.isEmpty()) {
+ const auto uuid = currentUuids.takeFirst();
+ result.append(completeStatement(idHash, enabledEdges, uuid));
+
+ const auto outgoing = outgoingEdges(currentEdges, uuid);
+ for (const auto &outgoingEdge : outgoing) {
+ currentEdges.removeAll(outgoingEdge);
+ const QUuid nextUuid = outgoingEdge.sourceNodeUuid;
+ const auto incoming = incomingEdges(currentEdges, nextUuid);
+ if (incoming.isEmpty()) {
+ currentUuids.append(nextUuid);
+ }
+ }
+ }
+
+ std::reverse(result.begin(), result.end());
+ return result;
+}
+
+bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW
+{
+ return lhs.sourceNodeUuid == rhs.sourceNodeUuid
+ && lhs.sourcePortName == rhs.sourcePortName
+ && lhs.targetNodeUuid == rhs.targetNodeUuid
+ && lhs.targetPortName == rhs.targetPortName;
+}
+
+bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW
+{
+ return lhs.inputs == rhs.inputs
+ && lhs.outputs == rhs.outputs
+ && lhs.node.uuid() == rhs.node.uuid();
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshadergraph_p.h b/src/gui/util/qshadergraph_p.h
new file mode 100644
index 0000000000..756e1b2da2
--- /dev/null
+++ b/src/gui/util/qshadergraph_p.h
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 QSHADERGRAPH_P_H
+#define QSHADERGRAPH_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 <QtGui/private/qshadernode_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QShaderGraph
+{
+public:
+ class Edge
+ {
+ public:
+ QStringList layers;
+ QUuid sourceNodeUuid;
+ QString sourcePortName;
+ QUuid targetNodeUuid;
+ QString targetPortName;
+ };
+
+ 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;
+
+ QShaderNode node;
+ QVector<int> inputs;
+ QVector<int> outputs;
+ };
+
+ 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 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<Statement> createStatements(const QStringList &enabledLayers = QStringList()) const;
+
+private:
+ QVector<QShaderNode> m_nodes;
+ QVector<Edge> m_edges;
+};
+
+Q_GUI_EXPORT bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_GUI_EXPORT bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_DECLARE_TYPEINFO(QShaderGraph, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QShaderGraph::Edge, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QShaderGraph::Statement, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderGraph)
+Q_DECLARE_METATYPE(QShaderGraph::Edge)
+Q_DECLARE_METATYPE(QShaderGraph::Statement)
+
+#endif // QSHADERGRAPH_P_H
diff --git a/src/gui/util/qshadergraphloader.cpp b/src/gui/util/qshadergraphloader.cpp
new file mode 100644
index 0000000000..c7560d9105
--- /dev/null
+++ b/src/gui/util/qshadergraphloader.cpp
@@ -0,0 +1,251 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 "qshadergraphloader_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qiodevice.h>
+#include <QtCore/qjsonarray.h>
+#include <QtCore/qjsondocument.h>
+#include <QtCore/qjsonobject.h>
+#include <QtCore/qmetaobject.h>
+
+QT_BEGIN_NAMESPACE
+
+QShaderGraphLoader::QShaderGraphLoader() Q_DECL_NOTHROW
+ : m_status(Null),
+ m_device(nullptr)
+{
+}
+
+QShaderGraphLoader::Status QShaderGraphLoader::status() const Q_DECL_NOTHROW
+{
+ return m_status;
+}
+
+QShaderGraph QShaderGraphLoader::graph() const Q_DECL_NOTHROW
+{
+ return m_graph;
+}
+
+QIODevice *QShaderGraphLoader::device() const Q_DECL_NOTHROW
+{
+ return m_device;
+}
+
+void QShaderGraphLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
+{
+ m_device = device;
+ m_graph = QShaderGraph();
+ m_status = !m_device ? Null
+ : (m_device->openMode() & QIODevice::ReadOnly) ? Waiting
+ : Error;
+}
+
+QHash<QString, QShaderNode> QShaderGraphLoader::prototypes() const Q_DECL_NOTHROW
+{
+ return m_prototypes;
+}
+
+void QShaderGraphLoader::setPrototypes(const QHash<QString, QShaderNode> &prototypes) Q_DECL_NOTHROW
+{
+ m_prototypes = prototypes;
+}
+
+void QShaderGraphLoader::load()
+{
+ if (m_status == Error)
+ return;
+
+ auto error = QJsonParseError();
+ const auto document = QJsonDocument::fromJson(m_device->readAll(), &error);
+
+ if (error.error != QJsonParseError::NoError) {
+ qWarning() << "Invalid JSON document:" << error.errorString();
+ m_status = Error;
+ return;
+ }
+
+ if (document.isEmpty() || !document.isObject()) {
+ qWarning() << "Invalid JSON document, root should be an object";
+ m_status = Error;
+ return;
+ }
+
+ const auto root = document.object();
+
+ const auto nodesValue = root.value(QStringLiteral("nodes"));
+ if (!nodesValue.isArray()) {
+ qWarning() << "Invalid nodes property, should be an array";
+ m_status = Error;
+ return;
+ }
+
+ const auto edgesValue = root.value(QStringLiteral("edges"));
+ if (!edgesValue.isArray()) {
+ qWarning() << "Invalid edges property, should be an array";
+ m_status = Error;
+ return;
+ }
+
+ bool hasError = false;
+
+ const auto nodes = nodesValue.toArray();
+ for (const auto &nodeValue : nodes) {
+ if (!nodeValue.isObject()) {
+ qWarning() << "Invalid node found";
+ hasError = true;
+ continue;
+ }
+
+ const auto nodeObject = nodeValue.toObject();
+
+ const auto uuidString = nodeObject.value(QStringLiteral("uuid")).toString();
+ const auto uuid = QUuid(uuidString);
+ if (uuid.isNull()) {
+ qWarning() << "Invalid UUID found in node:" << uuidString;
+ hasError = true;
+ continue;
+ }
+
+ const auto type = nodeObject.value(QStringLiteral("type")).toString();
+ if (!m_prototypes.contains(type)) {
+ qWarning() << "Unsupported node type found:" << type;
+ hasError = true;
+ continue;
+ }
+
+ const auto layersArray = nodeObject.value(QStringLiteral("layers")).toArray();
+ auto layers = QStringList();
+ for (const auto &layerValue : layersArray) {
+ layers.append(layerValue.toString());
+ }
+
+ auto node = m_prototypes.value(type);
+ node.setUuid(uuid);
+ node.setLayers(layers);
+
+ const auto parametersValue = nodeObject.value(QStringLiteral("parameters"));
+ if (parametersValue.isObject()) {
+ const auto parametersObject = parametersValue.toObject();
+ for (const auto &parameterName : parametersObject.keys()) {
+ const auto parameterValue = parametersObject.value(parameterName);
+ if (parameterValue.isObject()) {
+ const auto parameterObject = parameterValue.toObject();
+ const auto type = parameterObject.value(QStringLiteral("type")).toString();
+ const auto typeId = QMetaType::type(type.toUtf8());
+
+ const auto value = parameterObject.value(QStringLiteral("value")).toString();
+ auto variant = QVariant(value);
+
+ if (QMetaType::typeFlags(typeId) & QMetaType::IsEnumeration) {
+ const auto metaObject = QMetaType::metaObjectForType(typeId);
+ const auto className = metaObject->className();
+ const auto enumName = type.mid(static_cast<int>(qstrlen(className)) + 2).toUtf8();
+ const auto metaEnum = metaObject->enumerator(metaObject->indexOfEnumerator(enumName));
+ const auto enumValue = metaEnum.keyToValue(value.toUtf8());
+ variant = QVariant(enumValue);
+ variant.convert(typeId);
+ } else {
+ variant.convert(typeId);
+ }
+ node.setParameter(parameterName, variant);
+ } else {
+ node.setParameter(parameterName, parameterValue.toVariant());
+ }
+ }
+ }
+
+ m_graph.addNode(node);
+ }
+
+ const auto edges = edgesValue.toArray();
+ for (const auto &edgeValue : edges) {
+ if (!edgeValue.isObject()) {
+ qWarning() << "Invalid edge found";
+ hasError = true;
+ continue;
+ }
+
+ const auto edgeObject = edgeValue.toObject();
+
+ const auto sourceUuidString = edgeObject.value(QStringLiteral("sourceUuid")).toString();
+ const auto sourceUuid = QUuid(sourceUuidString);
+ if (sourceUuid.isNull()) {
+ qWarning() << "Invalid source UUID found in edge:" << sourceUuidString;
+ hasError = true;
+ continue;
+ }
+
+ const auto sourcePort = edgeObject.value(QStringLiteral("sourcePort")).toString();
+
+ const auto targetUuidString = edgeObject.value(QStringLiteral("targetUuid")).toString();
+ const auto targetUuid = QUuid(targetUuidString);
+ if (targetUuid.isNull()) {
+ qWarning() << "Invalid target UUID found in edge:" << targetUuidString;
+ hasError = true;
+ continue;
+ }
+
+ const auto targetPort = edgeObject.value(QStringLiteral("targetPort")).toString();
+
+ const auto layersArray = edgeObject.value(QStringLiteral("layers")).toArray();
+ auto layers = QStringList();
+ for (const auto &layerValue : layersArray) {
+ layers.append(layerValue.toString());
+ }
+
+ auto edge = QShaderGraph::Edge();
+ edge.sourceNodeUuid = sourceUuid;
+ edge.sourcePortName = sourcePort;
+ edge.targetNodeUuid = targetUuid;
+ edge.targetPortName = targetPort;
+ edge.layers = layers;
+ m_graph.addEdge(edge);
+ }
+
+ if (hasError) {
+ m_status = Error;
+ m_graph = QShaderGraph();
+ } else {
+ m_status = Ready;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshadergraphloader_p.h b/src/gui/util/qshadergraphloader_p.h
new file mode 100644
index 0000000000..97cbd8d18c
--- /dev/null
+++ b/src/gui/util/qshadergraphloader_p.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 QSHADERGRAPHLOADER_P_H
+#define QSHADERGRAPHLOADER_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 <QtGui/private/qshadergraph_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QIODevice;
+
+class QShaderGraphLoader
+{
+public:
+ enum Status : char {
+ Null,
+ Waiting,
+ Ready,
+ Error
+ };
+
+ Q_GUI_EXPORT QShaderGraphLoader() Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT Status status() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderGraph graph() const Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QIODevice *device() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setDevice(QIODevice *device) Q_DECL_NOTHROW;
+
+ 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 void load();
+
+private:
+ Status m_status;
+ QIODevice *m_device;
+ QHash<QString, QShaderNode> m_prototypes;
+ QShaderGraph m_graph;
+};
+
+Q_DECLARE_TYPEINFO(QShaderGraphLoader, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderGraphLoader)
+Q_DECLARE_METATYPE(QShaderGraphLoader::Status)
+
+#endif // QSHADERGRAPHLOADER_P_H
diff --git a/src/gui/util/qshaderlanguage.cpp b/src/gui/util/qshaderlanguage.cpp
new file mode 100644
index 0000000000..4a0da5bfb5
--- /dev/null
+++ b/src/gui/util/qshaderlanguage.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Layouts 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 "qshaderlanguage_p.h"
+
+#include <QtCore/qcoreapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+ void registerEnums()
+ {
+ qRegisterMetaType<QShaderLanguage::StorageQualifier>();
+ qRegisterMetaType<QShaderLanguage::VariableType>();
+ }
+}
+
+Q_COREAPP_STARTUP_FUNCTION(registerEnums)
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshaderlanguage_p.h b/src/gui/util/qshaderlanguage_p.h
new file mode 100644
index 0000000000..5c7819a3b8
--- /dev/null
+++ b/src/gui/util/qshaderlanguage_p.h
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Layouts 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 QSHADERLANGUAGE_P_H
+#define QSHADERLANGUAGE_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/qmetatype.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QShaderLanguage
+{
+ Q_GUI_EXPORT Q_NAMESPACE
+
+ enum StorageQualifier : char {
+ Const = 1,
+ Input,
+ Output,
+ Uniform
+ };
+ Q_ENUM_NS(StorageQualifier)
+
+ enum VariableType : int {
+ Bool = 1,
+ Int,
+ Uint,
+ Float,
+ Double,
+ Vec2,
+ Vec3,
+ Vec4,
+ DVec2,
+ DVec3,
+ DVec4,
+ BVec2,
+ BVec3,
+ BVec4,
+ IVec2,
+ IVec3,
+ IVec4,
+ UVec2,
+ UVec3,
+ UVec4,
+ Mat2,
+ Mat3,
+ Mat4,
+ Mat2x2,
+ Mat2x3,
+ Mat2x4,
+ Mat3x2,
+ Mat3x3,
+ Mat3x4,
+ Mat4x2,
+ Mat4x3,
+ Mat4x4,
+ DMat2,
+ DMat3,
+ DMat4,
+ DMat2x2,
+ DMat2x3,
+ DMat2x4,
+ DMat3x2,
+ DMat3x3,
+ DMat3x4,
+ DMat4x2,
+ DMat4x3,
+ DMat4x4,
+ Sampler1D,
+ Sampler2D,
+ Sampler3D,
+ SamplerCube,
+ Sampler2DRect,
+ Sampler2DMs,
+ SamplerBuffer,
+ Sampler1DArray,
+ Sampler2DArray,
+ Sampler2DMsArray,
+ SamplerCubeArray,
+ Sampler1DShadow,
+ Sampler2DShadow,
+ Sampler2DRectShadow,
+ Sampler1DArrayShadow,
+ Sampler2DArrayShadow,
+ SamplerCubeShadow,
+ SamplerCubeArrayShadow,
+ ISampler1D,
+ ISampler2D,
+ ISampler3D,
+ ISamplerCube,
+ ISampler2DRect,
+ ISampler2DMs,
+ ISamplerBuffer,
+ ISampler1DArray,
+ ISampler2DArray,
+ ISampler2DMsArray,
+ ISamplerCubeArray,
+ USampler1D,
+ USampler2D,
+ USampler3D,
+ USamplerCube,
+ USampler2DRect,
+ USampler2DMs,
+ USamplerBuffer,
+ USampler1DArray,
+ USampler2DArray,
+ USampler2DMsArray,
+ USamplerCubeArray
+ };
+ Q_ENUM_NS(VariableType)
+}
+
+QT_END_NAMESPACE
+
+#endif // QSHADERLANGUAGE_P_H
diff --git a/src/gui/util/qshadernode.cpp b/src/gui/util/qshadernode.cpp
new file mode 100644
index 0000000000..676667ddcf
--- /dev/null
+++ b/src/gui/util/qshadernode.cpp
@@ -0,0 +1,172 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Layouts 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 "qshadernode_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QShaderNode::Type QShaderNode::type() const Q_DECL_NOTHROW
+{
+ int inputCount = 0;
+ int outputCount = 0;
+ for (const auto &port : qAsConst(m_ports)) {
+ switch (port.direction) {
+ case QShaderNodePort::Input:
+ inputCount++;
+ break;
+ case QShaderNodePort::Output:
+ outputCount++;
+ break;
+ }
+ }
+
+ return (inputCount == 0 && outputCount == 0) ? Invalid
+ : (inputCount > 0 && outputCount == 0) ? Output
+ : (inputCount == 0 && outputCount > 0) ? Input
+ : Function;
+}
+
+QUuid QShaderNode::uuid() const Q_DECL_NOTHROW
+{
+ return m_uuid;
+}
+
+void QShaderNode::setUuid(const QUuid &uuid) Q_DECL_NOTHROW
+{
+ m_uuid = uuid;
+}
+
+QStringList QShaderNode::layers() const Q_DECL_NOTHROW
+{
+ return m_layers;
+}
+
+void QShaderNode::setLayers(const QStringList &layers) Q_DECL_NOTHROW
+{
+ m_layers = layers;
+}
+
+QVector<QShaderNodePort> QShaderNode::ports() const Q_DECL_NOTHROW
+{
+ return m_ports;
+}
+
+void QShaderNode::addPort(const QShaderNodePort &port)
+{
+ removePort(port);
+ m_ports.append(port);
+}
+
+void QShaderNode::removePort(const QShaderNodePort &port)
+{
+ const auto it = std::find_if(m_ports.begin(), m_ports.end(),
+ [port](const QShaderNodePort &p) {
+ return p.name == port.name;
+ });
+ if (it != m_ports.end())
+ m_ports.erase(it);
+}
+
+QStringList QShaderNode::parameterNames() const
+{
+ return m_parameters.keys();
+}
+
+QVariant QShaderNode::parameter(const QString &name) const
+{
+ return m_parameters.value(name);
+}
+
+void QShaderNode::setParameter(const QString &name, const QVariant &value)
+{
+ m_parameters.insert(name, value);
+}
+
+void QShaderNode::clearParameter(const QString &name)
+{
+ m_parameters.remove(name);
+}
+
+void QShaderNode::addRule(const QShaderFormat &format, const QShaderNode::Rule &rule)
+{
+ removeRule(format);
+ m_rules << qMakePair(format, rule);
+}
+
+void QShaderNode::removeRule(const QShaderFormat &format)
+{
+ const auto it = std::find_if(m_rules.begin(), m_rules.end(),
+ [format](const QPair<QShaderFormat, Rule> &entry) {
+ return entry.first == format;
+ });
+ if (it != m_rules.end())
+ m_rules.erase(it);
+}
+
+QVector<QShaderFormat> QShaderNode::availableFormats() const
+{
+ auto res = QVector<QShaderFormat>();
+ std::transform(m_rules.cbegin(), m_rules.cend(),
+ std::back_inserter(res),
+ [](const QPair<QShaderFormat, Rule> &entry) { return entry.first; });
+ return res;
+}
+
+QShaderNode::Rule QShaderNode::rule(const QShaderFormat &format) const
+{
+ const auto it = std::find_if(m_rules.crbegin(), m_rules.crend(),
+ [format](const QPair<QShaderFormat, Rule> &entry) {
+ return format.supports(entry.first);
+ });
+ return it != m_rules.crend() ? it->second : Rule();
+}
+
+QShaderNode::Rule::Rule(const QByteArray &subs, const QByteArrayList &snippets) Q_DECL_NOTHROW
+ : substitution(subs),
+ headerSnippets(snippets)
+{
+}
+
+bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW
+{
+ return lhs.substitution == rhs.substitution
+ && lhs.headerSnippets == rhs.headerSnippets;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshadernode_p.h b/src/gui/util/qshadernode_p.h
new file mode 100644
index 0000000000..494c87bc18
--- /dev/null
+++ b/src/gui/util/qshadernode_p.h
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Layouts 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 QSHADERNODE_P_H
+#define QSHADERNODE_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 <QtGui/private/qshaderformat_p.h>
+#include <QtGui/private/qshadernodeport_p.h>
+
+#include <QtCore/quuid.h>
+
+QT_BEGIN_NAMESPACE
+
+class QShaderNode
+{
+public:
+ enum Type : char {
+ Invalid,
+ Input,
+ Output,
+ Function
+ };
+
+ class Rule
+ {
+ public:
+ Q_GUI_EXPORT Rule(const QByteArray &substitution = QByteArray(), const QByteArrayList &headerSnippets = QByteArrayList()) Q_DECL_NOTHROW;
+
+ QByteArray substitution;
+ QByteArrayList headerSnippets;
+ };
+
+ Q_GUI_EXPORT Type type() const Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QUuid uuid() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setUuid(const QUuid &uuid) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QStringList layers() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setLayers(const QStringList &layers) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QVector<QShaderNodePort> ports() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void addPort(const QShaderNodePort &port);
+ Q_GUI_EXPORT void removePort(const QShaderNodePort &port);
+
+ Q_GUI_EXPORT QStringList parameterNames() const;
+ Q_GUI_EXPORT QVariant parameter(const QString &name) const;
+ Q_GUI_EXPORT void setParameter(const QString &name, const QVariant &value);
+ Q_GUI_EXPORT void clearParameter(const QString &name);
+
+ Q_GUI_EXPORT void addRule(const QShaderFormat &format, const Rule &rule);
+ Q_GUI_EXPORT void removeRule(const QShaderFormat &format);
+
+ Q_GUI_EXPORT QVector<QShaderFormat> availableFormats() const;
+ Q_GUI_EXPORT Rule rule(const QShaderFormat &format) const;
+
+private:
+ QUuid m_uuid;
+ QStringList m_layers;
+ QVector<QShaderNodePort> m_ports;
+ QHash<QString, QVariant> m_parameters;
+ QVector<QPair<QShaderFormat, QShaderNode::Rule>> m_rules;
+};
+
+Q_GUI_EXPORT bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_DECLARE_TYPEINFO(QShaderNode, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QShaderNode::Rule, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderNode)
+Q_DECLARE_METATYPE(QShaderNode::Rule)
+
+#endif // QSHADERNODE_P_H
diff --git a/src/gui/util/qshadernodeport.cpp b/src/gui/util/qshadernodeport.cpp
new file mode 100644
index 0000000000..03646a9467
--- /dev/null
+++ b/src/gui/util/qshadernodeport.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 "qshadernodeport_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QShaderNodePort::QShaderNodePort() Q_DECL_NOTHROW
+ : direction(Output)
+{
+}
+
+bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW
+{
+ return lhs.direction == rhs.direction
+ && lhs.name == rhs.name;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshadernodeport_p.h b/src/gui/util/qshadernodeport_p.h
new file mode 100644
index 0000000000..cfdaf05017
--- /dev/null
+++ b/src/gui/util/qshadernodeport_p.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 QSHADERNODEPORT_P_H
+#define QSHADERNODEPORT_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/qstring.h>
+#include <QtCore/qvariant.h>
+
+QT_BEGIN_NAMESPACE
+
+class QShaderNodePort
+{
+public:
+ enum Direction : char {
+ Input,
+ Output
+ };
+
+ Q_GUI_EXPORT QShaderNodePort() Q_DECL_NOTHROW;
+
+ QShaderNodePort::Direction direction;
+ QString name;
+};
+
+Q_GUI_EXPORT bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_DECLARE_TYPEINFO(QShaderNodePort, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderNodePort)
+
+#endif // QSHADERNODEPORT_P_H
diff --git a/src/gui/util/qshadernodesloader.cpp b/src/gui/util/qshadernodesloader.cpp
new file mode 100644
index 0000000000..db34b6d44d
--- /dev/null
+++ b/src/gui/util/qshadernodesloader.cpp
@@ -0,0 +1,274 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 "qshadernodesloader_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qiodevice.h>
+#include <QtCore/qjsonarray.h>
+#include <QtCore/qjsondocument.h>
+#include <QtCore/qjsonobject.h>
+#include <QtCore/qmetaobject.h>
+
+QT_BEGIN_NAMESPACE
+
+QShaderNodesLoader::QShaderNodesLoader() Q_DECL_NOTHROW
+ : m_status(Null),
+ m_device(nullptr)
+{
+}
+
+QShaderNodesLoader::Status QShaderNodesLoader::status() const Q_DECL_NOTHROW
+{
+ return m_status;
+}
+
+QHash<QString, QShaderNode> QShaderNodesLoader::nodes() const Q_DECL_NOTHROW
+{
+ return m_nodes;
+}
+
+QIODevice *QShaderNodesLoader::device() const Q_DECL_NOTHROW
+{
+ return m_device;
+}
+
+void QShaderNodesLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
+{
+ m_device = device;
+ m_nodes.clear();
+ m_status = !m_device ? Null
+ : (m_device->openMode() & QIODevice::ReadOnly) ? Waiting
+ : Error;
+}
+
+void QShaderNodesLoader::load()
+{
+ if (m_status == Error)
+ return;
+
+ auto error = QJsonParseError();
+ const auto document = QJsonDocument::fromJson(m_device->readAll(), &error);
+
+ if (error.error != QJsonParseError::NoError) {
+ qWarning() << "Invalid JSON document:" << error.errorString();
+ m_status = Error;
+ return;
+ }
+
+ if (document.isEmpty() || !document.isObject()) {
+ qWarning() << "Invalid JSON document, root should be an object";
+ m_status = Error;
+ return;
+ }
+
+ const auto root = document.object();
+
+ bool hasError = false;
+
+ for (const auto &property : root.keys()) {
+ const auto nodeValue = root.value(property);
+ if (!nodeValue.isObject()) {
+ qWarning() << "Invalid node found";
+ hasError = true;
+ break;
+ }
+
+ const auto nodeObject = nodeValue.toObject();
+
+ auto node = QShaderNode();
+
+ const auto inputsValue = nodeObject.value(QStringLiteral("inputs"));
+ if (inputsValue.isArray()) {
+ const auto inputsArray = inputsValue.toArray();
+ for (const auto &inputValue : inputsArray) {
+ if (!inputValue.isString()) {
+ qWarning() << "Non-string value in inputs";
+ hasError = true;
+ break;
+ }
+
+ auto input = QShaderNodePort();
+ input.direction = QShaderNodePort::Input;
+ input.name = inputValue.toString();
+ node.addPort(input);
+ }
+ }
+
+ const auto outputsValue = nodeObject.value(QStringLiteral("outputs"));
+ if (outputsValue.isArray()) {
+ const auto outputsArray = outputsValue.toArray();
+ for (const auto &outputValue : outputsArray) {
+ if (!outputValue.isString()) {
+ qWarning() << "Non-string value in outputs";
+ hasError = true;
+ break;
+ }
+
+ auto output = QShaderNodePort();
+ output.direction = QShaderNodePort::Output;
+ output.name = outputValue.toString();
+ node.addPort(output);
+ }
+ }
+
+ const auto parametersValue = nodeObject.value(QStringLiteral("parameters"));
+ if (parametersValue.isObject()) {
+ const auto parametersObject = parametersValue.toObject();
+ for (const auto &parameterName : parametersObject.keys()) {
+ const auto parameterValue = parametersObject.value(parameterName);
+ if (parameterValue.isObject()) {
+ const auto parameterObject = parameterValue.toObject();
+ const auto type = parameterObject.value(QStringLiteral("type")).toString();
+ const auto typeId = QMetaType::type(type.toUtf8());
+
+ const auto value = parameterObject.value(QStringLiteral("value")).toString();
+ auto variant = QVariant(value);
+
+ if (QMetaType::typeFlags(typeId) & QMetaType::IsEnumeration) {
+ const auto metaObject = QMetaType::metaObjectForType(typeId);
+ const auto className = metaObject->className();
+ const auto enumName = type.mid(static_cast<int>(qstrlen(className)) + 2).toUtf8();
+ const auto metaEnum = metaObject->enumerator(metaObject->indexOfEnumerator(enumName));
+ const auto enumValue = metaEnum.keyToValue(value.toUtf8());
+ variant = QVariant(enumValue);
+ variant.convert(typeId);
+ } else {
+ variant.convert(typeId);
+ }
+ node.setParameter(parameterName, variant);
+ } else {
+ node.setParameter(parameterName, parameterValue.toVariant());
+ }
+ }
+ }
+
+ const auto rulesValue = nodeObject.value(QStringLiteral("rules"));
+ if (rulesValue.isArray()) {
+ const auto rulesArray = rulesValue.toArray();
+ for (const auto &ruleValue : rulesArray) {
+ if (!ruleValue.isObject()) {
+ qWarning() << "Rules should be objects";
+ hasError = true;
+ break;
+ }
+
+ const auto ruleObject = ruleValue.toObject();
+
+ const auto formatValue = ruleObject.value(QStringLiteral("format"));
+ if (!formatValue.isObject()) {
+ qWarning() << "Format is mandatory in rules and should be an object";
+ hasError = true;
+ break;
+ }
+
+ const auto formatObject = formatValue.toObject();
+ auto format = QShaderFormat();
+
+ const auto apiValue = formatObject.value(QStringLiteral("api"));
+ if (!apiValue.isString()) {
+ qWarning() << "Format API must be a string";
+ hasError = true;
+ break;
+ }
+
+ const auto api = apiValue.toString();
+ format.setApi(api == QStringLiteral("OpenGLES") ? QShaderFormat::OpenGLES
+ : api == QStringLiteral("OpenGLNoProfile") ? QShaderFormat::OpenGLNoProfile
+ : api == QStringLiteral("OpenGLCoreProfile") ? QShaderFormat::OpenGLCoreProfile
+ : api == QStringLiteral("OpenGLCompatibilityProfile") ? QShaderFormat::OpenGLCompatibilityProfile
+ : QShaderFormat::NoApi);
+ if (format.api() == QShaderFormat::NoApi) {
+ qWarning() << "Format API must be one of: OpenGLES, OpenGLNoProfile, OpenGLCoreProfile or OpenGLCompatibilityProfile";
+ hasError = true;
+ break;
+ }
+
+ const auto majorValue = formatObject.value(QStringLiteral("major"));
+ const auto minorValue = formatObject.value(QStringLiteral("minor"));
+ if (!majorValue.isDouble() || !minorValue.isDouble()) {
+ qWarning() << "Format major and minor version must be values";
+ hasError = true;
+ break;
+ }
+ format.setVersion(QVersionNumber(majorValue.toInt(), minorValue.toInt()));
+
+ const auto extensionsValue = formatObject.value(QStringLiteral("extensions"));
+ const auto extensionsArray = extensionsValue.toArray();
+ auto extensions = QStringList();
+ std::transform(extensionsArray.constBegin(), extensionsArray.constEnd(),
+ std::back_inserter(extensions),
+ [] (const QJsonValue &extensionValue) { return extensionValue.toString(); });
+ format.setExtensions(extensions);
+
+ const auto vendor = formatObject.value(QStringLiteral("vendor")).toString();
+ format.setVendor(vendor);
+
+ const auto substitutionValue = ruleObject.value(QStringLiteral("substitution"));
+ if (!substitutionValue.isString()) {
+ qWarning() << "Substitution needs to be a string";
+ hasError = true;
+ break;
+ }
+
+ const auto substitution = substitutionValue.toString().toUtf8();
+
+ const auto snippetsValue = ruleObject.value(QStringLiteral("headerSnippets"));
+ const auto snippetsArray = snippetsValue.toArray();
+ auto snippets = QByteArrayList();
+ std::transform(snippetsArray.constBegin(), snippetsArray.constEnd(),
+ std::back_inserter(snippets),
+ [] (const QJsonValue &snippetValue) { return snippetValue.toString().toUtf8(); });
+
+ node.addRule(format, QShaderNode::Rule(substitution, snippets));
+ }
+ }
+
+ m_nodes.insert(property, node);
+ }
+
+ if (hasError) {
+ m_status = Error;
+ m_nodes.clear();
+ } else {
+ m_status = Ready;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/util/qshadernodesloader_p.h b/src/gui/util/qshadernodesloader_p.h
new file mode 100644
index 0000000000..2696e958b6
--- /dev/null
+++ b/src/gui/util/qshadernodesloader_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+** 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 QSHADERNODESLOADER_P_H
+#define QSHADERNODESLOADER_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 <QtGui/private/qshadergraph_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QIODevice;
+
+class QShaderNodesLoader
+{
+public:
+ enum Status : char {
+ Null,
+ Waiting,
+ Ready,
+ Error
+ };
+
+ Q_GUI_EXPORT QShaderNodesLoader() Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT Status status() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QHash<QString, QShaderNode> nodes() const Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT QIODevice *device() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT void setDevice(QIODevice *device) Q_DECL_NOTHROW;
+
+ Q_GUI_EXPORT void load();
+
+private:
+ Status m_status;
+ QIODevice *m_device;
+ QHash<QString, QShaderNode> m_nodes;
+};
+
+Q_DECLARE_TYPEINFO(QShaderNodesLoader, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QShaderNodesLoader)
+Q_DECLARE_METATYPE(QShaderNodesLoader::Status)
+
+#endif // QSHADERNODESLOADER_P_H
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp
index fb9dfc9f69..1709012291 100644
--- a/src/gui/util/qvalidator.cpp
+++ b/src/gui/util/qvalidator.cpp
@@ -420,9 +420,9 @@ QValidator::State QIntValidator::validate(QString & input, int&) const
if (buff.size() == 1 && (buff.at(0) == '+' || buff.at(0) == '-'))
return Intermediate;
- bool ok, overflow;
- qlonglong entered = QLocaleData::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow);
- if (overflow || !ok)
+ bool ok;
+ qlonglong entered = QLocaleData::bytearrayToLongLong(buff.constData(), 10, &ok);
+ if (!ok)
return Invalid;
if (entered >= b && entered <= t) {
@@ -447,9 +447,9 @@ void QIntValidator::fixup(QString &input) const
locale().numberOptions())) {
return;
}
- bool ok, overflow;
- qlonglong entered = QLocaleData::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow);
- if (ok && !overflow)
+ bool ok;
+ qlonglong entered = QLocaleData::bytearrayToLongLong(buff.constData(), 10, &ok);
+ if (ok)
input = locale().toString(entered);
}
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index 79c83599b9..cf3cbee48e 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -6,11 +6,27 @@ HEADERS += \
util/qvalidator.h \
util/qgridlayoutengine_p.h \
util/qabstractlayoutstyleinfo_p.h \
- util/qlayoutpolicy_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 \
+ util/qshadernode_p.h \
+ util/qshadernodeport_p.h \
+ util/qshadernodesloader_p.h
SOURCES += \
util/qdesktopservices.cpp \
util/qvalidator.cpp \
util/qgridlayoutengine.cpp \
util/qabstractlayoutstyleinfo.cpp \
- util/qlayoutpolicy.cpp
+ util/qlayoutpolicy.cpp \
+ util/qshaderformat.cpp \
+ util/qshadergenerator.cpp \
+ util/qshadergraph.cpp \
+ util/qshadergraphloader.cpp \
+ util/qshaderlanguage.cpp \
+ util/qshadernode.cpp \
+ util/qshadernodeport.cpp \
+ util/qshadernodesloader.cpp
diff --git a/src/gui/vulkan/KHRONOS_LICENSE.txt b/src/gui/vulkan/KHRONOS_LICENSE.txt
new file mode 100644
index 0000000000..7f6672d50e
--- /dev/null
+++ b/src/gui/vulkan/KHRONOS_LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2015-2017 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
+"Materials"), to deal in the Materials without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Materials, and to
+permit persons to whom the Materials are 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 Materials.
+
+THE MATERIALS ARE 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
+MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
diff --git a/src/gui/vulkan/qplatformvulkaninstance.cpp b/src/gui/vulkan/qplatformvulkaninstance.cpp
new file mode 100644
index 0000000000..6201d3ec11
--- /dev/null
+++ b/src/gui/vulkan/qplatformvulkaninstance.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qplatformvulkaninstance.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QPlatformVulkanInstance
+ \since 5.10
+ \internal
+ \preliminary
+ \ingroup qpa
+
+ \brief The QPlatformVulkanInstance class provides an abstraction for Vulkan instances.
+
+ The platform Vulkan instance is responsible for loading a Vulkan library,
+ resolving the basic entry points for creating instances, providing support
+ for creating new or adopting existing VkInstances, and abstracting some
+ WSI-specifics like checking if a given queue family can be used to present
+ using a given window.
+
+ \note platform plugins will typically subclass not this class, but rather
+ QBasicVulkanPlatformInstance.
+
+ \note Vulkan instance creation is split into two phases: a new
+ QPlatformVulkanInstance is expected to load the Vulkan library and do basic
+ initialization, after which the supported layers and extensions can be
+ queried. Everything else is deferred into createOrAdoptInstance().
+*/
+
+class QPlatformVulkanInstancePrivate
+{
+public:
+ QPlatformVulkanInstancePrivate() { }
+};
+
+QPlatformVulkanInstance::QPlatformVulkanInstance()
+ : d_ptr(new QPlatformVulkanInstancePrivate)
+{
+}
+
+QPlatformVulkanInstance::~QPlatformVulkanInstance()
+{
+}
+
+void QPlatformVulkanInstance::presentQueued(QWindow *window)
+{
+ Q_UNUSED(window);
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/vulkan/qplatformvulkaninstance.h b/src/gui/vulkan/qplatformvulkaninstance.h
new file mode 100644
index 0000000000..9470e2d0b4
--- /dev/null
+++ b/src/gui/vulkan/qplatformvulkaninstance.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QPLATFORMVULKANINSTANCE_H
+#define QPLATFORMVULKANINSTANCE_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is part of the QPA API and is not meant to be used
+// in applications. Usage of this API may make your code
+// source and binary incompatible with future versions of Qt.
+//
+
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
+
+#include <qvulkaninstance.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPlatformVulkanInstancePrivate;
+
+class Q_GUI_EXPORT QPlatformVulkanInstance
+{
+ Q_DECLARE_PRIVATE(QPlatformVulkanInstance)
+
+public:
+ QPlatformVulkanInstance();
+ virtual ~QPlatformVulkanInstance();
+
+ virtual QVulkanInfoVector<QVulkanLayer> supportedLayers() const = 0;
+ virtual QVulkanInfoVector<QVulkanExtension> supportedExtensions() const = 0;
+ virtual void createOrAdoptInstance() = 0;
+ virtual bool isValid() const = 0;
+ virtual VkResult errorCode() const = 0;
+ virtual VkInstance vkInstance() const = 0;
+ virtual QByteArrayList enabledLayers() const = 0;
+ virtual QByteArrayList enabledExtensions() const = 0;
+ virtual PFN_vkVoidFunction getInstanceProcAddr(const char *name) = 0;
+ virtual bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) = 0;
+ virtual void presentQueued(QWindow *window);
+
+private:
+ QScopedPointer<QPlatformVulkanInstancePrivate> d_ptr;
+ Q_DISABLE_COPY(QPlatformVulkanInstance)
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_CONFIG(vulkan)
+
+#endif // QPLATFORMVULKANINSTANCE_H
diff --git a/src/gui/vulkan/qt_attribution.json b/src/gui/vulkan/qt_attribution.json
new file mode 100644
index 0000000000..3c09e9f498
--- /dev/null
+++ b/src/gui/vulkan/qt_attribution.json
@@ -0,0 +1,17 @@
+[
+ {
+ "Id": "vulkan-xml-spec",
+ "Name": "Vulkan API Registry",
+ "QDocModule": "qtgui",
+ "Description": "Vulkan XML API Registry.",
+ "QtUsage": "Used to dynamically generate the sources for the QVulkan(Device)Functions classes.",
+ "Path": "vk.xml",
+
+ "Homepage": "https://www.khronos.org/",
+ "Version": "1.0.39",
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "KHRONOS_LICENSE.txt",
+ "Copyright": "Copyright (c) 2015-2017 The Khronos Group Inc."
+ }
+]
diff --git a/src/gui/vulkan/qvulkanfunctions.cpp b/src/gui/vulkan/qvulkanfunctions.cpp
new file mode 100644
index 0000000000..c5f9616d20
--- /dev/null
+++ b/src/gui/vulkan/qvulkanfunctions.cpp
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <private/qvulkanfunctions_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QVulkanFunctions
+ \since 5.10
+ \ingroup painting-3D
+ \inmodule QtGui
+ \wrapper
+
+ \brief The QVulkanFunctions class provides cross-platform access to the
+ instance level core Vulkan 1.0 API.
+
+ Qt and Qt applications do not link to any Vulkan libraries by default.
+ Instead, all functions are resolved dynamically at run time. Each
+ QVulkanInstance provides a QVulkanFunctions object retrievable via
+ QVulkanInstance::functions(). This does not contain device level functions
+ in order to avoid the potential overhead of an internal dispatching.
+ Instead, functions that rely on a device, or a dispatchable child object of
+ a device, are exposed via QVulkanDeviceFunctions and
+ QVulkanInstance::deviceFunctions(). QVulkanFunctions and
+ QVulkanDeviceFunctions together provides access to the full core Vulkan
+ API, excluding any extensions.
+
+ \note QVulkanFunctions instances cannot be constructed directly.
+
+ The typical usage is the following:
+
+ \code
+ void Window::render()
+ {
+ QVulkanInstance *inst = vulkanInstance();
+ QVulkanFunctions *f = inst->functions();
+ ...
+ VkResult err = f->vkAllocateCommandBuffers(device, &cmdBufInfo, &cmdBuf);
+ ...
+ }
+ \endcode
+
+ \note Windowing system interface (WSI) specifics and extensions are
+ excluded. This class only covers core Vulkan commands, with the exception
+ of instance creation, destruction, and function resolving, since such
+ functionality is covered by QVulkanInstance itself.
+
+ To access additional functions, applications can use
+ QVulkanInstance::getInstanceProcAddr() and vkGetDeviceProcAddr().
+ Applications can also decide to link to a Vulkan library directly, as
+ platforms with an appropriate loader will typically export function symbols
+ for the core commands. See
+ \l{https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetInstanceProcAddr.html}{the
+ man page for vkGetInstanceProcAddr} for more information.
+
+ \sa QVulkanInstance, QVulkanDeviceFunctions, QWindow::setVulkanInstance(), QWindow::setSurfaceType()
+*/
+
+/*!
+ \class QVulkanDeviceFunctions
+ \since 5.10
+ \ingroup painting-3D
+ \inmodule QtGui
+ \wrapper
+
+ \brief The QVulkanDeviceFunctions class provides cross-platform access to
+ the device level core Vulkan 1.0 API.
+
+ Qt and Qt applications do not link to any Vulkan libraries by default.
+ Instead, all functions are resolved dynamically at run time. Each
+ QVulkanInstance provides a QVulkanFunctions object retrievable via
+ QVulkanInstance::functions(). This does not contain device level functions
+ in order to avoid the potential overhead of an internal dispatching.
+ Instead, functions that rely on a device, or a dispatchable child object of
+ a device, are exposed via QVulkanDeviceFunctions and
+ QVulkanInstance::deviceFunctions(). QVulkanFunctions and
+ QVulkanDeviceFunctions together provides access to the full core Vulkan
+ API, excluding any extensions.
+
+ \note QVulkanDeviceFunctions instances cannot be constructed directly.
+
+ The typical usage is the following:
+
+ \code
+ void Window::render()
+ {
+ QVulkanInstance *inst = vulkanInstance();
+ QVulkanDeviceFunctions *df = inst->deviceFunctions(device);
+ VkResult err = df->vkAllocateCommandBuffers(device, &cmdBufInfo, &cmdBuf);
+ ...
+ }
+ \endcode
+
+ The QVulkanDeviceFunctions object specific to the provided VkDevice is
+ created when QVulkanInstance::deviceFunctions() is first called with the
+ device in question. The object is then cached internally.
+
+ To access additional functions, applications can use
+ QVulkanInstance::getInstanceProcAddr() and vkGetDeviceProcAddr().
+ Applications can also decide to link to a Vulkan library directly, as many
+ implementations export function symbols for the core commands. See
+ \l{https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetInstanceProcAddr.html}{the
+ man page for vkGetInstanceProcAddr} for more information.
+
+ \sa QVulkanInstance, QVulkanFunctions, QWindow::setVulkanInstance(), QWindow::setSurfaceType()
+*/
+
+/*
+ Constructs a new QVulkanFunctions for \a inst.
+ \internal
+ */
+QVulkanFunctions::QVulkanFunctions(QVulkanInstance *inst)
+ : d_ptr(new QVulkanFunctionsPrivate(inst))
+{
+}
+
+/*
+ Destructor.
+ */
+QVulkanFunctions::~QVulkanFunctions()
+{
+}
+
+/*
+ Constructs a new QVulkanDeviceFunctions for \a inst and the given \a device.
+ \internal
+ */
+QVulkanDeviceFunctions::QVulkanDeviceFunctions(QVulkanInstance *inst, VkDevice device)
+ : d_ptr(new QVulkanDeviceFunctionsPrivate(inst, device))
+{
+}
+
+/*
+ Destructor.
+ */
+QVulkanDeviceFunctions::~QVulkanDeviceFunctions()
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/vulkan/qvulkaninstance.cpp b/src/gui/vulkan/qvulkaninstance.cpp
new file mode 100644
index 0000000000..8f364328d6
--- /dev/null
+++ b/src/gui/vulkan/qvulkaninstance.cpp
@@ -0,0 +1,894 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qvulkaninstance.h"
+#include <private/qvulkanfunctions_p.h>
+#include <qpa/qplatformvulkaninstance.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformnativeinterface.h>
+#include <QtGui/private/qguiapplication_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QVulkanInstance
+ \since 5.10
+ \inmodule QtGui
+
+ \brief The QVulkanInstance class represents a native Vulkan instance, enabling
+ Vulkan rendering onto a QSurface.
+
+ \l{https://www.khronos.org/vulkan/}{Vulkan} is a cross-platform, explicit
+ graphics and compute API. This class provides support for loading a Vulkan
+ library and creating an \c instance in a cross-platform manner. For an
+ introduction on Vulkan instances, refer
+ \l{https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#initialization-instances}{to
+ section 3.2 of the specification}.
+
+ \note Platform-specific support for Vulkan instances and windows with
+ Vulkan-capable surfaces is provided by the various platform plugins. Not
+ all of them will support Vulkan, however. When running on such a platform,
+ create() will fail and always return \c false.
+
+ \note Vulkan support may get automatically disabled for a given Qt build due
+ to not having the necessary Vulkan headers available at build time. When
+ this is the case, and the output of \c configure indicates Vulkan support is
+ disabled, the QVulkan* classes will be unavailable.
+
+ \note Some functions changed their signature between the various Vulkan
+ header revisions. When building Qt and only headers with the old,
+ conflicting signatures are present in a system, Vulkan support will get
+ disabled. It is recommended to use headers from Vulkan 1.0.39 or newer.
+
+ \section1 Initialization
+
+ Similarly to QOpenGLContext, any actual Vulkan instance creation happens
+ only when calling create(). This allows using QVulkanInstance as a plain
+ member variable while retaining control over when to perform
+ initialization.
+
+ Querying the supported instance-level layers and extensions is possible by
+ calling supportedLayers() and supportedExtensions(). These ensure the
+ Vulkan library is loaded, and can therefore be called safely before
+ create() as well.
+
+ Instances store per-application Vulkan state and creating a \c VkInstance
+ object initializes the Vulkan library. In practice there will typically be
+ a single instance constructed early on in main(). The object then stays
+ alive until exiting the application.
+
+ Every Vulkan-based QWindow must be associated with a QVulkanInstance by
+ calling QWindow::setVulkanInstance(). Thus a typical application pattern is
+ the following:
+
+ \code
+ int main(int argc, char **argv)
+ {
+ QGuiApplication app(argc, argv);
+
+ QVulkanInstance inst;
+ if (!inst.create())
+ return 1;
+
+ ...
+ window->setVulkanInstance(&inst);
+ window->show();
+
+ return app.exec();
+ }
+ \endcode
+
+ \section1 Configuration
+
+ QVulkanInstance automatically enables the minimum set of extensions it
+ needs on the newly created instance. In practice this means the
+ \c{VK_KHR_*_surface} family of extensions.
+
+ By default Vulkan debug output, for example messages from the validation
+ layers, is routed to qDebug(). This can be disabled by passing the flag
+ \c NoDebugOutputRedirect to setFlags() \e before invoking create().
+
+ To enable additional layers and extensions, provide the list via
+ setLayers() and setExtensions() \e before invoking create(). When a
+ given layer or extension is not reported as available from the instance,
+ the request is ignored. After a successful call to create(), the values
+ returned from functions like layers() and extensions() reflect the actual
+ enabled layers and extensions. When necessary, for example to avoid
+ requesting extensions that conflict and thus would fail the Vulkan instance
+ creation, the list of actually supported layers and extensions can be
+ examined via supportedLayers() and supportedExtensions() before calling
+ create().
+
+ For example, to enable the standard validation layers, one could do the
+ following:
+
+ \code
+ QVulkanInstance inst;
+
+ // Enable validation layer, if supported. Messages go to qDebug by default.
+ inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation");
+
+ bool ok = inst.create();
+ if (!ok)
+ ... // Vulkan not available
+ if (!inst.layers().contains("VK_LAYER_LUNARG_standard_validation"))
+ ... // validation layer not available
+ \endcode
+
+ Or, alternatively, to make decisions before attempting to create a Vulkan
+ instance:
+
+ \code
+ QVulkanInstance inst;
+
+ if (inst.supportedLayers().contains("VK_LAYER_LUNARG_standard_validation"))
+ ...
+
+ bool ok = inst.create();
+ ...
+ \endcode
+
+ \section1 Adopting an Existing Instance
+
+ By default QVulkanInstance creates a new Vulkan instance. When working with
+ external engines and renderers, this may sometimes not be desirable. When
+ there is a \c VkInstance handle already available, call setVkInstance()
+ before invoking create(). This way no additional instances will get
+ created, and QVulkanInstance will not own the handle.
+
+ \note It is up to the component creating the external instance to ensure
+ the necessary extensions are enabled on it. These are: \c{VK_KHR_surface},
+ the WSI-specific \c{VK_KHR_*_surface} that is appropriate for the platform
+ in question, and \c{VK_EXT_debug_report} in case QVulkanInstance's debug
+ output redirection is desired.
+
+ \section1 Accessing Core Vulkan Commands
+
+ To access the \c VkInstance handle the QVulkanInstance wraps, call
+ vkInstance(). To resolve Vulkan functions, call getInstanceProcAddr(). For
+ core Vulkan commands manual resolving is not necessary as they are provided
+ via the QVulkanFunctions and QVulkanDeviceFunctions objects accessible via
+ functions() and deviceFunctions().
+
+ \note QVulkanFunctions and QVulkanDeviceFunctions are generated from the
+ Vulkan API XML specifications when building the Qt libraries. Therefore no
+ documentation is provided for them. They contain the Vulkan 1.0 functions
+ with the same signatures as described in the
+ \l{https://www.khronos.org/registry/vulkan/specs/1.0/html/}{Vulkan API
+ documentation}.
+
+ \section1 Getting a Native Vulkan Surface for a Window
+
+ The two common windowing system specific operations are getting a surface
+ (a \c{VkSurfaceKHR} handle) for a window, and querying if a given queue
+ family supports presenting to a given surface. To avoid WSI-specific bits
+ in the applications, these are abstracted by QVulkanInstance and the
+ underlying QPA layers.
+
+ To create a Vulkan surface for a window, or retrieve an existing one,
+ call surfaceForWindow(). Most platforms will only create the surface via
+ \c{VK_KHR_*_surface} when first calling surfaceForWindow(), but there may be
+ platform-specific variations in the internal behavior. Once created,
+ subsequent calls to surfaceForWindow() just return the same handle. This
+ fits the structure of typical Vulkan-enabled QWindow subclasses well.
+
+ To query if a given queue family within a physical device can be used to
+ perform presentation to a given surface, call supportsPresent(). This
+ encapsulates both the generic \c vkGetPhysicalDeviceSurfaceSupportKHR and
+ the WSI-specific \c{vkGetPhysicalDevice*PresentationSupportKHR} checks.
+
+ \section1 Troubleshooting
+
+ Besides returning \c false from create() or \c 0 from surfaceForWindow(),
+ critical errors will also get printed to the debug output via qWarning().
+ Additional logging can be requested by enabling debug output for the
+ logging category \c{qt.vulkan}. The actual Vulkan error code from instance
+ creation can be retrieved by calling errorCode() after a failing create().
+
+ In some special cases it may be necessary to override the Vulkan
+ library name. This can be achieved by setting the \c{QT_VULKAN_LIB}
+ environment variable.
+
+ \section1 Example
+
+ The following is the basic outline of creating a Vulkan-capable QWindow:
+
+ \code
+ class VulkanWindow : public QWindow
+ {
+ public:
+ VulkanWindow() {
+ setSurfaceType(VulkanSurface);
+ }
+
+ void exposeEvent(QExposeEvent *) {
+ if (isExposed()) {
+ if (!m_initialized) {
+ m_initialized = true;
+ // initialize device, swapchain, etc.
+ QVulkanInstance *inst = vulkanInstance();
+ QVulkanFunctions *f = inst->functions();
+ uint32_t devCount = 0;
+ f->vkEnumeratePhysicalDevices(inst->vkInstance(), &devCount, nullptr);
+ ...
+ // build the first frame
+ render();
+ }
+ }
+ }
+
+ bool event(QEvent *e) {
+ if (e->type == QEvent::UpdateRequest)
+ render();
+ return QWindow::event(e);
+ }
+
+ void render() {
+ ...
+ requestUpdate(); // render continuously
+ }
+
+ private:
+ bool m_initialized = false;
+ };
+
+ int main(int argc, char **argv)
+ {
+ QGuiApplication app(argc, argv);
+
+ QVulkanInstance inst;
+ if (!inst.create()) {
+ qWarning("Vulkan not available");
+ return 1;
+ }
+
+ VulkanWindow window;
+ window.showMaximized();
+
+ return app.exec();
+
+ }
+ \endcode
+
+ \note In addition to expose, a well-behaving window implementation will
+ also have to take care of additional events like resize and
+ QPlatformSurfaceEvent in order to ensure proper management of the
+ swap chain. Additionally, some platforms may require releasing resources
+ when not being exposed anymore.
+
+ \section1 Using C++ Bindings for Vulkan
+
+ Combining Qt's Vulkan enablers with a C++ Vulkan wrapper, for example
+ \l{https://github.com/KhronosGroup/Vulkan-Hpp}{Vulkan-Hpp}, is possible as
+ well. The pre-requisite here is that the C++ layer must be able to adopt
+ native handles (VkInstance, VkSurfaceKHR) in its classes without taking
+ ownership (since the ownership stays with QVulkanInstance and QWindow).
+ Consider also the following:
+
+ \list
+
+ \li Some wrappers require exception support to be enabled. Qt does not use
+ exceptions. To enable exceptions for the application, add \c{CONFIG += exceptions}
+ to the \c{.pro} file.
+
+ \li Some wrappers call Vulkan functions directly, assuming \c{vulkan.h}
+ provides prototypes and the application links to a Vulkan library exporting
+ all necessary symbols. Qt may not directly link to a Vulkan library.
+ Therefore, on some platforms it may be necessary to add
+ \c{LIBS += -lvulkan} or similar in the application's \c{.pro} file.
+
+ \li The headers for the QVulkan classes may include \c{vulkan.h} with
+ \c{VK_NO_PROTOTYPES} enabled. This can cause issues in C++ wrapper headers
+ that rely on the prototypes. Hence in application code it may be
+ necessary to include \c{vulkan.hpp} or similar before any of the QVulkan
+ headers.
+
+ \endlist
+
+ \sa QVulkanFunctions, QSurface::SurfaceType
+*/
+
+/*!
+ \enum QVulkanInstance::Flag
+ \since 5.10
+
+ This enum describes the flags that can be passed to setFlags(). These control
+ the behavior of create().
+
+ \value NoDebugOutputRedirect Disables Vulkan debug output (\c{VK_EXT_debug_report}) redirection to qDebug.
+*/
+
+class QVulkanInstancePrivate
+{
+public:
+ QVulkanInstancePrivate(QVulkanInstance *q)
+ : q_ptr(q),
+ vkInst(VK_NULL_HANDLE),
+ flags(0),
+ errorCode(VK_SUCCESS)
+ { }
+ ~QVulkanInstancePrivate() { reset(); }
+
+ bool ensureVulkan();
+ void reset();
+
+ QVulkanInstance *q_ptr;
+ QScopedPointer<QPlatformVulkanInstance> platformInst;
+ VkInstance vkInst;
+ QVulkanInstance::Flags flags;
+ QByteArrayList layers;
+ QByteArrayList extensions;
+ QVersionNumber apiVersion;
+ VkResult errorCode;
+ QScopedPointer<QVulkanFunctions> funcs;
+ QHash<VkDevice, QVulkanDeviceFunctions *> deviceFuncs;
+};
+
+bool QVulkanInstancePrivate::ensureVulkan()
+{
+ if (!platformInst) {
+ platformInst.reset(QGuiApplicationPrivate::platformIntegration()->createPlatformVulkanInstance(q_ptr));
+ if (!platformInst) {
+ qWarning("QVulkanInstance: Failed to initialize Vulkan");
+ return false;
+ }
+ }
+ return true;
+}
+
+void QVulkanInstancePrivate::reset()
+{
+ qDeleteAll(deviceFuncs);
+ deviceFuncs.clear();
+ funcs.reset();
+ platformInst.reset();
+ vkInst = VK_NULL_HANDLE;
+ errorCode = VK_SUCCESS;
+}
+
+/*!
+ Constructs a new instance.
+
+ \note No Vulkan initialization is performed in the constructor.
+ */
+QVulkanInstance::QVulkanInstance()
+ : d_ptr(new QVulkanInstancePrivate(this))
+{
+}
+
+/*!
+ Destructor.
+
+ \note current() will return \c nullptr once the instance is destroyed.
+ */
+QVulkanInstance::~QVulkanInstance()
+{
+ destroy();
+}
+
+/*!
+ \class QVulkanLayer
+ \brief Represents information about a Vulkan layer.
+ */
+
+/*!
+ \variable QVulkanLayer::name
+ \brief The name of the layer.
+ */
+
+/*!
+ \variable QVulkanLayer::version
+ \brief The version of the layer. This is an integer, increasing with each backward
+ compatible change.
+ */
+
+/*!
+ \variable QVulkanLayer::specVersion
+ \brief The Vulkan version the layer was written against.
+ */
+
+/*!
+ \variable QVulkanLayer::description
+ \brief The description of the layer.
+ */
+
+/*!
+ \fn bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs)
+ \since 5.10
+ \relates QVulkanLayer
+
+ Returns \c true if Vulkan layers \a lhs and \a rhs have
+ the same name, version, and spec version.
+*/
+
+/*!
+ \fn bool operator!=(const QVulkanLayer &lhs, const QVulkanLayer &rhs)
+ \since 5.10
+ \relates QVulkanLayer
+
+ Returns \c true if Vulkan layers \a lhs and \a rhs have
+ different name, version, or spec version.
+*/
+
+/*!
+ \fn uint qHash(const QVulkanLayer &key, uint seed)
+ \since 5.10
+ \relates QVulkanLayer
+
+ Returns the hash value for the \a key, using \a seed to seed the
+ calculation.
+*/
+
+/*!
+ \class QVulkanExtension
+ \brief Represents information about a Vulkan extension.
+ */
+
+/*!
+ \variable QVulkanExtension::name
+ \brief The name of the extension.
+ */
+
+/*!
+ \variable QVulkanExtension::version
+ \brief The version of the extension. This is an integer, increasing with each backward
+ compatible change.
+ */
+
+/*!
+ \fn bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs)
+ \since 5.10
+ \relates QVulkanExtension
+
+ Returns \c true if Vulkan extensions \a lhs and \a rhs are have the
+ same name and version.
+*/
+
+/*!
+ \fn bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs)
+ \since 5.10
+ \relates QVulkanExtension
+
+ Returns \c true if Vulkan extensions \a lhs and \a rhs are have different
+ name or version.
+*/
+
+/*!
+ \fn uint qHash(const QVulkanExtension &key, uint seed)
+ \since 5.10
+ \relates QVulkanExtension
+
+ Returns the hash value for the \a key, using \a seed to seed the
+ calculation.
+*/
+
+/*!
+ \class QVulkanInfoVector
+ \brief A specialized QVector for QVulkanLayer and QVulkanExtension.
+ */
+
+/*!
+ \fn bool QVulkanInfoVector::contains(const QByteArray &name) const
+
+ \return true if the vector contains a layer or extension with the given \a name.
+ */
+
+/*!
+ \fn bool QVulkanInfoVector::contains(const QByteArray &name, int minVersion) const
+
+ \return true if the vector contains a layer or extension with the given
+ \a name and a version same as or newer than \a minVersion.
+ */
+
+/*!
+ \return the list of supported instance-level layers.
+
+ \note This function can be called before create().
+ */
+QVulkanInfoVector<QVulkanLayer> QVulkanInstance::supportedLayers()
+{
+ return d_ptr->ensureVulkan() ? d_ptr->platformInst->supportedLayers() : QVulkanInfoVector<QVulkanLayer>();
+}
+
+/*!
+ \return the list of supported instance-level extensions.
+
+ \note This function can be called before create().
+ */
+QVulkanInfoVector<QVulkanExtension> QVulkanInstance::supportedExtensions()
+{
+ return d_ptr->ensureVulkan() ? d_ptr->platformInst->supportedExtensions() : QVulkanInfoVector<QVulkanExtension>();
+}
+
+/*!
+ Makes QVulkanInstance adopt an existing VkInstance handle instead of
+ creating a new one.
+
+ \note \a existingVkInstance must have at least \c{VK_KHR_surface} and the
+ appropriate WSI-specific \c{VK_KHR_*_surface} extensions enabled. To ensure
+ debug output redirection is functional, \c{VK_EXT_debug_report} is needed as
+ well.
+
+ \note This function can only be called before create() and has no effect if
+ called afterwards.
+ */
+void QVulkanInstance::setVkInstance(VkInstance existingVkInstance)
+{
+ if (isValid()) {
+ qWarning("QVulkanInstance already created; setVkInstance() has no effect");
+ return;
+ }
+
+ d_ptr->vkInst = existingVkInstance;
+}
+
+/*!
+ Configures the behavior of create() based on the provided \a flags.
+
+ \note This function can only be called before create() and has no effect if
+ called afterwards.
+ */
+void QVulkanInstance::setFlags(Flags flags)
+{
+ if (isValid()) {
+ qWarning("QVulkanInstance already created; setFlags() has no effect");
+ return;
+ }
+
+ d_ptr->flags = flags;
+}
+
+/*!
+ Specifies the list of instance \a layers to enable. It is safe to specify
+ unsupported layers as well because these get ignored when not supported at
+ run time.
+
+ \note This function can only be called before create() and has no effect if
+ called afterwards.
+ */
+void QVulkanInstance::setLayers(const QByteArrayList &layers)
+{
+ if (isValid()) {
+ qWarning("QVulkanInstance already created; setLayers() has no effect");
+ return;
+ }
+
+ d_ptr->layers = layers;
+}
+
+/*!
+ Specifies the list of additional instance \a extensions to enable. It is
+ safe to specify unsupported extensions as well because these get ignored
+ when not supported at run time. The surface-related extensions required by
+ Qt will always be added automatically, no need to include them in this
+ list.
+
+ \note This function can only be called before create() and has no effect if
+ called afterwards.
+ */
+void QVulkanInstance::setExtensions(const QByteArrayList &extensions)
+{
+ if (isValid()) {
+ qWarning("QVulkanInstance already created; setExtensions() has no effect");
+ return;
+ }
+
+ d_ptr->extensions = extensions;
+}
+
+/*!
+ Specifies the Vulkan API against which the application expects to run.
+
+ By default no \a vulkanVersion is specified, and so no version check is performed
+ during Vulkan instance creation.
+
+ \note This function can only be called before create() and has no effect if
+ called afterwards.
+ */
+void QVulkanInstance::setApiVersion(const QVersionNumber &vulkanVersion)
+{
+ if (isValid()) {
+ qWarning("QVulkanInstance already created; setApiVersion() has no effect");
+ return;
+ }
+
+ d_ptr->apiVersion = vulkanVersion;
+}
+
+/*!
+ Initializes the Vulkan library and creates a new or adopts and existing
+ Vulkan instance.
+
+ \return true if successful, false on error or when Vulkan is not supported.
+
+ When successful, the pointer to this QVulkanInstance is retrievable via the
+ static function current().
+
+ The Vulkan instance and library is available as long as this
+ QVulkanInstance exists, or until destroy() is called.
+ */
+bool QVulkanInstance::create()
+{
+ if (isValid())
+ destroy();
+
+ if (!d_ptr->ensureVulkan())
+ return false;
+
+ d_ptr->platformInst->createOrAdoptInstance();
+
+ if (d_ptr->platformInst->isValid()) {
+ d_ptr->vkInst = d_ptr->platformInst->vkInstance();
+ d_ptr->layers = d_ptr->platformInst->enabledLayers();
+ d_ptr->extensions = d_ptr->platformInst->enabledExtensions();
+ d_ptr->errorCode = VK_SUCCESS;
+ d_ptr->funcs.reset(new QVulkanFunctions(this));
+ return true;
+ }
+
+ qWarning("Failed to create platform Vulkan instance");
+ if (d_ptr->platformInst) {
+ d_ptr->errorCode = d_ptr->platformInst->errorCode();
+ d_ptr->platformInst.reset();
+ } else {
+ d_ptr->errorCode = VK_NOT_READY;
+ }
+ return false;
+}
+
+/*!
+ Destroys the underlying platform instance, thus destroying the VkInstance
+ (when owned). The QVulkanInstance object is still reusable by calling
+ create() again.
+ */
+void QVulkanInstance::destroy()
+{
+ d_ptr->reset();
+}
+
+/*!
+ \return true if create() was successful and the instance is valid.
+ */
+bool QVulkanInstance::isValid() const
+{
+ return d_ptr->platformInst && d_ptr->platformInst->isValid();
+}
+
+/*!
+ \return the Vulkan error code after an unsuccessful create(), \c VK_SUCCESS otherwise.
+
+ The value is typically the return value from vkCreateInstance() (when
+ creating a new Vulkan instance instead of adopting an existing one), but
+ may also be \c VK_NOT_READY if the platform plugin does not support Vulkan.
+ */
+VkResult QVulkanInstance::errorCode() const
+{
+ return d_ptr->errorCode;
+}
+
+/*!
+ \return the VkInstance handle this QVulkanInstance wraps, or \c null if
+ create() has not yet been successfully called and no existing instance has
+ been provided via setVkInstance().
+ */
+VkInstance QVulkanInstance::vkInstance() const
+{
+ return d_ptr->vkInst;
+}
+
+/*!
+ \return the requested flags.
+ */
+QVulkanInstance::Flags QVulkanInstance::flags() const
+{
+ return d_ptr->flags;
+}
+
+/*!
+ \return the enabled instance layers, if create() was called and was successful. The
+ requested layers otherwise.
+ */
+QByteArrayList QVulkanInstance::layers() const
+{
+ return d_ptr->layers;
+}
+
+/*!
+ \return the enabled instance extensions, if create() was called and was
+ successful. The requested extensions otherwise.
+ */
+QByteArrayList QVulkanInstance::extensions() const
+{
+ return d_ptr->extensions;
+}
+
+/*!
+ \return the requested Vulkan API version against which the application
+ expects to run, or a null version number if setApiVersion() was not called
+ before create().
+ */
+QVersionNumber QVulkanInstance::apiVersion() const
+{
+ return d_ptr->apiVersion;
+}
+
+/*!
+ Resolves the Vulkan function with the given \a name.
+
+ For core Vulkan commands prefer using the function wrappers retrievable from
+ functions() and deviceFunctions() instead.
+ */
+PFN_vkVoidFunction QVulkanInstance::getInstanceProcAddr(const char *name)
+{
+ // The return value is PFN_vkVoidFunction instead of QFunctionPointer or
+ // similar because on some platforms honoring VKAPI_PTR is important.
+ return d_ptr->platformInst->getInstanceProcAddr(name);
+}
+
+/*!
+ \return the platform Vulkan instance corresponding to this QVulkanInstance.
+
+ \internal
+ */
+QPlatformVulkanInstance *QVulkanInstance::handle() const
+{
+ return d_ptr->platformInst.data();
+}
+
+/*!
+ \return the corresponding QVulkanFunctions object that exposes the core
+ Vulkan command set, excluding device level functions, and is guaranteed to
+ be functional cross-platform.
+
+ \note The returned object is owned and managed by the QVulkanInstance. Do
+ not destroy or alter it.
+
+ \sa deviceFunctions()
+ */
+QVulkanFunctions *QVulkanInstance::functions() const
+{
+ return d_ptr->funcs.data();
+}
+
+/*!
+ \return the QVulkanDeviceFunctions object that exposes the device level
+ core Vulkan command set and is guaranteed to be functional cross-platform.
+
+ \note The Vulkan functions in the returned object must only be called with
+ \a device or a child object (VkQueue, VkCommandBuffer) of \a device as
+ their first parameter. This is because these functions are resolved via
+ \l{https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetDeviceProcAddr.html}{vkGetDeviceProcAddr}
+ in order to avoid the potential overhead of internal dispatching.
+
+ \note The returned object is owned and managed by the QVulkanInstance. Do
+ not destroy or alter it.
+
+ \note The object is cached so calling this function with the same \a device
+ again is a cheap operation. However, when the device gets destroyed, it is up
+ to the application to notify the QVulkanInstance by calling
+ resetDeviceFunctions().
+
+ \sa functions(), resetDeviceFunctions()
+ */
+QVulkanDeviceFunctions *QVulkanInstance::deviceFunctions(VkDevice device)
+{
+ QVulkanDeviceFunctions *&f(d_ptr->deviceFuncs[device]);
+ if (!f)
+ f = new QVulkanDeviceFunctions(this, device);
+ return f;
+}
+
+/*!
+ Invalidates and destroys the QVulkanDeviceFunctions object for the given
+ \a device.
+
+ This function must be called when a VkDevice, for which deviceFunctions()
+ was called, gets destroyed while the application intends to continue
+ running, possibly creating a new logical Vulkan device later on.
+
+ There is no need to call this before destroying the QVulkanInstance since
+ clean up is then performed automatically.
+
+ \sa deviceFunctions()
+ */
+void QVulkanInstance::resetDeviceFunctions(VkDevice device)
+{
+ QVulkanDeviceFunctions *&f(d_ptr->deviceFuncs[device]);
+ delete f;
+ f = nullptr;
+}
+
+/*!
+ Creates or retrieves the already existing \c{VkSurfaceKHR} handle for the
+ given \a window.
+
+ \return the Vulkan surface handle or 0 when failed.
+ */
+VkSurfaceKHR QVulkanInstance::surfaceForWindow(QWindow *window)
+{
+ QPlatformNativeInterface *nativeInterface = qGuiApp->platformNativeInterface();
+ // VkSurfaceKHR is non-dispatchable and maps to a pointer on x64 and a uint64 on x86.
+ // Therefore a pointer is returned from the platform plugin, not the value itself.
+ void *p = nativeInterface->nativeResourceForWindow(QByteArrayLiteral("vkSurface"), window);
+ return p ? *static_cast<VkSurfaceKHR *>(p) : 0;
+}
+
+/*!
+ \return true if the queue family with \a queueFamilyIndex within the
+ \a physicalDevice supports presenting to \a window.
+
+ Call this function when examining the queues of a given Vulkan device, in
+ order to decide which queue can be used for performing presentation.
+ */
+bool QVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window)
+{
+ return d_ptr->platformInst->supportsPresent(physicalDevice, queueFamilyIndex, window);
+}
+
+/*!
+ This function should be called by the application's renderer after queuing
+ a present operation for \a window.
+
+ While on some platforms this will be a no-op, some may perform windowing
+ system dependent synchronization. For example, on X11 this will update
+ \c{_NET_WM_SYNC_REQUEST_COUNTER}.
+ */
+void QVulkanInstance::presentQueued(QWindow *window)
+{
+ d_ptr->platformInst->presentQueued(window);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QVulkanLayer &layer)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QVulkanLayer(" << layer.name << " " << layer.version
+ << " " << layer.specVersion << " " << layer.description << ")";
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QVulkanExtension &extension)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QVulkanExtension(" << extension.name << " " << extension.version << ")";
+ return dbg;
+}
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/gui/vulkan/qvulkaninstance.h b/src/gui/vulkan/qvulkaninstance.h
new file mode 100644
index 0000000000..ada297be43
--- /dev/null
+++ b/src/gui/vulkan/qvulkaninstance.h
@@ -0,0 +1,198 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QVULKANINSTANCE_H
+#define QVULKANINSTANCE_H
+
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
+
+#ifndef VK_NO_PROTOTYPES
+#define VK_NO_PROTOTYPES
+#endif
+#ifndef Q_CLANG_QDOC
+#include <vulkan/vulkan.h>
+#else
+typedef void* PFN_vkVoidFunction;
+typedef unsigned long VkSurfaceKHR;
+typedef unsigned long VkImage;
+typedef unsigned long VkImageView;
+#endif
+
+#include <QtCore/qhashfunctions.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qbytearraylist.h>
+#include <QtCore/qversionnumber.h>
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVulkanInstancePrivate;
+class QPlatformVulkanInstance;
+class QVulkanFunctions;
+class QVulkanDeviceFunctions;
+class QWindow;
+
+struct QVulkanLayer
+{
+ QByteArray name;
+ uint32_t version;
+ QVersionNumber specVersion;
+ QByteArray description;
+};
+Q_DECLARE_TYPEINFO(QVulkanLayer, Q_MOVABLE_TYPE);
+
+inline bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs) Q_DECL_NOTHROW
+{
+ 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
+{ return !(lhs == rhs); }
+
+inline uint qHash(const QVulkanLayer &key, uint seed = 0) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.name);
+ seed = hash(seed, key.version);
+ seed = hash(seed, key.specVersion);
+ return seed;
+}
+
+struct QVulkanExtension
+{
+ QByteArray name;
+ uint32_t version;
+};
+Q_DECLARE_TYPEINFO(QVulkanExtension, Q_MOVABLE_TYPE);
+
+inline bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs) Q_DECL_NOTHROW
+{
+ return lhs.name == rhs.name && lhs.version == rhs.version;
+}
+inline bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs) Q_DECL_NOTHROW
+{ return !(lhs == rhs); }
+
+inline uint qHash(const QVulkanExtension &key, uint seed = 0) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.name);
+ seed = hash(seed, key.version);
+ return seed;
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QVulkanLayer &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QVulkanExtension &);
+#endif
+
+template<typename T>
+class QVulkanInfoVector : public QVector<T>
+{
+public:
+ bool contains(const QByteArray &name) const {
+ return std::any_of(this->cbegin(), this->cend(), [&](const T &entry) {
+ return entry.name == name; });
+ }
+ bool contains(const QByteArray &name, int minVersion) const {
+ return std::any_of(this->cbegin(), this->cend(), [&](const T &entry) {
+ return entry.name == name && entry.version >= minVersion; });
+ }
+};
+
+class Q_GUI_EXPORT QVulkanInstance
+{
+public:
+ QVulkanInstance();
+ ~QVulkanInstance();
+
+ enum Flag {
+ NoDebugOutputRedirect = 0x01
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ QVulkanInfoVector<QVulkanLayer> supportedLayers();
+ QVulkanInfoVector<QVulkanExtension> supportedExtensions();
+
+ void setVkInstance(VkInstance existingVkInstance);
+
+ void setFlags(Flags flags);
+ void setLayers(const QByteArrayList &layers);
+ void setExtensions(const QByteArrayList &extensions);
+ void setApiVersion(const QVersionNumber &vulkanVersion);
+
+ bool create();
+ void destroy();
+ bool isValid() const;
+ VkResult errorCode() const;
+
+ VkInstance vkInstance() const;
+
+ Flags flags() const;
+ QByteArrayList layers() const;
+ QByteArrayList extensions() const;
+ QVersionNumber apiVersion() const;
+
+ PFN_vkVoidFunction getInstanceProcAddr(const char *name);
+
+ QPlatformVulkanInstance *handle() const;
+
+ QVulkanFunctions *functions() const;
+ QVulkanDeviceFunctions *deviceFunctions(VkDevice device);
+ void resetDeviceFunctions(VkDevice device);
+
+ static VkSurfaceKHR surfaceForWindow(QWindow *window);
+
+ bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window);
+
+ void presentQueued(QWindow *window);
+
+private:
+ QScopedPointer<QVulkanInstancePrivate> d_ptr;
+ Q_DISABLE_COPY(QVulkanInstance)
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QVulkanInstance::Flags)
+
+QT_END_NAMESPACE
+
+#endif // QT_CONFIG(vulkan)
+
+#endif // QVULKANINSTANCE_H
diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp
new file mode 100644
index 0000000000..bc82f5df08
--- /dev/null
+++ b/src/gui/vulkan/qvulkanwindow.cpp
@@ -0,0 +1,2720 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qvulkanwindow_p.h"
+#include "qvulkanfunctions.h"
+#include <QLoggingCategory>
+#include <QTimer>
+#include <QThread>
+#include <QCoreApplication>
+#include <qevent.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcVk, "qt.vulkan")
+
+/*!
+ \class QVulkanWindow
+ \inmodule QtGui
+ \since 5.10
+ \brief The QVulkanWindow class is a convenience subclass of QWindow to perform Vulkan rendering.
+
+ QVulkanWindow is a Vulkan-capable QWindow that manages a Vulkan device, a
+ graphics queue, a command pool and buffer, a depth-stencil image and a
+ double-buffered FIFO swapchain, while taking care of correct behavior when it
+ comes to events like resize, special situations like not having a device
+ queue supporting both graphics and presentation, device lost scenarios, and
+ additional functionality like reading the rendered content back. Conceptually
+ it is the counterpart of QOpenGLWindow in the Vulkan world.
+
+ \note QVulkanWindow does not always eliminate the need to implement a fully
+ custom QWindow subclass as it will not necessarily be sufficient in advanced
+ use cases.
+
+ QVulkanWindow can be embedded into QWidget-based user interfaces via
+ QWidget::createWindowContainer(). This approach has a number of limitations,
+ however. Make sure to study the
+ \l{QWidget::createWindowContainer()}{documentation} first.
+
+ A typical application using QVulkanWindow may look like the following:
+
+ \code
+ class VulkanRenderer : public QVulkanWindowRenderer
+ {
+ public:
+ VulkanRenderer(QVulkanWindow *w) : m_window(w) { }
+
+ void initResources() override
+ {
+ m_devFuncs = m_window->vulkanInstance()->deviceFunctions(m_window->device());
+ ...
+ }
+ void initSwapChainResources() override { ... }
+ void releaseSwapChainResources() override { ... }
+ void releaseResources() override { ... }
+
+ void startNextFrame() override
+ {
+ VkCommandBuffer cmdBuf = m_window->currentCommandBuffer();
+ ...
+ m_devFuncs->vkCmdBeginRenderPass(...);
+ ...
+ m_window->frameReady();
+ }
+
+ private:
+ QVulkanWindow *m_window;
+ QVulkanDeviceFunctions *m_devFuncs;
+ };
+
+ class VulkanWindow : public QVulkanWindow
+ {
+ public:
+ QVulkanWindowRenderer *createRenderer() override {
+ return new VulkanRenderer(this);
+ }
+ };
+
+ int main(int argc, char *argv[])
+ {
+ QGuiApplication app(argc, argv);
+
+ QVulkanInstance inst;
+ // enable the standard validation layers, when available
+ inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation");
+ if (!inst.create())
+ qFatal("Failed to create Vulkan instance: %d", inst.errorCode());
+
+ VulkanWindow w;
+ w.setVulkanInstance(&inst);
+ w.showMaximized();
+
+ return app.exec();
+ }
+ \endcode
+
+ As it can be seen in the example, the main patterns in QVulkanWindow usage are:
+
+ \list
+
+ \li The QVulkanInstance is associated via QWindow::setVulkanInstance(). It is
+ then retrievable via QWindow::vulkanInstance() from everywhere, on any
+ thread.
+
+ \li Similarly to QVulkanInstance, device extensions can be queried via
+ supportedDeviceExtensions() before the actual initialization. Requesting an
+ extension to be enabled is done via setDeviceExtensions(). Such calls must be
+ made before the window becomes visible, that is, before calling show() or
+ similar functions. Unsupported extension requests are gracefully ignored.
+
+ \li The renderer is implemented in a QVulkanWindowRenderer subclass, an
+ instance of which is created in the createRenderer() factory function.
+
+ \li The core Vulkan commands are exposed via the QVulkanFunctions object,
+ retrievable by calling QVulkanInstance::functions(). Device level functions
+ are available after creating a VkDevice by calling
+ QVulkanInstance::deviceFunctions().
+
+ \li The building of the draw calls for the next frame happens in
+ QVulkanWindowRenderer::startNextFrame(). The implementation is expected to
+ add commands to the command buffer returned from currentCommandBuffer().
+ Returning from the function does not indicate that the commands are ready for
+ submission. Rather, an explicit call to frameReady() is required. This allows
+ asynchronous generation of commands, possibly on multiple threads. Simple
+ implementations will simply call frameReady() at the end of their
+ QVulkanWindowRenderer::startNextFrame().
+
+ \li The basic Vulkan resources (physical device, graphics queue, a command
+ pool, the window's main command buffer, image formats, etc.) are exposed on
+ the QVulkanWindow via lightweight getter functions. Some of these are for
+ convenience only, and applications are always free to query, create and
+ manage additional resources directly via the Vulkan API.
+
+ \li The renderer lives in the gui/main thread, like the window itself. This
+ thread is then throttled to the presentation rate, similarly to how OpenGL
+ with a swap interval of 1 would behave. However, the renderer implementation
+ is free to utilize multiple threads in any way it sees fit. The accessors
+ like vulkanInstance(), currentCommandBuffer(), etc. can be called from any
+ thread. The submission of the main command buffer, the queueing of present,
+ and the building of the next frame do not start until frameReady() is
+ invoked on the gui/main thread.
+
+ \li When the window is made visible, the content is updated automatically.
+ Further updates can be requested by calling QWindow::requestUpdate(). To
+ render continuously, call requestUpdate() after frameReady().
+
+ \endlist
+
+ For troubleshooting, enable the logging category \c{qt.vulkan}. Critical
+ errors are printed via qWarning() automatically.
+
+ \section1 Coordinate system differences between OpenGL and Vulkan
+
+ There are two notable differences to be aware of: First, with Vulkan Y points
+ down the screen in clip space, while OpenGL uses an upwards pointing Y axis.
+ Second, the standard OpenGL projection matrix assume a near and far plane
+ values of -1 and 1, while Vulkan prefers 0 and 1.
+
+ In order to help applications migrate from OpenGL-based code without having
+ to flip Y coordinates in the vertex data, and to allow using QMatrix4x4
+ functions like QMatrix4x4::perspective() while keeping the Vulkan viewport's
+ minDepth and maxDepth set to 0 and 1, QVulkanWindow provides a correction
+ matrix retrievable by calling clipCorrectionMatrix().
+
+ \section1 Multisampling
+
+ While disabled by default, multisample antialiasing is fully supported by
+ QVulkanWindow. Additional color buffers and resolving into the swapchain's
+ non-multisample buffers are all managed automatically.
+
+ To query the supported sample counts, call supportedSampleCounts(). When the
+ returned set contains 4, 8, ..., passing one of those values to setSampleCount()
+ requests multisample rendering.
+
+ \note unlike QSurfaceFormat::setSamples(), the list of supported sample
+ counts are exposed to the applications in advance and there is no automatic
+ falling back to lower sample counts in setSampleCount(). If the requested value
+ is not supported, a warning is shown and a no multisampling will be used.
+
+ \section1 Reading images back
+
+ When supportsGrab() returns true, QVulkanWindow can perform readbacks from
+ the color buffer into a QImage. grab() is a slow and inefficient operation,
+ so frequent usage should be avoided. It is nonetheless valuable since it
+ allows applications to take screenshots, or tools and tests to process and
+ verify the output of the GPU rendering.
+
+ \section1 sRGB support
+
+ While many applications will be fine with the default behavior of
+ QVulkanWindow when it comes to swapchain image formats,
+ setPreferredColorFormats() allows requesting a pre-defined format. This is
+ useful most notably when working in the sRGB color space. Passing a format
+ like \c{VK_FORMAT_B8G8R8A8_SRGB} results in choosing an sRGB format, when
+ available.
+
+ \section1 Validation layers
+
+ During application development it can be extremely valuable to have the
+ Vulkan validation layers enabled. As shown in the example code above, calling
+ QVulkanInstance::setLayers() on the QVulkanInstance before
+ QVulkanInstance::create() enables validation, assuming the Vulkan driver
+ stack in the system contains the necessary layers.
+
+ \note Be aware of platform-specific differences. On desktop platforms
+ installing the \l{https://www.lunarg.com/vulkan-sdk/}{Vulkan SDK} is
+ typically sufficient. However, Android for example requires deploying
+ additional shared libraries together with the application, and also mandates
+ a different list of validation layer names. See
+ \l{https://developer.android.com/ndk/guides/graphics/validation-layer.html}{the
+ Android Vulkan development pages} for more information.
+
+ \note QVulkanWindow does not expose device layers since this functionality
+ has been deprecated since version 1.0.13 of the Vulkan API.
+
+ \sa QVulkanInstance, QWindow
+ */
+
+/*!
+ \class QVulkanWindowRenderer
+ \inmodule QtGui
+ \since 5.10
+
+ \brief The QVulkanWindowRenderer class is used to implement the
+ application-specific rendering logic for a QVulkanWindow.
+
+ Applications typically subclass both QVulkanWindow and QVulkanWindowRenderer.
+ The former allows handling events, for example, input, while the latter allows
+ implementing the Vulkan resource management and command buffer building that
+ make up the application's rendering.
+
+ In addition to event handling, the QVulkanWindow subclass is responsible for
+ providing an implementation for QVulkanWindow::createRenderer() as well. This
+ is where the window and renderer get connected. A typical implementation will
+ simply create a new instance of a subclass of QVulkanWindowRenderer.
+ */
+
+/*!
+ Constructs a new QVulkanWindow with the given \a parent.
+
+ The surface type is set to QSurface::VulkanSurface.
+ */
+QVulkanWindow::QVulkanWindow(QWindow *parent)
+ : QWindow(*(new QVulkanWindowPrivate), parent)
+{
+ setSurfaceType(QSurface::VulkanSurface);
+}
+
+/*!
+ Destructor.
+*/
+QVulkanWindow::~QVulkanWindow()
+{
+}
+
+QVulkanWindowPrivate::~QVulkanWindowPrivate()
+{
+ // graphics resource cleanup is already done at this point due to
+ // QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed
+
+ delete renderer;
+}
+
+/*!
+ \enum QVulkanWindow::Flag
+
+ This enum describes the flags that can be passed to setFlags().
+
+ \value PersistentResources Ensures no graphics resources are released when
+ the window becomes unexposed. The default behavior is to release
+ everything, and reinitialize later when becoming visible again.
+ */
+
+/*!
+ Configures the behavior based on the provided \a flags.
+
+ \note This function must be called before the window is made visible or at
+ latest in QVulkanWindowRenderer::preInitResources(), and has no effect if
+ called afterwards.
+ */
+void QVulkanWindow::setFlags(Flags flags)
+{
+ Q_D(QVulkanWindow);
+ if (d->status != QVulkanWindowPrivate::StatusUninitialized) {
+ qWarning("QVulkanWindow: Attempted to set flags when already initialized");
+ return;
+ }
+ d->flags = flags;
+}
+
+/*!
+ Return the requested flags.
+ */
+QVulkanWindow::Flags QVulkanWindow::flags() const
+{
+ Q_D(const QVulkanWindow);
+ return d->flags;
+}
+
+/*!
+ Returns the list of properties for the supported physical devices in the system.
+
+ \note This function can be called before making the window visible.
+ */
+QVector<VkPhysicalDeviceProperties> QVulkanWindow::availablePhysicalDevices()
+{
+ Q_D(QVulkanWindow);
+ if (!d->physDevs.isEmpty() && !d->physDevProps.isEmpty())
+ return d->physDevProps;
+
+ QVulkanInstance *inst = vulkanInstance();
+ if (!inst) {
+ qWarning("QVulkanWindow: Attempted to call availablePhysicalDevices() without a QVulkanInstance");
+ return d->physDevProps;
+ }
+
+ QVulkanFunctions *f = inst->functions();
+ uint32_t count = 1;
+ VkResult err = f->vkEnumeratePhysicalDevices(inst->vkInstance(), &count, nullptr);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to get physical device count: %d", err);
+ return d->physDevProps;
+ }
+
+ qCDebug(lcVk, "%d physical devices", count);
+ if (!count)
+ return d->physDevProps;
+
+ QVector<VkPhysicalDevice> devs(count);
+ err = f->vkEnumeratePhysicalDevices(inst->vkInstance(), &count, devs.data());
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to enumerate physical devices: %d", err);
+ return d->physDevProps;
+ }
+
+ d->physDevs = devs;
+ d->physDevProps.resize(count);
+ for (uint32_t i = 0; i < count; ++i) {
+ VkPhysicalDeviceProperties *p = &d->physDevProps[i];
+ f->vkGetPhysicalDeviceProperties(d->physDevs.at(i), p);
+ qCDebug(lcVk, "Physical device [%d]: name '%s' version %d.%d.%d", i, p->deviceName,
+ VK_VERSION_MAJOR(p->driverVersion), VK_VERSION_MINOR(p->driverVersion),
+ VK_VERSION_PATCH(p->driverVersion));
+ }
+
+ return d->physDevProps;
+}
+
+/*!
+ Requests the usage of the physical device with index \a idx. The index
+ corresponds to the list returned from availablePhysicalDevices().
+
+ By default the first physical device is used.
+
+ \note This function must be called before the window is made visible or at
+ latest in QVulkanWindowRenderer::preInitResources(), and has no effect if
+ called afterwards.
+ */
+void QVulkanWindow::setPhysicalDeviceIndex(int idx)
+{
+ Q_D(QVulkanWindow);
+ if (d->status != QVulkanWindowPrivate::StatusUninitialized) {
+ qWarning("QVulkanWindow: Attempted to set physical device when already initialized");
+ return;
+ }
+ const int count = availablePhysicalDevices().count();
+ if (idx < 0 || idx >= count) {
+ qWarning("QVulkanWindow: Invalid physical device index %d (total physical devices: %d)", idx, count);
+ return;
+ }
+ d->physDevIndex = idx;
+}
+
+/*!
+ Returns the list of the extensions that are supported by logical devices
+ created from the physical device selected by setPhysicalDeviceIndex().
+
+ \note This function can be called before making the window visible.
+ */
+QVulkanInfoVector<QVulkanExtension> QVulkanWindow::supportedDeviceExtensions()
+{
+ Q_D(QVulkanWindow);
+
+ availablePhysicalDevices();
+
+ if (d->physDevs.isEmpty()) {
+ qWarning("QVulkanWindow: No physical devices found");
+ return QVulkanInfoVector<QVulkanExtension>();
+ }
+
+ VkPhysicalDevice physDev = d->physDevs.at(d->physDevIndex);
+ if (d->supportedDevExtensions.contains(physDev))
+ return d->supportedDevExtensions.value(physDev);
+
+ QVulkanFunctions *f = vulkanInstance()->functions();
+ uint32_t count = 0;
+ VkResult err = f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &count, nullptr);
+ if (err == VK_SUCCESS) {
+ QVector<VkExtensionProperties> extProps(count);
+ err = f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &count, extProps.data());
+ if (err == VK_SUCCESS) {
+ QVulkanInfoVector<QVulkanExtension> exts;
+ for (const VkExtensionProperties &prop : extProps) {
+ QVulkanExtension ext;
+ ext.name = prop.extensionName;
+ ext.version = prop.specVersion;
+ exts.append(ext);
+ }
+ d->supportedDevExtensions.insert(physDev, exts);
+ qDebug(lcVk) << "Supported device extensions:" << exts;
+ return exts;
+ }
+ }
+
+ qWarning("QVulkanWindow: Failed to query device extension count: %d", err);
+ return QVulkanInfoVector<QVulkanExtension>();
+}
+
+/*!
+ Sets the list of device \a extensions to be enabled.
+
+ Unsupported extensions are ignored.
+
+ The swapchain extension will always be added automatically, no need to
+ include it in this list.
+
+ \note This function must be called before the window is made visible or at
+ latest in QVulkanWindowRenderer::preInitResources(), and has no effect if
+ called afterwards.
+ */
+void QVulkanWindow::setDeviceExtensions(const QByteArrayList &extensions)
+{
+ Q_D(QVulkanWindow);
+ if (d->status != QVulkanWindowPrivate::StatusUninitialized) {
+ qWarning("QVulkanWindow: Attempted to set device extensions when already initialized");
+ return;
+ }
+ d->requestedDevExtensions = extensions;
+}
+
+/*!
+ Sets the preferred \a formats of the swapchain.
+
+ By default no application-preferred format is set. In this case the
+ surface's preferred format will be used or, in absence of that,
+ \c{VK_FORMAT_B8G8R8A8_UNORM}.
+
+ The list in \a formats is ordered. If the first format is not supported,
+ the second will be considered, and so on. When no formats in the list are
+ supported, the behavior is the same as in the default case.
+
+ To query the actual format after initialization, call colorFormat().
+
+ \note This function must be called before the window is made visible or at
+ latest in QVulkanWindowRenderer::preInitResources(), and has no effect if
+ called afterwards.
+
+ \note Reimplementing QVulkanWindowRenderer::preInitResources() allows
+ dynamically examining the list of supported formats, should that be
+ desired. There the surface is retrievable via
+ QVulkanInstace::surfaceForWindow(), while this function can still safely be
+ called to affect the later stages of initialization.
+
+ \sa colorFormat()
+ */
+void QVulkanWindow::setPreferredColorFormats(const QVector<VkFormat> &formats)
+{
+ Q_D(QVulkanWindow);
+ if (d->status != QVulkanWindowPrivate::StatusUninitialized) {
+ qWarning("QVulkanWindow: Attempted to set preferred color format when already initialized");
+ return;
+ }
+ d->requestedColorFormats = formats;
+}
+
+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 }
+};
+
+/*!
+ Returns the set of supported sample counts when using the physical device
+ selected by setPhysicalDeviceIndex(), as a sorted vector.
+
+ By default QVulkanWindow uses a sample count of 1. By calling setSampleCount()
+ with a different value (2, 4, 8, ...) from the set returned by this
+ function, multisample anti-aliasing can be requested.
+
+ \note This function can be called before making the window visible.
+
+ \sa setSampleCount()
+ */
+QVector<int> QVulkanWindow::supportedSampleCounts()
+{
+ Q_D(const QVulkanWindow);
+ QVector<int> result;
+
+ availablePhysicalDevices();
+
+ if (d->physDevs.isEmpty()) {
+ qWarning("QVulkanWindow: No physical devices found");
+ return result;
+ }
+
+ const VkPhysicalDeviceLimits *limits = &d->physDevProps[d->physDevIndex].limits;
+ VkSampleCountFlags color = limits->framebufferColorSampleCounts;
+ 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))
+ {
+ result.append(qvk_sampleCounts[i].count);
+ }
+ }
+
+ return result;
+}
+
+/*!
+ Requests multisample antialiasing with the given \a sampleCount. The valid
+ values are 1, 2, 4, 8, ... up until the maximum value supported by the
+ physical device.
+
+ When the sample count is greater than 1, QVulkanWindow will create a
+ multisample color buffer instead of simply targeting the swapchain's
+ images. The rendering in the multisample buffer will get resolved into the
+ non-multisample buffers at the end of each frame.
+
+ To examine the list of supported sample counts, call supportedSampleCounts().
+
+ When setting up the rendering pipeline, call sampleCountFlagBits() to query the
+ active sample count as a \c VkSampleCountFlagBits value.
+
+ \note This function must be called before the window is made visible or at
+ latest in QVulkanWindowRenderer::preInitResources(), and has no effect if
+ called afterwards.
+
+ \sa supportedSampleCounts(), sampleCountFlagBits()
+ */
+void QVulkanWindow::setSampleCount(int sampleCount)
+{
+ Q_D(QVulkanWindow);
+ if (d->status != QVulkanWindowPrivate::StatusUninitialized) {
+ qWarning("QVulkanWindow: Attempted to set sample count when already initialized");
+ return;
+ }
+
+ // Stay compatible with QSurfaceFormat and friends where samples == 0 means the same as 1.
+ sampleCount = qBound(1, sampleCount, 64);
+
+ if (!supportedSampleCounts().contains(sampleCount)) {
+ qWarning("QVulkanWindow: Attempted to set unsupported sample count %d", 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;
+ return;
+ }
+ }
+
+ Q_UNREACHABLE();
+}
+
+void QVulkanWindowPrivate::init()
+{
+ Q_Q(QVulkanWindow);
+ Q_ASSERT(status == StatusUninitialized);
+
+ qCDebug(lcVk, "QVulkanWindow init");
+
+ inst = q->vulkanInstance();
+ if (!inst) {
+ qWarning("QVulkanWindow: Attempted to initialize without a QVulkanInstance");
+ // This is a simple user error, recheck on the next expose instead of
+ // going into the permanent failure state.
+ status = StatusFailRetry;
+ return;
+ }
+
+ if (!renderer)
+ renderer = q->createRenderer();
+
+ surface = QVulkanInstance::surfaceForWindow(q);
+ if (surface == VK_NULL_HANDLE) {
+ qWarning("QVulkanWindow: Failed to retrieve Vulkan surface for window");
+ status = StatusFailRetry;
+ return;
+ }
+
+ q->availablePhysicalDevices();
+
+ if (physDevs.isEmpty()) {
+ qWarning("QVulkanWindow: No physical devices found");
+ status = StatusFail;
+ return;
+ }
+
+ if (physDevIndex < 0 || physDevIndex >= physDevs.count()) {
+ qWarning("QVulkanWindow: Invalid physical device index; defaulting to 0");
+ physDevIndex = 0;
+ }
+ qCDebug(lcVk, "Using physical device [%d]", physDevIndex);
+
+ // Give a last chance to do decisions based on the physical device and the surface.
+ if (renderer)
+ renderer->preInitResources();
+
+ VkPhysicalDevice physDev = physDevs.at(physDevIndex);
+ QVulkanFunctions *f = inst->functions();
+
+ uint32_t queueCount = 0;
+ f->vkGetPhysicalDeviceQueueFamilyProperties(physDev, &queueCount, nullptr);
+ QVector<VkQueueFamilyProperties> queueFamilyProps(queueCount);
+ f->vkGetPhysicalDeviceQueueFamilyProperties(physDev, &queueCount, queueFamilyProps.data());
+ gfxQueueFamilyIdx = uint32_t(-1);
+ presQueueFamilyIdx = uint32_t(-1);
+ for (int i = 0; i < queueFamilyProps.count(); ++i) {
+ const bool supportsPresent = inst->supportsPresent(physDev, i, q);
+ qCDebug(lcVk, "queue family %d: flags=0x%x count=%d supportsPresent=%d", i,
+ queueFamilyProps[i].queueFlags, queueFamilyProps[i].queueCount, supportsPresent);
+ if (gfxQueueFamilyIdx == uint32_t(-1)
+ && (queueFamilyProps[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)
+ && supportsPresent)
+ gfxQueueFamilyIdx = i;
+ }
+ if (gfxQueueFamilyIdx != uint32_t(-1)) {
+ presQueueFamilyIdx = gfxQueueFamilyIdx;
+ } else {
+ qCDebug(lcVk, "No queue with graphics+present; trying separate queues");
+ for (int i = 0; i < queueFamilyProps.count(); ++i) {
+ if (gfxQueueFamilyIdx == uint32_t(-1) && (queueFamilyProps[i].queueFlags & VK_QUEUE_GRAPHICS_BIT))
+ gfxQueueFamilyIdx = i;
+ if (presQueueFamilyIdx == uint32_t(-1) && inst->supportsPresent(physDev, i, q))
+ presQueueFamilyIdx = i;
+ }
+ }
+ if (gfxQueueFamilyIdx == uint32_t(-1)) {
+ qWarning("QVulkanWindow: No graphics queue family found");
+ status = StatusFail;
+ return;
+ }
+ if (presQueueFamilyIdx == uint32_t(-1)) {
+ qWarning("QVulkanWindow: No present queue family found");
+ status = StatusFail;
+ return;
+ }
+#ifdef QT_DEBUG
+ // allow testing the separate present queue case in debug builds on AMD cards
+ if (qEnvironmentVariableIsSet("QT_VK_PRESENT_QUEUE_INDEX"))
+ presQueueFamilyIdx = qEnvironmentVariableIntValue("QT_VK_PRESENT_QUEUE_INDEX");
+#endif
+ qCDebug(lcVk, "Using queue families: graphics = %u present = %u", gfxQueueFamilyIdx, presQueueFamilyIdx);
+
+ 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 = gfxQueueFamilyIdx;
+ queueInfo[0].queueCount = 1;
+ queueInfo[0].pQueuePriorities = prio;
+ if (gfxQueueFamilyIdx != presQueueFamilyIdx) {
+ queueInfo[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
+ queueInfo[1].queueFamilyIndex = presQueueFamilyIdx;
+ queueInfo[1].queueCount = 1;
+ queueInfo[1].pQueuePriorities = prio;
+ }
+
+ // Filter out unsupported extensions in order to keep symmetry
+ // with how QVulkanInstance behaves. Add the swapchain extension.
+ QVector<const char *> devExts;
+ QVulkanInfoVector<QVulkanExtension> supportedExtensions = q->supportedDeviceExtensions();
+ QByteArrayList reqExts = requestedDevExtensions;
+ reqExts.append("VK_KHR_swapchain");
+ for (const QByteArray &ext : reqExts) {
+ if (supportedExtensions.contains(ext))
+ devExts.append(ext.constData());
+ }
+ qCDebug(lcVk) << "Enabling device extensions:" << devExts;
+
+ VkDeviceCreateInfo devInfo;
+ memset(&devInfo, 0, sizeof(devInfo));
+ devInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
+ devInfo.queueCreateInfoCount = gfxQueueFamilyIdx == presQueueFamilyIdx ? 1 : 2;
+ devInfo.pQueueCreateInfos = queueInfo;
+ devInfo.enabledExtensionCount = devExts.count();
+ devInfo.ppEnabledExtensionNames = devExts.constData();
+
+ // Device layers are not supported by QVulkanWindow since that's an already deprecated
+ // API. However, have a workaround for systems with older API and layers (f.ex. L4T
+ // 24.2 for the Jetson TX1 provides API 1.0.13 and crashes when the validation layer
+ // is enabled for the instance but not the device).
+ uint32_t apiVersion = physDevProps[physDevIndex].apiVersion;
+ if (VK_VERSION_MAJOR(apiVersion) == 1
+ && VK_VERSION_MINOR(apiVersion) == 0
+ && VK_VERSION_PATCH(apiVersion) <= 13)
+ {
+ // Make standard validation work at least.
+ const QByteArray stdValName = QByteArrayLiteral("VK_LAYER_LUNARG_standard_validation");
+ const char *stdValNamePtr = stdValName.constData();
+ if (inst->layers().contains(stdValName)) {
+ uint32_t count = 0;
+ VkResult err = f->vkEnumerateDeviceLayerProperties(physDev, &count, nullptr);
+ if (err == VK_SUCCESS) {
+ QVector<VkLayerProperties> layerProps(count);
+ err = f->vkEnumerateDeviceLayerProperties(physDev, &count, layerProps.data());
+ if (err == VK_SUCCESS) {
+ for (const VkLayerProperties &prop : layerProps) {
+ if (!strncmp(prop.layerName, stdValNamePtr, stdValName.count())) {
+ devInfo.enabledLayerCount = 1;
+ devInfo.ppEnabledLayerNames = &stdValNamePtr;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ VkResult err = f->vkCreateDevice(physDev, &devInfo, nullptr, &dev);
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("QVulkanWindow: Physical device lost");
+ if (renderer)
+ renderer->physicalDeviceLost();
+ // clear the caches so the list of physical devices is re-queried
+ physDevs.clear();
+ physDevProps.clear();
+ status = StatusUninitialized;
+ qCDebug(lcVk, "Attempting to restart in 2 seconds");
+ QTimer::singleShot(2000, q, [this]() { ensureStarted(); });
+ return;
+ }
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create device: %d", err);
+ status = StatusFail;
+ return;
+ }
+
+ devFuncs = inst->deviceFunctions(dev);
+ Q_ASSERT(devFuncs);
+
+ devFuncs->vkGetDeviceQueue(dev, gfxQueueFamilyIdx, 0, &gfxQueue);
+ if (gfxQueueFamilyIdx == presQueueFamilyIdx)
+ presQueue = gfxQueue;
+ else
+ devFuncs->vkGetDeviceQueue(dev, presQueueFamilyIdx, 0, &presQueue);
+
+ VkCommandPoolCreateInfo poolInfo;
+ memset(&poolInfo, 0, sizeof(poolInfo));
+ poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
+ poolInfo.queueFamilyIndex = gfxQueueFamilyIdx;
+ err = devFuncs->vkCreateCommandPool(dev, &poolInfo, nullptr, &cmdPool);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create command pool: %d", err);
+ status = StatusFail;
+ return;
+ }
+ if (gfxQueueFamilyIdx != presQueueFamilyIdx) {
+ poolInfo.queueFamilyIndex = presQueueFamilyIdx;
+ err = devFuncs->vkCreateCommandPool(dev, &poolInfo, nullptr, &presCmdPool);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create command pool for present queue: %d", err);
+ status = StatusFail;
+ return;
+ }
+ }
+
+ hostVisibleMemIndex = 0;
+ VkPhysicalDeviceMemoryProperties physDevMemProps;
+ bool hostVisibleMemIndexSet = false;
+ f->vkGetPhysicalDeviceMemoryProperties(physDev, &physDevMemProps);
+ for (uint32_t i = 0; i < physDevMemProps.memoryTypeCount; ++i) {
+ const VkMemoryType *memType = physDevMemProps.memoryTypes;
+ qCDebug(lcVk, "memtype %d: flags=0x%x", i, memType[i].propertyFlags);
+ // Find a host visible, host coherent memtype. If there is one that is
+ // cached as well (in addition to being coherent), prefer that.
+ const int hostVisibleAndCoherent = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
+ if ((memType[i].propertyFlags & hostVisibleAndCoherent) == hostVisibleAndCoherent) {
+ if (!hostVisibleMemIndexSet
+ || (memType[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)) {
+ hostVisibleMemIndexSet = true;
+ hostVisibleMemIndex = i;
+ }
+ }
+ }
+ qCDebug(lcVk, "Picked memtype %d for host visible memory", hostVisibleMemIndex);
+ deviceLocalMemIndex = 0;
+ for (uint32_t i = 0; i < physDevMemProps.memoryTypeCount; ++i) {
+ const VkMemoryType *memType = physDevMemProps.memoryTypes;
+ // Just pick the first device local memtype.
+ if (memType[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) {
+ deviceLocalMemIndex = i;
+ break;
+ }
+ }
+ qCDebug(lcVk, "Picked memtype %d for device local memory", deviceLocalMemIndex);
+
+ if (!vkGetPhysicalDeviceSurfaceCapabilitiesKHR || !vkGetPhysicalDeviceSurfaceFormatsKHR) {
+ vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR>(
+ inst->getInstanceProcAddr("vkGetPhysicalDeviceSurfaceCapabilitiesKHR"));
+ vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR>(
+ inst->getInstanceProcAddr("vkGetPhysicalDeviceSurfaceFormatsKHR"));
+ if (!vkGetPhysicalDeviceSurfaceCapabilitiesKHR || !vkGetPhysicalDeviceSurfaceFormatsKHR) {
+ qWarning("QVulkanWindow: Physical device surface queries not available");
+ status = StatusFail;
+ return;
+ }
+ }
+
+ // Figure out the color format here. Must not wait until recreateSwapChain()
+ // because the renderpass should be available already from initResources (so
+ // that apps do not have to defer pipeline creation to
+ // initSwapChainResources), but the renderpass needs the final color format.
+
+ uint32_t formatCount = 0;
+ vkGetPhysicalDeviceSurfaceFormatsKHR(physDev, surface, &formatCount, nullptr);
+ QVector<VkSurfaceFormatKHR> formats(formatCount);
+ if (formatCount)
+ vkGetPhysicalDeviceSurfaceFormatsKHR(physDev, surface, &formatCount, formats.data());
+
+ colorFormat = VK_FORMAT_B8G8R8A8_UNORM; // our documented default if all else fails
+ colorSpace = VkColorSpaceKHR(0); // this is in fact VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
+
+ // Pick the preferred format, if there is one.
+ if (!formats.isEmpty() && formats[0].format != VK_FORMAT_UNDEFINED) {
+ colorFormat = formats[0].format;
+ colorSpace = formats[0].colorSpace;
+ }
+
+ // Try to honor the user request.
+ if (!formats.isEmpty() && !requestedColorFormats.isEmpty()) {
+ for (VkFormat reqFmt : qAsConst(requestedColorFormats)) {
+ auto r = std::find_if(formats.cbegin(), formats.cend(),
+ [reqFmt](const VkSurfaceFormatKHR &sfmt) { return sfmt.format == reqFmt; });
+ if (r != formats.cend()) {
+ colorFormat = r->format;
+ colorSpace = r->colorSpace;
+ break;
+ }
+ }
+ }
+
+ 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) {
+ dsFormat = dsFormatCandidates[dsFormatIdx];
+ VkFormatProperties fmtProp;
+ f->vkGetPhysicalDeviceFormatProperties(physDev, dsFormat, &fmtProp);
+ if (fmtProp.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)
+ break;
+ ++dsFormatIdx;
+ }
+ if (dsFormatIdx == dsFormatCandidateCount)
+ qWarning("QVulkanWindow: Failed to find an optimal depth-stencil format");
+
+ qCDebug(lcVk, "Color format: %d Depth-stencil format: %d", colorFormat, dsFormat);
+
+ if (!createDefaultRenderPass())
+ return;
+
+ if (renderer)
+ renderer->initResources();
+
+ status = StatusDeviceReady;
+}
+
+void QVulkanWindowPrivate::reset()
+{
+ if (!dev) // do not rely on 'status', a half done init must be cleaned properly too
+ return;
+
+ qCDebug(lcVk, "QVulkanWindow reset");
+
+ devFuncs->vkDeviceWaitIdle(dev);
+
+ if (renderer) {
+ renderer->releaseResources();
+ devFuncs->vkDeviceWaitIdle(dev);
+ }
+
+ if (defaultRenderPass) {
+ devFuncs->vkDestroyRenderPass(dev, defaultRenderPass, nullptr);
+ defaultRenderPass = VK_NULL_HANDLE;
+ }
+
+ if (cmdPool) {
+ devFuncs->vkDestroyCommandPool(dev, cmdPool, nullptr);
+ cmdPool = VK_NULL_HANDLE;
+ }
+
+ if (presCmdPool) {
+ devFuncs->vkDestroyCommandPool(dev, presCmdPool, nullptr);
+ presCmdPool = VK_NULL_HANDLE;
+ }
+
+ if (frameGrabImage) {
+ devFuncs->vkDestroyImage(dev, frameGrabImage, nullptr);
+ frameGrabImage = VK_NULL_HANDLE;
+ }
+
+ if (frameGrabImageMem) {
+ devFuncs->vkFreeMemory(dev, frameGrabImageMem, nullptr);
+ frameGrabImageMem = VK_NULL_HANDLE;
+ }
+
+ if (dev) {
+ devFuncs->vkDestroyDevice(dev, nullptr);
+ inst->resetDeviceFunctions(dev);
+ dev = VK_NULL_HANDLE;
+ vkCreateSwapchainKHR = nullptr; // re-resolve swapchain funcs later on since some come via the device
+ }
+
+ surface = VK_NULL_HANDLE;
+
+ status = StatusUninitialized;
+}
+
+bool QVulkanWindowPrivate::createDefaultRenderPass()
+{
+ VkAttachmentDescription attDesc[3];
+ memset(attDesc, 0, sizeof(attDesc));
+
+ const bool msaa = sampleCount > VK_SAMPLE_COUNT_1_BIT;
+
+ // This is either the non-msaa render target or the resolve target.
+ attDesc[0].format = colorFormat;
+ attDesc[0].samples = VK_SAMPLE_COUNT_1_BIT;
+ attDesc[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; // ignored when msaa
+ attDesc[0].storeOp = 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 = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+
+ attDesc[1].format = dsFormat;
+ attDesc[1].samples = sampleCount;
+ attDesc[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc[1].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ attDesc[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+ 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 (msaa) {
+ // msaa render target
+ attDesc[2].format = colorFormat;
+ attDesc[2].samples = sampleCount;
+ attDesc[2].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc[2].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ 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_COLOR_ATTACHMENT_OPTIMAL;
+ }
+
+ VkAttachmentReference colorRef = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+ VkAttachmentReference resolveRef = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+ VkAttachmentReference dsRef = { 1, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL };
+
+ VkSubpassDescription subPassDesc;
+ memset(&subPassDesc, 0, sizeof(subPassDesc));
+ subPassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
+ subPassDesc.colorAttachmentCount = 1;
+ subPassDesc.pColorAttachments = &colorRef;
+ subPassDesc.pDepthStencilAttachment = &dsRef;
+
+ VkRenderPassCreateInfo rpInfo;
+ memset(&rpInfo, 0, sizeof(rpInfo));
+ rpInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
+ rpInfo.attachmentCount = 2;
+ rpInfo.pAttachments = attDesc;
+ rpInfo.subpassCount = 1;
+ rpInfo.pSubpasses = &subPassDesc;
+
+ if (msaa) {
+ colorRef.attachment = 2;
+ subPassDesc.pResolveAttachments = &resolveRef;
+ rpInfo.attachmentCount = 3;
+ }
+
+ VkResult err = devFuncs->vkCreateRenderPass(dev, &rpInfo, nullptr, &defaultRenderPass);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create renderpass: %d", err);
+ return false;
+ }
+
+ return true;
+}
+
+void QVulkanWindowPrivate::recreateSwapChain()
+{
+ Q_Q(QVulkanWindow);
+ Q_ASSERT(status >= StatusDeviceReady);
+
+ swapChainImageSize = q->size() * q->devicePixelRatio(); // note: may change below due to surfaceCaps
+
+ if (swapChainImageSize.isEmpty()) // handle null window size gracefully
+ return;
+
+ QVulkanInstance *inst = q->vulkanInstance();
+ QVulkanFunctions *f = inst->functions();
+ devFuncs->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"));
+ }
+
+ VkPhysicalDevice physDev = physDevs.at(physDevIndex);
+ VkSurfaceCapabilitiesKHR surfaceCaps;
+ vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDev, surface, &surfaceCaps);
+ uint32_t reqBufferCount = swapChainBufferCount;
+ if (surfaceCaps.maxImageCount)
+ reqBufferCount = qBound(surfaceCaps.minImageCount, reqBufferCount, surfaceCaps.maxImageCount);
+
+ VkExtent2D bufferSize = surfaceCaps.currentExtent;
+ if (bufferSize.width == uint32_t(-1)) {
+ Q_ASSERT(bufferSize.height == uint32_t(-1));
+ bufferSize.width = swapChainImageSize.width();
+ bufferSize.height = swapChainImageSize.height();
+ } else {
+ swapChainImageSize = QSize(bufferSize.width, bufferSize.height);
+ }
+
+ 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 (q->requestedFormat().hasAlpha()) {
+ if (surfaceCaps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR)
+ compositeAlpha = VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR;
+ else if (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;
+ swapChainSupportsReadBack = (surfaceCaps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
+ if (swapChainSupportsReadBack)
+ usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+
+ VkSwapchainKHR oldSwapChain = swapChain;
+ VkSwapchainCreateInfoKHR swapChainInfo;
+ memset(&swapChainInfo, 0, sizeof(swapChainInfo));
+ swapChainInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
+ swapChainInfo.surface = surface;
+ swapChainInfo.minImageCount = reqBufferCount;
+ swapChainInfo.imageFormat = colorFormat;
+ swapChainInfo.imageColorSpace = colorSpace;
+ swapChainInfo.imageExtent = bufferSize;
+ 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 = oldSwapChain;
+
+ qCDebug(lcVk, "Creating new swap chain of %d buffers, size %dx%d", reqBufferCount, bufferSize.width, bufferSize.height);
+
+ VkSwapchainKHR newSwapChain;
+ VkResult err = vkCreateSwapchainKHR(dev, &swapChainInfo, nullptr, &newSwapChain);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create swap chain: %d", err);
+ return;
+ }
+
+ if (oldSwapChain)
+ releaseSwapChain();
+
+ swapChain = newSwapChain;
+
+ uint32_t actualSwapChainBufferCount = 0;
+ err = vkGetSwapchainImagesKHR(dev, swapChain, &actualSwapChainBufferCount, nullptr);
+ if (err != VK_SUCCESS || actualSwapChainBufferCount < 2) {
+ qWarning("QVulkanWindow: Failed to get swapchain images: %d (count=%d)", err, actualSwapChainBufferCount);
+ return;
+ }
+
+ qCDebug(lcVk, "Actual swap chain buffer count: %d (supportsReadback=%d)",
+ actualSwapChainBufferCount, swapChainSupportsReadBack);
+ if (actualSwapChainBufferCount > MAX_SWAPCHAIN_BUFFER_COUNT) {
+ qWarning("QVulkanWindow: Too many swapchain buffers (%d)", actualSwapChainBufferCount);
+ return;
+ }
+ swapChainBufferCount = actualSwapChainBufferCount;
+
+ VkImage swapChainImages[MAX_SWAPCHAIN_BUFFER_COUNT];
+ err = vkGetSwapchainImagesKHR(dev, swapChain, &actualSwapChainBufferCount, swapChainImages);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to get swapchain images: %d", err);
+ return;
+ }
+
+ if (!createTransientImage(dsFormat,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
+ VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT,
+ &dsImage,
+ &dsMem,
+ &dsView,
+ 1))
+ {
+ return;
+ }
+
+ const bool msaa = sampleCount > VK_SAMPLE_COUNT_1_BIT;
+ VkImage msaaImages[MAX_SWAPCHAIN_BUFFER_COUNT];
+ VkImageView msaaViews[MAX_SWAPCHAIN_BUFFER_COUNT];
+
+ if (msaa) {
+ if (!createTransientImage(colorFormat,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ msaaImages,
+ &msaaImageMem,
+ msaaViews,
+ swapChainBufferCount))
+ {
+ return;
+ }
+ }
+
+ VkFenceCreateInfo fenceInfo = { VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, nullptr, VK_FENCE_CREATE_SIGNALED_BIT };
+
+ for (int i = 0; i < swapChainBufferCount; ++i) {
+ ImageResources &image(imageRes[i]);
+ image.image = swapChainImages[i];
+
+ if (msaa) {
+ 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 = 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 = devFuncs->vkCreateImageView(dev, &imgViewInfo, nullptr, &image.imageView);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create swapchain image view %d: %d", i, err);
+ return;
+ }
+
+ err = devFuncs->vkCreateFence(dev, &fenceInfo, nullptr, &image.cmdFence);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create command buffer fence: %d", err);
+ return;
+ }
+ image.cmdFenceWaitable = true; // fence was created in signaled state
+
+ VkImageView views[3] = { image.imageView,
+ dsView,
+ msaa ? image.msaaImageView : VK_NULL_HANDLE };
+ VkFramebufferCreateInfo fbInfo;
+ memset(&fbInfo, 0, sizeof(fbInfo));
+ fbInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
+ fbInfo.renderPass = defaultRenderPass;
+ fbInfo.attachmentCount = msaa ? 3 : 2;
+ fbInfo.pAttachments = views;
+ fbInfo.width = swapChainImageSize.width();
+ fbInfo.height = swapChainImageSize.height();
+ fbInfo.layers = 1;
+ VkResult err = devFuncs->vkCreateFramebuffer(dev, &fbInfo, nullptr, &image.fb);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create framebuffer: %d", err);
+ return;
+ }
+
+ if (gfxQueueFamilyIdx != presQueueFamilyIdx) {
+ // pre-build the static image-acquire-on-present-queue command buffer
+ VkCommandBufferAllocateInfo cmdBufInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, nullptr, presCmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY, 1 };
+ err = devFuncs->vkAllocateCommandBuffers(dev, &cmdBufInfo, &image.presTransCmdBuf);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to allocate acquire-on-present-queue command buffer: %d", err);
+ return;
+ }
+ VkCommandBufferBeginInfo cmdBufBeginInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, nullptr,
+ VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, nullptr };
+ err = devFuncs->vkBeginCommandBuffer(image.presTransCmdBuf, &cmdBufBeginInfo);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to begin acquire-on-present-queue command buffer: %d", err);
+ return;
+ }
+ VkImageMemoryBarrier presTrans;
+ memset(&presTrans, 0, sizeof(presTrans));
+ presTrans.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ presTrans.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ presTrans.oldLayout = presTrans.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+ presTrans.srcQueueFamilyIndex = gfxQueueFamilyIdx;
+ presTrans.dstQueueFamilyIndex = presQueueFamilyIdx;
+ presTrans.image = image.image;
+ presTrans.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ presTrans.subresourceRange.levelCount = presTrans.subresourceRange.layerCount = 1;
+ devFuncs->vkCmdPipelineBarrier(image.presTransCmdBuf,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &presTrans);
+ err = devFuncs->vkEndCommandBuffer(image.presTransCmdBuf);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to end acquire-on-present-queue command buffer: %d", err);
+ return;
+ }
+ }
+ }
+
+ currentImage = 0;
+
+ VkSemaphoreCreateInfo semInfo = { VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, nullptr, 0 };
+ for (int i = 0; i < frameLag; ++i) {
+ FrameResources &frame(frameRes[i]);
+
+ frame.imageAcquired = false;
+ frame.imageSemWaitable = false;
+
+ devFuncs->vkCreateFence(dev, &fenceInfo, nullptr, &frame.fence);
+ frame.fenceWaitable = true; // fence was created in signaled state
+
+ devFuncs->vkCreateSemaphore(dev, &semInfo, nullptr, &frame.imageSem);
+ devFuncs->vkCreateSemaphore(dev, &semInfo, nullptr, &frame.drawSem);
+ if (gfxQueueFamilyIdx != presQueueFamilyIdx)
+ devFuncs->vkCreateSemaphore(dev, &semInfo, nullptr, &frame.presTransSem);
+ }
+
+ currentFrame = 0;
+
+ if (renderer)
+ renderer->initSwapChainResources();
+
+ status = StatusReady;
+}
+
+uint32_t QVulkanWindowPrivate::chooseTransientImageMemType(VkImage img, uint32_t startIndex)
+{
+ VkPhysicalDeviceMemoryProperties physDevMemProps;
+ inst->functions()->vkGetPhysicalDeviceMemoryProperties(physDevs[physDevIndex], &physDevMemProps);
+
+ VkMemoryRequirements memReq;
+ devFuncs->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;
+}
+
+static inline VkDeviceSize aligned(VkDeviceSize v, VkDeviceSize byteAlign)
+{
+ return (v + byteAlign - 1) & ~(byteAlign - 1);
+}
+
+bool QVulkanWindowPrivate::createTransientImage(VkFormat format,
+ VkImageUsageFlags usage,
+ VkImageAspectFlags aspectMask,
+ VkImage *images,
+ VkDeviceMemory *mem,
+ 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 = swapChainImageSize.width();
+ imgInfo.extent.height = swapChainImageSize.height();
+ imgInfo.extent.depth = 1;
+ imgInfo.mipLevels = imgInfo.arrayLayers = 1;
+ imgInfo.samples = sampleCount;
+ imgInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
+ imgInfo.usage = usage | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT;
+
+ err = devFuncs->vkCreateImage(dev, &imgInfo, nullptr, images + i);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: 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.
+ devFuncs->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) * count;
+
+ uint32_t startIndex = 0;
+ do {
+ memInfo.memoryTypeIndex = chooseTransientImageMemType(images[0], startIndex);
+ if (memInfo.memoryTypeIndex == uint32_t(-1)) {
+ qWarning("QVulkanWindow: No suitable memory type found");
+ return false;
+ }
+ startIndex = memInfo.memoryTypeIndex + 1;
+ qCDebug(lcVk, "Allocating %u bytes for transient image (memtype %u)",
+ uint32_t(memInfo.allocationSize), memInfo.memoryTypeIndex);
+ err = devFuncs->vkAllocateMemory(dev, &memInfo, nullptr, mem);
+ if (err != VK_SUCCESS && err != VK_ERROR_OUT_OF_DEVICE_MEMORY) {
+ qWarning("QVulkanWindow: Failed to allocate image memory: %d", err);
+ return false;
+ }
+ } while (err != VK_SUCCESS);
+
+ VkDeviceSize ofs = 0;
+ for (int i = 0; i < count; ++i) {
+ err = devFuncs->vkBindImageMemory(dev, images[i], *mem, ofs);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: 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 = devFuncs->vkCreateImageView(dev, &imgViewInfo, nullptr, views + i);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create image view: %d", err);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void QVulkanWindowPrivate::releaseSwapChain()
+{
+ if (!dev || !swapChain) // do not rely on 'status', a half done init must be cleaned properly too
+ return;
+
+ qCDebug(lcVk, "Releasing swapchain");
+
+ devFuncs->vkDeviceWaitIdle(dev);
+
+ if (renderer) {
+ renderer->releaseSwapChainResources();
+ devFuncs->vkDeviceWaitIdle(dev);
+ }
+
+ for (int i = 0; i < frameLag; ++i) {
+ FrameResources &frame(frameRes[i]);
+ if (frame.fence) {
+ if (frame.fenceWaitable)
+ devFuncs->vkWaitForFences(dev, 1, &frame.fence, VK_TRUE, UINT64_MAX);
+ devFuncs->vkDestroyFence(dev, frame.fence, nullptr);
+ frame.fence = VK_NULL_HANDLE;
+ frame.fenceWaitable = false;
+ }
+ if (frame.imageSem) {
+ devFuncs->vkDestroySemaphore(dev, frame.imageSem, nullptr);
+ frame.imageSem = VK_NULL_HANDLE;
+ }
+ if (frame.drawSem) {
+ devFuncs->vkDestroySemaphore(dev, frame.drawSem, nullptr);
+ frame.drawSem = VK_NULL_HANDLE;
+ }
+ if (frame.presTransSem) {
+ devFuncs->vkDestroySemaphore(dev, frame.presTransSem, nullptr);
+ frame.presTransSem = VK_NULL_HANDLE;
+ }
+ }
+
+ for (int i = 0; i < swapChainBufferCount; ++i) {
+ ImageResources &image(imageRes[i]);
+ if (image.cmdFence) {
+ if (image.cmdFenceWaitable)
+ devFuncs->vkWaitForFences(dev, 1, &image.cmdFence, VK_TRUE, UINT64_MAX);
+ devFuncs->vkDestroyFence(dev, image.cmdFence, nullptr);
+ image.cmdFence = VK_NULL_HANDLE;
+ image.cmdFenceWaitable = false;
+ }
+ if (image.fb) {
+ devFuncs->vkDestroyFramebuffer(dev, image.fb, nullptr);
+ image.fb = VK_NULL_HANDLE;
+ }
+ if (image.imageView) {
+ devFuncs->vkDestroyImageView(dev, image.imageView, nullptr);
+ image.imageView = VK_NULL_HANDLE;
+ }
+ if (image.cmdBuf) {
+ devFuncs->vkFreeCommandBuffers(dev, cmdPool, 1, &image.cmdBuf);
+ image.cmdBuf = VK_NULL_HANDLE;
+ }
+ if (image.presTransCmdBuf) {
+ devFuncs->vkFreeCommandBuffers(dev, presCmdPool, 1, &image.presTransCmdBuf);
+ image.presTransCmdBuf = VK_NULL_HANDLE;
+ }
+ if (image.msaaImageView) {
+ devFuncs->vkDestroyImageView(dev, image.msaaImageView, nullptr);
+ image.msaaImageView = VK_NULL_HANDLE;
+ }
+ if (image.msaaImage) {
+ devFuncs->vkDestroyImage(dev, image.msaaImage, nullptr);
+ image.msaaImage = VK_NULL_HANDLE;
+ }
+ }
+
+ if (msaaImageMem) {
+ devFuncs->vkFreeMemory(dev, msaaImageMem, nullptr);
+ msaaImageMem = VK_NULL_HANDLE;
+ }
+
+ if (dsView) {
+ devFuncs->vkDestroyImageView(dev, dsView, nullptr);
+ dsView = VK_NULL_HANDLE;
+ }
+ if (dsImage) {
+ devFuncs->vkDestroyImage(dev, dsImage, nullptr);
+ dsImage = VK_NULL_HANDLE;
+ }
+ if (dsMem) {
+ devFuncs->vkFreeMemory(dev, dsMem, nullptr);
+ dsMem = VK_NULL_HANDLE;
+ }
+
+ if (swapChain) {
+ vkDestroySwapchainKHR(dev, swapChain, nullptr);
+ swapChain = VK_NULL_HANDLE;
+ }
+
+ if (status == StatusReady)
+ status = StatusDeviceReady;
+}
+
+/*!
+ \internal
+ */
+void QVulkanWindow::exposeEvent(QExposeEvent *)
+{
+ Q_D(QVulkanWindow);
+
+ if (isExposed()) {
+ d->ensureStarted();
+ } else {
+ if (!d->flags.testFlag(PersistentResources)) {
+ d->releaseSwapChain();
+ d->reset();
+ }
+ }
+}
+
+void QVulkanWindowPrivate::ensureStarted()
+{
+ Q_Q(QVulkanWindow);
+ if (status == QVulkanWindowPrivate::StatusFailRetry)
+ status = QVulkanWindowPrivate::StatusUninitialized;
+ if (status == QVulkanWindowPrivate::StatusUninitialized) {
+ init();
+ if (status == QVulkanWindowPrivate::StatusDeviceReady)
+ recreateSwapChain();
+ }
+ if (status == QVulkanWindowPrivate::StatusReady)
+ q->requestUpdate();
+}
+
+/*!
+ \internal
+ */
+void QVulkanWindow::resizeEvent(QResizeEvent *)
+{
+ // Nothing to do here - recreating the swapchain is handled when building the next frame.
+}
+
+/*!
+ \internal
+ */
+bool QVulkanWindow::event(QEvent *e)
+{
+ Q_D(QVulkanWindow);
+
+ switch (e->type()) {
+ case QEvent::UpdateRequest:
+ d->beginFrame();
+ break;
+
+ // The swapchain must be destroyed before the surface as per spec. This is
+ // not ideal for us because the surface is managed by the QPlatformWindow
+ // which may be gone already when the unexpose comes, making the validation
+ // layer scream. The solution is to listen to the PlatformSurface events.
+ case QEvent::PlatformSurface:
+ if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed) {
+ d->releaseSwapChain();
+ d->reset();
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return QWindow::event(e);
+}
+
+/*!
+ Returns true if this window has successfully initialized all Vulkan
+ resources, including the swapchain.
+
+ \note Initialization happens on the first expose event after the window is
+ made visible.
+ */
+bool QVulkanWindow::isValid() const
+{
+ Q_D(const QVulkanWindow);
+ return d->status == QVulkanWindowPrivate::StatusReady;
+}
+
+/*!
+ Returns a new instance of QVulkanWindowRenderer.
+
+ This virtual function is called once during the lifetime of the window, at
+ some point after making it visible for the first time.
+
+ The default implementation returns null and so no rendering will be
+ performed apart from clearing the buffers.
+
+ The window takes ownership of the returned renderer object.
+ */
+QVulkanWindowRenderer *QVulkanWindow::createRenderer()
+{
+ return nullptr;
+}
+
+/*!
+ Virtual destructor.
+ */
+QVulkanWindowRenderer::~QVulkanWindowRenderer()
+{
+}
+
+/*!
+ This virtual function is called right before graphics initialization, that
+ ends up in calling initResources(), is about to begin.
+
+ Normally there is no need to reimplement this function. However, there are
+ cases that involve decisions based on both the physical device and the
+ surface. These cannot normally be performed before making the QVulkanWindow
+ visible since the Vulkan surface is not retrievable at that stage.
+
+ Instead, applications can reimplement this function. Here both
+ QVulkanWindow::physicalDevice() and QVulkanInstance::surfaceForWindow() are
+ functional, but no further logical device initialization has taken place
+ yet.
+
+ The default implementation is empty.
+ */
+void QVulkanWindowRenderer::preInitResources()
+{
+}
+
+/*!
+ This virtual function is called when it is time to create the renderer's
+ graphics resources.
+
+ Depending on the QVulkanWindow::PersistentResources flag, device lost
+ situations, etc. this function may be called more than once during the
+ lifetime of a QVulkanWindow. However, subsequent invocations are always
+ preceded by a call to releaseResources().
+
+ Accessors like device(), graphicsQueue() and graphicsCommandPool() are only
+ guaranteed to return valid values inside this function and afterwards, up
+ until releaseResources() is called.
+
+ The default implementation is empty.
+ */
+void QVulkanWindowRenderer::initResources()
+{
+}
+
+/*!
+ This virtual function is called when swapchain, framebuffer or renderpass
+ related initialization can be performed. Swapchain and related resources
+ are reset and then recreated in response to window resize events, and
+ therefore a pair of calls to initResources() and releaseResources() can
+ have multiple calls to initSwapChainResources() and
+ releaseSwapChainResources() calls in-between.
+
+ Accessors like QVulkanWindow::swapChainImageSize() are only guaranteed to
+ return valid values inside this function and afterwards, up until
+ releaseSwapChainResources() is called.
+
+ This is also the place where size-dependent calculations (for example, the
+ projection matrix) should be made since this function is called effectively
+ on every resize.
+
+ The default implementation is empty.
+ */
+void QVulkanWindowRenderer::initSwapChainResources()
+{
+}
+
+/*!
+ This virtual function is called when swapchain, framebuffer or renderpass
+ related resources must be released.
+
+ The implementation must be prepared that a call to this function may be
+ followed by a new call to initSwapChainResources() at a later point.
+
+ QVulkanWindow takes care of waiting for the device to become idle before
+ and after invoking this function.
+
+ The default implementation is empty.
+
+ \note This is the last place to act with all graphics resources intact
+ before QVulkanWindow starts releasing them. It is therefore essential that
+ implementations with an asynchronous, potentially multi-threaded
+ startNextFrame() perform a blocking wait and call
+ QVulkanWindow::frameReady() before returning from this function in case
+ there is a pending frame submission.
+ */
+void QVulkanWindowRenderer::releaseSwapChainResources()
+{
+}
+
+/*!
+ This virtual function is called when the renderer's graphics resources must be
+ released.
+
+ The implementation must be prepared that a call to this function may be
+ followed by an initResources() at a later point.
+
+ QVulkanWindow takes care of waiting for the device to become idle before
+ and after invoking this function.
+
+ The default implementation is empty.
+ */
+void QVulkanWindowRenderer::releaseResources()
+{
+}
+
+/*!
+ \fn QVulkanWindowRenderer::startNextFrame()
+
+ This virtual function is called when the draw calls for the next frame are
+ to be added to the command buffer.
+
+ Each call to this function must be followed by a call to
+ QVulkanWindow::frameReady(). Failing to do so will stall the rendering
+ loop. The call can also be made at a later time, after returning from this
+ function. This means that it is possible to kick off asynchronous work, and
+ only update the command buffer and notify QVulkanWindow when that work has
+ finished.
+
+ All Vulkan resources are initialized and ready when this function is
+ invoked. The current framebuffer and main command buffer can be retrieved
+ via QVulkanWindow::currentFramebuffer() and
+ QVulkanWindow::currentCommandBuffer(). The logical device and the active
+ graphics queue are available via QVulkanWindow::device() and
+ QVulkanWindow::graphicsQueue(). Implementations can create additional
+ command buffers from the pool returned by
+ QVulkanWindow::graphicsCommandPool(). For convenience, the index of a host
+ visible and device local memory type index are exposed via
+ QVulkanWindow::hostVisibleMemoryIndex() and
+ QVulkanWindow::deviceLocalMemoryIndex(). All these accessors are safe to be
+ called from any thread.
+
+ \sa QVulkanWindow::frameReady(), QVulkanWindow
+ */
+
+/*!
+ This virtual function is called when the physical device is lost, meaning
+ the creation of the logical device fails with \c{VK_ERROR_DEVICE_LOST}.
+
+ The default implementation is empty.
+
+ There is typically no need to perform anything special in this function
+ because QVulkanWindow will automatically retry to initialize itself after a
+ certain amount of time.
+
+ \sa logicalDeviceLost()
+ */
+void QVulkanWindowRenderer::physicalDeviceLost()
+{
+}
+
+/*!
+ This virtual function is called when the logical device (VkDevice) is lost,
+ meaning some operation failed with \c{VK_ERROR_DEVICE_LOST}.
+
+ The default implementation is empty.
+
+ There is typically no need to perform anything special in this function.
+ QVulkanWindow will automatically release all resources (invoking
+ releaseSwapChainResources() and releaseResources() as necessary) and will
+ attempt to reinitialize, acquiring a new device. When the physical device
+ was also lost, this reinitialization attempt may then result in
+ physicalDeviceLost().
+
+ \sa physicalDeviceLost()
+ */
+void QVulkanWindowRenderer::logicalDeviceLost()
+{
+}
+
+void QVulkanWindowPrivate::beginFrame()
+{
+ if (!swapChain || framePending)
+ return;
+
+ Q_Q(QVulkanWindow);
+ if (q->size() * q->devicePixelRatio() != swapChainImageSize) {
+ recreateSwapChain();
+ if (!swapChain)
+ return;
+ }
+
+ FrameResources &frame(frameRes[currentFrame]);
+
+ 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.fenceWaitable) {
+ devFuncs->vkWaitForFences(dev, 1, &frame.fence, VK_TRUE, UINT64_MAX);
+ devFuncs->vkResetFences(dev, 1, &frame.fence);
+ frame.fenceWaitable = false;
+ }
+
+ // move on to next swapchain image
+ VkResult err = vkAcquireNextImageKHR(dev, swapChain, UINT64_MAX,
+ frame.imageSem, frame.fence, &currentImage);
+ if (err == VK_SUCCESS || err == VK_SUBOPTIMAL_KHR) {
+ frame.imageSemWaitable = true;
+ frame.imageAcquired = true;
+ frame.fenceWaitable = true;
+ } else if (err == VK_ERROR_OUT_OF_DATE_KHR) {
+ recreateSwapChain();
+ q->requestUpdate();
+ return;
+ } else {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to acquire next swapchain image: %d", err);
+ q->requestUpdate();
+ return;
+ }
+ }
+
+ // make sure the previous draw for the same image has finished
+ ImageResources &image(imageRes[currentImage]);
+ if (image.cmdFenceWaitable) {
+ devFuncs->vkWaitForFences(dev, 1, &image.cmdFence, VK_TRUE, UINT64_MAX);
+ devFuncs->vkResetFences(dev, 1, &image.cmdFence);
+ image.cmdFenceWaitable = false;
+ }
+
+ // build new draw command buffer
+ if (image.cmdBuf) {
+ devFuncs->vkFreeCommandBuffers(dev, cmdPool, 1, &image.cmdBuf);
+ image.cmdBuf = 0;
+ }
+
+ VkCommandBufferAllocateInfo cmdBufInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, nullptr, cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY, 1 };
+ VkResult err = devFuncs->vkAllocateCommandBuffers(dev, &cmdBufInfo, &image.cmdBuf);
+ if (err != VK_SUCCESS) {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to allocate frame command buffer: %d", err);
+ return;
+ }
+
+ VkCommandBufferBeginInfo cmdBufBeginInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, nullptr, 0, nullptr };
+ err = devFuncs->vkBeginCommandBuffer(image.cmdBuf, &cmdBufBeginInfo);
+ if (err != VK_SUCCESS) {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to begin frame command buffer: %d", err);
+ return;
+ }
+
+ if (frameGrabbing)
+ frameGrabTargetImage = QImage(swapChainImageSize, QImage::Format_RGBA8888);
+
+ if (renderer) {
+ framePending = true;
+ renderer->startNextFrame();
+ // done for now - endFrame() will get invoked when frameReady() is called back
+ } else {
+ VkClearColorValue clearColor = { { 0.0f, 0.0f, 0.0f, 1.0f } };
+ VkClearDepthStencilValue clearDS = { 1.0f, 0 };
+ VkClearValue clearValues[3];
+ memset(clearValues, 0, sizeof(clearValues));
+ clearValues[0].color = clearValues[2].color = clearColor;
+ clearValues[1].depthStencil = clearDS;
+
+ VkRenderPassBeginInfo rpBeginInfo;
+ memset(&rpBeginInfo, 0, sizeof(rpBeginInfo));
+ rpBeginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
+ rpBeginInfo.renderPass = defaultRenderPass;
+ rpBeginInfo.framebuffer = image.fb;
+ rpBeginInfo.renderArea.extent.width = swapChainImageSize.width();
+ rpBeginInfo.renderArea.extent.height = swapChainImageSize.height();
+ rpBeginInfo.clearValueCount = sampleCount > VK_SAMPLE_COUNT_1_BIT ? 3 : 2;
+ rpBeginInfo.pClearValues = clearValues;
+ devFuncs->vkCmdBeginRenderPass(image.cmdBuf, &rpBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
+ devFuncs->vkCmdEndRenderPass(image.cmdBuf);
+
+ endFrame();
+ }
+}
+
+void QVulkanWindowPrivate::endFrame()
+{
+ Q_Q(QVulkanWindow);
+
+ FrameResources &frame(frameRes[currentFrame]);
+ ImageResources &image(imageRes[currentImage]);
+
+ if (gfxQueueFamilyIdx != presQueueFamilyIdx && !frameGrabbing) {
+ // Add the swapchain image release to the command buffer that will be
+ // submitted to the graphics queue.
+ VkImageMemoryBarrier presTrans;
+ memset(&presTrans, 0, sizeof(presTrans));
+ presTrans.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ presTrans.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ presTrans.oldLayout = presTrans.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+ presTrans.srcQueueFamilyIndex = gfxQueueFamilyIdx;
+ presTrans.dstQueueFamilyIndex = presQueueFamilyIdx;
+ presTrans.image = image.image;
+ presTrans.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ presTrans.subresourceRange.levelCount = presTrans.subresourceRange.layerCount = 1;
+ devFuncs->vkCmdPipelineBarrier(image.cmdBuf,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &presTrans);
+ }
+
+ // When grabbing a frame, add a readback at the end and skip presenting.
+ if (frameGrabbing)
+ addReadback();
+
+ VkResult err = devFuncs->vkEndCommandBuffer(image.cmdBuf);
+ if (err != VK_SUCCESS) {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to end frame command buffer: %d", err);
+ return;
+ }
+
+ // submit draw calls
+ VkSubmitInfo submitInfo;
+ memset(&submitInfo, 0, sizeof(submitInfo));
+ submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
+ submitInfo.commandBufferCount = 1;
+ submitInfo.pCommandBuffers = &image.cmdBuf;
+ if (frame.imageSemWaitable) {
+ submitInfo.waitSemaphoreCount = 1;
+ submitInfo.pWaitSemaphores = &frame.imageSem;
+ }
+ if (!frameGrabbing) {
+ submitInfo.signalSemaphoreCount = 1;
+ submitInfo.pSignalSemaphores = &frame.drawSem;
+ }
+ VkPipelineStageFlags psf = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+ submitInfo.pWaitDstStageMask = &psf;
+
+ Q_ASSERT(!image.cmdFenceWaitable);
+
+ err = devFuncs->vkQueueSubmit(gfxQueue, 1, &submitInfo, image.cmdFence);
+ if (err == VK_SUCCESS) {
+ frame.imageSemWaitable = false;
+ image.cmdFenceWaitable = true;
+ } else {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to submit to graphics queue: %d", err);
+ return;
+ }
+
+ // block and then bail out when grabbing
+ if (frameGrabbing) {
+ finishBlockingReadback();
+ frameGrabbing = false;
+ // Leave frame.imageAcquired set to true.
+ // Do not change currentFrame.
+ emit q->frameGrabbed(frameGrabTargetImage);
+ return;
+ }
+
+ if (gfxQueueFamilyIdx != presQueueFamilyIdx) {
+ // Submit the swapchain image acquire to the present queue.
+ submitInfo.pWaitSemaphores = &frame.drawSem;
+ submitInfo.pSignalSemaphores = &frame.presTransSem;
+ submitInfo.pCommandBuffers = &image.presTransCmdBuf; // must be USAGE_SIMULTANEOUS
+ err = devFuncs->vkQueueSubmit(presQueue, 1, &submitInfo, VK_NULL_HANDLE);
+ if (err != VK_SUCCESS) {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to submit to present queue: %d", err);
+ return;
+ }
+ }
+
+ // queue present
+ VkPresentInfoKHR presInfo;
+ memset(&presInfo, 0, sizeof(presInfo));
+ presInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
+ presInfo.swapchainCount = 1;
+ presInfo.pSwapchains = &swapChain;
+ presInfo.pImageIndices = &currentImage;
+ presInfo.waitSemaphoreCount = 1;
+ presInfo.pWaitSemaphores = gfxQueueFamilyIdx == presQueueFamilyIdx ? &frame.drawSem : &frame.presTransSem;
+
+ err = vkQueuePresentKHR(gfxQueue, &presInfo);
+ if (err != VK_SUCCESS) {
+ if (err == VK_ERROR_OUT_OF_DATE_KHR) {
+ recreateSwapChain();
+ q->requestUpdate();
+ return;
+ } else if (err != VK_SUBOPTIMAL_KHR) {
+ if (!checkDeviceLost(err))
+ qWarning("QVulkanWindow: Failed to present: %d", err);
+ return;
+ }
+ }
+
+ frame.imageAcquired = false;
+
+ inst->presentQueued(q);
+
+ currentFrame = (currentFrame + 1) % frameLag;
+}
+
+/*!
+ This function must be called exactly once in response to each invocation of
+ the QVulkanWindowRenderer::startNextFrame() implementation. At the time of
+ this call, the main command buffer, exposed via currentCommandBuffer(),
+ must have all necessary rendering commands added to it since this function
+ will trigger submitting the commands and queuing the present command.
+
+ \note This function must only be called from the gui/main thread, which is
+ where QVulkanWindowRenderer's functions are invoked and where the
+ QVulkanWindow instance lives.
+
+ \sa QVulkanWindowRenderer::startNextFrame()
+ */
+void QVulkanWindow::frameReady()
+{
+ Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(),
+ "QVulkanWindow", "frameReady() can only be called from the GUI (main) thread");
+
+ Q_D(QVulkanWindow);
+
+ if (!d->framePending) {
+ qWarning("QVulkanWindow: frameReady() called without a corresponding startNextFrame()");
+ return;
+ }
+
+ d->framePending = false;
+
+ d->endFrame();
+}
+
+bool QVulkanWindowPrivate::checkDeviceLost(VkResult err)
+{
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("QVulkanWindow: Device lost");
+ if (renderer)
+ renderer->logicalDeviceLost();
+ qCDebug(lcVk, "Releasing all resources due to device lost");
+ releaseSwapChain();
+ reset();
+ qCDebug(lcVk, "Restarting");
+ ensureStarted();
+ return true;
+ }
+ return false;
+}
+
+void QVulkanWindowPrivate::addReadback()
+{
+ VkImageCreateInfo imageInfo;
+ memset(&imageInfo, 0, sizeof(imageInfo));
+ imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
+ imageInfo.imageType = VK_IMAGE_TYPE_2D;
+ imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
+ imageInfo.extent.width = frameGrabTargetImage.width();
+ imageInfo.extent.height = frameGrabTargetImage.height();
+ imageInfo.extent.depth = 1;
+ imageInfo.mipLevels = 1;
+ imageInfo.arrayLayers = 1;
+ imageInfo.samples = VK_SAMPLE_COUNT_1_BIT;
+ imageInfo.tiling = VK_IMAGE_TILING_LINEAR;
+ imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT;
+ imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
+
+ VkResult err = devFuncs->vkCreateImage(dev, &imageInfo, nullptr, &frameGrabImage);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to create image for readback: %d", err);
+ return;
+ }
+
+ VkMemoryRequirements memReq;
+ devFuncs->vkGetImageMemoryRequirements(dev, frameGrabImage, &memReq);
+
+ VkMemoryAllocateInfo allocInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ nullptr,
+ memReq.size,
+ hostVisibleMemIndex
+ };
+
+ err = devFuncs->vkAllocateMemory(dev, &allocInfo, nullptr, &frameGrabImageMem);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to allocate memory for readback image: %d", err);
+ return;
+ }
+
+ err = devFuncs->vkBindImageMemory(dev, frameGrabImage, frameGrabImageMem, 0);
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to bind readback image memory: %d", err);
+ return;
+ }
+
+ ImageResources &image(imageRes[currentImage]);
+
+ 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.levelCount = barrier.subresourceRange.layerCount = 1;
+
+ barrier.oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+ barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+ barrier.srcAccessMask = VK_ACCESS_MEMORY_READ_BIT;
+ barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
+ barrier.image = image.image;
+
+ devFuncs->vkCmdPipelineBarrier(image.cmdBuf,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &barrier);
+
+ barrier.oldLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
+ barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+ barrier.srcAccessMask = 0;
+ barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
+ barrier.image = frameGrabImage;
+
+ devFuncs->vkCmdPipelineBarrier(image.cmdBuf,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &barrier);
+
+ VkImageCopy copyInfo;
+ memset(&copyInfo, 0, sizeof(copyInfo));
+ copyInfo.srcSubresource.aspectMask = copyInfo.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ copyInfo.srcSubresource.layerCount = copyInfo.dstSubresource.layerCount = 1;
+ copyInfo.extent.width = frameGrabTargetImage.width();
+ copyInfo.extent.height = frameGrabTargetImage.height();
+ copyInfo.extent.depth = 1;
+
+ devFuncs->vkCmdCopyImage(image.cmdBuf, image.image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ frameGrabImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &copyInfo);
+
+ barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+ barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
+ barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
+ barrier.dstAccessMask = VK_ACCESS_HOST_READ_BIT;
+ barrier.image = frameGrabImage;
+
+ devFuncs->vkCmdPipelineBarrier(image.cmdBuf,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &barrier);
+}
+
+void QVulkanWindowPrivate::finishBlockingReadback()
+{
+ ImageResources &image(imageRes[currentImage]);
+
+ // Block until the current frame is done. Normally this wait would only be
+ // done in current + concurrentFrameCount().
+ devFuncs->vkWaitForFences(dev, 1, &image.cmdFence, VK_TRUE, UINT64_MAX);
+ devFuncs->vkResetFences(dev, 1, &image.cmdFence);
+ // will reuse the same image for the next "real" frame, do not wait then
+ image.cmdFenceWaitable = false;
+
+ VkImageSubresource subres = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 };
+ VkSubresourceLayout layout;
+ devFuncs->vkGetImageSubresourceLayout(dev, frameGrabImage, &subres, &layout);
+
+ uchar *p;
+ VkResult err = devFuncs->vkMapMemory(dev, frameGrabImageMem, layout.offset, layout.size, 0, reinterpret_cast<void **>(&p));
+ if (err != VK_SUCCESS) {
+ qWarning("QVulkanWindow: Failed to map readback image memory after transfer: %d", err);
+ return;
+ }
+
+ for (int y = 0; y < frameGrabTargetImage.height(); ++y) {
+ memcpy(frameGrabTargetImage.scanLine(y), p, frameGrabTargetImage.width() * 4);
+ p += layout.rowPitch;
+ }
+
+ devFuncs->vkUnmapMemory(dev, frameGrabImageMem);
+
+ devFuncs->vkDestroyImage(dev, frameGrabImage, nullptr);
+ frameGrabImage = VK_NULL_HANDLE;
+ devFuncs->vkFreeMemory(dev, frameGrabImageMem, nullptr);
+ frameGrabImageMem = VK_NULL_HANDLE;
+}
+
+/*!
+ Returns the active physical device.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::preInitResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+VkPhysicalDevice QVulkanWindow::physicalDevice() const
+{
+ Q_D(const QVulkanWindow);
+ if (d->physDevIndex < d->physDevs.count())
+ return d->physDevs[d->physDevIndex];
+ qWarning("QVulkanWindow: Physical device not available");
+ return VK_NULL_HANDLE;
+}
+
+/*!
+ Returns a pointer to the properties for the active physical device.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::preInitResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+const VkPhysicalDeviceProperties *QVulkanWindow::physicalDeviceProperties() const
+{
+ Q_D(const QVulkanWindow);
+ if (d->physDevIndex < d->physDevProps.count())
+ return &d->physDevProps[d->physDevIndex];
+ qWarning("QVulkanWindow: Physical device properties not available");
+ return nullptr;
+}
+
+/*!
+ Returns the active logical device.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+VkDevice QVulkanWindow::device() const
+{
+ Q_D(const QVulkanWindow);
+ return d->dev;
+}
+
+/*!
+ Returns the active graphics queue.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+VkQueue QVulkanWindow::graphicsQueue() const
+{
+ Q_D(const QVulkanWindow);
+ return d->gfxQueue;
+}
+
+/*!
+ Returns the active graphics command pool.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+VkCommandPool QVulkanWindow::graphicsCommandPool() const
+{
+ Q_D(const QVulkanWindow);
+ return d->cmdPool;
+}
+
+/*!
+ Returns a host visible memory type index suitable for general use.
+
+ The returned memory type will be both host visible and coherent. In
+ addition, it will also be cached, if possible.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+uint32_t QVulkanWindow::hostVisibleMemoryIndex() const
+{
+ Q_D(const QVulkanWindow);
+ return d->hostVisibleMemIndex;
+}
+
+/*!
+ Returns a device local memory type index suitable for general use.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+uint32_t QVulkanWindow::deviceLocalMemoryIndex() const
+{
+ Q_D(const QVulkanWindow);
+ return d->deviceLocalMemIndex;
+}
+
+/*!
+ Returns a typical render pass with one sub-pass.
+
+ \note Applications are not required to use this render pass. However, they
+ are then responsible for ensuring the current swap chain and depth-stencil
+ images get transitioned from \c{VK_IMAGE_LAYOUT_UNDEFINED} to
+ \c{VK_IMAGE_LAYOUT_PRESENT_SRC_KHR} and
+ \c{VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL} either via the
+ application's custom render pass or by other means.
+
+ \note Stencil read/write is not enabled in this render pass.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+
+ \sa currentFramebuffer()
+ */
+VkRenderPass QVulkanWindow::defaultRenderPass() const
+{
+ Q_D(const QVulkanWindow);
+ return d->defaultRenderPass;
+}
+
+/*!
+ Returns the color buffer format used by the swapchain.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+
+ \sa setPreferredColorFormats()
+ */
+VkFormat QVulkanWindow::colorFormat() const
+{
+ Q_D(const QVulkanWindow);
+ return d->colorFormat;
+}
+
+/*!
+ Returns the format used by the depth-stencil buffer(s).
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initResources() up until
+ QVulkanWindowRenderer::releaseResources().
+ */
+VkFormat QVulkanWindow::depthStencilFormat() const
+{
+ Q_D(const QVulkanWindow);
+ return d->dsFormat;
+}
+
+/*!
+ Returns the image size of the swapchain.
+
+ This usually matches the size of the window, but may also differ in case
+ \c vkGetPhysicalDeviceSurfaceCapabilitiesKHR reports a fixed size.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+QSize QVulkanWindow::swapChainImageSize() const
+{
+ Q_D(const QVulkanWindow);
+ return d->swapChainImageSize;
+}
+
+/*!
+ Returns The active command buffer for the current swap chain image.
+ Implementations of QVulkanWindowRenderer::startNextFrame() are expected to
+ add commands to this command buffer.
+
+ \note This function must only be called from within startNextFrame() and, in
+ case of asynchronous command generation, up until the call to frameReady().
+ */
+VkCommandBuffer QVulkanWindow::currentCommandBuffer() const
+{
+ Q_D(const QVulkanWindow);
+ if (!d->framePending) {
+ qWarning("QVulkanWindow: Attempted to call currentCommandBuffer() without an active frame");
+ return VK_NULL_HANDLE;
+ }
+ return d->imageRes[d->currentImage].cmdBuf;
+}
+
+/*!
+ Returns a VkFramebuffer for the current swapchain image using the default
+ render pass.
+
+ The framebuffer has two attachments (color, depth-stencil) when
+ multisampling is not in use, and three (color resolve, depth-stencil,
+ multisample color) when sampleCountFlagBits() is greater than
+ \c{VK_SAMPLE_COUNT_1_BIT}. Renderers must take this into account, for
+ example when providing clear values.
+
+ \note Applications are not required to use this framebuffer in case they
+ provide their own render pass instead of using the one returned from
+ defaultRenderPass().
+
+ \note This function must only be called from within startNextFrame() and, in
+ case of asynchronous command generation, up until the call to frameReady().
+
+ \sa defaultRenderPass()
+ */
+VkFramebuffer QVulkanWindow::currentFramebuffer() const
+{
+ Q_D(const QVulkanWindow);
+ if (!d->framePending) {
+ qWarning("QVulkanWindow: Attempted to call currentFramebuffer() without an active frame");
+ return VK_NULL_HANDLE;
+ }
+ return d->imageRes[d->currentImage].fb;
+}
+
+/*!
+ Returns the current frame index in the range [0, concurrentFrameCount() - 1].
+
+ Renderer implementations will have to ensure that uniform data and other
+ dynamic resources exist in multiple copies, in order to prevent frame N
+ altering the data used by the still-active frames N - 1, N - 2, ... N -
+ concurrentFrameCount() + 1.
+
+ To avoid relying on dynamic array sizes, applications can use
+ MAX_CONCURRENT_FRAME_COUNT when declaring arrays. This is guaranteed to be
+ always equal to or greater than the value returned from
+ concurrentFrameCount(). Such arrays can then be indexed by the value
+ returned from this function.
+
+ \code
+ class Renderer {
+ ...
+ VkDescriptorBufferInfo m_uniformBufInfo[QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT];
+ };
+
+ void Renderer::startNextFrame()
+ {
+ VkDescriptorBufferInfo &uniformBufInfo(m_uniformBufInfo[m_window->currentFrame()]);
+ ...
+ }
+ \endcode
+
+ \note This function must only be called from within startNextFrame() and, in
+ case of asynchronous command generation, up until the call to frameReady().
+
+ \sa concurrentFrameCount()
+ */
+int QVulkanWindow::currentFrame() const
+{
+ Q_D(const QVulkanWindow);
+ if (!d->framePending)
+ qWarning("QVulkanWindow: Attempted to call currentFrame() without an active frame");
+ return d->currentFrame;
+}
+
+/*!
+ \variable QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT
+
+ \brief A constant value that is always equal to or greater than the maximum value
+ of concurrentFrameCount().
+ */
+
+/*!
+ Returns the number of frames that can be potentially active at the same time.
+
+ \note The value is constant for the entire lifetime of the QVulkanWindow.
+
+ \code
+ class Renderer {
+ ...
+ VkDescriptorBufferInfo m_uniformBufInfo[QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT];
+ };
+
+ void Renderer::startNextFrame()
+ {
+ const int count = m_window->concurrentFrameCount();
+ for (int i = 0; i < count; ++i)
+ m_uniformBufInfo[i] = ...
+ ...
+ }
+ \endcode
+
+ \sa currentFrame()
+ */
+int QVulkanWindow::concurrentFrameCount() const
+{
+ Q_D(const QVulkanWindow);
+ return d->frameLag;
+}
+
+/*!
+ Returns the number of images in the swap chain.
+
+ \note Accessing this is necessary when providing a custom render pass and
+ framebuffer. The framebuffer is specific to the current swapchain image and
+ hence the application must provide multiple framebuffers.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+int QVulkanWindow::swapChainImageCount() const
+{
+ Q_D(const QVulkanWindow);
+ return d->swapChainBufferCount;
+}
+
+/*!
+ Returns the current swap chain image index in the range [0, swapChainImageCount() - 1].
+
+ \note This function must only be called from within startNextFrame() and, in
+ case of asynchronous command generation, up until the call to frameReady().
+ */
+int QVulkanWindow::currentSwapChainImageIndex() const
+{
+ Q_D(const QVulkanWindow);
+ if (!d->framePending)
+ qWarning("QVulkanWindow: Attempted to call currentSwapChainImageIndex() without an active frame");
+ return d->currentImage;
+}
+
+/*!
+ Returns the specified swap chain image.
+
+ \a idx must be in the range [0, swapChainImageCount() - 1].
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+VkImage QVulkanWindow::swapChainImage(int idx) const
+{
+ Q_D(const QVulkanWindow);
+ return idx >= 0 && idx < d->swapChainBufferCount ? d->imageRes[idx].image : VK_NULL_HANDLE;
+}
+
+/*!
+ Returns the specified swap chain image view.
+
+ \a idx must be in the range [0, swapChainImageCount() - 1].
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+VkImageView QVulkanWindow::swapChainImageView(int idx) const
+{
+ Q_D(const QVulkanWindow);
+ return idx >= 0 && idx < d->swapChainBufferCount ? d->imageRes[idx].imageView : VK_NULL_HANDLE;
+}
+
+/*!
+ Returns the depth-stencil image.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+VkImage QVulkanWindow::depthStencilImage() const
+{
+ Q_D(const QVulkanWindow);
+ return d->dsImage;
+}
+
+/*!
+ Returns the depth-stencil image view.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+VkImageView QVulkanWindow::depthStencilImageView() const
+{
+ Q_D(const QVulkanWindow);
+ return d->dsView;
+}
+
+/*!
+ Returns the current sample count as a \c VkSampleCountFlagBits value.
+
+ When targeting the default render target, the \c rasterizationSamples field
+ of \c VkPipelineMultisampleStateCreateInfo must be set to this value.
+
+ \sa setSampleCount(), supportedSampleCounts()
+ */
+VkSampleCountFlagBits QVulkanWindow::sampleCountFlagBits() const
+{
+ Q_D(const QVulkanWindow);
+ return d->sampleCount;
+}
+
+/*!
+ Returns the specified multisample color image, or \c{VK_NULL_HANDLE} if
+ multisampling is not in use.
+
+ \a idx must be in the range [0, swapChainImageCount() - 1].
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+VkImage QVulkanWindow::msaaColorImage(int idx) const
+{
+ Q_D(const QVulkanWindow);
+ return idx >= 0 && idx < d->swapChainBufferCount ? d->imageRes[idx].msaaImage : VK_NULL_HANDLE;
+}
+
+/*!
+ Returns the specified multisample color image view, or \c{VK_NULL_HANDLE} if
+ multisampling is not in use.
+
+ \a idx must be in the range [0, swapChainImageCount() - 1].
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+VkImageView QVulkanWindow::msaaColorImageView(int idx) const
+{
+ Q_D(const QVulkanWindow);
+ return idx >= 0 && idx < d->swapChainBufferCount ? d->imageRes[idx].msaaImageView : VK_NULL_HANDLE;
+}
+
+/*!
+ Returns true if the swapchain supports usage as transfer source, meaning
+ grab() is functional.
+
+ \note Calling this function is only valid from the invocation of
+ QVulkanWindowRenderer::initSwapChainResources() up until
+ QVulkanWindowRenderer::releaseSwapChainResources().
+ */
+bool QVulkanWindow::supportsGrab() const
+{
+ Q_D(const QVulkanWindow);
+ return d->swapChainSupportsReadBack;
+}
+
+/*!
+ \fn void QVulkanWindow::frameGrabbed(const QImage &image)
+
+ This signal is emitted when the \a image is ready.
+*/
+
+/*!
+ Builds and renders the next frame without presenting it, then performs a
+ blocking readback of the image content.
+
+ Returns the image if the renderer's
+ \l{QVulkanWindowRenderer::startNextFrame()}{startNextFrame()}
+ implementation calls back frameReady() directly. Otherwise, returns an
+ incomplete image, that has the correct size but not the content yet. The
+ content will be delivered via the frameGrabbed() signal in the latter case.
+
+ \note This function should not be called when a frame is in progress
+ (that is, frameReady() has not yet been called back by the application).
+
+ \note This function is potentially expensive due to the additional,
+ blocking readback.
+
+ \note This function currently requires that the swapchain supports usage as
+ a transfer source (\c{VK_IMAGE_USAGE_TRANSFER_SRC_BIT}), and will fail otherwise.
+ */
+QImage QVulkanWindow::grab()
+{
+ Q_D(QVulkanWindow);
+ if (!d->swapChain) {
+ qWarning("QVulkanWindow: Attempted to call grab() without a swapchain");
+ return QImage();
+ }
+ if (d->framePending) {
+ qWarning("QVulkanWindow: Attempted to call grab() while a frame is still pending");
+ return QImage();
+ }
+ if (!d->swapChainSupportsReadBack) {
+ qWarning("QVulkanWindow: Attempted to call grab() with a swapchain that does not support usage as transfer source");
+ return QImage();
+ }
+
+ d->frameGrabbing = true;
+ d->beginFrame();
+
+ return d->frameGrabTargetImage;
+}
+
+/*!
+ Returns a QMatrix4x4 that can be used to correct for coordinate
+ system differences between OpenGL and Vulkan.
+
+ By pre-multiplying the projection matrix with this matrix, applications can
+ continue to assume OpenGL-style Y coordinates in clip space (i.e. Y pointing
+ upwards), and can set minDepth and maxDepth to 0 and 1, respectively,
+ without any further corrections to the vertex Z positions, while using the
+ projection matrices retrieved from the QMatrix4x4 functions, such as
+ QMatrix4x4::perspective(), as-is.
+
+ \note With vertex data following the default OpenGL rules (that is, the
+ front face being CCW), the correct winding order in the rasterization state
+ after applying this matrix is clockwise (\c{VK_FRONT_FACE_CLOCKWISE}).
+ */
+QMatrix4x4 QVulkanWindow::clipCorrectionMatrix()
+{
+ Q_D(QVulkanWindow);
+ if (d->m_clipCorrect.isIdentity()) {
+ // NB the ctor takes row-major
+ d->m_clipCorrect = 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 d->m_clipCorrect;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/vulkan/qvulkanwindow.h b/src/gui/vulkan/qvulkanwindow.h
new file mode 100644
index 0000000000..65249ecbfc
--- /dev/null
+++ b/src/gui/vulkan/qvulkanwindow.h
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QVULKANWINDOW_H
+#define QVULKANWINDOW_H
+
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
+
+#include <QtGui/qvulkaninstance.h>
+#include <QtGui/qwindow.h>
+#include <QtGui/qimage.h>
+#include <QtGui/qmatrix4x4.h>
+#include <QtCore/qset.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVulkanWindowPrivate;
+
+class Q_GUI_EXPORT QVulkanWindowRenderer
+{
+public:
+ virtual ~QVulkanWindowRenderer();
+
+ virtual void preInitResources();
+ virtual void initResources();
+ virtual void initSwapChainResources();
+ virtual void releaseSwapChainResources();
+ virtual void releaseResources();
+
+ virtual void startNextFrame() = 0;
+
+ virtual void physicalDeviceLost();
+ virtual void logicalDeviceLost();
+};
+
+class Q_GUI_EXPORT QVulkanWindow : public QWindow
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QVulkanWindow)
+
+public:
+ enum Flag {
+ PersistentResources = 0x01
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ explicit QVulkanWindow(QWindow *parent = nullptr);
+ ~QVulkanWindow();
+
+ void setFlags(Flags flags);
+ Flags flags() const;
+
+ QVector<VkPhysicalDeviceProperties> availablePhysicalDevices();
+ void setPhysicalDeviceIndex(int idx);
+
+ QVulkanInfoVector<QVulkanExtension> supportedDeviceExtensions();
+ void setDeviceExtensions(const QByteArrayList &extensions);
+
+ void setPreferredColorFormats(const QVector<VkFormat> &formats);
+
+ QVector<int> supportedSampleCounts();
+ void setSampleCount(int sampleCount);
+
+ bool isValid() const;
+
+ virtual QVulkanWindowRenderer *createRenderer();
+ void frameReady();
+
+ VkPhysicalDevice physicalDevice() const;
+ const VkPhysicalDeviceProperties *physicalDeviceProperties() const;
+ VkDevice device() const;
+ VkQueue graphicsQueue() const;
+ VkCommandPool graphicsCommandPool() const;
+ uint32_t hostVisibleMemoryIndex() const;
+ uint32_t deviceLocalMemoryIndex() const;
+ VkRenderPass defaultRenderPass() const;
+
+ VkFormat colorFormat() const;
+ VkFormat depthStencilFormat() const;
+ QSize swapChainImageSize() const;
+
+ VkCommandBuffer currentCommandBuffer() const;
+ VkFramebuffer currentFramebuffer() const;
+ int currentFrame() const;
+
+ static const int MAX_CONCURRENT_FRAME_COUNT = 3;
+ int concurrentFrameCount() const;
+
+ int swapChainImageCount() const;
+ int currentSwapChainImageIndex() const;
+ VkImage swapChainImage(int idx) const;
+ VkImageView swapChainImageView(int idx) const;
+ VkImage depthStencilImage() const;
+ VkImageView depthStencilImageView() const;
+
+ VkSampleCountFlagBits sampleCountFlagBits() const;
+ VkImage msaaColorImage(int idx) const;
+ VkImageView msaaColorImageView(int idx) const;
+
+ bool supportsGrab() const;
+ QImage grab();
+
+ QMatrix4x4 clipCorrectionMatrix();
+
+Q_SIGNALS:
+ void frameGrabbed(const QImage &image);
+
+protected:
+ void exposeEvent(QExposeEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ bool event(QEvent *) override;
+
+private:
+ Q_DISABLE_COPY(QVulkanWindow)
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QVulkanWindow::Flags)
+
+QT_END_NAMESPACE
+
+#endif // QT_CONFIG(vulkan)
+
+#endif
diff --git a/src/gui/vulkan/qvulkanwindow_p.h b/src/gui/vulkan/qvulkanwindow_p.h
new file mode 100644
index 0000000000..c6a772bc31
--- /dev/null
+++ b/src/gui/vulkan/qvulkanwindow_p.h
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QVULKANWINDOW_P_H
+#define QVULKANWINDOW_P_H
+
+#include <QtGui/private/qtguiglobal_p.h>
+
+#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
+
+#include "qvulkanwindow.h"
+#include <QtCore/QHash>
+#include <private/qwindow_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.
+//
+
+QT_BEGIN_NAMESPACE
+
+class QVulkanWindowPrivate : public QWindowPrivate
+{
+ Q_DECLARE_PUBLIC(QVulkanWindow)
+
+public:
+ ~QVulkanWindowPrivate();
+
+ void ensureStarted();
+ void init();
+ void reset();
+ bool createDefaultRenderPass();
+ void recreateSwapChain();
+ uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
+ bool createTransientImage(VkFormat format, VkImageUsageFlags usage, VkImageAspectFlags aspectMask,
+ VkImage *images, VkDeviceMemory *mem, VkImageView *views, int count);
+ void releaseSwapChain();
+ void beginFrame();
+ void endFrame();
+ bool checkDeviceLost(VkResult err);
+ void addReadback();
+ void finishBlockingReadback();
+
+ enum Status {
+ StatusUninitialized,
+ StatusFail,
+ StatusFailRetry,
+ StatusDeviceReady,
+ StatusReady
+ };
+ Status status = StatusUninitialized;
+ QVulkanWindowRenderer *renderer = nullptr;
+ QVulkanInstance *inst = nullptr;
+ VkSurfaceKHR surface = VK_NULL_HANDLE;
+ int physDevIndex = 0;
+ QVector<VkPhysicalDevice> physDevs;
+ QVector<VkPhysicalDeviceProperties> physDevProps;
+ QVulkanWindow::Flags flags = 0;
+ QByteArrayList requestedDevExtensions;
+ QHash<VkPhysicalDevice, QVulkanInfoVector<QVulkanExtension> > supportedDevExtensions;
+ QVector<VkFormat> requestedColorFormats;
+ VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT;
+
+ VkDevice dev = VK_NULL_HANDLE;
+ QVulkanDeviceFunctions *devFuncs;
+ uint32_t gfxQueueFamilyIdx;
+ uint32_t presQueueFamilyIdx;
+ VkQueue gfxQueue;
+ VkQueue presQueue;
+ VkCommandPool cmdPool = VK_NULL_HANDLE;
+ VkCommandPool presCmdPool = VK_NULL_HANDLE;
+ uint32_t hostVisibleMemIndex;
+ uint32_t deviceLocalMemIndex;
+ VkFormat colorFormat;
+ VkColorSpaceKHR colorSpace;
+ VkFormat dsFormat = VK_FORMAT_D24_UNORM_S8_UINT;
+
+ PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = nullptr;
+ PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
+ PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
+ PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
+ PFN_vkQueuePresentKHR vkQueuePresentKHR;
+ PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR = nullptr;
+ PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
+
+ static const int MAX_SWAPCHAIN_BUFFER_COUNT = 3;
+ static const int MAX_FRAME_LAG = QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT;
+ // QVulkanWindow only supports the always available FIFO mode. The
+ // rendering thread will get throttled to the presentation rate (vsync).
+ // This is in effect Example 5 from the VK_KHR_swapchain spec.
+ VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
+ int swapChainBufferCount = 2;
+ int frameLag = 2;
+
+ QSize swapChainImageSize;
+ VkSwapchainKHR swapChain = VK_NULL_HANDLE;
+ bool swapChainSupportsReadBack = false;
+
+ struct ImageResources {
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ VkCommandBuffer cmdBuf = VK_NULL_HANDLE;
+ VkFence cmdFence = VK_NULL_HANDLE;
+ bool cmdFenceWaitable = false;
+ VkFramebuffer fb = VK_NULL_HANDLE;
+ VkCommandBuffer presTransCmdBuf = VK_NULL_HANDLE;
+ VkImage msaaImage = VK_NULL_HANDLE;
+ VkImageView msaaImageView = VK_NULL_HANDLE;
+ } imageRes[MAX_SWAPCHAIN_BUFFER_COUNT];
+
+ VkDeviceMemory msaaImageMem = VK_NULL_HANDLE;
+
+ uint32_t currentImage;
+
+ struct FrameResources {
+ VkFence fence = VK_NULL_HANDLE;
+ bool fenceWaitable = false;
+ VkSemaphore imageSem = VK_NULL_HANDLE;
+ VkSemaphore drawSem = VK_NULL_HANDLE;
+ VkSemaphore presTransSem = VK_NULL_HANDLE;
+ bool imageAcquired = false;
+ bool imageSemWaitable = false;
+ } frameRes[MAX_FRAME_LAG];
+
+ uint32_t currentFrame;
+
+ VkRenderPass defaultRenderPass = VK_NULL_HANDLE;
+
+ VkDeviceMemory dsMem = VK_NULL_HANDLE;
+ VkImage dsImage = VK_NULL_HANDLE;
+ VkImageView dsView = VK_NULL_HANDLE;
+
+ bool framePending = false;
+ bool frameGrabbing = false;
+ QImage frameGrabTargetImage;
+ VkImage frameGrabImage = VK_NULL_HANDLE;
+ VkDeviceMemory frameGrabImageMem = VK_NULL_HANDLE;
+
+ QMatrix4x4 m_clipCorrect;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_CONFIG(vulkan)
+
+#endif
diff --git a/src/gui/vulkan/vk.xml b/src/gui/vulkan/vk.xml
new file mode 100644
index 0000000000..779875b819
--- /dev/null
+++ b/src/gui/vulkan/vk.xml
@@ -0,0 +1,5269 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <comment>
+Copyright (c) 2015-2017 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
+"Materials"), to deal in the Materials without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Materials, and to
+permit persons to whom the Materials are 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 Materials.
+
+THE MATERIALS ARE 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
+MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+------------------------------------------------------------------------
+
+This file, vk.xml, is the Vulkan API Registry. It is a critically important
+and normative part of the Vulkan Specification, including a canonical
+machine-readable definition of the API, parameter and member validation
+language incorporated into the Specification and reference pages, and other
+material which is registered by Khronos, such as tags used by extension and
+layer authors. The only authoritative version of vk.xml is the one
+maintained in the master branch of the Khronos Vulkan GitHub project.
+ </comment>
+
+ <!-- SECTION: Vulkan vendor IDs for physical devices without PCI vendor IDs -->
+ <vendorids>
+ <vendorid name="KHR" id="0x10000" comment="This is the next available Khronos vendor ID"/>
+ <vendorid name="VIV" id="0x10001" comment="Vivante vendor ID"/>
+ <vendorid name="VSI" id="0x10002" comment="VeriSilicon vendor ID"/>
+ </vendorids>
+
+ <!-- SECTION: Vulkan vendor/author tags for extensions and layers -->
+ <tags>
+ <tag name="IMG" author="Imagination Technologies" contact="Michael Worcester @michaelworcester"/>
+ <tag name="AMD" author="Advanced Micro Devices, Inc." contact="Daniel Rakos @aqnuep"/>
+ <tag name="ARM" author="ARM Limited" contact="Jan-Harald Fredriksen @janharald"/>
+ <tag name="FSL" author="Freescale Semiconductor, Inc." contact="Norbert Nopper @FslNopper"/>
+ <tag name="BRCM" author="Broadcom Corporation" contact="Graeme Leese @gnl21"/>
+ <tag name="NXP" author="NXP Semiconductors N.V." contact="Norbert Nopper @FslNopper"/>
+ <tag name="NV" author="NVIDIA Corporation" contact="Daniel Koch @dgkoch"/>
+ <tag name="NVX" author="NVIDIA Corporation" contact="Daniel Koch @dgkoch"/>
+ <tag name="VIV" author="Vivante Corporation" contact="Yanjun Zhang @yanjunzhang"/>
+ <tag name="VSI" author="VeriSilicon Holdings Co., Ltd." contact="Yanjun Zhang @yanjunzhang"/>
+ <tag name="KDAB" author="KDAB" contact="Sean Harmer @seanharmer"/>
+ <tag name="ANDROID" author="Google, Inc." contact="Jesse Hall @jessehall"/>
+ <tag name="CHROMIUM" author="Google, Inc." contact="Jesse Hall @jessehall"/>
+ <tag name="GOOGLE" author="Google, Inc." contact="Jesse Hall @jessehall"/>
+ <tag name="QCOM" author="Qualcomm Technologies, Inc." contact="Maurice Ribble @mribble"/>
+ <tag name="LUNARG" author="LunarG, Inc." contact="Karen Ghavam @KarenGhavam"/>
+ <tag name="SAMSUNG" author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/>
+ <tag name="SEC" author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/>
+ <tag name="TIZEN" author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/>
+ <tag name="RENDERDOC" author="RenderDoc (renderdoc.org)" contact="baldurk@baldurk.org"/>
+ <tag name="NN" author="Nintendo Co., Ltd." contact="Yasuhiro Yoshioka @yoshioka_yasuhiro"/>
+ </tags>
+
+ <!-- SECTION: Vulkan type definitions -->
+ <types>
+ <type name="vk_platform" category="include">#include "vk_platform.h"</type>
+ <!-- WSI extensions -->
+ <type category="include">#include "<name>vulkan.h</name>"</type>
+ <type category="include">#include &lt;<name>X11/Xlib.h</name>&gt;</type>
+ <type category="include">#include &lt;<name>X11/extensions/Xrandr.h</name>&gt;</type>
+ <type category="include">#include &lt;<name>android/native_window.h</name>&gt;</type>
+ <type category="include">#include &lt;<name>mir_toolkit/client_types.h</name>&gt;</type>
+ <type category="include">#include &lt;<name>wayland-client.h</name>&gt;</type>
+ <type category="include">#include &lt;<name>windows.h</name>&gt;</type>
+ <type category="include">#include &lt;<name>xcb/xcb.h</name>&gt;</type>
+
+ <type requires="X11/Xlib.h" name="Display"/>
+ <type requires="X11/Xlib.h" name="VisualID"/>
+ <type requires="X11/Xlib.h" name="Window"/>
+ <type requires="X11/extensions/Xrandr.h" name="RROutput"/>
+ <type requires="android/native_window.h" name="ANativeWindow"/>
+ <type requires="mir_toolkit/client_types.h" name="MirConnection"/>
+ <type requires="mir_toolkit/client_types.h" name="MirSurface"/>
+ <type requires="wayland-client.h" name="wl_display"/>
+ <type requires="wayland-client.h" name="wl_surface"/>
+ <type requires="windows.h" name="HINSTANCE"/>
+ <type requires="windows.h" name="HWND"/>
+ <type requires="windows.h" name="HANDLE"/>
+ <type requires="windows.h" name="SECURITY_ATTRIBUTES"/>
+ <type requires="windows.h" name="DWORD"/>
+ <type requires="xcb/xcb.h" name="xcb_connection_t"/>
+ <type requires="xcb/xcb.h" name="xcb_visualid_t"/>
+ <type requires="xcb/xcb.h" name="xcb_window_t"/>
+
+ <type category="define">#define <name>VK_MAKE_VERSION</name>(major, minor, patch) \
+ (((major) &lt;&lt; 22) | ((minor) &lt;&lt; 12) | (patch))</type>
+ <type category="define">#define <name>VK_VERSION_MAJOR</name>(version) ((uint32_t)(version) &gt;&gt; 22)</type>
+ <type category="define">#define <name>VK_VERSION_MINOR</name>(version) (((uint32_t)(version) &gt;&gt; 12) &amp; 0x3ff)</type>
+ <type category="define">#define <name>VK_VERSION_PATCH</name>(version) ((uint32_t)(version) &amp; 0xfff)</type>
+
+ <type category="define">// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead.
+//#define <name>VK_API_VERSION</name> <type>VK_MAKE_VERSION</type>(1, 0, 0)</type> <!-- The patch version here should never be set to anything other than 0 -->
+ <type category="define">// Vulkan 1.0 version number
+#define <name>VK_API_VERSION_1_0</name> <type>VK_MAKE_VERSION</type>(1, 0, 0)</type> <!-- The patch version here should never be set to anything other than 0 -->
+ <type category="define">// Version of this file
+#define <name>VK_HEADER_VERSION</name> 39</type>
+
+ <type category="define">
+#define <name>VK_DEFINE_HANDLE</name>(object) typedef struct object##_T* object;</type>
+
+ <type category="define" name="VK_DEFINE_NON_DISPATCHABLE_HANDLE">
+#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE)
+#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) &amp;&amp; !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
+ #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
+#else
+ #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
+#endif
+#endif
+ </type>
+
+ <type category="define">
+#define <name>VK_NULL_HANDLE</name> 0
+ </type>
+
+ <type category="basetype">typedef <type>uint32_t</type> <name>VkSampleMask</name>;</type>
+ <type category="basetype">typedef <type>uint32_t</type> <name>VkBool32</name>;</type>
+ <type category="basetype">typedef <type>uint32_t</type> <name>VkFlags</name>;</type>
+ <type category="basetype">typedef <type>uint64_t</type> <name>VkDeviceSize</name>;</type>
+ <!-- Basic C types, pulled in via vk_platform.h -->
+ <type requires="vk_platform" name="void"/>
+ <type requires="vk_platform" name="char"/>
+ <type requires="vk_platform" name="float"/>
+ <type requires="vk_platform" name="uint8_t"/>
+ <type requires="vk_platform" name="uint32_t"/>
+ <type requires="vk_platform" name="uint64_t"/>
+ <type requires="vk_platform" name="int32_t"/>
+ <type requires="vk_platform" name="size_t"/>
+ <!-- Bitmask types -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkFramebufferCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkQueryPoolCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkRenderPassCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkSamplerCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineLayoutCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCacheCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineDepthStencilStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineDynamicStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineColorBlendStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineMultisampleStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineViewportStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineTessellationStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineInputAssemblyStateCreateFlags</name>;</type><!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineVertexInputStateCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineShaderStageCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorSetLayoutCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkBufferViewCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkInstanceCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceCreateFlags</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceQueueCreateFlags</name>;</type> <!-- creation flags -->
+ <type requires="VkQueueFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkQueueFlags</name>;</type> <!-- Queue capabilities -->
+ <type requires="VkMemoryPropertyFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryPropertyFlags</name>;</type> <!-- Memory properties passed into vkAllocateMemory(). -->
+ <type requires="VkMemoryHeapFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryHeapFlags</name>;</type> <!-- Memory heap flags -->
+ <type requires="VkAccessFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkAccessFlags</name>;</type> <!-- Memory access flags passed to barrier/dependency operations -->
+ <type requires="VkBufferUsageFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkBufferUsageFlags</name>;</type> <!-- Buffer usage flags -->
+ <type requires="VkBufferCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkBufferCreateFlags</name>;</type> <!-- Buffer creation flags -->
+ <type requires="VkShaderStageFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkShaderStageFlags</name>;</type> <!-- Shader stage flags -->
+ <type requires="VkImageUsageFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkImageUsageFlags</name>;</type> <!-- Image usage flags -->
+ <type requires="VkImageCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkImageCreateFlags</name>;</type> <!-- Image creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkImageViewCreateFlags</name>;</type> <!-- Image view creation flags (no bits yet) -->
+ <type requires="VkPipelineCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCreateFlags</name>;</type> <!-- Pipeline creation flags -->
+ <type requires="VkColorComponentFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkColorComponentFlags</name>;</type> <!-- Color component flags -->
+ <type requires="VkFenceCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkFenceCreateFlags</name>;</type> <!-- Fence creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkSemaphoreCreateFlags</name>;</type> <!-- Semaphore creation flags -->
+ <type requires="VkFormatFeatureFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkFormatFeatureFlags</name>;</type> <!-- Format capability flags -->
+ <type requires="VkQueryControlFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkQueryControlFlags</name>;</type> <!-- Query control flags -->
+ <type requires="VkQueryResultFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkQueryResultFlags</name>;</type> <!-- Query result flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkShaderModuleCreateFlags</name>;</type> <!-- Shader module creation flags (no bits yet) -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkEventCreateFlags</name>;</type> <!-- Event creation flags (no bits yet) -->
+ <type requires="VkCommandPoolCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolCreateFlags</name>;</type> <!-- Command pool creation flags -->
+ <type requires="VkCommandPoolResetFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolResetFlags</name>;</type> <!-- Command pool reset flags -->
+ <type requires="VkCommandBufferResetFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkCommandBufferResetFlags</name>;</type> <!-- Command buffer reset flags -->
+ <type requires="VkCommandBufferUsageFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkCommandBufferUsageFlags</name>;</type> <!-- Command buffer usage flags -->
+ <type requires="VkQueryPipelineStatisticFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkQueryPipelineStatisticFlags</name>;</type> <!-- Pipeline statistics flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryMapFlags</name>;</type> <!-- Memory mapping flags (no bits yet) -->
+ <type requires="VkImageAspectFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkImageAspectFlags</name>;</type> <!-- Bitmask of image aspects -->
+ <type requires="VkSparseMemoryBindFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSparseMemoryBindFlags</name>;</type> <!-- Sparse memory bind flags -->
+ <type requires="VkSparseImageFormatFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSparseImageFormatFlags</name>;</type> <!-- Sparse image memory requirements flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkSubpassDescriptionFlags</name>;</type> <!-- Subpass description flags -->
+ <type requires="VkPipelineStageFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineStageFlags</name>;</type> <!-- Pipeline stages -->
+ <type requires="VkSampleCountFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSampleCountFlags</name>;</type> <!-- Pipeline stages -->
+ <type requires="VkAttachmentDescriptionFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkAttachmentDescriptionFlags</name>;</type> <!-- Render pass attachment description flags -->
+ <type requires="VkStencilFaceFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkStencilFaceFlags</name>;</type> <!-- Stencil face flags -->
+ <type requires="VkCullModeFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkCullModeFlags</name>;</type> <!-- Cull mode flags -->
+ <type requires="VkDescriptorPoolCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorPoolCreateFlags</name>;</type> <!-- Descriptor pool creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorPoolResetFlags</name>;</type> <!-- Descriptor pool reset flags -->
+ <type requires="VkDependencyFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkDependencyFlags</name>;</type> <!-- Pipeline barrier and subpass dependency flags -->
+
+ <type requires="VkIndirectCommandsLayoutUsageFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkIndirectCommandsLayoutUsageFlagsNVX</name>;</type> <!-- Device generated commands usage flags -->
+ <type requires="VkObjectEntryUsageFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkObjectEntryUsageFlagsNVX</name>;</type> <!-- Object usage flags -->
+
+ <!-- WSI extensions -->
+ <type requires="VkCompositeAlphaFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkCompositeAlphaFlagsKHR</name>;</type>
+ <type requires="VkDisplayPlaneAlphaFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkDisplayPlaneAlphaFlagsKHR</name>;</type>
+ <type requires="VkSurfaceTransformFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkSurfaceTransformFlagsKHR</name>;</type>
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkSwapchainCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkDisplayModeCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkDisplaySurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkAndroidSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkMirSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkViSurfaceCreateFlagsNN</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkWaylandSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkWin32SurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkXlibSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkXcbSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags -->
+
+ <type requires="VkDebugReportFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkDebugReportFlagsEXT</name>;</type>
+ <type category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolTrimFlagsKHR</name>;</type>
+ <type requires="VkExternalMemoryHandleTypeFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryHandleTypeFlagsNV</name>;</type>
+ <type requires="VkExternalMemoryFeatureFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryFeatureFlagsNV</name>;</type>
+ <type requires="VkSurfaceCounterFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkSurfaceCounterFlagsEXT</name>;</type>
+
+ <!-- Types which can be void pointers or class pointers, selected at compile time -->
+ <type category="handle"><type>VK_DEFINE_HANDLE</type>(<name>VkInstance</name>)</type>
+ <type category="handle" parent="VkInstance"><type>VK_DEFINE_HANDLE</type>(<name>VkPhysicalDevice</name>)</type>
+ <type category="handle" parent="VkPhysicalDevice"><type>VK_DEFINE_HANDLE</type>(<name>VkDevice</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_HANDLE</type>(<name>VkQueue</name>)</type>
+ <type category="handle" parent="VkCommandPool"><type>VK_DEFINE_HANDLE</type>(<name>VkCommandBuffer</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDeviceMemory</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkCommandPool</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkBuffer</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkBufferView</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkImage</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkImageView</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkShaderModule</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipeline</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipelineLayout</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSampler</name>)</type>
+ <type category="handle" parent="VkDescriptorPool"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorSet</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorSetLayout</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorPool</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkFence</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSemaphore</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkEvent</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkQueryPool</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkFramebuffer</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkRenderPass</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipelineCache</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkObjectTableNVX</name>)</type>
+ <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkIndirectCommandsLayoutNVX</name>)</type>
+
+ <!-- WSI extensions -->
+ <type category="handle"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDisplayKHR</name>)</type>
+ <type category="handle" parent="VkPhysicalDevice,VkDisplayKHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDisplayModeKHR</name>)</type>
+ <type category="handle" parent="VkInstance"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSurfaceKHR</name>)</type>
+ <type category="handle" parent="VkSurfaceKHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSwapchainKHR</name>)</type>
+ <type category="handle" parent="VkInstance"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDebugReportCallbackEXT</name>)</type>
+
+ <!-- Types generated from corresponding <enums> tags below -->
+ <type name="VkAttachmentLoadOp" category="enum"/>
+ <type name="VkAttachmentStoreOp" category="enum"/>
+ <type name="VkBlendFactor" category="enum"/>
+ <type name="VkBlendOp" category="enum"/>
+ <type name="VkBorderColor" category="enum"/>
+ <type name="VkFramebufferCreateFlagBits" category="enum"/>
+ <type name="VkQueryPoolCreateFlagBits" category="enum"/>
+ <type name="VkRenderPassCreateFlagBits" category="enum"/>
+ <type name="VkSamplerCreateFlagBits" category="enum"/>
+ <type name="VkPipelineCacheHeaderVersion" category="enum"/>
+ <type name="VkPipelineLayoutCreateFlagBits" category="enum"/>
+ <type name="VkPipelineCacheCreateFlagBits" category="enum"/>
+ <type name="VkPipelineDepthStencilStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineDynamicStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineColorBlendStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineMultisampleStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineRasterizationStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineViewportStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineTessellationStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineInputAssemblyStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineVertexInputStateCreateFlagBits" category="enum"/>
+ <type name="VkPipelineShaderStageCreateFlagBits" category="enum"/>
+ <type name="VkDescriptorSetLayoutCreateFlagBits" category="enum"/>
+ <type name="VkBufferViewCreateFlagBits" category="enum"/>
+ <type name="VkInstanceCreateFlagBits" category="enum"/>
+ <type name="VkDeviceQueueCreateFlagBits" category="enum"/>
+ <type name="VkBufferCreateFlagBits" category="enum"/>
+ <type name="VkBufferUsageFlagBits" category="enum"/>
+ <type name="VkColorComponentFlagBits" category="enum"/>
+ <type name="VkComponentSwizzle" category="enum"/>
+ <type name="VkCommandPoolCreateFlagBits" category="enum"/>
+ <type name="VkCommandPoolResetFlagBits" category="enum"/>
+ <type name="VkCommandBufferResetFlagBits" category="enum"/>
+ <type name="VkCommandBufferLevel" category="enum"/>
+ <type name="VkCommandBufferUsageFlagBits" category="enum"/>
+ <type name="VkCompareOp" category="enum"/>
+ <type name="VkCullModeFlagBits" category="enum"/>
+ <type name="VkDescriptorType" category="enum"/>
+ <type name="VkDeviceCreateFlagBits" category="enum"/>
+ <type name="VkDynamicState" category="enum"/>
+ <type name="VkFenceCreateFlagBits" category="enum"/>
+ <type name="VkPolygonMode" category="enum"/>
+ <type name="VkFormat" category="enum"/>
+ <type name="VkFormatFeatureFlagBits" category="enum"/>
+ <type name="VkFrontFace" category="enum"/>
+ <type name="VkImageAspectFlagBits" category="enum"/>
+ <type name="VkImageCreateFlagBits" category="enum"/>
+ <type name="VkImageLayout" category="enum"/>
+ <type name="VkImageTiling" category="enum"/>
+ <type name="VkImageType" category="enum"/>
+ <type name="VkImageUsageFlagBits" category="enum"/>
+ <type name="VkImageViewType" category="enum"/>
+ <type name="VkSharingMode" category="enum"/>
+ <type name="VkIndexType" category="enum"/>
+ <type name="VkLogicOp" category="enum"/>
+ <type name="VkMemoryHeapFlagBits" category="enum"/>
+ <type name="VkAccessFlagBits" category="enum"/>
+ <type name="VkMemoryPropertyFlagBits" category="enum"/>
+ <type name="VkPhysicalDeviceType" category="enum"/>
+ <type name="VkPipelineBindPoint" category="enum"/>
+ <type name="VkPipelineCreateFlagBits" category="enum"/>
+ <type name="VkPrimitiveTopology" category="enum"/>
+ <type name="VkQueryControlFlagBits" category="enum"/>
+ <type name="VkQueryPipelineStatisticFlagBits" category="enum"/>
+ <type name="VkQueryResultFlagBits" category="enum"/>
+ <type name="VkQueryType" category="enum"/>
+ <type name="VkQueueFlagBits" category="enum"/>
+ <type name="VkSubpassContents" category="enum"/>
+ <type name="VkResult" category="enum"/>
+ <type name="VkShaderStageFlagBits" category="enum"/>
+ <type name="VkSparseMemoryBindFlagBits" category="enum"/>
+ <type name="VkStencilFaceFlagBits" category="enum"/>
+ <type name="VkStencilOp" category="enum"/>
+ <type name="VkStructureType" category="enum"/>
+ <type name="VkSystemAllocationScope" category="enum"/>
+ <type name="VkInternalAllocationType" category="enum"/>
+ <type name="VkSamplerAddressMode" category="enum"/>
+ <type name="VkFilter" category="enum"/>
+ <type name="VkSamplerMipmapMode" category="enum"/>
+ <type name="VkVertexInputRate" category="enum"/>
+ <type name="VkPipelineStageFlagBits" category="enum"/>
+ <type name="VkSparseImageFormatFlagBits" category="enum"/>
+ <type name="VkSampleCountFlagBits" category="enum"/>
+ <type name="VkAttachmentDescriptionFlagBits" category="enum"/>
+ <type name="VkDescriptorPoolCreateFlagBits" category="enum"/>
+ <type name="VkDependencyFlagBits" category="enum"/>
+ <type name="VkIndirectCommandsLayoutUsageFlagBitsNVX" category="enum"/>
+ <type name="VkIndirectCommandsTokenTypeNVX" category="enum"/>
+ <type name="VkObjectEntryUsageFlagBitsNVX" category="enum"/>
+ <type name="VkObjectEntryTypeNVX" category="enum"/>
+ <!-- WSI extensions -->
+ <type name="VkColorSpaceKHR" category="enum"/>
+ <type name="VkCompositeAlphaFlagBitsKHR" category="enum"/>
+ <type name="VkDisplayPlaneAlphaFlagBitsKHR" category="enum"/>
+ <type name="VkPresentModeKHR" category="enum"/>
+ <type name="VkSurfaceTransformFlagBitsKHR" category="enum"/>
+ <type name="VkDebugReportFlagBitsEXT" category="enum"/>
+ <type name="VkDebugReportObjectTypeEXT" category="enum"/>
+ <type name="VkDebugReportErrorEXT" category="enum"/>
+ <type name="VkRasterizationOrderAMD" category="enum"/>
+ <type name="VkExternalMemoryHandleTypeFlagBitsNV" category="enum"/>
+ <type name="VkExternalMemoryFeatureFlagBitsNV" category="enum"/>
+ <type name="VkValidationCheckEXT" category="enum"/>
+ <type name="VkSurfaceCounterFlagBitsEXT" category="enum"/>
+ <type name="VkDisplayPowerStateEXT" category="enum"/>
+ <type name="VkDeviceEventTypeEXT" category="enum"/>
+ <type name="VkDisplayEventTypeEXT" category="enum"/>
+
+ <!-- The PFN_vk*Function types are used by VkAllocationCallbacks below -->
+ <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkInternalAllocationNotification</name>)(
+ <type>void</type>* pUserData,
+ <type>size_t</type> size,
+ <type>VkInternalAllocationType</type> allocationType,
+ <type>VkSystemAllocationScope</type> allocationScope);</type>
+ <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkInternalFreeNotification</name>)(
+ <type>void</type>* pUserData,
+ <type>size_t</type> size,
+ <type>VkInternalAllocationType</type> allocationType,
+ <type>VkSystemAllocationScope</type> allocationScope);</type>
+ <type category="funcpointer">typedef void* (VKAPI_PTR *<name>PFN_vkReallocationFunction</name>)(
+ <type>void</type>* pUserData,
+ <type>void</type>* pOriginal,
+ <type>size_t</type> size,
+ <type>size_t</type> alignment,
+ <type>VkSystemAllocationScope</type> allocationScope);</type>
+ <type category="funcpointer">typedef void* (VKAPI_PTR *<name>PFN_vkAllocationFunction</name>)(
+ <type>void</type>* pUserData,
+ <type>size_t</type> size,
+ <type>size_t</type> alignment,
+ <type>VkSystemAllocationScope</type> allocationScope);</type>
+ <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkFreeFunction</name>)(
+ <type>void</type>* pUserData,
+ <type>void</type>* pMemory);</type>
+
+ <!-- The PFN_vkVoidFunction type are used by VkGet*ProcAddr below -->
+ <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkVoidFunction</name>)(void);</type>
+
+ <!-- The PFN_vkDebugReportCallbackEXT type are used by the DEBUG_REPORT extension-->
+ <type category="funcpointer">typedef VkBool32 (VKAPI_PTR *<name>PFN_vkDebugReportCallbackEXT</name>)(
+ <type>VkDebugReportFlagsEXT</type> flags,
+ <type>VkDebugReportObjectTypeEXT</type> objectType,
+ <type>uint64_t</type> object,
+ <type>size_t</type> location,
+ <type>int32_t</type> messageCode,
+ const <type>char</type>* pLayerPrefix,
+ const <type>char</type>* pMessage,
+ <type>void</type>* pUserData);</type>
+
+ <!-- Struct types -->
+ <type category="struct" name="VkOffset2D">
+ <member><type>int32_t</type> <name>x</name></member>
+ <member><type>int32_t</type> <name>y</name></member>
+ </type>
+ <type category="struct" name="VkOffset3D">
+ <member><type>int32_t</type> <name>x</name></member>
+ <member><type>int32_t</type> <name>y</name></member>
+ <member><type>int32_t</type> <name>z</name></member>
+ </type>
+ <type category="struct" name="VkExtent2D">
+ <member><type>uint32_t</type> <name>width</name></member>
+ <member><type>uint32_t</type> <name>height</name></member>
+ </type>
+ <type category="struct" name="VkExtent3D">
+ <member><type>uint32_t</type> <name>width</name></member>
+ <member><type>uint32_t</type> <name>height</name></member>
+ <member><type>uint32_t</type> <name>depth</name></member>
+ </type>
+ <type category="struct" name="VkViewport">
+ <member><type>float</type> <name>x</name></member>
+ <member><type>float</type> <name>y</name></member>
+ <member><type>float</type> <name>width</name></member>
+ <member><type>float</type> <name>height</name></member>
+ <member><type>float</type> <name>minDepth</name></member>
+ <member><type>float</type> <name>maxDepth</name></member>
+ </type>
+ <type category="struct" name="VkRect2D">
+ <member><type>VkOffset2D</type> <name>offset</name></member>
+ <member><type>VkExtent2D</type> <name>extent</name></member>
+ </type>
+ <type category="struct" name="VkRect3D">
+ <member><type>VkOffset3D</type> <name>offset</name></member>
+ <member><type>VkExtent3D</type> <name>extent</name></member>
+ </type>
+ <type category="struct" name="VkClearRect">
+ <member><type>VkRect2D</type> <name>rect</name></member>
+ <member><type>uint32_t</type> <name>baseArrayLayer</name></member>
+ <member><type>uint32_t</type> <name>layerCount</name></member>
+ </type>
+ <type category="struct" name="VkComponentMapping">
+ <member><type>VkComponentSwizzle</type> <name>r</name></member>
+ <member><type>VkComponentSwizzle</type> <name>g</name></member>
+ <member><type>VkComponentSwizzle</type> <name>b</name></member>
+ <member><type>VkComponentSwizzle</type> <name>a</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceProperties" returnedonly="true">
+ <member><type>uint32_t</type> <name>apiVersion</name></member>
+ <member><type>uint32_t</type> <name>driverVersion</name></member>
+ <member><type>uint32_t</type> <name>vendorID</name></member>
+ <member><type>uint32_t</type> <name>deviceID</name></member>
+ <member><type>VkPhysicalDeviceType</type> <name>deviceType</name></member>
+ <member><type>char</type> <name>deviceName</name>[<enum>VK_MAX_PHYSICAL_DEVICE_NAME_SIZE</enum>]</member>
+ <member><type>uint8_t</type> <name>pipelineCacheUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+ <member><type>VkPhysicalDeviceLimits</type> <name>limits</name></member>
+ <member><type>VkPhysicalDeviceSparseProperties</type> <name>sparseProperties</name></member>
+ </type>
+ <type category="struct" name="VkExtensionProperties" returnedonly="true">
+ <member><type>char</type> <name>extensionName</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]</member> <!-- extension name -->
+ <member><type>uint32_t</type> <name>specVersion</name></member> <!-- version of the extension specification implemented -->
+ </type>
+ <type category="struct" name="VkLayerProperties" returnedonly="true">
+ <member><type>char</type> <name>layerName</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]</member> <!-- layer name -->
+ <member><type>uint32_t</type> <name>specVersion</name></member> <!-- version of the layer specification implemented -->
+ <member><type>uint32_t</type> <name>implementationVersion</name></member> <!-- build or release version of the layer's library -->
+ <member><type>char</type> <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member> <!-- Free-form description of the layer -->
+ </type>
+ <type category="struct" name="VkApplicationInfo">
+ <member values="VK_STRUCTURE_TYPE_APPLICATION_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true" len="null-terminated">const <type>char</type>* <name>pApplicationName</name></member>
+ <member><type>uint32_t</type> <name>applicationVersion</name></member>
+ <member optional="true" len="null-terminated">const <type>char</type>* <name>pEngineName</name></member>
+ <member><type>uint32_t</type> <name>engineVersion</name></member>
+ <member><type>uint32_t</type> <name>apiVersion</name></member>
+ </type>
+ <type category="struct" name="VkAllocationCallbacks">
+ <member optional="true"><type>void</type>* <name>pUserData</name></member>
+ <member><type>PFN_vkAllocationFunction</type> <name>pfnAllocation</name></member>
+ <member><type>PFN_vkReallocationFunction</type> <name>pfnReallocation</name></member>
+ <member><type>PFN_vkFreeFunction</type> <name>pfnFree</name></member>
+ <member optional="true"><type>PFN_vkInternalAllocationNotification</type> <name>pfnInternalAllocation</name></member>
+ <member optional="true"><type>PFN_vkInternalFreeNotification</type> <name>pfnInternalFree</name></member>
+ </type>
+ <type category="struct" name="VkDeviceQueueCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkDeviceQueueCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>uint32_t</type> <name>queueFamilyIndex</name></member>
+ <member><type>uint32_t</type> <name>queueCount</name></member>
+ <member len="queueCount">const <type>float</type>* <name>pQueuePriorities</name></member>
+ </type>
+ <type category="struct" name="VkDeviceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member validextensionstructs="VkPhysicalDeviceFeatures2KHR">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkDeviceCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>uint32_t</type> <name>queueCreateInfoCount</name></member>
+ <member len="queueCreateInfoCount">const <type>VkDeviceQueueCreateInfo</type>* <name>pQueueCreateInfos</name></member>
+ <member optional="true"><type>uint32_t</type> <name>enabledLayerCount</name></member>
+ <member len="enabledLayerCount,null-terminated">const <type>char</type>* const* <name>ppEnabledLayerNames</name></member> <!-- Ordered list of layer names to be enabled -->
+ <member optional="true"><type>uint32_t</type> <name>enabledExtensionCount</name></member>
+ <member len="enabledExtensionCount,null-terminated">const <type>char</type>* const* <name>ppEnabledExtensionNames</name></member>
+ <member optional="true">const <type>VkPhysicalDeviceFeatures</type>* <name>pEnabledFeatures</name></member>
+ </type>
+ <type category="struct" name="VkInstanceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkInstanceCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member optional="true">const <type>VkApplicationInfo</type>* <name>pApplicationInfo</name></member>
+ <member optional="true"><type>uint32_t</type> <name>enabledLayerCount</name></member>
+ <member len="enabledLayerCount,null-terminated">const <type>char</type>* const* <name>ppEnabledLayerNames</name></member> <!-- Ordered list of layer names to be enabled -->
+ <member optional="true"><type>uint32_t</type> <name>enabledExtensionCount</name></member>
+ <member len="enabledExtensionCount,null-terminated">const <type>char</type>* const* <name>ppEnabledExtensionNames</name></member> <!-- Extension names to be enabled -->
+ </type>
+ <type category="struct" name="VkQueueFamilyProperties" returnedonly="true">
+ <member optional="true"><type>VkQueueFlags</type> <name>queueFlags</name></member> <!-- Queue flags -->
+ <member><type>uint32_t</type> <name>queueCount</name></member>
+ <member><type>uint32_t</type> <name>timestampValidBits</name></member>
+ <member><type>VkExtent3D</type> <name>minImageTransferGranularity</name></member> <!-- Minimum alignment requirement for image transfers -->
+ </type>
+ <type category="struct" name="VkPhysicalDeviceMemoryProperties" returnedonly="true">
+ <member><type>uint32_t</type> <name>memoryTypeCount</name></member>
+ <member><type>VkMemoryType</type> <name>memoryTypes</name>[<enum>VK_MAX_MEMORY_TYPES</enum>]</member>
+ <member><type>uint32_t</type> <name>memoryHeapCount</name></member>
+ <member><type>VkMemoryHeap</type> <name>memoryHeaps</name>[<enum>VK_MAX_MEMORY_HEAPS</enum>]</member>
+ </type>
+ <type category="struct" name="VkMemoryAllocateInfo">
+ <member values="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member validextensionstructs="VkDedicatedAllocationMemoryAllocateInfoNV">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDeviceSize</type> <name>allocationSize</name></member> <!-- Size of memory allocation -->
+ <member><type>uint32_t</type> <name>memoryTypeIndex</name></member> <!-- Index of the of the memory type to allocate from -->
+ </type>
+ <type category="struct" name="VkMemoryRequirements" returnedonly="true">
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>alignment</name></member> <!-- Specified in bytes -->
+ <member><type>uint32_t</type> <name>memoryTypeBits</name></member> <!-- Bitmask of the allowed memory type indices into memoryTypes[] for this object -->
+ </type>
+ <type category="struct" name="VkSparseImageFormatProperties" returnedonly="true">
+ <member optional="true"><type>VkImageAspectFlags</type> <name>aspectMask</name></member>
+ <member><type>VkExtent3D</type> <name>imageGranularity</name></member>
+ <member optional="true"><type>VkSparseImageFormatFlags</type> <name>flags</name></member>
+ </type>
+ <type category="struct" name="VkSparseImageMemoryRequirements" returnedonly="true">
+ <member><type>VkSparseImageFormatProperties</type> <name>formatProperties</name></member>
+ <member><type>uint32_t</type> <name>imageMipTailFirstLod</name></member>
+ <member><type>VkDeviceSize</type> <name>imageMipTailSize</name></member> <!-- Specified in bytes, must be a multiple of sparse block size in bytes / alignment -->
+ <member><type>VkDeviceSize</type> <name>imageMipTailOffset</name></member> <!-- Specified in bytes, must be a multiple of sparse block size in bytes / alignment -->
+ <member><type>VkDeviceSize</type> <name>imageMipTailStride</name></member> <!-- Specified in bytes, must be a multiple of sparse block size in bytes / alignment -->
+ </type>
+ <type category="struct" name="VkMemoryType" returnedonly="true">
+ <member optional="true"><type>VkMemoryPropertyFlags</type> <name>propertyFlags</name></member> <!-- Memory properties of this memory type -->
+ <member><type>uint32_t</type> <name>heapIndex</name></member> <!-- Index of the memory heap allocations of this memory type are taken from -->
+ </type>
+ <type category="struct" name="VkMemoryHeap" returnedonly="true">
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Available memory in the heap-->
+ <member optional="true"><type>VkMemoryHeapFlags</type> <name>flags</name></member> <!-- Flags for the heap-->
+ </type>
+ <type category="struct" name="VkMappedMemoryRange">
+ <member values="VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDeviceMemory</type> <name>memory</name></member> <!-- Mapped memory object -->
+ <member><type>VkDeviceSize</type> <name>offset</name></member> <!-- Offset within the memory object where the range starts -->
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Size of the range within the memory object -->
+ </type>
+ <type category="struct" name="VkFormatProperties" returnedonly="true">
+ <member optional="true"><type>VkFormatFeatureFlags</type> <name>linearTilingFeatures</name></member> <!-- Format features in case of linear tiling -->
+ <member optional="true"><type>VkFormatFeatureFlags</type> <name>optimalTilingFeatures</name></member> <!-- Format features in case of optimal tiling -->
+ <member optional="true"><type>VkFormatFeatureFlags</type> <name>bufferFeatures</name></member> <!-- Format features supported by buffers -->
+ </type>
+ <type category="struct" name="VkImageFormatProperties" returnedonly="true">
+ <member><type>VkExtent3D</type> <name>maxExtent</name></member> <!-- max image dimensions for this resource type -->
+ <member><type>uint32_t</type> <name>maxMipLevels</name></member> <!-- max number of mipmap levels for this resource type -->
+ <member><type>uint32_t</type> <name>maxArrayLayers</name></member> <!-- max array size for this resource type -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>sampleCounts</name></member> <!-- supported sample counts for this resource type -->
+ <member><type>VkDeviceSize</type> <name>maxResourceSize</name></member> <!-- max size (in bytes) of this resource type -->
+ </type>
+ <type category="struct" name="VkDescriptorBufferInfo">
+ <member><type>VkBuffer</type> <name>buffer</name></member> <!-- Buffer used for this descriptor slot when the descriptor is UNIFORM_BUFFER[_DYNAMIC] or STORAGE_BUFFER[_DYNAMIC]. VK_NULL_HANDLE otherwise. -->
+ <member><type>VkDeviceSize</type> <name>offset</name></member> <!-- Base offset from buffer start in bytes to update in the descriptor set. -->
+ <member><type>VkDeviceSize</type> <name>range</name></member> <!-- Size in bytes of the buffer resource for this descriptor update. -->
+ </type>
+ <type category="struct" name="VkDescriptorImageInfo">
+ <member noautovalidity="true"><type>VkSampler</type> <name>sampler</name></member> <!-- Sampler to write to the descriptor in case it is a SAMPLER or COMBINED_IMAGE_SAMPLER descriptor. Ignored otherwise. -->
+ <member noautovalidity="true"><type>VkImageView</type> <name>imageView</name></member> <!-- Image view to write to the descriptor in case it is a SAMPLED_IMAGE, STORAGE_IMAGE, COMBINED_IMAGE_SAMPLER, or INPUT_ATTACHMENT descriptor. Ignored otherwise. -->
+ <member noautovalidity="true"><type>VkImageLayout</type> <name>imageLayout</name></member> <!-- Layout the image is expected to be in when accessed using this descriptor (only used if imageView is not VK_NULL_HANDLE). -->
+ </type>
+ <type category="struct" name="VkWriteDescriptorSet">
+ <member values="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDescriptorSet</type> <name>dstSet</name></member> <!-- Destination descriptor set -->
+ <member><type>uint32_t</type> <name>dstBinding</name></member> <!-- Binding within the destination descriptor set to write -->
+ <member><type>uint32_t</type> <name>dstArrayElement</name></member> <!-- Array element within the destination binding to write -->
+ <member><type>uint32_t</type> <name>descriptorCount</name></member> <!-- Number of descriptors to write (determines the size of the array pointed by pDescriptors) -->
+ <member><type>VkDescriptorType</type> <name>descriptorType</name></member> <!-- Descriptor type to write (determines which members of the array pointed by pDescriptors are going to be used) -->
+ <member noautovalidity="true" len="descriptorCount">const <type>VkDescriptorImageInfo</type>* <name>pImageInfo</name></member> <!-- Sampler, image view, and layout for SAMPLER, COMBINED_IMAGE_SAMPLER, {SAMPLED,STORAGE}_IMAGE, and INPUT_ATTACHMENT descriptor types. -->
+ <member noautovalidity="true" len="descriptorCount">const <type>VkDescriptorBufferInfo</type>* <name>pBufferInfo</name></member> <!-- Raw buffer, size, and offset for {UNIFORM,STORAGE}_BUFFER[_DYNAMIC] descriptor types. -->
+ <member noautovalidity="true" len="descriptorCount">const <type>VkBufferView</type>* <name>pTexelBufferView</name></member> <!-- Buffer view to write to the descriptor for {UNIFORM,STORAGE}_TEXEL_BUFFER descriptor types. -->
+ </type>
+ <type category="struct" name="VkCopyDescriptorSet">
+ <member values="VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDescriptorSet</type> <name>srcSet</name></member> <!-- Source descriptor set -->
+ <member><type>uint32_t</type> <name>srcBinding</name></member> <!-- Binding within the source descriptor set to copy from -->
+ <member><type>uint32_t</type> <name>srcArrayElement</name></member> <!-- Array element within the source binding to copy from -->
+ <member><type>VkDescriptorSet</type> <name>dstSet</name></member> <!-- Destination descriptor set -->
+ <member><type>uint32_t</type> <name>dstBinding</name></member> <!-- Binding within the destination descriptor set to copy to -->
+ <member><type>uint32_t</type> <name>dstArrayElement</name></member> <!-- Array element within the destination binding to copy to -->
+ <member><type>uint32_t</type> <name>descriptorCount</name></member> <!-- Number of descriptors to write (determines the size of the array pointed by pDescriptors) -->
+ </type>
+ <type category="struct" name="VkBufferCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member validextensionstructs="VkDedicatedAllocationBufferCreateInfoNV">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>VkBufferCreateFlags</type> <name>flags</name></member> <!-- Buffer creation flags -->
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Specified in bytes -->
+ <member><type>VkBufferUsageFlags</type> <name>usage</name></member> <!-- Buffer usage flags -->
+ <member><type>VkSharingMode</type> <name>sharingMode</name></member>
+ <member optional="true"><type>uint32_t</type> <name>queueFamilyIndexCount</name></member>
+ <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>* <name>pQueueFamilyIndices</name></member>
+ </type>
+ <type category="struct" name="VkBufferViewCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>VkBufferViewCreateFlags</type><name>flags</name></member> <!-- Reserved -->
+ <member><type>VkBuffer</type> <name>buffer</name></member>
+ <member><type>VkFormat</type> <name>format</name></member> <!-- Optionally specifies format of elements -->
+ <member><type>VkDeviceSize</type> <name>offset</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>range</name></member> <!-- View size specified in bytes -->
+ </type>
+ <type category="struct" name="VkImageSubresource">
+ <member><type>VkImageAspectFlags</type> <name>aspectMask</name></member>
+ <member><type>uint32_t</type> <name>mipLevel</name></member>
+ <member><type>uint32_t</type> <name>arrayLayer</name></member>
+ </type>
+ <type category="struct" name="VkImageSubresourceLayers">
+ <member><type>VkImageAspectFlags</type> <name>aspectMask</name></member>
+ <member><type>uint32_t</type> <name>mipLevel</name></member>
+ <member><type>uint32_t</type> <name>baseArrayLayer</name></member>
+ <member><type>uint32_t</type> <name>layerCount</name></member>
+ </type>
+ <type category="struct" name="VkImageSubresourceRange">
+ <member><type>VkImageAspectFlags</type> <name>aspectMask</name></member>
+ <member><type>uint32_t</type> <name>baseMipLevel</name></member>
+ <member><type>uint32_t</type> <name>levelCount</name></member>
+ <member><type>uint32_t</type> <name>baseArrayLayer</name></member>
+ <member><type>uint32_t</type> <name>layerCount</name></member>
+ </type>
+ <type category="struct" name="VkMemoryBarrier">
+ <member values="VK_STRUCTURE_TYPE_MEMORY_BARRIER"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>VkAccessFlags</type> <name>srcAccessMask</name></member> <!-- Memory accesses from the source of the dependency to synchronize -->
+ <member optional="true"><type>VkAccessFlags</type> <name>dstAccessMask</name></member> <!-- Memory accesses from the destination of the dependency to synchronize -->
+ </type>
+ <type category="struct" name="VkBufferMemoryBarrier">
+ <member values="VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>VkAccessFlags</type> <name>srcAccessMask</name></member> <!-- Memory accesses from the source of the dependency to synchronize -->
+ <member optional="true"><type>VkAccessFlags</type> <name>dstAccessMask</name></member> <!-- Memory accesses from the destination of the dependency to synchronize -->
+ <member><type>uint32_t</type> <name>srcQueueFamilyIndex</name></member> <!-- Queue family to transition ownership from -->
+ <member><type>uint32_t</type> <name>dstQueueFamilyIndex</name></member> <!-- Queue family to transition ownership to -->
+ <member><type>VkBuffer</type> <name>buffer</name></member> <!-- Buffer to sync -->
+ <member><type>VkDeviceSize</type> <name>offset</name></member> <!-- Offset within the buffer to sync -->
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Amount of bytes to sync -->
+ </type>
+ <type category="struct" name="VkImageMemoryBarrier">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>VkAccessFlags</type> <name>srcAccessMask</name></member> <!-- Memory accesses from the source of the dependency to synchronize -->
+ <member optional="true"><type>VkAccessFlags</type> <name>dstAccessMask</name></member> <!-- Memory accesses from the destination of the dependency to synchronize -->
+ <member><type>VkImageLayout</type> <name>oldLayout</name></member> <!-- Current layout of the image -->
+ <member><type>VkImageLayout</type> <name>newLayout</name></member> <!-- New layout to transition the image to -->
+ <member><type>uint32_t</type> <name>srcQueueFamilyIndex</name></member> <!-- Queue family to transition ownership from -->
+ <member><type>uint32_t</type> <name>dstQueueFamilyIndex</name></member> <!-- Queue family to transition ownership to -->
+ <member><type>VkImage</type> <name>image</name></member> <!-- Image to sync -->
+ <member><type>VkImageSubresourceRange</type> <name>subresourceRange</name></member> <!-- Subresource range to sync -->
+ </type>
+ <type category="struct" name="VkImageCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member validextensionstructs="VkDedicatedAllocationImageCreateInfoNV">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>VkImageCreateFlags</type> <name>flags</name></member> <!-- Image creation flags -->
+ <member><type>VkImageType</type> <name>imageType</name></member>
+ <member><type>VkFormat</type> <name>format</name></member>
+ <member><type>VkExtent3D</type> <name>extent</name></member>
+ <member><type>uint32_t</type> <name>mipLevels</name></member>
+ <member><type>uint32_t</type> <name>arrayLayers</name></member>
+ <member><type>VkSampleCountFlagBits</type> <name>samples</name></member>
+ <member><type>VkImageTiling</type> <name>tiling</name></member>
+ <member><type>VkImageUsageFlags</type> <name>usage</name></member> <!-- Image usage flags -->
+ <member><type>VkSharingMode</type> <name>sharingMode</name></member> <!-- Cross-queue-family sharing mode -->
+ <member optional="true"><type>uint32_t</type> <name>queueFamilyIndexCount</name></member> <!-- Number of queue families to share across -->
+ <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>* <name>pQueueFamilyIndices</name></member> <!-- Array of queue family indices to share across -->
+ <member><type>VkImageLayout</type> <name>initialLayout</name></member> <!-- Initial image layout for all subresources -->
+ </type>
+ <type category="struct" name="VkSubresourceLayout" returnedonly="true">
+ <member><type>VkDeviceSize</type> <name>offset</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>rowPitch</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>arrayPitch</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>depthPitch</name></member> <!-- Specified in bytes -->
+ </type>
+ <type category="struct" name="VkImageViewCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkImageViewCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkImage</type> <name>image</name></member>
+ <member><type>VkImageViewType</type> <name>viewType</name></member>
+ <member><type>VkFormat</type> <name>format</name></member>
+ <member><type>VkComponentMapping</type> <name>components</name></member>
+ <member><type>VkImageSubresourceRange</type> <name>subresourceRange</name></member>
+ </type>
+ <type category="struct" name="VkBufferCopy">
+ <member><type>VkDeviceSize</type> <name>srcOffset</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>dstOffset</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Specified in bytes -->
+ </type>
+ <type category="struct" name="VkSparseMemoryBind">
+ <member><type>VkDeviceSize</type> <name>resourceOffset</name></member> <!-- Specified in bytes -->
+ <member><type>VkDeviceSize</type> <name>size</name></member> <!-- Specified in bytes -->
+ <member optional="true"><type>VkDeviceMemory</type> <name>memory</name></member>
+ <member><type>VkDeviceSize</type> <name>memoryOffset</name></member> <!-- Specified in bytes -->
+ <member optional="true"><type>VkSparseMemoryBindFlags</type><name>flags</name></member> <!-- Reserved for future -->
+ </type>
+ <type category="struct" name="VkSparseImageMemoryBind">
+ <member><type>VkImageSubresource</type> <name>subresource</name></member>
+ <member><type>VkOffset3D</type> <name>offset</name></member>
+ <member><type>VkExtent3D</type> <name>extent</name></member>
+ <member optional="true"><type>VkDeviceMemory</type> <name>memory</name></member>
+ <member><type>VkDeviceSize</type> <name>memoryOffset</name></member> <!-- Specified in bytes -->
+ <member optional="true"><type>VkSparseMemoryBindFlags</type><name>flags</name></member> <!-- Reserved for future -->
+ </type>
+ <type category="struct" name="VkSparseBufferMemoryBindInfo">
+ <member><type>VkBuffer</type> <name>buffer</name></member>
+ <member><type>uint32_t</type> <name>bindCount</name></member>
+ <member len="bindCount">const <type>VkSparseMemoryBind</type>* <name>pBinds</name></member>
+ </type>
+ <type category="struct" name="VkSparseImageOpaqueMemoryBindInfo">
+ <member><type>VkImage</type> <name>image</name></member>
+ <member><type>uint32_t</type> <name>bindCount</name></member>
+ <member len="bindCount">const <type>VkSparseMemoryBind</type>* <name>pBinds</name></member>
+ </type>
+ <type category="struct" name="VkSparseImageMemoryBindInfo">
+ <member><type>VkImage</type> <name>image</name></member>
+ <member><type>uint32_t</type> <name>bindCount</name></member>
+ <member len="bindCount">const <type>VkSparseImageMemoryBind</type>* <name>pBinds</name></member>
+ </type>
+ <type category="struct" name="VkBindSparseInfo">
+ <member values="VK_STRUCTURE_TYPE_BIND_SPARSE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. -->
+ <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member>
+ <member len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></member>
+ <member optional="true"><type>uint32_t</type> <name>bufferBindCount</name></member>
+ <member len="bufferBindCount">const <type>VkSparseBufferMemoryBindInfo</type>* <name>pBufferBinds</name></member>
+ <member optional="true"><type>uint32_t</type> <name>imageOpaqueBindCount</name></member>
+ <member len="imageOpaqueBindCount">const <type>VkSparseImageOpaqueMemoryBindInfo</type>* <name>pImageOpaqueBinds</name></member>
+ <member optional="true"><type>uint32_t</type> <name>imageBindCount</name></member>
+ <member len="imageBindCount">const <type>VkSparseImageMemoryBindInfo</type>* <name>pImageBinds</name></member>
+ <member optional="true"><type>uint32_t</type> <name>signalSemaphoreCount</name></member>
+ <member len="signalSemaphoreCount">const <type>VkSemaphore</type>* <name>pSignalSemaphores</name></member>
+ </type>
+ <type category="struct" name="VkImageCopy">
+ <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>srcOffset</name></member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>dstOffset</name></member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ <member><type>VkExtent3D</type> <name>extent</name></member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ </type>
+ <type category="struct" name="VkImageBlit">
+ <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>srcOffsets</name>[2]</member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>dstOffsets</name>[2]</member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ </type>
+ <type category="struct" name="VkBufferImageCopy">
+ <member><type>VkDeviceSize</type> <name>bufferOffset</name></member> <!-- Specified in bytes -->
+ <member><type>uint32_t</type> <name>bufferRowLength</name></member> <!-- Specified in texels -->
+ <member><type>uint32_t</type> <name>bufferImageHeight</name></member>
+ <member><type>VkImageSubresourceLayers</type> <name>imageSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>imageOffset</name></member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ <member><type>VkExtent3D</type> <name>imageExtent</name></member> <!-- Specified in pixels for both compressed and uncompressed images -->
+ </type>
+ <type category="struct" name="VkImageResolve">
+ <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>srcOffset</name></member>
+ <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+ <member><type>VkOffset3D</type> <name>dstOffset</name></member>
+ <member><type>VkExtent3D</type> <name>extent</name></member>
+ </type>
+ <type category="struct" name="VkShaderModuleCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkShaderModuleCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>size_t</type> <name>codeSize</name></member> <!-- Specified in bytes -->
+ <member len="latexmath:[$codeSize \over 4$]">const <type>uint32_t</type>* <name>pCode</name></member> <!-- Binary code of size codeSize -->
+ </type>
+ <type category="struct" name="VkDescriptorSetLayoutBinding">
+ <member><type>uint32_t</type> <name>binding</name></member> <!-- Binding number for this entry -->
+ <member><type>VkDescriptorType</type> <name>descriptorType</name></member> <!-- Type of the descriptors in this binding -->
+ <member optional="true"><type>uint32_t</type> <name>descriptorCount</name></member> <!-- Number of descriptors in this binding -->
+ <member noautovalidity="true"><type>VkShaderStageFlags</type> <name>stageFlags</name></member> <!-- Shader stages this binding is visible to -->
+ <member noautovalidity="true" optional="true" len="descriptorCount">const <type>VkSampler</type>* <name>pImmutableSamplers</name></member> <!-- Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains count number of elements) -->
+ </type>
+ <type category="struct" name="VkDescriptorSetLayoutCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkDescriptorSetLayoutCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member optional="true"><type>uint32_t</type> <name>bindingCount</name></member> <!-- Number of bindings in the descriptor set layout -->
+ <member len="bindingCount">const <type>VkDescriptorSetLayoutBinding</type>* <name>pBindings</name></member> <!-- Array of descriptor set layout bindings -->
+ </type>
+ <type category="struct" name="VkDescriptorPoolSize">
+ <member><type>VkDescriptorType</type> <name>type</name></member>
+ <member><type>uint32_t</type> <name>descriptorCount</name></member>
+ </type>
+ <type category="struct" name="VkDescriptorPoolCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkDescriptorPoolCreateFlags</type> <name>flags</name></member>
+ <member><type>uint32_t</type> <name>maxSets</name></member>
+ <member><type>uint32_t</type> <name>poolSizeCount</name></member>
+ <member len="poolSizeCount">const <type>VkDescriptorPoolSize</type>* <name>pPoolSizes</name></member>
+ </type>
+ <type category="struct" name="VkDescriptorSetAllocateInfo">
+ <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDescriptorPool</type> <name>descriptorPool</name></member>
+ <member><type>uint32_t</type> <name>descriptorSetCount</name></member>
+ <member len="descriptorSetCount">const <type>VkDescriptorSetLayout</type>* <name>pSetLayouts</name></member>
+ </type>
+ <type category="struct" name="VkSpecializationMapEntry">
+ <member><type>uint32_t</type> <name>constantID</name></member> <!-- The SpecConstant ID specified in the BIL -->
+ <member><type>uint32_t</type> <name>offset</name></member> <!-- Offset of the value in the data block -->
+ <member><type>size_t</type> <name>size</name></member> <!-- Size in bytes of the SpecConstant -->
+ </type>
+ <type category="struct" name="VkSpecializationInfo">
+ <member optional="true"><type>uint32_t</type> <name>mapEntryCount</name></member> <!-- Number of entries in the map -->
+ <member len="mapEntryCount" noautovalidity="true">const <type>VkSpecializationMapEntry</type>* <name>pMapEntries</name></member> <!-- Array of map entries -->
+ <member optional="true"><type>size_t</type> <name>dataSize</name></member> <!-- Size in bytes of pData -->
+ <member len="dataSize">const <type>void</type>* <name>pData</name></member> <!-- Pointer to SpecConstant data -->
+ </type>
+ <type category="struct" name="VkPipelineShaderStageCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineShaderStageCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkShaderStageFlagBits</type> <name>stage</name></member> <!-- Shader stage -->
+ <member><type>VkShaderModule</type> <name>module</name></member> <!-- Module containing entry point -->
+ <member len="null-terminated">const <type>char</type>* <name>pName</name></member> <!-- Null-terminated entry point name -->
+ <member optional="true">const <type>VkSpecializationInfo</type>* <name>pSpecializationInfo</name></member>
+ </type>
+ <type category="struct" name="VkComputePipelineCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineCreateFlags</type> <name>flags</name></member> <!-- Pipeline creation flags -->
+ <member><type>VkPipelineShaderStageCreateInfo</type> <name>stage</name></member>
+ <member><type>VkPipelineLayout</type> <name>layout</name></member> <!-- Interface layout of the pipeline -->
+ <member noautovalidity="true" optional="true"><type>VkPipeline</type> <name>basePipelineHandle</name></member> <!-- If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of -->
+ <member><type>int32_t</type> <name>basePipelineIndex</name></member> <!-- If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of -->
+ </type>
+ <type category="struct" name="VkVertexInputBindingDescription">
+ <member><type>uint32_t</type> <name>binding</name></member> <!-- Vertex buffer binding id -->
+ <member><type>uint32_t</type> <name>stride</name></member> <!-- Distance between vertices in bytes (0 = no advancement) -->
+ <member><type>VkVertexInputRate</type> <name>inputRate</name></member> <!-- The rate at which the vertex data is consumed -->
+ </type>
+ <type category="struct" name="VkVertexInputAttributeDescription">
+ <member><type>uint32_t</type> <name>location</name></member> <!-- location of the shader vertex attrib -->
+ <member><type>uint32_t</type> <name>binding</name></member> <!-- Vertex buffer binding id -->
+ <member><type>VkFormat</type> <name>format</name></member> <!-- format of source data -->
+ <member><type>uint32_t</type> <name>offset</name></member> <!-- Offset of first element in bytes from base of vertex -->
+ </type>
+ <type category="struct" name="VkPipelineVertexInputStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineVertexInputStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member optional="true"><type>uint32_t</type> <name>vertexBindingDescriptionCount</name></member> <!-- number of bindings -->
+ <member len="vertexBindingDescriptionCount">const <type>VkVertexInputBindingDescription</type>* <name>pVertexBindingDescriptions</name></member>
+ <member optional="true"><type>uint32_t</type> <name>vertexAttributeDescriptionCount</name></member> <!-- number of attributes -->
+ <member len="vertexAttributeDescriptionCount">const <type>VkVertexInputAttributeDescription</type>* <name>pVertexAttributeDescriptions</name></member>
+ </type>
+ <type category="struct" name="VkPipelineInputAssemblyStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineInputAssemblyStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkPrimitiveTopology</type> <name>topology</name></member>
+ <member><type>VkBool32</type> <name>primitiveRestartEnable</name></member>
+ </type>
+ <type category="struct" name="VkPipelineTessellationStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineTessellationStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>uint32_t</type> <name>patchControlPoints</name></member>
+ </type>
+ <type category="struct" name="VkPipelineViewportStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineViewportStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>uint32_t</type> <name>viewportCount</name></member>
+ <member noautovalidity="true" optional="true" len="viewportCount">const <type>VkViewport</type>* <name>pViewports</name></member>
+ <member><type>uint32_t</type> <name>scissorCount</name></member>
+ <member noautovalidity="true" optional="true" len="scissorCount">const <type>VkRect2D</type>* <name>pScissors</name></member>
+ </type>
+ <type category="struct" name="VkPipelineRasterizationStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member validextensionstructs="VkPipelineRasterizationStateRasterizationOrderAMD">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineRasterizationStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkBool32</type> <name>depthClampEnable</name></member>
+ <member><type>VkBool32</type> <name>rasterizerDiscardEnable</name></member>
+ <member><type>VkPolygonMode</type> <name>polygonMode</name></member> <!-- optional (GL45) -->
+ <member optional="true"><type>VkCullModeFlags</type> <name>cullMode</name></member>
+ <member><type>VkFrontFace</type> <name>frontFace</name></member>
+ <member><type>VkBool32</type> <name>depthBiasEnable</name></member>
+ <member><type>float</type> <name>depthBiasConstantFactor</name></member>
+ <member><type>float</type> <name>depthBiasClamp</name></member>
+ <member><type>float</type> <name>depthBiasSlopeFactor</name></member>
+ <member><type>float</type> <name>lineWidth</name></member>
+ </type>
+ <type category="struct" name="VkPipelineMultisampleStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineMultisampleStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkSampleCountFlagBits</type> <name>rasterizationSamples</name></member> <!-- Number of samples used for rasterization -->
+ <member><type>VkBool32</type> <name>sampleShadingEnable</name></member> <!-- optional (GL45) -->
+ <member><type>float</type> <name>minSampleShading</name></member> <!-- optional (GL45) -->
+ <member optional="true" len="latexmath:[$\lceil{\mathit{rasterizationSamples} \over 32}\rceil$]">const <type>VkSampleMask</type>* <name>pSampleMask</name></member> <!-- Array of sampleMask words -->
+ <member><type>VkBool32</type> <name>alphaToCoverageEnable</name></member>
+ <member><type>VkBool32</type> <name>alphaToOneEnable</name></member>
+ </type>
+ <type category="struct" name="VkPipelineColorBlendAttachmentState">
+ <member><type>VkBool32</type> <name>blendEnable</name></member>
+ <member><type>VkBlendFactor</type> <name>srcColorBlendFactor</name></member>
+ <member><type>VkBlendFactor</type> <name>dstColorBlendFactor</name></member>
+ <member><type>VkBlendOp</type> <name>colorBlendOp</name></member>
+ <member><type>VkBlendFactor</type> <name>srcAlphaBlendFactor</name></member>
+ <member><type>VkBlendFactor</type> <name>dstAlphaBlendFactor</name></member>
+ <member><type>VkBlendOp</type> <name>alphaBlendOp</name></member>
+ <member optional="true"><type>VkColorComponentFlags</type> <name>colorWriteMask</name></member>
+ </type>
+ <type category="struct" name="VkPipelineColorBlendStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineColorBlendStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkBool32</type> <name>logicOpEnable</name></member>
+ <member noautovalidity="true"><type>VkLogicOp</type> <name>logicOp</name></member>
+ <member optional="true"><type>uint32_t</type> <name>attachmentCount</name></member> <!-- # of pAttachments -->
+ <member len="attachmentCount">const <type>VkPipelineColorBlendAttachmentState</type>* <name>pAttachments</name></member>
+ <member><type>float</type> <name>blendConstants</name>[4]</member>
+ </type>
+ <type category="struct" name="VkPipelineDynamicStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineDynamicStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>uint32_t</type> <name>dynamicStateCount</name></member>
+ <member len="dynamicStateCount">const <type>VkDynamicState</type>* <name>pDynamicStates</name></member>
+ </type>
+ <type category="struct" name="VkStencilOpState">
+ <member><type>VkStencilOp</type> <name>failOp</name></member>
+ <member><type>VkStencilOp</type> <name>passOp</name></member>
+ <member><type>VkStencilOp</type> <name>depthFailOp</name></member>
+ <member><type>VkCompareOp</type> <name>compareOp</name></member>
+ <member><type>uint32_t</type> <name>compareMask</name></member>
+ <member><type>uint32_t</type> <name>writeMask</name></member>
+ <member><type>uint32_t</type> <name>reference</name></member>
+ </type>
+ <type category="struct" name="VkPipelineDepthStencilStateCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineDepthStencilStateCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkBool32</type> <name>depthTestEnable</name></member>
+ <member><type>VkBool32</type> <name>depthWriteEnable</name></member>
+ <member><type>VkCompareOp</type> <name>depthCompareOp</name></member>
+ <member><type>VkBool32</type> <name>depthBoundsTestEnable</name></member> <!-- optional (depth_bounds_test) -->
+ <member><type>VkBool32</type> <name>stencilTestEnable</name></member>
+ <member><type>VkStencilOpState</type> <name>front</name></member>
+ <member><type>VkStencilOpState</type> <name>back</name></member>
+ <member><type>float</type> <name>minDepthBounds</name></member>
+ <member><type>float</type> <name>maxDepthBounds</name></member>
+ </type>
+ <type category="struct" name="VkGraphicsPipelineCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineCreateFlags</type> <name>flags</name></member> <!-- Pipeline creation flags -->
+ <member><type>uint32_t</type> <name>stageCount</name></member>
+ <member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>* <name>pStages</name></member> <!-- One entry for each active shader stage -->
+ <member>const <type>VkPipelineVertexInputStateCreateInfo</type>* <name>pVertexInputState</name></member>
+ <member>const <type>VkPipelineInputAssemblyStateCreateInfo</type>* <name>pInputAssemblyState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineTessellationStateCreateInfo</type>* <name>pTessellationState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineViewportStateCreateInfo</type>* <name>pViewportState</name></member>
+ <member>const <type>VkPipelineRasterizationStateCreateInfo</type>* <name>pRasterizationState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineMultisampleStateCreateInfo</type>* <name>pMultisampleState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineDepthStencilStateCreateInfo</type>* <name>pDepthStencilState</name></member>
+ <member noautovalidity="true" optional="true">const <type>VkPipelineColorBlendStateCreateInfo</type>* <name>pColorBlendState</name></member>
+ <member optional="true">const <type>VkPipelineDynamicStateCreateInfo</type>* <name>pDynamicState</name></member>
+ <member><type>VkPipelineLayout</type> <name>layout</name></member> <!-- Interface layout of the pipeline -->
+ <member><type>VkRenderPass</type> <name>renderPass</name></member>
+ <member><type>uint32_t</type> <name>subpass</name></member>
+ <member noautovalidity="true" optional="true"><type>VkPipeline</type> <name>basePipelineHandle</name></member> <!-- If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of -->
+ <member><type>int32_t</type> <name>basePipelineIndex</name></member> <!-- If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of -->
+ </type>
+ <type category="struct" name="VkPipelineCacheCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineCacheCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member optional="true"><type>size_t</type> <name>initialDataSize</name></member> <!-- Size of initial data to populate cache, in bytes -->
+ <member len="initialDataSize">const <type>void</type>* <name>pInitialData</name></member> <!-- Initial data to populate cache -->
+ </type>
+ <type category="struct" name="VkPushConstantRange">
+ <member><type>VkShaderStageFlags</type> <name>stageFlags</name></member> <!-- Which stages use the range -->
+ <member><type>uint32_t</type> <name>offset</name></member> <!-- Start of the range, in bytes -->
+ <member><type>uint32_t</type> <name>size</name></member> <!-- Size of the range, in bytes -->
+ </type>
+ <type category="struct" name="VkPipelineLayoutCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkPipelineLayoutCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member optional="true"><type>uint32_t</type> <name>setLayoutCount</name></member> <!-- Number of descriptor sets interfaced by the pipeline -->
+ <member len="setLayoutCount">const <type>VkDescriptorSetLayout</type>* <name>pSetLayouts</name></member> <!-- Array of setCount number of descriptor set layout objects defining the layout of the -->
+ <member optional="true"><type>uint32_t</type> <name>pushConstantRangeCount</name></member> <!-- Number of push-constant ranges used by the pipeline -->
+ <member len="pushConstantRangeCount">const <type>VkPushConstantRange</type>* <name>pPushConstantRanges</name></member> <!-- Array of pushConstantRangeCount number of ranges used by various shader stages -->
+ </type>
+ <type category="struct" name="VkSamplerCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkSamplerCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkFilter</type> <name>magFilter</name></member> <!-- Filter mode for magnification -->
+ <member><type>VkFilter</type> <name>minFilter</name></member> <!-- Filter mode for minifiation -->
+ <member><type>VkSamplerMipmapMode</type> <name>mipmapMode</name></member> <!-- Mipmap selection mode -->
+ <member><type>VkSamplerAddressMode</type> <name>addressModeU</name></member>
+ <member><type>VkSamplerAddressMode</type> <name>addressModeV</name></member>
+ <member><type>VkSamplerAddressMode</type> <name>addressModeW</name></member>
+ <member><type>float</type> <name>mipLodBias</name></member>
+ <member><type>VkBool32</type> <name>anisotropyEnable</name></member>
+ <member><type>float</type> <name>maxAnisotropy</name></member>
+ <member><type>VkBool32</type> <name>compareEnable</name></member>
+ <member noautovalidity="true"><type>VkCompareOp</type> <name>compareOp</name></member>
+ <member><type>float</type> <name>minLod</name></member>
+ <member><type>float</type> <name>maxLod</name></member>
+ <member noautovalidity="true"><type>VkBorderColor</type> <name>borderColor</name></member>
+ <member><type>VkBool32</type> <name>unnormalizedCoordinates</name></member>
+ </type>
+ <type category="struct" name="VkCommandPoolCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkCommandPoolCreateFlags</type> <name>flags</name></member> <!-- Command pool creation flags -->
+ <member><type>uint32_t</type> <name>queueFamilyIndex</name></member>
+ </type>
+ <type category="struct" name="VkCommandBufferAllocateInfo">
+ <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkCommandPool</type> <name>commandPool</name></member>
+ <member><type>VkCommandBufferLevel</type> <name>level</name></member>
+ <member><type>uint32_t</type> <name>commandBufferCount</name></member>
+ </type>
+ <type category="struct" name="VkCommandBufferInheritanceInfo">
+ <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true" noautovalidity="true"><type>VkRenderPass</type> <name>renderPass</name></member> <!-- Render pass for secondary command buffers -->
+ <member><type>uint32_t</type> <name>subpass</name></member>
+ <member optional="true" noautovalidity="true"><type>VkFramebuffer</type> <name>framebuffer</name></member> <!-- Framebuffer for secondary command buffers -->
+ <member><type>VkBool32</type> <name>occlusionQueryEnable</name></member> <!-- Whether this secondary command buffer may be executed during an occlusion query -->
+ <member optional="true" noautovalidity="true"><type>VkQueryControlFlags</type> <name>queryFlags</name></member> <!-- Query flags used by this secondary command buffer, if executed during an occlusion query -->
+ <member optional="true" noautovalidity="true"><type>VkQueryPipelineStatisticFlags</type> <name>pipelineStatistics</name></member> <!-- Pipeline statistics that may be counted for this secondary command buffer -->
+ </type>
+ <type category="struct" name="VkCommandBufferBeginInfo">
+ <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkCommandBufferUsageFlags</type> <name>flags</name></member> <!-- Command buffer usage flags -->
+ <member optional="true" noautovalidity="true">const <type>VkCommandBufferInheritanceInfo</type>* <name>pInheritanceInfo</name></member> <!-- Pointer to inheritance info for secondary command buffers -->
+ </type>
+ <type category="struct" name="VkRenderPassBeginInfo">
+ <member values="VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkRenderPass</type> <name>renderPass</name></member>
+ <member><type>VkFramebuffer</type> <name>framebuffer</name></member>
+ <member><type>VkRect2D</type> <name>renderArea</name></member>
+ <member optional="true"><type>uint32_t</type> <name>clearValueCount</name></member>
+ <member len="clearValueCount" noautovalidity="true">const <type>VkClearValue</type>* <name>pClearValues</name></member>
+ </type>
+ <type category="union" name="VkClearColorValue" comment="// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.">
+ <member><type>float</type> <name>float32</name>[4]</member>
+ <member><type>int32_t</type> <name>int32</name>[4]</member>
+ <member><type>uint32_t</type> <name>uint32</name>[4]</member>
+ </type>
+ <type category="struct" name="VkClearDepthStencilValue">
+ <member><type>float</type> <name>depth</name></member>
+ <member><type>uint32_t</type> <name>stencil</name></member>
+ </type>
+ <type category="union" name="VkClearValue" comment="// Union allowing specification of color or depth and stencil values. Actual value selected is based on attachment being cleared.">
+ <member><type>VkClearColorValue</type> <name>color</name></member>
+ <member><type>VkClearDepthStencilValue</type> <name>depthStencil</name></member>
+ </type>
+ <type category="struct" name="VkClearAttachment">
+ <member><type>VkImageAspectFlags</type> <name>aspectMask</name></member>
+ <member><type>uint32_t</type> <name>colorAttachment</name></member>
+ <member><type>VkClearValue</type> <name>clearValue</name></member>
+ </type>
+ <type category="struct" name="VkAttachmentDescription">
+ <member optional="true"><type>VkAttachmentDescriptionFlags</type> <name>flags</name></member>
+ <member><type>VkFormat</type> <name>format</name></member>
+ <member><type>VkSampleCountFlagBits</type> <name>samples</name></member>
+ <member><type>VkAttachmentLoadOp</type> <name>loadOp</name></member> <!-- Load operation for color or depth data -->
+ <member><type>VkAttachmentStoreOp</type> <name>storeOp</name></member> <!-- Store operation for color or depth data -->
+ <member><type>VkAttachmentLoadOp</type> <name>stencilLoadOp</name></member> <!-- Load operation for stencil data -->
+ <member><type>VkAttachmentStoreOp</type> <name>stencilStoreOp</name></member> <!-- Store operation for stencil data -->
+ <member><type>VkImageLayout</type> <name>initialLayout</name></member>
+ <member><type>VkImageLayout</type> <name>finalLayout</name></member>
+ </type>
+ <type category="struct" name="VkAttachmentReference">
+ <member><type>uint32_t</type> <name>attachment</name></member>
+ <member><type>VkImageLayout</type> <name>layout</name></member>
+ </type>
+ <type category="struct" name="VkSubpassDescription">
+ <member optional="true"><type>VkSubpassDescriptionFlags</type> <name>flags</name></member>
+ <member><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></member> <!-- Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now -->
+ <member optional="true"><type>uint32_t</type> <name>inputAttachmentCount</name></member>
+ <member len="inputAttachmentCount">const <type>VkAttachmentReference</type>* <name>pInputAttachments</name></member>
+ <member optional="true"><type>uint32_t</type> <name>colorAttachmentCount</name></member>
+ <member len="colorAttachmentCount">const <type>VkAttachmentReference</type>* <name>pColorAttachments</name></member>
+ <member optional="true" len="colorAttachmentCount">const <type>VkAttachmentReference</type>* <name>pResolveAttachments</name></member>
+ <member optional="true">const <type>VkAttachmentReference</type>* <name>pDepthStencilAttachment</name></member>
+ <member optional="true"><type>uint32_t</type> <name>preserveAttachmentCount</name></member>
+ <member len="preserveAttachmentCount">const <type>uint32_t</type>* <name>pPreserveAttachments</name></member>
+ </type>
+ <type category="struct" name="VkSubpassDependency">
+ <member><type>uint32_t</type> <name>srcSubpass</name></member>
+ <member><type>uint32_t</type> <name>dstSubpass</name></member>
+ <member><type>VkPipelineStageFlags</type> <name>srcStageMask</name></member>
+ <member><type>VkPipelineStageFlags</type> <name>dstStageMask</name></member>
+ <member optional="true"><type>VkAccessFlags</type> <name>srcAccessMask</name></member> <!-- Memory accesses from the source of the dependency to synchronize -->
+ <member optional="true"><type>VkAccessFlags</type> <name>dstAccessMask</name></member> <!-- Memory accesses from the destination of the dependency to synchronize -->
+ <member optional="true"><type>VkDependencyFlags</type> <name>dependencyFlags</name></member>
+ </type>
+ <type category="struct" name="VkRenderPassCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkRenderPassCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member optional="true"><type>uint32_t</type> <name>attachmentCount</name></member>
+ <member len="attachmentCount">const <type>VkAttachmentDescription</type>* <name>pAttachments</name></member>
+ <member><type>uint32_t</type> <name>subpassCount</name></member>
+ <member len="subpassCount">const <type>VkSubpassDescription</type>* <name>pSubpasses</name></member>
+ <member optional="true"><type>uint32_t</type> <name>dependencyCount</name></member>
+ <member len="dependencyCount">const <type>VkSubpassDependency</type>* <name>pDependencies</name></member>
+ </type>
+ <type category="struct" name="VkEventCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_EVENT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkEventCreateFlags</type> <name>flags</name></member> <!-- Event creation flags -->
+ </type>
+ <type category="struct" name="VkFenceCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_FENCE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkFenceCreateFlags</type> <name>flags</name></member> <!-- Fence creation flags -->
+ </type>
+ <type category="struct" name="VkPhysicalDeviceFeatures">
+ <member><type>VkBool32</type> <name>robustBufferAccess</name></member> <!-- out of bounds buffer accesses are well defined -->
+ <member><type>VkBool32</type> <name>fullDrawIndexUint32</name></member> <!-- full 32-bit range of indices for indexed draw calls -->
+ <member><type>VkBool32</type> <name>imageCubeArray</name></member> <!-- image views which are arrays of cube maps -->
+ <member><type>VkBool32</type> <name>independentBlend</name></member> <!-- blending operations are controlled per-attachment -->
+ <member><type>VkBool32</type> <name>geometryShader</name></member> <!-- geometry stage -->
+ <member><type>VkBool32</type> <name>tessellationShader</name></member> <!-- tessellation control and evaluation stage -->
+ <member><type>VkBool32</type> <name>sampleRateShading</name></member> <!-- per-sample shading and interpolation -->
+ <member><type>VkBool32</type> <name>dualSrcBlend</name></member> <!-- blend operations which take two sources -->
+ <member><type>VkBool32</type> <name>logicOp</name></member> <!-- logic operations -->
+ <member><type>VkBool32</type> <name>multiDrawIndirect</name></member> <!-- multi draw indirect -->
+ <member><type>VkBool32</type> <name>drawIndirectFirstInstance</name></member> <!-- indirect draws can use non-zero firstInstance -->
+ <member><type>VkBool32</type> <name>depthClamp</name></member> <!-- depth clamping -->
+ <member><type>VkBool32</type> <name>depthBiasClamp</name></member> <!-- depth bias clamping -->
+ <member><type>VkBool32</type> <name>fillModeNonSolid</name></member> <!-- point and wireframe fill modes -->
+ <member><type>VkBool32</type> <name>depthBounds</name></member> <!-- depth bounds test -->
+ <member><type>VkBool32</type> <name>wideLines</name></member> <!-- lines with width greater than 1 -->
+ <member><type>VkBool32</type> <name>largePoints</name></member> <!-- points with size greater than 1 -->
+ <member><type>VkBool32</type> <name>alphaToOne</name></member> <!-- the fragment alpha component can be forced to maximum representable alpha value -->
+ <member><type>VkBool32</type> <name>multiViewport</name></member> <!-- viewport arrays -->
+ <member><type>VkBool32</type> <name>samplerAnisotropy</name></member> <!-- anisotropic sampler filtering -->
+ <member><type>VkBool32</type> <name>textureCompressionETC2</name></member> <!-- ETC texture compression formats -->
+ <member><type>VkBool32</type> <name>textureCompressionASTC_LDR</name></member> <!-- ASTC LDR texture compression formats -->
+ <member><type>VkBool32</type> <name>textureCompressionBC</name></member> <!-- BC1-7 texture compressed formats -->
+ <member><type>VkBool32</type> <name>occlusionQueryPrecise</name></member> <!-- precise occlusion queries returning actual sample counts -->
+ <member><type>VkBool32</type> <name>pipelineStatisticsQuery</name></member> <!-- pipeline statistics query -->
+ <member><type>VkBool32</type> <name>vertexPipelineStoresAndAtomics</name></member> <!-- stores and atomic ops on storage buffers and images are supported in vertex, tessellation, and geometry stages -->
+ <member><type>VkBool32</type> <name>fragmentStoresAndAtomics</name></member> <!-- stores and atomic ops on storage buffers and images are supported in the fragment stage -->
+ <member><type>VkBool32</type> <name>shaderTessellationAndGeometryPointSize</name></member><!-- tessellation and geometry stages can export point size -->
+ <member><type>VkBool32</type> <name>shaderImageGatherExtended</name></member> <!-- image gather with run-time values and independent offsets -->
+ <member><type>VkBool32</type> <name>shaderStorageImageExtendedFormats</name></member> <!-- the extended set of formats can be used for storage images -->
+ <member><type>VkBool32</type> <name>shaderStorageImageMultisample</name></member> <!-- multisample images can be used for storage images -->
+ <member><type>VkBool32</type> <name>shaderStorageImageReadWithoutFormat</name></member> <!-- read from storage image does not require format qualifier -->
+ <member><type>VkBool32</type> <name>shaderStorageImageWriteWithoutFormat</name></member> <!-- write to storage image does not require format qualifier -->
+ <member><type>VkBool32</type> <name>shaderUniformBufferArrayDynamicIndexing</name></member> <!-- arrays of uniform buffers can be accessed with dynamically uniform indices -->
+ <member><type>VkBool32</type> <name>shaderSampledImageArrayDynamicIndexing</name></member> <!-- arrays of sampled images can be accessed with dynamically uniform indices -->
+ <member><type>VkBool32</type> <name>shaderStorageBufferArrayDynamicIndexing</name></member> <!-- arrays of storage buffers can be accessed with dynamically uniform indices -->
+ <member><type>VkBool32</type> <name>shaderStorageImageArrayDynamicIndexing</name></member> <!-- arrays of storage images can be accessed with dynamically uniform indices -->
+ <member><type>VkBool32</type> <name>shaderClipDistance</name></member> <!-- clip distance in shaders -->
+ <member><type>VkBool32</type> <name>shaderCullDistance</name></member> <!-- cull distance in shaders -->
+ <member><type>VkBool32</type> <name>shaderFloat64</name></member> <!-- 64-bit floats (doubles) in shaders -->
+ <member><type>VkBool32</type> <name>shaderInt64</name></member> <!-- 64-bit integers in shaders -->
+ <member><type>VkBool32</type> <name>shaderInt16</name></member> <!-- 16-bit integers in shaders -->
+ <member><type>VkBool32</type> <name>shaderResourceResidency</name></member> <!-- shader can use texture operations that return resource residency information (requires sparseNonResident support) -->
+ <member><type>VkBool32</type> <name>shaderResourceMinLod</name></member> <!-- shader can use texture operations that specify minimum resource level of detail -->
+ <member><type>VkBool32</type> <name>sparseBinding</name></member> <!-- Sparse resources support: Resource memory can be managed at opaque page level rather than object level -->
+ <member><type>VkBool32</type> <name>sparseResidencyBuffer</name></member> <!-- Sparse resources support: GPU can access partially resident buffers -->
+ <member><type>VkBool32</type> <name>sparseResidencyImage2D</name></member> <!-- Sparse resources support: GPU can access partially resident 2D (non-MSAA non-depth/stencil) images -->
+ <member><type>VkBool32</type> <name>sparseResidencyImage3D</name></member> <!-- Sparse resources support: GPU can access partially resident 3D images -->
+ <member><type>VkBool32</type> <name>sparseResidency2Samples</name></member> <!-- Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples -->
+ <member><type>VkBool32</type> <name>sparseResidency4Samples</name></member> <!-- Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples -->
+ <member><type>VkBool32</type> <name>sparseResidency8Samples</name></member> <!-- Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples -->
+ <member><type>VkBool32</type> <name>sparseResidency16Samples</name></member> <!-- Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples -->
+ <member><type>VkBool32</type> <name>sparseResidencyAliased</name></member> <!-- Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in) -->
+ <member><type>VkBool32</type> <name>variableMultisampleRate</name></member> <!-- multisample rate must be the same for all pipelines in a subpass -->
+ <member><type>VkBool32</type> <name>inheritedQueries</name></member> <!-- Queries may be inherited from primary to secondary command buffers -->
+ </type>
+ <type category="struct" name="VkPhysicalDeviceSparseProperties" returnedonly="true">
+ <member><type>VkBool32</type> <name>residencyStandard2DBlockShape</name></member> <!-- Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard sparse image block shapes (based on pixel format) -->
+ <member><type>VkBool32</type> <name>residencyStandard2DMultisampleBlockShape</name></member> <!-- Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard sparse image block shapes (based on pixel format) -->
+ <member><type>VkBool32</type> <name>residencyStandard3DBlockShape</name></member> <!-- Sparse resources support: GPU will access all 3D sparse resources using the standard sparse image block shapes (based on pixel format) -->
+ <member><type>VkBool32</type> <name>residencyAlignedMipSize</name></member> <!-- Sparse resources support: Images with mip level dimensions that are NOT a multiple of the sparse image block dimensions will be placed in the mip tail -->
+ <member><type>VkBool32</type> <name>residencyNonResidentStrict</name></member> <!-- Sparse resources support: GPU can consistently access non-resident regions of a resource, all reads return as if data is 0, writes are discarded -->
+ </type>
+ <type category="struct" name="VkPhysicalDeviceLimits" returnedonly="true">
+ <!-- resource maximum sizes -->
+ <member><type>uint32_t</type> <name>maxImageDimension1D</name></member> <!-- max 1D image dimension -->
+ <member><type>uint32_t</type> <name>maxImageDimension2D</name></member> <!-- max 2D image dimension -->
+ <member><type>uint32_t</type> <name>maxImageDimension3D</name></member> <!-- max 3D image dimension -->
+ <member><type>uint32_t</type> <name>maxImageDimensionCube</name></member> <!-- max cubemap image dimension -->
+ <member><type>uint32_t</type> <name>maxImageArrayLayers</name></member> <!-- max layers for image arrays -->
+ <member><type>uint32_t</type> <name>maxTexelBufferElements</name></member> <!-- max texel buffer size (fstexels) -->
+ <member><type>uint32_t</type> <name>maxUniformBufferRange</name></member> <!-- max uniform buffer range (bytes) -->
+ <member><type>uint32_t</type> <name>maxStorageBufferRange</name></member> <!-- max storage buffer range (bytes) -->
+ <member><type>uint32_t</type> <name>maxPushConstantsSize</name></member> <!-- max size of the push constants pool (bytes) -->
+ <!-- memory limits -->
+ <member><type>uint32_t</type> <name>maxMemoryAllocationCount</name></member> <!-- max number of device memory allocations supported -->
+ <member><type>uint32_t</type> <name>maxSamplerAllocationCount</name></member> <!-- max number of samplers that can be allocated on a device -->
+ <member><type>VkDeviceSize</type> <name>bufferImageGranularity</name></member> <!-- Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage -->
+ <member><type>VkDeviceSize</type> <name>sparseAddressSpaceSize</name></member> <!-- Total address space available for sparse allocations (bytes) -->
+ <!-- descriptor set limits -->
+ <member><type>uint32_t</type> <name>maxBoundDescriptorSets</name></member> <!-- max number of descriptors sets that can be bound to a pipeline -->
+ <member><type>uint32_t</type> <name>maxPerStageDescriptorSamplers</name></member> <!-- max number of samplers allowed per-stage in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxPerStageDescriptorUniformBuffers</name></member> <!-- max number of uniform buffers allowed per-stage in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxPerStageDescriptorStorageBuffers</name></member> <!-- max number of storage buffers allowed per-stage in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxPerStageDescriptorSampledImages</name></member> <!-- max number of sampled images allowed per-stage in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxPerStageDescriptorStorageImages</name></member> <!-- max number of storage images allowed per-stage in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxPerStageDescriptorInputAttachments</name></member> <!-- max number of input attachments allowed per-stage in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxPerStageResources</name></member> <!-- max number of resources allowed by a single stage -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetSamplers</name></member> <!-- max number of samplers allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetUniformBuffers</name></member> <!-- max number of uniform buffers allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetUniformBuffersDynamic</name></member> <!-- max number of dynamic uniform buffers allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetStorageBuffers</name></member> <!-- max number of storage buffers allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetStorageBuffersDynamic</name></member> <!-- max number of dynamic storage buffers allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetSampledImages</name></member> <!-- max number of sampled images allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetStorageImages</name></member> <!-- max number of storage images allowed in all stages in a descriptor set -->
+ <member><type>uint32_t</type> <name>maxDescriptorSetInputAttachments</name></member> <!-- max number of input attachments allowed in all stages in a descriptor set -->
+ <!-- vertex stage limits -->
+ <member><type>uint32_t</type> <name>maxVertexInputAttributes</name></member> <!-- max number of vertex input attribute slots -->
+ <member><type>uint32_t</type> <name>maxVertexInputBindings</name></member> <!-- max number of vertex input binding slots -->
+ <member><type>uint32_t</type> <name>maxVertexInputAttributeOffset</name></member> <!-- max vertex input attribute offset added to vertex buffer offset -->
+ <member><type>uint32_t</type> <name>maxVertexInputBindingStride</name></member> <!-- max vertex input binding stride -->
+ <member><type>uint32_t</type> <name>maxVertexOutputComponents</name></member> <!-- max number of output components written by vertex shader -->
+ <!-- tessellation control stage limits -->
+ <member><type>uint32_t</type> <name>maxTessellationGenerationLevel</name></member> <!-- max level supported by tessellation primitive generator -->
+ <member><type>uint32_t</type> <name>maxTessellationPatchSize</name></member> <!-- max patch size (vertices) -->
+ <member><type>uint32_t</type> <name>maxTessellationControlPerVertexInputComponents</name></member> <!-- max number of input components per-vertex in TCS -->
+ <member><type>uint32_t</type> <name>maxTessellationControlPerVertexOutputComponents</name></member> <!-- max number of output components per-vertex in TCS -->
+ <member><type>uint32_t</type> <name>maxTessellationControlPerPatchOutputComponents</name></member> <!-- max number of output components per-patch in TCS -->
+ <member><type>uint32_t</type> <name>maxTessellationControlTotalOutputComponents</name></member> <!-- max total number of per-vertex and per-patch output components in TCS -->
+ <!-- tessellation evaluation stage limits -->
+ <member><type>uint32_t</type> <name>maxTessellationEvaluationInputComponents</name></member> <!-- max number of input components per vertex in TES -->
+ <member><type>uint32_t</type> <name>maxTessellationEvaluationOutputComponents</name></member> <!-- max number of output components per vertex in TES -->
+ <!-- geometry stage limits -->
+ <member><type>uint32_t</type> <name>maxGeometryShaderInvocations</name></member> <!-- max invocation count supported in geometry shader -->
+ <member><type>uint32_t</type> <name>maxGeometryInputComponents</name></member> <!-- max number of input components read in geometry stage -->
+ <member><type>uint32_t</type> <name>maxGeometryOutputComponents</name></member> <!-- max number of output components written in geometry stage -->
+ <member><type>uint32_t</type> <name>maxGeometryOutputVertices</name></member> <!-- max number of vertices that can be emitted in geometry stage -->
+ <member><type>uint32_t</type> <name>maxGeometryTotalOutputComponents</name></member> <!-- max total number of components (all vertices) written in geometry stage -->
+ <!-- fragment stage limits -->
+ <member><type>uint32_t</type> <name>maxFragmentInputComponents</name></member> <!-- max number of input compontents read in fragment stage -->
+ <member><type>uint32_t</type> <name>maxFragmentOutputAttachments</name></member> <!-- max number of output attachments written in fragment stage -->
+ <member><type>uint32_t</type> <name>maxFragmentDualSrcAttachments</name></member> <!-- max number of output attachments written when using dual source blending -->
+ <member><type>uint32_t</type> <name>maxFragmentCombinedOutputResources</name></member><!-- max total number of storage buffers, storage images and output buffers -->
+ <!-- compute stage limits -->
+ <member><type>uint32_t</type> <name>maxComputeSharedMemorySize</name></member> <!-- max total storage size of work group local storage (bytes) -->
+ <member><type>uint32_t</type> <name>maxComputeWorkGroupCount</name>[3]</member> <!-- max num of compute work groups that may be dispatched by a single command (x,y,z) -->
+ <member><type>uint32_t</type> <name>maxComputeWorkGroupInvocations</name></member> <!-- max total compute invocations in a single local work group -->
+ <member><type>uint32_t</type> <name>maxComputeWorkGroupSize</name>[3]</member> <!-- max local size of a compute work group (x,y,z) -->
+ <member><type>uint32_t</type> <name>subPixelPrecisionBits</name></member> <!-- number bits of subpixel precision in screen x and y-->
+ <member><type>uint32_t</type> <name>subTexelPrecisionBits</name></member> <!-- number bits of precision for selecting texel weights-->
+ <member><type>uint32_t</type> <name>mipmapPrecisionBits</name></member> <!-- number bits of precision for selecting mipmap weights -->
+ <member><type>uint32_t</type> <name>maxDrawIndexedIndexValue</name></member> <!-- max index value for indexed draw calls (for 32-bit indices) -->
+ <member><type>uint32_t</type> <name>maxDrawIndirectCount</name></member> <!-- max draw count for indirect draw calls -->
+ <member><type>float</type> <name>maxSamplerLodBias</name></member> <!-- max absolute sampler level of detail bias -->
+ <member><type>float</type> <name>maxSamplerAnisotropy</name></member> <!-- max degree of sampler anisotropy -->
+ <member><type>uint32_t</type> <name>maxViewports</name></member> <!-- max number of active viewports -->
+ <member><type>uint32_t</type> <name>maxViewportDimensions</name>[2]</member> <!-- max viewport dimensions (x,y) -->
+ <member><type>float</type> <name>viewportBoundsRange</name>[2]</member> <!-- viewport bounds range (min,max) -->
+ <member><type>uint32_t</type> <name>viewportSubPixelBits</name></member> <!-- number bits of subpixel precision for viewport -->
+ <member><type>size_t</type> <name>minMemoryMapAlignment</name></member> <!-- min required alignment of pointers returned by MapMemory (bytes) -->
+ <member><type>VkDeviceSize</type> <name>minTexelBufferOffsetAlignment</name></member> <!-- min required alignment for texel buffer offsets (bytes) -->
+ <member><type>VkDeviceSize</type> <name>minUniformBufferOffsetAlignment</name></member> <!-- min required alignment for uniform buffer sizes and offsets (bytes) -->
+ <member><type>VkDeviceSize</type> <name>minStorageBufferOffsetAlignment</name></member> <!-- min required alignment for storage buffer offsets (bytes) -->
+ <member><type>int32_t</type> <name>minTexelOffset</name></member> <!-- min texel offset for OpTextureSampleOffset -->
+ <member><type>uint32_t</type> <name>maxTexelOffset</name></member> <!-- max texel offset for OpTextureSampleOffset -->
+ <member><type>int32_t</type> <name>minTexelGatherOffset</name></member> <!-- min texel offset for OpTextureGatherOffset -->
+ <member><type>uint32_t</type> <name>maxTexelGatherOffset</name></member> <!-- max texel offset for OpTextureGatherOffset -->
+ <member><type>float</type> <name>minInterpolationOffset</name></member> <!-- furthest negative offset for interpolateAtOffset -->
+ <member><type>float</type> <name>maxInterpolationOffset</name></member> <!-- furthest positive offset for interpolateAtOffset -->
+ <member><type>uint32_t</type> <name>subPixelInterpolationOffsetBits</name></member> <!-- number of subpixel bits for interpolateAtOffset -->
+ <member><type>uint32_t</type> <name>maxFramebufferWidth</name></member> <!-- max width for a framebuffer -->
+ <member><type>uint32_t</type> <name>maxFramebufferHeight</name></member> <!-- max height for a framebuffer -->
+ <member><type>uint32_t</type> <name>maxFramebufferLayers</name></member> <!-- max layer count for a layered framebuffer -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>framebufferColorSampleCounts</name></member> <!-- supported color sample counts for a framebuffer -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>framebufferDepthSampleCounts</name></member> <!-- supported depth sample counts for a framebuffer -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>framebufferStencilSampleCounts</name></member> <!-- supported stencil sample counts for a framebuffer -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>framebufferNoAttachmentsSampleCounts</name></member> <!-- supported sample counts for a framebuffer with no attachments -->
+ <member><type>uint32_t</type> <name>maxColorAttachments</name></member> <!-- max number of color attachments per subpass -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>sampledImageColorSampleCounts</name></member> <!-- supported color sample counts for a non-integer sampled image -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>sampledImageIntegerSampleCounts</name></member> <!-- supported sample counts for an integer image -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>sampledImageDepthSampleCounts</name></member> <!-- supported depth sample counts for a sampled image -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>sampledImageStencilSampleCounts</name></member> <!-- supported stencil sample counts for a sampled image -->
+ <member optional="true"><type>VkSampleCountFlags</type> <name>storageImageSampleCounts</name></member> <!-- supported sample counts for a storage image -->
+ <member><type>uint32_t</type> <name>maxSampleMaskWords</name></member> <!-- max number of sample mask words -->
+ <member><type>VkBool32</type> <name>timestampComputeAndGraphics</name></member> <!-- timestamps on graphics and compute queues -->
+ <member><type>float</type> <name>timestampPeriod</name></member> <!-- number of nanoseconds it takes for timestamp query value to increment by 1 -->
+ <member><type>uint32_t</type> <name>maxClipDistances</name></member> <!-- max number of clip distances -->
+ <member><type>uint32_t</type> <name>maxCullDistances</name></member> <!-- max number of cull distances -->
+ <member><type>uint32_t</type> <name>maxCombinedClipAndCullDistances</name></member> <!-- max combined number of user clipping -->
+ <member><type>uint32_t</type> <name>discreteQueuePriorities</name></member> <!-- distinct queue priorities available -->
+ <member><type>float</type> <name>pointSizeRange</name>[2]</member> <!-- range (min,max) of supported point sizes -->
+ <member><type>float</type> <name>lineWidthRange</name>[2]</member> <!-- range (min,max) of supported line widths -->
+ <member><type>float</type> <name>pointSizeGranularity</name></member> <!-- granularity of supported point sizes -->
+ <member><type>float</type> <name>lineWidthGranularity</name></member> <!-- granularity of supported line widths -->
+ <member><type>VkBool32</type> <name>strictLines</name></member> <!-- line rasterization follows preferred rules -->
+ <member><type>VkBool32</type> <name>standardSampleLocations</name></member> <!-- supports standard sample locations for all supported sample counts -->
+ <member><type>VkDeviceSize</type> <name>optimalBufferCopyOffsetAlignment</name></member> <!-- optimal offset of buffer copies -->
+ <member><type>VkDeviceSize</type> <name>optimalBufferCopyRowPitchAlignment</name></member><!-- optimal pitch of buffer copies -->
+ <member><type>VkDeviceSize</type> <name>nonCoherentAtomSize</name></member> <!-- minimum size and alignment for non-coherent host-mapped device memory access -->
+ </type>
+ <type category="struct" name="VkSemaphoreCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkSemaphoreCreateFlags</type> <name>flags</name></member> <!-- Semaphore creation flags -->
+ </type>
+ <type category="struct" name="VkQueryPoolCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkQueryPoolCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkQueryType</type> <name>queryType</name></member>
+ <member><type>uint32_t</type> <name>queryCount</name></member>
+ <member optional="true" noautovalidity="true"><type>VkQueryPipelineStatisticFlags</type> <name>pipelineStatistics</name></member> <!-- Optional -->
+ </type>
+ <type category="struct" name="VkFramebufferCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkFramebufferCreateFlags</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkRenderPass</type> <name>renderPass</name></member>
+ <member optional="true"><type>uint32_t</type> <name>attachmentCount</name></member>
+ <member len="attachmentCount">const <type>VkImageView</type>* <name>pAttachments</name></member>
+ <member><type>uint32_t</type> <name>width</name></member>
+ <member><type>uint32_t</type> <name>height</name></member>
+ <member><type>uint32_t</type> <name>layers</name></member>
+ </type>
+ <type category="struct" name="VkDrawIndirectCommand">
+ <member><type>uint32_t</type> <name>vertexCount</name></member>
+ <member><type>uint32_t</type> <name>instanceCount</name></member>
+ <member><type>uint32_t</type> <name>firstVertex</name></member>
+ <member><type>uint32_t</type> <name>firstInstance</name></member>
+ </type>
+ <type category="struct" name="VkDrawIndexedIndirectCommand">
+ <member><type>uint32_t</type> <name>indexCount</name></member>
+ <member><type>uint32_t</type> <name>instanceCount</name></member>
+ <member><type>uint32_t</type> <name>firstIndex</name></member>
+ <member><type>int32_t</type> <name>vertexOffset</name></member>
+ <member><type>uint32_t</type> <name>firstInstance</name></member>
+ </type>
+ <type category="struct" name="VkDispatchIndirectCommand">
+ <member><type>uint32_t</type> <name>x</name></member>
+ <member><type>uint32_t</type> <name>y</name></member>
+ <member><type>uint32_t</type> <name>z</name></member>
+ </type>
+ <type category="struct" name="VkSubmitInfo">
+ <member values="VK_STRUCTURE_TYPE_SUBMIT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member>
+ <member len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></member>
+ <member len="waitSemaphoreCount">const <type>VkPipelineStageFlags</type>* <name>pWaitDstStageMask</name></member>
+ <member optional="true"><type>uint32_t</type> <name>commandBufferCount</name></member>
+ <member len="commandBufferCount">const <type>VkCommandBuffer</type>* <name>pCommandBuffers</name></member>
+ <member optional="true"><type>uint32_t</type> <name>signalSemaphoreCount</name></member>
+ <member len="signalSemaphoreCount">const <type>VkSemaphore</type>* <name>pSignalSemaphores</name></member>
+ </type>
+ <!-- WSI extensions -->
+ <type category="struct" name="VkDisplayPropertiesKHR" returnedonly="true">
+ <member><type>VkDisplayKHR</type> <name>display</name></member> <!-- Handle of the display object -->
+ <member len="null-terminated">const <type>char</type>* <name>displayName</name></member> <!-- Name of the display -->
+ <member><type>VkExtent2D</type> <name>physicalDimensions</name></member> <!-- In millimeters? -->
+ <member><type>VkExtent2D</type> <name>physicalResolution</name></member> <!-- Max resolution for CRT? -->
+ <member optional="true"><type>VkSurfaceTransformFlagsKHR</type> <name>supportedTransforms</name></member> <!-- one or more bits from VkSurfaceTransformFlagsKHR -->
+ <member><type>VkBool32</type> <name>planeReorderPossible</name></member> <!-- VK_TRUE if the overlay plane's z-order can be changed on this display. -->
+ <member><type>VkBool32</type> <name>persistentContent</name></member> <!-- VK_TRUE if this is a "smart" display that supports self-refresh/internal buffering. -->
+ </type>
+ <type category="struct" name="VkDisplayPlanePropertiesKHR" returnedonly="true">
+ <member><type>VkDisplayKHR</type> <name>currentDisplay</name></member> <!-- Display the plane is currently associated with. Will be VK_NULL_HANDLE if the plane is not in use. -->
+ <member><type>uint32_t</type> <name>currentStackIndex</name></member> <!-- Current z-order of the plane. -->
+ </type>
+ <type category="struct" name="VkDisplayModeParametersKHR">
+ <member><type>VkExtent2D</type> <name>visibleRegion</name></member> <!-- Visible scanout region. -->
+ <member><type>uint32_t</type> <name>refreshRate</name></member> <!-- Number of times per second the display is updated. -->
+ </type>
+ <type category="struct" name="VkDisplayModePropertiesKHR" returnedonly="true">
+ <member><type>VkDisplayModeKHR</type> <name>displayMode</name></member> <!-- Handle of this display mode. -->
+ <member><type>VkDisplayModeParametersKHR</type> <name>parameters</name></member> <!-- The parameters this mode uses. -->
+ </type>
+ <type category="struct" name="VkDisplayModeCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkDisplayModeCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkDisplayModeParametersKHR</type> <name>parameters</name></member> <!-- The parameters this mode uses. -->
+ </type>
+ <type category="struct" name="VkDisplayPlaneCapabilitiesKHR" returnedonly="true">
+ <member optional="true"><type>VkDisplayPlaneAlphaFlagsKHR</type> <name>supportedAlpha</name></member> <!-- Types of alpha blending supported, if any. -->
+ <member><type>VkOffset2D</type> <name>minSrcPosition</name></member> <!-- Does the plane have any position and extent restrictions? -->
+ <member><type>VkOffset2D</type> <name>maxSrcPosition</name></member>
+ <member><type>VkExtent2D</type> <name>minSrcExtent</name></member>
+ <member><type>VkExtent2D</type> <name>maxSrcExtent</name></member>
+ <member><type>VkOffset2D</type> <name>minDstPosition</name></member>
+ <member><type>VkOffset2D</type> <name>maxDstPosition</name></member>
+ <member><type>VkExtent2D</type> <name>minDstExtent</name></member>
+ <member><type>VkExtent2D</type> <name>maxDstExtent</name></member>
+ </type>
+ <type category="struct" name="VkDisplaySurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkDisplaySurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkDisplayModeKHR</type> <name>displayMode</name></member> <!-- The mode to use when displaying this surface -->
+ <member><type>uint32_t</type> <name>planeIndex</name></member> <!-- The plane on which this surface appears. Must be between 0 and the value returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR() in pPropertyCount. -->
+ <member><type>uint32_t</type> <name>planeStackIndex</name></member> <!-- The z-order of the plane. -->
+ <member><type>VkSurfaceTransformFlagBitsKHR</type> <name>transform</name></member> <!-- Transform to apply to the images as part of the scanout operation -->
+ <member><type>float</type> <name>globalAlpha</name></member> <!-- Global alpha value. Must be between 0 and 1, inclusive. Ignored if alphaMode is not VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR -->
+ <member><type>VkDisplayPlaneAlphaFlagBitsKHR</type> <name>alphaMode</name></member> <!-- What type of alpha blending to use. Must be a bit from vkGetDisplayPlanePropertiesKHR::supportedAlpha. -->
+ <member><type>VkExtent2D</type> <name>imageExtent</name></member> <!-- size of the images to use with this surface -->
+ </type>
+ <type category="struct" name="VkDisplayPresentInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkRect2D</type> <name>srcRect</name></member> <!-- Rectangle within the presentable image to read pixel data from when presenting to the display. -->
+ <member><type>VkRect2D</type> <name>dstRect</name></member> <!-- Rectangle within the current display mode's visible region to display srcRectangle in. -->
+ <member><type>VkBool32</type> <name>persistent</name></member> <!-- For smart displays, use buffered mode. If the display properties member "persistentMode" is VK_FALSE, this member must always be VK_FALSE. -->
+ </type>
+ <type category="struct" name="VkSurfaceCapabilitiesKHR" returnedonly="true">
+ <member><type>uint32_t</type> <name>minImageCount</name></member> <!-- Supported minimum number of images for the surface -->
+ <member><type>uint32_t</type> <name>maxImageCount</name></member> <!-- Supported maximum number of images for the surface, 0 for unlimited -->
+ <member><type>VkExtent2D</type> <name>currentExtent</name></member> <!-- Current image width and height for the surface, (0, 0) if undefined -->
+ <member><type>VkExtent2D</type> <name>minImageExtent</name></member> <!-- Supported minimum image width and height for the surface -->
+ <member><type>VkExtent2D</type> <name>maxImageExtent</name></member> <!-- Supported maximum image width and height for the surface -->
+ <member><type>uint32_t</type> <name>maxImageArrayLayers</name></member> <!-- Supported maximum number of image layers for the surface -->
+ <member optional="true"><type>VkSurfaceTransformFlagsKHR</type> <name>supportedTransforms</name></member> <!-- 1 or more bits representing the transforms supported -->
+ <member><type>VkSurfaceTransformFlagBitsKHR</type> <name>currentTransform</name></member> <!-- The surface's current transform relative to the device's natural orientation -->
+ <member optional="true"><type>VkCompositeAlphaFlagsKHR</type> <name>supportedCompositeAlpha</name></member> <!-- 1 or more bits representing the alpha compositing modes supported -->
+ <member optional="true"><type>VkImageUsageFlags</type> <name>supportedUsageFlags</name></member> <!-- Supported image usage flags for the surface -->
+ </type>
+ <type category="struct" name="VkAndroidSurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkAndroidSurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member noautovalidity="true"><type>ANativeWindow</type>* <name>window</name></member>
+ </type>
+ <type category="struct" name="VkMirSurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkMirSurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member noautovalidity="true"><type>MirConnection</type>* <name>connection</name></member>
+ <member noautovalidity="true"><type>MirSurface</type>* <name>mirSurface</name></member>
+ </type>
+ <type category="struct" name="VkViSurfaceCreateInfoNN">
+ <member values="VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkViSurfaceCreateFlagsNN</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>void</type>* <name>window</name></member>
+ </type>
+ <type category="struct" name="VkWaylandSurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkWaylandSurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member noautovalidity="true">struct <type>wl_display</type>* <name>display</name></member>
+ <member noautovalidity="true">struct <type>wl_surface</type>* <name>surface</name></member>
+ </type>
+ <type category="struct" name="VkWin32SurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkWin32SurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>HINSTANCE</type> <name>hinstance</name></member>
+ <member><type>HWND</type> <name>hwnd</name></member>
+ </type>
+ <type category="struct" name="VkXlibSurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkXlibSurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member noautovalidity="true"><type>Display</type>* <name>dpy</name></member>
+ <member><type>Window</type> <name>window</name></member>
+ </type>
+ <type category="struct" name="VkXcbSurfaceCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkXcbSurfaceCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member noautovalidity="true"><type>xcb_connection_t</type>* <name>connection</name></member>
+ <member><type>xcb_window_t</type> <name>window</name></member>
+ </type>
+ <type category="struct" name="VkSurfaceFormatKHR" returnedonly="true">
+ <member><type>VkFormat</type> <name>format</name></member> <!-- Supported pair of rendering format -->
+ <member><type>VkColorSpaceKHR</type> <name>colorSpace</name></member> <!-- and color space for the surface -->
+ </type>
+ <type category="struct" name="VkSwapchainCreateInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkSwapchainCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved -->
+ <member><type>VkSurfaceKHR</type> <name>surface</name></member> <!-- The swapchain's target surface -->
+ <member><type>uint32_t</type> <name>minImageCount</name></member> <!-- Minimum number of presentation images the application needs -->
+ <member><type>VkFormat</type> <name>imageFormat</name></member> <!-- Format of the presentation images -->
+ <member><type>VkColorSpaceKHR</type> <name>imageColorSpace</name></member> <!-- Colorspace of the presentation images -->
+ <member><type>VkExtent2D</type> <name>imageExtent</name></member> <!-- Dimensions of the presentation images -->
+ <member><type>uint32_t</type> <name>imageArrayLayers</name></member> <!-- Determines the number of views for multiview/stereo presentation -->
+ <member><type>VkImageUsageFlags</type> <name>imageUsage</name></member> <!-- Bits indicating how the presentation images will be used -->
+ <member><type>VkSharingMode</type> <name>imageSharingMode</name></member> <!-- Sharing mode used for the presentation images -->
+ <member optional="true"><type>uint32_t</type> <name>queueFamilyIndexCount</name></member> <!-- Number of queue families having access to the images in case of concurrent sharing mode -->
+ <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>* <name>pQueueFamilyIndices</name></member> <!-- Array of queue family indices having access to the images in case of concurrent sharing mode -->
+ <member><type>VkSurfaceTransformFlagBitsKHR</type> <name>preTransform</name></member> <!-- The transform, relative to the device's natural orientation, applied to the image content prior to presentation -->
+ <member><type>VkCompositeAlphaFlagBitsKHR</type> <name>compositeAlpha</name></member> <!-- The alpha blending mode used when compositing this surface with other surfaces in the window system -->
+ <member><type>VkPresentModeKHR</type> <name>presentMode</name></member> <!-- Which presentation mode to use for presents on this swap chain -->
+ <member><type>VkBool32</type> <name>clipped</name></member> <!-- Specifies whether presentable images may be affected by window clip regions -->
+ <member optional="true"><type>VkSwapchainKHR</type> <name>oldSwapchain</name></member> <!-- Existing swap chain to replace, if any -->
+ </type>
+ <type category="struct" name="VkPresentInfoKHR">
+ <member values="VK_STRUCTURE_TYPE_PRESENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member validextensionstructs="VkDisplayPresentInfoKHR">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member> <!-- Number of semaphores to wait for before presenting -->
+ <member optional="true" len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></member> <!-- Semaphores to wait for before presenting -->
+ <member><type>uint32_t</type> <name>swapchainCount</name></member> <!-- Number of swap chains to present in this call -->
+ <member len="swapchainCount">const <type>VkSwapchainKHR</type>* <name>pSwapchains</name></member> <!-- Swapchains to present an image from -->
+ <member len="swapchainCount">const <type>uint32_t</type>* <name>pImageIndices</name></member> <!-- Indices of which swapchain images to present -->
+ <member optional="true" len="swapchainCount"><type>VkResult</type>* <name>pResults</name></member> <!-- Optional (i.e. if non-NULL) VkResult for each swapchain -->
+ </type>
+ <type category="struct" name="VkDebugReportCallbackCreateInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDebugReportFlagsEXT</type> <name>flags</name></member> <!-- Indicates which events call this callback-->
+ <member><type>PFN_vkDebugReportCallbackEXT</type> <name>pfnCallback</name></member> <!-- Function pointer of a callback function-->
+ <member optional="true"><type>void</type>* <name>pUserData</name></member> <!-- User data provided to callback function -->
+ </type>
+ <type category="struct" name="VkValidationFlagsEXT">
+ <member><type>VkStructureType</type> <name>sType</name></member> <!-- Must be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT -->
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>uint32_t</type> <name>disabledValidationCheckCount</name></member> <!-- Number of validation checks to disable -->
+ <member len="disabledValidationCheckCount"><type>VkValidationCheckEXT</type>* <name>pDisabledValidationChecks</name></member> <!-- Validation checks to disable -->
+ </type>
+ <type category="struct" name="VkPipelineRasterizationStateRasterizationOrderAMD">
+ <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkRasterizationOrderAMD</type> <name>rasterizationOrder</name></member> <!-- Rasterization order to use for the pipeline -->
+ </type>
+ <type category="struct" name="VkDebugMarkerObjectNameInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDebugReportObjectTypeEXT</type> <name>objectType</name></member> <!-- The type of the object -->
+ <member><type>uint64_t</type> <name>object</name></member> <!-- The handle of the object, cast to uint64_t -->
+ <member len="null-terminated">const <type>char</type>* <name>pObjectName</name></member> <!-- Name to apply to the object -->
+ </type>
+ <type category="struct" name="VkDebugMarkerObjectTagInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkDebugReportObjectTypeEXT</type> <name>objectType</name></member> <!-- The type of the object -->
+ <member><type>uint64_t</type> <name>object</name></member> <!-- The handle of the object, cast to uint64_t -->
+ <member><type>uint64_t</type> <name>tagName</name></member> <!-- The name of the tag to set on the object -->
+ <member><type>size_t</type> <name>tagSize</name></member> <!-- The length in bytes of the tag data -->
+ <member len="tagSize">const <type>void</type>* <name>pTag</name></member> <!-- Tag data to attach to the object -->
+ </type>
+ <type category="struct" name="VkDebugMarkerMarkerInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member len="null-terminated">const <type>char</type>* <name>pMarkerName</name></member> <!-- Name of the debug marker -->
+ <member optional="true"><type>float</type> <name>color</name>[4]</member> <!-- Optional color for debug marker -->
+ </type>
+ <type category="struct" name="VkDedicatedAllocationImageCreateInfoNV">
+ <member values="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkBool32</type> <name>dedicatedAllocation</name></member> <!-- Whether this image uses a dedicated allocation -->
+ </type>
+ <type category="struct" name="VkDedicatedAllocationBufferCreateInfoNV">
+ <member values="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkBool32</type> <name>dedicatedAllocation</name></member> <!-- Whether this buffer uses a dedicated allocation -->
+ </type>
+ <type category="struct" name="VkDedicatedAllocationMemoryAllocateInfoNV">
+ <member values="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member optional="true"><type>VkImage</type> <name>image</name></member> <!-- Image that this allocation will be bound to -->
+ <member optional="true"><type>VkBuffer</type> <name>buffer</name></member> <!-- Buffer that this allocation will be bound to -->
+ </type>
+ <type category="struct" name="VkExternalImageFormatPropertiesNV" returnedonly="true">
+ <member><type>VkImageFormatProperties</type> <name>imageFormatProperties</name></member>
+ <member optional="true"><type>VkExternalMemoryFeatureFlagsNV</type> <name>externalMemoryFeatures</name></member>
+ <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>exportFromImportedHandleTypes</name></member>
+ <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>compatibleHandleTypes</name></member>
+ </type>
+ <type category="struct" name="VkExternalMemoryImageCreateInfoNV">
+ <member values="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleTypes</name></member>
+ </type>
+ <type category="struct" name="VkExportMemoryAllocateInfoNV">
+ <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleTypes</name></member>
+ </type>
+ <type category="struct" name="VkImportMemoryWin32HandleInfoNV">
+ <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleType</name></member>
+ <member optional="true"><type>HANDLE</type> <name>handle</name></member>
+ </type>
+ <type category="struct" name="VkExportMemoryWin32HandleInfoNV">
+ <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true">const <type>SECURITY_ATTRIBUTES</type>* <name>pAttributes</name></member>
+ <member optional="true"><type>DWORD</type> <name>dwAccess</name></member>
+ </type>
+ <type category="struct" name="VkWin32KeyedMutexAcquireReleaseInfoNV">
+ <member values="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>uint32_t</type> <name>acquireCount</name></member>
+ <member len="acquireCount">const <type>VkDeviceMemory</type>* <name>pAcquireSyncs</name></member>
+ <member len="acquireCount">const <type>uint64_t</type>* <name>pAcquireKeys</name></member>
+ <member len="acquireCount">const <type>uint32_t</type>* <name>pAcquireTimeoutMilliseconds</name></member>
+ <member optional="true"><type>uint32_t</type> <name>releaseCount</name></member>
+ <member len="releaseCount">const <type>VkDeviceMemory</type>* <name>pReleaseSyncs</name></member>
+ <member len="releaseCount">const <type>uint64_t</type>* <name>pReleaseKeys</name></member>
+ </type>
+
+ <type category="struct" name="VkDeviceGeneratedCommandsFeaturesNVX">
+ <member values="VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkBool32</type> <name>computeBindingPointSupport</name></member>
+ </type>
+ <type category="struct" name="VkDeviceGeneratedCommandsLimitsNVX">
+ <member values="VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>maxIndirectCommandsLayoutTokenCount</name></member>
+ <member><type>uint32_t</type> <name>maxObjectEntryCounts</name></member>
+ <member><type>uint32_t</type> <name>minSequenceCountBufferOffsetAlignment</name></member>
+ <member><type>uint32_t</type> <name>minSequenceIndexBufferOffsetAlignment</name></member>
+ <member><type>uint32_t</type> <name>minCommandsTokenBufferOffsetAlignment</name></member>
+ </type>
+ <type category="struct" name="VkIndirectCommandsTokenNVX">
+ <member><type>VkIndirectCommandsTokenTypeNVX</type> <name>tokenType</name></member>
+ <member><type>VkBuffer</type> <name>buffer</name></member> <!-- buffer containing tableEntries and additional data for indirectCommands -->
+ <member><type>VkDeviceSize</type> <name>offset</name></member> <!-- offset from the base address of the buffer -->
+ </type>
+ <type category="struct" name="VkIndirectCommandsLayoutTokenNVX">
+ <member><type>VkIndirectCommandsTokenTypeNVX</type> <name>tokenType</name></member>
+ <member><type>uint32_t</type> <name>bindingUnit</name></member> <!-- Binding unit for vertex attribute / descriptor set, offset for pushconstants -->
+ <member><type>uint32_t</type> <name>dynamicCount</name></member> <!-- Number of variable dynamic values for descriptor set / push constants -->
+ <member><type>uint32_t</type> <name>divisor</name></member> <!-- Rate the which the array is advanced per element (must be power of 2, minimum 1) -->
+ </type>
+ <type category="struct" name="VkIndirectCommandsLayoutCreateInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></member>
+ <member><type>VkIndirectCommandsLayoutUsageFlagsNVX</type> <name>flags</name></member>
+ <member><type>uint32_t</type> <name>tokenCount</name></member>
+ <member len="tokenCount">const <type>VkIndirectCommandsLayoutTokenNVX</type>* <name>pTokens</name></member>
+ </type>
+ <type category="struct" name="VkCmdProcessCommandsInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member externsync="true"><type>VkObjectTableNVX</type> <name>objectTable</name></member>
+ <member><type>VkIndirectCommandsLayoutNVX</type> <name>indirectCommandsLayout</name></member>
+ <member><type>uint32_t</type> <name>indirectCommandsTokenCount</name></member>
+ <member len="indirectCommandsTokenCount">const <type>VkIndirectCommandsTokenNVX</type>* <name>pIndirectCommandsTokens</name></member>
+ <member><type>uint32_t</type> <name>maxSequencesCount</name></member>
+ <member optional="true" externsync="true"><type>VkCommandBuffer</type> <name>targetCommandBuffer</name></member>
+ <member optional="true"><type>VkBuffer</type> <name>sequencesCountBuffer</name></member>
+ <member optional="true"><type>VkDeviceSize</type> <name>sequencesCountOffset</name></member>
+ <member optional="true"><type>VkBuffer</type> <name>sequencesIndexBuffer</name></member>
+ <member optional="true"><type>VkDeviceSize</type> <name>sequencesIndexOffset</name></member>
+ </type>
+ <type category="struct" name="VkCmdReserveSpaceForCommandsInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member externsync="true"><type>VkObjectTableNVX</type> <name>objectTable</name></member>
+ <member><type>VkIndirectCommandsLayoutNVX</type> <name>indirectCommandsLayout</name></member>
+ <member><type>uint32_t</type> <name>maxSequencesCount</name></member>
+ </type>
+ <type category="struct" name="VkObjectTableCreateInfoNVX">
+ <member values="VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>objectCount</name></member>
+ <member len="objectCount">const <type>VkObjectEntryTypeNVX</type>* <name>pObjectEntryTypes</name></member>
+ <member len="objectCount">const <type>uint32_t</type>* <name>pObjectEntryCounts</name></member>
+ <member len="objectCount">const <type>VkObjectEntryUsageFlagsNVX</type>* <name>pObjectEntryUsageFlags</name></member>
+
+ <member><type>uint32_t</type> <name>maxUniformBuffersPerDescriptor</name></member>
+ <member><type>uint32_t</type> <name>maxStorageBuffersPerDescriptor</name></member>
+ <member><type>uint32_t</type> <name>maxStorageImagesPerDescriptor</name></member>
+ <member><type>uint32_t</type> <name>maxSampledImagesPerDescriptor</name></member>
+ <member><type>uint32_t</type> <name>maxPipelineLayouts</name></member>
+ </type>
+ <type category="struct" name="VkObjectTableEntryNVX">
+ <member><type>VkObjectEntryTypeNVX</type> <name>type</name></member>
+ <member><type>VkObjectEntryUsageFlagsNVX</type> <name>flags</name></member>
+ </type>
+ <type category="struct" name="VkObjectTablePipelineEntryNVX">
+ <member><type>VkObjectEntryTypeNVX</type> <name>type</name></member>
+ <member><type>VkObjectEntryUsageFlagsNVX</type> <name>flags</name></member>
+ <member><type>VkPipeline</type> <name>pipeline</name></member>
+ </type>
+ <type category="struct" name="VkObjectTableDescriptorSetEntryNVX">
+ <member><type>VkObjectEntryTypeNVX</type> <name>type</name></member>
+ <member><type>VkObjectEntryUsageFlagsNVX</type> <name>flags</name></member>
+ <member><type>VkPipelineLayout</type> <name>pipelineLayout</name></member>
+ <member><type>VkDescriptorSet</type> <name>descriptorSet</name></member>
+ </type>
+ <type category="struct" name="VkObjectTableVertexBufferEntryNVX">
+ <member><type>VkObjectEntryTypeNVX</type> <name>type</name></member>
+ <member><type>VkObjectEntryUsageFlagsNVX</type> <name>flags</name></member>
+ <member><type>VkBuffer</type> <name>buffer</name></member>
+ </type>
+ <type category="struct" name="VkObjectTableIndexBufferEntryNVX">
+ <member><type>VkObjectEntryTypeNVX</type> <name>type</name></member>
+ <member><type>VkObjectEntryUsageFlagsNVX</type> <name>flags</name></member>
+ <member><type>VkBuffer</type> <name>buffer</name></member>
+ <member><type>VkIndexType</type> <name>indexType</name></member>
+ </type>
+ <type category="struct" name="VkObjectTablePushConstantEntryNVX">
+ <member><type>VkObjectEntryTypeNVX</type> <name>type</name></member>
+ <member><type>VkObjectEntryUsageFlagsNVX</type> <name>flags</name></member>
+ <member><type>VkPipelineLayout</type> <name>pipelineLayout</name></member>
+ <member><type>VkShaderStageFlags</type> <name>stageFlags</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceFeatures2KHR">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkPhysicalDeviceFeatures</type> <name>features</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceProperties2KHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkPhysicalDeviceProperties</type> <name>properties</name></member>
+ </type>
+ <type category="struct" name="VkFormatProperties2KHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkFormatProperties</type> <name>formatProperties</name></member>
+ </type>
+ <type category="struct" name="VkImageFormatProperties2KHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkImageFormatProperties</type> <name>imageFormatProperties</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceImageFormatInfo2KHR">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkFormat</type> <name>format</name></member>
+ <member><type>VkImageType</type> <name>type</name></member>
+ <member><type>VkImageTiling</type> <name>tiling</name></member>
+ <member><type>VkImageUsageFlags</type> <name>usage</name></member>
+ <member optional="true"><type>VkImageCreateFlags</type> <name>flags</name></member>
+ </type>
+ <type category="struct" name="VkQueueFamilyProperties2KHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkQueueFamilyProperties</type> <name>queueFamilyProperties</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceMemoryProperties2KHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkPhysicalDeviceMemoryProperties</type> <name>memoryProperties</name></member>
+ </type>
+ <type category="struct" name="VkSparseImageFormatProperties2KHR" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkSparseImageFormatProperties</type> <name>properties</name></member>
+ </type>
+ <type category="struct" name="VkPhysicalDeviceSparseImageFormatInfo2KHR">
+ <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
+ <member><type>VkFormat</type> <name>format</name></member>
+ <member><type>VkImageType</type> <name>type</name></member>
+ <member><type>VkSampleCountFlagBits</type> <name>samples</name></member>
+ <member><type>VkImageUsageFlags</type> <name>usage</name></member>
+ <member><type>VkImageTiling</type> <name>tiling</name></member>
+ </type>
+ <type category="struct" name="VkSurfaceCapabilities2EXT" returnedonly="true">
+ <member values="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>minImageCount</name></member> <!-- Supported minimum number of images for the surface -->
+ <member><type>uint32_t</type> <name>maxImageCount</name></member> <!-- Supported maximum number of images for the surface, 0 for unlimited -->
+ <member><type>VkExtent2D</type> <name>currentExtent</name></member> <!-- Current image width and height for the surface, (0, 0) if undefined -->
+ <member><type>VkExtent2D</type> <name>minImageExtent</name></member> <!-- Supported minimum image width and height for the surface -->
+ <member><type>VkExtent2D</type> <name>maxImageExtent</name></member> <!-- Supported maximum image width and height for the surface -->
+ <member><type>uint32_t</type> <name>maxImageArrayLayers</name></member> <!-- Supported maximum number of image layers for the surface -->
+ <member optional="true"><type>VkSurfaceTransformFlagsKHR</type> <name>supportedTransforms</name></member> <!-- 1 or more bits representing the transforms supported -->
+ <member><type>VkSurfaceTransformFlagBitsKHR</type> <name>currentTransform</name></member> <!-- The surface's current transform relative to the device's natural orientation -->
+ <member optional="true"><type>VkCompositeAlphaFlagsKHR</type> <name>supportedCompositeAlpha</name></member> <!-- 1 or more bits representing the alpha compositing modes supported -->
+ <member optional="true"><type>VkImageUsageFlags</type> <name>supportedUsageFlags</name></member> <!-- Supported image usage flags for the surface -->
+ <member optional="true"><type>VkSurfaceCounterFlagsEXT</type> <name>supportedSurfaceCounters</name></member>
+ </type>
+ <type category="struct" name="VkDisplayPowerInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkDisplayPowerStateEXT</type> <name>powerState</name></member>
+ </type>
+ <type category="struct" name="VkDeviceEventInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkDeviceEventTypeEXT</type> <name>deviceEvent</name></member>
+ </type>
+ <type category="struct" name="VkDisplayEventInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member><type>VkDisplayEventTypeEXT</type> <name>displayEvent</name></member>
+ </type>
+ <type category="struct" name="VkSwapchainCounterCreateInfoEXT">
+ <member values="VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member>const <type>void</type>* <name>pNext</name></member>
+ <member optional="true"><type>VkSurfaceCounterFlagsEXT</type> <name>surfaceCounters</name></member>
+ </type>
+ </types>
+
+ <!-- SECTION: Vulkan enumerant (token) definitions. -->
+
+ <enums name="API Constants" comment="Misc. hardcoded constants - not an enumerated type">
+ <!-- This is part of the header boilerplate -->
+ <enum value="256" name="VK_MAX_PHYSICAL_DEVICE_NAME_SIZE"/>
+ <enum value="16" name="VK_UUID_SIZE"/>
+ <enum value="256" name="VK_MAX_EXTENSION_NAME_SIZE"/>
+ <enum value="256" name="VK_MAX_DESCRIPTION_SIZE"/>
+ <enum value="32" name="VK_MAX_MEMORY_TYPES"/>
+ <enum value="16" name="VK_MAX_MEMORY_HEAPS"/> <!-- The maximum number of unique memory heaps, each of which supporting 1 or more memory types. -->
+ <enum value="1000.0f" name="VK_LOD_CLAMP_NONE"/>
+ <enum value="(~0U)" name="VK_REMAINING_MIP_LEVELS"/>
+ <enum value="(~0U)" name="VK_REMAINING_ARRAY_LAYERS"/>
+ <enum value="(~0ULL)" name="VK_WHOLE_SIZE"/>
+ <enum value="(~0U)" name="VK_ATTACHMENT_UNUSED"/>
+ <enum value="1" name="VK_TRUE"/>
+ <enum value="0" name="VK_FALSE"/>
+ <enum value="(~0U)" name="VK_QUEUE_FAMILY_IGNORED"/>
+ <enum value="(~0U)" name="VK_SUBPASS_EXTERNAL"/>
+ </enums>
+
+ <!-- Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in
+ their own numeric namespaces. The "name" attribute is the C enum
+ type name, and is pulled in from a <type> definition above
+ (slightly clunky, but retains the type / enum distinction). "type"
+ attributes of "enum" or "bitmask" indicate that these values should
+ be generated inside an appropriate definition. -->
+
+ <enums name="VkImageLayout" type="enum">
+ <enum value="0" name="VK_IMAGE_LAYOUT_UNDEFINED" comment="Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)"/>
+ <enum value="1" name="VK_IMAGE_LAYOUT_GENERAL" comment="General layout when image can be used for any kind of access"/>
+ <enum value="2" name="VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL" comment="Optimal layout when image is only used for color attachment read/write"/>
+ <enum value="3" name="VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL" comment="Optimal layout when image is only used for depth/stencil attachment read/write"/>
+ <enum value="4" name="VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL" comment="Optimal layout when image is used for read only depth/stencil attachment and shader access"/>
+ <enum value="5" name="VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL" comment="Optimal layout when image is used for read only shader access"/>
+ <enum value="6" name="VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL" comment="Optimal layout when image is used only as source of transfer operations"/>
+ <enum value="7" name="VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL" comment="Optimal layout when image is used only as destination of transfer operations"/>
+ <enum value="8" name="VK_IMAGE_LAYOUT_PREINITIALIZED" comment="Initial layout used when the data is populated by the CPU"/>
+ </enums>
+ <enums name="VkAttachmentLoadOp" type="enum">
+ <enum value="0" name="VK_ATTACHMENT_LOAD_OP_LOAD"/>
+ <enum value="1" name="VK_ATTACHMENT_LOAD_OP_CLEAR"/>
+ <enum value="2" name="VK_ATTACHMENT_LOAD_OP_DONT_CARE"/>
+ </enums>
+ <enums name="VkAttachmentStoreOp" type="enum">
+ <enum value="0" name="VK_ATTACHMENT_STORE_OP_STORE"/>
+ <enum value="1" name="VK_ATTACHMENT_STORE_OP_DONT_CARE"/>
+ </enums>
+ <enums name="VkImageType" type="enum">
+ <enum value="0" name="VK_IMAGE_TYPE_1D"/>
+ <enum value="1" name="VK_IMAGE_TYPE_2D"/>
+ <enum value="2" name="VK_IMAGE_TYPE_3D"/>
+ </enums>
+ <enums name="VkImageTiling" type="enum">
+ <enum value="0" name="VK_IMAGE_TILING_OPTIMAL"/>
+ <enum value="1" name="VK_IMAGE_TILING_LINEAR"/>
+ </enums>
+ <enums name="VkImageViewType" type="enum">
+ <enum value="0" name="VK_IMAGE_VIEW_TYPE_1D"/>
+ <enum value="1" name="VK_IMAGE_VIEW_TYPE_2D"/>
+ <enum value="2" name="VK_IMAGE_VIEW_TYPE_3D"/>
+ <enum value="3" name="VK_IMAGE_VIEW_TYPE_CUBE"/>
+ <enum value="4" name="VK_IMAGE_VIEW_TYPE_1D_ARRAY"/>
+ <enum value="5" name="VK_IMAGE_VIEW_TYPE_2D_ARRAY"/>
+ <enum value="6" name="VK_IMAGE_VIEW_TYPE_CUBE_ARRAY"/>
+ </enums>
+ <enums name="VkCommandBufferLevel" type="enum">
+ <enum value="0" name="VK_COMMAND_BUFFER_LEVEL_PRIMARY"/>
+ <enum value="1" name="VK_COMMAND_BUFFER_LEVEL_SECONDARY"/>
+ </enums>
+ <enums name="VkComponentSwizzle" type="enum">
+ <enum value="0" name="VK_COMPONENT_SWIZZLE_IDENTITY"/>
+ <enum value="1" name="VK_COMPONENT_SWIZZLE_ZERO"/>
+ <enum value="2" name="VK_COMPONENT_SWIZZLE_ONE"/>
+ <enum value="3" name="VK_COMPONENT_SWIZZLE_R"/>
+ <enum value="4" name="VK_COMPONENT_SWIZZLE_G"/>
+ <enum value="5" name="VK_COMPONENT_SWIZZLE_B"/>
+ <enum value="6" name="VK_COMPONENT_SWIZZLE_A"/>
+ </enums>
+ <enums name="VkDescriptorType" type="enum">
+ <enum value="0" name="VK_DESCRIPTOR_TYPE_SAMPLER"/>
+ <enum value="1" name="VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER"/>
+ <enum value="2" name="VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE"/>
+ <enum value="3" name="VK_DESCRIPTOR_TYPE_STORAGE_IMAGE"/>
+ <enum value="4" name="VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER"/>
+ <enum value="5" name="VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER"/>
+ <enum value="6" name="VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER"/>
+ <enum value="7" name="VK_DESCRIPTOR_TYPE_STORAGE_BUFFER"/>
+ <enum value="8" name="VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC"/>
+ <enum value="9" name="VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC"/>
+ <enum value="10" name="VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT"/>
+ </enums>
+ <enums name="VkQueryType" type="enum">
+ <enum value="0" name="VK_QUERY_TYPE_OCCLUSION"/>
+ <enum value="1" name="VK_QUERY_TYPE_PIPELINE_STATISTICS" comment="Optional"/>
+ <enum value="2" name="VK_QUERY_TYPE_TIMESTAMP"/>
+ </enums>
+ <enums name="VkBorderColor" type="enum">
+ <enum value="0" name="VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK"/>
+ <enum value="1" name="VK_BORDER_COLOR_INT_TRANSPARENT_BLACK"/>
+ <enum value="2" name="VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK"/>
+ <enum value="3" name="VK_BORDER_COLOR_INT_OPAQUE_BLACK"/>
+ <enum value="4" name="VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE"/>
+ <enum value="5" name="VK_BORDER_COLOR_INT_OPAQUE_WHITE"/>
+ </enums>
+ <enums name="VkPipelineBindPoint" type="enum">
+ <enum value="0" name="VK_PIPELINE_BIND_POINT_GRAPHICS"/>
+ <enum value="1" name="VK_PIPELINE_BIND_POINT_COMPUTE"/>
+ </enums>
+ <enums name="VkPipelineCacheHeaderVersion" type="enum">
+ <enum value="1" name="VK_PIPELINE_CACHE_HEADER_VERSION_ONE"/>
+ </enums>
+ <enums name="VkPrimitiveTopology" type="enum">
+ <enum value="0" name="VK_PRIMITIVE_TOPOLOGY_POINT_LIST"/>
+ <enum value="1" name="VK_PRIMITIVE_TOPOLOGY_LINE_LIST"/>
+ <enum value="2" name="VK_PRIMITIVE_TOPOLOGY_LINE_STRIP"/>
+ <enum value="3" name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST"/>
+ <enum value="4" name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP"/>
+ <enum value="5" name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN"/>
+ <enum value="6" name="VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY"/>
+ <enum value="7" name="VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY"/>
+ <enum value="8" name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY"/>
+ <enum value="9" name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY"/>
+ <enum value="10" name="VK_PRIMITIVE_TOPOLOGY_PATCH_LIST"/>
+ </enums>
+ <enums name="VkSharingMode" type="enum">
+ <enum value="0" name="VK_SHARING_MODE_EXCLUSIVE"/>
+ <enum value="1" name="VK_SHARING_MODE_CONCURRENT"/>
+ </enums>
+ <enums name="VkIndexType" type="enum">
+ <enum value="0" name="VK_INDEX_TYPE_UINT16"/>
+ <enum value="1" name="VK_INDEX_TYPE_UINT32"/>
+ </enums>
+ <enums name="VkFilter" type="enum">
+ <enum value="0" name="VK_FILTER_NEAREST"/>
+ <enum value="1" name="VK_FILTER_LINEAR"/>
+ </enums>
+ <enums name="VkSamplerMipmapMode" type="enum">
+ <enum value="0" name="VK_SAMPLER_MIPMAP_MODE_NEAREST" comment="Choose nearest mip level"/>
+ <enum value="1" name="VK_SAMPLER_MIPMAP_MODE_LINEAR" comment="Linear filter between mip levels"/>
+ </enums>
+ <enums name="VkSamplerAddressMode" type="enum">
+ <enum value="0" name="VK_SAMPLER_ADDRESS_MODE_REPEAT"/>
+ <enum value="1" name="VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT"/>
+ <enum value="2" name="VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE"/>
+ <enum value="3" name="VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER"/>
+ <!-- <enum value="4" name="VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE" comment="Reserved for VK_KHR_sampler_mirror_clamp_to_edge, do not alias!"/> -->
+ </enums>
+ <enums name="VkCompareOp" type="enum">
+ <enum value="0" name="VK_COMPARE_OP_NEVER"/>
+ <enum value="1" name="VK_COMPARE_OP_LESS"/>
+ <enum value="2" name="VK_COMPARE_OP_EQUAL"/>
+ <enum value="3" name="VK_COMPARE_OP_LESS_OR_EQUAL"/>
+ <enum value="4" name="VK_COMPARE_OP_GREATER"/>
+ <enum value="5" name="VK_COMPARE_OP_NOT_EQUAL"/>
+ <enum value="6" name="VK_COMPARE_OP_GREATER_OR_EQUAL"/>
+ <enum value="7" name="VK_COMPARE_OP_ALWAYS"/>
+ </enums>
+ <enums name="VkPolygonMode" type="enum">
+ <enum value="0" name="VK_POLYGON_MODE_FILL"/>
+ <enum value="1" name="VK_POLYGON_MODE_LINE"/>
+ <enum value="2" name="VK_POLYGON_MODE_POINT"/>
+ </enums>
+ <enums name="VkCullModeFlagBits" type="bitmask">
+ <enum value="0" name="VK_CULL_MODE_NONE"/>
+ <enum bitpos="0" name="VK_CULL_MODE_FRONT_BIT"/>
+ <enum bitpos="1" name="VK_CULL_MODE_BACK_BIT"/>
+ <enum value="0x00000003" name="VK_CULL_MODE_FRONT_AND_BACK"/>
+ </enums>
+ <enums name="VkFrontFace" type="enum">
+ <enum value="0" name="VK_FRONT_FACE_COUNTER_CLOCKWISE"/>
+ <enum value="1" name="VK_FRONT_FACE_CLOCKWISE"/>
+ </enums>
+ <enums name="VkBlendFactor" type="enum">
+ <enum value="0" name="VK_BLEND_FACTOR_ZERO"/>
+ <enum value="1" name="VK_BLEND_FACTOR_ONE"/>
+ <enum value="2" name="VK_BLEND_FACTOR_SRC_COLOR"/>
+ <enum value="3" name="VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR"/>
+ <enum value="4" name="VK_BLEND_FACTOR_DST_COLOR"/>
+ <enum value="5" name="VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR"/>
+ <enum value="6" name="VK_BLEND_FACTOR_SRC_ALPHA"/>
+ <enum value="7" name="VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA"/>
+ <enum value="8" name="VK_BLEND_FACTOR_DST_ALPHA"/>
+ <enum value="9" name="VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA"/>
+ <enum value="10" name="VK_BLEND_FACTOR_CONSTANT_COLOR"/>
+ <enum value="11" name="VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR"/>
+ <enum value="12" name="VK_BLEND_FACTOR_CONSTANT_ALPHA"/>
+ <enum value="13" name="VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA"/>
+ <enum value="14" name="VK_BLEND_FACTOR_SRC_ALPHA_SATURATE"/>
+ <enum value="15" name="VK_BLEND_FACTOR_SRC1_COLOR"/>
+ <enum value="16" name="VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR"/>
+ <enum value="17" name="VK_BLEND_FACTOR_SRC1_ALPHA"/>
+ <enum value="18" name="VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA"/>
+ </enums>
+ <enums name="VkBlendOp" type="enum">
+ <enum value="0" name="VK_BLEND_OP_ADD"/>
+ <enum value="1" name="VK_BLEND_OP_SUBTRACT"/>
+ <enum value="2" name="VK_BLEND_OP_REVERSE_SUBTRACT"/>
+ <enum value="3" name="VK_BLEND_OP_MIN"/>
+ <enum value="4" name="VK_BLEND_OP_MAX"/>
+ </enums>
+ <enums name="VkStencilOp" type="enum">
+ <enum value="0" name="VK_STENCIL_OP_KEEP"/>
+ <enum value="1" name="VK_STENCIL_OP_ZERO"/>
+ <enum value="2" name="VK_STENCIL_OP_REPLACE"/>
+ <enum value="3" name="VK_STENCIL_OP_INCREMENT_AND_CLAMP"/>
+ <enum value="4" name="VK_STENCIL_OP_DECREMENT_AND_CLAMP"/>
+ <enum value="5" name="VK_STENCIL_OP_INVERT"/>
+ <enum value="6" name="VK_STENCIL_OP_INCREMENT_AND_WRAP"/>
+ <enum value="7" name="VK_STENCIL_OP_DECREMENT_AND_WRAP"/>
+ </enums>
+ <enums name="VkLogicOp" type="enum">
+ <enum value="0" name="VK_LOGIC_OP_CLEAR"/>
+ <enum value="1" name="VK_LOGIC_OP_AND"/>
+ <enum value="2" name="VK_LOGIC_OP_AND_REVERSE"/>
+ <enum value="3" name="VK_LOGIC_OP_COPY"/>
+ <enum value="4" name="VK_LOGIC_OP_AND_INVERTED"/>
+ <enum value="5" name="VK_LOGIC_OP_NO_OP"/>
+ <enum value="6" name="VK_LOGIC_OP_XOR"/>
+ <enum value="7" name="VK_LOGIC_OP_OR"/>
+ <enum value="8" name="VK_LOGIC_OP_NOR"/>
+ <enum value="9" name="VK_LOGIC_OP_EQUIVALENT"/>
+ <enum value="10" name="VK_LOGIC_OP_INVERT"/>
+ <enum value="11" name="VK_LOGIC_OP_OR_REVERSE"/>
+ <enum value="12" name="VK_LOGIC_OP_COPY_INVERTED"/>
+ <enum value="13" name="VK_LOGIC_OP_OR_INVERTED"/>
+ <enum value="14" name="VK_LOGIC_OP_NAND"/>
+ <enum value="15" name="VK_LOGIC_OP_SET"/>
+ </enums>
+ <enums name="VkInternalAllocationType" type="enum">
+ <enum value="0" name="VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE"/>
+ </enums>
+ <enums name="VkSystemAllocationScope" type="enum">
+ <enum value="0" name="VK_SYSTEM_ALLOCATION_SCOPE_COMMAND"/>
+ <enum value="1" name="VK_SYSTEM_ALLOCATION_SCOPE_OBJECT"/>
+ <enum value="2" name="VK_SYSTEM_ALLOCATION_SCOPE_CACHE"/>
+ <enum value="3" name="VK_SYSTEM_ALLOCATION_SCOPE_DEVICE"/>
+ <enum value="4" name="VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE"/>
+ </enums>
+ <enums name="VkPhysicalDeviceType" type="enum">
+ <enum value="0" name="VK_PHYSICAL_DEVICE_TYPE_OTHER"/>
+ <enum value="1" name="VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU"/>
+ <enum value="2" name="VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU"/>
+ <enum value="3" name="VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU"/>
+ <enum value="4" name="VK_PHYSICAL_DEVICE_TYPE_CPU"/>
+ </enums>
+ <enums name="VkVertexInputRate" type="enum">
+ <enum value="0" name="VK_VERTEX_INPUT_RATE_VERTEX"/>
+ <enum value="1" name="VK_VERTEX_INPUT_RATE_INSTANCE"/>
+ </enums>
+ <enums name="VkFormat" type="enum" comment="Vulkan format definitions">
+ <enum value="0" name="VK_FORMAT_UNDEFINED"/>
+ <enum value="1" name="VK_FORMAT_R4G4_UNORM_PACK8"/>
+ <enum value="2" name="VK_FORMAT_R4G4B4A4_UNORM_PACK16"/>
+ <enum value="3" name="VK_FORMAT_B4G4R4A4_UNORM_PACK16"/>
+ <enum value="4" name="VK_FORMAT_R5G6B5_UNORM_PACK16"/>
+ <enum value="5" name="VK_FORMAT_B5G6R5_UNORM_PACK16"/>
+ <enum value="6" name="VK_FORMAT_R5G5B5A1_UNORM_PACK16"/>
+ <enum value="7" name="VK_FORMAT_B5G5R5A1_UNORM_PACK16"/>
+ <enum value="8" name="VK_FORMAT_A1R5G5B5_UNORM_PACK16"/>
+ <enum value="9" name="VK_FORMAT_R8_UNORM"/>
+ <enum value="10" name="VK_FORMAT_R8_SNORM"/>
+ <enum value="11" name="VK_FORMAT_R8_USCALED"/>
+ <enum value="12" name="VK_FORMAT_R8_SSCALED"/>
+ <enum value="13" name="VK_FORMAT_R8_UINT"/>
+ <enum value="14" name="VK_FORMAT_R8_SINT"/>
+ <enum value="15" name="VK_FORMAT_R8_SRGB"/>
+ <enum value="16" name="VK_FORMAT_R8G8_UNORM"/>
+ <enum value="17" name="VK_FORMAT_R8G8_SNORM"/>
+ <enum value="18" name="VK_FORMAT_R8G8_USCALED"/>
+ <enum value="19" name="VK_FORMAT_R8G8_SSCALED"/>
+ <enum value="20" name="VK_FORMAT_R8G8_UINT"/>
+ <enum value="21" name="VK_FORMAT_R8G8_SINT"/>
+ <enum value="22" name="VK_FORMAT_R8G8_SRGB"/>
+ <enum value="23" name="VK_FORMAT_R8G8B8_UNORM"/>
+ <enum value="24" name="VK_FORMAT_R8G8B8_SNORM"/>
+ <enum value="25" name="VK_FORMAT_R8G8B8_USCALED"/>
+ <enum value="26" name="VK_FORMAT_R8G8B8_SSCALED"/>
+ <enum value="27" name="VK_FORMAT_R8G8B8_UINT"/>
+ <enum value="28" name="VK_FORMAT_R8G8B8_SINT"/>
+ <enum value="29" name="VK_FORMAT_R8G8B8_SRGB"/>
+ <enum value="30" name="VK_FORMAT_B8G8R8_UNORM"/>
+ <enum value="31" name="VK_FORMAT_B8G8R8_SNORM"/>
+ <enum value="32" name="VK_FORMAT_B8G8R8_USCALED"/>
+ <enum value="33" name="VK_FORMAT_B8G8R8_SSCALED"/>
+ <enum value="34" name="VK_FORMAT_B8G8R8_UINT"/>
+ <enum value="35" name="VK_FORMAT_B8G8R8_SINT"/>
+ <enum value="36" name="VK_FORMAT_B8G8R8_SRGB"/>
+ <enum value="37" name="VK_FORMAT_R8G8B8A8_UNORM"/>
+ <enum value="38" name="VK_FORMAT_R8G8B8A8_SNORM"/>
+ <enum value="39" name="VK_FORMAT_R8G8B8A8_USCALED"/>
+ <enum value="40" name="VK_FORMAT_R8G8B8A8_SSCALED"/>
+ <enum value="41" name="VK_FORMAT_R8G8B8A8_UINT"/>
+ <enum value="42" name="VK_FORMAT_R8G8B8A8_SINT"/>
+ <enum value="43" name="VK_FORMAT_R8G8B8A8_SRGB"/>
+ <enum value="44" name="VK_FORMAT_B8G8R8A8_UNORM"/>
+ <enum value="45" name="VK_FORMAT_B8G8R8A8_SNORM"/>
+ <enum value="46" name="VK_FORMAT_B8G8R8A8_USCALED"/>
+ <enum value="47" name="VK_FORMAT_B8G8R8A8_SSCALED"/>
+ <enum value="48" name="VK_FORMAT_B8G8R8A8_UINT"/>
+ <enum value="49" name="VK_FORMAT_B8G8R8A8_SINT"/>
+ <enum value="50" name="VK_FORMAT_B8G8R8A8_SRGB"/>
+ <enum value="51" name="VK_FORMAT_A8B8G8R8_UNORM_PACK32"/>
+ <enum value="52" name="VK_FORMAT_A8B8G8R8_SNORM_PACK32"/>
+ <enum value="53" name="VK_FORMAT_A8B8G8R8_USCALED_PACK32"/>
+ <enum value="54" name="VK_FORMAT_A8B8G8R8_SSCALED_PACK32"/>
+ <enum value="55" name="VK_FORMAT_A8B8G8R8_UINT_PACK32"/>
+ <enum value="56" name="VK_FORMAT_A8B8G8R8_SINT_PACK32"/>
+ <enum value="57" name="VK_FORMAT_A8B8G8R8_SRGB_PACK32"/>
+ <enum value="58" name="VK_FORMAT_A2R10G10B10_UNORM_PACK32"/>
+ <enum value="59" name="VK_FORMAT_A2R10G10B10_SNORM_PACK32"/>
+ <enum value="60" name="VK_FORMAT_A2R10G10B10_USCALED_PACK32"/>
+ <enum value="61" name="VK_FORMAT_A2R10G10B10_SSCALED_PACK32"/>
+ <enum value="62" name="VK_FORMAT_A2R10G10B10_UINT_PACK32"/>
+ <enum value="63" name="VK_FORMAT_A2R10G10B10_SINT_PACK32"/>
+ <enum value="64" name="VK_FORMAT_A2B10G10R10_UNORM_PACK32"/>
+ <enum value="65" name="VK_FORMAT_A2B10G10R10_SNORM_PACK32"/>
+ <enum value="66" name="VK_FORMAT_A2B10G10R10_USCALED_PACK32"/>
+ <enum value="67" name="VK_FORMAT_A2B10G10R10_SSCALED_PACK32"/>
+ <enum value="68" name="VK_FORMAT_A2B10G10R10_UINT_PACK32"/>
+ <enum value="69" name="VK_FORMAT_A2B10G10R10_SINT_PACK32"/>
+ <enum value="70" name="VK_FORMAT_R16_UNORM"/>
+ <enum value="71" name="VK_FORMAT_R16_SNORM"/>
+ <enum value="72" name="VK_FORMAT_R16_USCALED"/>
+ <enum value="73" name="VK_FORMAT_R16_SSCALED"/>
+ <enum value="74" name="VK_FORMAT_R16_UINT"/>
+ <enum value="75" name="VK_FORMAT_R16_SINT"/>
+ <enum value="76" name="VK_FORMAT_R16_SFLOAT"/>
+ <enum value="77" name="VK_FORMAT_R16G16_UNORM"/>
+ <enum value="78" name="VK_FORMAT_R16G16_SNORM"/>
+ <enum value="79" name="VK_FORMAT_R16G16_USCALED"/>
+ <enum value="80" name="VK_FORMAT_R16G16_SSCALED"/>
+ <enum value="81" name="VK_FORMAT_R16G16_UINT"/>
+ <enum value="82" name="VK_FORMAT_R16G16_SINT"/>
+ <enum value="83" name="VK_FORMAT_R16G16_SFLOAT"/>
+ <enum value="84" name="VK_FORMAT_R16G16B16_UNORM"/>
+ <enum value="85" name="VK_FORMAT_R16G16B16_SNORM"/>
+ <enum value="86" name="VK_FORMAT_R16G16B16_USCALED"/>
+ <enum value="87" name="VK_FORMAT_R16G16B16_SSCALED"/>
+ <enum value="88" name="VK_FORMAT_R16G16B16_UINT"/>
+ <enum value="89" name="VK_FORMAT_R16G16B16_SINT"/>
+ <enum value="90" name="VK_FORMAT_R16G16B16_SFLOAT"/>
+ <enum value="91" name="VK_FORMAT_R16G16B16A16_UNORM"/>
+ <enum value="92" name="VK_FORMAT_R16G16B16A16_SNORM"/>
+ <enum value="93" name="VK_FORMAT_R16G16B16A16_USCALED"/>
+ <enum value="94" name="VK_FORMAT_R16G16B16A16_SSCALED"/>
+ <enum value="95" name="VK_FORMAT_R16G16B16A16_UINT"/>
+ <enum value="96" name="VK_FORMAT_R16G16B16A16_SINT"/>
+ <enum value="97" name="VK_FORMAT_R16G16B16A16_SFLOAT"/>
+ <enum value="98" name="VK_FORMAT_R32_UINT"/>
+ <enum value="99" name="VK_FORMAT_R32_SINT"/>
+ <enum value="100" name="VK_FORMAT_R32_SFLOAT"/>
+ <enum value="101" name="VK_FORMAT_R32G32_UINT"/>
+ <enum value="102" name="VK_FORMAT_R32G32_SINT"/>
+ <enum value="103" name="VK_FORMAT_R32G32_SFLOAT"/>
+ <enum value="104" name="VK_FORMAT_R32G32B32_UINT"/>
+ <enum value="105" name="VK_FORMAT_R32G32B32_SINT"/>
+ <enum value="106" name="VK_FORMAT_R32G32B32_SFLOAT"/>
+ <enum value="107" name="VK_FORMAT_R32G32B32A32_UINT"/>
+ <enum value="108" name="VK_FORMAT_R32G32B32A32_SINT"/>
+ <enum value="109" name="VK_FORMAT_R32G32B32A32_SFLOAT"/>
+ <enum value="110" name="VK_FORMAT_R64_UINT"/>
+ <enum value="111" name="VK_FORMAT_R64_SINT"/>
+ <enum value="112" name="VK_FORMAT_R64_SFLOAT"/>
+ <enum value="113" name="VK_FORMAT_R64G64_UINT"/>
+ <enum value="114" name="VK_FORMAT_R64G64_SINT"/>
+ <enum value="115" name="VK_FORMAT_R64G64_SFLOAT"/>
+ <enum value="116" name="VK_FORMAT_R64G64B64_UINT"/>
+ <enum value="117" name="VK_FORMAT_R64G64B64_SINT"/>
+ <enum value="118" name="VK_FORMAT_R64G64B64_SFLOAT"/>
+ <enum value="119" name="VK_FORMAT_R64G64B64A64_UINT"/>
+ <enum value="120" name="VK_FORMAT_R64G64B64A64_SINT"/>
+ <enum value="121" name="VK_FORMAT_R64G64B64A64_SFLOAT"/>
+ <enum value="122" name="VK_FORMAT_B10G11R11_UFLOAT_PACK32"/>
+ <enum value="123" name="VK_FORMAT_E5B9G9R9_UFLOAT_PACK32"/>
+ <enum value="124" name="VK_FORMAT_D16_UNORM"/>
+ <enum value="125" name="VK_FORMAT_X8_D24_UNORM_PACK32"/>
+ <enum value="126" name="VK_FORMAT_D32_SFLOAT"/>
+ <enum value="127" name="VK_FORMAT_S8_UINT"/>
+ <enum value="128" name="VK_FORMAT_D16_UNORM_S8_UINT"/>
+ <enum value="129" name="VK_FORMAT_D24_UNORM_S8_UINT"/>
+ <enum value="130" name="VK_FORMAT_D32_SFLOAT_S8_UINT"/>
+ <enum value="131" name="VK_FORMAT_BC1_RGB_UNORM_BLOCK"/>
+ <enum value="132" name="VK_FORMAT_BC1_RGB_SRGB_BLOCK"/>
+ <enum value="133" name="VK_FORMAT_BC1_RGBA_UNORM_BLOCK"/>
+ <enum value="134" name="VK_FORMAT_BC1_RGBA_SRGB_BLOCK"/>
+ <enum value="135" name="VK_FORMAT_BC2_UNORM_BLOCK"/>
+ <enum value="136" name="VK_FORMAT_BC2_SRGB_BLOCK"/>
+ <enum value="137" name="VK_FORMAT_BC3_UNORM_BLOCK"/>
+ <enum value="138" name="VK_FORMAT_BC3_SRGB_BLOCK"/>
+ <enum value="139" name="VK_FORMAT_BC4_UNORM_BLOCK"/>
+ <enum value="140" name="VK_FORMAT_BC4_SNORM_BLOCK"/>
+ <enum value="141" name="VK_FORMAT_BC5_UNORM_BLOCK"/>
+ <enum value="142" name="VK_FORMAT_BC5_SNORM_BLOCK"/>
+ <enum value="143" name="VK_FORMAT_BC6H_UFLOAT_BLOCK"/>
+ <enum value="144" name="VK_FORMAT_BC6H_SFLOAT_BLOCK"/>
+ <enum value="145" name="VK_FORMAT_BC7_UNORM_BLOCK"/>
+ <enum value="146" name="VK_FORMAT_BC7_SRGB_BLOCK"/>
+ <enum value="147" name="VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK"/>
+ <enum value="148" name="VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK"/>
+ <enum value="149" name="VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK"/>
+ <enum value="150" name="VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK"/>
+ <enum value="151" name="VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK"/>
+ <enum value="152" name="VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK"/>
+ <enum value="153" name="VK_FORMAT_EAC_R11_UNORM_BLOCK"/>
+ <enum value="154" name="VK_FORMAT_EAC_R11_SNORM_BLOCK"/>
+ <enum value="155" name="VK_FORMAT_EAC_R11G11_UNORM_BLOCK"/>
+ <enum value="156" name="VK_FORMAT_EAC_R11G11_SNORM_BLOCK"/>
+ <enum value="157" name="VK_FORMAT_ASTC_4x4_UNORM_BLOCK"/>
+ <enum value="158" name="VK_FORMAT_ASTC_4x4_SRGB_BLOCK"/>
+ <enum value="159" name="VK_FORMAT_ASTC_5x4_UNORM_BLOCK"/>
+ <enum value="160" name="VK_FORMAT_ASTC_5x4_SRGB_BLOCK"/>
+ <enum value="161" name="VK_FORMAT_ASTC_5x5_UNORM_BLOCK"/>
+ <enum value="162" name="VK_FORMAT_ASTC_5x5_SRGB_BLOCK"/>
+ <enum value="163" name="VK_FORMAT_ASTC_6x5_UNORM_BLOCK"/>
+ <enum value="164" name="VK_FORMAT_ASTC_6x5_SRGB_BLOCK"/>
+ <enum value="165" name="VK_FORMAT_ASTC_6x6_UNORM_BLOCK"/>
+ <enum value="166" name="VK_FORMAT_ASTC_6x6_SRGB_BLOCK"/>
+ <enum value="167" name="VK_FORMAT_ASTC_8x5_UNORM_BLOCK"/>
+ <enum value="168" name="VK_FORMAT_ASTC_8x5_SRGB_BLOCK"/>
+ <enum value="169" name="VK_FORMAT_ASTC_8x6_UNORM_BLOCK"/>
+ <enum value="170" name="VK_FORMAT_ASTC_8x6_SRGB_BLOCK"/>
+ <enum value="171" name="VK_FORMAT_ASTC_8x8_UNORM_BLOCK"/>
+ <enum value="172" name="VK_FORMAT_ASTC_8x8_SRGB_BLOCK"/>
+ <enum value="173" name="VK_FORMAT_ASTC_10x5_UNORM_BLOCK"/>
+ <enum value="174" name="VK_FORMAT_ASTC_10x5_SRGB_BLOCK"/>
+ <enum value="175" name="VK_FORMAT_ASTC_10x6_UNORM_BLOCK"/>
+ <enum value="176" name="VK_FORMAT_ASTC_10x6_SRGB_BLOCK"/>
+ <enum value="177" name="VK_FORMAT_ASTC_10x8_UNORM_BLOCK"/>
+ <enum value="178" name="VK_FORMAT_ASTC_10x8_SRGB_BLOCK"/>
+ <enum value="179" name="VK_FORMAT_ASTC_10x10_UNORM_BLOCK"/>
+ <enum value="180" name="VK_FORMAT_ASTC_10x10_SRGB_BLOCK"/>
+ <enum value="181" name="VK_FORMAT_ASTC_12x10_UNORM_BLOCK"/>
+ <enum value="182" name="VK_FORMAT_ASTC_12x10_SRGB_BLOCK"/>
+ <enum value="183" name="VK_FORMAT_ASTC_12x12_UNORM_BLOCK"/>
+ <enum value="184" name="VK_FORMAT_ASTC_12x12_SRGB_BLOCK"/>
+ </enums>
+ <enums name="VkStructureType" type="enum" comment="Structure type enumerant">
+ <enum value="0" name="VK_STRUCTURE_TYPE_APPLICATION_INFO"/>
+ <enum value="1" name="VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO"/>
+ <enum value="2" name="VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO"/>
+ <enum value="3" name="VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO"/>
+ <enum value="4" name="VK_STRUCTURE_TYPE_SUBMIT_INFO"/>
+ <enum value="5" name="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO"/>
+ <enum value="6" name="VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE"/>
+ <enum value="7" name="VK_STRUCTURE_TYPE_BIND_SPARSE_INFO"/>
+ <enum value="8" name="VK_STRUCTURE_TYPE_FENCE_CREATE_INFO"/>
+ <enum value="9" name="VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO"/>
+ <enum value="10" name="VK_STRUCTURE_TYPE_EVENT_CREATE_INFO"/>
+ <enum value="11" name="VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO"/>
+ <enum value="12" name="VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO"/>
+ <enum value="13" name="VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO"/>
+ <enum value="14" name="VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO"/>
+ <enum value="15" name="VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO"/>
+ <enum value="16" name="VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO"/>
+ <enum value="17" name="VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO"/>
+ <enum value="18" name="VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO"/>
+ <enum value="19" name="VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO"/>
+ <enum value="20" name="VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO"/>
+ <enum value="21" name="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO"/>
+ <enum value="22" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO"/>
+ <enum value="23" name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO"/>
+ <enum value="24" name="VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO"/>
+ <enum value="25" name="VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO"/>
+ <enum value="26" name="VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO"/>
+ <enum value="27" name="VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO"/>
+ <enum value="28" name="VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO"/>
+ <enum value="29" name="VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO"/>
+ <enum value="30" name="VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO"/>
+ <enum value="31" name="VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO"/>
+ <enum value="32" name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO"/>
+ <enum value="33" name="VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO"/>
+ <enum value="34" name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO"/>
+ <enum value="35" name="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET"/>
+ <enum value="36" name="VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET"/>
+ <enum value="37" name="VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO"/>
+ <enum value="38" name="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO"/>
+ <enum value="39" name="VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO"/>
+ <enum value="40" name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO"/>
+ <enum value="41" name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO"/>
+ <enum value="42" name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO"/>
+ <enum value="43" name="VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO"/>
+ <enum value="44" name="VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER"/>
+ <enum value="45" name="VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER"/>
+ <enum value="46" name="VK_STRUCTURE_TYPE_MEMORY_BARRIER"/>
+ <enum value="47" name="VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO"/> <!-- Reserved for internal use by the loader, layers, and ICDs -->
+ <enum value="48" name="VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO"/> <!-- Reserved for internal use by the loader, layers, and ICDs -->
+ </enums>
+ <enums name="VkSubpassContents" type="enum">
+ <enum value="0" name="VK_SUBPASS_CONTENTS_INLINE"/>
+ <enum value="1" name="VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS"/>
+ </enums>
+ <enums name="VkResult" type="enum" comment="Error and return codes">
+ <!-- Return codes for successful operation execution (positive values) -->
+ <enum value="0" name="VK_SUCCESS" comment="Command completed successfully"/>
+ <enum value="1" name="VK_NOT_READY" comment="A fence or query has not yet completed"/>
+ <enum value="2" name="VK_TIMEOUT" comment="A wait operation has not completed in the specified time"/>
+ <enum value="3" name="VK_EVENT_SET" comment="An event is signaled"/>
+ <enum value="4" name="VK_EVENT_RESET" comment="An event is unsignaled"/>
+ <enum value="5" name="VK_INCOMPLETE" comment="A return array was too small for the result"/>
+ <!-- Error codes (negative values) -->
+ <enum value="-1" name="VK_ERROR_OUT_OF_HOST_MEMORY" comment="A host memory allocation has failed"/>
+ <enum value="-2" name="VK_ERROR_OUT_OF_DEVICE_MEMORY" comment="A device memory allocation has failed"/>
+ <enum value="-3" name="VK_ERROR_INITIALIZATION_FAILED" comment="Initialization of a object has failed"/>
+ <enum value="-4" name="VK_ERROR_DEVICE_LOST" comment="The logical device has been lost. See &lt;&lt;devsandqueues-lost-device&gt;&gt;"/>
+ <enum value="-5" name="VK_ERROR_MEMORY_MAP_FAILED" comment="Mapping of a memory object has failed"/>
+ <enum value="-6" name="VK_ERROR_LAYER_NOT_PRESENT" comment="Layer specified does not exist"/>
+ <enum value="-7" name="VK_ERROR_EXTENSION_NOT_PRESENT" comment="Extension specified does not exist"/>
+ <enum value="-8" name="VK_ERROR_FEATURE_NOT_PRESENT" comment="Requested feature is not available on this device"/>
+ <enum value="-9" name="VK_ERROR_INCOMPATIBLE_DRIVER" comment="Unable to find a Vulkan driver"/>
+ <enum value="-10" name="VK_ERROR_TOO_MANY_OBJECTS" comment="Too many objects of the type have already been created"/>
+ <enum value="-11" name="VK_ERROR_FORMAT_NOT_SUPPORTED" comment="Requested format is not supported on this device"/>
+ <enum value="-12" name="VK_ERROR_FRAGMENTED_POOL" comment="A requested pool allocation has failed due to fragmentation of the pool's memory"/>
+ <unused start="-12"/>
+ </enums>
+ <enums name="VkDynamicState" type="enum">
+ <enum value="0" name="VK_DYNAMIC_STATE_VIEWPORT"/>
+ <enum value="1" name="VK_DYNAMIC_STATE_SCISSOR"/>
+ <enum value="2" name="VK_DYNAMIC_STATE_LINE_WIDTH"/>
+ <enum value="3" name="VK_DYNAMIC_STATE_DEPTH_BIAS"/>
+ <enum value="4" name="VK_DYNAMIC_STATE_BLEND_CONSTANTS"/>
+ <enum value="5" name="VK_DYNAMIC_STATE_DEPTH_BOUNDS"/>
+ <enum value="6" name="VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK"/>
+ <enum value="7" name="VK_DYNAMIC_STATE_STENCIL_WRITE_MASK"/>
+ <enum value="8" name="VK_DYNAMIC_STATE_STENCIL_REFERENCE"/>
+ </enums>
+
+ <!-- Flags -->
+ <enums name="VkQueueFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_QUEUE_GRAPHICS_BIT" comment="Queue supports graphics operations"/>
+ <enum bitpos="1" name="VK_QUEUE_COMPUTE_BIT" comment="Queue supports compute operations"/>
+ <enum bitpos="2" name="VK_QUEUE_TRANSFER_BIT" comment="Queue supports transfer operations"/>
+ <enum bitpos="3" name="VK_QUEUE_SPARSE_BINDING_BIT" comment="Queue supports sparse resource memory management operations"/>
+ </enums>
+ <enums name="VkMemoryPropertyFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT" comment="If otherwise stated, then allocate memory on device"/>
+ <enum bitpos="1" name="VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT" comment="Memory is mappable by host"/>
+ <enum bitpos="2" name="VK_MEMORY_PROPERTY_HOST_COHERENT_BIT" comment="Memory will have i/o coherency. If not set, application may need to use vkFlushMappedMemoryRanges and vkInvalidateMappedMemoryRanges to flush/invalidate host cache"/>
+ <enum bitpos="3" name="VK_MEMORY_PROPERTY_HOST_CACHED_BIT" comment="Memory will be cached by the host"/>
+ <enum bitpos="4" name="VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT" comment="Memory may be allocated by the driver when it is required"/>
+ </enums>
+ <enums name="VkMemoryHeapFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_MEMORY_HEAP_DEVICE_LOCAL_BIT" comment="If set, heap represents device memory"/>
+ </enums>
+ <enums name="VkAccessFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_ACCESS_INDIRECT_COMMAND_READ_BIT" comment="Controls coherency of indirect command reads"/>
+ <enum bitpos="1" name="VK_ACCESS_INDEX_READ_BIT" comment="Controls coherency of index reads"/>
+ <enum bitpos="2" name="VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT" comment="Controls coherency of vertex attribute reads"/>
+ <enum bitpos="3" name="VK_ACCESS_UNIFORM_READ_BIT" comment="Controls coherency of uniform buffer reads"/>
+ <enum bitpos="4" name="VK_ACCESS_INPUT_ATTACHMENT_READ_BIT" comment="Controls coherency of input attachment reads"/>
+ <enum bitpos="5" name="VK_ACCESS_SHADER_READ_BIT" comment="Controls coherency of shader reads"/>
+ <enum bitpos="6" name="VK_ACCESS_SHADER_WRITE_BIT" comment="Controls coherency of shader writes"/>
+ <enum bitpos="7" name="VK_ACCESS_COLOR_ATTACHMENT_READ_BIT" comment="Controls coherency of color attachment reads"/>
+ <enum bitpos="8" name="VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT" comment="Controls coherency of color attachment writes"/>
+ <enum bitpos="9" name="VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT" comment="Controls coherency of depth/stencil attachment reads"/>
+ <enum bitpos="10" name="VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT" comment="Controls coherency of depth/stencil attachment writes"/>
+ <enum bitpos="11" name="VK_ACCESS_TRANSFER_READ_BIT" comment="Controls coherency of transfer reads"/>
+ <enum bitpos="12" name="VK_ACCESS_TRANSFER_WRITE_BIT" comment="Controls coherency of transfer writes"/>
+ <enum bitpos="13" name="VK_ACCESS_HOST_READ_BIT" comment="Controls coherency of host reads"/>
+ <enum bitpos="14" name="VK_ACCESS_HOST_WRITE_BIT" comment="Controls coherency of host writes"/>
+ <enum bitpos="15" name="VK_ACCESS_MEMORY_READ_BIT" comment="Controls coherency of memory reads"/>
+ <enum bitpos="16" name="VK_ACCESS_MEMORY_WRITE_BIT" comment="Controls coherency of memory writes"/>
+ </enums>
+ <enums name="VkBufferUsageFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_BUFFER_USAGE_TRANSFER_SRC_BIT" comment="Can be used as a source of transfer operations"/>
+ <enum bitpos="1" name="VK_BUFFER_USAGE_TRANSFER_DST_BIT" comment="Can be used as a destination of transfer operations"/>
+ <enum bitpos="2" name="VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT" comment="Can be used as TBO"/>
+ <enum bitpos="3" name="VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT" comment="Can be used as IBO"/>
+ <enum bitpos="4" name="VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT" comment="Can be used as UBO"/>
+ <enum bitpos="5" name="VK_BUFFER_USAGE_STORAGE_BUFFER_BIT" comment="Can be used as SSBO"/>
+ <enum bitpos="6" name="VK_BUFFER_USAGE_INDEX_BUFFER_BIT" comment="Can be used as source of fixed-function index fetch (index buffer)"/>
+ <enum bitpos="7" name="VK_BUFFER_USAGE_VERTEX_BUFFER_BIT" comment="Can be used as source of fixed-function vertex fetch (VBO)"/>
+ <enum bitpos="8" name="VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT" comment="Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)"/>
+ </enums>
+ <enums name="VkBufferCreateFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_BUFFER_CREATE_SPARSE_BINDING_BIT" comment="Buffer should support sparse backing"/>
+ <enum bitpos="1" name="VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT" comment="Buffer should support sparse backing with partial residency"/>
+ <enum bitpos="2" name="VK_BUFFER_CREATE_SPARSE_ALIASED_BIT" comment="Buffer should support constent data access to physical memory ranges mapped into multiple locations of sparse buffers"/>
+ </enums>
+ <enums name="VkShaderStageFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_SHADER_STAGE_VERTEX_BIT"/>
+ <enum bitpos="1" name="VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"/>
+ <enum bitpos="2" name="VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"/>
+ <enum bitpos="3" name="VK_SHADER_STAGE_GEOMETRY_BIT"/>
+ <enum bitpos="4" name="VK_SHADER_STAGE_FRAGMENT_BIT"/>
+ <enum bitpos="5" name="VK_SHADER_STAGE_COMPUTE_BIT"/>
+ <enum value="0x0000001F" name="VK_SHADER_STAGE_ALL_GRAPHICS"/>
+ <enum value="0x7FFFFFFF" name="VK_SHADER_STAGE_ALL"/>
+ </enums>
+ <enums name="VkImageUsageFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_IMAGE_USAGE_TRANSFER_SRC_BIT" comment="Can be used as a source of transfer operations"/>
+ <enum bitpos="1" name="VK_IMAGE_USAGE_TRANSFER_DST_BIT" comment="Can be used as a destination of transfer operations"/>
+ <enum bitpos="2" name="VK_IMAGE_USAGE_SAMPLED_BIT" comment="Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)"/>
+ <enum bitpos="3" name="VK_IMAGE_USAGE_STORAGE_BIT" comment="Can be used as storage image (STORAGE_IMAGE descriptor type)"/>
+ <enum bitpos="4" name="VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT" comment="Can be used as framebuffer color attachment"/>
+ <enum bitpos="5" name="VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT" comment="Can be used as framebuffer depth/stencil attachment"/>
+ <enum bitpos="6" name="VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT" comment="Image data not needed outside of rendering"/>
+ <enum bitpos="7" name="VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT" comment="Can be used as framebuffer input attachment"/>
+ </enums>
+ <enums name="VkImageCreateFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_IMAGE_CREATE_SPARSE_BINDING_BIT" comment="Image should support sparse backing"/>
+ <enum bitpos="1" name="VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT" comment="Image should support sparse backing with partial residency"/>
+ <enum bitpos="2" name="VK_IMAGE_CREATE_SPARSE_ALIASED_BIT" comment="Image should support constent data access to physical memory ranges mapped into multiple locations of sparse images"/>
+ <enum bitpos="3" name="VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT" comment="Allows image views to have different format than the base image"/>
+ <enum bitpos="4" name="VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT" comment="Allows creating image views with cube type from the created image"/>
+ </enums>
+ <enums name="VkPipelineCreateFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"/>
+ <enum bitpos="1" name="VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"/>
+ <enum bitpos="2" name="VK_PIPELINE_CREATE_DERIVATIVE_BIT"/>
+ </enums>
+ <enums name="VkColorComponentFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_COLOR_COMPONENT_R_BIT"/>
+ <enum bitpos="1" name="VK_COLOR_COMPONENT_G_BIT"/>
+ <enum bitpos="2" name="VK_COLOR_COMPONENT_B_BIT"/>
+ <enum bitpos="3" name="VK_COLOR_COMPONENT_A_BIT"/>
+ </enums>
+ <enums name="VkFenceCreateFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_FENCE_CREATE_SIGNALED_BIT"/>
+ </enums>
+ <enums name="VkFormatFeatureFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT" comment="Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)"/>
+ <enum bitpos="1" name="VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT" comment="Format can be used for storage images (STORAGE_IMAGE descriptor type)"/>
+ <enum bitpos="2" name="VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT" comment="Format supports atomic operations in case it is used for storage images"/>
+ <enum bitpos="3" name="VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" comment="Format can be used for uniform texel buffers (TBOs)"/>
+ <enum bitpos="4" name="VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" comment="Format can be used for storage texel buffers (IBOs)"/>
+ <enum bitpos="5" name="VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT" comment="Format supports atomic operations in case it is used for storage texel buffers"/>
+ <enum bitpos="6" name="VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" comment="Format can be used for vertex buffers (VBOs)"/>
+ <enum bitpos="7" name="VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT" comment="Format can be used for color attachment images"/>
+ <enum bitpos="8" name="VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT" comment="Format supports blending in case it is used for color attachment images"/>
+ <enum bitpos="9" name="VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT" comment="Format can be used for depth/stencil attachment images"/>
+ <enum bitpos="10" name="VK_FORMAT_FEATURE_BLIT_SRC_BIT" comment="Format can be used as the source image of blits with vkCmdBlitImage"/>
+ <enum bitpos="11" name="VK_FORMAT_FEATURE_BLIT_DST_BIT" comment="Format can be used as the destination image of blits with vkCmdBlitImage"/>
+ <enum bitpos="12" name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT" comment="Format can be filtered with VK_FILTER_LINEAR when being sampled"/>
+ </enums>
+ <enums name="VkQueryControlFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_QUERY_CONTROL_PRECISE_BIT" comment="Require precise results to be collected by the query"/>
+ </enums>
+ <enums name="VkQueryResultFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_QUERY_RESULT_64_BIT" comment="Results of the queries are written to the destination buffer as 64-bit values"/>
+ <enum bitpos="1" name="VK_QUERY_RESULT_WAIT_BIT" comment="Results of the queries are waited on before proceeding with the result copy"/>
+ <enum bitpos="2" name="VK_QUERY_RESULT_WITH_AVAILABILITY_BIT" comment="Besides the results of the query, the availability of the results is also written"/>
+ <enum bitpos="3" name="VK_QUERY_RESULT_PARTIAL_BIT" comment="Copy the partial results of the query even if the final results are not available"/>
+ </enums>
+ <enums name="VkCommandBufferUsageFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT"/>
+ <enum bitpos="1" name="VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT"/>
+ <enum bitpos="2" name="VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT" comment="Command buffer may be submitted/executed more than once simultaneously"/>
+ </enums>
+ <enums name="VkQueryPipelineStatisticFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT" comment="Optional"/>
+ <enum bitpos="1" name="VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT" comment="Optional"/>
+ <enum bitpos="2" name="VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT" comment="Optional"/>
+ <enum bitpos="3" name="VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT" comment="Optional"/>
+ <enum bitpos="4" name="VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT" comment="Optional"/>
+ <enum bitpos="5" name="VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT" comment="Optional"/>
+ <enum bitpos="6" name="VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT" comment="Optional"/>
+ <enum bitpos="7" name="VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT" comment="Optional"/>
+ <enum bitpos="8" name="VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT" comment="Optional"/>
+ <enum bitpos="9" name="VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT" comment="Optional"/>
+ <enum bitpos="10" name="VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT" comment="Optional"/>
+ </enums>
+ <enums name="VkImageAspectFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_IMAGE_ASPECT_COLOR_BIT"/>
+ <enum bitpos="1" name="VK_IMAGE_ASPECT_DEPTH_BIT"/>
+ <enum bitpos="2" name="VK_IMAGE_ASPECT_STENCIL_BIT"/>
+ <enum bitpos="3" name="VK_IMAGE_ASPECT_METADATA_BIT"/>
+ </enums>
+ <enums name="VkSparseImageFormatFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT" comment="Image uses a single mip tail region for all array layers"/>
+ <enum bitpos="1" name="VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT" comment="Image requires mip level dimensions to be an integer multiple of the sparse image block dimensions for non-tail mip levels."/>
+ <enum bitpos="2" name="VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT" comment="Image uses a non-standard sparse image block dimensions"/>
+ </enums>
+ <enums name="VkSparseMemoryBindFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_SPARSE_MEMORY_BIND_METADATA_BIT" comment="Operation binds resource metadata to memory"/>
+ </enums>
+ <enums name="VkPipelineStageFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT" comment="Before subsequent commands are processed"/>
+ <enum bitpos="1" name="VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT" comment="Draw/DispatchIndirect command fetch"/>
+ <enum bitpos="2" name="VK_PIPELINE_STAGE_VERTEX_INPUT_BIT" comment="Vertex/index fetch"/>
+ <enum bitpos="3" name="VK_PIPELINE_STAGE_VERTEX_SHADER_BIT" comment="Vertex shading"/>
+ <enum bitpos="4" name="VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT" comment="Tessellation control shading"/>
+ <enum bitpos="5" name="VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" comment="Tessellation evaluation shading"/>
+ <enum bitpos="6" name="VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT" comment="Geometry shading"/>
+ <enum bitpos="7" name="VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT" comment="Fragment shading"/>
+ <enum bitpos="8" name="VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT" comment="Early fragment (depth and stencil) tests"/>
+ <enum bitpos="9" name="VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT" comment="Late fragment (depth and stencil) tests"/>
+ <enum bitpos="10" name="VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT" comment="Color attachment writes"/>
+ <enum bitpos="11" name="VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT" comment="Compute shading"/>
+ <enum bitpos="12" name="VK_PIPELINE_STAGE_TRANSFER_BIT" comment="Transfer/copy operations"/>
+ <enum bitpos="13" name="VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT" comment="After previous commands have completed"/>
+ <enum bitpos="14" name="VK_PIPELINE_STAGE_HOST_BIT" comment="Indicates host (CPU) is a source/sink of the dependency"/>
+ <enum bitpos="15" name="VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" comment="All stages of the graphics pipeline"/>
+ <enum bitpos="16" name="VK_PIPELINE_STAGE_ALL_COMMANDS_BIT" comment="All stages supported on the queue"/>
+ </enums>
+ <enums name="VkCommandPoolCreateFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_COMMAND_POOL_CREATE_TRANSIENT_BIT" comment="Command buffers have a short lifetime"/>
+ <enum bitpos="1" name="VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT" comment="Command buffers may release their memory individually"/>
+ </enums>
+ <enums name="VkCommandPoolResetFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT" comment="Release resources owned by the pool"/>
+ </enums>
+ <enums name="VkCommandBufferResetFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT" comment="Release resources owned by the buffer"/>
+ </enums>
+ <enums name="VkSampleCountFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_SAMPLE_COUNT_1_BIT" comment="Sample count 1 supported"/>
+ <enum bitpos="1" name="VK_SAMPLE_COUNT_2_BIT" comment="Sample count 2 supported"/>
+ <enum bitpos="2" name="VK_SAMPLE_COUNT_4_BIT" comment="Sample count 4 supported"/>
+ <enum bitpos="3" name="VK_SAMPLE_COUNT_8_BIT" comment="Sample count 8 supported"/>
+ <enum bitpos="4" name="VK_SAMPLE_COUNT_16_BIT" comment="Sample count 16 supported"/>
+ <enum bitpos="5" name="VK_SAMPLE_COUNT_32_BIT" comment="Sample count 32 supported"/>
+ <enum bitpos="6" name="VK_SAMPLE_COUNT_64_BIT" comment="Sample count 64 supported"/>
+ </enums>
+ <enums name="VkAttachmentDescriptionFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT" comment="The attachment may alias physical memory of another attachment in the same render pass"/>
+ </enums>
+ <enums name="VkStencilFaceFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_STENCIL_FACE_FRONT_BIT" comment="Front face"/>
+ <enum bitpos="1" name="VK_STENCIL_FACE_BACK_BIT" comment="Back face"/>
+ <enum value="0x00000003" name="VK_STENCIL_FRONT_AND_BACK" comment="Front and back faces"/>
+ </enums>
+ <enums name="VkDescriptorPoolCreateFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT" comment="Descriptor sets may be freed individually"/>
+ </enums>
+ <enums name="VkDependencyFlagBits" type="bitmask">
+ <enum bitpos="0" name="VK_DEPENDENCY_BY_REGION_BIT" comment="Dependency is per pixel region "/>
+ </enums>
+ <!-- WSI extensions -->
+ <enums name="VkPresentModeKHR" type="enum">
+ <enum value="0" name="VK_PRESENT_MODE_IMMEDIATE_KHR"/>
+ <enum value="1" name="VK_PRESENT_MODE_MAILBOX_KHR"/>
+ <enum value="2" name="VK_PRESENT_MODE_FIFO_KHR"/>
+ <enum value="3" name="VK_PRESENT_MODE_FIFO_RELAXED_KHR"/>
+ </enums>
+ <enums name="VkColorSpaceKHR" type="enum">
+ <enum value="0" name="VK_COLOR_SPACE_SRGB_NONLINEAR_KHR"/>
+ </enums>
+ <enums name="VkDisplayPlaneAlphaFlagBitsKHR" type="bitmask">
+ <enum bitpos="0" name="VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR"/>
+ <enum bitpos="1" name="VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR"/>
+ <enum bitpos="2" name="VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR"/>
+ <enum bitpos="3" name="VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR"/>
+ </enums>
+ <enums name="VkCompositeAlphaFlagBitsKHR" type="bitmask">
+ <enum bitpos="0" name="VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR"/>
+ <enum bitpos="1" name="VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR"/>
+ <enum bitpos="2" name="VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR"/>
+ <enum bitpos="3" name="VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR"/>
+ </enums>
+ <enums name="VkSurfaceTransformFlagBitsKHR" type="bitmask">
+ <enum bitpos="0" name="VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR"/>
+ <enum bitpos="1" name="VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR"/>
+ <enum bitpos="2" name="VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR"/>
+ <enum bitpos="3" name="VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR"/>
+ <enum bitpos="4" name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR"/>
+ <enum bitpos="5" name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR"/>
+ <enum bitpos="6" name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR"/>
+ <enum bitpos="7" name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"/>
+ <enum bitpos="8" name="VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR"/>
+ </enums>
+ <enums name="VkDebugReportFlagBitsEXT" type="bitmask">
+ <enum bitpos="0" name="VK_DEBUG_REPORT_INFORMATION_BIT_EXT"/>
+ <enum bitpos="1" name="VK_DEBUG_REPORT_WARNING_BIT_EXT"/>
+ <enum bitpos="2" name="VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT"/>
+ <enum bitpos="3" name="VK_DEBUG_REPORT_ERROR_BIT_EXT"/>
+ <enum bitpos="4" name="VK_DEBUG_REPORT_DEBUG_BIT_EXT"/>
+ </enums>
+ <enums name="VkDebugReportObjectTypeEXT" type="enum">
+ <enum value="0" name="VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT"/>
+ <enum value="1" name="VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT"/>
+ <enum value="2" name="VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT"/>
+ <enum value="3" name="VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT"/>
+ <enum value="4" name="VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT"/>
+ <enum value="5" name="VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT"/>
+ <enum value="6" name="VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT"/>
+ <enum value="7" name="VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT"/>
+ <enum value="8" name="VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT"/>
+ <enum value="9" name="VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT"/>
+ <enum value="10" name="VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT"/>
+ <enum value="11" name="VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT"/>
+ <enum value="12" name="VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT"/>
+ <enum value="13" name="VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT"/>
+ <enum value="14" name="VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT"/>
+ <enum value="15" name="VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT"/>
+ <enum value="16" name="VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT"/>
+ <enum value="17" name="VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT"/>
+ <enum value="18" name="VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT"/>
+ <enum value="19" name="VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT"/>
+ <enum value="20" name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT"/>
+ <enum value="21" name="VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT"/>
+ <enum value="22" name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT"/>
+ <enum value="23" name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT"/>
+ <enum value="24" name="VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT"/>
+ <enum value="25" name="VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT"/>
+ <enum value="26" name="VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT"/>
+ <enum value="27" name="VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT"/>
+ <enum value="28" name="VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT"/>
+ <enum value="29" name="VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT"/>
+ <enum value="30" name="VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT"/>
+ <enum value="31" name="VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT"/>
+ <enum value="32" name="VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT"/>
+ </enums>
+ <enums name="VkDebugReportErrorEXT" type="enum">
+ <enum value="0" name="VK_DEBUG_REPORT_ERROR_NONE_EXT"/> <!-- Used for INFO & other non-error messages -->
+ <enum value="1" name="VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT"/> <!-- Callbacks were not destroyed prior to calling DestroyInstance -->
+ </enums>
+ <enums name="VkRasterizationOrderAMD" type="enum">
+ <enum value="0" name="VK_RASTERIZATION_ORDER_STRICT_AMD"/> <!-- Rasterization order strictly follows API order -->
+ <enum value="1" name="VK_RASTERIZATION_ORDER_RELAXED_AMD"/> <!-- Rasterization order may not follow API order -->
+ </enums>
+ <enums name="VkExternalMemoryHandleTypeFlagBitsNV" type="bitmask">
+ <enum bitpos="0" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV"/>
+ <enum bitpos="1" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV"/>
+ <enum bitpos="2" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV"/>
+ <enum bitpos="3" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV"/>
+ </enums>
+ <enums name="VkExternalMemoryFeatureFlagBitsNV" type="bitmask">
+ <enum bitpos="0" name="VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV"/>
+ <enum bitpos="1" name="VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV"/>
+ <enum bitpos="2" name="VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV"/>
+ </enums>
+ <enums name="VkValidationCheckEXT" type="enum">
+ <enum value="0" name="VK_VALIDATION_CHECK_ALL_EXT"/>
+ <!-- Placeholder for validation enums to be defined for VK_EXT_Validation_flags extension -->
+ </enums>
+ <enums name="VkIndirectCommandsLayoutUsageFlagBitsNVX" type="bitmask">
+ <enum bitpos="0" name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX"/> <!-- sequences can be processed in implementation-dependent order -->
+ <enum bitpos="1" name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX"/> <!-- likely generated with a high difference in actual sequencesCount and maxSequencesCount -->
+ <enum bitpos="2" name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX"/> <!-- likely to contain draw/dispatch calls that are zero-sized -->
+ <enum bitpos="3" name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX"/> <!-- custom sequence index permutation (32-bit) is provided -->
+ </enums>
+ <enums name="VkObjectEntryUsageFlagBitsNVX" type="bitmask">
+ <enum bitpos="0" name="VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX"/>
+ <enum bitpos="1" name="VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX"/>
+ </enums>
+ <enums name="VkIndirectCommandsTokenTypeNVX" type="enum">
+ <enum value="0" name="VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX"/> <!-- array of 32bit tableEntry in the object table -->
+ <enum value="1" name="VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX"/> <!-- array of (32 bit tableEntry + variable count 32bit offsets) -->
+ <enum value="2" name="VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX"/> <!-- array of (32 bit tableEntry + optional 32bit offset) -->
+ <enum value="3" name="VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX"/> <!-- array of (32 bit tableEntry + optional 32bit offset) -->
+ <enum value="4" name="VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX"/> <!-- array of (32 bit tableEntry + variable count 32bit values ) -->
+ <enum value="5" name="VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX"/> <!-- array of VkDrawIndexedIndirectCommand -->
+ <enum value="6" name="VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX"/> <!-- array of VkDrawIndirectCommand -->
+ <enum value="7" name="VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX"/> <!-- array of VkDispatchIndirectCommand -->
+ </enums>
+ <enums name="VkObjectEntryTypeNVX" type="enum">
+ <enum value="0" name="VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX"/>
+ <enum value="1" name="VK_OBJECT_ENTRY_PIPELINE_NVX"/>
+ <enum value="2" name="VK_OBJECT_ENTRY_INDEX_BUFFER_NVX"/>
+ <enum value="3" name="VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX"/>
+ <enum value="4" name="VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX"/>
+ </enums>
+ <enums name="VkSurfaceCounterFlagBitsEXT" type="bitmask">
+ <enum bitpos="0" name="VK_SURFACE_COUNTER_VBLANK_EXT"/>
+ </enums>
+ <enums name="VkDisplayPowerStateEXT" type="enum">
+ <enum value="0" name="VK_DISPLAY_POWER_STATE_OFF_EXT"/>
+ <enum value="1" name="VK_DISPLAY_POWER_STATE_SUSPEND_EXT"/>
+ <enum value="2" name="VK_DISPLAY_POWER_STATE_ON_EXT"/>
+ </enums>
+ <enums name="VkDeviceEventTypeEXT" type="enum">
+ <enum value="0" name="VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT"/>
+ </enums>
+ <enums name="VkDisplayEventTypeEXT" type="enum">
+ <enum value="0" name="VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT"/>
+ </enums>
+
+ <!-- SECTION: Vulkan command definitions -->
+ <commands>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_LAYER_NOT_PRESENT,VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_INCOMPATIBLE_DRIVER">
+ <proto><type>VkResult</type> <name>vkCreateInstance</name></proto>
+ <param>const <type>VkInstanceCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkInstance</type>* <name>pInstance</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyInstance</name></proto>
+ <param optional="true" externsync="true"><type>VkInstance</type> <name>instance</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+ <proto><type>VkResult</type> <name>vkEnumeratePhysicalDevices</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPhysicalDeviceCount</name></param>
+ <param optional="true" len="pPhysicalDeviceCount"><type>VkPhysicalDevice</type>* <name>pPhysicalDevices</name></param>
+ </command>
+ <command>
+ <proto><type>PFN_vkVoidFunction</type> <name>vkGetDeviceProcAddr</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param len="null-terminated">const <type>char</type>* <name>pName</name></param>
+ </command>
+ <command>
+ <proto><type>PFN_vkVoidFunction</type> <name>vkGetInstanceProcAddr</name></proto>
+ <param optional="true"><type>VkInstance</type> <name>instance</name></param>
+ <param len="null-terminated">const <type>char</type>* <name>pName</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkPhysicalDeviceProperties</type>* <name>pProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceQueueFamilyProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pQueueFamilyPropertyCount</name></param>
+ <param optional="true" len="pQueueFamilyPropertyCount"><type>VkQueueFamilyProperties</type>* <name>pQueueFamilyProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceMemoryProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkPhysicalDeviceMemoryProperties</type>* <name>pMemoryProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceFeatures</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkPhysicalDeviceFeatures</type>* <name>pFeatures</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceFormatProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkFormat</type> <name>format</name></param>
+ <param><type>VkFormatProperties</type>* <name>pFormatProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceImageFormatProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkFormat</type> <name>format</name></param>
+ <param><type>VkImageType</type> <name>type</name></param>
+ <param><type>VkImageTiling</type> <name>tiling</name></param>
+ <param><type>VkImageUsageFlags</type> <name>usage</name></param>
+ <param optional="true"><type>VkImageCreateFlags</type> <name>flags</name></param>
+ <param><type>VkImageFormatProperties</type>* <name>pImageFormatProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_FEATURE_NOT_PRESENT,VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkCreateDevice</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param>const <type>VkDeviceCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkDevice</type>* <name>pDevice</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyDevice</name></proto>
+ <param optional="true" externsync="true"><type>VkDevice</type> <name>device</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkEnumerateInstanceLayerProperties</name></proto>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkLayerProperties</type>* <name>pProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_LAYER_NOT_PRESENT">
+ <proto><type>VkResult</type> <name>vkEnumerateInstanceExtensionProperties</name></proto>
+ <param optional="true" len="null-terminated">const <type>char</type>* <name>pLayerName</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkExtensionProperties</type>* <name>pProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkEnumerateDeviceLayerProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkLayerProperties</type>* <name>pProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_LAYER_NOT_PRESENT">
+ <proto><type>VkResult</type> <name>vkEnumerateDeviceExtensionProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="true" len="null-terminated">const <type>char</type>* <name>pLayerName</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkExtensionProperties</type>* <name>pProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetDeviceQueue</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ <param><type>uint32_t</type> <name>queueIndex</name></param>
+ <param><type>VkQueue</type>* <name>pQueue</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkQueueSubmit</name></proto>
+ <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+ <param optional="true"><type>uint32_t</type> <name>submitCount</name></param>
+ <param len="submitCount" externsync="pSubmits[].pWaitSemaphores[],pSubmits[].pSignalSemaphores[]">const <type>VkSubmitInfo</type>* <name>pSubmits</name></param>
+ <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkQueueWaitIdle</name></proto>
+ <param><type>VkQueue</type> <name>queue</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkDeviceWaitIdle</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <implicitexternsyncparams>
+ <param>all sname:VkQueue objects created from pname:device</param>
+ </implicitexternsyncparams>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_TOO_MANY_OBJECTS">
+ <proto><type>VkResult</type> <name>vkAllocateMemory</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkMemoryAllocateInfo</type>* <name>pAllocateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkDeviceMemory</type>* <name>pMemory</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkFreeMemory</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_MEMORY_MAP_FAILED">
+ <proto><type>VkResult</type> <name>vkMapMemory</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>VkDeviceSize</type> <name>size</name></param>
+ <param optional="true"><type>VkMemoryMapFlags</type> <name>flags</name></param>
+ <param><type>void</type>** <name>ppData</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkUnmapMemory</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkDeviceMemory</type> <name>memory</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkFlushMappedMemoryRanges</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>memoryRangeCount</name></param>
+ <param len="memoryRangeCount">const <type>VkMappedMemoryRange</type>* <name>pMemoryRanges</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkInvalidateMappedMemoryRanges</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>memoryRangeCount</name></param>
+ <param len="memoryRangeCount">const <type>VkMappedMemoryRange</type>* <name>pMemoryRanges</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetDeviceMemoryCommitment</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param><type>VkDeviceSize</type>* <name>pCommittedMemoryInBytes</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetBufferMemoryRequirements</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkMemoryRequirements</type>* <name>pMemoryRequirements</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkBindBufferMemory</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param><type>VkDeviceSize</type> <name>memoryOffset</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetImageMemoryRequirements</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param><type>VkMemoryRequirements</type>* <name>pMemoryRequirements</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkBindImageMemory</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkImage</type> <name>image</name></param>
+ <param><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param><type>VkDeviceSize</type> <name>memoryOffset</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetImageSparseMemoryRequirements</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pSparseMemoryRequirementCount</name></param>
+ <param optional="true" len="pSparseMemoryRequirementCount"><type>VkSparseImageMemoryRequirements</type>* <name>pSparseMemoryRequirements</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceSparseImageFormatProperties</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkFormat</type> <name>format</name></param>
+ <param><type>VkImageType</type> <name>type</name></param>
+ <param><type>VkSampleCountFlagBits</type> <name>samples</name></param>
+ <param><type>VkImageUsageFlags</type> <name>usage</name></param>
+ <param><type>VkImageTiling</type> <name>tiling</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkSparseImageFormatProperties</type>* <name>pProperties</name></param>
+ </command>
+ <command queues="sparse_binding" successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkQueueBindSparse</name></proto>
+ <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+ <param optional="true"><type>uint32_t</type> <name>bindInfoCount</name></param>
+ <param len="bindInfoCount" externsync="pBindInfo[].pWaitSemaphores[],pBindInfo[].pSignalSemaphores[],pBindInfo[].pBufferBinds[].buffer,pBindInfo[].pImageOpaqueBinds[].image,pBindInfo[].pImageBinds[].image">const <type>VkBindSparseInfo</type>* <name>pBindInfo</name></param>
+ <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateFence</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkFenceCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkFence</type>* <name>pFence</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyFence</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkResetFences</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>fenceCount</name></param>
+ <param len="fenceCount" externsync="true">const <type>VkFence</type>* <name>pFences</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_NOT_READY" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkGetFenceStatus</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkFence</type> <name>fence</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_TIMEOUT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkWaitForFences</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>fenceCount</name></param>
+ <param len="fenceCount">const <type>VkFence</type>* <name>pFences</name></param>
+ <param><type>VkBool32</type> <name>waitAll</name></param>
+ <param><type>uint64_t</type> <name>timeout</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateSemaphore</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkSemaphoreCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSemaphore</type>* <name>pSemaphore</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroySemaphore</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkSemaphore</type> <name>semaphore</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateEvent</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkEventCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkEvent</type>* <name>pEvent</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyEvent</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkEvent</type> <name>event</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_EVENT_SET,VK_EVENT_RESET" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkGetEventStatus</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkEvent</type> <name>event</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkSetEvent</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkEvent</type> <name>event</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkResetEvent</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkEvent</type> <name>event</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateQueryPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkQueryPoolCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkQueryPool</type>* <name>pQueryPool</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyQueryPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_NOT_READY" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+ <proto><type>VkResult</type> <name>vkGetQueryPoolResults</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>firstQuery</name></param>
+ <param><type>uint32_t</type> <name>queryCount</name></param>
+ <param><type>size_t</type> <name>dataSize</name></param>
+ <param len="dataSize"><type>void</type>* <name>pData</name></param>
+ <param><type>VkDeviceSize</type> <name>stride</name></param>
+ <param optional="true"><type>VkQueryResultFlags</type> <name>flags</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateBuffer</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkBufferCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkBuffer</type>* <name>pBuffer</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyBuffer</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkBuffer</type> <name>buffer</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateBufferView</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkBufferViewCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkBufferView</type>* <name>pView</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyBufferView</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkBufferView</type> <name>bufferView</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateImage</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkImageCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkImage</type>* <name>pImage</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyImage</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkImage</type> <name>image</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetImageSubresourceLayout</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param>const <type>VkImageSubresource</type>* <name>pSubresource</name></param>
+ <param><type>VkSubresourceLayout</type>* <name>pLayout</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateImageView</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkImageViewCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkImageView</type>* <name>pView</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyImageView</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkImageView</type> <name>imageView</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+ <proto><type>VkResult</type> <name>vkCreateShaderModule</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkShaderModuleCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkShaderModule</type>* <name>pShaderModule</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyShaderModule</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkShaderModule</type> <name>shaderModule</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreatePipelineCache</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkPipelineCacheCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkPipelineCache</type>* <name>pPipelineCache</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyPipelineCache</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetPipelineCacheData</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+ <param optional="false,true"><type>size_t</type>* <name>pDataSize</name></param>
+ <param optional="true" len="pDataSize"><type>void</type>* <name>pData</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkMergePipelineCaches</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkPipelineCache</type> <name>dstCache</name></param>
+ <param><type>uint32_t</type> <name>srcCacheCount</name></param>
+ <param len="srcCacheCount">const <type>VkPipelineCache</type>* <name>pSrcCaches</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+ <proto><type>VkResult</type> <name>vkCreateGraphicsPipelines</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+ <param><type>uint32_t</type> <name>createInfoCount</name></param>
+ <param len="createInfoCount">const <type>VkGraphicsPipelineCreateInfo</type>* <name>pCreateInfos</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+ <proto><type>VkResult</type> <name>vkCreateComputePipelines</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+ <param><type>uint32_t</type> <name>createInfoCount</name></param>
+ <param len="createInfoCount">const <type>VkComputePipelineCreateInfo</type>* <name>pCreateInfos</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyPipeline</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkPipeline</type> <name>pipeline</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreatePipelineLayout</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkPipelineLayoutCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkPipelineLayout</type>* <name>pPipelineLayout</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyPipelineLayout</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkPipelineLayout</type> <name>pipelineLayout</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_TOO_MANY_OBJECTS">
+ <proto><type>VkResult</type> <name>vkCreateSampler</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkSamplerCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSampler</type>* <name>pSampler</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroySampler</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkSampler</type> <name>sampler</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateDescriptorSetLayout</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkDescriptorSetLayoutCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkDescriptorSetLayout</type>* <name>pSetLayout</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyDescriptorSetLayout</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkDescriptorSetLayout</type> <name>descriptorSetLayout</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateDescriptorPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkDescriptorPoolCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkDescriptorPool</type>* <name>pDescriptorPool</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyDescriptorPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkResetDescriptorPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+ <param optional="true"><type>VkDescriptorPoolResetFlags</type> <name>flags</name></param>
+ <implicitexternsyncparams>
+ <param>any sname:VkDescriptorSet objects allocated from pname:descriptorPool</param>
+ </implicitexternsyncparams>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FRAGMENTED_POOL">
+ <proto><type>VkResult</type> <name>vkAllocateDescriptorSets</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="pAllocateInfo::descriptorPool">const <type>VkDescriptorSetAllocateInfo</type>* <name>pAllocateInfo</name></param>
+ <param len="pAllocateInfo::descriptorSetCount"><type>VkDescriptorSet</type>* <name>pDescriptorSets</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkFreeDescriptorSets</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+ <param><type>uint32_t</type> <name>descriptorSetCount</name></param>
+ <param noautovalidity="true" externsync="true" len="descriptorSetCount">const <type>VkDescriptorSet</type>* <name>pDescriptorSets</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkUpdateDescriptorSets</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true"><type>uint32_t</type> <name>descriptorWriteCount</name></param>
+ <param len="descriptorWriteCount" externsync="pDescriptorWrites[].dstSet">const <type>VkWriteDescriptorSet</type>* <name>pDescriptorWrites</name></param>
+ <param optional="true"><type>uint32_t</type> <name>descriptorCopyCount</name></param>
+ <param len="descriptorCopyCount" externsync="pDescriptorCopies[].dstSet">const <type>VkCopyDescriptorSet</type>* <name>pDescriptorCopies</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateFramebuffer</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkFramebufferCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkFramebuffer</type>* <name>pFramebuffer</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyFramebuffer</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkFramebuffer</type> <name>framebuffer</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateRenderPass</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkRenderPassCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkRenderPass</type>* <name>pRenderPass</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyRenderPass</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkRenderPass</type> <name>renderPass</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetRenderAreaGranularity</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkRenderPass</type> <name>renderPass</name></param>
+ <param><type>VkExtent2D</type>* <name>pGranularity</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateCommandPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkCommandPoolCreateInfo</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkCommandPool</type>* <name>pCommandPool</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyCommandPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkResetCommandPool</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+ <param optional="true"><type>VkCommandPoolResetFlags</type> <name>flags</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkAllocateCommandBuffers</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="pAllocateInfo::commandPool">const <type>VkCommandBufferAllocateInfo</type>* <name>pAllocateInfo</name></param>
+ <param len="pAllocateInfo::commandBufferCount"><type>VkCommandBuffer</type>* <name>pCommandBuffers</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkFreeCommandBuffers</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+ <param><type>uint32_t</type> <name>commandBufferCount</name></param>
+ <param noautovalidity="true" externsync="true" len="commandBufferCount">const <type>VkCommandBuffer</type>* <name>pCommandBuffers</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkBeginCommandBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param>const <type>VkCommandBufferBeginInfo</type>* <name>pBeginInfo</name></param>
+ <implicitexternsyncparams>
+ <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+ </implicitexternsyncparams>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkEndCommandBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <implicitexternsyncparams>
+ <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+ </implicitexternsyncparams>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkResetCommandBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param optional="true"><type>VkCommandBufferResetFlags</type> <name>flags</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBindPipeline</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param>
+ <param><type>VkPipeline</type> <name>pipeline</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetViewport</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstViewport</name></param>
+ <param><type>uint32_t</type> <name>viewportCount</name></param>
+ <param len="viewportCount" noautovalidity="true">const <type>VkViewport</type>* <name>pViewports</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetScissor</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstScissor</name></param>
+ <param><type>uint32_t</type> <name>scissorCount</name></param>
+ <param len="scissorCount">const <type>VkRect2D</type>* <name>pScissors</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetLineWidth</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>float</type> <name>lineWidth</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetDepthBias</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>float</type> <name>depthBiasConstantFactor</name></param>
+ <param><type>float</type> <name>depthBiasClamp</name></param>
+ <param><type>float</type> <name>depthBiasSlopeFactor</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetBlendConstants</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param>const <type>float</type> <name>blendConstants</name>[4]</param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetDepthBounds</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>float</type> <name>minDepthBounds</name></param>
+ <param><type>float</type> <name>maxDepthBounds</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetStencilCompareMask</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+ <param><type>uint32_t</type> <name>compareMask</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetStencilWriteMask</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+ <param><type>uint32_t</type> <name>writeMask</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetStencilReference</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+ <param><type>uint32_t</type> <name>reference</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBindDescriptorSets</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param>
+ <param><type>VkPipelineLayout</type> <name>layout</name></param>
+ <param><type>uint32_t</type> <name>firstSet</name></param>
+ <param><type>uint32_t</type> <name>descriptorSetCount</name></param>
+ <param len="descriptorSetCount">const <type>VkDescriptorSet</type>* <name>pDescriptorSets</name></param>
+ <param optional="true"><type>uint32_t</type> <name>dynamicOffsetCount</name></param>
+ <param len="dynamicOffsetCount">const <type>uint32_t</type>* <name>pDynamicOffsets</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBindIndexBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>VkIndexType</type> <name>indexType</name></param>
+ </command>
+ <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBindVertexBuffers</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>firstBinding</name></param>
+ <param><type>uint32_t</type> <name>bindingCount</name></param>
+ <param len="bindingCount">const <type>VkBuffer</type>* <name>pBuffers</name></param>
+ <param len="bindingCount">const <type>VkDeviceSize</type>* <name>pOffsets</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDraw</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>vertexCount</name></param>
+ <param><type>uint32_t</type> <name>instanceCount</name></param>
+ <param><type>uint32_t</type> <name>firstVertex</name></param>
+ <param><type>uint32_t</type> <name>firstInstance</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawIndexed</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>indexCount</name></param>
+ <param><type>uint32_t</type> <name>instanceCount</name></param>
+ <param><type>uint32_t</type> <name>firstIndex</name></param>
+ <param><type>int32_t</type> <name>vertexOffset</name></param>
+ <param><type>uint32_t</type> <name>firstInstance</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawIndirect</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>uint32_t</type> <name>drawCount</name></param>
+ <param><type>uint32_t</type> <name>stride</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawIndexedIndirect</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>uint32_t</type> <name>drawCount</name></param>
+ <param><type>uint32_t</type> <name>stride</name></param>
+ </command>
+ <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="compute">
+ <proto><type>void</type> <name>vkCmdDispatch</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>x</name></param>
+ <param><type>uint32_t</type> <name>y</name></param>
+ <param><type>uint32_t</type> <name>z</name></param>
+ </command>
+ <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="compute">
+ <proto><type>void</type> <name>vkCmdDispatchIndirect</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdCopyBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>srcBuffer</name></param>
+ <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+ <param><type>uint32_t</type> <name>regionCount</name></param>
+ <param len="regionCount">const <type>VkBufferCopy</type>* <name>pRegions</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdCopyImage</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImage</type> <name>srcImage</name></param>
+ <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+ <param><type>VkImage</type> <name>dstImage</name></param>
+ <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+ <param><type>uint32_t</type> <name>regionCount</name></param>
+ <param len="regionCount">const <type>VkImageCopy</type>* <name>pRegions</name></param>
+ </command>
+ <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdBlitImage</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImage</type> <name>srcImage</name></param>
+ <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+ <param><type>VkImage</type> <name>dstImage</name></param>
+ <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+ <param><type>uint32_t</type> <name>regionCount</name></param>
+ <param len="regionCount">const <type>VkImageBlit</type>* <name>pRegions</name></param>
+ <param><type>VkFilter</type> <name>filter</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdCopyBufferToImage</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>srcBuffer</name></param>
+ <param><type>VkImage</type> <name>dstImage</name></param>
+ <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+ <param><type>uint32_t</type> <name>regionCount</name></param>
+ <param len="regionCount">const <type>VkBufferImageCopy</type>* <name>pRegions</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdCopyImageToBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImage</type> <name>srcImage</name></param>
+ <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+ <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+ <param><type>uint32_t</type> <name>regionCount</name></param>
+ <param len="regionCount">const <type>VkBufferImageCopy</type>* <name>pRegions</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdUpdateBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+ <param><type>VkDeviceSize</type> <name>dataSize</name></param>
+ <param len="dataSize">const <type>void</type>* <name>pData</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer" comment="transfer support is only available when VK_KHR_maintenance1 is enabled, as documented in valid usage language in the specification">
+ <proto><type>void</type> <name>vkCmdFillBuffer</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+ <param><type>VkDeviceSize</type> <name>size</name></param>
+ <param><type>uint32_t</type> <name>data</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdClearColorImage</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+ <param>const <type>VkClearColorValue</type>* <name>pColor</name></param>
+ <param><type>uint32_t</type> <name>rangeCount</name></param>
+ <param len="rangeCount">const <type>VkImageSubresourceRange</type>* <name>pRanges</name></param>
+ </command>
+ <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdClearDepthStencilImage</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+ <param>const <type>VkClearDepthStencilValue</type>* <name>pDepthStencil</name></param>
+ <param><type>uint32_t</type> <name>rangeCount</name></param>
+ <param len="rangeCount">const <type>VkImageSubresourceRange</type>* <name>pRanges</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdClearAttachments</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>attachmentCount</name></param>
+ <param len="attachmentCount">const <type>VkClearAttachment</type>* <name>pAttachments</name></param>
+ <param><type>uint32_t</type> <name>rectCount</name></param>
+ <param len="rectCount">const <type>VkClearRect</type>* <name>pRects</name></param>
+ </command>
+ <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdResolveImage</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkImage</type> <name>srcImage</name></param>
+ <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+ <param><type>VkImage</type> <name>dstImage</name></param>
+ <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+ <param><type>uint32_t</type> <name>regionCount</name></param>
+ <param len="regionCount">const <type>VkImageResolve</type>* <name>pRegions</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdSetEvent</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkEvent</type> <name>event</name></param>
+ <param><type>VkPipelineStageFlags</type> <name>stageMask</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdResetEvent</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkEvent</type> <name>event</name></param>
+ <param><type>VkPipelineStageFlags</type> <name>stageMask</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdWaitEvents</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>eventCount</name></param>
+ <param len="eventCount">const <type>VkEvent</type>* <name>pEvents</name></param>
+ <param><type>VkPipelineStageFlags</type> <name>srcStageMask</name></param>
+ <param><type>VkPipelineStageFlags</type> <name>dstStageMask</name></param>
+ <param optional="true"><type>uint32_t</type> <name>memoryBarrierCount</name></param>
+ <param len="memoryBarrierCount">const <type>VkMemoryBarrier</type>* <name>pMemoryBarriers</name></param>
+ <param optional="true"><type>uint32_t</type> <name>bufferMemoryBarrierCount</name></param>
+ <param len="bufferMemoryBarrierCount">const <type>VkBufferMemoryBarrier</type>* <name>pBufferMemoryBarriers</name></param>
+ <param optional="true"><type>uint32_t</type> <name>imageMemoryBarrierCount</name></param>
+ <param len="imageMemoryBarrierCount">const <type>VkImageMemoryBarrier</type>* <name>pImageMemoryBarriers</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdPipelineBarrier</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkPipelineStageFlags</type> <name>srcStageMask</name></param>
+ <param><type>VkPipelineStageFlags</type> <name>dstStageMask</name></param>
+ <param optional="true"><type>VkDependencyFlags</type> <name>dependencyFlags</name></param>
+ <param optional="true"><type>uint32_t</type> <name>memoryBarrierCount</name></param>
+ <param len="memoryBarrierCount">const <type>VkMemoryBarrier</type>* <name>pMemoryBarriers</name></param>
+ <param optional="true"><type>uint32_t</type> <name>bufferMemoryBarrierCount</name></param>
+ <param len="bufferMemoryBarrierCount">const <type>VkBufferMemoryBarrier</type>* <name>pBufferMemoryBarriers</name></param>
+ <param optional="true"><type>uint32_t</type> <name>imageMemoryBarrierCount</name></param>
+ <param len="imageMemoryBarrierCount">const <type>VkImageMemoryBarrier</type>* <name>pImageMemoryBarriers</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdBeginQuery</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>query</name></param>
+ <param optional="true"><type>VkQueryControlFlags</type> <name>flags</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdEndQuery</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>query</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdResetQueryPool</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>firstQuery</name></param>
+ <param><type>uint32_t</type> <name>queryCount</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdWriteTimestamp</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkPipelineStageFlagBits</type> <name>pipelineStage</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>query</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="transfer">
+ <proto><type>void</type> <name>vkCmdCopyQueryPoolResults</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkQueryPool</type> <name>queryPool</name></param>
+ <param><type>uint32_t</type> <name>firstQuery</name></param>
+ <param><type>uint32_t</type> <name>queryCount</name></param>
+ <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+ <param><type>VkDeviceSize</type> <name>stride</name></param>
+ <param optional="true"><type>VkQueryResultFlags</type> <name>flags</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdPushConstants</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkPipelineLayout</type> <name>layout</name></param>
+ <param><type>VkShaderStageFlags</type> <name>stageFlags</name></param>
+ <param><type>uint32_t</type> <name>offset</name></param>
+ <param><type>uint32_t</type> <name>size</name></param>
+ <param len="size">const <type>void</type>* <name>pValues</name></param>
+ </command>
+ <command queues="graphics" renderpass="outside" cmdbufferlevel="primary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdBeginRenderPass</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param>const <type>VkRenderPassBeginInfo</type>* <name>pRenderPassBegin</name></param>
+ <param><type>VkSubpassContents</type> <name>contents</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdNextSubpass</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkSubpassContents</type> <name>contents</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdEndRenderPass</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ </command>
+ <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary">
+ <proto><type>void</type> <name>vkCmdExecuteCommands</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>uint32_t</type> <name>commandBufferCount</name></param>
+ <param len="commandBufferCount">const <type>VkCommandBuffer</type>* <name>pCommandBuffers</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+ <proto><type>VkResult</type> <name>vkCreateAndroidSurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkAndroidSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceDisplayPropertiesKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkDisplayPropertiesKHR</type>* <name>pProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceDisplayPlanePropertiesKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkDisplayPlanePropertiesKHR</type>* <name>pProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetDisplayPlaneSupportedDisplaysKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>planeIndex</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pDisplayCount</name></param>
+ <param optional="true" len="pDisplayCount"><type>VkDisplayKHR</type>* <name>pDisplays</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetDisplayModePropertiesKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkDisplayKHR</type> <name>display</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkDisplayModePropertiesKHR</type>* <name>pProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+ <proto><type>VkResult</type> <name>vkCreateDisplayModeKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param externsync="true"><type>VkDisplayKHR</type> <name>display</name></param>
+ <param>const <type>VkDisplayModeCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkDisplayModeKHR</type>* <name>pMode</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetDisplayPlaneCapabilitiesKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param externsync="true"><type>VkDisplayModeKHR</type> <name>mode</name></param>
+ <param><type>uint32_t</type> <name>planeIndex</name></param>
+ <param><type>VkDisplayPlaneCapabilitiesKHR</type>* <name>pCapabilities</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateDisplayPlaneSurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkDisplaySurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INCOMPATIBLE_DISPLAY_KHR,VK_ERROR_DEVICE_LOST,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkCreateSharedSwapchainsKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint32_t</type> <name>swapchainCount</name></param>
+ <param len="swapchainCount" externsync="pCreateInfos[].surface,pCreateInfos[].oldSwapchain">const <type>VkSwapchainCreateInfoKHR</type>* <name>pCreateInfos</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param len="swapchainCount"><type>VkSwapchainKHR</type>* <name>pSwapchains</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateMirSurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkMirSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command>
+ <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceMirPresentationSupportKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ <param><type>MirConnection</type>* <name>connection</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroySurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param optional="true" externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceSupportKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+ <param><type>VkBool32</type>* <name>pSupported</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceCapabilitiesKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+ <param><type>VkSurfaceCapabilitiesKHR</type>* <name>pSurfaceCapabilities</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceFormatsKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pSurfaceFormatCount</name></param>
+ <param optional="true" len="pSurfaceFormatCount"><type>VkSurfaceFormatKHR</type>* <name>pSurfaceFormats</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfacePresentModesKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPresentModeCount</name></param>
+ <param optional="true" len="pPresentModeCount"><type>VkPresentModeKHR</type>* <name>pPresentModes</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_SURFACE_LOST_KHR,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+ <proto><type>VkResult</type> <name>vkCreateSwapchainKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="pCreateInfo.surface,pCreateInfo.oldSwapchain">const <type>VkSwapchainCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSwapchainKHR</type>* <name>pSwapchain</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroySwapchainKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param optional="true" externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetSwapchainImagesKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pSwapchainImageCount</name></param>
+ <param optional="true" len="pSwapchainImageCount"><type>VkImage</type>* <name>pSwapchainImages</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_TIMEOUT,VK_NOT_READY,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkAcquireNextImageKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+ <param><type>uint64_t</type> <name>timeout</name></param>
+ <param optional="true" externsync="true"><type>VkSemaphore</type> <name>semaphore</name></param>
+ <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+ <param><type>uint32_t</type>* <name>pImageIndex</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkQueuePresentKHR</name></proto>
+ <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+ <param externsync="pPresentInfo.pWaitSemaphores[],pPresentInfo.pSwapchains[]">const <type>VkPresentInfoKHR</type>* <name>pPresentInfo</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+ <proto><type>VkResult</type> <name>vkCreateViSurfaceNN</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkViSurfaceCreateInfoNN</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateWaylandSurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkWaylandSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command>
+ <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceWaylandPresentationSupportKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ <param>struct <type>wl_display</type>* <name>display</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateWin32SurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkWin32SurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command>
+ <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceWin32PresentationSupportKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateXlibSurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkXlibSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command>
+ <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceXlibPresentationSupportKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ <param><type>Display</type>* <name>dpy</name></param>
+ <param><type>VisualID</type> <name>visualID</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateXcbSurfaceKHR</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkXcbSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+ </command>
+ <command>
+ <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceXcbPresentationSupportKHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+ <param><type>xcb_connection_t</type>* <name>connection</name></param>
+ <param><type>xcb_visualid_t</type> <name>visual_id</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateDebugReportCallbackEXT</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param>const <type>VkDebugReportCallbackCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkDebugReportCallbackEXT</type>* <name>pCallback</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyDebugReportCallbackEXT</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param externsync="true"><type>VkDebugReportCallbackEXT</type> <name>callback</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDebugReportMessageEXT</name></proto>
+ <param><type>VkInstance</type> <name>instance</name></param>
+ <param><type>VkDebugReportFlagsEXT</type> <name>flags</name></param>
+ <param><type>VkDebugReportObjectTypeEXT</type> <name>objectType</name></param>
+ <param><type>uint64_t</type> <name>object</name></param>
+ <param><type>size_t</type> <name>location</name></param>
+ <param><type>int32_t</type> <name>messageCode</name></param>
+ <param len="null-terminated">const <type>char</type>* <name>pLayerPrefix</name></param>
+ <param len="null-terminated">const <type>char</type>* <name>pMessage</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkDebugMarkerSetObjectNameEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="pNameInfo.object"><type>VkDebugMarkerObjectNameInfoEXT</type>* <name>pNameInfo</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkDebugMarkerSetObjectTagEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="pTagInfo.object"><type>VkDebugMarkerObjectTagInfoEXT</type>* <name>pTagInfo</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdDebugMarkerBeginEXT</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkDebugMarkerMarkerInfoEXT</type>* <name>pMarkerInfo</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdDebugMarkerEndEXT</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdDebugMarkerInsertEXT</name></proto>
+ <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkDebugMarkerMarkerInfoEXT</type>* <name>pMarkerInfo</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceExternalImageFormatPropertiesNV</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkFormat</type> <name>format</name></param>
+ <param><type>VkImageType</type> <name>type</name></param>
+ <param><type>VkImageTiling</type> <name>tiling</name></param>
+ <param><type>VkImageUsageFlags</type> <name>usage</name></param>
+ <param optional="true"><type>VkImageCreateFlags</type> <name>flags</name></param>
+ <param optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>externalHandleType</name></param>
+ <param><type>VkExternalImageFormatPropertiesNV</type>* <name>pExternalImageFormatProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetMemoryWin32HandleNV</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleType</name></param>
+ <param><type>HANDLE</type>* <name>pHandle</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawIndirectCountAMD</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>VkBuffer</type> <name>countBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
+ <param><type>uint32_t</type> <name>maxDrawCount</name></param>
+ <param><type>uint32_t</type> <name>stride</name></param>
+ </command>
+ <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
+ <proto><type>void</type> <name>vkCmdDrawIndexedIndirectCountAMD</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkBuffer</type> <name>buffer</name></param>
+ <param><type>VkDeviceSize</type> <name>offset</name></param>
+ <param><type>VkBuffer</type> <name>countBuffer</name></param>
+ <param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
+ <param><type>uint32_t</type> <name>maxDrawCount</name></param>
+ <param><type>uint32_t</type> <name>stride</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="inside" cmdbufferlevel="primary,secondary">
+ <proto><type>void</type> <name>vkCmdProcessCommandsNVX</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param>const <type>VkCmdProcessCommandsInfoNVX</type>* <name>pProcessCommandsInfo</name></param>
+ </command>
+ <command queues="graphics,compute" renderpass="inside" cmdbufferlevel="secondary">
+ <proto><type>void</type> <name>vkCmdReserveSpaceForCommandsNVX</name></proto>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param>const <type>VkCmdReserveSpaceForCommandsInfoNVX</type>* <name>pReserveSpaceInfo</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateIndirectCommandsLayoutNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkIndirectCommandsLayoutCreateInfoNVX</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkIndirectCommandsLayoutNVX</type>* <name>pIndirectCommandsLayout</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyIndirectCommandsLayoutNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkIndirectCommandsLayoutNVX</type> <name>indirectCommandsLayout</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkCreateObjectTableNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkObjectTableCreateInfoNVX</type>* <name>pCreateInfo</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkObjectTableNVX</type>* <name>pObjectTable</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkDestroyObjectTableNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkObjectTableNVX</type> <name>objectTable</name></param>
+ <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkRegisterObjectsNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkObjectTableNVX</type> <name>objectTable</name></param>
+ <param><type>uint32_t</type> <name>objectCount</name></param>
+ <param len="objectCount">const <type>VkObjectTableEntryNVX</type>* const* <name>ppObjectTableEntries</name></param>
+ <param len="objectCount">const <type>uint32_t</type>* <name>pObjectIndices</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+ <proto><type>VkResult</type> <name>vkUnregisterObjectsNVX</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkObjectTableNVX</type> <name>objectTable</name></param>
+ <param><type>uint32_t</type> <name>objectCount</name></param>
+ <param len="objectCount">const <type>VkObjectEntryTypeNVX</type>* <name>pObjectEntryTypes</name></param>
+ <param len="objectCount">const <type>uint32_t</type>* <name>pObjectIndices</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkDeviceGeneratedCommandsFeaturesNVX</type>* <name>pFeatures</name></param>
+ <param><type>VkDeviceGeneratedCommandsLimitsNVX</type>* <name>pLimits</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceFeatures2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkPhysicalDeviceFeatures2KHR</type>* <name>pFeatures</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceProperties2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkPhysicalDeviceProperties2KHR</type>* <name>pProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceFormatProperties2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkFormat</type> <name>format</name></param>
+ <param><type>VkFormatProperties2KHR</type>* <name>pFormatProperties</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceImageFormatProperties2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param>const <type>VkPhysicalDeviceImageFormatInfo2KHR</type>* <name>pImageFormatInfo</name></param>
+ <param><type>VkImageFormatProperties2KHR</type>* <name>pImageFormatProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceQueueFamilyProperties2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pQueueFamilyPropertyCount</name></param>
+ <param optional="true" len="pQueueFamilyPropertyCount"><type>VkQueueFamilyProperties2KHR</type>* <name>pQueueFamilyProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceMemoryProperties2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkPhysicalDeviceMemoryProperties2KHR</type>* <name>pMemoryProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkGetPhysicalDeviceSparseImageFormatProperties2KHR</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param>const <type>VkPhysicalDeviceSparseImageFormatInfo2KHR</type>* <name>pFormatInfo</name></param>
+ <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+ <param optional="true" len="pPropertyCount"><type>VkSparseImageFormatProperties2KHR</type>* <name>pProperties</name></param>
+ </command>
+ <command>
+ <proto><type>void</type> <name>vkTrimCommandPoolKHR</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+ <param optional="true"><type>VkCommandPoolTrimFlagsKHR</type> <name>flags</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkReleaseDisplayEXT</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkDisplayKHR</type> <name>display</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkAcquireXlibDisplayEXT</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>Display</type>* <name>dpy</name></param>
+ <param><type>VkDisplayKHR</type> <name>display</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkGetRandROutputDisplayEXT</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>Display</type>* <name>dpy</name></param>
+ <param><type>RROutput</type> <name>rrOutput</name></param>
+ <param><type>VkDisplayKHR</type>* <name>pDisplay</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkDisplayPowerControlEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkDisplayKHR</type> <name>display</name></param>
+ <param>const <type>VkDisplayPowerInfoEXT</type>* <name>pDisplayPowerInfo</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkRegisterDeviceEventEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkDeviceEventInfoEXT</type>* <name>pDeviceEventInfo</name></param>
+ <param>const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkFence</type>* <name>pFence</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkRegisterDisplayEventEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkDisplayKHR</type> <name>display</name></param>
+ <param>const <type>VkDisplayEventInfoEXT</type>* <name>pDisplayEventInfo</name></param>
+ <param>const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+ <param><type>VkFence</type>* <name>pFence</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR">
+ <proto><type>VkResult</type> <name>vkGetSwapchainCounterEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+ <param><type>VkSurfaceCounterFlagBitsEXT</type> <name>counter</name></param>
+ <param><type>uint64_t</type>* <name>pCounterValue</name></param>
+ </command>
+ <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+ <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceCapabilities2EXT</name></proto>
+ <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+ <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+ <param><type>VkSurfaceCapabilities2EXT</type>* <name>pSurfaceCapabilities</name></param>
+ </command>
+ </commands>
+
+ <!-- SECTION: Vulkan API interface definitions -->
+ <feature api="vulkan" name="VK_VERSION_1_0" number="1.0">
+ <require comment="Header boilerplate">
+ <type name="vk_platform"/>
+ </require>
+ <require comment="API version">
+ <type name="VK_API_VERSION"/>
+ <type name="VK_API_VERSION_1_0"/>
+ <type name="VK_VERSION_MAJOR"/>
+ <type name="VK_VERSION_MINOR"/>
+ <type name="VK_VERSION_PATCH"/>
+ <type name="VK_HEADER_VERSION"/>
+ </require>
+ <require comment="API constants">
+ <enum name="VK_LOD_CLAMP_NONE"/>
+ <enum name="VK_REMAINING_MIP_LEVELS"/>
+ <enum name="VK_REMAINING_ARRAY_LAYERS"/>
+ <enum name="VK_WHOLE_SIZE"/>
+ <enum name="VK_ATTACHMENT_UNUSED"/>
+ <enum name="VK_TRUE"/>
+ <enum name="VK_FALSE"/>
+ <type name="VK_NULL_HANDLE"/>
+ <enum name="VK_QUEUE_FAMILY_IGNORED"/>
+ <enum name="VK_SUBPASS_EXTERNAL"/>
+ <type name="VkPipelineCacheHeaderVersion"/>
+ </require>
+ <require comment="Device initialization">
+ <command name="vkCreateInstance"/>
+ <command name="vkDestroyInstance"/>
+ <command name="vkEnumeratePhysicalDevices"/>
+ <command name="vkGetPhysicalDeviceFeatures"/>
+ <command name="vkGetPhysicalDeviceFormatProperties"/>
+ <command name="vkGetPhysicalDeviceImageFormatProperties"/>
+ <command name="vkGetPhysicalDeviceProperties"/>
+ <command name="vkGetPhysicalDeviceQueueFamilyProperties"/>
+ <command name="vkGetPhysicalDeviceMemoryProperties"/>
+ <command name="vkGetInstanceProcAddr"/>
+ <command name="vkGetDeviceProcAddr"/>
+ </require>
+ <require comment="Device commands">
+ <command name="vkCreateDevice"/>
+ <command name="vkDestroyDevice"/>
+ </require>
+ <require comment="Extension discovery commands">
+ <command name="vkEnumerateInstanceExtensionProperties"/>
+ <command name="vkEnumerateDeviceExtensionProperties"/>
+ </require>
+ <require comment="Layer discovery commands">
+ <command name="vkEnumerateInstanceLayerProperties"/>
+ <command name="vkEnumerateDeviceLayerProperties"/>
+ </require>
+ <require comment="queue commands">
+ <command name="vkGetDeviceQueue"/>
+ <command name="vkQueueSubmit"/>
+ <command name="vkQueueWaitIdle"/>
+ <command name="vkDeviceWaitIdle"/>
+ </require>
+ <require comment="Memory commands">
+ <command name="vkAllocateMemory"/>
+ <command name="vkFreeMemory"/>
+ <command name="vkMapMemory"/>
+ <command name="vkUnmapMemory"/>
+ <command name="vkFlushMappedMemoryRanges"/>
+ <command name="vkInvalidateMappedMemoryRanges"/>
+ <command name="vkGetDeviceMemoryCommitment"/>
+ </require>
+ <require comment="Memory management API commands">
+ <command name="vkBindBufferMemory"/>
+ <command name="vkBindImageMemory"/>
+ <command name="vkGetBufferMemoryRequirements"/>
+ <command name="vkGetImageMemoryRequirements"/>
+ </require>
+ <require comment="Sparse resource memory management API commands">
+ <command name="vkGetImageSparseMemoryRequirements"/>
+ <command name="vkGetPhysicalDeviceSparseImageFormatProperties"/>
+ <command name="vkQueueBindSparse"/>
+ </require>
+ <require comment="Fence commands">
+ <command name="vkCreateFence"/>
+ <command name="vkDestroyFence"/>
+ <command name="vkResetFences"/>
+ <command name="vkGetFenceStatus"/>
+ <command name="vkWaitForFences"/>
+ </require>
+ <require comment="Queue semaphore commands">
+ <command name="vkCreateSemaphore"/>
+ <command name="vkDestroySemaphore"/>
+ </require>
+ <require comment="Event commands">
+ <command name="vkCreateEvent"/>
+ <command name="vkDestroyEvent"/>
+ <command name="vkGetEventStatus"/>
+ <command name="vkSetEvent"/>
+ <command name="vkResetEvent"/>
+ </require>
+ <require comment="Query commands">
+ <command name="vkCreateQueryPool"/>
+ <command name="vkDestroyQueryPool"/>
+ <command name="vkGetQueryPoolResults"/>
+ </require>
+ <require comment="Buffer commands">
+ <command name="vkCreateBuffer"/>
+ <command name="vkDestroyBuffer"/>
+ </require>
+ <require comment="Buffer view commands">
+ <command name="vkCreateBufferView"/>
+ <command name="vkDestroyBufferView"/>
+ </require>
+ <require comment="Image commands">
+ <command name="vkCreateImage"/>
+ <command name="vkDestroyImage"/>
+ <command name="vkGetImageSubresourceLayout"/>
+ </require>
+ <require comment="Image view commands">
+ <command name="vkCreateImageView"/>
+ <command name="vkDestroyImageView"/>
+ </require>
+ <require comment="Shader commands">
+ <command name="vkCreateShaderModule"/>
+ <command name="vkDestroyShaderModule"/>
+ </require>
+ <require comment="Pipeline Cache commands">
+ <command name="vkCreatePipelineCache"/>
+ <command name="vkDestroyPipelineCache"/>
+ <command name="vkGetPipelineCacheData"/>
+ <command name="vkMergePipelineCaches"/>
+ </require>
+ <require comment="Pipeline commands">
+ <command name="vkCreateGraphicsPipelines"/>
+ <command name="vkCreateComputePipelines"/>
+ <command name="vkDestroyPipeline"/>
+ </require>
+ <require comment="Pipeline layout commands">
+ <command name="vkCreatePipelineLayout"/>
+ <command name="vkDestroyPipelineLayout"/>
+ </require>
+ <require comment="Sampler commands">
+ <command name="vkCreateSampler"/>
+ <command name="vkDestroySampler"/>
+ </require>
+ <require comment="Descriptor set commands">
+ <command name="vkCreateDescriptorSetLayout"/>
+ <command name="vkDestroyDescriptorSetLayout"/>
+ <command name="vkCreateDescriptorPool"/>
+ <command name="vkDestroyDescriptorPool"/>
+ <command name="vkResetDescriptorPool"/>
+ <command name="vkAllocateDescriptorSets"/>
+ <command name="vkFreeDescriptorSets"/>
+ <command name="vkUpdateDescriptorSets"/>
+ </require>
+ <require comment="Pass commands">
+ <command name="vkCreateFramebuffer"/>
+ <command name="vkDestroyFramebuffer"/>
+ <command name="vkCreateRenderPass"/>
+ <command name="vkDestroyRenderPass"/>
+ <command name="vkGetRenderAreaGranularity"/>
+ </require>
+ <require comment="Command pool commands">
+ <command name="vkCreateCommandPool"/>
+ <command name="vkDestroyCommandPool"/>
+ <command name="vkResetCommandPool"/>
+ </require>
+ <require comment="Command buffer commands">
+ <command name="vkAllocateCommandBuffers"/>
+ <command name="vkFreeCommandBuffers"/>
+ <command name="vkBeginCommandBuffer"/>
+ <command name="vkEndCommandBuffer"/>
+ <command name="vkResetCommandBuffer"/>
+ </require>
+ <require comment="Command buffer building commands">
+ <command name="vkCmdBindPipeline"/>
+ <command name="vkCmdSetViewport"/>
+ <command name="vkCmdSetScissor"/>
+ <command name="vkCmdSetLineWidth"/>
+ <command name="vkCmdSetDepthBias"/>
+ <command name="vkCmdSetBlendConstants"/>
+ <command name="vkCmdSetDepthBounds"/>
+ <command name="vkCmdSetStencilCompareMask"/>
+ <command name="vkCmdSetStencilWriteMask"/>
+ <command name="vkCmdSetStencilReference"/>
+ <command name="vkCmdBindDescriptorSets"/>
+ <command name="vkCmdBindIndexBuffer"/>
+ <command name="vkCmdBindVertexBuffers"/>
+ <command name="vkCmdDraw"/>
+ <command name="vkCmdDrawIndexed"/>
+ <command name="vkCmdDrawIndirect"/>
+ <command name="vkCmdDrawIndexedIndirect"/>
+ <command name="vkCmdDispatch"/>
+ <command name="vkCmdDispatchIndirect"/>
+ <command name="vkCmdCopyBuffer"/>
+ <command name="vkCmdCopyImage"/>
+ <command name="vkCmdBlitImage"/>
+ <command name="vkCmdCopyBufferToImage"/>
+ <command name="vkCmdCopyImageToBuffer"/>
+ <command name="vkCmdUpdateBuffer"/>
+ <command name="vkCmdFillBuffer"/>
+ <command name="vkCmdClearColorImage"/>
+ <command name="vkCmdClearDepthStencilImage"/>
+ <command name="vkCmdClearAttachments"/>
+ <command name="vkCmdResolveImage"/>
+ <command name="vkCmdSetEvent"/>
+ <command name="vkCmdResetEvent"/>
+ <command name="vkCmdWaitEvents"/>
+ <command name="vkCmdPipelineBarrier"/>
+ <command name="vkCmdBeginQuery"/>
+ <command name="vkCmdEndQuery"/>
+ <command name="vkCmdResetQueryPool"/>
+ <command name="vkCmdWriteTimestamp"/>
+ <command name="vkCmdCopyQueryPoolResults"/>
+ <command name="vkCmdPushConstants"/>
+ <command name="vkCmdBeginRenderPass"/>
+ <command name="vkCmdNextSubpass"/>
+ <command name="vkCmdEndRenderPass"/>
+ <command name="vkCmdExecuteCommands"/>
+ </require>
+ <require comment="Types not directly used by the API">
+ <!-- Include <type name="typename"/> here for e.g. structs that
+ are not parameter types of commands, but still need to be
+ defined in the API.
+ -->
+ <type name="VkBufferMemoryBarrier"/>
+ <type name="VkDispatchIndirectCommand"/>
+ <type name="VkDrawIndexedIndirectCommand"/>
+ <type name="VkDrawIndirectCommand"/>
+ <type name="VkImageMemoryBarrier"/>
+ <type name="VkMemoryBarrier"/>
+ </require>
+ </feature>
+
+ <!-- SECTION: Vulkan extension interface definitions -->
+ <extensions>
+ <!-- WSI extensions -->
+ <extension name="VK_KHR_surface" number="1" type="instance" supported="vulkan">
+ <require>
+ <enum value="25" name="VK_KHR_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_surface&quot;" name="VK_KHR_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" dir="-" extends="VkResult" name="VK_ERROR_SURFACE_LOST_KHR"/>
+ <enum offset="1" dir="-" extends="VkResult" name="VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"/>
+ <enum value="VK_COLOR_SPACE_SRGB_NONLINEAR_KHR" name="VK_COLORSPACE_SRGB_NONLINEAR_KHR"/>
+ <command name="vkDestroySurfaceKHR"/>
+ <command name="vkGetPhysicalDeviceSurfaceSupportKHR"/>
+ <command name="vkGetPhysicalDeviceSurfaceCapabilitiesKHR"/>
+ <command name="vkGetPhysicalDeviceSurfaceFormatsKHR"/>
+ <command name="vkGetPhysicalDeviceSurfacePresentModesKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_swapchain" number="2" type="device" requires="VK_KHR_surface" supported="vulkan">
+ <require>
+ <enum value="68" name="VK_KHR_SWAPCHAIN_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_swapchain&quot;" name="VK_KHR_SWAPCHAIN_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PRESENT_INFO_KHR"/>
+ <enum offset="2" extends="VkImageLayout" name="VK_IMAGE_LAYOUT_PRESENT_SRC_KHR"/>
+ <enum offset="3" extends="VkResult" name="VK_SUBOPTIMAL_KHR"/>
+ <enum offset="4" dir="-" extends="VkResult" name="VK_ERROR_OUT_OF_DATE_KHR"/>
+ <command name="vkCreateSwapchainKHR"/>
+ <command name="vkDestroySwapchainKHR"/>
+ <command name="vkGetSwapchainImagesKHR"/>
+ <command name="vkAcquireNextImageKHR"/>
+ <command name="vkQueuePresentKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_display" number="3" type="instance" requires="VK_KHR_surface" supported="vulkan">
+ <require>
+ <enum value="21" name="VK_KHR_DISPLAY_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_display&quot;" name="VK_KHR_DISPLAY_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkDisplayPlaneAlphaFlagsKHR"/>
+ <type name="VkDisplayPlaneAlphaFlagBitsKHR"/>
+ <type name="VkDisplayPropertiesKHR"/>
+ <type name="VkDisplayModeParametersKHR"/>
+ <type name="VkDisplayModePropertiesKHR"/>
+ <type name="VkDisplayModeCreateInfoKHR"/>
+ <type name="VkDisplayPlaneCapabilitiesKHR"/>
+ <type name="VkDisplayPlanePropertiesKHR"/>
+ <type name="VkDisplaySurfaceCreateInfoKHR"/>
+ <command name="vkGetPhysicalDeviceDisplayPropertiesKHR"/>
+ <command name="vkGetPhysicalDeviceDisplayPlanePropertiesKHR"/>
+ <command name="vkGetDisplayPlaneSupportedDisplaysKHR"/>
+ <command name="vkGetDisplayModePropertiesKHR"/>
+ <command name="vkCreateDisplayModeKHR"/>
+ <command name="vkGetDisplayPlaneCapabilitiesKHR"/>
+ <command name="vkCreateDisplayPlaneSurfaceKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_display_swapchain" number="4" type="device" requires="VK_KHR_swapchain,VK_KHR_display" supported="vulkan">
+ <require>
+ <enum value="9" name="VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_display_swapchain&quot;" name="VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR"/>
+ <enum offset="1" dir="-" extends="VkResult" name="VK_ERROR_INCOMPATIBLE_DISPLAY_KHR"/>
+ <type name="VkDisplayPresentInfoKHR"/>
+ <command name="vkCreateSharedSwapchainsKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_xlib_surface" number="5" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_XLIB_KHR" supported="vulkan">
+ <require>
+ <enum value="6" name="VK_KHR_XLIB_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_xlib_surface&quot;" name="VK_KHR_XLIB_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkXlibSurfaceCreateFlagsKHR"/>
+ <type name="VkXlibSurfaceCreateInfoKHR"/>
+ <command name="vkCreateXlibSurfaceKHR"/>
+ <command name="vkGetPhysicalDeviceXlibPresentationSupportKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_xcb_surface" number="6" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_XCB_KHR" supported="vulkan">
+ <require>
+ <enum value="6" name="VK_KHR_XCB_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_xcb_surface&quot;" name="VK_KHR_XCB_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkXcbSurfaceCreateFlagsKHR"/>
+ <type name="VkXcbSurfaceCreateInfoKHR"/>
+ <command name="vkCreateXcbSurfaceKHR"/>
+ <command name="vkGetPhysicalDeviceXcbPresentationSupportKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_wayland_surface" number="7" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_WAYLAND_KHR" supported="vulkan">
+ <require>
+ <enum value="5" name="VK_KHR_WAYLAND_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_wayland_surface&quot;" name="VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkWaylandSurfaceCreateFlagsKHR"/>
+ <type name="VkWaylandSurfaceCreateInfoKHR"/>
+ <command name="vkCreateWaylandSurfaceKHR"/>
+ <command name="vkGetPhysicalDeviceWaylandPresentationSupportKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_mir_surface" number="8" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_MIR_KHR" supported="vulkan">
+ <require>
+ <enum value="4" name="VK_KHR_MIR_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_mir_surface&quot;" name="VK_KHR_MIR_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkMirSurfaceCreateFlagsKHR"/>
+ <type name="VkMirSurfaceCreateInfoKHR"/>
+ <command name="vkCreateMirSurfaceKHR"/>
+ <command name="vkGetPhysicalDeviceMirPresentationSupportKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_android_surface" number="9" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_ANDROID_KHR" supported="vulkan">
+ <require>
+ <enum value="6" name="VK_KHR_ANDROID_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_android_surface&quot;" name="VK_KHR_ANDROID_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkAndroidSurfaceCreateFlagsKHR"/>
+ <type name="VkAndroidSurfaceCreateInfoKHR"/>
+ <command name="vkCreateAndroidSurfaceKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_win32_surface" number="10" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_WIN32_KHR" supported="vulkan">
+ <require>
+ <enum value="5" name="VK_KHR_WIN32_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_win32_surface&quot;" name="VK_KHR_WIN32_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR"/>
+ <type name="VkWin32SurfaceCreateFlagsKHR"/>
+ <type name="VkWin32SurfaceCreateInfoKHR"/>
+ <command name="vkCreateWin32SurfaceKHR"/>
+ <command name="vkGetPhysicalDeviceWin32PresentationSupportKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_ANDROID_native_buffer" number="11" supported="disabled">
+ <require>
+ <enum value="4" name="VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION"/>
+ <enum value="11" name="VK_ANDROID_NATIVE_BUFFER_NUMBER"/>
+ <enum value="&quot;VK_ANDROID_native_buffer&quot;" name="VK_ANDROID_NATIVE_BUFFER_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_debug_report" number="12" type="instance" author="Google, Inc." contact="Courtney Goeltzenleuchter @courtney" supported="vulkan">
+ <require>
+ <enum value="4" name="VK_EXT_DEBUG_REPORT_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_debug_report&quot;" name="VK_EXT_DEBUG_REPORT_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT"/>
+ <enum offset="1" dir="-" extends="VkResult" name="VK_ERROR_VALIDATION_FAILED_EXT"/>
+ <enum value="VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT" name="VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT"/>
+ <type name="VkDebugReportObjectTypeEXT"/>
+ <type name="VkDebugReportErrorEXT"/>
+ <command name="vkCreateDebugReportCallbackEXT"/>
+ <command name="vkDestroyDebugReportCallbackEXT"/>
+ <command name="vkDebugReportMessageEXT"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_glsl_shader" number="13" type="device" author="NVIDIA" contact="Piers Daniell @pdaniell" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NV_GLSL_SHADER_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_glsl_shader&quot;" name="VK_NV_GLSL_SHADER_EXTENSION_NAME"/>
+ <enum offset="0" dir="-" extends="VkResult" name="VK_ERROR_INVALID_SHADER_NV"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_1" number="14" author="NVIDIA" contact="Piers Daniell @pdaniell" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_1_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_1&quot;" name="VK_NV_EXTENSION_1_EXTENSION_NAME"/>
+ <enum offset="0" dir="-" extends="VkResult" name="VK_NV_EXTENSION_1_ERROR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_sampler_mirror_clamp_to_edge" type="device" number="15" author="KHR" contact="Tobias Hector @tobias" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_sampler_mirror_clamp_to_edge&quot;" name="VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME"/>
+ <enum value="4" extends="VkSamplerAddressMode" name="VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE" comment="Note that this defines what was previously a core enum, and so uses the 'value' attribute rather than 'offset', and does not have a suffix. This is a special case, and should not be repeated"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_filter_cubic" number="16" type="device" author="IMG" contact="Tobias Hector @tobias" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_IMG_FILTER_CUBIC_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_filter_cubic&quot;" name="VK_IMG_FILTER_CUBIC_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkFilter" name="VK_FILTER_CUBIC_IMG"/>
+ <enum bitpos="13" extends="VkFormatFeatureFlagBits" name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" comment="Format can be filtered with VK_FILTER_CUBIC_IMG when being sampled"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_17" number="17" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_17_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_17&quot;" name="VK_AMD_EXTENSION_17_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_18" number="18" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_18_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_18&quot;" name="VK_AMD_EXTENSION_18_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_rasterization_order" number="19" type="device" author="AMD" contact="Daniel Rakos @aqnuep" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_rasterization_order&quot;" name="VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD"/>
+ <type name="VkRasterizationOrderAMD"/>
+ <type name="VkPipelineRasterizationStateRasterizationOrderAMD"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_20" number="20" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_20_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_20&quot;" name="VK_AMD_EXTENSION_20_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_shader_trinary_minmax" number="21" type="device" author="AMD" contact="quentin.lin@amd.com" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_shader_trinary_minmax&quot;" name="VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_shader_explicit_vertex_parameter" number="22" type="device" author="AMD" contact="quentin.lin@amd.com" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_shader_explicit_vertex_parameter&quot;" name="VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_debug_marker" number="23" type="device" author="Baldur Karlsson" contact="baldurk@baldurk.org" supported="vulkan">
+ <require>
+ <enum value="3" name="VK_EXT_DEBUG_MARKER_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_debug_marker&quot;" name="VK_EXT_DEBUG_MARKER_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT"/>
+ <type name="VkDebugMarkerObjectNameInfoEXT"/>
+ <type name="VkDebugMarkerObjectTagInfoEXT"/>
+ <type name="VkDebugMarkerMarkerInfoEXT"/>
+ <command name="vkDebugMarkerSetObjectTagEXT"/>
+ <command name="vkDebugMarkerSetObjectNameEXT"/>
+ <command name="vkCmdDebugMarkerBeginEXT"/>
+ <command name="vkCmdDebugMarkerEndEXT"/>
+ <command name="vkCmdDebugMarkerInsertEXT"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_24" number="24" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_24_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_24&quot;" name="VK_AMD_EXTENSION_24_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_25" number="25" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_25_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_25&quot;" name="VK_AMD_EXTENSION_25_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_gcn_shader" number="26" type="device" author="AMD" contact="dominik.witczak@amd.com" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_GCN_SHADER_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_gcn_shader&quot;" name="VK_AMD_GCN_SHADER_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_dedicated_allocation" number="27" type="device" author="NVIDIA" contact="Jeff Bolz @jbolz" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_dedicated_allocation&quot;" name="VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV"/>
+ <type name="VkDedicatedAllocationImageCreateInfoNV"/>
+ <type name="VkDedicatedAllocationBufferCreateInfoNV"/>
+ <type name="VkDedicatedAllocationMemoryAllocateInfoNV"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_extension_28" number="28" author="NVIDIA" contact="Piers Daniell @pdaniell" supported="disabled">
+ <require>
+ <enum value="0" name="VK_EXT_EXTENSION_28_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_28&quot;" name="VK_EXT_EXTENSION_28_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_extension_29" number="29" author="NVIDIA" contact="Jeff Juliano @jjuliano" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NVX_EXTENSION_29_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_extension_29&quot;" name="VK_NVX_EXTENSION_29_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_extension_30" number="30" author="NVIDIA" contact="Jeff Juliano @jjuliano" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NVX_EXTENSION_30_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_extension_30&quot;" name="VK_NVX_EXTENSION_30_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_extension_31" number="31" author="NVIDIA" contact="Jeff Juliano @jjuliano" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NVX_EXTENSION_31_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_extension_31&quot;" name="VK_NVX_EXTENSION_31_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_32" number="32" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_32_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_32&quot;" name="VK_AMD_EXTENSION_32_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_33" number="33" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_33_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_33&quot;" name="VK_AMD_EXTENSION_33_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_draw_indirect_count" number="34" type="device" author="AMD" contact="Daniel Rakos @aqnuep" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_draw_indirect_count&quot;" name="VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME"/>
+ <command name="vkCmdDrawIndirectCountAMD"/>
+ <command name="vkCmdDrawIndexedIndirectCountAMD"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_35" number="35" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_35_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_35&quot;" name="VK_AMD_EXTENSION_35_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_negative_viewport_height" number="36" type="device" author="AMD" contact="Matthaeus G. Chajdas @anteru" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_negative_viewport_height&quot;" name="VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_gpu_shader_half_float" number="37" type="device" author="AMD" contact="Dominik Witczak @dominikwitczak_amd" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_gpu_shader_half_float&quot;" name="VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_shader_ballot" number="38" type="device" author="AMD" contact="Dominik Witczak @dominikwitczak_amd" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_AMD_SHADER_BALLOT_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_shader_ballot&quot;" name="VK_AMD_SHADER_BALLOT_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_39" number="39" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_39_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_39&quot;" name="VK_AMD_EXTENSION_39_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_40" number="40" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_40_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_40&quot;" name="VK_AMD_EXTENSION_40_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_41" number="41" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_41_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_41&quot;" name="VK_AMD_EXTENSION_41_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_42" number="42" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_42_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_42&quot;" name="VK_AMD_EXTENSION_42_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_43" number="43" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_43_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_43&quot;" name="VK_AMD_EXTENSION_43_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_44" number="44" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_44_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_44&quot;" name="VK_AMD_EXTENSION_44_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_45" number="45" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_45_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_45&quot;" name="VK_AMD_EXTENSION_45_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_46" number="46" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_46_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_46&quot;" name="VK_AMD_EXTENSION_46_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_AMD_extension_47" number="47" author="AMD" contact="Daniel Rakos @aqnuep" supported="disabled">
+ <require>
+ <enum value="0" name="VK_AMD_EXTENSION_47_SPEC_VERSION"/>
+ <enum value="&quot;VK_AMD_extension_47&quot;" name="VK_AMD_EXTENSION_47_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_extension_48" number="48" author="NVIDIA" contact="James Jones @cubanismo" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NVX_EXTENSION_48_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_extension_48&quot;" name="VK_NVX_EXTENSION_48_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_GOOGLE_extension_49" number="49" author="GOOGLE" contact="Jean-Francois Roy @jfroy" supported="disabled">
+ <require>
+ <enum value="0" name="VK_GOOGLE_EXTENSION_49_SPEC_VERSION"/>
+ <enum value="&quot;VK_GOOGLE_extension_49&quot;" name="VK_GOOGLE_EXTENSION_49_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_GOOGLE_extension_50" number="50" author="GOOGLE" contact="Jean-Francois Roy @jfroy" supported="disabled">
+ <require>
+ <enum value="0" name="VK_GOOGLE_EXTENSION_50_SPEC_VERSION"/>
+ <enum value="&quot;VK_GOOGLE_extension_50&quot;" name="VK_GOOGLE_EXTENSION_50_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_extension_51" number="51" author="NVIDIA" contact="James Jones @cubanismo" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NVX_EXTENSION_51_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_extension_51&quot;" name="VK_NVX_EXTENSION_51_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_extension_52" number="52" author="NVIDIA" contact="James Jones @cubanismo" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NVX_EXTENSION_52_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_extension_52&quot;" name="VK_NVX_EXTENSION_52_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_53" number="53" author="NVIDIA" contact="Jeff Bolz @jbolz" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_53_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_53&quot;" name="VK_NV_EXTENSION_53_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_54" number="54" author="NVIDIA" contact="Jeff Bolz @jbolz" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_54_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_54&quot;" name="VK_NV_EXTENSION_54_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_format_pvrtc" number="55" type="device" author="IMG" contact="Tobias Hector @tobias" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_IMG_FORMAT_PVRTC_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_format_pvrtc&quot;" name="VK_IMG_FORMAT_PVRTC_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkFormat" name="VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG"/>
+ <enum offset="1" extends="VkFormat" name="VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG"/>
+ <enum offset="2" extends="VkFormat" name="VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG"/>
+ <enum offset="3" extends="VkFormat" name="VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG"/>
+ <enum offset="4" extends="VkFormat" name="VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG"/>
+ <enum offset="5" extends="VkFormat" name="VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG"/>
+ <enum offset="6" extends="VkFormat" name="VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG"/>
+ <enum offset="7" extends="VkFormat" name="VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_external_memory_capabilities" number="56" type="instance" author="NVIDIA" contact="James jones @cubanismo" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_external_memory_capabilities&quot;" name="VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME"/>
+ <type name="VkExternalMemoryHandleTypeFlagsNV"/>
+ <type name="VkExternalMemoryHandleTypeFlagBitsNV"/>
+ <type name="VkExternalMemoryFeatureFlagsNV"/>
+ <type name="VkExternalMemoryFeatureFlagBitsNV"/>
+ <type name="VkExternalImageFormatPropertiesNV"/>
+ <command name="vkGetPhysicalDeviceExternalImageFormatPropertiesNV"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_external_memory" number="57" type="device" requires="VK_NV_external_memory_capabilities" author="NVIDIA" contact="James jones @cubanismo" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NV_EXTERNAL_MEMORY_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_external_memory&quot;" name="VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV"/>
+ <type name="VkExternalMemoryImageCreateInfoNV"/>
+ <type name="VkExportMemoryAllocateInfoNV"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_external_memory_win32" number="58" type="device" requires="VK_NV_external_memory_capabilities,VK_NV_external_memory" author="NVIDIA" contact="James jones @cubanismo" protect="VK_USE_PLATFORM_WIN32_KHR" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_external_memory_win32&quot;" name="VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV"/>
+ <type name="VkImportMemoryWin32HandleInfoNV"/>
+ <type name="VkExportMemoryWin32HandleInfoNV"/>
+ <command name="vkGetMemoryWin32HandleNV"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_win32_keyed_mutex" number="59" type="device" requires="VK_NV_external_memory_capabilities,VK_NV_external_memory_win32" author="NVIDIA" contact="Carsten Rohde" protect="VK_USE_PLATFORM_WIN32_KHR" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_win32_keyed_mutex&quot;" name="VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV"/>
+ <type name="VkWin32KeyedMutexAcquireReleaseInfoNV"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_get_physical_device_properties2" number="60" author="KHR" contact="Jeff Bolz @jbolz" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_get_physical_device_properties2&quot;" name="VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR"/>
+ <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR"/>
+ <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR"/>
+ <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR"/>
+ <enum offset="6" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR"/>
+ <enum offset="7" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR"/>
+ <enum offset="8" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR"/>
+ <type name="VkPhysicalDeviceFeatures2KHR"/>
+ <type name="VkPhysicalDeviceProperties2KHR"/>
+ <type name="VkFormatProperties2KHR"/>
+ <type name="VkImageFormatProperties2KHR"/>
+ <type name="VkPhysicalDeviceImageFormatInfo2KHR"/>
+ <type name="VkQueueFamilyProperties2KHR"/>
+ <type name="VkPhysicalDeviceMemoryProperties2KHR"/>
+ <type name="VkSparseImageFormatProperties2KHR"/>
+ <type name="VkPhysicalDeviceSparseImageFormatInfo2KHR"/>
+ <command name="vkGetPhysicalDeviceFeatures2KHR"/>
+ <command name="vkGetPhysicalDeviceProperties2KHR"/>
+ <command name="vkGetPhysicalDeviceFormatProperties2KHR"/>
+ <command name="vkGetPhysicalDeviceImageFormatProperties2KHR"/>
+ <command name="vkGetPhysicalDeviceQueueFamilyProperties2KHR"/>
+ <command name="vkGetPhysicalDeviceMemoryProperties2KHR"/>
+ <command name="vkGetPhysicalDeviceSparseImageFormatProperties2KHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_61" number="61" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_61_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_61&quot;" name="VK_KHR_EXTENSION_61_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_validation_flags" number="62" type="instance" author="Google, Inc." contact="Tobin Ehlis @tobine" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_VALIDATION_FLAGS_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_validation_flags&quot;" name="VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT"/>
+ <type name="VkValidationFlagsEXT"/>
+ </require>
+ </extension>
+ <extension name="VK_NN_vi_surface" number="63" author="NN" contact="Mathias Heyer @mheyer" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_VI_NN" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NN_VI_SURFACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_NN_vi_surface&quot;" name="VK_NN_VI_SURFACE_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN"/>
+ <type name="VkViSurfaceCreateFlagsNN"/>
+ <type name="VkViSurfaceCreateInfoNN"/>
+ <command name="vkCreateViSurfaceNN"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_shader_draw_parameters" number="64" type="device" author="KHR" contact="Daniel Koch @dgkoch" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_shader_draw_parameters&quot;" name="VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_shader_subgroup_ballot" number="65" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_shader_subgroup_ballot&quot;" name="VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_shader_subgroup_vote" number="66" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_shader_subgroup_vote&quot;" name="VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_ARM_extension_01" number="67" type="device" author="ARM" contact="Jan-Harald Fredriksen @janharald" supported="disabled">
+ <require>
+ <enum value="0" name="VK_ARM_EXTENSION_01_SPEC_VERSION"/>
+ <enum value="&quot;VK_ARM_extension_01&quot;" name="VK_ARM_EXTENSION_01_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_ARM_extension_02" number="68" type="device" author="ARM" contact="Jan-Harald Fredriksen @janharald" supported="disabled">
+ <require>
+ <enum value="0" name="VK_ARM_EXTENSION_02_SPEC_VERSION"/>
+ <enum value="&quot;VK_ARM_extension_02&quot;" name="VK_ARM_EXTENSION_02_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_extension_69" number="69" type="device" author="IMG" contact="Tobias Hector @tobias" supported="disabled">
+ <require>
+ <enum value="0" name="VK_IMG_EXTENSION_69_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_extension_69&quot;" name="VK_IMG_EXTENSION_69_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_maintenance1" number="70" author="KHR" contact="Piers Daniell @pdaniell" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_KHR_MAINTENANCE1_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_maintenance1&quot;" name="VK_KHR_MAINTENANCE1_EXTENSION_NAME"/>
+ <enum offset="0" dir="-" extends="VkResult" name="VK_ERROR_OUT_OF_POOL_MEMORY_KHR"/>
+ <enum bitpos="14" extends="VkFormatFeatureFlagBits" name="VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR" comment="Format can be used as the source image of image transfer commands"/>
+ <enum bitpos="15" extends="VkFormatFeatureFlagBits" name="VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR" comment="Format can be used as the destination image of image transfer commands"/>
+ <enum bitpos="5" extends="VkImageCreateFlagBits" name="VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR" comment="The 3D image can be viewed as a 2D or 2D array image"/>
+ <command name="vkTrimCommandPoolKHR"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_71" number="71" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_71_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_71&quot;" name="VK_KHR_EXTENSION_71_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_72" number="72" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_72_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_72&quot;" name="VK_KHR_EXTENSION_72_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_73" number="73" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_73_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_73&quot;" name="VK_KHR_EXTENSION_73_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_74" number="74" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_74_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_74&quot;" name="VK_KHR_EXTENSION_74_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_75" number="75" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_75_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_75&quot;" name="VK_KHR_EXTENSION_75_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_76" number="76" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_76_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_76&quot;" name="VK_KHR_EXTENSION_76_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_77" number="77" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_77_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_77&quot;" name="VK_KHR_EXTENSION_77_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_78" number="78" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_78_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_78&quot;" name="VK_KHR_EXTENSION_78_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_79" number="79" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_79_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_79&quot;" name="VK_KHR_EXTENSION_79_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_80" number="80" author="KHR" contact="James Jones @cubanismo" supported="disable">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_80_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_80&quot;" name="VK_KHR_EXTENSION_80_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_81" number="81" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_81_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_81&quot;" name="VK_KHR_EXTENSION_81_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_82" number="82" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_82_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_82&quot;" name="VK_KHR_EXTENSION_82_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_83" number="83" author="KHR" contact="Jan-Harald Fredriksen @janharald" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_83_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_83&quot;" name="VK_KHR_EXTENSION_83_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_84" number="84" author="KHR" contact="Jan-Harald Fredriksen @janharald" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_84_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_84&quot;" name="VK_KHR_EXTENSION_84_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_85" number="85" author="KHR" contact="Ian Elliott @ianelliott" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_85_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_85&quot;" name="VK_KHR_EXTENSION_85_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_86" number="86" author="KHR" contact="Markus Tavenrath @mtavenrath" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_86_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_86&quot;" name="VK_KHR_EXTENSION_86_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NVX_device_generated_commands" number="87" type="device" author="NVIDIA" contact="Christoph Kubisch @pixeljetstream" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION"/>
+ <enum value="&quot;VK_NVX_device_generated_commands&quot;" name="VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX"/>
+ <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX"/>
+ <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX"/>
+ <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX"/>
+ <enum bitpos="17" extends="VkPipelineStageFlagBits" name="VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX"/>
+ <enum bitpos="17" extends="VkAccessFlagBits" name="VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX"/>
+ <enum bitpos="18" extends="VkAccessFlagBits" name="VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX"/>
+ <type name="VkObjectTableNVX"/>
+ <type name="VkIndirectCommandsLayoutNVX"/>
+ <type name="VkIndirectCommandsLayoutUsageFlagsNVX"/>
+ <type name="VkObjectEntryUsageFlagsNVX"/>
+ <type name="VkIndirectCommandsLayoutUsageFlagBitsNVX"/>
+ <type name="VkIndirectCommandsTokenTypeNVX"/>
+ <type name="VkObjectEntryUsageFlagBitsNVX"/>
+ <type name="VkObjectEntryTypeNVX"/>
+ <type name="VkDeviceGeneratedCommandsFeaturesNVX"/>
+ <type name="VkDeviceGeneratedCommandsLimitsNVX"/>
+ <type name="VkIndirectCommandsTokenNVX"/>
+ <type name="VkIndirectCommandsLayoutTokenNVX"/>
+ <type name="VkIndirectCommandsLayoutCreateInfoNVX"/>
+ <type name="VkCmdProcessCommandsInfoNVX"/>
+ <type name="VkCmdReserveSpaceForCommandsInfoNVX"/>
+ <type name="VkObjectTableCreateInfoNVX"/>
+ <type name="VkObjectTableEntryNVX"/>
+ <type name="VkObjectTablePipelineEntryNVX"/>
+ <type name="VkObjectTableDescriptorSetEntryNVX"/>
+ <type name="VkObjectTableVertexBufferEntryNVX"/>
+ <type name="VkObjectTableIndexBufferEntryNVX"/>
+ <type name="VkObjectTablePushConstantEntryNVX"/>
+ <command name="vkCmdProcessCommandsNVX"/>
+ <command name="vkCmdReserveSpaceForCommandsNVX"/>
+ <command name="vkCreateIndirectCommandsLayoutNVX"/>
+ <command name="vkDestroyIndirectCommandsLayoutNVX"/>
+ <command name="vkCreateObjectTableNVX"/>
+ <command name="vkDestroyObjectTableNVX"/>
+ <command name="vkRegisterObjectsNVX"/>
+ <command name="vkUnregisterObjectsNVX"/>
+ <command name="vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_88" number="88" author="NV" contact="Eric Werness @ewerness" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_88_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_88&quot;" name="VK_KHR_EXTENSION_88_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_direct_mode_display" number="89" type="instance" requires="VK_KHR_display" author="NVIDIA" contact="James Jones @cubanismo" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_direct_mode_display&quot;" name="VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME"/>
+ <command name="vkReleaseDisplayEXT"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_acquire_xlib_display" number="90" type="instance" requires="VK_EXT_direct_mode_display,VK_KHR_display" author="NVIDIA" contact="James Jones @cubanismo" protect="VK_USE_PLATFORM_XLIB_XRANDR_EXT" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_acquire_xlib_display&quot;" name="VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME"/>
+ <command name="vkAcquireXlibDisplayEXT"/>
+ <command name="vkGetRandROutputDisplayEXT"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_display_surface_counter" number="91" type="instance" requires="VK_KHR_display" author="NVIDIA" contact="James Jones @cubanismo" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_display_surface_counter&quot;" name="VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT"/>
+ <type name="VkSurfaceCounterFlagsEXT"/>
+ <type name="VkSurfaceCounterFlagBitsEXT"/>
+ <type name="VkSurfaceCapabilities2EXT"/>
+ <command name="vkGetPhysicalDeviceSurfaceCapabilities2EXT"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_display_control" number="92" type="device" requires="VK_KHR_display,VK_EXT_display_surface_counter,VK_KHR_swapchain" author="NVIDIA" contact="James Jones @cubanismo" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_EXT_DISPLAY_CONTROL_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_display_control&quot;" name="VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT"/>
+ <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT"/>
+ <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT"/>
+ <type name="VkDisplayPowerStateEXT"/>
+ <type name="VkDeviceEventTypeEXT"/>
+ <type name="VkDisplayEventTypeEXT"/>
+ <type name="VkDisplayPowerInfoEXT"/>
+ <type name="VkDeviceEventInfoEXT"/>
+ <type name="VkDisplayEventInfoEXT"/>
+ <type name="VkSwapchainCounterCreateInfoEXT"/>
+ <command name="vkDisplayPowerControlEXT"/>
+ <command name="vkRegisterDeviceEventEXT"/>
+ <command name="vkRegisterDisplayEventEXT"/>
+ <command name="vkGetSwapchainCounterEXT"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_93" number="93" author="GOOGLE" contact="Ian Elliott @ianelliott" supported="disabled">
+ <require>
+ <enum value="0" name="VK_GOOGLE_EXTENSION_93_SPEC_VERSION"/>
+ <enum value="&quot;VK_GOOGLE_extension_93&quot;" name="VK_GOOGLE_EXTENSION_93_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_94" number="94" author="Codeplay" contact="Neil Henning @neil_henning" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_94_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_94&quot;" name="VK_KHR_EXTENSION_94_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_95" number="95" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_95_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_95&quot;" name="VK_NV_EXTENSION_95_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_96" number="96" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_96_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_96&quot;" name="VK_NV_EXTENSION_96_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_97" number="97" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_97_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_97&quot;" name="VK_NV_EXTENSION_97_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_98" number="98" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_98_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_98&quot;" name="VK_NV_EXTENSION_98_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_99" number="99" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_99_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_99&quot;" name="VK_NV_EXTENSION_99_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_100" number="100" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_100_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_100&quot;" name="VK_NV_EXTENSION_100_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_101" number="101" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_101_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_101&quot;" name="VK_NV_EXTENSION_101_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_102" number="102" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_102_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_102&quot;" name="VK_NV_EXTENSION_102_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_103" number="103" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_103_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_103&quot;" name="VK_NV_EXTENSION_103_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_NV_extension_104" number="104" author="NVIDIA" contact="Mathias Schott @mschott" supported="disabled">
+ <require>
+ <enum value="0" name="VK_NV_EXTENSION_104_SPEC_VERSION"/>
+ <enum value="&quot;VK_NV_extension_104&quot;" name="VK_NV_EXTENSION_104_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_swapchain_colorspace" number="105" author="GOOGLE" contact="Courtney Goeltzenleuchter @courtneygo" requires="VK_KHR_surface" supported="vulkan">
+ <require>
+ <enum value="1" name="VK_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_swapchain_colorspace&quot;" name="VK_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME"/>
+ <enum offset="1" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT"/>
+ <enum offset="2" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT"/>
+ <enum offset="3" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_SCRGB_LINEAR_EXT"/>
+ <enum offset="4" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT"/>
+ <enum offset="5" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_DCI_P3_LINEAR_EXT"/>
+ <enum offset="6" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT"/>
+ <enum offset="7" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_BT709_LINEAR_EXT"/>
+ <enum offset="8" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_BT709_NONLINEAR_EXT"/>
+ <enum offset="9" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_BT2020_LINEAR_EXT"/>
+ <enum offset="10" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_BT2020_NONLINEAR_EXT"/>
+ <enum offset="11" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT"/>
+ <enum offset="12" extends="VkColorSpaceKHR" name="VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT"/>
+ </require>
+ </extension>
+ <extension name="VK_EXT_extension_106" number="106" author="GOOGLE" contact="Courtney Goeltzenleuchter @courtneygo" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_106_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_extension_106&quot;" name="VK_KHR_EXTENSION_106_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_extension_107" number="107" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+ <require>
+ <enum value="0" name="VK_IMG_EXTENSION_107_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_extension_107&quot;" name="VK_IMG_EXTENSION_107_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_extension_108" number="108" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+ <require>
+ <enum value="0" name="VK_IMG_EXTENSION_108_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_extension_108&quot;" name="VK_IMG_EXTENSION_108_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_extension_109" number="109" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+ <require>
+ <enum value="0" name="VK_IMG_EXTENSION_109_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_extension_109&quot;" name="VK_IMG_EXTENSION_109_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_extension_110" number="110" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+ <require>
+ <enum value="0" name="VK_IMG_EXTENSION_110_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_extension_110&quot;" name="VK_IMG_EXTENSION_110_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_IMG_extension_111" number="111" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+ <require>
+ <enum value="0" name="VK_IMG_EXTENSION_111_SPEC_VERSION"/>
+ <enum value="&quot;VK_IMG_extension_111&quot;" name="VK_IMG_EXTENSION_111_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_112" number="112" author="KHR" contact="Alon Or-bach @alonorbach" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_112_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_112&quot;" name="VK_KHR_EXTENSION_112_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_113" number="113" author="KHX" contact="Cass Everitt @casseveritt" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_113_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_113&quot;" name="VK_KHR_EXTENSION_113_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_114" number="114" author="KHX" contact="Cass Everitt @casseveritt" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_114_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_114&quot;" name="VK_KHR_EXTENSION_114_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_115" number="115" author="KHX" contact="Cass Everitt @casseveritt" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_115_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_115&quot;" name="VK_KHR_EXTENSION_115_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_116" number="116" author="KHX" contact="Cass Everitt @casseveritt" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_116_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_116&quot;" name="VK_KHR_EXTENSION_116_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ <extension name="VK_KHR_extension_117" number="117" author="KHR" contact="Kenneth Benzie @kbenzie" supported="disabled">
+ <require>
+ <enum value="0" name="VK_KHR_EXTENSION_117_SPEC_VERSION"/>
+ <enum value="&quot;VK_KHR_extension_117&quot;" name="VK_KHR_EXTENSION_117_EXTENSION_NAME"/>
+ </require>
+ </extension>
+ </extensions>
+</registry>
diff --git a/src/gui/vulkan/vulkan.pri b/src/gui/vulkan/vulkan.pri
new file mode 100644
index 0000000000..9bd7391235
--- /dev/null
+++ b/src/gui/vulkan/vulkan.pri
@@ -0,0 +1,55 @@
+qtConfig(vulkan) {
+ CONFIG += generated_privates
+
+ HEADERS += \
+ vulkan/qvulkaninstance.h \
+ vulkan/qplatformvulkaninstance.h \
+ vulkan/qvulkanwindow.h \
+ vulkan/qvulkanwindow_p.h
+
+ SOURCES += \
+ vulkan/qvulkaninstance.cpp \
+ vulkan/qplatformvulkaninstance.cpp \
+ vulkan/qvulkanfunctions.cpp \
+ vulkan/qvulkanwindow.cpp
+
+ # Applications must inherit the Vulkan header include path.
+ 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
+
+# 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 5806262ac2..e8669dcec8 100644
--- a/src/network/access/access.pri
+++ b/src/network/access/access.pri
@@ -37,7 +37,8 @@ HEADERS += \
access/qnetworkfile_p.h \
access/qhttp2protocolhandler_p.h \
access/qhsts_p.h \
- access/qhstspolicy.h
+ access/qhstspolicy.h \
+ access/qhstsstore_p.h
SOURCES += \
access/qhttpnetworkheader.cpp \
@@ -69,7 +70,8 @@ SOURCES += \
access/qnetworkfile.cpp \
access/qhttp2protocolhandler.cpp \
access/qhsts.cpp \
- access/qhstspolicy.cpp
+ access/qhstspolicy.cpp \
+ access/qhstsstore.cpp
qtConfig(ftp) {
HEADERS += \
diff --git a/src/network/access/http2/http2frames.cpp b/src/network/access/http2/http2frames.cpp
index 5a684c2f41..e695b4dd9e 100644
--- a/src/network/access/http2/http2frames.cpp
+++ b/src/network/access/http2/http2frames.cpp
@@ -361,6 +361,12 @@ FrameWriter::FrameWriter(FrameType type, FrameFlags flags, quint32 streamID)
start(type, flags, streamID);
}
+void FrameWriter::setOutboundFrame(Frame &&newFrame)
+{
+ frame = std::move(newFrame);
+ updatePayloadSize();
+}
+
void FrameWriter::start(FrameType type, FrameFlags flags, quint32 streamID)
{
auto &buffer = frame.buffer;
diff --git a/src/network/access/http2/http2frames_p.h b/src/network/access/http2/http2frames_p.h
index e5f6d46c67..4bdc775806 100644
--- a/src/network/access/http2/http2frames_p.h
+++ b/src/network/access/http2/http2frames_p.h
@@ -129,6 +129,8 @@ public:
return frame;
}
+ void setOutboundFrame(Frame &&newFrame);
+
// Frame 'builders':
void start(FrameType type, FrameFlags flags, quint32 streamID);
void setPayloadSize(quint32 size);
diff --git a/src/network/access/http2/http2protocol.cpp b/src/network/access/http2/http2protocol.cpp
index 7f788a6f42..54811aeab0 100644
--- a/src/network/access/http2/http2protocol.cpp
+++ b/src/network/access/http2/http2protocol.cpp
@@ -37,9 +37,14 @@
**
****************************************************************************/
-#include <QtCore/qstring.h>
-
#include "http2protocol_p.h"
+#include "http2frames_p.h"
+
+#include "private/qhttpnetworkrequest_p.h"
+#include "private/qhttpnetworkreply_p.h"
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qstring.h>
QT_BEGIN_NAMESPACE
@@ -57,6 +62,38 @@ const char Http2clientPreface[clientPrefaceLength] =
0x2e, 0x30, 0x0d, 0x0a, 0x0d, 0x0a,
0x53, 0x4d, 0x0d, 0x0a, 0x0d, 0x0a};
+QByteArray default_SETTINGS_to_Base64()
+{
+ Frame frame(default_SETTINGS_frame());
+ // SETTINGS frame's payload consists of pairs:
+ // 2-byte-identifier | 4-byte-value == multiple of 6.
+ Q_ASSERT(frame.payloadSize() && !(frame.payloadSize() % 6));
+ const char *src = reinterpret_cast<const char *>(frame.dataBegin());
+ const QByteArray wrapper(QByteArray::fromRawData(src, int(frame.dataSize())));
+ // 3.2.1
+ // The content of the HTTP2-Settings header field is the payload
+ // of a SETTINGS frame (Section 6.5), encoded as a base64url string
+ // (that is, the URL- and filename-safe Base64 encoding described in
+ // Section 5 of [RFC4648], with any trailing '=' characters omitted).
+ return wrapper.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
+}
+
+void prepare_for_protocol_upgrade(QHttpNetworkRequest &request)
+{
+ // RFC 2616, 14.10
+ // RFC 7540, 3.2
+ QByteArray value(request.headerField("Connection"));
+ // We _append_ 'Upgrade':
+ if (value.size())
+ value += ", ";
+
+ value += "Upgrade, HTTP2-Settings";
+ request.setHeaderField("Connection", value);
+ // This we just (re)write.
+ request.setHeaderField("Upgrade", "h2c");
+ // This we just (re)write.
+ request.setHeaderField("HTTP2-Settings", default_SETTINGS_to_Base64());
+}
void qt_error(quint32 errorCode, QNetworkReply::NetworkError &error,
QString &errorMessage)
@@ -151,6 +188,40 @@ QNetworkReply::NetworkError qt_error(quint32 errorCode)
return error;
}
+bool is_PUSH_PROMISE_enabled()
+{
+ bool ok = false;
+ const int env = qEnvironmentVariableIntValue("QT_HTTP2_ENABLE_PUSH_PROMISE", &ok);
+ return ok && env;
+}
+
+bool is_protocol_upgraded(const QHttpNetworkReply &reply)
+{
+ if (reply.statusCode() == 101) {
+ // Do some minimal checks here - we expect 'Upgrade: h2c' to be found.
+ const auto &header = reply.header();
+ for (const QPair<QByteArray, QByteArray> &field : header) {
+ if (field.first.toLower() == "upgrade" && field.second.toLower() == "h2c")
+ return true;
+ }
+ }
+
+ return false;
}
+Frame default_SETTINGS_frame()
+{
+ // 6.5 SETTINGS
+ FrameWriter builder(FrameType::SETTINGS, FrameFlag::EMPTY, connectionStreamID);
+ // MAX frame size (16 kb), disable/enable PUSH_PROMISE
+ builder.append(Settings::MAX_FRAME_SIZE_ID);
+ builder.append(quint32(maxFrameSize));
+ builder.append(Settings::ENABLE_PUSH_ID);
+ builder.append(quint32(is_PUSH_PROMISE_enabled()));
+
+ return builder.outboundFrame();
+}
+
+} // namespace Http2
+
QT_END_NAMESPACE
diff --git a/src/network/access/http2/http2protocol_p.h b/src/network/access/http2/http2protocol_p.h
index 5d730404bb..b26ff0e9f4 100644
--- a/src/network/access/http2/http2protocol_p.h
+++ b/src/network/access/http2/http2protocol_p.h
@@ -59,6 +59,8 @@
QT_BEGIN_NAMESPACE
+class QHttpNetworkRequest;
+class QHttpNetworkReply;
class QString;
namespace Http2
@@ -132,6 +134,7 @@ enum Http2PredefinedParameters
const quint32 lastValidStreamID((quint32(1) << 31) - 1); // HTTP/2, 5.1.1
extern const Q_AUTOTEST_EXPORT char Http2clientPreface[clientPrefaceLength];
+void prepare_for_protocol_upgrade(QHttpNetworkRequest &request);
enum class FrameStatus
{
@@ -169,6 +172,9 @@ enum Http2Error
void qt_error(quint32 errorCode, QNetworkReply::NetworkError &error, QString &errorString);
QString qt_error_string(quint32 errorCode);
QNetworkReply::NetworkError qt_error(quint32 errorCode);
+bool is_PUSH_PROMISE_enabled();
+bool is_protocol_upgraded(const QHttpNetworkReply &reply);
+struct Frame default_SETTINGS_frame();
}
diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp
index ca9f3b977b..6a731afc2f 100644
--- a/src/network/access/qhsts.cpp
+++ b/src/network/access/qhsts.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include "qhstsstore_p.h"
#include "qhsts_p.h"
#include "QtCore/private/qipaddress_p.h"
@@ -80,14 +81,24 @@ void QHstsCache::updateFromHeaders(const QList<QPair<QByteArray, QByteArray>> &h
return;
QHstsHeaderParser parser;
- if (parser.parse(headers))
+ if (parser.parse(headers)) {
updateKnownHost(url.host(), parser.expirationDate(), parser.includeSubDomains());
+ if (hstsStore)
+ hstsStore->synchronize();
+ }
}
void QHstsCache::updateFromPolicies(const QVector<QHstsPolicy> &policies)
{
for (const auto &policy : policies)
updateKnownHost(policy.host(), policy.expiry(), policy.includesSubDomains());
+
+ if (hstsStore && policies.size()) {
+ // These policies are coming either from store or from QNAM's setter
+ // function. As a result we can notice expired or new policies, time
+ // to sync ...
+ hstsStore->synchronize();
+ }
}
void QHstsCache::updateKnownHost(const QUrl &url, const QDateTime &expires,
@@ -97,6 +108,8 @@ void QHstsCache::updateKnownHost(const QUrl &url, const QDateTime &expires,
return;
updateKnownHost(url.host(), expires, includeSubDomains);
+ if (hstsStore)
+ hstsStore->synchronize();
}
void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
@@ -124,13 +137,20 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
}
knownHosts.insert(pos, hostName, newPolicy);
+ if (hstsStore)
+ hstsStore->addToObserved(newPolicy);
return;
}
if (newPolicy.isExpired())
knownHosts.erase(pos);
- else
+ else if (*pos != newPolicy)
*pos = std::move(newPolicy);
+ else
+ return;
+
+ if (hstsStore)
+ hstsStore->addToObserved(newPolicy);
}
bool QHstsCache::isKnownHost(const QUrl &url) const
@@ -165,10 +185,15 @@ bool QHstsCache::isKnownHost(const QUrl &url) const
while (nameToTest.fragment.size()) {
auto const pos = knownHosts.find(nameToTest);
if (pos != knownHosts.end()) {
- if (pos.value().isExpired())
+ if (pos.value().isExpired()) {
knownHosts.erase(pos);
- else if (!superDomainMatch || pos.value().includesSubDomains())
+ if (hstsStore) {
+ // Inform our store that this policy has expired.
+ hstsStore->addToObserved(pos.value());
+ }
+ } else if (!superDomainMatch || pos.value().includesSubDomains()) {
return true;
+ }
}
const int dot = nameToTest.fragment.indexOf(QLatin1Char('.'));
@@ -196,6 +221,34 @@ QVector<QHstsPolicy> QHstsCache::policies() const
return values;
}
+void QHstsCache::setStore(QHstsStore *store)
+{
+ // Caller retains ownership of store, which must outlive this cache.
+ if (store != hstsStore) {
+ hstsStore = store;
+
+ if (!hstsStore)
+ return;
+
+ // First we augment our store with the policies we already know about
+ // (and thus the cached policy takes priority over whatever policy we
+ // had in the store for the same host, if any).
+ if (knownHosts.size()) {
+ const QVector<QHstsPolicy> observed(policies());
+ for (const auto &policy : observed)
+ hstsStore->addToObserved(policy);
+ hstsStore->synchronize();
+ }
+
+ // Now we update the cache with anything we have not observed yet, but
+ // the store knows about (well, it can happen we synchronize again as a
+ // result if some policies managed to expire or if we add a new one
+ // from the store to cache):
+ const QVector<QHstsPolicy> restored(store->readPolicies());
+ updateFromPolicies(restored);
+ }
+}
+
// The parser is quite simple: 'nextToken' knowns exactly what kind of tokens
// are valid and it will return false if something else was found; then
// we immediately stop parsing. 'parseDirective' knows how these tokens can
diff --git a/src/network/access/qhsts_p.h b/src/network/access/qhsts_p.h
index ab3ca536fb..2feb73b446 100644
--- a/src/network/access/qhsts_p.h
+++ b/src/network/access/qhsts_p.h
@@ -51,6 +51,8 @@
// We mean it.
//
+#include <QtNetwork/private/qtnetworkglobal_p.h>
+
#include <QtNetwork/qhstspolicy.h>
#include <QtCore/qbytearray.h>
@@ -66,6 +68,8 @@ QT_BEGIN_NAMESPACE
template<typename T> class QList;
template <typename T> class QVector;
+class QHstsStore;
+
class Q_AUTOTEST_EXPORT QHstsCache
{
public:
@@ -80,6 +84,8 @@ public:
QVector<QHstsPolicy> policies() const;
+ void setStore(QHstsStore *store);
+
private:
void updateKnownHost(const QString &hostName, const QDateTime &expires,
@@ -112,6 +118,7 @@ private:
};
mutable QMap<HostName, QHstsPolicy> knownHosts;
+ QHstsStore *hstsStore = nullptr;
};
class Q_AUTOTEST_EXPORT QHstsHeaderParser
diff --git a/src/network/access/qhstsstore.cpp b/src/network/access/qhstsstore.cpp
new file mode 100644
index 0000000000..239a52b7a4
--- /dev/null
+++ b/src/network/access/qhstsstore.cpp
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qhstsstore_p.h"
+#include "qhstspolicy.h"
+
+#include "qstandardpaths.h"
+#include "qdatastream.h"
+#include "qbytearray.h"
+#include "qdatetime.h"
+#include "qvariant.h"
+#include "qstring.h"
+#include "qdir.h"
+
+#include <utility>
+
+QT_BEGIN_NAMESPACE
+
+static QString host_name_to_settings_key(const QString &hostName)
+{
+ const QByteArray hostNameAsHex(hostName.toUtf8().toHex());
+ return QString::fromLatin1(hostNameAsHex);
+}
+
+static QString settings_key_to_host_name(const QString &key)
+{
+ const QByteArray hostNameAsUtf8(QByteArray::fromHex(key.toLatin1()));
+ return QString::fromUtf8(hostNameAsUtf8);
+}
+
+QHstsStore::QHstsStore(const QString &dirName)
+ : store(absoluteFilePath(dirName), QSettings::IniFormat)
+{
+ // Disable fallbacks, we do not want to use anything but our own ini file.
+ store.setFallbacksEnabled(false);
+}
+
+QHstsStore::~QHstsStore()
+{
+ synchronize();
+}
+
+QVector<QHstsPolicy> QHstsStore::readPolicies()
+{
+ // This function only attempts to read policies, making no decision about
+ // expired policies. It's up to a user (QHstsCache) to mark these policies
+ // for deletion and sync the store later. But we immediately remove keys/values
+ // (if the store isWritable) for the policies that we fail to read.
+ QVector<QHstsPolicy> policies;
+
+ beginHstsGroups();
+
+ const QStringList keys = store.childKeys();
+ for (const auto &key : keys) {
+ QHstsPolicy restoredPolicy;
+ if (deserializePolicy(key, restoredPolicy)) {
+ restoredPolicy.setHost(settings_key_to_host_name(key));
+ policies.push_back(std::move(restoredPolicy));
+ } else if (isWritable()) {
+ evictPolicy(key);
+ }
+ }
+
+ endHstsGroups();
+
+ return policies;
+}
+
+void QHstsStore::addToObserved(const QHstsPolicy &policy)
+{
+ observedPolicies.push_back(policy);
+}
+
+void QHstsStore::synchronize()
+{
+ if (!isWritable())
+ return;
+
+ if (observedPolicies.size()) {
+ beginHstsGroups();
+ for (const QHstsPolicy &policy : observedPolicies) {
+ const QString key(host_name_to_settings_key(policy.host()));
+ // If we fail to write a new, updated policy, we also remove the old one.
+ if (policy.isExpired() || !serializePolicy(key, policy))
+ evictPolicy(key);
+ }
+ observedPolicies.clear();
+ endHstsGroups();
+ }
+
+ store.sync();
+}
+
+bool QHstsStore::isWritable() const
+{
+ return store.isWritable();
+}
+
+QString QHstsStore::absoluteFilePath(const QString &dirName)
+{
+ const QDir dir(dirName.isEmpty() ? QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
+ : dirName);
+ return dir.absoluteFilePath(QLatin1String("hstsstore"));
+}
+
+void QHstsStore::beginHstsGroups()
+{
+ store.beginGroup(QLatin1String("StrictTransportSecurity"));
+ store.beginGroup(QLatin1String("Policies"));
+}
+
+void QHstsStore::endHstsGroups()
+{
+ store.endGroup();
+ store.endGroup();
+}
+
+bool QHstsStore::deserializePolicy(const QString &key, QHstsPolicy &policy)
+{
+ Q_ASSERT(store.contains(key));
+
+ const QVariant data(store.value(key));
+ if (data.isNull() || !data.canConvert<QByteArray>())
+ return false;
+
+ const QByteArray serializedData(data.toByteArray());
+ QDataStream streamer(serializedData);
+ qint64 expiryInMS = 0;
+ streamer >> expiryInMS;
+ if (streamer.status() != QDataStream::Ok)
+ return false;
+ bool includesSubDomains = false;
+ streamer >> includesSubDomains;
+ if (streamer.status() != QDataStream::Ok)
+ return false;
+
+ policy.setExpiry(QDateTime::fromMSecsSinceEpoch(expiryInMS));
+ policy.setIncludesSubDomains(includesSubDomains);
+
+ return true;
+}
+
+bool QHstsStore::serializePolicy(const QString &key, const QHstsPolicy &policy)
+{
+ Q_ASSERT(store.isWritable());
+
+ QByteArray serializedData;
+ QDataStream streamer(&serializedData, QIODevice::WriteOnly);
+ streamer << policy.expiry().toMSecsSinceEpoch();
+ streamer << policy.includesSubDomains();
+
+ if (streamer.status() != QDataStream::Ok)
+ return false;
+
+ store.setValue(key, serializedData);
+ return true;
+}
+
+void QHstsStore::evictPolicy(const QString &key)
+{
+ Q_ASSERT(store.isWritable());
+ if (store.contains(key))
+ store.remove(key);
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/access/qhstsstore_p.h b/src/network/access/qhstsstore_p.h
new file mode 100644
index 0000000000..13042839c4
--- /dev/null
+++ b/src/network/access/qhstsstore_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 QHSTSSTORE_P_H
+#define QHSTSSTORE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of the Network Access API. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtNetwork/private/qtnetworkglobal_p.h>
+
+#include <QtCore/qsettings.h>
+#include <QtCore/qvector.h>
+
+QT_BEGIN_NAMESPACE
+
+class QHstsPolicy;
+class QByteArray;
+class QString;
+
+class Q_AUTOTEST_EXPORT QHstsStore
+{
+public:
+ explicit QHstsStore(const QString &dirName);
+ ~QHstsStore();
+
+ QVector<QHstsPolicy> readPolicies();
+ void addToObserved(const QHstsPolicy &policy);
+ void synchronize();
+
+ bool isWritable() const;
+
+ static QString absoluteFilePath(const QString &dirName);
+private:
+ void beginHstsGroups();
+ bool serializePolicy(const QString &key, const QHstsPolicy &policy);
+ bool deserializePolicy(const QString &key, QHstsPolicy &policy);
+ void evictPolicy(const QString &key);
+ void endHstsGroups();
+
+ QVector<QHstsPolicy> observedPolicies;
+ QSettings store;
+
+ Q_DISABLE_COPY(QHstsStore)
+};
+
+QT_END_NAMESPACE
+
+#endif // QHSTSSTORE_P_H
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 44ab637da8..5032f6017f 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -170,10 +170,22 @@ QHttp2ProtocolHandler::QHttp2ProtocolHandler(QHttpNetworkConnectionChannel *chan
decoder(HPack::FieldLookupTable::DefaultSize),
encoder(HPack::FieldLookupTable::DefaultSize, true)
{
+ Q_ASSERT(channel);
continuedFrames.reserve(20);
- bool ok = false;
- const int env = qEnvironmentVariableIntValue("QT_HTTP2_ENABLE_PUSH_PROMISE", &ok);
- pushPromiseEnabled = ok && env;
+ pushPromiseEnabled = is_PUSH_PROMISE_enabled();
+
+ if (!channel->ssl) {
+ // We upgraded from HTTP/1.1 to HTTP/2. channel->request was already sent
+ // as HTTP/1.1 request. The response with status code 101 triggered
+ // protocol switch and now we are waiting for the real response, sent
+ // as HTTP/2 frames.
+ Q_ASSERT(channel->reply);
+ const quint32 initialStreamID = createNewStream(HttpMessagePair(channel->request, channel->reply),
+ true /* uploaded by HTTP/1.1 */);
+ Q_ASSERT(initialStreamID == 1);
+ Stream &stream = activeStreams[initialStreamID];
+ stream.state = Stream::halfClosedLocal;
+ }
}
void QHttp2ProtocolHandler::_q_uploadDataReadyRead()
@@ -356,12 +368,8 @@ bool QHttp2ProtocolHandler::sendClientPreface()
return false;
// 6.5 SETTINGS
- frameWriter.start(FrameType::SETTINGS, FrameFlag::EMPTY, Http2::connectionStreamID);
- // MAX frame size (16 kb), enable/disable PUSH
- frameWriter.append(Settings::MAX_FRAME_SIZE_ID);
- frameWriter.append(quint32(Http2::maxFrameSize));
- frameWriter.append(Settings::ENABLE_PUSH_ID);
- frameWriter.append(quint32(pushPromiseEnabled));
+ frameWriter.setOutboundFrame(default_SETTINGS_frame());
+ Q_ASSERT(frameWriter.outboundFrame().payloadSize());
if (!frameWriter.write(*m_socket))
return false;
@@ -1157,7 +1165,7 @@ void QHttp2ProtocolHandler::finishStreamWithError(Stream &stream, QNetworkReply:
<< "finished with error:" << message;
}
-quint32 QHttp2ProtocolHandler::createNewStream(const HttpMessagePair &message)
+quint32 QHttp2ProtocolHandler::createNewStream(const HttpMessagePair &message, bool uploadDone)
{
const qint32 newStreamID = allocateStreamID();
if (!newStreamID)
@@ -1178,10 +1186,12 @@ quint32 QHttp2ProtocolHandler::createNewStream(const HttpMessagePair &message)
streamInitialSendWindowSize,
streamInitialRecvWindowSize);
- if (auto src = newStream.data()) {
- connect(src, SIGNAL(readyRead()), this,
- SLOT(_q_uploadDataReadyRead()), Qt::QueuedConnection);
- src->setProperty("HTTP2StreamID", newStreamID);
+ if (!uploadDone) {
+ if (auto src = newStream.data()) {
+ connect(src, SIGNAL(readyRead()), this,
+ SLOT(_q_uploadDataReadyRead()), Qt::QueuedConnection);
+ src->setProperty("HTTP2StreamID", newStreamID);
+ }
}
activeStreams.insert(newStreamID, newStream);
diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h
index df0cf6a288..82eea21818 100644
--- a/src/network/access/qhttp2protocolhandler_p.h
+++ b/src/network/access/qhttp2protocolhandler_p.h
@@ -98,7 +98,7 @@ private:
using Stream = Http2::Stream;
void _q_readyRead() override;
- void _q_receiveReply() override;
+ Q_INVOKABLE void _q_receiveReply() override;
Q_INVOKABLE bool sendRequest() override;
bool sendClientPreface();
@@ -136,7 +136,7 @@ private:
const QString &message);
// Stream's lifecycle management:
- quint32 createNewStream(const HttpMessagePair &message);
+ quint32 createNewStream(const HttpMessagePair &message, bool uploadDone = false);
void addToSuspended(Stream &stream);
void markAsReset(quint32 streamID);
quint32 popStreamToResume();
diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp
index 5c704efeef..303c145394 100644
--- a/src/network/access/qhttpmultipart.cpp
+++ b/src/network/access/qhttpmultipart.cpp
@@ -41,7 +41,7 @@
#include "qhttpmultipart_p.h"
#include "QtCore/qdatetime.h" // for initializing the random number generator with QTime
#include "QtCore/qmutex.h"
-#include "QtCore/qthreadstorage.h"
+#include "QtCore/qrandom.h"
QT_BEGIN_NAMESPACE
@@ -431,23 +431,16 @@ void QHttpPartPrivate::checkHeaderCreated() const
}
}
-Q_GLOBAL_STATIC(QThreadStorage<bool *>, seedCreatedStorage);
-
QHttpMultiPartPrivate::QHttpMultiPartPrivate() : contentType(QHttpMultiPart::MixedType), device(new QHttpMultiPartIODevice(this))
{
- if (!seedCreatedStorage()->hasLocalData()) {
- qsrand(QTime(0,0,0).msecsTo(QTime::currentTime()) ^ reinterpret_cast<quintptr>(this));
- seedCreatedStorage()->setLocalData(new bool(true));
- }
-
- boundary = QByteArray("boundary_.oOo._")
- + QByteArray::number(qrand()).toBase64()
- + QByteArray::number(qrand()).toBase64()
- + QByteArray::number(qrand()).toBase64();
+ // 24 random bytes, becomes 32 characters when encoded to Base64
+ quint32 random[6];
+ QRandomGenerator::fillRange(random);
+ boundary = "boundary_.oOo._"
+ + QByteArray::fromRawData(reinterpret_cast<char *>(random), sizeof(random)).toBase64();
// boundary must not be longer than 70 characters, see RFC 2046, section 5.1.1
- if (boundary.count() > 70)
- boundary = boundary.left(70);
+ Q_ASSERT(boundary.count() <= 70);
}
qint64 QHttpMultiPartIODevice::size() const
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index da055de2da..0b474ba116 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -627,7 +627,8 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
if (request.isPreConnect())
preConnectRequests++;
- if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP) {
+ if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP
+ || (!encrypt && connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2 && !channels[0].switchedToHttp2)) {
switch (request.priority()) {
case QHttpNetworkRequest::HighPriority:
highPriorityQueue.prepend(pair);
@@ -638,12 +639,13 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
break;
}
}
- else { // SPDY, HTTP/2
+ else { // SPDY, HTTP/2 ('h2' mode)
if (!pair.second->d_func()->requestIsPrepared)
prepareRequest(pair);
channels[0].spdyRequestsToSend.insertMulti(request.priority(), pair);
}
+#ifndef Q_OS_WINRT
// For Happy Eyeballs the networkLayerState is set to Unknown
// untill we have started the first connection attempt. So no
// request will be started untill we know if IPv4 or IPv6
@@ -651,6 +653,13 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
if (networkLayerState == Unknown || networkLayerState == HostLookupPending) {
startHostInfoLookup();
} else if ( networkLayerState == IPv4 || networkLayerState == IPv6 ) {
+#else // !Q_OS_WINRT
+ {
+ // Skip the host lookup part for winrt. Host lookup and proxy handling are done by Windows
+ // internally and networkLayerPreference is ignored on this platform. Instead of refactoring
+ // the whole approach we just pretend that everything important is known here.
+ networkLayerState = IPv4;
+#endif
// this used to be called via invokeMethod and a QueuedConnection
// It is the only place _q_startNextRequest is called directly without going
// through the event loop using a QueuedConnection.
@@ -664,6 +673,25 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
return reply;
}
+void QHttpNetworkConnectionPrivate::fillHttp2Queue()
+{
+ for (auto &pair : highPriorityQueue) {
+ if (!pair.second->d_func()->requestIsPrepared)
+ prepareRequest(pair);
+ channels[0].spdyRequestsToSend.insertMulti(QHttpNetworkRequest::HighPriority, pair);
+ }
+
+ highPriorityQueue.clear();
+
+ for (auto &pair : lowPriorityQueue) {
+ if (!pair.second->d_func()->requestIsPrepared)
+ prepareRequest(pair);
+ channels[0].spdyRequestsToSend.insertMulti(pair.first.priority(), pair);
+ }
+
+ lowPriorityQueue.clear();
+}
+
void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair)
{
Q_Q(QHttpNetworkConnection);
@@ -1039,8 +1067,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
}
case QHttpNetworkConnection::ConnectionTypeHTTP2:
case QHttpNetworkConnection::ConnectionTypeSPDY: {
-
- if (channels[0].spdyRequestsToSend.isEmpty())
+ if (channels[0].spdyRequestsToSend.isEmpty() && channels[0].switchedToHttp2)
return;
if (networkLayerState == IPv4)
@@ -1049,7 +1076,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
channels[0].networkLayerPreference = QAbstractSocket::IPv6Protocol;
channels[0].ensureConnection();
if (channels[0].socket && channels[0].socket->state() == QAbstractSocket::ConnectedState
- && !channels[0].pendingEncrypt)
+ && !channels[0].pendingEncrypt && channels[0].spdyRequestsToSend.size())
channels[0].sendRequest();
break;
}
@@ -1347,6 +1374,12 @@ QHttpNetworkReply* QHttpNetworkConnection::sendRequest(const QHttpNetworkRequest
return d->queueRequest(request);
}
+void QHttpNetworkConnection::fillHttp2Queue()
+{
+ Q_D(QHttpNetworkConnection);
+ d->fillHttp2Queue();
+}
+
bool QHttpNetworkConnection::isSsl() const
{
Q_D(const QHttpNetworkConnection);
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 3dd9bde9bd..f01a2318a5 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -122,6 +122,7 @@ public:
//add a new HTTP request through this connection
QHttpNetworkReply* sendRequest(const QHttpNetworkRequest &request);
+ void fillHttp2Queue();
#ifndef QT_NO_NETWORKPROXY
//set the proxy for this connection
@@ -208,6 +209,7 @@ public:
QHttpNetworkReply *queueRequest(const QHttpNetworkRequest &request);
void requeueRequest(const HttpMessagePair &pair); // e.g. after pipeline broke
+ void fillHttp2Queue();
bool dequeueRequest(QAbstractSocket *socket);
void prepareRequest(HttpMessagePair &request);
void updateChannel(int i, const HttpMessagePair &messagePair);
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index e1084e0870..b1ae29427e 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -55,7 +55,6 @@
# include <private/qsslsocket_p.h>
# include <QtNetwork/qsslkey.h>
# include <QtNetwork/qsslcipher.h>
-# include <QtNetwork/qsslconfiguration.h>
#endif
#ifndef QT_NO_BEARERMANAGEMENT
@@ -64,6 +63,20 @@
QT_BEGIN_NAMESPACE
+namespace
+{
+
+class ProtocolHandlerDeleter : public QObject
+{
+public:
+ explicit ProtocolHandlerDeleter(QAbstractProtocolHandler *h) : handler(h) {}
+ ~ProtocolHandlerDeleter() { delete handler; }
+private:
+ QAbstractProtocolHandler *handler = nullptr;
+};
+
+}
+
// TODO: Put channel specific stuff here so it does not polute qhttpnetworkconnection.cpp
// Because in-flight when sending a request, the server might close our connection (because the persistent HTTP
@@ -176,8 +189,8 @@ void QHttpNetworkConnectionChannel::init()
if (!ignoreSslErrorsList.isEmpty())
sslSocket->ignoreSslErrors(ignoreSslErrorsList);
- if (!sslConfiguration.isNull())
- sslSocket->setSslConfiguration(sslConfiguration);
+ if (sslConfiguration.data() && !sslConfiguration->isNull())
+ sslSocket->setSslConfiguration(*sslConfiguration);
} else {
#endif // !QT_NO_SSL
if (connection->connectionType() != QHttpNetworkConnection::ConnectionTypeHTTP2)
@@ -425,6 +438,40 @@ void QHttpNetworkConnectionChannel::allDone()
return;
}
+ if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
+ && !ssl && !switchedToHttp2) {
+ if (Http2::is_protocol_upgraded(*reply)) {
+ switchedToHttp2 = true;
+ protocolHandler->setReply(nullptr);
+
+ // As allDone() gets called from the protocol handler, it's not yet
+ // safe to delete it. There is no 'deleteLater', since
+ // QAbstractProtocolHandler is not a QObject. Instead we do this
+ // trick with ProtocolHandlerDeleter, a QObject-derived class.
+ // These dances below just make it somewhat exception-safe.
+ // 1. Create a new owner:
+ QAbstractProtocolHandler *oldHandler = protocolHandler.data();
+ QScopedPointer<ProtocolHandlerDeleter> deleter(new ProtocolHandlerDeleter(oldHandler));
+ // 2. Retire the old one:
+ protocolHandler.take();
+ // 3. Call 'deleteLater':
+ deleter->deleteLater();
+ // 3. Give up the ownerthip:
+ deleter.take();
+
+ connection->fillHttp2Queue();
+ protocolHandler.reset(new QHttp2ProtocolHandler(this));
+ QHttp2ProtocolHandler *h2c = static_cast<QHttp2ProtocolHandler *>(protocolHandler.data());
+ QMetaObject::invokeMethod(h2c, "_q_receiveReply", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ return;
+ } else {
+ // Ok, whatever happened, we do not try HTTP/2 anymore ...
+ connection->setConnectionType(QHttpNetworkConnection::ConnectionTypeHTTP);
+ connection->d_func()->activeChannelCount = connection->d_func()->channelCount;
+ }
+ }
+
// while handling 401 & 407, we might reset the status code, so save this.
bool emitFinished = reply->d_func()->shouldEmitSignals();
bool connectionCloseEnabled = reply->d_func()->isConnectionCloseEnabled();
@@ -656,7 +703,10 @@ void QHttpNetworkConnectionChannel::setSslConfiguration(const QSslConfiguration
if (socket)
static_cast<QSslSocket *>(socket)->setSslConfiguration(config);
- sslConfiguration = config;
+ if (sslConfiguration.data())
+ *sslConfiguration = config;
+ else
+ sslConfiguration.reset(new QSslConfiguration(config));
}
#endif
@@ -836,19 +886,23 @@ void QHttpNetworkConnectionChannel::_q_connected()
#endif
} else {
state = QHttpNetworkConnectionChannel::IdleState;
- if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
- // We have to reset QHttp2ProtocolHandler's state machine, it's a new
- // connection and the handler's state is unique per connection.
- protocolHandler.reset(new QHttp2ProtocolHandler(this));
- if (spdyRequestsToSend.count() > 0) {
- // wait for data from the server first (e.g. initial window, max concurrent requests)
- QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ const bool tryProtocolUpgrade = connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2;
+ if (tryProtocolUpgrade) {
+ // For HTTP/1.1 it's already created and never reset.
+ protocolHandler.reset(new QHttpProtocolHandler(this));
+ }
+ switchedToHttp2 = false;
+
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
+
+ if (reply) {
+ if (tryProtocolUpgrade) {
+ // Let's augment our request with some magic headers and try to
+ // switch to HTTP/2.
+ Http2::prepare_for_protocol_upgrade(request);
}
- } else {
- if (!reply)
- connection->d_func()->dequeueRequest(socket);
- if (reply)
- sendRequest();
+ sendRequest();
}
}
}
@@ -1076,6 +1130,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
// has gone to the SPDY queue already
break;
} else if (nextProtocol == QSslConfiguration::ALPNProtocolHTTP2) {
+ switchedToHttp2 = true;
protocolHandler.reset(new QHttp2ProtocolHandler(this));
connection->setConnectionType(QHttpNetworkConnection::ConnectionTypeHTTP2);
break;
@@ -1088,8 +1143,15 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
Q_FALLTHROUGH();
case QSslConfiguration::NextProtocolNegotiationNone: {
protocolHandler.reset(new QHttpProtocolHandler(this));
+ if (!sslConfiguration.data()) {
+ // Our own auto-tests bypass the normal initialization (done by
+ // QHttpThreadDelegate), this means in the past we'd have here
+ // the default constructed QSslConfiguration without any protocols
+ // to negotiate. Let's create it now:
+ sslConfiguration.reset(new QSslConfiguration);
+ }
- QList<QByteArray> protocols = sslConfiguration.allowedNextProtocols();
+ QList<QByteArray> protocols = sslConfiguration->allowedNextProtocols();
const int nProtocols = protocols.size();
// Clear the protocol that we failed to negotiate, so we do not try
// it again on other channels that our connection can create/open.
@@ -1099,10 +1161,10 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
protocols.removeAll(QSslConfiguration::NextProtocolSpdy3_0);
if (nProtocols > protocols.size()) {
- sslConfiguration.setAllowedNextProtocols(protocols);
+ sslConfiguration->setAllowedNextProtocols(protocols);
const int channelCount = connection->d_func()->channelCount;
for (int i = 0; i < channelCount; ++i)
- connection->d_func()->channels[i].setSslConfiguration(sslConfiguration);
+ connection->d_func()->channels[i].setSslConfiguration(*sslConfiguration);
}
connection->setConnectionType(QHttpNetworkConnection::ConnectionTypeHTTP);
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index 61aea9d35d..844a7d5d15 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -78,6 +78,8 @@
# include <QtNetwork/qtcpsocket.h>
#endif
+#include <QtCore/qscopedpointer.h>
+
QT_BEGIN_NAMESPACE
class QHttpNetworkRequest;
@@ -125,10 +127,11 @@ public:
// HTTP/2 can be cleartext also, that's why it's
// outside of QT_NO_SSL section. Sorted by priority:
QMultiMap<int, HttpMessagePair> spdyRequestsToSend;
+ bool switchedToHttp2 = false;
#ifndef QT_NO_SSL
bool ignoreAllSslErrors;
QList<QSslError> ignoreSslErrorsList;
- QSslConfiguration sslConfiguration;
+ QScopedPointer<QSslConfiguration> sslConfiguration;
void ignoreSslErrors();
void ignoreSslErrors(const QList<QSslError> &errors);
void setSslConfiguration(const QSslConfiguration &config);
diff --git a/src/network/access/qhttpnetworkheader_p.h b/src/network/access/qhttpnetworkheader_p.h
index 89169b9331..46aec1dd8c 100644
--- a/src/network/access/qhttpnetworkheader_p.h
+++ b/src/network/access/qhttpnetworkheader_p.h
@@ -78,7 +78,7 @@ public:
virtual void setHeaderField(const QByteArray &name, const QByteArray &data) = 0;
};
-class QHttpNetworkHeaderPrivate : public QSharedData
+class Q_AUTOTEST_EXPORT QHttpNetworkHeaderPrivate : public QSharedData
{
public:
QUrl url;
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 9d874b4d94..3d17664ed4 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -44,6 +44,7 @@
#include <QTimer>
#include <QAuthenticator>
#include <QEventLoop>
+#include <QCryptographicHash>
#include "private/qhttpnetworkreply_p.h"
#include "private/qnetworkaccesscache_p.h"
@@ -158,7 +159,10 @@ static QByteArray makeCacheKey(QUrl &url, QNetworkProxy *proxy)
}
if (!key.scheme().isEmpty()) {
+ const QByteArray obfuscatedPassword = QCryptographicHash::hash(proxy->password().toUtf8(),
+ QCryptographicHash::Sha1).toHex();
key.setUserName(proxy->user());
+ key.setPassword(QString::fromUtf8(obfuscatedPassword));
key.setHost(proxy->hostName());
key.setPort(proxy->port());
key.setQuery(result);
@@ -290,18 +294,21 @@ void QHttpThreadDelegate::startRequest()
: QHttpNetworkConnection::ConnectionTypeHTTP;
#ifndef QT_NO_SSL
+ if (ssl && !incomingSslConfiguration.data())
+ incomingSslConfiguration.reset(new QSslConfiguration);
+
if (httpRequest.isHTTP2Allowed() && ssl) {
QList<QByteArray> protocols;
protocols << QSslConfiguration::ALPNProtocolHTTP2
<< QSslConfiguration::NextProtocolHttp1_1;
- incomingSslConfiguration.setAllowedNextProtocols(protocols);
+ incomingSslConfiguration->setAllowedNextProtocols(protocols);
} else if (httpRequest.isSPDYAllowed() && ssl) {
connectionType = QHttpNetworkConnection::ConnectionTypeSPDY;
urlCopy.setScheme(QStringLiteral("spdy")); // to differentiate SPDY requests from HTTPS requests
QList<QByteArray> nextProtocols;
nextProtocols << QSslConfiguration::NextProtocolSpdy3_0
<< QSslConfiguration::NextProtocolHttp1_1;
- incomingSslConfiguration.setAllowedNextProtocols(nextProtocols);
+ incomingSslConfiguration->setAllowedNextProtocols(nextProtocols);
}
#endif // QT_NO_SSL
@@ -330,9 +337,8 @@ void QHttpThreadDelegate::startRequest()
#endif
#ifndef QT_NO_SSL
// Set the QSslConfiguration from this QNetworkRequest.
- if (ssl && incomingSslConfiguration != QSslConfiguration::defaultConfiguration()) {
- httpConnection->setSslConfiguration(incomingSslConfiguration);
- }
+ if (ssl)
+ httpConnection->setSslConfiguration(*incomingSslConfiguration);
#endif
#ifndef QT_NO_NETWORKPROXY
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
index 6d1ea11f29..2f6954aa3b 100644
--- a/src/network/access/qhttpthreaddelegate_p.h
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -63,7 +63,7 @@
#include "qhttpnetworkrequest_p.h"
#include "qhttpnetworkconnection_p.h"
#include <QSharedPointer>
-#include "qsslconfiguration.h"
+#include <QScopedPointer>
#include "private/qnoncontiguousbytedevice_p.h"
#include "qnetworkaccessauthenticationmanager_p.h"
@@ -88,7 +88,7 @@ public:
// incoming
bool ssl;
#ifndef QT_NO_SSL
- QSslConfiguration incomingSslConfiguration;
+ QScopedPointer<QSslConfiguration> incomingSslConfiguration;
#endif
QHttpNetworkRequest httpRequest;
qint64 downloadBufferMaximumSize;
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index 9c223dd32f..272dd22097 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -396,30 +396,8 @@ bool QNetworkAccessBackend::start()
#endif
#ifndef QT_NO_NETWORKPROXY
-#ifndef QT_NO_BEARERMANAGEMENT
- // Get the proxy settings from the network session (in the case of service networks,
- // the proxy settings change depending which AP was activated)
- QNetworkSession *session = networkSession.data();
- QNetworkConfiguration config;
- if (session) {
- QNetworkConfigurationManager configManager;
- // The active configuration tells us what IAP is in use
- QVariant v = session->sessionProperty(QLatin1String("ActiveConfiguration"));
- if (v.isValid())
- config = configManager.configurationFromIdentifier(qvariant_cast<QString>(v));
- // Fallback to using the configuration if no active configuration
- if (!config.isValid())
- config = session->configuration();
- // or unspecified configuration if that is no good either
- if (!config.isValid())
- config = QNetworkConfiguration();
- }
- reply->proxyList = manager->queryProxy(QNetworkProxyQuery(config, url()));
-#else // QT_NO_BEARERMANAGEMENT
- // Without bearer management, the proxy depends only on the url
reply->proxyList = manager->queryProxy(QNetworkProxyQuery(url()));
#endif
-#endif
// now start the request
open();
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 92b7fcbe11..8bbef0a0d8 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -734,9 +734,51 @@ bool QNetworkAccessManager::isStrictTransportSecurityEnabled() const
}
/*!
+ \since 5.10
+
+ If \a enabled is \c true, the internal HSTS cache will use a persistent store
+ to read and write HSTS policies. \a storeDir defines where this store will be
+ located. The default location is defined by QStandardPaths::CacheLocation.
+ If there is no writable QStandartPaths::CacheLocation and \a storeDir is an
+ empty string, the store will be located in the program's working directory.
+
+ \note If HSTS cache already contains HSTS policies by the time persistent
+ store is enabled, these policies will be preserved in the store. In case both
+ cache and store contain the same known hosts, policies from cache are considered
+ to be more up-to-date (and thus will overwrite the previous values in the store).
+ If this behavior is undesired, enable HSTS store before enabling Strict Tranport
+ Security. By default, the persistent store of HSTS policies is disabled.
+
+ \sa isStrictTransportSecurityStoreEnabled(), setStrictTransportSecurityEnabled(),
+ QStandardPaths::standardLocations()
+*/
+
+void QNetworkAccessManager::enableStrictTransportSecurityStore(bool enabled, const QString &storeDir)
+{
+ Q_D(QNetworkAccessManager);
+ d->stsStore.reset(enabled ? new QHstsStore(storeDir) : nullptr);
+ d->stsCache.setStore(d->stsStore.data());
+}
+
+/*!
+ \since 5.10
+
+ Returns true if HSTS cache uses a permanent store to load and store HSTS
+ policies.
+
+ \sa enableStrictTransportSecurityStore()
+*/
+
+bool QNetworkAccessManager::isStrictTransportSecurityStoreEnabled() const
+{
+ Q_D(const QNetworkAccessManager);
+ return bool(d->stsStore.data());
+}
+
+/*!
\since 5.9
- Adds HTTP Strict Transport Security policies into HSTS cache.
+ Adds HTTP Strict Transport Security policies contained in \a knownHosts into HSTS cache.
\note An expired policy will remove a known host from the cache, if previously
present.
@@ -748,7 +790,7 @@ bool QNetworkAccessManager::isStrictTransportSecurityEnabled() const
policies, but this information can be overridden by "Strict-Transport-Security"
response headers.
- \sa addStrictTransportSecurityHosts(), QHstsPolicy
+ \sa addStrictTransportSecurityHosts(), enableStrictTransportSecurityStore(), QHstsPolicy
*/
void QNetworkAccessManager::addStrictTransportSecurityHosts(const QVector<QHstsPolicy> &knownHosts)
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index f035ac5b00..4806ec0475 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -42,6 +42,7 @@
#include <QtNetwork/qtnetworkglobal.h>
#include <QtNetwork/qnetworkrequest.h>
+#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtCore/QObject>
#ifndef QT_NO_SSL
@@ -124,6 +125,8 @@ public:
void setStrictTransportSecurityEnabled(bool enabled);
bool isStrictTransportSecurityEnabled() const;
+ void enableStrictTransportSecurityStore(bool enabled, const QString &storeDir = QString());
+ bool isStrictTransportSecurityStoreEnabled() const;
void addStrictTransportSecurityHosts(const QVector<QHstsPolicy> &knownHosts);
QVector<QHstsPolicy> strictTransportSecurityHosts() const;
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index 13a26a54f1..e5257251a4 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -56,6 +56,7 @@
#include "qnetworkaccesscache_p.h"
#include "qnetworkaccessbackend_p.h"
#include "qnetworkrequest.h"
+#include "qhstsstore_p.h"
#include "qhsts_p.h"
#include "private/qobject_p.h"
#include "QtNetwork/qnetworkproxy.h"
@@ -211,6 +212,7 @@ public:
Q_AUTOTEST_EXPORT static void clearConnectionCache(QNetworkAccessManager *manager);
QHstsCache stsCache;
+ QScopedPointer<QHstsStore> stsStore;
bool stsEnabled = false;
#ifndef QT_NO_BEARERMANAGEMENT
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index 8e7059de0f..cabea86521 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -311,9 +311,11 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
When client code handling the redirected() signal has verified the new URL,
it emits this signal to allow the redirect to go ahead. This protocol applies
to network requests whose redirects policy is set to
- QNetworkRequest::UserVerifiedRedirectsPolicy.
+ QNetworkRequest::UserVerifiedRedirectPolicy
- \sa QNetworkRequest::UserVerifiedRedirectPolicy, QNetworkAccessManager::setRedirectPolicy(), QNetworkRequest::RedirectPolicyAttribute
+ \sa QNetworkRequest::UserVerifiedRedirectPolicy,
+ QNetworkAccessManager::setRedirectPolicy(),
+ QNetworkRequest::RedirectPolicyAttribute
*/
/*!
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index fec3b0a100..84b1ddf5ac 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -180,7 +180,8 @@ QNetworkReplyHttpImpl::QNetworkReplyHttpImpl(QNetworkAccessManager* const manage
d->outgoingData = outgoingData;
d->url = request.url();
#ifndef QT_NO_SSL
- d->sslConfiguration = request.sslConfiguration();
+ if (request.url().scheme() == QLatin1String("https"))
+ d->sslConfiguration.reset(new QSslConfiguration(request.sslConfiguration()));
#endif
// FIXME Later maybe set to Unbuffered, especially if it is zerocopy or from cache?
@@ -419,7 +420,10 @@ void QNetworkReplyHttpImpl::setSslConfigurationImplementation(const QSslConfigur
void QNetworkReplyHttpImpl::sslConfigurationImplementation(QSslConfiguration &configuration) const
{
Q_D(const QNetworkReplyHttpImpl);
- configuration = d->sslConfiguration;
+ if (d->sslConfiguration.data())
+ configuration = *d->sslConfiguration;
+ else
+ configuration = request().sslConfiguration();
}
#endif
@@ -786,7 +790,7 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
delegate->ssl = ssl;
#ifndef QT_NO_SSL
if (ssl)
- delegate->incomingSslConfiguration = newHttpRequest.sslConfiguration();
+ delegate->incomingSslConfiguration.reset(new QSslConfiguration(newHttpRequest.sslConfiguration()));
#endif
// Do we use synchronous HTTP?
@@ -1411,10 +1415,13 @@ void QNetworkReplyHttpImplPrivate::replySslErrors(
*toBeIgnored = pendingIgnoreSslErrorsList;
}
-void QNetworkReplyHttpImplPrivate::replySslConfigurationChanged(const QSslConfiguration &sslConfiguration)
+void QNetworkReplyHttpImplPrivate::replySslConfigurationChanged(const QSslConfiguration &newSslConfiguration)
{
// Receiving the used SSL configuration from the HTTP thread
- this->sslConfiguration = sslConfiguration;
+ if (sslConfiguration.data())
+ *sslConfiguration = newSslConfiguration;
+ else
+ sslConfiguration.reset(new QSslConfiguration(newSslConfiguration));
}
void QNetworkReplyHttpImplPrivate::replyPreSharedKeyAuthenticationRequiredSlot(QSslPreSharedKeyAuthenticator *authenticator)
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index 9383149124..26b16e8386 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -58,6 +58,7 @@
#include "QtCore/qpointer.h"
#include "QtCore/qdatetime.h"
#include "QtCore/qsharedpointer.h"
+#include "QtCore/qscopedpointer.h"
#include "qatomic.h"
#include <QtNetwork/QNetworkCacheMetaData>
@@ -260,7 +261,7 @@ public:
#ifndef QT_NO_SSL
- QSslConfiguration sslConfiguration;
+ QScopedPointer<QSslConfiguration> sslConfiguration;
bool pendingIgnoreAllSslErrors;
QList<QSslError> pendingIgnoreSslErrorsList;
#endif
@@ -290,7 +291,7 @@ public:
#ifndef QT_NO_SSL
void replyEncrypted();
void replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
- void replySslConfigurationChanged(const QSslConfiguration&);
+ void replySslConfigurationChanged(const QSslConfiguration &newSslConfiguration);
void replyPreSharedKeyAuthenticationRequiredSlot(QSslPreSharedKeyAuthenticator *);
#endif
#ifndef QT_NO_NETWORKPROXY
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index f1619ab7c0..3367de80c8 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -111,7 +111,7 @@ QT_BEGIN_NAMESPACE
Depending on the type of configuration some states are transient in nature. A GPRS/UMTS
connection may almost always be \l Discovered if the GSM/UMTS network is available.
- However if the GSM/UMTS network looses the connection the associated configuration may change its state
+ However if the GSM/UMTS network loses the connection the associated configuration may change its state
from \l Discovered to \l Defined as well. A similar use case might be triggered by
WLAN availability. QNetworkConfigurationManager::updateConfigurations() can be used to
manually trigger updates of states. Note that some platforms do not require such updates
diff --git a/src/network/configure.json b/src/network/configure.json
index 916448a727..b1c943de6f 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -154,6 +154,12 @@
]
},
"use": "network"
+ },
+ "openssl11": {
+ "label": "OpenSSL v. 1.1 support",
+ "type": "compile",
+ "test": "unix/openssl11",
+ "use": "network"
}
},
@@ -221,6 +227,11 @@
"condition": "config.winrt || features.securetransport || features.openssl",
"output": [ "publicFeature", "feature" ]
},
+ "opensslv11": {
+ "label": "OpenSSL v. 1.1",
+ "condition": "tests.openssl11",
+ "output": ["publicFeature", "feature"]
+ },
"sctp": {
"label": "SCTP",
"autoDetect": false,
@@ -254,14 +265,13 @@
"label": "QNetworkProxy",
"purpose": "Provides network proxy support.",
"section": "Networking",
- "condition": "!config.winrt",
"output": [ "publicFeature", "feature" ]
},
"socks5": {
"label": "SOCKS5",
"purpose": "Provides SOCKS5 support in QNetworkProxy.",
"section": "Networking",
- "condition": "!config.winrt && features.networkproxy",
+ "condition": "features.networkproxy",
"output": [ "publicFeature", "feature" ]
},
"networkinterface": {
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 00c115da84..716f745bc9 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -63,7 +63,7 @@ mac {
}
osx:SOURCES += kernel/qnetworkproxy_mac.cpp
-else:win32:SOURCES += kernel/qnetworkproxy_win.cpp
+else:win32:!winrt: SOURCES += kernel/qnetworkproxy_win.cpp
else: qtConfig(libproxy) {
SOURCES += kernel/qnetworkproxy_libproxy.cpp
QMAKE_USE_PRIVATE += libproxy libdl
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 1b7061d050..ca64e3b95f 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -44,6 +44,7 @@
#include "qdebug.h"
#if defined(Q_OS_WIN)
# include <winsock2.h>
+# include <ws2tcpip.h>
#else
# include <netinet/in.h>
#endif
@@ -63,36 +64,6 @@
QT_BEGIN_NAMESPACE
-#ifdef Q_OS_WIN
-// sockaddr_in6 size changed between old and new SDK
-// Only the new version is the correct one, so always
-// use this structure.
-#if defined(Q_OS_WINRT)
-# if !defined(u_char)
-# define u_char unsigned char
-# endif
-# if !defined(u_short)
-# define u_short unsigned short
-# endif
-# if !defined(u_long)
-# define u_long unsigned long
-# endif
-#endif
-struct qt_in6_addr {
- u_char qt_s6_addr[16];
-};
-typedef struct {
- short sin6_family; /* AF_INET6 */
- u_short sin6_port; /* Transport level port number */
- u_long sin6_flowinfo; /* IPv6 flow information */
- struct qt_in6_addr sin6_addr; /* IPv6 address */
- u_long sin6_scope_id; /* set of interfaces for a scope */
-} qt_sockaddr_in6;
-#else
-#define qt_sockaddr_in6 sockaddr_in6
-#define qt_s6_addr s6_addr
-#endif
-
class QHostAddressPrivate : public QSharedData
{
@@ -495,7 +466,7 @@ QHostAddress::QHostAddress(const struct sockaddr *sockaddr)
if (sockaddr->sa_family == AF_INET)
setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
- setAddress(((const qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
+ setAddress(((const sockaddr_in6 *)sockaddr)->sin6_addr.s6_addr);
#else
Q_UNUSED(sockaddr)
#endif
@@ -718,7 +689,7 @@ void QHostAddress::setAddress(const struct sockaddr *sockaddr)
if (sockaddr->sa_family == AF_INET)
setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
- setAddress(((const qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
+ setAddress(((const sockaddr_in6 *)sockaddr)->sin6_addr.s6_addr);
#else
Q_UNUSED(sockaddr)
#endif
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 46123eb8a7..0156e22d41 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -279,6 +279,27 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver,
}
/*!
+ \fn QHostInfo &QHostInfo::operator=(QHostInfo &&other)
+
+ Move-assigns \a other to this QHostInfo instance.
+
+ \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.10
+*/
+
+/*!
+ \fn void QHostInfo::swap(QHostInfo &other)
+
+ Swaps host-info \a other with this host-info. This operation is
+ very fast and never fails.
+
+ \since 5.10
+*/
+
+/*!
\fn int QHostInfo::lookupHost(const QString &name, const QObject *receiver, PointerToMemberFunction function)
\since 5.9
diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h
index 4484d718bd..c5727bb6eb 100644
--- a/src/network/kernel/qhostinfo.h
+++ b/src/network/kernel/qhostinfo.h
@@ -63,8 +63,11 @@ public:
explicit QHostInfo(int lookupId = -1);
QHostInfo(const QHostInfo &d);
QHostInfo &operator=(const QHostInfo &d);
+ QHostInfo &operator=(QHostInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
~QHostInfo();
+ void swap(QHostInfo &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
QString hostName() const;
void setHostName(const QString &name);
@@ -125,7 +128,7 @@ public:
!std::is_same<const char *, Func>::value, int>::type
lookupHost(const QString &name, Func slot)
{
- return lookupHost(name, nullptr, slot);
+ return lookupHost(name, nullptr, std::move(slot));
}
// lookupHost to a functor or function pointer (with context)
@@ -141,7 +144,7 @@ public:
auto slotObj = new QtPrivate::QFunctorSlotObject<Func1, 1,
typename QtPrivate::List<QHostInfo>,
- void>(slot);
+ void>(std::move(slot));
return lookupHostImpl(name, context, slotObj);
}
#endif // Q_QDOC
@@ -154,6 +157,8 @@ private:
QtPrivate::QSlotObjectBase *slotObj);
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QHostInfo)
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QHostInfo)
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp
index 3002b2497b..c2efcea625 100644
--- a/src/network/kernel/qnetworkinterface_win.cpp
+++ b/src/network/kernel/qnetworkinterface_win.cpp
@@ -63,33 +63,6 @@
QT_BEGIN_NAMESPACE
-typedef NETIO_STATUS (WINAPI *PtrConvertInterfaceIndexToLuid)(NET_IFINDEX, PNET_LUID);
-typedef NETIO_STATUS (WINAPI *PtrConvertInterfaceLuidToName)(const NET_LUID *, PWSTR, SIZE_T);
-typedef NETIO_STATUS (WINAPI *PtrConvertInterfaceLuidToIndex)(const NET_LUID *, PNET_IFINDEX);
-typedef NETIO_STATUS (WINAPI *PtrConvertInterfaceNameToLuid)(const WCHAR *, PNET_LUID);
-static PtrConvertInterfaceIndexToLuid ptrConvertInterfaceIndexToLuid = 0;
-static PtrConvertInterfaceLuidToName ptrConvertInterfaceLuidToName = 0;
-static PtrConvertInterfaceLuidToIndex ptrConvertInterfaceLuidToIndex = 0;
-static PtrConvertInterfaceNameToLuid ptrConvertInterfaceNameToLuid = 0;
-
-static void resolveLibs()
-{
- // try to find the functions we need from Iphlpapi.dll
- static bool done = false;
-
- if (!done) {
- HINSTANCE iphlpapiHnd = GetModuleHandle(L"iphlpapi");
- Q_ASSERT(iphlpapiHnd);
-
- // since Windows Vista
- ptrConvertInterfaceIndexToLuid = (PtrConvertInterfaceIndexToLuid)GetProcAddress(iphlpapiHnd, "ConvertInterfaceIndexToLuid");
- ptrConvertInterfaceLuidToName = (PtrConvertInterfaceLuidToName)GetProcAddress(iphlpapiHnd, "ConvertInterfaceLuidToNameW");
- ptrConvertInterfaceLuidToIndex = (PtrConvertInterfaceLuidToIndex)GetProcAddress(iphlpapiHnd, "ConvertInterfaceLuidToIndex");
- ptrConvertInterfaceNameToLuid = (PtrConvertInterfaceNameToLuid)GetProcAddress(iphlpapiHnd, "ConvertInterfaceNameToLuidW");
- done = true;
- }
-}
-
static QHostAddress addressFromSockaddr(sockaddr *sa)
{
QHostAddress address;
@@ -111,30 +84,22 @@ static QHostAddress addressFromSockaddr(sockaddr *sa)
uint QNetworkInterfaceManager::interfaceIndexFromName(const QString &name)
{
- resolveLibs();
- if (!ptrConvertInterfaceNameToLuid || !ptrConvertInterfaceLuidToIndex)
- return 0;
-
NET_IFINDEX id;
NET_LUID luid;
- if (ptrConvertInterfaceNameToLuid(reinterpret_cast<const wchar_t *>(name.constData()), &luid) == NO_ERROR
- && ptrConvertInterfaceLuidToIndex(&luid, &id) == NO_ERROR)
+ if (ConvertInterfaceNameToLuidW(reinterpret_cast<const wchar_t *>(name.constData()), &luid) == NO_ERROR
+ && ConvertInterfaceLuidToIndex(&luid, &id) == NO_ERROR)
return uint(id);
return 0;
}
QString QNetworkInterfaceManager::interfaceNameFromIndex(uint index)
{
- resolveLibs();
- if (ptrConvertInterfaceIndexToLuid && ptrConvertInterfaceLuidToName) {
- NET_LUID luid;
- if (ptrConvertInterfaceIndexToLuid(index, &luid) == NO_ERROR) {
- WCHAR buf[IF_MAX_STRING_SIZE + 1];
- if (ptrConvertInterfaceLuidToName(&luid, buf, sizeof(buf)/sizeof(buf[0])) == NO_ERROR)
- return QString::fromWCharArray(buf);
- }
+ NET_LUID luid;
+ if (ConvertInterfaceIndexToLuid(index, &luid) == NO_ERROR) {
+ WCHAR buf[IF_MAX_STRING_SIZE + 1];
+ if (ConvertInterfaceLuidToNameW(&luid, buf, sizeof(buf)/sizeof(buf[0])) == NO_ERROR)
+ return QString::fromWCharArray(buf);
}
-
return QString::number(index);
}
@@ -223,11 +188,11 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
if (ptr->IfType == IF_TYPE_PPP)
iface->flags |= QNetworkInterface::IsPointToPoint;
- if (ptrConvertInterfaceLuidToName && ptr->Length >= offsetof(IP_ADAPTER_ADDRESSES, Luid)) {
- // use ConvertInterfaceLuidToName because that returns a friendlier name, though not
+ if (ptr->Length >= offsetof(IP_ADAPTER_ADDRESSES, Luid)) {
+ // use ConvertInterfaceLuidToNameW because that returns a friendlier name, though not
// as friendly as FriendlyName below
WCHAR buf[IF_MAX_STRING_SIZE + 1];
- if (ptrConvertInterfaceLuidToName(&ptr->Luid, buf, sizeof(buf)/sizeof(buf[0])) == NO_ERROR)
+ if (ConvertInterfaceLuidToNameW(&ptr->Luid, buf, sizeof(buf)/sizeof(buf[0])) == NO_ERROR)
iface->name = QString::fromWCharArray(buf);
}
if (iface->name.isEmpty())
@@ -275,14 +240,11 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
QList<QNetworkInterfacePrivate *> QNetworkInterfaceManager::scan()
{
- resolveLibs();
return interfaceListingWinXP();
}
QString QHostInfo::localDomainName()
{
- resolveLibs();
-
FIXED_INFO info, *pinfo;
ULONG bufSize = sizeof info;
pinfo = &info;
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 0ed68042f6..6b53b4b58e 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -917,9 +917,6 @@ public:
QUrl remote;
int localPort;
QNetworkProxyQuery::QueryType type;
-#ifndef QT_NO_BEARERMANAGEMENT
- QNetworkConfiguration config;
-#endif
};
template<> void QSharedDataPointer<QNetworkProxyQueryPrivate>::detach()
@@ -1131,29 +1128,32 @@ QNetworkProxyQuery::QNetworkProxyQuery(quint16 bindPort, const QString &protocol
d->type = queryType;
}
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
/*!
+ \deprecated
+
Constructs a QNetworkProxyQuery with the URL \a requestUrl and
sets the query type to \a queryType. The specified \a networkConfiguration
- is used to resolve the proxy settings.
+ parameter is ignored.
\sa protocolTag(), peerHostName(), peerPort(), networkConfiguration()
*/
QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
const QUrl &requestUrl, QueryType queryType)
{
- d->config = networkConfiguration;
+ Q_UNUSED(networkConfiguration)
d->remote = requestUrl;
d->type = queryType;
}
/*!
+ \deprecated
+
Constructs a QNetworkProxyQuery of type \a queryType and sets the
protocol tag to be \a protocolTag. This constructor is suitable
for QNetworkProxyQuery::TcpSocket queries, because it sets the
peer hostname to \a hostname and the peer's port number to \a
- port. The specified \a networkConfiguration
- is used to resolve the proxy settings.
+ port. The specified \a networkConfiguration parameter is ignored.
\sa networkConfiguration()
*/
@@ -1162,7 +1162,7 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi
const QString &protocolTag,
QueryType queryType)
{
- d->config = networkConfiguration;
+ Q_UNUSED(networkConfiguration);
d->remote.setScheme(protocolTag);
d->remote.setHost(hostname);
d->remote.setPort(port);
@@ -1170,11 +1170,13 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi
}
/*!
+ \deprecated
+
Constructs a QNetworkProxyQuery of type \a queryType and sets the
protocol tag to be \a protocolTag. This constructor is suitable
for QNetworkProxyQuery::TcpSocket queries because it sets the
local port number to \a bindPort. The specified \a networkConfiguration
- is used to resolve the proxy settings.
+ parameter is ignored.
Note that \a bindPort is of type quint16 to indicate the exact
port number that is requested. The value of -1 (unknown) is not
@@ -1186,12 +1188,12 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi
quint16 bindPort, const QString &protocolTag,
QueryType queryType)
{
- d->config = networkConfiguration;
+ Q_UNUSED(networkConfiguration);
d->remote.setScheme(protocolTag);
d->localPort = bindPort;
d->type = queryType;
}
-#endif
+#endif // !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
/*!
Constructs a QNetworkProxyQuery object that is a copy of \a other.
@@ -1415,34 +1417,32 @@ void QNetworkProxyQuery::setUrl(const QUrl &url)
d->remote = url;
}
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
/*!
- Returns the network configuration component of the query.
+ \deprecated
+
+ Returns QNetworkConfiguration().
\sa setNetworkConfiguration()
*/
QNetworkConfiguration QNetworkProxyQuery::networkConfiguration() const
{
- return d ? d->config : QNetworkConfiguration();
+ return QNetworkConfiguration();
}
/*!
- Sets the network configuration component of this QNetworkProxyQuery
- object to be \a networkConfiguration. The network configuration can
- be used to return different proxy settings based on the network in
- use, for example WLAN vs cellular networks on a mobile phone.
+ \deprecated
- In the case of "user choice" or "service network" configurations,
- you should first start the QNetworkSession and obtain the active
- configuration from its properties.
+ This function does nothing. The specified \a networkConfiguration parameter
+ is ignored.
\sa networkConfiguration()
*/
void QNetworkProxyQuery::setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration)
{
- d->config = networkConfiguration;
+ Q_UNUSED(networkConfiguration);
}
-#endif
+#endif // !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
/*!
\class QNetworkProxyFactory
diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h
index 8699c313e9..7e3e6906a8 100644
--- a/src/network/kernel/qnetworkproxy.h
+++ b/src/network/kernel/qnetworkproxy.h
@@ -75,12 +75,15 @@ public:
QueryType queryType = TcpSocket);
explicit QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(),
QueryType queryType = TcpServer);
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
+ Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
const QUrl &requestUrl, QueryType queryType = UrlRequest);
+ Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
const QString &hostname, int port, const QString &protocolTag = QString(),
QueryType queryType = TcpSocket);
+ Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
quint16 bindPort, const QString &protocolTag = QString(),
QueryType queryType = TcpServer);
@@ -116,8 +119,10 @@ public:
QUrl url() const;
void setUrl(const QUrl &url);
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
+ Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
QNetworkConfiguration networkConfiguration() const;
+ Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
void setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration);
#endif
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 7ecbf35489..9cb6c4be57 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -943,7 +943,9 @@ void QAbstractSocketPrivate::resolveProxy(const QString &hostname, quint16 port)
// DefaultProxy here will raise an error
proxyInUse = QNetworkProxy();
}
+#endif // !QT_NO_NETWORKPROXY
+#if !defined(QT_NO_NETWORKPROXY) || defined(Q_OS_WINRT)
/*!
\internal
@@ -981,7 +983,7 @@ void QAbstractSocketPrivate::startConnectingByName(const QString &host)
emit q->stateChanged(state);
}
-#endif
+#endif // !QT_NO_NETWORKPROXY || Q_OS_WINRT
/*! \internal
@@ -1113,10 +1115,6 @@ void QAbstractSocketPrivate::_q_connectToNextAddress()
// (localhost address on BSD or any UDP connect), emit
// connected() and return.
if (
-#if defined(Q_OS_WINRT) && _MSC_VER >= 1900
- !qEnvironmentVariableIsEmpty("QT_WINRT_USE_THREAD_NETWORK_CONTEXT") ?
- socketEngine->connectToHostByName(hostName, port) :
-#endif
socketEngine->connectToHost(host, port)) {
//_q_testConnection();
fetchConnectionParameters();
@@ -1712,6 +1710,7 @@ void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,
QIODevice::open(openMode);
d->readChannelCount = d->writeChannelCount = 0;
+#ifndef Q_OS_WINRT
d->state = HostLookupState;
emit stateChanged(d->state);
@@ -1749,6 +1748,10 @@ void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,
(d->state == ConnectingState || d->state == HostLookupState)
? " (connection in progress)" : "");
#endif
+#else // !Q_OS_WINRT
+ // On WinRT we should always connect by name. Lookup and proxy handling are done by the API.
+ d->startConnectingByName(hostName);
+#endif
}
/*! \overload
diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index 3fcec954e7..a9789b7d04 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -41,6 +41,10 @@
#include "qlocalserver_p.h"
#include "qlocalsocket.h"
+#if defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP)
+#include <QtCore/qt_windows.h>
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -181,6 +185,42 @@ QLocalServer::SocketOptions QLocalServer::socketOptions() const
}
/*!
+ \since 5.10
+ Returns the native socket descriptor the server uses to listen
+ for incoming instructions, or -1 if the server is not listening.
+
+ The type of the descriptor depends on the platform:
+ \list
+ \li On Windows, the returned value is a
+ \l{https://msdn.microsoft.com/en-us/library/windows/desktop/ms740522(v=vs.85).aspx}
+ {Winsock 2 Socket Handle}.
+
+ \li With WinRT and on INTEGRITY, the returned value is the
+ QTcpServer socket descriptor and the type is defined by
+ \l{QTcpServer::socketDescriptor}{socketDescriptor}.
+
+ \li On all other UNIX-like operating systems, the type is
+ a file descriptor representing a listening socket.
+ \endlist
+
+ \sa listen()
+*/
+qintptr QLocalServer::socketDescriptor() const
+{
+ Q_D(const QLocalServer);
+ if (!isListening())
+ return -1;
+#if defined(QT_LOCALSOCKET_TCP)
+ return d->tcpServer.socketDescriptor();
+#elif defined(Q_OS_WIN)
+ const auto handle = d->connectionEventNotifier->handle();
+ return handle != INVALID_HANDLE_VALUE ? qintptr(handle) : -1;
+#else
+ return d->socketNotifier->socket();
+#endif
+}
+
+/*!
Stop listening for incoming connections. Existing connections are not
affected, but any new connections will be refused.
diff --git a/src/network/socket/qlocalserver.h b/src/network/socket/qlocalserver.h
index 9bd2990389..454ac30c9b 100644
--- a/src/network/socket/qlocalserver.h
+++ b/src/network/socket/qlocalserver.h
@@ -92,6 +92,8 @@ public:
void setSocketOptions(SocketOptions options);
SocketOptions socketOptions() const;
+ qintptr socketDescriptor() const;
+
protected:
virtual void incomingConnection(quintptr socketDescriptor);
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 090a9e98c6..6fec2fdbd2 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -126,6 +126,20 @@ QT_BEGIN_NAMESPACE
The socket descriptor is not available when QLocalSocket
is in UnconnectedState.
+ The type of the descriptor depends on the platform:
+
+ \list
+ \li On Windows, the returned value is a
+ \l{https://msdn.microsoft.com/en-us/library/windows/desktop/ms740522(v=vs.85).aspx}
+ {Winsock 2 Socket Handle}.
+
+ \li With WinRT and on INTEGRITY, the returned value is the
+ QTcpSocket socket descriptor and the type is defined by
+ \l{QTcpSocket::socketDescriptor}{socketDescriptor}.
+
+ \li On all other UNIX-like operating systems, the type is
+ a file descriptor representing a socket.
+ \endlist
\sa setSocketDescriptor()
*/
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 312c934632..ae94cb9d51 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -183,10 +183,8 @@ void QLocalSocket::connectToServer(OpenMode openMode)
}
// we have a valid handle
- if (setSocketDescriptor((qintptr)localSocket, ConnectedState, openMode)) {
- d->handle = localSocket;
+ if (setSocketDescriptor((qintptr)localSocket, ConnectedState, openMode))
emit connected();
- }
}
// This is reading from the buffer
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index 3f7c0d94e1..03395a37f0 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -1162,6 +1162,7 @@ bool QNativeSocketEngine::waitForReadOrWrite(bool *readyToRead, bool *readyToWri
return ret > 0;
}
+#if 0 // currently unused
/*!
Returns the size of the operating system's socket receive
buffer. Depending on the operating system, this size may be
@@ -1220,7 +1221,7 @@ void QNativeSocketEngine::setSendBufferSize(qint64 size)
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::setSendBufferSize(), Q_VOID);
setOption(SendBufferSocketOption, size);
}
-
+#endif
/*!
Sets the option \a option to the value \a value.
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 08e72072ef..d488ce150c 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -166,11 +166,13 @@ public:
qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
qint64 bytesToWrite() const Q_DECL_OVERRIDE;
+#if 0 // currently unused
qint64 receiveBufferSize() const;
void setReceiveBufferSize(qint64 bufferSize);
qint64 sendBufferSize() const;
void setSendBufferSize(qint64 bufferSize);
+#endif
int option(SocketOption option) const Q_DECL_OVERRIDE;
bool setOption(SocketOption option, int value) Q_DECL_OVERRIDE;
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 3cf65b3553..a8f756dc31 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -670,8 +670,7 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d,
Q_IPV6ADDR ip6 = groupAddress.toIPv6Address();
memcpy(&mreq6.ipv6mr_multiaddr, &ip6, sizeof(ip6));
mreq6.ipv6mr_interface = interface.index();
- } else
- if (groupAddress.protocol() == QAbstractSocket::IPv4Protocol) {
+ } else if (groupAddress.protocol() == QAbstractSocket::IPv4Protocol) {
level = IPPROTO_IP;
sockOpt = how4;
sockArg = &mreq4;
@@ -835,7 +834,7 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
QT_SOCKLEN_T storageSize = sizeof(storage);
memset(&storage, 0, storageSize);
- // Peek 0 bytes into the next message. The size of the message may
+ // Peek 1 bytes into the next message. The size of the message may
// well be 0, so we can't check recvfrom's return value.
ssize_t readBytes;
do {
@@ -856,8 +855,20 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
{
- QVarLengthArray<char, 8192> udpMessagePeekBuffer(8192);
ssize_t recvResult = -1;
+#ifdef Q_OS_LINUX
+ // Linux can return the actual datagram size if we use MSG_TRUNC
+ char c;
+ EINTR_LOOP(recvResult, ::recv(socketDescriptor, &c, 1, MSG_PEEK | MSG_TRUNC));
+#elif defined(SO_NREAD)
+ // macOS can return the actual datagram size if we use SO_NREAD
+ int value;
+ socklen_t valuelen = sizeof(value);
+ recvResult = getsockopt(socketDescriptor, SOL_SOCKET, SO_NREAD, &value, &valuelen);
+ if (recvResult != -1)
+ recvResult = value;
+#else
+ QVarLengthArray<char, 8192> udpMessagePeekBuffer(8192);
for (;;) {
// the data written to udpMessagePeekBuffer is discarded, so
@@ -873,6 +884,7 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
udpMessagePeekBuffer.resize(udpMessagePeekBuffer.size() * 2);
}
+#endif
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativePendingDatagramSize() == %zd", recvResult);
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index eb633eb1d2..e21bf29d4b 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -944,9 +944,7 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d,
Q_IPV6ADDR ip6 = groupAddress.toIPv6Address();
memcpy(&mreq6.ipv6mr_multiaddr, &ip6, sizeof(ip6));
mreq6.ipv6mr_interface = iface.index();
- } else
-
- if (groupAddress.protocol() == QAbstractSocket::IPv4Protocol) {
+ } else if (groupAddress.protocol() == QAbstractSocket::IPv4Protocol) {
level = IPPROTO_IP;
sockOpt = how4;
sockArg = reinterpret_cast<char *>(&mreq4);
diff --git a/src/network/socket/qtcpserver_p.h b/src/network/socket/qtcpserver_p.h
index 71dc4d985f..b7fae4c105 100644
--- a/src/network/socket/qtcpserver_p.h
+++ b/src/network/socket/qtcpserver_p.h
@@ -63,7 +63,8 @@
QT_BEGIN_NAMESPACE
-class QTcpServerPrivate : public QObjectPrivate, public QAbstractSocketEngineReceiver
+class Q_NETWORK_EXPORT QTcpServerPrivate : public QObjectPrivate,
+ public QAbstractSocketEngineReceiver
{
Q_DECLARE_PUBLIC(QTcpServer)
public:
diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp
index 28b7eda54a..71e514a025 100644
--- a/src/network/ssl/qsslcertificate_openssl.cpp
+++ b/src/network/ssl/qsslcertificate_openssl.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -64,12 +65,14 @@ bool QSslCertificate::operator==(const QSslCertificate &other) const
uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW
{
if (X509 * const x509 = key.d->x509) {
- (void)q_X509_cmp(x509, x509); // populate x509->sha1_hash
- // (if someone knows a better way...)
- return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed);
- } else {
- return seed;
+ const EVP_MD *sha1 = q_EVP_sha1();
+ unsigned int len = 0;
+ unsigned char md[EVP_MAX_MD_SIZE];
+ q_X509_digest(x509, sha1, md, &len);
+ return qHashBits(md, len, seed);
}
+
+ return seed;
}
bool QSslCertificate::isNull() const
@@ -89,8 +92,7 @@ QByteArray QSslCertificate::version() const
{
QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
if (d->versionString.isEmpty() && d->x509)
- d->versionString =
- QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
+ d->versionString = QByteArray::number(qlonglong(q_X509_get_version(d->x509)) + 1);
return d->versionString;
}
@@ -99,7 +101,7 @@ QByteArray QSslCertificate::serialNumber() const
{
QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
if (d->serialNumberString.isEmpty() && d->x509) {
- ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
+ ASN1_INTEGER *serialNumber = q_X509_get_serialNumber(d->x509);
QByteArray hexString;
hexString.reserve(serialNumber->length * 3);
for (int a = 0; a < serialNumber->length; ++a) {
@@ -199,14 +201,15 @@ QMultiMap<QSsl::AlternativeNameEntryType, QString> QSslCertificate::subjectAlter
continue;
}
- const char *altNameStr = reinterpret_cast<const char *>(q_ASN1_STRING_data(genName->d.ia5));
+ const char *altNameStr = reinterpret_cast<const char *>(q_ASN1_STRING_get0_data(genName->d.ia5));
const QString altName = QString::fromLatin1(altNameStr, len);
if (genName->type == GEN_DNS)
result.insert(QSsl::DnsEntry, altName);
else if (genName->type == GEN_EMAIL)
result.insert(QSsl::EmailEntry, altName);
}
- q_sk_pop_free((STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_sk_free));
+
+ q_OPENSSL_sk_pop_free((OPENSSL_STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_OPENSSL_sk_free));
}
return result;
@@ -235,25 +238,26 @@ QSslKey QSslCertificate::publicKey() const
QSslKey key;
key.d->type = QSsl::PublicKey;
- X509_PUBKEY *xkey = d->x509->cert_info->key;
- EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);
+
+ EVP_PKEY *pkey = q_X509_get_pubkey(d->x509);
Q_ASSERT(pkey);
+ const int keyType = q_EVP_PKEY_type(q_EVP_PKEY_base_id(pkey));
- if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
+ if (keyType == EVP_PKEY_RSA) {
key.d->rsa = q_EVP_PKEY_get1_RSA(pkey);
key.d->algorithm = QSsl::Rsa;
key.d->isNull = false;
- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) {
+ } else if (keyType == EVP_PKEY_DSA) {
key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);
key.d->algorithm = QSsl::Dsa;
key.d->isNull = false;
#ifndef OPENSSL_NO_EC
- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_EC) {
+ } else if (keyType == EVP_PKEY_EC) {
key.d->ec = q_EVP_PKEY_get1_EC_KEY(pkey);
key.d->algorithm = QSsl::Ec;
key.d->isNull = false;
#endif
- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
+ } else if (keyType == EVP_PKEY_DH) {
// DH unsupported
} else {
// error?
@@ -275,7 +279,7 @@ static QVariant x509UnknownExtensionToValue(X509_EXTENSION *ext)
X509V3_EXT_METHOD *meth = const_cast<X509V3_EXT_METHOD *>(q_X509V3_EXT_get(ext));
if (!meth) {
ASN1_OCTET_STRING *value = q_X509_EXTENSION_get_data(ext);
- QByteArray result( reinterpret_cast<const char *>(q_ASN1_STRING_data(value)),
+ QByteArray result( reinterpret_cast<const char *>(q_ASN1_STRING_get0_data(value)),
q_ASN1_STRING_length(value));
return result;
}
@@ -371,7 +375,7 @@ static QVariant x509ExtensionToValue(X509_EXTENSION *ext)
continue;
}
- const char *uriStr = reinterpret_cast<const char *>(q_ASN1_STRING_data(name->d.uniformResourceIdentifier));
+ const char *uriStr = reinterpret_cast<const char *>(q_ASN1_STRING_get0_data(name->d.uniformResourceIdentifier));
const QString uri = QString::fromUtf8(uriStr, len);
result[QString::fromUtf8(QSslCertificatePrivate::asn1ObjectName(ad->method))] = uri;
@@ -380,11 +384,7 @@ static QVariant x509ExtensionToValue(X509_EXTENSION *ext)
}
}
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- q_sk_pop_free((_STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));
-#else
- q_sk_pop_free((STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));
-#endif
+ q_OPENSSL_sk_pop_free((OPENSSL_STACK*)info, reinterpret_cast<void(*)(void *)>(q_OPENSSL_sk_free));
return result;
}
break;
@@ -607,7 +607,11 @@ static QMap<QByteArray, QString> _q_mapFromX509Name(X509_NAME *name)
unsigned char *data = 0;
int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e));
info.insertMulti(name, QString::fromUtf8((char*)data, size));
+#if QT_CONFIG(opensslv11)
+ q_CRYPTO_free(data, 0, 0);
+#else
q_CRYPTO_free(data);
+#endif
}
return info;
@@ -619,8 +623,9 @@ QSslCertificate QSslCertificatePrivate::QSslCertificate_from_X509(X509 *x509)
if (!x509 || !QSslSocket::supportsSsl())
return certificate;
- ASN1_TIME *nbef = q_X509_get_notBefore(x509);
- ASN1_TIME *naft = q_X509_get_notAfter(x509);
+ ASN1_TIME *nbef = q_X509_getm_notBefore(x509);
+ ASN1_TIME *naft = q_X509_getm_notAfter(x509);
+
certificate.d->notValidBefore = q_getTimeFromASN1(nbef);
certificate.d->notValidAfter = q_getTimeFromASN1(naft);
certificate.d->null = false;
diff --git a/src/network/ssl/qsslcertificate_qt.cpp b/src/network/ssl/qsslcertificate_qt.cpp
index 5e8f4cfac7..1cc2b1f964 100644
--- a/src/network/ssl/qsslcertificate_qt.cpp
+++ b/src/network/ssl/qsslcertificate_qt.cpp
@@ -272,17 +272,12 @@ QList<QSslCertificate> QSslCertificatePrivate::certificatesFromDer(const QByteAr
static QByteArray colonSeparatedHex(const QByteArray &value)
{
- QByteArray hexString;
- hexString.reserve(value.size() * 3);
- for (int a = 0; a < value.size(); ++a) {
- const quint8 b = value.at(a);
- if (b || !hexString.isEmpty()) { // skip leading zeros
- hexString += QByteArray::number(b, 16).rightJustified(2, '0');
- hexString += ':';
- }
- }
- hexString.chop(1);
- return hexString;
+ const int size = value.size();
+ int i = 0;
+ while (i < size && !value.at(i)) // skip leading zeros
+ ++i;
+
+ return value.mid(i).toHex(':');
}
bool QSslCertificatePrivate::parse(const QByteArray &data)
diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp
index c92d8fc3f8..cef503710c 100644
--- a/src/network/ssl/qsslcontext_openssl.cpp
+++ b/src/network/ssl/qsslcontext_openssl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
** Copyright (C) 2014 Governikus GmbH & Co. KG.
** Contact: https://www.qt.io/licensing/
@@ -41,22 +41,14 @@
#include <QtNetwork/qsslsocket.h>
-#include <QtNetwork/qssldiffiehellmanparameters.h>
-#include <QtCore/qmutex.h>
#include "private/qssl_p.h"
#include "private/qsslcontext_openssl_p.h"
-#include "private/qsslsocket_p.h"
#include "private/qsslsocket_openssl_p.h"
#include "private/qsslsocket_openssl_symbols_p.h"
-#include "private/qssldiffiehellmanparameters_p.h"
QT_BEGIN_NAMESPACE
-// defined in qsslsocket_openssl.cpp:
-extern int q_X509Callback(int ok, X509_STORE_CTX *ctx);
-extern QString getErrorsFromOpenSsl();
-
QSslContext::QSslContext()
: ctx(0),
pkey(0),
@@ -78,301 +70,6 @@ QSslContext::~QSslContext()
q_SSL_SESSION_free(session);
}
-static inline QString msgErrorSettingEllipticCurves(const QString &why)
-{
- return QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(why);
-}
-
-// static
-void QSslContext::initSslContext(QSslContext *sslContext, QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
-{
- sslContext->sslConfiguration = configuration;
- sslContext->errorCode = QSslError::NoError;
-
- bool client = (mode == QSslSocket::SslClientMode);
-
- bool reinitialized = false;
- bool unsupportedProtocol = false;
-init_context:
- switch (sslContext->sslConfiguration.protocol()) {
- case QSsl::SslV2:
-#ifndef OPENSSL_NO_SSL2
- sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv2_client_method() : q_SSLv2_server_method());
-#else
- // SSL 2 not supported by the system, but chosen deliberately -> error
- sslContext->ctx = 0;
- unsupportedProtocol = true;
-#endif
- break;
- case QSsl::SslV3:
-#ifndef OPENSSL_NO_SSL3_METHOD
- sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
-#else
- // SSL 3 not supported by the system, but chosen deliberately -> error
- sslContext->ctx = 0;
- unsupportedProtocol = true;
-#endif
- break;
- case QSsl::SecureProtocols:
- // SSLv2 and SSLv3 will be disabled by SSL options
- // But we need q_SSLv23_server_method() otherwise AnyProtocol will be unable to connect on Win32.
- case QSsl::TlsV1SslV3:
- // SSLv2 will will be disabled by SSL options
- case QSsl::AnyProtocol:
- default:
- sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
- break;
- case QSsl::TlsV1_0:
- sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_client_method() : q_TLSv1_server_method());
- break;
- case QSsl::TlsV1_1:
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_1_client_method() : q_TLSv1_1_server_method());
-#else
- // TLS 1.1 not supported by the system, but chosen deliberately -> error
- sslContext->ctx = 0;
- unsupportedProtocol = true;
-#endif
- break;
- case QSsl::TlsV1_2:
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_2_client_method() : q_TLSv1_2_server_method());
-#else
- // TLS 1.2 not supported by the system, but chosen deliberately -> error
- sslContext->ctx = 0;
- unsupportedProtocol = true;
-#endif
- break;
- case QSsl::TlsV1_0OrLater:
- // Specific protocols will be specified via SSL options.
- sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
- break;
- case QSsl::TlsV1_1OrLater:
- case QSsl::TlsV1_2OrLater:
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- // Specific protocols will be specified via SSL options.
- sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
-#else
- // TLS 1.1/1.2 not supported by the system, but chosen deliberately -> error
- sslContext->ctx = 0;
- unsupportedProtocol = true;
-#endif
- break;
- }
-
- if (!sslContext->ctx) {
- // After stopping Flash 10 the SSL library looses its ciphers. Try re-adding them
- // by re-initializing the library.
- if (!reinitialized) {
- reinitialized = true;
- if (q_SSL_library_init() == 1)
- goto init_context;
- }
-
- sslContext->errorStr = QSslSocket::tr("Error creating SSL context (%1)").arg(
- unsupportedProtocol ? QSslSocket::tr("unsupported protocol") : QSslSocketBackendPrivate::getErrorsFromOpenSsl()
- );
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
-
- // Enable bug workarounds.
- long options = QSslSocketBackendPrivate::setupOpenSslOptions(configuration.protocol(), configuration.d->sslOptions);
- q_SSL_CTX_set_options(sslContext->ctx, options);
-
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- // Tell OpenSSL to release memory early
- // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
- if (q_SSLeay() >= 0x10000000L)
- q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
-#endif
-
- // Initialize ciphers
- QByteArray cipherString;
- bool first = true;
- QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
- if (ciphers.isEmpty())
- ciphers = QSslSocketPrivate::defaultCiphers();
- for (const QSslCipher &cipher : qAsConst(ciphers)) {
- if (first)
- first = false;
- else
- cipherString.append(':');
- cipherString.append(cipher.name().toLatin1());
- }
-
- if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
- sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
-
- const QDateTime now = QDateTime::currentDateTimeUtc();
-
- // Add all our CAs to this store.
- const auto caCertificates = sslContext->sslConfiguration.caCertificates();
- for (const QSslCertificate &caCertificate : caCertificates) {
- // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
- //
- // If several CA certificates matching the name, key identifier, and
- // serial number condition are available, only the first one will be
- // examined. This may lead to unexpected results if the same CA
- // certificate is available with different expiration dates. If a
- // ``certificate expired'' verification error occurs, no other
- // certificate will be searched. Make sure to not have expired
- // certificates mixed with valid ones.
- //
- // See also: QSslSocketBackendPrivate::verify()
- if (caCertificate.expiryDate() >= now) {
- q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
- }
- }
-
- if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
- // tell OpenSSL the directories where to look up the root certs on demand
- const QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
- for (const QByteArray &unixDir : unixDirs)
- q_SSL_CTX_load_verify_locations(sslContext->ctx, 0, unixDir.constData());
- }
-
- if (!sslContext->sslConfiguration.localCertificate().isNull()) {
- // Require a private key as well.
- if (sslContext->sslConfiguration.privateKey().isNull()) {
- sslContext->errorStr = QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
-
- // Load certificate
- if (!q_SSL_CTX_use_certificate(sslContext->ctx, (X509 *)sslContext->sslConfiguration.localCertificate().handle())) {
- sslContext->errorStr = QSslSocket::tr("Error loading local certificate, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
-
- if (configuration.d->privateKey.algorithm() == QSsl::Opaque) {
- sslContext->pkey = reinterpret_cast<EVP_PKEY *>(configuration.d->privateKey.handle());
- } else {
- // Load private key
- sslContext->pkey = q_EVP_PKEY_new();
- // before we were using EVP_PKEY_assign_R* functions and did not use EVP_PKEY_free.
- // this lead to a memory leak. Now we use the *_set1_* functions which do not
- // take ownership of the RSA/DSA key instance because the QSslKey already has ownership.
- if (configuration.d->privateKey.algorithm() == QSsl::Rsa)
- q_EVP_PKEY_set1_RSA(sslContext->pkey, reinterpret_cast<RSA *>(configuration.d->privateKey.handle()));
- else if (configuration.d->privateKey.algorithm() == QSsl::Dsa)
- q_EVP_PKEY_set1_DSA(sslContext->pkey, reinterpret_cast<DSA *>(configuration.d->privateKey.handle()));
-#ifndef OPENSSL_NO_EC
- else if (configuration.d->privateKey.algorithm() == QSsl::Ec)
- q_EVP_PKEY_set1_EC_KEY(sslContext->pkey, reinterpret_cast<EC_KEY *>(configuration.d->privateKey.handle()));
-#endif
- }
-
- if (!q_SSL_CTX_use_PrivateKey(sslContext->ctx, sslContext->pkey)) {
- sslContext->errorStr = QSslSocket::tr("Error loading private key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
- if (configuration.d->privateKey.algorithm() == QSsl::Opaque)
- sslContext->pkey = 0; // Don't free the private key, it belongs to QSslKey
-
- // Check if the certificate matches the private key.
- if (!q_SSL_CTX_check_private_key(sslContext->ctx)) {
- sslContext->errorStr = QSslSocket::tr("Private key does not certify public key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
-
- // If we have any intermediate certificates then we need to add them to our chain
- bool first = true;
- for (const QSslCertificate &cert : qAsConst(configuration.d->localCertificateChain)) {
- if (first) {
- first = false;
- continue;
- }
- q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0,
- q_X509_dup(reinterpret_cast<X509 *>(cert.handle())));
- }
- }
-
- // Initialize peer verification.
- if (sslContext->sslConfiguration.peerVerifyMode() == QSslSocket::VerifyNone) {
- q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_NONE, 0);
- } else {
- q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_PEER, q_X509Callback);
- }
-
- // Set verification depth.
- if (sslContext->sslConfiguration.peerVerifyDepth() != 0)
- q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
-
- // set persisted session if the user set it
- if (!configuration.sessionTicket().isEmpty())
- sslContext->setSessionASN1(configuration.sessionTicket());
-
- // Set temp DH params
- QSslDiffieHellmanParameters dhparams = configuration.diffieHellmanParameters();
-
- if (!dhparams.isValid()) {
- sslContext->errorStr = QSslSocket::tr("Diffie-Hellman parameters are not valid");
- sslContext->errorCode = QSslError::UnspecifiedError;
- return;
- }
-
- if (!dhparams.isEmpty()) {
- const QByteArray &params = dhparams.d->derData;
- const char *ptr = params.constData();
- DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
- if (dh == NULL)
- qFatal("q_d2i_DHparams failed to convert QSslDiffieHellmanParameters to DER form");
- q_SSL_CTX_set_tmp_dh(sslContext->ctx, dh);
- q_DH_free(dh);
- }
-
-#ifndef OPENSSL_NO_EC
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
- if (q_SSLeay() >= 0x10002000L) {
- q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL);
- } else
-#endif
- {
- // Set temp ECDH params
- EC_KEY *ecdh = 0;
- ecdh = q_EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
- q_SSL_CTX_set_tmp_ecdh(sslContext->ctx, ecdh);
- q_EC_KEY_free(ecdh);
- }
-#endif // OPENSSL_NO_EC
-
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
- if (!client)
- q_SSL_CTX_use_psk_identity_hint(sslContext->ctx, sslContext->sslConfiguration.preSharedKeyIdentityHint().constData());
-#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
-
- const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
- if (!qcurves.isEmpty()) {
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
- // Set the curves to be used
- if (q_SSLeay() >= 0x10002000L) {
- // SSL_CTX_ctrl wants a non-const pointer as last argument,
- // but let's avoid a copy into a temporary array
- if (!q_SSL_CTX_ctrl(sslContext->ctx,
- SSL_CTRL_SET_CURVES,
- qcurves.size(),
- const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())))) {
- sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
- sslContext->errorCode = QSslError::UnspecifiedError;
- }
- } else
-#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
- {
- // specific curves requested, but not possible to set -> error
- sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
- sslContext->errorCode = QSslError::UnspecifiedError;
- }
- }
-}
-
QSslContext* QSslContext::fromConfiguration(QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
{
QSslContext *sslContext = new QSslContext();
@@ -463,7 +160,7 @@ SSL* QSslContext::createSsl()
m_npnContext.len = m_supportedNPNVersions.count();
m_npnContext.status = QSslConfiguration::NextProtocolNegotiationNone;
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
- if (q_SSLeay() >= 0x10002000L) {
+ if (QSslSocket::sslLibraryVersionNumber() >= 0x10002000L) {
// Callback's type has a parameter 'const unsigned char ** out'
// since it was introduced in 1.0.2. Internally, OpenSSL's own code
// (tests/examples) cast it to unsigned char * (since it's 'out').
@@ -508,7 +205,7 @@ bool QSslContext::cacheSession(SSL* ssl)
unsigned char *data = reinterpret_cast<unsigned char *>(m_sessionASN1.data());
if (!q_i2d_SSL_SESSION(session, &data))
qCWarning(lcSsl, "could not store persistent version of SSL session");
- m_sessionTicketLifeTimeHint = session->tlsext_tick_lifetime_hint;
+ m_sessionTicketLifeTimeHint = q_SSL_SESSION_get_ticket_lifetime_hint(session);
}
}
diff --git a/src/network/ssl/qsslcontext_openssl11.cpp b/src/network/ssl/qsslcontext_openssl11.cpp
new file mode 100644
index 0000000000..787b6ae3f5
--- /dev/null
+++ b/src/network/ssl/qsslcontext_openssl11.cpp
@@ -0,0 +1,277 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Copyright (C) 2014 Governikus GmbH & Co. KG.
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
+** 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 <QtNetwork/qsslsocket.h>
+#include <QtNetwork/qssldiffiehellmanparameters.h>
+
+#include "private/qssl_p.h"
+#include "private/qsslcontext_openssl_p.h"
+#include "private/qsslsocket_p.h"
+#include "private/qsslsocket_openssl_p.h"
+#include "private/qsslsocket_openssl_symbols_p.h"
+#include "private/qssldiffiehellmanparameters_p.h"
+
+#include <vector>
+
+QT_BEGIN_NAMESPACE
+
+// defined in qsslsocket_openssl.cpp:
+extern int q_X509Callback(int ok, X509_STORE_CTX *ctx);
+extern QString getErrorsFromOpenSsl();
+
+static inline QString msgErrorSettingEllipticCurves(const QString &why)
+{
+ return QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(why);
+}
+
+// static
+void QSslContext::initSslContext(QSslContext *sslContext, QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
+{
+ sslContext->sslConfiguration = configuration;
+ sslContext->errorCode = QSslError::NoError;
+
+ bool client = (mode == QSslSocket::SslClientMode);
+
+ bool reinitialized = false;
+ bool unsupportedProtocol = false;
+init_context:
+ if (sslContext->sslConfiguration.protocol() == QSsl::SslV2) {
+ // SSL 2 is no longer supported, but chosen deliberately -> error
+ sslContext->ctx = nullptr;
+ unsupportedProtocol = true;
+ } else {
+ // The ssl options will actually control the supported methods
+ sslContext->ctx = q_SSL_CTX_new(client ? q_TLS_client_method() : q_TLS_server_method());
+ }
+
+ if (!sslContext->ctx) {
+ // After stopping Flash 10 the SSL library loses its ciphers. Try re-adding them
+ // by re-initializing the library.
+ if (!reinitialized) {
+ reinitialized = true;
+ if (q_OPENSSL_init_ssl(0, nullptr) == 1)
+ goto init_context;
+ }
+
+ sslContext->errorStr = QSslSocket::tr("Error creating SSL context (%1)").arg(
+ unsupportedProtocol ? QSslSocket::tr("unsupported protocol") : QSslSocketBackendPrivate::getErrorsFromOpenSsl()
+ );
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ // Enable bug workarounds.
+ long options = QSslSocketBackendPrivate::setupOpenSslOptions(configuration.protocol(), configuration.d->sslOptions);
+ q_SSL_CTX_set_options(sslContext->ctx, options);
+
+ // Tell OpenSSL to release memory early
+ // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
+ q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
+
+ // Initialize ciphers
+ QByteArray cipherString;
+ bool first = true;
+ QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
+ if (ciphers.isEmpty())
+ ciphers = QSslSocketPrivate::defaultCiphers();
+ for (const QSslCipher &cipher : qAsConst(ciphers)) {
+ if (first)
+ first = false;
+ else
+ cipherString.append(':');
+ cipherString.append(cipher.name().toLatin1());
+ }
+
+ if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
+ sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ const QDateTime now = QDateTime::currentDateTimeUtc();
+
+ // Add all our CAs to this store.
+ const auto caCertificates = sslContext->sslConfiguration.caCertificates();
+ for (const QSslCertificate &caCertificate : caCertificates) {
+ // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
+ //
+ // If several CA certificates matching the name, key identifier, and
+ // serial number condition are available, only the first one will be
+ // examined. This may lead to unexpected results if the same CA
+ // certificate is available with different expiration dates. If a
+ // ``certificate expired'' verification error occurs, no other
+ // certificate will be searched. Make sure to not have expired
+ // certificates mixed with valid ones.
+ //
+ // See also: QSslSocketBackendPrivate::verify()
+ if (caCertificate.expiryDate() >= now) {
+ q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
+ }
+ }
+
+ if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
+ // tell OpenSSL the directories where to look up the root certs on demand
+ const QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
+ for (const QByteArray &unixDir : unixDirs)
+ q_SSL_CTX_load_verify_locations(sslContext->ctx, nullptr, unixDir.constData());
+ }
+
+ if (!sslContext->sslConfiguration.localCertificate().isNull()) {
+ // Require a private key as well.
+ if (sslContext->sslConfiguration.privateKey().isNull()) {
+ sslContext->errorStr = QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ // Load certificate
+ if (!q_SSL_CTX_use_certificate(sslContext->ctx, (X509 *)sslContext->sslConfiguration.localCertificate().handle())) {
+ sslContext->errorStr = QSslSocket::tr("Error loading local certificate, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ if (configuration.d->privateKey.algorithm() == QSsl::Opaque) {
+ sslContext->pkey = reinterpret_cast<EVP_PKEY *>(configuration.d->privateKey.handle());
+ } else {
+ // Load private key
+ sslContext->pkey = q_EVP_PKEY_new();
+ // before we were using EVP_PKEY_assign_R* functions and did not use EVP_PKEY_free.
+ // this lead to a memory leak. Now we use the *_set1_* functions which do not
+ // take ownership of the RSA/DSA key instance because the QSslKey already has ownership.
+ if (configuration.d->privateKey.algorithm() == QSsl::Rsa)
+ q_EVP_PKEY_set1_RSA(sslContext->pkey, reinterpret_cast<RSA *>(configuration.d->privateKey.handle()));
+ else if (configuration.d->privateKey.algorithm() == QSsl::Dsa)
+ q_EVP_PKEY_set1_DSA(sslContext->pkey, reinterpret_cast<DSA *>(configuration.d->privateKey.handle()));
+#ifndef OPENSSL_NO_EC
+ else if (configuration.d->privateKey.algorithm() == QSsl::Ec)
+ q_EVP_PKEY_set1_EC_KEY(sslContext->pkey, reinterpret_cast<EC_KEY *>(configuration.d->privateKey.handle()));
+#endif
+ }
+
+ if (!q_SSL_CTX_use_PrivateKey(sslContext->ctx, sslContext->pkey)) {
+ sslContext->errorStr = QSslSocket::tr("Error loading private key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+ if (configuration.d->privateKey.algorithm() == QSsl::Opaque)
+ sslContext->pkey = nullptr; // Don't free the private key, it belongs to QSslKey
+
+ // Check if the certificate matches the private key.
+ if (!q_SSL_CTX_check_private_key(sslContext->ctx)) {
+ sslContext->errorStr = QSslSocket::tr("Private key does not certify public key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ // If we have any intermediate certificates then we need to add them to our chain
+ bool first = true;
+ for (const QSslCertificate &cert : qAsConst(configuration.d->localCertificateChain)) {
+ if (first) {
+ first = false;
+ continue;
+ }
+ q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0,
+ q_X509_dup(reinterpret_cast<X509 *>(cert.handle())));
+ }
+ }
+
+ // Initialize peer verification.
+ if (sslContext->sslConfiguration.peerVerifyMode() == QSslSocket::VerifyNone) {
+ q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_NONE, nullptr);
+ } else {
+ q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_PEER, q_X509Callback);
+ }
+
+ // Set verification depth.
+ if (sslContext->sslConfiguration.peerVerifyDepth() != 0)
+ q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
+
+ // set persisted session if the user set it
+ if (!configuration.sessionTicket().isEmpty())
+ sslContext->setSessionASN1(configuration.sessionTicket());
+
+ // Set temp DH params
+ QSslDiffieHellmanParameters dhparams = configuration.diffieHellmanParameters();
+
+ if (!dhparams.isValid()) {
+ sslContext->errorStr = QSslSocket::tr("Diffie-Hellman parameters are not valid");
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ if (!dhparams.isEmpty()) {
+ const QByteArray &params = dhparams.d->derData;
+ const char *ptr = params.constData();
+ DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
+ if (dh == NULL)
+ qFatal("q_d2i_DHparams failed to convert QSslDiffieHellmanParameters to DER form");
+ q_SSL_CTX_set_tmp_dh(sslContext->ctx, dh);
+ q_DH_free(dh);
+ }
+
+#ifndef OPENSSL_NO_PSK
+ if (!client)
+ q_SSL_CTX_use_psk_identity_hint(sslContext->ctx, sslContext->sslConfiguration.preSharedKeyIdentityHint().constData());
+#endif // !OPENSSL_NO_PSK
+
+ const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
+ if (!qcurves.isEmpty()) {
+#ifdef OPENSSL_NO_EC
+ sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version with disabled elliptic curves"));
+ sslContext->errorCode = QSslError::UnspecifiedError;
+#else
+ // Set the curves to be used.
+ std::vector<int> curves;
+ curves.reserve(qcurves.size());
+ for (const auto &sslCurve : qcurves)
+ curves.push_back(sslCurve.id);
+ if (!q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_CURVES, long(curves.size()), &curves[0])) {
+ sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ }
+#endif
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslcontext_opensslpre11.cpp b/src/network/ssl/qsslcontext_opensslpre11.cpp
new file mode 100644
index 0000000000..9c01c2f2dc
--- /dev/null
+++ b/src/network/ssl/qsslcontext_opensslpre11.cpp
@@ -0,0 +1,354 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Copyright (C) 2014 Governikus GmbH & Co. KG.
+** 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 <QtNetwork/qsslsocket.h>
+#include <QtNetwork/qssldiffiehellmanparameters.h>
+
+#include "private/qssl_p.h"
+#include "private/qsslcontext_openssl_p.h"
+#include "private/qsslsocket_p.h"
+#include "private/qsslsocket_openssl_p.h"
+#include "private/qsslsocket_openssl_symbols_p.h"
+#include "private/qssldiffiehellmanparameters_p.h"
+
+QT_BEGIN_NAMESPACE
+
+// defined in qsslsocket_openssl.cpp:
+extern int q_X509Callback(int ok, X509_STORE_CTX *ctx);
+extern QString getErrorsFromOpenSsl();
+
+static inline QString msgErrorSettingEllipticCurves(const QString &why)
+{
+ return QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(why);
+}
+
+// static
+void QSslContext::initSslContext(QSslContext *sslContext, QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
+{
+ sslContext->sslConfiguration = configuration;
+ sslContext->errorCode = QSslError::NoError;
+
+ bool client = (mode == QSslSocket::SslClientMode);
+
+ bool reinitialized = false;
+ bool unsupportedProtocol = false;
+init_context:
+ switch (sslContext->sslConfiguration.protocol()) {
+ case QSsl::SslV2:
+#ifndef OPENSSL_NO_SSL2
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv2_client_method() : q_SSLv2_server_method());
+#else
+ // SSL 2 not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = 0;
+ unsupportedProtocol = true;
+#endif
+ break;
+ case QSsl::SslV3:
+#ifndef OPENSSL_NO_SSL3_METHOD
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
+#else
+ // SSL 3 not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = 0;
+ unsupportedProtocol = true;
+#endif
+ break;
+ case QSsl::SecureProtocols:
+ // SSLv2 and SSLv3 will be disabled by SSL options
+ // But we need q_SSLv23_server_method() otherwise AnyProtocol will be unable to connect on Win32.
+ case QSsl::TlsV1SslV3:
+ // SSLv2 will will be disabled by SSL options
+ case QSsl::AnyProtocol:
+ default:
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
+ break;
+ case QSsl::TlsV1_0:
+ sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_client_method() : q_TLSv1_server_method());
+ break;
+ case QSsl::TlsV1_1:
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_1_client_method() : q_TLSv1_1_server_method());
+#else
+ // TLS 1.1 not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = 0;
+ unsupportedProtocol = true;
+#endif
+ break;
+ case QSsl::TlsV1_2:
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_2_client_method() : q_TLSv1_2_server_method());
+#else
+ // TLS 1.2 not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = 0;
+ unsupportedProtocol = true;
+#endif
+ break;
+ case QSsl::TlsV1_0OrLater:
+ // Specific protocols will be specified via SSL options.
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
+ break;
+ case QSsl::TlsV1_1OrLater:
+ case QSsl::TlsV1_2OrLater:
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ // Specific protocols will be specified via SSL options.
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
+#else
+ // TLS 1.1/1.2 not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = 0;
+ unsupportedProtocol = true;
+#endif
+ break;
+ }
+
+ if (!sslContext->ctx) {
+ // After stopping Flash 10 the SSL library loses its ciphers. Try re-adding them
+ // by re-initializing the library.
+ if (!reinitialized) {
+ reinitialized = true;
+ if (q_SSL_library_init() == 1)
+ goto init_context;
+ }
+
+ sslContext->errorStr = QSslSocket::tr("Error creating SSL context (%1)").arg(
+ unsupportedProtocol ? QSslSocket::tr("unsupported protocol") : QSslSocketBackendPrivate::getErrorsFromOpenSsl()
+ );
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ // Enable bug workarounds.
+ long options = QSslSocketBackendPrivate::setupOpenSslOptions(configuration.protocol(), configuration.d->sslOptions);
+ q_SSL_CTX_set_options(sslContext->ctx, options);
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ // Tell OpenSSL to release memory early
+ // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
+ if (q_SSLeay() >= 0x10000000L)
+ q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
+ // Initialize ciphers
+ QByteArray cipherString;
+ bool first = true;
+ QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
+ if (ciphers.isEmpty())
+ ciphers = QSslSocketPrivate::defaultCiphers();
+ for (const QSslCipher &cipher : qAsConst(ciphers)) {
+ if (first)
+ first = false;
+ else
+ cipherString.append(':');
+ cipherString.append(cipher.name().toLatin1());
+ }
+
+ if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
+ sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ const QDateTime now = QDateTime::currentDateTimeUtc();
+
+ // Add all our CAs to this store.
+ const auto caCertificates = sslContext->sslConfiguration.caCertificates();
+ for (const QSslCertificate &caCertificate : caCertificates) {
+ // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
+ //
+ // If several CA certificates matching the name, key identifier, and
+ // serial number condition are available, only the first one will be
+ // examined. This may lead to unexpected results if the same CA
+ // certificate is available with different expiration dates. If a
+ // ``certificate expired'' verification error occurs, no other
+ // certificate will be searched. Make sure to not have expired
+ // certificates mixed with valid ones.
+ //
+ // See also: QSslSocketBackendPrivate::verify()
+ if (caCertificate.expiryDate() >= now) {
+ q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
+ }
+ }
+
+ if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
+ // tell OpenSSL the directories where to look up the root certs on demand
+ const QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
+ for (const QByteArray &unixDir : unixDirs)
+ q_SSL_CTX_load_verify_locations(sslContext->ctx, 0, unixDir.constData());
+ }
+
+ if (!sslContext->sslConfiguration.localCertificate().isNull()) {
+ // Require a private key as well.
+ if (sslContext->sslConfiguration.privateKey().isNull()) {
+ sslContext->errorStr = QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ // Load certificate
+ if (!q_SSL_CTX_use_certificate(sslContext->ctx, (X509 *)sslContext->sslConfiguration.localCertificate().handle())) {
+ sslContext->errorStr = QSslSocket::tr("Error loading local certificate, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ if (configuration.d->privateKey.algorithm() == QSsl::Opaque) {
+ sslContext->pkey = reinterpret_cast<EVP_PKEY *>(configuration.d->privateKey.handle());
+ } else {
+ // Load private key
+ sslContext->pkey = q_EVP_PKEY_new();
+ // before we were using EVP_PKEY_assign_R* functions and did not use EVP_PKEY_free.
+ // this lead to a memory leak. Now we use the *_set1_* functions which do not
+ // take ownership of the RSA/DSA key instance because the QSslKey already has ownership.
+ if (configuration.d->privateKey.algorithm() == QSsl::Rsa)
+ q_EVP_PKEY_set1_RSA(sslContext->pkey, reinterpret_cast<RSA *>(configuration.d->privateKey.handle()));
+ else if (configuration.d->privateKey.algorithm() == QSsl::Dsa)
+ q_EVP_PKEY_set1_DSA(sslContext->pkey, reinterpret_cast<DSA *>(configuration.d->privateKey.handle()));
+#ifndef OPENSSL_NO_EC
+ else if (configuration.d->privateKey.algorithm() == QSsl::Ec)
+ q_EVP_PKEY_set1_EC_KEY(sslContext->pkey, reinterpret_cast<EC_KEY *>(configuration.d->privateKey.handle()));
+#endif
+ }
+
+ if (!q_SSL_CTX_use_PrivateKey(sslContext->ctx, sslContext->pkey)) {
+ sslContext->errorStr = QSslSocket::tr("Error loading private key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+ if (configuration.d->privateKey.algorithm() == QSsl::Opaque)
+ sslContext->pkey = 0; // Don't free the private key, it belongs to QSslKey
+
+ // Check if the certificate matches the private key.
+ if (!q_SSL_CTX_check_private_key(sslContext->ctx)) {
+ sslContext->errorStr = QSslSocket::tr("Private key does not certify public key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ // If we have any intermediate certificates then we need to add them to our chain
+ bool first = true;
+ for (const QSslCertificate &cert : qAsConst(configuration.d->localCertificateChain)) {
+ if (first) {
+ first = false;
+ continue;
+ }
+ q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0,
+ q_X509_dup(reinterpret_cast<X509 *>(cert.handle())));
+ }
+ }
+
+ // Initialize peer verification.
+ if (sslContext->sslConfiguration.peerVerifyMode() == QSslSocket::VerifyNone) {
+ q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_NONE, 0);
+ } else {
+ q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_PEER, q_X509Callback);
+ }
+
+ // Set verification depth.
+ if (sslContext->sslConfiguration.peerVerifyDepth() != 0)
+ q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
+
+ // set persisted session if the user set it
+ if (!configuration.sessionTicket().isEmpty())
+ sslContext->setSessionASN1(configuration.sessionTicket());
+
+ // Set temp DH params
+ QSslDiffieHellmanParameters dhparams = configuration.diffieHellmanParameters();
+
+ if (!dhparams.isValid()) {
+ sslContext->errorStr = QSslSocket::tr("Diffie-Hellman parameters are not valid");
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+
+ if (!dhparams.isEmpty()) {
+ const QByteArray &params = dhparams.d->derData;
+ const char *ptr = params.constData();
+ DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
+ if (dh == NULL)
+ qFatal("q_d2i_DHparams failed to convert QSslDiffieHellmanParameters to DER form");
+ q_SSL_CTX_set_tmp_dh(sslContext->ctx, dh);
+ q_DH_free(dh);
+ }
+
+#ifndef OPENSSL_NO_EC
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ if (q_SSLeay() >= 0x10002000L) {
+ q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL);
+ } else
+#endif
+ {
+ // Set temp ECDH params
+ EC_KEY *ecdh = 0;
+ ecdh = q_EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
+ q_SSL_CTX_set_tmp_ecdh(sslContext->ctx, ecdh);
+ q_EC_KEY_free(ecdh);
+ }
+#endif // OPENSSL_NO_EC
+
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
+ if (!client)
+ q_SSL_CTX_use_psk_identity_hint(sslContext->ctx, sslContext->sslConfiguration.preSharedKeyIdentityHint().constData());
+#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
+
+ const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
+ if (!qcurves.isEmpty()) {
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
+ // Set the curves to be used
+ if (q_SSLeay() >= 0x10002000L) {
+ // SSL_CTX_ctrl wants a non-const pointer as last argument,
+ // but let's avoid a copy into a temporary array
+ if (!q_SSL_CTX_ctrl(sslContext->ctx,
+ SSL_CTRL_SET_CURVES,
+ qcurves.size(),
+ const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())))) {
+ sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ }
+ } else
+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
+ {
+ // specific curves requested, but not possible to set -> error
+ sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
index 90687b05c5..5ebad822f1 100644
--- a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -50,8 +51,8 @@
#include <QtCore/qdebug.h>
#endif
-// For q_BN_is_word.
#include <openssl/bn.h>
+#include <openssl/dh.h>
QT_BEGIN_NAMESPACE
@@ -62,13 +63,6 @@ static bool isSafeDH(DH *dh)
QSslSocketPrivate::ensureInitialized();
- // Mark p < 1024 bits as unsafe.
- if (q_BN_num_bits(dh->p) < 1024) {
- return false;
- }
-
- if (q_DH_check(dh, &status) != 1)
- return false;
// From https://wiki.openssl.org/index.php/Diffie-Hellman_parameters:
//
@@ -81,11 +75,39 @@ static bool isSafeDH(DH *dh)
// Without the test, the IETF parameters would
// fail validation. For details, see Diffie-Hellman
// Parameter Check (when g = 2, must p mod 24 == 11?).
+#if QT_CONFIG(opensslv11)
+ // Mark p < 1024 bits as unsafe.
+ if (q_DH_bits(dh) < 1024)
+ return false;
+
+ if (q_DH_check(dh, &status) != 1)
+ return false;
+
+ const BIGNUM *p = nullptr;
+ const BIGNUM *q = nullptr;
+ const BIGNUM *g = nullptr;
+ q_DH_get0_pqg(dh, &p, &q, &g);
+
+ if (q_BN_is_word(const_cast<BIGNUM *>(g), DH_GENERATOR_2)) {
+ long residue = q_BN_mod_word(p, 24);
+ if (residue == 11 || residue == 23)
+ status &= ~DH_NOT_SUITABLE_GENERATOR;
+ }
+
+#else
+ // Mark p < 1024 bits as unsafe.
+ if (q_BN_num_bits(dh->p) < 1024)
+ return false;
+
+ if (q_DH_check(dh, &status) != 1)
+ return false;
+
if (q_BN_is_word(dh->g, DH_GENERATOR_2)) {
long residue = q_BN_mod_word(dh->p, 24);
if (residue == 11 || residue == 23)
status &= ~DH_NOT_SUITABLE_GENERATOR;
}
+#endif
bad |= DH_CHECK_P_NOT_PRIME;
bad |= DH_CHECK_P_NOT_SAFE_PRIME;
diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h
index 231566063e..57dda19bad 100644
--- a/src/network/ssl/qsslellipticcurve.h
+++ b/src/network/ssl/qsslellipticcurve.h
@@ -80,6 +80,7 @@ private:
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 class QSslContext;
friend class QSslSocketPrivate;
friend class QSslSocketBackendPrivate;
};
diff --git a/src/network/ssl/qsslellipticcurve_openssl.cpp b/src/network/ssl/qsslellipticcurve_openssl.cpp
index e18197b703..8cd14837f0 100644
--- a/src/network/ssl/qsslellipticcurve_openssl.cpp
+++ b/src/network/ssl/qsslellipticcurve_openssl.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Governikus GmbH & Co. KG.
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -78,17 +79,18 @@ QSslEllipticCurve QSslEllipticCurve::fromShortName(const QString &name)
QSslEllipticCurve result;
#ifndef OPENSSL_NO_EC
- const QByteArray curveNameLatin1 = name.toLatin1();
+ const QByteArray curveNameLatin1 = name.toLatin1();
int nid = q_OBJ_sn2nid(curveNameLatin1.data());
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
- if (nid == 0 && q_SSLeay() >= 0x10002000L)
+ if (nid == 0 && QSslSocket::sslLibraryVersionNumber() >= 0x10002000L)
nid = q_EC_curve_nist2nid(curveNameLatin1.data());
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
result.id = nid;
-#endif
+
+#endif // !OPENSSL_NO_EC
return result;
}
diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp
index 26119023d1..aa81b735b9 100644
--- a/src/network/ssl/qsslkey_openssl.cpp
+++ b/src/network/ssl/qsslkey_openssl.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -87,33 +88,30 @@ bool QSslKeyPrivate::fromEVP_PKEY(EVP_PKEY *pkey)
if (pkey == nullptr)
return false;
- if (pkey->type == EVP_PKEY_RSA) {
+#if QT_CONFIG(opensslv11)
+ const int keyType = q_EVP_PKEY_type(q_EVP_PKEY_base_id(pkey));
+#else
+ const int keyType = pkey->type;
+#endif
+ if (keyType == EVP_PKEY_RSA) {
isNull = false;
algorithm = QSsl::Rsa;
type = QSsl::PrivateKey;
-
- rsa = q_RSA_new();
- memcpy(rsa, q_EVP_PKEY_get1_RSA(pkey), sizeof(RSA));
-
+ rsa = q_EVP_PKEY_get1_RSA(pkey);
return true;
- }
- else if (pkey->type == EVP_PKEY_DSA) {
+ } else if (keyType == EVP_PKEY_DSA) {
isNull = false;
algorithm = QSsl::Dsa;
type = QSsl::PrivateKey;
-
- dsa = q_DSA_new();
- memcpy(dsa, q_EVP_PKEY_get1_DSA(pkey), sizeof(DSA));
-
+ dsa = q_EVP_PKEY_get1_DSA(pkey);
return true;
}
#ifndef OPENSSL_NO_EC
- else if (pkey->type == EVP_PKEY_EC) {
+ else if (keyType == EVP_PKEY_EC) {
isNull = false;
algorithm = QSsl::Ec;
type = QSsl::PrivateKey;
- ec = q_EC_KEY_dup(q_EVP_PKEY_get1_EC_KEY(pkey));
-
+ ec = q_EVP_PKEY_get1_EC_KEY(pkey);
return true;
}
#endif
@@ -181,8 +179,8 @@ int QSslKeyPrivate::length() const
return -1;
switch (algorithm) {
- case QSsl::Rsa: return q_BN_num_bits(rsa->n);
- case QSsl::Dsa: return q_BN_num_bits(dsa->p);
+ case QSsl::Rsa: return q_RSA_bits(rsa);
+ case QSsl::Dsa: return q_DSA_bits(dsa);
#ifndef OPENSSL_NO_EC
case QSsl::Ec: return q_EC_GROUP_get_degree(q_EC_KEY_get0_group(ec));
#endif
@@ -276,7 +274,13 @@ Qt::HANDLE QSslKeyPrivate::handle() const
static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv, int enc)
{
- EVP_CIPHER_CTX ctx;
+#if QT_CONFIG(opensslv11)
+ EVP_CIPHER_CTX *ctx = q_EVP_CIPHER_CTX_new();
+#else
+ EVP_CIPHER_CTX evpCipherContext;
+ EVP_CIPHER_CTX *ctx = &evpCipherContext;
+#endif
+
const EVP_CIPHER* type = 0;
int i = 0, len = 0;
@@ -294,21 +298,44 @@ static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data,
QByteArray output;
output.resize(data.size() + EVP_MAX_BLOCK_LENGTH);
- q_EVP_CIPHER_CTX_init(&ctx);
- q_EVP_CipherInit(&ctx, type, NULL, NULL, enc);
- q_EVP_CIPHER_CTX_set_key_length(&ctx, key.size());
+
+#if QT_CONFIG(opensslv11)
+ q_EVP_CIPHER_CTX_reset(ctx);
+#else
+ q_EVP_CIPHER_CTX_init(ctx);
+#endif
+
+ q_EVP_CipherInit(ctx, type, NULL, NULL, enc);
+ q_EVP_CIPHER_CTX_set_key_length(ctx, key.size());
if (cipher == QSslKeyPrivate::Rc2Cbc)
- q_EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
- q_EVP_CipherInit(&ctx, NULL,
+ q_EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
+
+#if QT_CONFIG(opensslv11)
+ // EVP_CipherInit in 1.1 resets the context thus making the calls above useless.
+ // We call EVP_CipherInit_ex instead.
+ q_EVP_CipherInit_ex(ctx, nullptr, nullptr,
+ reinterpret_cast<const unsigned char *>(key.constData()),
+ reinterpret_cast<const unsigned char *>(iv.constData()),
+ enc);
+#else
+ q_EVP_CipherInit(ctx, NULL,
reinterpret_cast<const unsigned char *>(key.constData()),
reinterpret_cast<const unsigned char *>(iv.constData()), enc);
- q_EVP_CipherUpdate(&ctx,
+#endif // opensslv11
+
+ q_EVP_CipherUpdate(ctx,
reinterpret_cast<unsigned char *>(output.data()), &len,
reinterpret_cast<const unsigned char *>(data.constData()), data.size());
- q_EVP_CipherFinal(&ctx,
+ q_EVP_CipherFinal(ctx,
reinterpret_cast<unsigned char *>(output.data()) + len, &i);
len += i;
- q_EVP_CIPHER_CTX_cleanup(&ctx);
+
+#if QT_CONFIG(opensslv11)
+ q_EVP_CIPHER_CTX_reset(ctx);
+ q_EVP_CIPHER_CTX_free(ctx);
+#else
+ q_EVP_CIPHER_CTX_cleanup(ctx);
+#endif
return output.left(len);
}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 9d11506fcb..5c9ebac283 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1993,6 +1993,8 @@ qint64 QSslSocket::readData(char *data, qint64 maxlen)
// possibly trigger another transmit() to decrypt more data from the socket
if (d->plainSocket->bytesAvailable())
QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection);
+ else if (d->state != QAbstractSocket::ConnectedState)
+ return maxlen ? qint64(-1) : qint64(0);
}
return readBytes;
@@ -2013,7 +2015,10 @@ qint64 QSslSocket::writeData(const char *data, qint64 len)
d->writeBuffer.append(data, len);
// make sure we flush to the plain socket's buffer
- QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection);
+ if (!d->flushTriggered) {
+ d->flushTriggered = true;
+ QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection);
+ }
return len;
}
@@ -2032,6 +2037,7 @@ QSslSocketPrivate::QSslSocketPrivate()
, allowRootCertOnDemandLoading(true)
, plainSocket(0)
, paused(false)
+ , flushTriggered(false)
{
QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration);
}
@@ -2054,6 +2060,7 @@ void QSslSocketPrivate::init()
ignoreAllSslErrors = false;
shutdown = false;
pendingClose = false;
+ flushTriggered = false;
// we don't want to clear the ignoreErrorsList, so
// that it is possible setting it before connecting
@@ -2522,6 +2529,10 @@ void QSslSocketPrivate::_q_readChannelFinishedSlot()
void QSslSocketPrivate::_q_flushWriteBuffer()
{
Q_Q(QSslSocket);
+
+ // need to notice if knock-on effects of this flush (e.g. a readReady() via transmit())
+ // make another necessary, so clear flag before calling:
+ flushTriggered = false;
if (!writeBuffer.isEmpty())
q->flush();
}
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 2aecf3407f..68c8ccff89 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -96,16 +96,14 @@ EphemeralSecKeychain::EphemeralSecKeychain()
return;
}
- QString uuidAsString(uuid.toString());
- Q_ASSERT(uuidAsString.size() > 2);
- Q_ASSERT(uuidAsString.startsWith(QLatin1Char('{'))
- && uuidAsString.endsWith(QLatin1Char('}')));
- uuidAsString = uuidAsString.mid(1, uuidAsString.size() - 2);
-
- QString keychainName(QDir::tempPath());
- keychainName.append(QDir::separator());
- keychainName += uuidAsString;
- keychainName += QLatin1String(".keychain");
+ const QByteArray uuidAsByteArray = uuid.toByteArray();
+ Q_ASSERT(uuidAsByteArray.size() > 2);
+ Q_ASSERT(uuidAsByteArray.startsWith('{'));
+ Q_ASSERT(uuidAsByteArray.endsWith('}'));
+ const auto uuidAsString = QLatin1String(uuidAsByteArray.data(), uuidAsByteArray.size()).mid(1, uuidAsByteArray.size() - 2);
+
+ const QString keychainName
+ = QDir::tempPath() + QDir::separator() + uuidAsString + QLatin1String(".keychain");
// SecKeychainCreate, pathName parameter:
//
// "A constant character string representing the POSIX path indicating where
@@ -1108,6 +1106,12 @@ bool QSslSocketBackendPrivate::verifySessionProtocol() const
protocolOk = (sessionProtocol() >= QSsl::SslV3);
else if (configuration.protocol == QSsl::SecureProtocols)
protocolOk = (sessionProtocol() >= QSsl::TlsV1_0);
+ else if (configuration.protocol == QSsl::TlsV1_0OrLater)
+ protocolOk = (sessionProtocol() >= QSsl::TlsV1_0);
+ else if (configuration.protocol == QSsl::TlsV1_1OrLater)
+ protocolOk = (sessionProtocol() >= QSsl::TlsV1_1);
+ else if (configuration.protocol == QSsl::TlsV1_2OrLater)
+ protocolOk = (sessionProtocol() >= QSsl::TlsV1_2);
else
protocolOk = (sessionProtocol() == configuration.protocol);
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index ab82cdcfc9..23a63ed063 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2014 Governikus GmbH & Co. KG
** Contact: https://www.qt.io/licensing/
**
@@ -97,70 +97,6 @@ bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
int QSslSocketBackendPrivate::s_indexForSSLExtraData = -1;
#endif
-/* \internal
-
- From OpenSSL's thread(3) manual page:
-
- OpenSSL can safely be used in multi-threaded applications provided that at
- least two callback functions are set.
-
- locking_function(int mode, int n, const char *file, int line) is needed to
- perform locking on shared data structures. (Note that OpenSSL uses a
- number of global data structures that will be implicitly shared
- whenever multiple threads use OpenSSL.) Multi-threaded
- applications will crash at random if it is not set. ...
- ...
- id_function(void) is a function that returns a thread ID. It is not
- needed on Windows nor on platforms where getpid() returns a different
- ID for each thread (most notably Linux)
-*/
-class QOpenSslLocks
-{
-public:
- inline QOpenSslLocks()
- : initLocker(QMutex::Recursive),
- locksLocker(QMutex::Recursive)
- {
- QMutexLocker locker(&locksLocker);
- int numLocks = q_CRYPTO_num_locks();
- locks = new QMutex *[numLocks];
- memset(locks, 0, numLocks * sizeof(QMutex *));
- }
- inline ~QOpenSslLocks()
- {
- QMutexLocker locker(&locksLocker);
- for (int i = 0; i < q_CRYPTO_num_locks(); ++i)
- delete locks[i];
- delete [] locks;
-
- QSslSocketPrivate::deinitialize();
- }
- inline QMutex *lock(int num)
- {
- QMutexLocker locker(&locksLocker);
- QMutex *tmp = locks[num];
- if (!tmp)
- tmp = locks[num] = new QMutex(QMutex::Recursive);
- return tmp;
- }
-
- QMutex *globalLock()
- {
- return &locksLocker;
- }
-
- QMutex *initLock()
- {
- return &initLocker;
- }
-
-private:
- QMutex initLocker;
- QMutex locksLocker;
- QMutex **locks;
-};
-Q_GLOBAL_STATIC(QOpenSslLocks, openssl_locks)
-
QString QSslSocketBackendPrivate::getErrorsFromOpenSsl()
{
QString errorString;
@@ -175,20 +111,6 @@ QString QSslSocketBackendPrivate::getErrorsFromOpenSsl()
}
extern "C" {
-static void locking_function(int mode, int lockNumber, const char *, int)
-{
- QMutex *mutex = openssl_locks()->lock(lockNumber);
-
- // Lock or unlock it
- if (mode & CRYPTO_LOCK)
- mutex->lock();
- else
- mutex->unlock();
-}
-static unsigned long id_function()
-{
- return (quintptr)QThread::currentThreadId();
-}
#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
static unsigned int q_ssl_psk_client_callback(SSL *ssl,
@@ -227,7 +149,7 @@ QSslSocketBackendPrivate::~QSslSocketBackendPrivate()
destroySslContext();
}
-QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher)
+QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(const SSL_CIPHER *cipher)
{
QSslCipher ciph;
@@ -268,12 +190,12 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph
}
// static
-inline QSslErrorEntry QSslErrorEntry::fromStoreContext(X509_STORE_CTX *ctx) {
- QSslErrorEntry result = {
+inline QSslErrorEntry QSslErrorEntry::fromStoreContext(X509_STORE_CTX *ctx)
+{
+ return {
q_X509_STORE_CTX_get_error(ctx),
q_X509_STORE_CTX_get_error_depth(ctx)
};
- return result;
}
// ### This list is shared between all threads, and protected by a
@@ -283,6 +205,7 @@ struct QSslErrorList
QMutex mutex;
QVector<QSslErrorEntry> errors;
};
+
Q_GLOBAL_STATIC(QSslErrorList, _q_sslErrorList)
int q_X509Callback(int ok, X509_STORE_CTX *ctx)
@@ -312,7 +235,7 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx)
}
#endif
}
- // Always return OK to allow verification to continue. We're handle the
+ // Always return OK to allow verification to continue. We handle the
// errors gracefully after collecting all errors, after verification has
// completed.
return 1;
@@ -397,7 +320,7 @@ bool QSslSocketBackendPrivate::initSslContext()
if (configuration.protocol != QSsl::SslV2 &&
configuration.protocol != QSsl::SslV3 &&
configuration.protocol != QSsl::UnknownProtocol &&
- mode == QSslSocket::SslClientMode && q_SSLeay() >= 0x00090806fL) {
+ mode == QSslSocket::SslClientMode && QSslSocket::sslLibraryVersionNumber() >= 0x00090806fL) {
// Set server hostname on TLS extension. RFC4366 section 3.1 requires it in ACE format.
QString tlsHostName = verificationPeerName.isEmpty() ? q->peerName() : verificationPeerName;
if (tlsHostName.isEmpty())
@@ -438,13 +361,13 @@ bool QSslSocketBackendPrivate::initSslContext()
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
// Save a pointer to this object into the SSL structure.
- if (q_SSLeay() >= 0x10001000L)
+ if (QSslSocket::sslLibraryVersionNumber() >= 0x10001000L)
q_SSL_set_ex_data(ssl, s_indexForSSLExtraData, this);
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
// Set the client callback for PSK
- if (q_SSLeay() >= 0x10001000L) {
+ if (QSslSocket::sslLibraryVersionNumber() >= 0x10001000L) {
if (mode == QSslSocket::SslClientMode)
q_SSL_set_psk_client_callback(ssl, &q_ssl_psk_client_callback);
else if (mode == QSslSocket::SslServerMode)
@@ -466,16 +389,6 @@ void QSslSocketBackendPrivate::destroySslContext()
/*!
\internal
-*/
-void QSslSocketPrivate::deinitialize()
-{
- q_CRYPTO_set_id_callback(0);
- q_CRYPTO_set_locking_callback(0);
- q_ERR_free_strings();
-}
-
-/*!
- \internal
Does the minimum amount of initialization to determine whether SSL
is supported or not.
@@ -486,91 +399,6 @@ bool QSslSocketPrivate::supportsSsl()
return ensureLibraryLoaded();
}
-bool QSslSocketPrivate::ensureLibraryLoaded()
-{
- if (!q_resolveOpenSslSymbols())
- return false;
-
- // Check if the library itself needs to be initialized.
- QMutexLocker locker(openssl_locks()->initLock());
-
- if (!s_libraryLoaded) {
- s_libraryLoaded = true;
-
- // Initialize OpenSSL.
- q_CRYPTO_set_id_callback(id_function);
- q_CRYPTO_set_locking_callback(locking_function);
- if (q_SSL_library_init() != 1)
- return false;
- q_SSL_load_error_strings();
- q_OpenSSL_add_all_algorithms();
-
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- if (q_SSLeay() >= 0x10001000L)
- QSslSocketBackendPrivate::s_indexForSSLExtraData = q_SSL_get_ex_new_index(0L, NULL, NULL, NULL, NULL);
-#endif
-
- // Initialize OpenSSL's random seed.
- if (!q_RAND_status()) {
- qWarning("Random number generator not seeded, disabling SSL support");
- return false;
- }
- }
- return true;
-}
-
-void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
-{
- QMutexLocker locker(openssl_locks()->initLock());
- if (s_loadedCiphersAndCerts)
- return;
- s_loadedCiphersAndCerts = true;
-
- resetDefaultCiphers();
- resetDefaultEllipticCurves();
-
-#if QT_CONFIG(library)
- //load symbols needed to receive certificates from system store
-#if defined(Q_OS_WIN)
- HINSTANCE hLib = LoadLibraryW(L"Crypt32");
- if (hLib) {
- ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
- ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
- ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
- if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
- qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
- } else {
- qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
- }
-#elif defined(Q_OS_QNX)
- s_loadRootCertsOnDemand = true;
-#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
- // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
- QList<QByteArray> dirs = unixRootCertDirectories();
- QStringList symLinkFilter;
- symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
- for (int a = 0; a < dirs.count(); ++a) {
- QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
- if (iterator.hasNext()) {
- s_loadRootCertsOnDemand = true;
- break;
- }
- }
-#endif
-#endif // QT_CONFIG(library)
- // if on-demand loading was not enabled, load the certs now
- if (!s_loadRootCertsOnDemand)
- setDefaultCaCertificates(systemCaCertificates());
-#ifdef Q_OS_WIN
- //Enabled for fetching additional root certs from windows update on windows 6+
- //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;
-#endif
-}
/*!
\internal
@@ -587,26 +415,6 @@ void QSslSocketPrivate::ensureInitialized()
ensureCiphersAndCertsLoaded();
}
-long QSslSocketPrivate::sslLibraryVersionNumber()
-{
- if (!supportsSsl())
- return 0;
-
- return q_SSLeay();
-}
-
-QString QSslSocketPrivate::sslLibraryVersionString()
-{
- if (!supportsSsl())
- return QString();
-
- const char *versionString = q_SSLeay_version(SSLEAY_VERSION);
- if (!versionString)
- return QString();
-
- return QString::fromLatin1(versionString);
-}
-
long QSslSocketPrivate::sslLibraryBuildVersionNumber()
{
return OPENSSL_VERSION_NUMBER;
@@ -628,7 +436,11 @@ QString QSslSocketPrivate::sslLibraryBuildVersionString()
*/
void QSslSocketPrivate::resetDefaultCiphers()
{
+#if QT_CONFIG(opensslv11)
+ SSL_CTX *myCtx = q_SSL_CTX_new(q_TLS_client_method());
+#else
SSL_CTX *myCtx = q_SSL_CTX_new(q_SSLv23_client_method());
+#endif
SSL *mySsl = q_SSL_new(myCtx);
QList<QSslCipher> ciphers;
@@ -664,7 +476,7 @@ void QSslSocketPrivate::resetDefaultEllipticCurves()
QVector<QSslEllipticCurve> curves;
#ifndef OPENSSL_NO_EC
- const size_t curveCount = q_EC_get_builtin_curves(NULL, 0);
+ const size_t curveCount = q_EC_get_builtin_curves(nullptr, 0);
QVarLengthArray<EC_builtin_curve> builtinCurves(static_cast<int>(curveCount));
@@ -698,13 +510,14 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
if (ptrCertOpenSystemStoreW && ptrCertFindCertificateInStore && ptrCertCloseStore) {
HCERTSTORE hSystemStore;
hSystemStore = ptrCertOpenSystemStoreW(0, L"ROOT");
- if(hSystemStore) {
- PCCERT_CONTEXT pc = NULL;
- while(1) {
- pc = ptrCertFindCertificateInStore( hSystemStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, pc);
- if(!pc)
+ if (hSystemStore) {
+ PCCERT_CONTEXT pc = nullptr;
+ while (1) {
+ pc = ptrCertFindCertificateInStore(hSystemStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, nullptr, pc);
+ if (!pc)
break;
- QByteArray der((const char *)(pc->pbCertEncoded), static_cast<int>(pc->cbCertEncoded));
+ QByteArray der(reinterpret_cast<const char *>(pc->pbCertEncoded),
+ static_cast<int>(pc->cbCertEncoded));
QSslCertificate cert(der, QSsl::Der);
systemCerts.append(cert);
}
@@ -891,10 +704,9 @@ void QSslSocketBackendPrivate::transmit()
// Write encrypted data from the buffer into the read BIO.
int writtenToBio = q_BIO_write(readBio, data.constData(), encryptedBytesRead);
- // do the actual read() here and throw away the results.
+ // Throw away the results.
if (writtenToBio > 0) {
- // ### TODO: make this cheaper by not making it memcpy. E.g. make it work with data=0x0 or make it work with seek
- plainSocket->read(data.data(), writtenToBio);
+ plainSocket->skip(writtenToBio);
} else {
// ### Better error handling.
setErrorAndEmit(QAbstractSocket::SslInternalError,
@@ -943,15 +755,15 @@ void QSslSocketBackendPrivate::transmit()
// we have a readBufferMaxSize. There's no point in leaving data there
// just so that readBuffer.size() == readBufferMaxSize.
int readBytes = 0;
- data.resize(4096);
- ::memset(data.data(), 0, data.size());
+ const int bytesToRead = 4096;
do {
// Don't use SSL_pending(). It's very unreliable.
- if ((readBytes = q_SSL_read(ssl, data.data(), data.size())) > 0) {
+ readBytes = q_SSL_read(ssl, buffer.reserve(bytesToRead), bytesToRead);
+ if (readBytes > 0) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << "QSslSocketBackendPrivate::transmit: decrypted" << readBytes << "bytes";
#endif
- buffer.append(data.constData(), readBytes);
+ buffer.chop(bytesToRead - readBytes);
if (readyReadEmittedPointer)
*readyReadEmittedPointer = true;
@@ -960,6 +772,7 @@ void QSslSocketBackendPrivate::transmit()
transmitting = true;
continue;
}
+ buffer.chop(bytesToRead);
// Error.
switch (q_SSL_get_error(ssl, readBytes)) {
@@ -1502,14 +1315,8 @@ QSslCipher QSslSocketBackendPrivate::sessionCipher() const
{
if (!ssl)
return QSslCipher();
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- // FIXME This is fairly evil, but needed to keep source level compatibility
- // with the OpenSSL 0.9.x implementation at maximum -- some other functions
- // don't take a const SSL_CIPHER* when they should
- SSL_CIPHER *sessionCipher = const_cast<SSL_CIPHER *>(q_SSL_get_current_cipher(ssl));
-#else
- SSL_CIPHER *sessionCipher = q_SSL_get_current_cipher(ssl);
-#endif
+
+ const SSL_CIPHER *sessionCipher = q_SSL_get_current_cipher(ssl);
return sessionCipher ? QSslCipher_from_SSL_CIPHER(sessionCipher) : QSslCipher();
}
@@ -1535,112 +1342,6 @@ QSsl::SslProtocol QSslSocketBackendPrivate::sessionProtocol() const
return QSsl::UnknownProtocol;
}
-void QSslSocketBackendPrivate::continueHandshake()
-{
- Q_Q(QSslSocket);
- // if we have a max read buffer size, reset the plain socket's to match
- if (readBufferMaxSize)
- plainSocket->setReadBufferSize(readBufferMaxSize);
-
- if (q_SSL_ctrl((ssl), SSL_CTRL_GET_SESSION_REUSED, 0, NULL))
- configuration.peerSessionShared = true;
-
-#ifdef QT_DECRYPT_SSL_TRAFFIC
- if (ssl->session && ssl->s3) {
- const char *mk = reinterpret_cast<const char *>(ssl->session->master_key);
- QByteArray masterKey(mk, ssl->session->master_key_length);
- const char *random = reinterpret_cast<const char *>(ssl->s3->client_random);
- QByteArray clientRandom(random, SSL3_RANDOM_SIZE);
-
- // different format, needed for e.g. older Wireshark versions:
-// const char *sid = reinterpret_cast<const char *>(ssl->session->session_id);
-// QByteArray sessionID(sid, ssl->session->session_id_length);
-// QByteArray debugLineRSA("RSA Session-ID:");
-// debugLineRSA.append(sessionID.toHex().toUpper());
-// debugLineRSA.append(" Master-Key:");
-// debugLineRSA.append(masterKey.toHex().toUpper());
-// debugLineRSA.append("\n");
-
- QByteArray debugLineClientRandom("CLIENT_RANDOM ");
- debugLineClientRandom.append(clientRandom.toHex().toUpper());
- debugLineClientRandom.append(" ");
- debugLineClientRandom.append(masterKey.toHex().toUpper());
- debugLineClientRandom.append("\n");
-
- QString sslKeyFile = QDir::tempPath() + QLatin1String("/qt-ssl-keys");
- QFile file(sslKeyFile);
- if (!file.open(QIODevice::Append))
- qCWarning(lcSsl) << "could not open file" << sslKeyFile << "for appending";
- if (!file.write(debugLineClientRandom))
- qCWarning(lcSsl) << "could not write to file" << sslKeyFile;
- file.close();
- } else {
- qCWarning(lcSsl, "could not decrypt SSL traffic");
- }
-#endif
-
- // Cache this SSL session inside the QSslContext
- if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionSharing)) {
- if (!sslContextPointer->cacheSession(ssl)) {
- sslContextPointer.clear(); // we could not cache the session
- } else {
- // Cache the session for permanent usage as well
- if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionPersistence)) {
- if (!sslContextPointer->sessionASN1().isEmpty())
- configuration.sslSession = sslContextPointer->sessionASN1();
- configuration.sslSessionTicketLifeTimeHint = sslContextPointer->sessionTicketLifeTimeHint();
- }
- }
- }
-
-#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
-
- configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
- if (sslContextPointer->npnContext().status == QSslConfiguration::NextProtocolNegotiationUnsupported) {
- // we could not agree -> be conservative and use HTTP/1.1
- configuration.nextNegotiatedProtocol = QByteArrayLiteral("http/1.1");
- } else {
- const unsigned char *proto = 0;
- unsigned int proto_len = 0;
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
- if (q_SSLeay() >= 0x10002000L) {
- q_SSL_get0_alpn_selected(ssl, &proto, &proto_len);
- if (proto_len && mode == QSslSocket::SslClientMode) {
- // Client does not have a callback that sets it ...
- configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
- }
- }
-
- if (!proto_len) { // Test if NPN was more lucky ...
-#else
- {
-#endif
- q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
- }
-
- if (proto_len)
- configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
- else
- configuration.nextNegotiatedProtocol.clear();
- }
-#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
-
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
- if (q_SSLeay() >= 0x10002000L && mode == QSslSocket::SslClientMode) {
- EVP_PKEY *key;
- if (q_SSL_get_server_tmp_key(ssl, &key))
- configuration.ephemeralServerKey = QSslKey(key, QSsl::PublicKey);
- }
-#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ...
-
- connectionEncrypted = true;
- emit q->encrypted();
- if (autoStartHandshake && pendingClose) {
- pendingClose = false;
- q->disconnectFromHost();
- }
-}
-
QList<QSslCertificate> QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509)
{
ensureInitialized();
@@ -1694,12 +1395,12 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
// Register a custom callback to get all verification errors.
- X509_STORE_set_verify_cb_func(certStore, q_X509Callback);
+ q_X509_STORE_set_verify_cb(certStore, q_X509Callback);
// Build the chain of intermediate certificates
STACK_OF(X509) *intermediates = 0;
if (certificateChain.length() > 1) {
- intermediates = (STACK_OF(X509) *) q_sk_new_null();
+ intermediates = (STACK_OF(X509) *) q_OPENSSL_sk_new_null();
if (!intermediates) {
q_X509_STORE_free(certStore);
@@ -1713,11 +1414,8 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
first = false;
continue;
}
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- q_sk_push( (_STACK *)intermediates, reinterpret_cast<X509 *>(cert.handle()));
-#else
- q_sk_push( (STACK *)intermediates, reinterpret_cast<char *>(cert.handle()));
-#endif
+
+ q_OPENSSL_sk_push((OPENSSL_STACK *)intermediates, reinterpret_cast<X509 *>(cert.handle()));
}
}
@@ -1741,11 +1439,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
(void) q_X509_verify_cert(storeContext);
q_X509_STORE_CTX_free(storeContext);
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- q_sk_free( (_STACK *) intermediates);
-#else
- q_sk_free( (STACK *) intermediates);
-#endif
+ q_OPENSSL_sk_free((OPENSSL_STACK *)intermediates);
// Now process the errors
const auto errorList = std::move(_q_sslErrorList()->errors);
@@ -1819,7 +1513,8 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
// Convert to Qt types
if (!key->d->fromEVP_PKEY(pkey)) {
qCWarning(lcSsl, "Unable to convert private key");
- q_sk_pop_free(reinterpret_cast<STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_sk_free));
+ q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca),
+ reinterpret_cast<void (*)(void *)>(q_OPENSSL_sk_free));
q_X509_free(x509);
q_EVP_PKEY_free(pkey);
q_PKCS12_free(p12);
@@ -1834,7 +1529,11 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
*caCertificates = QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ca);
// Clean up
- q_sk_pop_free(reinterpret_cast<STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_sk_free));
+ // TODO: verify ASAP, in the past we had sk_pop_free with q_OPENSSL_sk_free
+ // which seems to be blatantly wrong and even crashes with 1.1.
+ q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca),
+ reinterpret_cast<void (*)(void *)>(q_X509_free));
+
q_X509_free(x509);
q_EVP_PKEY_free(pkey);
q_PKCS12_free(p12);
diff --git a/src/network/ssl/qsslsocket_openssl11.cpp b/src/network/ssl/qsslsocket_openssl11.cpp
new file mode 100644
index 0000000000..b6d18943a5
--- /dev/null
+++ b/src/network/ssl/qsslsocket_openssl11.cpp
@@ -0,0 +1,285 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2014 Governikus GmbH & Co. KG
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
+** 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$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** In addition, as a special exception, the copyright holders listed above give
+** permission to link the code of its release of Qt with the OpenSSL project's
+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
+** same license as the original version), and distribute the linked executables.
+**
+** You must comply with the GNU General Public License version 2 in all
+** respects for all of the code used other than the "OpenSSL" code. If you
+** modify this file, you may extend this exception to your version of the file,
+** but you are not obligated to do so. If you do not wish to do so, delete
+** this exception statement from your version of this file.
+**
+****************************************************************************/
+
+//#define QT_DECRYPT_SSL_TRAFFIC
+
+#include "qssl_p.h"
+#include "qsslsocket_openssl_p.h"
+#include "qsslsocket_openssl_symbols_p.h"
+#include "qsslsocket.h"
+#include "qsslkey.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qdiriterator.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qmutex.h>
+#include <QtCore/qlibrary.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_opensslInitMutex, (QMutex::Recursive))
+
+/*!
+ \internal
+*/
+void QSslSocketPrivate::deinitialize()
+{
+ // This function exists only for compatibility with the pre-11 code,
+ // where deinitialize() actually does some cleanup. To be discarded
+ // once we retire < 1.1.
+}
+
+bool QSslSocketPrivate::ensureLibraryLoaded()
+{
+ if (!q_resolveOpenSslSymbols())
+ return false;
+
+ const QMutexLocker locker(qt_opensslInitMutex);
+
+ if (!s_libraryLoaded) {
+ s_libraryLoaded = true;
+
+ // Initialize OpenSSL.
+ if (q_OPENSSL_init_ssl(0, nullptr) != 1)
+ return false;
+ q_SSL_load_error_strings();
+ q_OpenSSL_add_all_algorithms();
+
+ QSslSocketBackendPrivate::s_indexForSSLExtraData
+ = q_CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, 0L, nullptr, nullptr,
+ nullptr, nullptr);
+
+ // Initialize OpenSSL's random seed.
+ if (!q_RAND_status()) {
+ qWarning("Random number generator not seeded, disabling SSL support");
+ return false;
+ }
+ }
+ return true;
+}
+
+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+{
+ const QMutexLocker locker(qt_opensslInitMutex);
+
+ if (s_loadedCiphersAndCerts)
+ return;
+ s_loadedCiphersAndCerts = true;
+
+ resetDefaultCiphers();
+ resetDefaultEllipticCurves();
+
+#if QT_CONFIG(library)
+ //load symbols needed to receive certificates from system store
+#if defined(Q_OS_WIN)
+ HINSTANCE hLib = LoadLibraryW(L"Crypt32");
+ if (hLib) {
+ ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
+ ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
+ ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
+ if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
+ qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
+ } else {
+ qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
+ }
+#elif defined(Q_OS_QNX)
+ s_loadRootCertsOnDemand = true;
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
+ // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
+ QList<QByteArray> dirs = unixRootCertDirectories();
+ QStringList symLinkFilter;
+ symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
+ for (int a = 0; a < dirs.count(); ++a) {
+ QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
+ if (iterator.hasNext()) {
+ s_loadRootCertsOnDemand = true;
+ break;
+ }
+ }
+#endif
+#endif // QT_CONFIG(library)
+ // if on-demand loading was not enabled, load the certs now
+ if (!s_loadRootCertsOnDemand)
+ setDefaultCaCertificates(systemCaCertificates());
+#ifdef Q_OS_WIN
+ //Enabled for fetching additional root certs from windows update on windows 6+
+ //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;
+#endif
+}
+
+long QSslSocketPrivate::sslLibraryVersionNumber()
+{
+ if (!supportsSsl())
+ return 0;
+
+ return q_OpenSSL_version_num();
+}
+
+QString QSslSocketPrivate::sslLibraryVersionString()
+{
+ if (!supportsSsl())
+ return QString();
+
+ const char *versionString = q_OpenSSL_version(OPENSSL_VERSION);
+ if (!versionString)
+ return QString();
+
+ return QString::fromLatin1(versionString);
+}
+
+void QSslSocketBackendPrivate::continueHandshake()
+{
+ Q_Q(QSslSocket);
+ // if we have a max read buffer size, reset the plain socket's to match
+ if (readBufferMaxSize)
+ plainSocket->setReadBufferSize(readBufferMaxSize);
+
+ if (q_SSL_session_reused(ssl))
+ configuration.peerSessionShared = true;
+
+#ifdef QT_DECRYPT_SSL_TRAFFIC
+ if (q_SSL_get_session(ssl)) {
+ size_t master_key_len = q_SSL_SESSION_get_master_key(q_SSL_get_session(ssl), 0, 0);
+ size_t client_random_len = q_SSL_get_client_random(ssl, 0, 0);
+ QByteArray masterKey(int(master_key_len), 0); // Will not overflow
+ QByteArray clientRandom(int(client_random_len), 0); // Will not overflow
+
+ q_SSL_SESSION_get_master_key(q_SSL_get_session(ssl),
+ reinterpret_cast<unsigned char*>(masterKey.data()),
+ masterKey.size());
+ q_SSL_get_client_random(ssl, reinterpret_cast<unsigned char *>(clientRandom.data()),
+ clientRandom.size());
+
+ QByteArray debugLineClientRandom("CLIENT_RANDOM ");
+ debugLineClientRandom.append(clientRandom.toHex().toUpper());
+ debugLineClientRandom.append(" ");
+ debugLineClientRandom.append(masterKey.toHex().toUpper());
+ debugLineClientRandom.append("\n");
+
+ QString sslKeyFile = QDir::tempPath() + QLatin1String("/qt-ssl-keys");
+ QFile file(sslKeyFile);
+ if (!file.open(QIODevice::Append))
+ qCWarning(lcSsl) << "could not open file" << sslKeyFile << "for appending";
+ if (!file.write(debugLineClientRandom))
+ qCWarning(lcSsl) << "could not write to file" << sslKeyFile;
+ file.close();
+ } else {
+ qCWarning(lcSsl, "could not decrypt SSL traffic");
+ }
+#endif
+
+ // Cache this SSL session inside the QSslContext
+ if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionSharing)) {
+ if (!sslContextPointer->cacheSession(ssl)) {
+ sslContextPointer.clear(); // we could not cache the session
+ } else {
+ // Cache the session for permanent usage as well
+ if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionPersistence)) {
+ if (!sslContextPointer->sessionASN1().isEmpty())
+ configuration.sslSession = sslContextPointer->sessionASN1();
+ configuration.sslSessionTicketLifeTimeHint = sslContextPointer->sessionTicketLifeTimeHint();
+ }
+ }
+ }
+
+#if !defined(OPENSSL_NO_NEXTPROTONEG)
+
+ configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
+ if (sslContextPointer->npnContext().status == QSslConfiguration::NextProtocolNegotiationUnsupported) {
+ // we could not agree -> be conservative and use HTTP/1.1
+ configuration.nextNegotiatedProtocol = QByteArrayLiteral("http/1.1");
+ } else {
+ const unsigned char *proto = 0;
+ unsigned int proto_len = 0;
+
+ q_SSL_get0_alpn_selected(ssl, &proto, &proto_len);
+ if (proto_len && mode == QSslSocket::SslClientMode) {
+ // Client does not have a callback that sets it ...
+ configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
+ }
+
+ if (!proto_len) { // Test if NPN was more lucky ...
+ q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
+ }
+
+ if (proto_len)
+ configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
+ else
+ configuration.nextNegotiatedProtocol.clear();
+ }
+#endif // !defined(OPENSSL_NO_NEXTPROTONEG)
+
+ if (mode == QSslSocket::SslClientMode) {
+ EVP_PKEY *key;
+ if (q_SSL_get_server_tmp_key(ssl, &key))
+ configuration.ephemeralServerKey = QSslKey(key, QSsl::PublicKey);
+ }
+
+ connectionEncrypted = true;
+ emit q->encrypted();
+ if (autoStartHandshake && pendingClose) {
+ pendingClose = false;
+ q->disconnectFromHost();
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslsocket_openssl11_symbols_p.h b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
new file mode 100644
index 0000000000..2980b3d23e
--- /dev/null
+++ b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
+** 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$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** In addition, as a special exception, the copyright holders listed above give
+** permission to link the code of its release of Qt with the OpenSSL project's
+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
+** same license as the original version), and distribute the linked executables.
+**
+** You must comply with the GNU General Public License version 2 in all
+** respects for all of the code used other than the "OpenSSL" code. If you
+** modify this file, you may extend this exception to your version of the file,
+** but you are not obligated to do so. If you do not wish to do so, delete
+** this exception statement from your version of this file.
+**
+****************************************************************************/
+
+#ifndef QSSLSOCKET_OPENSSL11_SYMBOLS_P_H
+#define QSSLSOCKET_OPENSSL11_SYMBOLS_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.
+//
+
+// Note: this file does not have QT_BEGIN_NAMESPACE/QT_END_NAMESPACE, it's done
+// in qsslsocket_openssl_symbols_p.h.
+
+#ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H
+#error "You are not supposed to use this header file, include qsslsocket_openssl_symbols_p.h instead"
+#endif
+
+const unsigned char * q_ASN1_STRING_get0_data(const ASN1_STRING *x);
+
+Q_AUTOTEST_EXPORT BIO *q_BIO_new(const BIO_METHOD *a);
+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);
+int q_EVP_PKEY_base_id(EVP_PKEY *a);
+int q_RSA_bits(RSA *a);
+int q_OPENSSL_sk_num(OPENSSL_STACK *a);
+void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
+OPENSSL_STACK *q_OPENSSL_sk_new_null();
+void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
+void q_OPENSSL_sk_free(OPENSSL_STACK *a);
+void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
+int q_SSL_session_reused(SSL *a);
+unsigned long q_SSL_CTX_set_options(SSL_CTX *ctx, unsigned long op);
+int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
+size_t q_SSL_get_client_random(SSL *a, unsigned char *out, size_t outlen);
+size_t q_SSL_SESSION_get_master_key(const SSL_SESSION *session, unsigned char *out, size_t outlen);
+int q_CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+const SSL_METHOD *q_TLS_method();
+const SSL_METHOD *q_TLS_client_method();
+const SSL_METHOD *q_TLS_server_method();
+ASN1_TIME *q_X509_getm_notBefore(X509 *a);
+ASN1_TIME *q_X509_getm_notAfter(X509 *a);
+
+long q_X509_get_version(X509 *a);
+EVP_PKEY *q_X509_get_pubkey(X509 *a);
+void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
+STACK_OF(X509) *q_X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx);
+void q_DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
+int q_DH_bits(DH *dh);
+
+# define q_SSL_load_error_strings() q_OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \
+ | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
+
+#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_OPENSSL_sk_num)(st)
+#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_OPENSSL_sk_value)(st, i)
+
+#define q_OPENSSL_add_all_algorithms_conf() q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
+ | OPENSSL_INIT_ADD_ALL_DIGESTS \
+ | OPENSSL_INIT_LOAD_CONFIG, NULL)
+#define q_OPENSSL_add_all_algorithms_noconf() q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
+ | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
+
+int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
+void q_CRYPTO_free(void *str, const char *file, int line);
+
+long q_OpenSSL_version_num();
+const char *q_OpenSSL_version(int type);
+
+unsigned long q_SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session);
+
+#endif
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index b2adb3e547..7f9e884045 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -98,8 +98,8 @@
#include <openssl/crypto.h>
#include <openssl/tls1.h>
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-typedef _STACK STACK;
+#if QT_CONFIG(opensslv11)
+#include <openssl/dh.h>
#endif
QT_BEGIN_NAMESPACE
@@ -151,7 +151,7 @@ public:
#endif
Q_AUTOTEST_EXPORT static long setupOpenSslOptions(QSsl::SslProtocol protocol, QSsl::SslOptions sslOptions);
- static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher);
+ static QSslCipher QSslCipher_from_SSL_CIPHER(const SSL_CIPHER *cipher);
static QList<QSslCertificate> STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509);
static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName);
static QString getErrorsFromOpenSsl();
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index c344a94427..0ef8bf6b5e 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -136,49 +137,195 @@ void qsslSocketCannotResolveSymbolWarning(const char *functionName)
#endif // QT_LINKED_OPENSSL
+#if QT_CONFIG(opensslv11)
+
+// Below are the functions first introduced in version 1.1:
+
+DEFINEFUNC(const unsigned char *, ASN1_STRING_get0_data, const ASN1_STRING *a, a, return 0, return)
+DEFINEFUNC2(int, OPENSSL_init_ssl, uint64_t opts, opts, const OPENSSL_INIT_SETTINGS *settings, settings, return 0, return)
+DEFINEFUNC2(int, OPENSSL_init_crypto, uint64_t opts, opts, const OPENSSL_INIT_SETTINGS *settings, settings, return 0, return)
+DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return 0, return)
+DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, 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_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)
+DEFINEFUNC(int, OPENSSL_sk_num, OPENSSL_STACK *a, a, return -1, return)
+DEFINEFUNC2(void, OPENSSL_sk_pop_free, OPENSSL_STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
+DEFINEFUNC(OPENSSL_STACK *, OPENSSL_sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC2(void, OPENSSL_sk_push, OPENSSL_STACK *a, a, void *b, b, return, DUMMYARG)
+DEFINEFUNC(void, OPENSSL_sk_free, OPENSSL_STACK *a, a, return, DUMMYARG)
+DEFINEFUNC2(void *, OPENSSL_sk_value, OPENSSL_STACK *a, a, int b, b, return 0, return)
+DEFINEFUNC(int, SSL_session_reused, SSL *a, a, return 0, return)
+DEFINEFUNC2(unsigned long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, unsigned long op, op, return 0, return)
+DEFINEFUNC3(size_t, SSL_get_client_random, SSL *a, a, unsigned char *out, out, size_t outlen, outlen, return 0, return)
+DEFINEFUNC3(size_t, SSL_SESSION_get_master_key, const SSL_SESSION *ses, ses, unsigned char *out, out, size_t outlen, outlen, return 0, return)
+DEFINEFUNC6(int, CRYPTO_get_ex_new_index, int class_index, class_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
+
+DEFINEFUNC(const SSL_METHOD *, TLS_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const SSL_METHOD *, TLS_client_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const SSL_METHOD *, TLS_server_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(ASN1_TIME *, X509_getm_notBefore, X509 *a, a, return 0, return)
+DEFINEFUNC(ASN1_TIME *, X509_getm_notAfter, X509 *a, a, return 0, return)
+DEFINEFUNC(long, X509_get_version, X509 *a, a, return -1, return)
+DEFINEFUNC(EVP_PKEY *, X509_get_pubkey, X509 *a, a, return 0, return)
+DEFINEFUNC2(void, X509_STORE_set_verify_cb, X509_STORE *a, a, X509_STORE_CTX_verify_cb verify_cb, verify_cb, return, DUMMYARG)
+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return)
+DEFINEFUNC3(void, CRYPTO_free, void *str, str, const char *file, file, int line, line, return, DUMMYARG)
+DEFINEFUNC(long, OpenSSL_version_num, void, DUMMYARG, return 0, return)
+DEFINEFUNC(const char *, OpenSSL_version, int a, a, return 0, return)
+DEFINEFUNC(unsigned long, SSL_SESSION_get_ticket_lifetime_hint, const SSL_SESSION *session, session, return 0, return)
+DEFINEFUNC4(void, DH_get0_pqg, const DH *dh, dh, const BIGNUM **p, p, const BIGNUM **q, q, const BIGNUM **g, g, return, DUMMYARG)
+DEFINEFUNC(int, DH_bits, DH *dh, dh, return 0, return)
+
+#else // QT_CONFIG(opensslv11)
+
+// Functions below are either deprecated or removed in OpenSSL >= 1.1:
+
+DEFINEFUNC(unsigned char *, ASN1_STRING_data, ASN1_STRING *a, a, return 0, return)
+
#ifdef SSLEAY_MACROS
DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return)
#endif
+DEFINEFUNC2(BIO *, BIO_new_file, const char *filename, filename, const char *mode, mode, return 0, return)
+DEFINEFUNC(void, ERR_clear_error, DUMMYARG, DUMMYARG, return, DUMMYARG)
+DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return)
+DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
+DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
+DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
+DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
+DEFINEFUNC(unsigned long, ERR_peek_last_error, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(void, ERR_free_strings, void, DUMMYARG, return, DUMMYARG)
+DEFINEFUNC(void, EVP_CIPHER_CTX_cleanup, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
+DEFINEFUNC(void, EVP_CIPHER_CTX_init, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
+
+#ifdef SSLEAY_MACROS
+DEFINEFUNC6(void *, PEM_ASN1_read_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
+DEFINEFUNC6(void *, PEM_ASN1_write_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
+#endif // SSLEAY_MACROS
+
+DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
+DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+DEFINEFUNC(_STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC2(void, sk_push, _STACK *a, a, void *b, b, return, DUMMYARG)
+DEFINEFUNC(void, sk_free, _STACK *a, a, return, DUMMYARG)
+DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return)
+#else
+DEFINEFUNC(STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC2(void, sk_push, STACK *a, a, char *b, b, return, DUMMYARG)
+DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
+DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
+#endif // OPENSSL_VERSION_NUMBER >= 0x10000000L
+
+DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
+DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
+
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+DEFINEFUNC5(int, SSL_get_ex_new_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
+#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#ifndef OPENSSL_NO_SSL2
+DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+DEFINEFUNC(const SSL_METHOD *, TLSv1_1_client_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const SSL_METHOD *, TLSv1_2_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+#ifndef OPENSSL_NO_SSL2
+DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+DEFINEFUNC(const SSL_METHOD *, TLSv1_1_server_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const SSL_METHOD *, TLSv1_2_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+#else
+#ifndef OPENSSL_NO_SSL2
+DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+DEFINEFUNC(SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
+#ifndef OPENSSL_NO_SSL2
+DEFINEFUNC(SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+DEFINEFUNC(SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+DEFINEFUNC(SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
+#endif
+
+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
+
+#ifdef SSLEAY_MACROS
+DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
+DEFINEFUNC2(int, i2d_RSAPrivateKey, const RSA *a, a, unsigned char **b, b, return -1, return)
+#ifndef OPENSSL_NO_EC
+DEFINEFUNC2(int, i2d_ECPrivateKey, const EC_KEY *a, a, unsigned char **b, b, return -1, return)
+#endif
+DEFINEFUNC3(RSA *, d2i_RSAPrivateKey, RSA **a, a, unsigned char **b, b, long c, c, return 0, return)
+DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, c, return 0, return)
+#ifndef OPENSSL_NO_EC
+DEFINEFUNC3(EC_KEY *, d2i_ECPrivateKey, EC_KEY **a, a, unsigned char **b, b, long c, c, return 0, return)
+#endif
+#endif
+DEFINEFUNC(char *, CONF_get1_default_config_file, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
+DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
+DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
+DEFINEFUNC(const char *, SSLeay_version, int a, a, return 0, return)
+
+#endif // QT_CONFIG(opensslv11)
+
DEFINEFUNC(long, ASN1_INTEGER_get, ASN1_INTEGER *a, a, return 0, return)
-DEFINEFUNC(unsigned char *, ASN1_STRING_data, ASN1_STRING *a, a, return 0, return)
DEFINEFUNC(int, ASN1_STRING_length, ASN1_STRING *a, a, return 0, return)
-DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return);
+DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return)
DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return)
DEFINEFUNC(int, BIO_free, BIO *a, a, return 0, return)
-DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return)
DEFINEFUNC2(BIO *, BIO_new_mem_buf, void *a, a, int b, b, return 0, return)
DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return)
-DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
+
DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return)
DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return)
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
-DEFINEFUNC2(int, BN_is_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return)
-#endif
DEFINEFUNC2(BN_ULONG, BN_mod_word, const BIGNUM *a, a, BN_ULONG w, w, return static_cast<BN_ULONG>(-1), return)
#ifndef OPENSSL_NO_EC
DEFINEFUNC(const EC_GROUP*, EC_KEY_get0_group, const EC_KEY* k, k, return 0, return)
DEFINEFUNC(int, EC_GROUP_get_degree, const EC_GROUP* g, g, return 0, return)
#endif
-DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
-DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
-DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
DEFINEFUNC(DSA *, DSA_new, DUMMYARG, DUMMYARG, return 0, return)
DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, const unsigned char **b, b, long c, c, return 0, return)
DEFINEFUNC2(char *, ERR_error_string, unsigned long a, a, char *b, b, return 0, return)
DEFINEFUNC(unsigned long, ERR_get_error, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(void, ERR_free_strings, void, DUMMYARG, return, DUMMYARG)
-DEFINEFUNC(void, EVP_CIPHER_CTX_cleanup, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
-DEFINEFUNC(void, EVP_CIPHER_CTX_init, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
-DEFINEFUNC4(int, EVP_CIPHER_CTX_ctrl, EVP_CIPHER_CTX *ctx, ctx, int type, type, int arg, arg, void *ptr, ptr, return 0, return);
+DEFINEFUNC(EVP_CIPHER_CTX *, EVP_CIPHER_CTX_new, void, DUMMYARG, return 0, return)
+DEFINEFUNC(void, EVP_CIPHER_CTX_free, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
+DEFINEFUNC4(int, EVP_CIPHER_CTX_ctrl, EVP_CIPHER_CTX *ctx, ctx, int type, type, int arg, arg, void *ptr, ptr, return 0, return)
DEFINEFUNC2(int, EVP_CIPHER_CTX_set_key_length, EVP_CIPHER_CTX *ctx, ctx, int keylen, keylen, return 0, return)
-DEFINEFUNC5(int, EVP_CipherInit, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *type, type, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return);
-DEFINEFUNC5(int, EVP_CipherUpdate, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, const unsigned char *in, in, int inl, inl, return 0, return);
-DEFINEFUNC3(int, EVP_CipherFinal, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, return 0, return);
+DEFINEFUNC5(int, EVP_CipherInit, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *type, type, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return)
+DEFINEFUNC6(int, EVP_CipherInit_ex, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *cipher, cipher, ENGINE *impl, impl, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return)
+DEFINEFUNC5(int, EVP_CipherUpdate, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, const unsigned char *in, in, int inl, inl, return 0, return)
+DEFINEFUNC3(int, EVP_CipherFinal, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, return 0, return)
DEFINEFUNC(const EVP_CIPHER *, EVP_des_cbc, DUMMYARG, DUMMYARG, return 0, return)
DEFINEFUNC(const EVP_CIPHER *, EVP_des_ede3_cbc, DUMMYARG, DUMMYARG, return 0, return)
DEFINEFUNC(const EVP_CIPHER *, EVP_rc2_cbc, DUMMYARG, DUMMYARG, return 0, return)
+DEFINEFUNC(const EVP_MD *, EVP_sha1, DUMMYARG, DUMMYARG, return 0, 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)
DEFINEFUNC2(int, EVP_PKEY_set1_DSA, EVP_PKEY *a, a, DSA *b, b, return -1, return)
@@ -202,10 +349,8 @@ DEFINEFUNC3(int, i2t_ASN1_OBJECT, char *a, a, int b, b, ASN1_OBJECT *c, c, retur
DEFINEFUNC4(int, OBJ_obj2txt, char *a, a, int b, b, ASN1_OBJECT *c, c, int d, d, return -1, return)
DEFINEFUNC(int, OBJ_obj2nid, const ASN1_OBJECT *a, a, return NID_undef, return)
-#ifdef SSLEAY_MACROS
-DEFINEFUNC6(void *, PEM_ASN1_read_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
-DEFINEFUNC6(void *, PEM_ASN1_write_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
-#else
+
+#ifndef SSLEAY_MACROS
DEFINEFUNC4(EVP_PKEY *, PEM_read_bio_PrivateKey, BIO *a, a, EVP_PKEY **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
DEFINEFUNC4(DSA *, PEM_read_bio_DSAPrivateKey, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
DEFINEFUNC4(RSA *, PEM_read_bio_RSAPrivateKey, BIO *a, a, RSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
@@ -218,7 +363,7 @@ DEFINEFUNC7(int, PEM_write_bio_RSAPrivateKey, BIO *a, a, RSA *b, b, const EVP_CI
#ifndef OPENSSL_NO_EC
DEFINEFUNC7(int, PEM_write_bio_ECPrivateKey, BIO *a, a, EC_KEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return)
#endif
-#endif
+#endif // !SSLEAY_MACROS
DEFINEFUNC4(EVP_PKEY *, PEM_read_bio_PUBKEY, BIO *a, a, EVP_PKEY **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
DEFINEFUNC4(DSA *, PEM_read_bio_DSA_PUBKEY, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
DEFINEFUNC4(RSA *, PEM_read_bio_RSA_PUBKEY, BIO *a, a, RSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
@@ -234,23 +379,10 @@ DEFINEFUNC2(void, RAND_seed, const void *a, a, int b, b, return, DUMMYARG)
DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return)
DEFINEFUNC(RSA *, RSA_new, DUMMYARG, DUMMYARG, return 0, return)
DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG)
-DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
-DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-DEFINEFUNC(_STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC2(void, sk_push, _STACK *a, a, void *b, b, return, DUMMYARG)
-DEFINEFUNC(void, sk_free, _STACK *a, a, return, DUMMYARG)
-DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return)
-#else
-DEFINEFUNC(STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC2(void, sk_push, STACK *a, a, char *b, b, return, DUMMYARG)
-DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
-DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
-#endif
DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return)
-DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
-DEFINEFUNC2(int, SSL_CIPHER_get_bits, SSL_CIPHER *a, a, int *b, b, return 0, return)
+DEFINEFUNC3(char *, SSL_CIPHER_description, const SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
+DEFINEFUNC2(int, SSL_CIPHER_get_bits, const SSL_CIPHER *a, a, int *b, b, return 0, return)
DEFINEFUNC(int, SSL_connect, SSL *a, a, return -1, return)
DEFINEFUNC(int, SSL_CTX_check_private_key, const SSL_CTX *a, a, return -1, return)
DEFINEFUNC4(long, SSL_CTX_ctrl, SSL_CTX *a, a, int b, b, long c, c, void *d, d, return -1, return)
@@ -287,8 +419,6 @@ DEFINEFUNC(long, SSL_get_verify_result, const SSL *a, a, return -1, return)
#else
DEFINEFUNC(long, SSL_get_verify_result, SSL *a, a, return -1, return)
#endif
-DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
-DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return 0, return)
DEFINEFUNC4(long, SSL_ctrl, SSL *a, a, int cmd, cmd, long larg, larg, void *parg, parg, return -1, return)
DEFINEFUNC3(int, SSL_read, SSL *a, a, void *b, b, int c, c, return -1, return)
@@ -301,7 +431,6 @@ DEFINEFUNC(void, SSL_SESSION_free, SSL_SESSION *ses, ses, return, DUMMYARG)
DEFINEFUNC(SSL_SESSION*, SSL_get1_session, SSL *ssl, ssl, return 0, return)
DEFINEFUNC(SSL_SESSION*, SSL_get_session, const SSL *ssl, ssl, return 0, return)
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-DEFINEFUNC5(int, SSL_get_ex_new_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
DEFINEFUNC3(int, SSL_set_ex_data, SSL *ssl, ssl, int idx, idx, void *arg, arg, return 0, return)
DEFINEFUNC2(void *, SSL_get_ex_data, const SSL *ssl, ssl, int idx, idx, return NULL, return)
#endif
@@ -310,51 +439,9 @@ DEFINEFUNC2(void, SSL_set_psk_client_callback, SSL* ssl, ssl, q_psk_client_callb
DEFINEFUNC2(void, SSL_set_psk_server_callback, SSL* ssl, ssl, q_psk_server_callback_t callback, callback, return, DUMMYARG)
DEFINEFUNC2(int, SSL_CTX_use_psk_identity_hint, SSL_CTX* ctx, ctx, const char *hint, hint, return 0, return)
#endif
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-#ifndef OPENSSL_NO_SSL2
-DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-DEFINEFUNC(const SSL_METHOD *, TLSv1_1_client_method, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(const SSL_METHOD *, TLSv1_2_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-#ifndef OPENSSL_NO_SSL2
-DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-DEFINEFUNC(const SSL_METHOD *, TLSv1_1_server_method, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(const SSL_METHOD *, TLSv1_2_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-#else
-#ifndef OPENSSL_NO_SSL2
-DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-DEFINEFUNC(SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
-#ifndef OPENSSL_NO_SSL2
-DEFINEFUNC(SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-DEFINEFUNC(SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
-DEFINEFUNC(SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
-DEFINEFUNC(SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
-#endif
DEFINEFUNC3(int, SSL_write, SSL *a, a, const void *b, b, int c, c, return -1, return)
DEFINEFUNC2(int, X509_cmp, X509 *a, a, X509 *b, b, return -1, return)
+DEFINEFUNC4(int, X509_digest, const X509 *x509, x509, const EVP_MD *type, type, unsigned char *md, md, unsigned int *len, len, return -1, return)
#ifndef SSLEAY_MACROS
DEFINEFUNC(X509 *, X509_dup, X509 *a, a, return 0, return)
#endif
@@ -378,6 +465,7 @@ DEFINEFUNC2(int, ASN1_STRING_print, BIO *a, a, ASN1_STRING *b, b, return 0, retu
DEFINEFUNC2(int, X509_check_issued, X509 *a, a, X509 *b, b, return -1, return)
DEFINEFUNC(X509_NAME *, X509_get_issuer_name, X509 *a, a, return 0, return)
DEFINEFUNC(X509_NAME *, X509_get_subject_name, X509 *a, a, return 0, return)
+DEFINEFUNC(ASN1_INTEGER *, X509_get_serialNumber, X509 *a, a, return 0, return)
DEFINEFUNC(int, X509_verify_cert, X509_STORE_CTX *a, a, return -1, return)
DEFINEFUNC(int, X509_NAME_entry_count, X509_NAME *a, a, return 0, return)
DEFINEFUNC2(X509_NAME_ENTRY *, X509_NAME_get_entry, X509_NAME *a, a, int b, b, return 0, return)
@@ -393,25 +481,8 @@ DEFINEFUNC2(int, X509_STORE_CTX_set_purpose, X509_STORE_CTX *a, a, int b, b, ret
DEFINEFUNC(int, X509_STORE_CTX_get_error, X509_STORE_CTX *a, a, return -1, return)
DEFINEFUNC(int, X509_STORE_CTX_get_error_depth, X509_STORE_CTX *a, a, return -1, return)
DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
-DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
-#ifdef SSLEAY_MACROS
-DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
-DEFINEFUNC2(int, i2d_RSAPrivateKey, const RSA *a, a, unsigned char **b, b, return -1, return)
-#ifndef OPENSSL_NO_EC
-DEFINEFUNC2(int, i2d_ECPrivateKey, const EC_KEY *a, a, unsigned char **b, b, return -1, return)
-#endif
-DEFINEFUNC3(RSA *, d2i_RSAPrivateKey, RSA **a, a, unsigned char **b, b, long c, c, return 0, return)
-DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, c, return 0, return)
-#ifndef OPENSSL_NO_EC
-DEFINEFUNC3(EC_KEY *, d2i_ECPrivateKey, EC_KEY **a, a, unsigned char **b, b, long c, c, return 0, return)
-#endif
-#endif
-DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
-DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
-DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
-DEFINEFUNC(const char *, SSLeay_version, int a, a, return 0, return)
DEFINEFUNC2(int, i2d_SSL_SESSION, SSL_SESSION *in, in, unsigned char **pp, pp, return 0, return)
DEFINEFUNC3(SSL_SESSION *, d2i_SSL_SESSION, SSL_SESSION **a, a, const unsigned char **pp, pp, long length, length, return 0, return)
#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
@@ -694,8 +765,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
#ifndef Q_OS_DARWIN
// second attempt: find the development files libssl.so and libcrypto.so
//
- // disabled on OS X/iOS:
- // OS X's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third
+ // disabled on macOS/iOS:
+ // macOS's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third
// attempt, _after_ <bundle>/Contents/Frameworks has been searched.
// iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place.
libssl->setFileNameAndVersion(QLatin1String("ssl"), -1);
@@ -754,8 +825,12 @@ bool q_resolveOpenSslSymbols()
static bool symbolsResolved = false;
static bool triedToResolveSymbols = false;
#ifndef QT_NO_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)
return true;
if (triedToResolveSymbols)
@@ -771,11 +846,145 @@ bool q_resolveOpenSslSymbols()
// failed to load them
return false;
+#if QT_CONFIG(opensslv11)
+
+ RESOLVEFUNC(OPENSSL_init_ssl)
+ RESOLVEFUNC(OPENSSL_init_crypto)
+ RESOLVEFUNC(ASN1_STRING_get0_data)
+ RESOLVEFUNC(EVP_CIPHER_CTX_reset)
+ RESOLVEFUNC(EVP_PKEY_base_id)
+ RESOLVEFUNC(RSA_bits)
+ RESOLVEFUNC(OPENSSL_sk_new_null)
+ RESOLVEFUNC(OPENSSL_sk_push)
+ RESOLVEFUNC(OPENSSL_sk_free)
+ RESOLVEFUNC(OPENSSL_sk_num)
+ RESOLVEFUNC(OPENSSL_sk_pop_free)
+ RESOLVEFUNC(OPENSSL_sk_value)
+ RESOLVEFUNC(DH_get0_pqg)
+ RESOLVEFUNC(SSL_CTX_set_options)
+ RESOLVEFUNC(SSL_get_client_random)
+ RESOLVEFUNC(SSL_SESSION_get_master_key)
+ RESOLVEFUNC(SSL_session_reused)
+ RESOLVEFUNC(SSL_get_session)
+ RESOLVEFUNC(CRYPTO_get_ex_new_index)
+ RESOLVEFUNC(TLS_method)
+ RESOLVEFUNC(TLS_client_method)
+ RESOLVEFUNC(TLS_server_method)
+ RESOLVEFUNC(X509_STORE_CTX_get0_chain)
+ RESOLVEFUNC(X509_getm_notBefore)
+ RESOLVEFUNC(X509_getm_notAfter)
+ RESOLVEFUNC(X509_get_version)
+ RESOLVEFUNC(X509_get_pubkey)
+ RESOLVEFUNC(X509_STORE_set_verify_cb)
+ RESOLVEFUNC(CRYPTO_free)
+ RESOLVEFUNC(OpenSSL_version_num)
+ RESOLVEFUNC(OpenSSL_version)
+ 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;
+ }
+
+ RESOLVEFUNC(SSL_SESSION_get_ticket_lifetime_hint)
+ RESOLVEFUNC(DH_bits)
+ RESOLVEFUNC(DSA_bits)
+
+#else // !opensslv11
+
+ RESOLVEFUNC(ASN1_STRING_data)
+
#ifdef SSLEAY_MACROS
RESOLVEFUNC(ASN1_dup)
+#endif // SSLEAY_MACROS
+ RESOLVEFUNC(BIO_new_file)
+ RESOLVEFUNC(ERR_clear_error)
+ RESOLVEFUNC(CRYPTO_free)
+ RESOLVEFUNC(CRYPTO_num_locks)
+ RESOLVEFUNC(CRYPTO_set_id_callback)
+ RESOLVEFUNC(CRYPTO_set_locking_callback)
+ RESOLVEFUNC(ERR_peek_last_error)
+ RESOLVEFUNC(ERR_free_strings)
+ RESOLVEFUNC(EVP_CIPHER_CTX_cleanup)
+ RESOLVEFUNC(EVP_CIPHER_CTX_init)
+
+#ifdef SSLEAY_MACROS // ### verify
+ RESOLVEFUNC(PEM_ASN1_read_bio)
+#endif // SSLEAY_MACROS
+
+ RESOLVEFUNC(sk_new_null)
+ RESOLVEFUNC(sk_push)
+ RESOLVEFUNC(sk_free)
+ RESOLVEFUNC(sk_num)
+ RESOLVEFUNC(sk_pop_free)
+ RESOLVEFUNC(sk_value)
+ RESOLVEFUNC(SSL_library_init)
+ RESOLVEFUNC(SSL_load_error_strings)
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ RESOLVEFUNC(SSL_get_ex_new_index)
+#endif
+#ifndef OPENSSL_NO_SSL2
+ RESOLVEFUNC(SSLv2_client_method)
#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+ RESOLVEFUNC(SSLv3_client_method)
+#endif
+ RESOLVEFUNC(SSLv23_client_method)
+ RESOLVEFUNC(TLSv1_client_method)
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ RESOLVEFUNC(TLSv1_1_client_method)
+ RESOLVEFUNC(TLSv1_2_client_method)
+#endif
+#ifndef OPENSSL_NO_SSL2
+ RESOLVEFUNC(SSLv2_server_method)
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+ RESOLVEFUNC(SSLv3_server_method)
+#endif
+ RESOLVEFUNC(SSLv23_server_method)
+ RESOLVEFUNC(TLSv1_server_method)
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ RESOLVEFUNC(TLSv1_1_server_method)
+ RESOLVEFUNC(TLSv1_2_server_method)
+#endif
+ RESOLVEFUNC(X509_STORE_CTX_get_chain)
+#ifdef SSLEAY_MACROS
+ RESOLVEFUNC(i2d_DSAPrivateKey)
+ RESOLVEFUNC(i2d_RSAPrivateKey)
+ RESOLVEFUNC(d2i_DSAPrivateKey)
+ RESOLVEFUNC(d2i_RSAPrivateKey)
+#endif
+ RESOLVEFUNC(CONF_get1_default_config_file)
+ RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
+ RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
+ RESOLVEFUNC(SSLeay)
+
+ if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
+ // 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;
+ }
+
+
+ RESOLVEFUNC(SSLeay_version)
+
+#ifndef OPENSSL_NO_EC
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ if (q_SSLeay() >= 0x10002000L)
+ RESOLVEFUNC(EC_curve_nist2nid)
+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
+#endif // OPENSSL_NO_EC
+
+
+#endif // !opensslv11
+
RESOLVEFUNC(ASN1_INTEGER_get)
- RESOLVEFUNC(ASN1_STRING_data)
RESOLVEFUNC(ASN1_STRING_length)
RESOLVEFUNC(ASN1_STRING_to_UTF8)
RESOLVEFUNC(BIO_ctrl)
@@ -794,25 +1003,22 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(BN_is_word)
#endif
RESOLVEFUNC(BN_mod_word)
- RESOLVEFUNC(CRYPTO_free)
- RESOLVEFUNC(CRYPTO_num_locks)
- RESOLVEFUNC(CRYPTO_set_id_callback)
- RESOLVEFUNC(CRYPTO_set_locking_callback)
RESOLVEFUNC(DSA_new)
RESOLVEFUNC(DSA_free)
RESOLVEFUNC(ERR_error_string)
RESOLVEFUNC(ERR_get_error)
- RESOLVEFUNC(ERR_free_strings)
- RESOLVEFUNC(EVP_CIPHER_CTX_cleanup)
- RESOLVEFUNC(EVP_CIPHER_CTX_init)
+ RESOLVEFUNC(EVP_CIPHER_CTX_new)
+ RESOLVEFUNC(EVP_CIPHER_CTX_free)
RESOLVEFUNC(EVP_CIPHER_CTX_ctrl)
RESOLVEFUNC(EVP_CIPHER_CTX_set_key_length)
RESOLVEFUNC(EVP_CipherInit)
+ RESOLVEFUNC(EVP_CipherInit_ex)
RESOLVEFUNC(EVP_CipherUpdate)
RESOLVEFUNC(EVP_CipherFinal)
RESOLVEFUNC(EVP_des_cbc)
RESOLVEFUNC(EVP_des_ede3_cbc)
RESOLVEFUNC(EVP_rc2_cbc)
+ RESOLVEFUNC(EVP_sha1)
RESOLVEFUNC(EVP_PKEY_assign)
RESOLVEFUNC(EVP_PKEY_set1_RSA)
RESOLVEFUNC(EVP_PKEY_set1_DSA)
@@ -834,9 +1040,8 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(i2t_ASN1_OBJECT)
RESOLVEFUNC(OBJ_obj2txt)
RESOLVEFUNC(OBJ_obj2nid)
-#ifdef SSLEAY_MACROS // ### verify
- RESOLVEFUNC(PEM_ASN1_read_bio)
-#else
+
+#ifndef SSLEAY_MACROS
RESOLVEFUNC(PEM_read_bio_PrivateKey)
RESOLVEFUNC(PEM_read_bio_DSAPrivateKey)
RESOLVEFUNC(PEM_read_bio_RSAPrivateKey)
@@ -849,7 +1054,8 @@ bool q_resolveOpenSslSymbols()
#ifndef OPENSSL_NO_EC
RESOLVEFUNC(PEM_write_bio_ECPrivateKey)
#endif
-#endif
+#endif // !SSLEAY_MACROS
+
RESOLVEFUNC(PEM_read_bio_PUBKEY)
RESOLVEFUNC(PEM_read_bio_DSA_PUBKEY)
RESOLVEFUNC(PEM_read_bio_RSA_PUBKEY)
@@ -865,12 +1071,6 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(RAND_status)
RESOLVEFUNC(RSA_new)
RESOLVEFUNC(RSA_free)
- RESOLVEFUNC(sk_new_null)
- RESOLVEFUNC(sk_push)
- RESOLVEFUNC(sk_free)
- RESOLVEFUNC(sk_num)
- RESOLVEFUNC(sk_pop_free)
- RESOLVEFUNC(sk_value)
RESOLVEFUNC(SSL_CIPHER_description)
RESOLVEFUNC(SSL_CIPHER_get_bits)
RESOLVEFUNC(SSL_CTX_check_private_key)
@@ -898,8 +1098,6 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(SSL_get_peer_cert_chain)
RESOLVEFUNC(SSL_get_peer_certificate)
RESOLVEFUNC(SSL_get_verify_result)
- RESOLVEFUNC(SSL_library_init)
- RESOLVEFUNC(SSL_load_error_strings)
RESOLVEFUNC(SSL_new)
RESOLVEFUNC(SSL_ctrl)
RESOLVEFUNC(SSL_read)
@@ -912,7 +1110,6 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(SSL_get1_session)
RESOLVEFUNC(SSL_get_session)
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- RESOLVEFUNC(SSL_get_ex_new_index)
RESOLVEFUNC(SSL_set_ex_data)
RESOLVEFUNC(SSL_get_ex_data)
#endif
@@ -922,30 +1119,6 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(SSL_CTX_use_psk_identity_hint)
#endif
RESOLVEFUNC(SSL_write)
-#ifndef OPENSSL_NO_SSL2
- RESOLVEFUNC(SSLv2_client_method)
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
- RESOLVEFUNC(SSLv3_client_method)
-#endif
- RESOLVEFUNC(SSLv23_client_method)
- RESOLVEFUNC(TLSv1_client_method)
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- RESOLVEFUNC(TLSv1_1_client_method)
- RESOLVEFUNC(TLSv1_2_client_method)
-#endif
-#ifndef OPENSSL_NO_SSL2
- RESOLVEFUNC(SSLv2_server_method)
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
- RESOLVEFUNC(SSLv3_server_method)
-#endif
- RESOLVEFUNC(SSLv23_server_method)
- RESOLVEFUNC(TLSv1_server_method)
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- RESOLVEFUNC(TLSv1_1_server_method)
- RESOLVEFUNC(TLSv1_2_server_method)
-#endif
RESOLVEFUNC(X509_NAME_entry_count)
RESOLVEFUNC(X509_NAME_get_entry)
RESOLVEFUNC(X509_NAME_ENTRY_get_data)
@@ -961,12 +1134,12 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(X509_STORE_CTX_get_error)
RESOLVEFUNC(X509_STORE_CTX_get_error_depth)
RESOLVEFUNC(X509_STORE_CTX_get_current_cert)
- RESOLVEFUNC(X509_STORE_CTX_get_chain)
RESOLVEFUNC(X509_cmp)
#ifndef SSLEAY_MACROS
RESOLVEFUNC(X509_dup)
#endif
RESOLVEFUNC(X509_print)
+ RESOLVEFUNC(X509_digest)
RESOLVEFUNC(X509_EXTENSION_get_object)
RESOLVEFUNC(X509_free)
RESOLVEFUNC(X509_get_ext)
@@ -982,20 +1155,11 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(X509_check_issued)
RESOLVEFUNC(X509_get_issuer_name)
RESOLVEFUNC(X509_get_subject_name)
+ RESOLVEFUNC(X509_get_serialNumber)
RESOLVEFUNC(X509_verify_cert)
RESOLVEFUNC(d2i_X509)
RESOLVEFUNC(i2d_X509)
-#ifdef SSLEAY_MACROS
- RESOLVEFUNC(i2d_DSAPrivateKey)
- RESOLVEFUNC(i2d_RSAPrivateKey)
- RESOLVEFUNC(d2i_DSAPrivateKey)
- RESOLVEFUNC(d2i_RSAPrivateKey)
-#endif
- RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
- RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
RESOLVEFUNC(SSL_CTX_load_verify_locations)
- RESOLVEFUNC(SSLeay)
- RESOLVEFUNC(SSLeay_version)
RESOLVEFUNC(i2d_SSL_SESSION)
RESOLVEFUNC(d2i_SSL_SESSION)
#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
@@ -1019,27 +1183,14 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(EC_KEY_new_by_curve_name)
RESOLVEFUNC(EC_KEY_free)
RESOLVEFUNC(EC_get_builtin_curves)
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
- if (q_SSLeay() >= 0x10002000L)
- RESOLVEFUNC(EC_curve_nist2nid)
-#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
#endif // OPENSSL_NO_EC
RESOLVEFUNC(PKCS12_parse)
RESOLVEFUNC(d2i_PKCS12_bio)
RESOLVEFUNC(PKCS12_free)
+ symbolsResolved = true;
delete libs.first;
delete libs.second;
- if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
- // OpenSSL 1.1 deprecated and removed SSLeay. We consider a failure to
- // resolve this symbol as a failure to resolve symbols.
- // The right operand of '||' above ... a bit of paranoia.
- qCWarning(lcSsl, "Incompatible version of OpenSSL");
- return false;
- }
-
- symbolsResolved = 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 b35a895d38..796bf2d4f5 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
@@ -56,6 +56,7 @@
#ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H
#define QSSLSOCKET_OPENSSL_SYMBOLS_P_H
+
//
// W A R N I N G
// -------------
@@ -215,17 +216,20 @@ QT_BEGIN_NAMESPACE
#endif // !defined QT_LINKED_OPENSSL
+#if QT_CONFIG(opensslv11)
+#include "qsslsocket_openssl11_symbols_p.h"
+#else
+#include "qsslsocket_opensslpre11_symbols_p.h"
+#endif // QT_CONFIG
+
bool q_resolveOpenSslSymbols();
long q_ASN1_INTEGER_get(ASN1_INTEGER *a);
-unsigned char * q_ASN1_STRING_data(ASN1_STRING *a);
int q_ASN1_STRING_length(ASN1_STRING *a);
int q_ASN1_STRING_to_UTF8(unsigned char **a, ASN1_STRING *b);
long q_BIO_ctrl(BIO *a, int b, long c, void *d);
Q_AUTOTEST_EXPORT int q_BIO_free(BIO *a);
-Q_AUTOTEST_EXPORT BIO *q_BIO_new(BIO_METHOD *a);
BIO *q_BIO_new_mem_buf(void *a, int b);
int q_BIO_read(BIO *a, void *b, int c);
-Q_AUTOTEST_EXPORT BIO_METHOD *q_BIO_s_mem();
Q_AUTOTEST_EXPORT int q_BIO_write(BIO *a, const void *b, int c);
int q_BN_num_bits(const BIGNUM *a);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
@@ -247,26 +251,23 @@ BN_ULONG q_BN_mod_word(const BIGNUM *a, BN_ULONG w);
const EC_GROUP* q_EC_KEY_get0_group(const EC_KEY* k);
int q_EC_GROUP_get_degree(const EC_GROUP* g);
#endif
-int q_CRYPTO_num_locks();
-void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
-void q_CRYPTO_set_id_callback(unsigned long (*a)());
-void q_CRYPTO_free(void *a);
DSA *q_DSA_new();
void q_DSA_free(DSA *a);
X509 *q_d2i_X509(X509 **a, const unsigned char **b, long c);
char *q_ERR_error_string(unsigned long a, char *b);
unsigned long q_ERR_get_error();
-void q_ERR_free_strings();
-void q_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
-void q_EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
+EVP_CIPHER_CTX *q_EVP_CIPHER_CTX_new();
+void q_EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);
int q_EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
int q_EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
int q_EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, const unsigned char *key, const unsigned char *iv, int enc);
+int q_EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, const unsigned char *key, const unsigned char *iv, int enc);
int q_EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl);
int q_EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
const EVP_CIPHER *q_EVP_des_cbc();
const EVP_CIPHER *q_EVP_des_ede3_cbc();
const EVP_CIPHER *q_EVP_rc2_cbc();
+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);
@@ -310,7 +311,7 @@ int q_PEM_write_bio_RSAPrivateKey(BIO *a, RSA *b, const EVP_CIPHER *c, unsigned
int q_PEM_write_bio_ECPrivateKey(BIO *a, EC_KEY *b, const EVP_CIPHER *c, unsigned char *d,
int e, pem_password_cb *f, void *g);
#endif
-#endif
+#endif // SSLEAY_MACROS
Q_AUTOTEST_EXPORT EVP_PKEY *q_PEM_read_bio_PUBKEY(BIO *a, EVP_PKEY **b, pem_password_cb *c, void *d);
DSA *q_PEM_read_bio_DSA_PUBKEY(BIO *a, DSA **b, pem_password_cb *c, void *d);
RSA *q_PEM_read_bio_RSA_PUBKEY(BIO *a, RSA **b, pem_password_cb *c, void *d);
@@ -326,23 +327,10 @@ void q_RAND_seed(const void *a, int b);
int q_RAND_status();
RSA *q_RSA_new();
void q_RSA_free(RSA *a);
-int q_sk_num(STACK *a);
-void q_sk_pop_free(STACK *a, void (*b)(void *));
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-_STACK *q_sk_new_null();
-void q_sk_push(_STACK *st, void *data);
-void q_sk_free(_STACK *a);
-void * q_sk_value(STACK *a, int b);
-#else
-STACK *q_sk_new_null();
-void q_sk_push(STACK *st, char *data);
-void q_sk_free(STACK *a);
-char * q_sk_value(STACK *a, int b);
-#endif
int q_SSL_accept(SSL *a);
int q_SSL_clear(SSL *a);
-char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c);
-int q_SSL_CIPHER_get_bits(SSL_CIPHER *a, int *b);
+char *q_SSL_CIPHER_description(const SSL_CIPHER *a, char *b, int c);
+int q_SSL_CIPHER_get_bits(const SSL_CIPHER *a, int *b);
int q_SSL_connect(SSL *a);
int q_SSL_CTX_check_private_key(const SSL_CTX *a);
long q_SSL_CTX_ctrl(SSL_CTX *a, int b, long c, void *d);
@@ -374,8 +362,6 @@ int q_SSL_get_error(SSL *a, int b);
STACK_OF(X509) *q_SSL_get_peer_cert_chain(SSL *a);
X509 *q_SSL_get_peer_certificate(SSL *a);
long q_SSL_get_verify_result(const SSL *a);
-int q_SSL_library_init();
-void q_SSL_load_error_strings();
SSL *q_SSL_new(SSL_CTX *a);
long q_SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
int q_SSL_read(SSL *a, void *b, int c);
@@ -388,7 +374,6 @@ void q_SSL_SESSION_free(SSL_SESSION *ses);
SSL_SESSION *q_SSL_get1_session(SSL *ssl);
SSL_SESSION *q_SSL_get_session(const SSL *ssl);
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-int q_SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int q_SSL_set_ex_data(SSL *ssl, int idx, void *arg);
void *q_SSL_get_ex_data(const SSL *ssl, int idx);
#endif
@@ -399,49 +384,6 @@ typedef unsigned int (*q_psk_server_callback_t)(SSL *ssl, const char *identity,
void q_SSL_set_psk_server_callback(SSL *ssl, q_psk_server_callback_t callback);
int q_SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint);
#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-#ifndef OPENSSL_NO_SSL2
-const SSL_METHOD *q_SSLv2_client_method();
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-const SSL_METHOD *q_SSLv3_client_method();
-#endif
-const SSL_METHOD *q_SSLv23_client_method();
-const SSL_METHOD *q_TLSv1_client_method();
-const SSL_METHOD *q_TLSv1_1_client_method();
-const SSL_METHOD *q_TLSv1_2_client_method();
-#ifndef OPENSSL_NO_SSL2
-const SSL_METHOD *q_SSLv2_server_method();
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-const SSL_METHOD *q_SSLv3_server_method();
-#endif
-const SSL_METHOD *q_SSLv23_server_method();
-const SSL_METHOD *q_TLSv1_server_method();
-const SSL_METHOD *q_TLSv1_1_server_method();
-const SSL_METHOD *q_TLSv1_2_server_method();
-#else
-#ifndef OPENSSL_NO_SSL2
-SSL_METHOD *q_SSLv2_client_method();
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-SSL_METHOD *q_SSLv3_client_method();
-#endif
-SSL_METHOD *q_SSLv23_client_method();
-SSL_METHOD *q_TLSv1_client_method();
-SSL_METHOD *q_TLSv1_1_client_method();
-SSL_METHOD *q_TLSv1_2_client_method();
-#ifndef OPENSSL_NO_SSL2
-SSL_METHOD *q_SSLv2_server_method();
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-SSL_METHOD *q_SSLv3_server_method();
-#endif
-SSL_METHOD *q_SSLv23_server_method();
-SSL_METHOD *q_TLSv1_server_method();
-SSL_METHOD *q_TLSv1_1_server_method();
-SSL_METHOD *q_TLSv1_2_server_method();
-#endif
int q_SSL_write(SSL *a, const void *b, int c);
int q_X509_cmp(X509 *a, X509 *b);
#ifdef SSLEAY_MACROS
@@ -452,6 +394,7 @@ void *q_ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
X509 *q_X509_dup(X509 *a);
#endif
void q_X509_print(BIO *a, X509*b);
+int q_X509_digest(const X509 *x509, const EVP_MD *type, unsigned char *md, unsigned int *len);
ASN1_OBJECT *q_X509_EXTENSION_get_object(X509_EXTENSION *a);
void q_X509_free(X509 *a);
X509_EXTENSION *q_X509_get_ext(X509 *a, int b);
@@ -471,6 +414,7 @@ int q_ASN1_STRING_print(BIO *a, ASN1_STRING *b);
int q_X509_check_issued(X509 *a, X509 *b);
X509_NAME *q_X509_get_issuer_name(X509 *a);
X509_NAME *q_X509_get_subject_name(X509 *a);
+ASN1_INTEGER *q_X509_get_serialNumber(X509 *a);
int q_X509_verify_cert(X509_STORE_CTX *ctx);
int q_X509_NAME_entry_count(X509_NAME *a);
X509_NAME_ENTRY *q_X509_NAME_get_entry(X509_NAME *a,int b);
@@ -488,7 +432,6 @@ int q_X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
int q_X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
int q_X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
X509 *q_X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
-STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
// Diffie-Hellman support
DH *q_DH_new();
@@ -522,34 +465,9 @@ int q_PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
PKCS12 *q_d2i_PKCS12_bio(BIO *bio, PKCS12 **pkcs12);
void q_PKCS12_free(PKCS12 *pkcs12);
-
#define q_BIO_get_mem_data(b, pp) (int)q_BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
#define q_BIO_pending(b) (int)q_BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
-#ifdef SSLEAY_MACROS
-int q_i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
-int q_i2d_RSAPrivateKey(const RSA *a, unsigned char **pp);
-RSA *q_d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length);
-DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
-#define q_PEM_read_bio_RSAPrivateKey(bp, x, cb, u) \
- (RSA *)q_PEM_ASN1_read_bio( \
- (void *(*)(void**, const unsigned char**, long int))q_d2i_RSAPrivateKey, PEM_STRING_RSA, bp, (void **)x, cb, u)
-#define q_PEM_read_bio_DSAPrivateKey(bp, x, cb, u) \
- (DSA *)q_PEM_ASN1_read_bio( \
- (void *(*)(void**, const unsigned char**, long int))q_d2i_DSAPrivateKey, PEM_STRING_DSA, bp, (void **)x, cb, u)
-#define q_PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_RSAPrivateKey,PEM_STRING_RSA,\
- bp,(char *)x,enc,kstr,klen,cb,u)
-#define q_PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
- bp,(char *)x,enc,kstr,klen,cb,u)
-#define q_PEM_read_bio_DHparams(bp, dh, cb, u) \
- (DH *)q_PEM_ASN1_read_bio( \
- (void *(*)(void**, const unsigned char**, long int))q_d2i_DHparams, PEM_STRING_DHPARAMS, bp, (void **)x, cb, u)
-#endif
-#define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
#define q_SSL_CTX_set_mode(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
-#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
-#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
#define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
#define q_sk_GENERAL_NAME_value(st, i) q_SKM_sk_value(GENERAL_NAME, (st), (i))
#define q_sk_X509_num(st) q_SKM_sk_num(X509, (st))
@@ -558,18 +476,12 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
#define q_sk_SSL_CIPHER_value(st, i) q_SKM_sk_value(SSL_CIPHER, (st), (i))
#define q_SSL_CTX_add_extra_chain_cert(ctx,x509) \
q_SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
-#define q_X509_get_notAfter(x) X509_get_notAfter(x)
-#define q_X509_get_notBefore(x) X509_get_notBefore(x)
#define q_EVP_PKEY_assign_RSA(pkey,rsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
(char *)(rsa))
#define q_EVP_PKEY_assign_DSA(pkey,dsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
(char *)(dsa))
#define q_OpenSSL_add_all_algorithms() q_OPENSSL_add_all_algorithms_conf()
-void q_OPENSSL_add_all_algorithms_noconf();
-void q_OPENSSL_add_all_algorithms_conf();
int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
-long q_SSLeay();
-const char *q_SSLeay_version(int type);
int q_i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
SSL_SESSION *q_d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length);
diff --git a/src/network/ssl/qsslsocket_opensslpre11.cpp b/src/network/ssl/qsslsocket_opensslpre11.cpp
new file mode 100644
index 0000000000..e51888c5f2
--- /dev/null
+++ b/src/network/ssl/qsslsocket_opensslpre11.cpp
@@ -0,0 +1,424 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2014 Governikus GmbH & Co. KG
+** 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$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** In addition, as a special exception, the copyright holders listed above give
+** permission to link the code of its release of Qt with the OpenSSL project's
+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
+** same license as the original version), and distribute the linked executables.
+**
+** You must comply with the GNU General Public License version 2 in all
+** respects for all of the code used other than the "OpenSSL" code. If you
+** modify this file, you may extend this exception to your version of the file,
+** but you are not obligated to do so. If you do not wish to do so, delete
+** this exception statement from your version of this file.
+**
+****************************************************************************/
+
+//#define QT_DECRYPT_SSL_TRAFFIC
+
+#include "qssl_p.h"
+#include "qsslsocket_openssl_p.h"
+#include "qsslsocket_openssl_symbols_p.h"
+#include "qsslsocket.h"
+#include "qsslkey.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qdiriterator.h>
+#include <QtCore/qthread.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qmutex.h>
+#include <QtCore/qlibrary.h>
+
+QT_BEGIN_NAMESPACE
+
+/* \internal
+
+ From OpenSSL's thread(3) manual page:
+
+ OpenSSL can safely be used in multi-threaded applications provided that at
+ least two callback functions are set.
+
+ locking_function(int mode, int n, const char *file, int line) is needed to
+ perform locking on shared data structures. (Note that OpenSSL uses a
+ number of global data structures that will be implicitly shared
+ whenever multiple threads use OpenSSL.) Multi-threaded
+ applications will crash at random if it is not set. ...
+ ...
+ id_function(void) is a function that returns a thread ID. It is not
+ needed on Windows nor on platforms where getpid() returns a different
+ ID for each thread (most notably Linux)
+*/
+
+class QOpenSslLocks
+{
+public:
+ QOpenSslLocks()
+ : initLocker(QMutex::Recursive),
+ locksLocker(QMutex::Recursive)
+ {
+ QMutexLocker locker(&locksLocker);
+ int numLocks = q_CRYPTO_num_locks();
+ locks = new QMutex *[numLocks];
+ memset(locks, 0, numLocks * sizeof(QMutex *));
+ }
+ ~QOpenSslLocks()
+ {
+ QMutexLocker locker(&locksLocker);
+ for (int i = 0; i < q_CRYPTO_num_locks(); ++i)
+ delete locks[i];
+ delete [] locks;
+
+ QSslSocketPrivate::deinitialize();
+ }
+ QMutex *lock(int num)
+ {
+ QMutexLocker locker(&locksLocker);
+ QMutex *tmp = locks[num];
+ if (!tmp)
+ tmp = locks[num] = new QMutex(QMutex::Recursive);
+ return tmp;
+ }
+
+ QMutex *globalLock()
+ {
+ return &locksLocker;
+ }
+
+ QMutex *initLock()
+ {
+ return &initLocker;
+ }
+
+private:
+ QMutex initLocker;
+ QMutex locksLocker;
+ QMutex **locks;
+};
+
+Q_GLOBAL_STATIC(QOpenSslLocks, openssl_locks)
+
+extern "C" {
+static void locking_function(int mode, int lockNumber, const char *, int)
+{
+ QMutex *mutex = openssl_locks()->lock(lockNumber);
+
+ // Lock or unlock it
+ if (mode & CRYPTO_LOCK)
+ mutex->lock();
+ else
+ mutex->unlock();
+}
+static unsigned long id_function()
+{
+ return (quintptr)QThread::currentThreadId();
+}
+
+} // extern "C"
+
+static void q_OpenSSL_add_all_algorithms_safe()
+{
+#ifdef Q_OS_WIN
+ // Prior to version 1.0.1m an attempt to call OpenSSL_add_all_algorithms on
+ // Windows could result in 'exit' call from OPENSSL_config (QTBUG-43843).
+ // We can predict this and avoid OPENSSL_add_all_algorithms call.
+ // From OpenSSL docs:
+ // "An application does not need to add algorithms to use them explicitly,
+ // for example by EVP_sha1(). It just needs to add them if it (or any of
+ // the functions it calls) needs to lookup algorithms.
+ // The cipher and digest lookup functions are used in many parts of the
+ // library. If the table is not initialized several functions will
+ // misbehave and complain they cannot find algorithms. This includes the
+ // PEM, PKCS#12, SSL and S/MIME libraries. This is a common query in
+ // the OpenSSL mailing lists."
+ //
+ // Anyway, as a result, we chose not to call this function if it would exit.
+
+ if (q_SSLeay() < 0x100010DFL)
+ {
+ // Now, before we try to call it, check if an attempt to open config file
+ // will result in exit:
+ if (char *confFileName = q_CONF_get1_default_config_file()) {
+ BIO *confFile = q_BIO_new_file(confFileName, "r");
+ const auto lastError = q_ERR_peek_last_error();
+ q_CRYPTO_free(confFileName);
+ if (confFile) {
+ q_BIO_free(confFile);
+ } else {
+ q_ERR_clear_error();
+ if (ERR_GET_REASON(lastError) == ERR_R_SYS_LIB) {
+ qCWarning(lcSsl, "failed to open openssl.conf file");
+ return;
+ }
+ }
+ }
+ }
+#endif // Q_OS_WIN
+
+ q_OpenSSL_add_all_algorithms();
+}
+
+
+/*!
+ \internal
+*/
+void QSslSocketPrivate::deinitialize()
+{
+ q_CRYPTO_set_id_callback(0);
+ q_CRYPTO_set_locking_callback(0);
+ q_ERR_free_strings();
+}
+
+
+bool QSslSocketPrivate::ensureLibraryLoaded()
+{
+ if (!q_resolveOpenSslSymbols())
+ return false;
+
+ // Check if the library itself needs to be initialized.
+ QMutexLocker locker(openssl_locks()->initLock());
+
+ if (!s_libraryLoaded) {
+ s_libraryLoaded = true;
+
+ // Initialize OpenSSL.
+ q_CRYPTO_set_id_callback(id_function);
+ q_CRYPTO_set_locking_callback(locking_function);
+ if (q_SSL_library_init() != 1)
+ return false;
+ q_SSL_load_error_strings();
+ q_OpenSSL_add_all_algorithms_safe();
+
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ if (q_SSLeay() >= 0x10001000L)
+ QSslSocketBackendPrivate::s_indexForSSLExtraData = q_SSL_get_ex_new_index(0L, NULL, NULL, NULL, NULL);
+#endif
+
+ // Initialize OpenSSL's random seed.
+ if (!q_RAND_status()) {
+ qWarning("Random number generator not seeded, disabling SSL support");
+ return false;
+ }
+ }
+ return true;
+}
+
+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+{
+ QMutexLocker locker(openssl_locks()->initLock());
+ if (s_loadedCiphersAndCerts)
+ return;
+ s_loadedCiphersAndCerts = true;
+
+ resetDefaultCiphers();
+ resetDefaultEllipticCurves();
+
+#if QT_CONFIG(library)
+ //load symbols needed to receive certificates from system store
+#if defined(Q_OS_WIN)
+ HINSTANCE hLib = LoadLibraryW(L"Crypt32");
+ if (hLib) {
+ ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
+ ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
+ ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
+ if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
+ qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
+ } else {
+ qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
+ }
+#elif defined(Q_OS_QNX)
+ s_loadRootCertsOnDemand = true;
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
+ // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
+ QList<QByteArray> dirs = unixRootCertDirectories();
+ QStringList symLinkFilter;
+ symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
+ for (int a = 0; a < dirs.count(); ++a) {
+ QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
+ if (iterator.hasNext()) {
+ s_loadRootCertsOnDemand = true;
+ break;
+ }
+ }
+#endif
+#endif // QT_CONFIG(library)
+ // if on-demand loading was not enabled, load the certs now
+ if (!s_loadRootCertsOnDemand)
+ setDefaultCaCertificates(systemCaCertificates());
+#ifdef Q_OS_WIN
+ //Enabled for fetching additional root certs from windows update on windows 6+
+ //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;
+#endif
+}
+
+long QSslSocketPrivate::sslLibraryVersionNumber()
+{
+ if (!supportsSsl())
+ return 0;
+
+ return q_SSLeay();
+}
+
+QString QSslSocketPrivate::sslLibraryVersionString()
+{
+ if (!supportsSsl())
+ return QString();
+
+ const char *versionString = q_SSLeay_version(SSLEAY_VERSION);
+ if (!versionString)
+ return QString();
+
+ return QString::fromLatin1(versionString);
+}
+
+void QSslSocketBackendPrivate::continueHandshake()
+{
+ Q_Q(QSslSocket);
+ // if we have a max read buffer size, reset the plain socket's to match
+ if (readBufferMaxSize)
+ plainSocket->setReadBufferSize(readBufferMaxSize);
+
+ if (q_SSL_ctrl((ssl), SSL_CTRL_GET_SESSION_REUSED, 0, NULL))
+ configuration.peerSessionShared = true;
+
+#ifdef QT_DECRYPT_SSL_TRAFFIC
+ if (ssl->session && ssl->s3) {
+ const char *mk = reinterpret_cast<const char *>(ssl->session->master_key);
+ QByteArray masterKey(mk, ssl->session->master_key_length);
+ const char *random = reinterpret_cast<const char *>(ssl->s3->client_random);
+ QByteArray clientRandom(random, SSL3_RANDOM_SIZE);
+
+ // different format, needed for e.g. older Wireshark versions:
+// const char *sid = reinterpret_cast<const char *>(ssl->session->session_id);
+// QByteArray sessionID(sid, ssl->session->session_id_length);
+// QByteArray debugLineRSA("RSA Session-ID:");
+// debugLineRSA.append(sessionID.toHex().toUpper());
+// debugLineRSA.append(" Master-Key:");
+// debugLineRSA.append(masterKey.toHex().toUpper());
+// debugLineRSA.append("\n");
+
+ QByteArray debugLineClientRandom("CLIENT_RANDOM ");
+ debugLineClientRandom.append(clientRandom.toHex().toUpper());
+ debugLineClientRandom.append(" ");
+ debugLineClientRandom.append(masterKey.toHex().toUpper());
+ debugLineClientRandom.append("\n");
+
+ QString sslKeyFile = QDir::tempPath() + QLatin1String("/qt-ssl-keys");
+ QFile file(sslKeyFile);
+ if (!file.open(QIODevice::Append))
+ qCWarning(lcSsl) << "could not open file" << sslKeyFile << "for appending";
+ if (!file.write(debugLineClientRandom))
+ qCWarning(lcSsl) << "could not write to file" << sslKeyFile;
+ file.close();
+ } else {
+ qCWarning(lcSsl, "could not decrypt SSL traffic");
+ }
+#endif
+
+ // Cache this SSL session inside the QSslContext
+ if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionSharing)) {
+ if (!sslContextPointer->cacheSession(ssl)) {
+ sslContextPointer.clear(); // we could not cache the session
+ } else {
+ // Cache the session for permanent usage as well
+ if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionPersistence)) {
+ if (!sslContextPointer->sessionASN1().isEmpty())
+ configuration.sslSession = sslContextPointer->sessionASN1();
+ configuration.sslSessionTicketLifeTimeHint = sslContextPointer->sessionTicketLifeTimeHint();
+ }
+ }
+ }
+
+#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
+
+ configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
+ if (sslContextPointer->npnContext().status == QSslConfiguration::NextProtocolNegotiationUnsupported) {
+ // we could not agree -> be conservative and use HTTP/1.1
+ configuration.nextNegotiatedProtocol = QByteArrayLiteral("http/1.1");
+ } else {
+ const unsigned char *proto = 0;
+ unsigned int proto_len = 0;
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ if (q_SSLeay() >= 0x10002000L) {
+ q_SSL_get0_alpn_selected(ssl, &proto, &proto_len);
+ if (proto_len && mode == QSslSocket::SslClientMode) {
+ // Client does not have a callback that sets it ...
+ configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
+ }
+ }
+
+ if (!proto_len) { // Test if NPN was more lucky ...
+#else
+ {
+#endif
+ q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
+ }
+
+ if (proto_len)
+ configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
+ else
+ configuration.nextNegotiatedProtocol.clear();
+ }
+#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
+
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ if (q_SSLeay() >= 0x10002000L && mode == QSslSocket::SslClientMode) {
+ EVP_PKEY *key;
+ if (q_SSL_get_server_tmp_key(ssl, &key))
+ configuration.ephemeralServerKey = QSslKey(key, QSsl::PublicKey);
+ }
+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ...
+
+ connectionEncrypted = true;
+ emit q->encrypted();
+ if (autoStartHandshake && pendingClose) {
+ pendingClose = false;
+ q->disconnectFromHost();
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslsocket_opensslpre11_symbols_p.h b/src/network/ssl/qsslsocket_opensslpre11_symbols_p.h
new file mode 100644
index 0000000000..9686d22b98
--- /dev/null
+++ b/src/network/ssl/qsslsocket_opensslpre11_symbols_p.h
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** 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$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** In addition, as a special exception, the copyright holders listed above give
+** permission to link the code of its release of Qt with the OpenSSL project's
+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
+** same license as the original version), and distribute the linked executables.
+**
+** You must comply with the GNU General Public License version 2 in all
+** respects for all of the code used other than the "OpenSSL" code. If you
+** modify this file, you may extend this exception to your version of the file,
+** but you are not obligated to do so. If you do not wish to do so, delete
+** this exception statement from your version of this file.
+**
+****************************************************************************/
+
+
+#ifndef QSSLSOCKET_OPENSSLPRE11_SYMBOLS_P_H
+#define QSSLSOCKET_OPENSSLPRE11_SYMBOLS_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.
+//
+
+// Note: this file does not have QT_BEGIN_NAMESPACE/QT_END_NAMESPACE, it's done
+// in qsslsocket_openssl_symbols_p.h.
+
+#ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H
+#error "You are not supposed to use this header file, include qsslsocket_openssl_symbols_p.h instead"
+#endif
+
+unsigned char * q_ASN1_STRING_data(ASN1_STRING *a);
+BIO *q_BIO_new_file(const char *filename, const char *mode);
+void q_ERR_clear_error();
+Q_AUTOTEST_EXPORT BIO *q_BIO_new(BIO_METHOD *a);
+Q_AUTOTEST_EXPORT BIO_METHOD *q_BIO_s_mem();
+int q_CRYPTO_num_locks();
+void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
+void q_CRYPTO_set_id_callback(unsigned long (*a)());
+void q_CRYPTO_free(void *a);
+unsigned long q_ERR_peek_last_error();
+void q_ERR_free_strings();
+void q_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
+void q_EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+typedef _STACK STACK;
+#endif
+
+// The typedef we use to make our pre 1.1 code look more like 1.1 (less ifdefs).
+typedef STACK OPENSSL_STACK;
+
+// We resolve q_sk_ functions, but use q_OPENSSL_sk_ macros in code to reduce
+// the amount of #ifdefs.
+int q_sk_num(STACK *a);
+#define q_OPENSSL_sk_num(a) q_sk_num(a)
+void q_sk_pop_free(STACK *a, void (*b)(void *));
+#define q_OPENSSL_sk_pop_free(a, b) q_sk_pop_free(a, b)
+STACK *q_sk_new_null();
+#define q_OPENSSL_sk_new_null() q_sk_new_null()
+
+void q_sk_free(STACK *a);
+
+// Just a name alias (not a function call expression) since in code we take an
+// address of this:
+#define q_OPENSSL_sk_free q_sk_free
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+void *q_sk_value(STACK *a, int b);
+void q_sk_push(STACK *st, void *data);
+#else
+char *q_sk_value(STACK *a, int b);
+void q_sk_push(STACK *st, char *data);
+#endif // OPENSSL_VERSION_NUMBER >= 0x10000000L
+
+#define q_OPENSSL_sk_value(a, b) q_sk_value(a, b)
+#define q_OPENSSL_sk_push(st, data) q_sk_push(st, data)
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+SSL_CTX *q_SSL_CTX_new(const SSL_METHOD *a);
+#else
+SSL_CTX *q_SSL_CTX_new(SSL_METHOD *a);
+#endif
+
+int q_SSL_library_init();
+void q_SSL_load_error_strings();
+
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+int q_SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+#endif
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#ifndef OPENSSL_NO_SSL2
+const SSL_METHOD *q_SSLv2_client_method();
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+const SSL_METHOD *q_SSLv3_client_method();
+#endif
+const SSL_METHOD *q_SSLv23_client_method();
+const SSL_METHOD *q_TLSv1_client_method();
+const SSL_METHOD *q_TLSv1_1_client_method();
+const SSL_METHOD *q_TLSv1_2_client_method();
+#ifndef OPENSSL_NO_SSL2
+const SSL_METHOD *q_SSLv2_server_method();
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+const SSL_METHOD *q_SSLv3_server_method();
+#endif
+const SSL_METHOD *q_SSLv23_server_method();
+const SSL_METHOD *q_TLSv1_server_method();
+const SSL_METHOD *q_TLSv1_1_server_method();
+const SSL_METHOD *q_TLSv1_2_server_method();
+#else
+#ifndef OPENSSL_NO_SSL2
+SSL_METHOD *q_SSLv2_client_method();
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+SSL_METHOD *q_SSLv3_client_method();
+#endif
+SSL_METHOD *q_SSLv23_client_method();
+SSL_METHOD *q_TLSv1_client_method();
+SSL_METHOD *q_TLSv1_1_client_method();
+SSL_METHOD *q_TLSv1_2_client_method();
+#ifndef OPENSSL_NO_SSL2
+SSL_METHOD *q_SSLv2_server_method();
+#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+SSL_METHOD *q_SSLv3_server_method();
+#endif
+SSL_METHOD *q_SSLv23_server_method();
+SSL_METHOD *q_TLSv1_server_method();
+SSL_METHOD *q_TLSv1_1_server_method();
+SSL_METHOD *q_TLSv1_2_server_method();
+#endif
+
+STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
+
+#ifdef SSLEAY_MACROS
+int q_i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
+int q_i2d_RSAPrivateKey(const RSA *a, unsigned char **pp);
+RSA *q_d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length);
+DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
+#define q_PEM_read_bio_RSAPrivateKey(bp, x, cb, u) \
+ (RSA *)q_PEM_ASN1_read_bio( \
+ (void *(*)(void**, const unsigned char**, long int))q_d2i_RSAPrivateKey, PEM_STRING_RSA, bp, (void **)x, cb, u)
+#define q_PEM_read_bio_DSAPrivateKey(bp, x, cb, u) \
+ (DSA *)q_PEM_ASN1_read_bio( \
+ (void *(*)(void**, const unsigned char**, long int))q_d2i_DSAPrivateKey, PEM_STRING_DSA, bp, (void **)x, cb, u)
+#define q_PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_RSAPrivateKey,PEM_STRING_RSA,\
+ bp,(char *)x,enc,kstr,klen,cb,u)
+#define q_PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
+ bp,(char *)x,enc,kstr,klen,cb,u)
+#define q_PEM_read_bio_DHparams(bp, dh, cb, u) \
+ (DH *)q_PEM_ASN1_read_bio( \
+ (void *(*)(void**, const unsigned char**, long int))q_d2i_DHparams, PEM_STRING_DHPARAMS, bp, (void **)x, cb, u)
+#endif // SSLEAY_MACROS
+
+#define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
+#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
+#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
+#define q_X509_getm_notAfter(x) X509_get_notAfter(x)
+#define q_X509_getm_notBefore(x) X509_get_notBefore(x)
+
+// "Forward compatibility" with OpenSSL 1.1 (to save on #if-ery elsewhere):
+#define q_X509_get_version(x509) q_ASN1_INTEGER_get((x509)->cert_info->version)
+#define q_ASN1_STRING_get0_data(x) q_ASN1_STRING_data(x)
+#define q_EVP_PKEY_base_id(pkey) ((pkey)->type)
+#define q_X509_get_pubkey(x509) q_X509_PUBKEY_get((x509)->cert_info->key)
+#define q_SSL_SESSION_get_ticket_lifetime_hint(s) ((s)->tlsext_tick_lifetime_hint)
+#define q_RSA_bits(rsa) q_BN_num_bits((rsa)->n)
+#define q_DSA_bits(dsa) q_BN_num_bits((dsa)->p)
+#define q_X509_STORE_set_verify_cb(s,c) X509_STORE_set_verify_cb_func((s),(c))
+
+char *q_CONF_get1_default_config_file();
+void q_OPENSSL_add_all_algorithms_noconf();
+void q_OPENSSL_add_all_algorithms_conf();
+
+long q_SSLeay();
+const char *q_SSLeay_version(int type);
+
+
+#endif // QSSLSOCKET_OPENSSL_PRE11_SYMBOLS_P_H
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 827f27cff1..00fda43b7e 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -218,6 +218,7 @@ private:
protected:
bool verifyErrorsHaveBeenIgnored();
bool paused;
+ bool flushTriggered;
};
QT_END_NAMESPACE
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 52ce2eeade..949ebc3d2a 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -60,13 +60,25 @@ qtConfig(ssl) {
HEADERS += ssl/qsslcontext_openssl_p.h \
ssl/qsslsocket_openssl_p.h \
ssl/qsslsocket_openssl_symbols_p.h
- SOURCES += ssl/qsslcertificate_openssl.cpp \
- ssl/qsslcontext_openssl.cpp \
+ SOURCES += ssl/qsslsocket_openssl_symbols.cpp \
ssl/qssldiffiehellmanparameters_openssl.cpp \
+ ssl/qsslcertificate_openssl.cpp \
ssl/qsslellipticcurve_openssl.cpp \
ssl/qsslkey_openssl.cpp \
ssl/qsslsocket_openssl.cpp \
- ssl/qsslsocket_openssl_symbols.cpp
+ ssl/qsslcontext_openssl.cpp
+
+ qtConfig(opensslv11) {
+ HEADERS += ssl/qsslsocket_openssl11_symbols_p.h
+ SOURCES += ssl/qsslsocket_openssl11.cpp \
+ ssl/qsslcontext_openssl11.cpp
+
+ QMAKE_CXXFLAGS += -DOPENSSL_API_COMPAT=0x10100000L
+ } else {
+ HEADERS += ssl/qsslsocket_opensslpre11_symbols_p.h
+ SOURCES += ssl/qsslsocket_opensslpre11.cpp \
+ ssl/qsslcontext_opensslpre11.cpp
+ }
darwin:SOURCES += ssl/qsslsocket_mac_shared.cpp
diff --git a/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h
index 3af3392268..248900ad2a 100644
--- a/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h
+++ b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QXCBWINDOWFUNCTIONS_H
-#define QXCBWINDOWFUNCTIONS_H
+#ifndef QCOCOAWINDOWFUNCTIONS_H
+#define QCOCOAWINDOWFUNCTIONS_H
#include <QtPlatformHeaders/QPlatformHeaderHelper>
@@ -60,4 +60,4 @@ public:
QT_END_NAMESPACE
-#endif // QXCBWINDOWFUNCTIONS_H
+#endif // QCOCOAWINDOWFUNCTIONS_H
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm
deleted file mode 100644
index 85add35879..0000000000
--- a/src/platformsupport/cglconvenience/cglconvenience.mm
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company 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 "cglconvenience_p.h"
-#include <QtCore/qglobal.h>
-#include <QtCore/private/qcore_mac_p.h>
-#include <AppKit/AppKit.h>
-#include <QVector>
-#include <qdebug.h>
-
-// Match up with createNSOpenGLPixelFormat below!
-QSurfaceFormat qcgl_surfaceFormat()
-{
- QSurfaceFormat format;
- format.setRenderableType(QSurfaceFormat::OpenGL);
- format.setRedBufferSize(8);
- format.setGreenBufferSize(8);
- format.setBlueBufferSize(8);
- format.setAlphaBufferSize(8);
-/*
- format.setDepthBufferSize(24);
- format.setAccumBufferSize(0);
- format.setStencilBufferSize(8);
- format.setSampleBuffers(false);
- format.setSamples(1);
- format.setDepth(true);
- format.setRgba(true);
- format.setAlpha(true);
- format.setAccum(false);
- format.setStencil(true);
- format.setStereo(false);
- format.setDirectRendering(false);
-*/
- return format;
-}
-
-void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format)
-{
-
- QVector<NSOpenGLPixelFormatAttribute> attrs;
-
- if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer
- || format.swapBehavior() == QSurfaceFormat::DefaultSwapBehavior)
- attrs.append(NSOpenGLPFADoubleBuffer);
- else if (format.swapBehavior() == QSurfaceFormat::TripleBuffer)
- attrs.append(NSOpenGLPFATripleBuffer);
-
- if (format.profile() == QSurfaceFormat::CoreProfile
- && ((format.majorVersion() == 3 && format.minorVersion() >= 2)
- || format.majorVersion() > 3)) {
- attrs << NSOpenGLPFAOpenGLProfile;
- attrs << NSOpenGLProfileVersion3_2Core;
- } else {
- attrs << NSOpenGLPFAOpenGLProfile;
- attrs << NSOpenGLProfileVersionLegacy;
- }
-
- if (format.depthBufferSize() > 0)
- attrs << NSOpenGLPFADepthSize << format.depthBufferSize();
- if (format.stencilBufferSize() > 0)
- attrs << NSOpenGLPFAStencilSize << format.stencilBufferSize();
- if (format.alphaBufferSize() > 0)
- attrs << NSOpenGLPFAAlphaSize << format.alphaBufferSize();
- if ((format.redBufferSize() > 0) &&
- (format.greenBufferSize() > 0) &&
- (format.blueBufferSize() > 0)) {
- const int colorSize = format.redBufferSize() +
- format.greenBufferSize() +
- format.blueBufferSize();
- attrs << NSOpenGLPFAColorSize << colorSize << NSOpenGLPFAMinimumPolicy;
- }
-
- if (format.samples() > 0) {
- attrs << NSOpenGLPFAMultisample
- << NSOpenGLPFASampleBuffers << (NSOpenGLPixelFormatAttribute) 1
- << NSOpenGLPFASamples << (NSOpenGLPixelFormatAttribute) format.samples();
- }
-
- if (format.stereo())
- attrs << NSOpenGLPFAStereo;
-
- attrs << NSOpenGLPFAAllowOfflineRenderers;
-
- 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;
- }
-
- attrs << 0;
-
- NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs.constData()];
- return pixelFormat;
-}
diff --git a/src/platformsupport/cglconvenience/cglconvenience.pro b/src/platformsupport/cglconvenience/cglconvenience.pro
deleted file mode 100644
index 89d1fc4643..0000000000
--- a/src/platformsupport/cglconvenience/cglconvenience.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TARGET = QtCglSupport
-MODULE = cgl_support
-
-QT = core-private gui
-CONFIG += static internal_module
-
-DEFINES += QT_NO_CAST_FROM_ASCII
-
-HEADERS += \
- cglconvenience_p.h
-
-OBJECTIVE_SOURCES += \
- cglconvenience.mm
-
-LIBS_PRIVATE += -framework AppKit -framework OpenGL
-
-load(qt_module)
diff --git a/src/platformsupport/clipboard/clipboard.pro b/src/platformsupport/clipboard/clipboard.pro
index def2a061a0..916f6b0c06 100644
--- a/src/platformsupport/clipboard/clipboard.pro
+++ b/src/platformsupport/clipboard/clipboard.pro
@@ -9,6 +9,7 @@ DEFINES += QT_NO_CAST_FROM_ASCII
HEADERS += qmacmime_p.h
SOURCES += qmacmime.mm
+LIBS += -framework ImageIO
macos: LIBS_PRIVATE += -framework AppKit
load(qt_module)
diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm
index 6a6e033bec..09901ba0a5 100644
--- a/src/platformsupport/clipboard/qmacmime.mm
+++ b/src/platformsupport/clipboard/qmacmime.mm
@@ -37,10 +37,15 @@
**
****************************************************************************/
+#include <ImageIO/ImageIO.h>
+
#include <QtCore/qsystemdetection.h>
+#include <QtGui/qimage.h>
#if defined(Q_OS_OSX)
#import <AppKit/AppKit.h>
+#else
+#include <MobileCoreServices/MobileCoreServices.h>
#endif
#if defined(QT_PLATFORM_UIKIT)
@@ -779,6 +784,85 @@ QList<QByteArray> QMacPasteboardMimeVCard::convertFromMime(const QString &mime,
return ret;
}
+extern QImage qt_mac_toQImage(CGImageRef image);
+extern CGImageRef qt_mac_toCGImage(const QImage &qImage);
+
+class QMacPasteboardMimeTiff : public QMacInternalPasteboardMime {
+public:
+ QMacPasteboardMimeTiff() : QMacInternalPasteboardMime(MIME_ALL) { }
+ QString convertorName();
+
+ QString flavorFor(const QString &mime);
+ QString mimeFor(QString flav);
+ bool canConvert(const QString &mime, QString flav);
+ QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav);
+ QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav);
+};
+
+QString QMacPasteboardMimeTiff::convertorName()
+{
+ return QLatin1String("Tiff");
+}
+
+QString QMacPasteboardMimeTiff::flavorFor(const QString &mime)
+{
+ if (mime.startsWith(QLatin1String("application/x-qt-image")))
+ return QLatin1String("public.tiff");
+ return QString();
+}
+
+QString QMacPasteboardMimeTiff::mimeFor(QString flav)
+{
+ if (flav == QLatin1String("public.tiff"))
+ return QLatin1String("application/x-qt-image");
+ return QString();
+}
+
+bool QMacPasteboardMimeTiff::canConvert(const QString &mime, QString flav)
+{
+ return flav == QLatin1String("public.tiff") && mime == QLatin1String("application/x-qt-image");
+}
+
+QVariant QMacPasteboardMimeTiff::convertToMime(const QString &mime, QList<QByteArray> data, QString flav)
+{
+ if (data.count() > 1)
+ qWarning("QMacPasteboardMimeTiff: Cannot handle multiple member data");
+
+ if (!canConvert(mime, flav))
+ return QVariant();
+
+ QCFType<CFDataRef> tiffData = data.first().toRawCFData();
+ QCFType<CGImageSourceRef> imageSource = CGImageSourceCreateWithData(tiffData, 0);
+
+ if (QCFType<CGImageRef> image = CGImageSourceCreateImageAtIndex(imageSource, 0, 0))
+ return QVariant(qt_mac_toQImage(image));
+
+ return QVariant();
+}
+
+QList<QByteArray> QMacPasteboardMimeTiff::convertFromMime(const QString &mime, QVariant variant, QString flav)
+{
+ if (!canConvert(mime, flav))
+ return QList<QByteArray>();
+
+ QCFType<CFMutableDataRef> data = CFDataCreateMutable(0, 0);
+ QCFType<CGImageDestinationRef> imageDestination = CGImageDestinationCreateWithData(data, kUTTypeTIFF, 1, 0);
+
+ if (!imageDestination)
+ return QList<QByteArray>();
+
+ QImage img = qvariant_cast<QImage>(variant);
+ NSDictionary *props = @{
+ static_cast<NSString *>(kCGImagePropertyPixelWidth) : [NSNumber numberWithInt:img.width()],
+ static_cast<NSString *>(kCGImagePropertyPixelHeight) : [NSNumber numberWithInt:img.height()]
+ };
+
+ CGImageDestinationAddImage(imageDestination, qt_mac_toCGImage(img), static_cast<CFDictionaryRef>(props));
+ CGImageDestinationFinalize(imageDestination);
+
+ return QList<QByteArray>() << QByteArray::fromCFData(data);
+}
+
/*!
\internal
@@ -792,6 +876,7 @@ void QMacInternalPasteboardMime::initializeMimeTypes()
new QMacPasteboardMimeAny;
//standard types that we wrap
+ new QMacPasteboardMimeTiff;
new QMacPasteboardMimePlainTextFallback;
new QMacPasteboardMimeUnicodeText;
new QMacPasteboardMimeRtfText;
diff --git a/src/platformsupport/edid/edid.pro b/src/platformsupport/edid/edid.pro
new file mode 100644
index 0000000000..842a91170e
--- /dev/null
+++ b/src/platformsupport/edid/edid.pro
@@ -0,0 +1,13 @@
+TARGET = QtEdidSupport
+MODULE = edid_support
+
+QT = core-private
+CONFIG += static internal_module
+
+DEFINES += QT_NO_CAST_FROM_ASCII
+PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h
+
+HEADERS += qedidparser_p.h
+SOURCES += qedidparser.cpp
+
+load(qt_module)
diff --git a/src/platformsupport/edid/qedidparser.cpp b/src/platformsupport/edid/qedidparser.cpp
new file mode 100644
index 0000000000..ccf12e9eb3
--- /dev/null
+++ b/src/platformsupport/edid/qedidparser.cpp
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+** 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 <QtCore/QFile>
+
+#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
+
+#define EDID_OFFSET_DATA_BLOCKS 0x36
+#define EDID_OFFSET_LAST_BLOCK 0x6c
+#define EDID_OFFSET_PNP_ID 0x08
+#define EDID_OFFSET_SERIAL 0x0c
+#define EDID_PHYSICAL_WIDTH 0x15
+#define EDID_OFFSET_PHYSICAL_HEIGHT 0x16
+
+QT_BEGIN_NAMESPACE
+
+QEdidParser::QEdidParser()
+{
+ // Cache vendors list from pnp.ids
+ const QString fileName = QLatin1String("/usr/share/hwdata/pnp.ids");
+ if (QFile::exists(fileName)) {
+ QFile file(fileName);
+
+ if (file.open(QFile::ReadOnly)) {
+ while (!file.atEnd()) {
+ QString line = QString::fromUtf8(file.readLine()).trimmed();
+
+ if (line.startsWith(QLatin1Char('#')))
+ continue;
+
+ QStringList parts = line.split(QLatin1Char('\t'));
+ if (parts.count() > 1) {
+ QString pnpId = parts.at(0);
+ parts.removeFirst();
+ m_vendorCache[pnpId] = parts.join(QLatin1Char(' '));
+ }
+ }
+
+ file.close();
+ }
+ }
+}
+
+bool QEdidParser::parse(const QByteArray &blob)
+{
+ const quint8 *data = reinterpret_cast<const quint8 *>(blob.constData());
+ const size_t length = blob.length();
+
+ // Verify header
+ if (length < 128)
+ return false;
+ if (data[0] != 0x00 || data[1] != 0xff)
+ return false;
+
+ /* Decode the PNP ID from three 5 bit words packed into 2 bytes
+ * /--08--\/--09--\
+ * 7654321076543210
+ * |\---/\---/\---/
+ * R C1 C2 C3 */
+ char id[3];
+ id[0] = 'A' + ((data[EDID_OFFSET_PNP_ID] & 0x7c) / 4) - 1;
+ id[1] = 'A' + ((data[EDID_OFFSET_PNP_ID] & 0x3) * 8) + ((data[EDID_OFFSET_PNP_ID + 1] & 0xe0) / 32) - 1;
+ id[2] = 'A' + (data[EDID_OFFSET_PNP_ID + 1] & 0x1f) - 1;
+ identifier = QString::fromLatin1(id, 3);
+
+ // Clear manufacturer
+ manufacturer = QString();
+
+ // Serial number, will be overwritten by an ASCII descriptor
+ // when and if it will be found
+ quint32 serial = data[EDID_OFFSET_SERIAL]
+ + (data[EDID_OFFSET_SERIAL + 1] << 8)
+ + (data[EDID_OFFSET_SERIAL + 2] << 16)
+ + (data[EDID_OFFSET_SERIAL + 3] << 24);
+ if (serial > 0)
+ serialNumber = QString::number(serial);
+ else
+ serialNumber = QString();
+
+ // Parse EDID data
+ for (int i = 0; i < 5; ++i) {
+ const uint offset = EDID_OFFSET_DATA_BLOCKS + i * 18;
+
+ if (data[offset] != 0 || data[offset + 1] != 0 || data[offset + 2] != 0)
+ continue;
+
+ if (data[offset + 3] == EDID_DESCRIPTOR_PRODUCT_NAME)
+ model = parseEdidString(&data[offset + 5]);
+ else if (data[offset + 3] == EDID_DESCRIPTOR_ALPHANUMERIC_STRING)
+ identifier = parseEdidString(&data[offset + 5]);
+ else if (data[offset + 3] == EDID_DESCRIPTOR_SERIAL_NUMBER)
+ serialNumber = parseEdidString(&data[offset + 5]);
+ }
+
+ // Try to use cache first because it is potentially more updated
+ if (m_vendorCache.contains(identifier)) {
+ manufacturer = m_vendorCache[identifier];
+ } else {
+ // Find the manufacturer from the vendor lookup table
+ for (size_t i = 0; i < ARRAY_LENGTH(q_edidVendorTable); i++) {
+ if (strcmp(q_edidVendorTable[i].id, identifier.toLatin1().constData()) == 0) {
+ manufacturer = QString::fromUtf8(q_edidVendorTable[i].name);
+ break;
+ }
+ }
+ }
+
+ // If we don't know the manufacturer, fallback to PNP ID
+ if (manufacturer.isEmpty())
+ manufacturer = identifier;
+
+ // Physical size
+ physicalSize = QSizeF(data[EDID_PHYSICAL_WIDTH], data[EDID_OFFSET_PHYSICAL_HEIGHT]) * 10;
+
+ return true;
+}
+
+QString QEdidParser::parseEdidString(const quint8 *data)
+{
+ QByteArray buffer(reinterpret_cast<const char *>(data), 12);
+
+ // Erase carriage return and line feed
+ buffer = buffer.replace('\r', '\0').replace('\n', '\0');
+
+ // Replace non-printable characters with dash
+ for (int i = 0; i < buffer.count(); ++i) {
+ if (buffer[i] < '\040' && buffer[i] > '\176')
+ buffer[i] = '-';
+ }
+
+ return QString::fromLatin1(buffer.trimmed());
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/cglconvenience/cglconvenience_p.h b/src/platformsupport/edid/qedidparser_p.h
index e531e73549..c5888dc5d7 100644
--- a/src/platformsupport/cglconvenience/cglconvenience_p.h
+++ b/src/platformsupport/edid/qedidparser_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -37,8 +37,11 @@
**
****************************************************************************/
-#ifndef QMACGLCONVENIENCE_H
-#define QMACGLCONVENIENCE_H
+#ifndef QEDIDPARSER_P_H
+#define QEDIDPARSER_P_H
+
+#include <QtCore/QSize>
+#include <QtCore/QMap>
//
// W A R N I N G
@@ -48,14 +51,28 @@
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
-// We mean it.
-//
-#include <QSurfaceFormat>
-#include <QString>
-#include <OpenGL/OpenGL.h>
+QT_BEGIN_NAMESPACE
+
+class QEdidParser
+{
+public:
+ QEdidParser();
+
+ bool parse(const QByteArray &blob);
+
+ QString identifier;
+ QString manufacturer;
+ QString model;
+ QString serialNumber;
+ QSizeF physicalSize;
+
+private:
+ QMap<QString, QString> m_vendorCache;
+
+ QString parseEdidString(const quint8 *data);
+};
-QSurfaceFormat qcgl_surfaceFormat();
-void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format);
+QT_END_NAMESPACE
-#endif // QMACGLCONVENIENCE_H
+#endif // QEDIDPARSER_P_H
diff --git a/src/platformsupport/edid/qedidvendortable_p.h b/src/platformsupport/edid/qedidvendortable_p.h
new file mode 100644
index 0000000000..d09642d649
--- /dev/null
+++ b/src/platformsupport/edid/qedidvendortable_p.h
@@ -0,0 +1,2296 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+** 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$
+**
+****************************************************************************/
+
+/*
+ * This lookup table was generated from https://git.fedorahosted.org/cgit/hwdata.git/plain/pnp.ids
+ *
+ * Do not change directly this file, instead edit the
+ * qtbase/util/edid/qedidvendortable.py script and regenerate this file.
+ */
+
+#ifndef QEDIDVENDORTABLE_P_H
+#define QEDIDVENDORTABLE_P_H
+
+QT_BEGIN_NAMESPACE
+
+typedef struct VendorTable {
+ const char id[4];
+ const char name[78];
+} VendorTable;
+
+static const struct VendorTable q_edidVendorTable[] = {
+ { "LLL", "L-3 Communications" },
+ { "GMX", "GMX Inc" },
+ { "FOS", "Foss Tecator" },
+ { "PHI", "DO NOT USE - PHI" },
+ { "DNV", "DiCon" },
+ { "KZN", "K-Zone International" },
+ { "TIC", "Trigem KinfoComm" },
+ { "FNC", "Fanuc LTD" },
+ { "ESY", "E-Systems Inc" },
+ { "TGM", "TriGem Computer,Inc." },
+ { "DBN", "DB Networks Inc" },
+ { "GCS", "Grey Cell Systems Ltd" },
+ { "AVR", "AVer Information Inc." },
+ { "OKI", "OKI Electric Industrial Company Ltd" },
+ { "GDI", "G. Diehl ISDN GmbH" },
+ { "SPC", "SpinCore Technologies, Inc" },
+ { "ICV", "Inside Contactless" },
+ { "UNY", "Unicate" },
+ { "NMP", "Nokia Mobile Phones" },
+ { "HMC", "Hualon Microelectric Corporation" },
+ { "OPT", "OPTi Inc" },
+ { "TSG", "The Software Group Ltd" },
+ { "IMN", "Impossible Production" },
+ { "DHQ", "Quadram" },
+ { "UFG", "UNIGRAF-USA" },
+ { "CLA", "Clarion Company Ltd" },
+ { "IOM", "Iomega" },
+ { "MTS", "Multi-Tech Systems" },
+ { "TXN", "Texas Insturments" },
+ { "SDH", "Communications Specialies, Inc." },
+ { "DCC", "Dale Computer Corporation" },
+ { "PAK", "Many CNC System Co., Ltd." },
+ { "TDC", "Teradici" },
+ { "XAC", "XAC Automation Corp" },
+ { "DRI", "Data Race Inc" },
+ { "HAN", "Hanchang System Corporation" },
+ { "NTR", "N-trig Innovative Technologies, Inc." },
+ { "PDR", "Pure Data Inc" },
+ { "BNS", "Boulder Nonlinear Systems" },
+ { "EGO", "Ergo Electronics" },
+ { "ETS", "Electronic Trade Solutions Ltd" },
+ { "CNN", "Canon Inc" },
+ { "CSB", "Transtex SA" },
+ { "NAK", "Nakano Engineering Co.,Ltd." },
+ { "IME", "Imagraph" },
+ { "CYT", "Cytechinfo Inc" },
+ { "ADM", "Ad Lib MultiMedia Inc" },
+ { "IBC", "Integrated Business Systems" },
+ { "TMT", "T-Metrics Inc." },
+ { "ALP", "Alps Electric Company Ltd" },
+ { "TWX", "TEKWorx Limited" },
+ { "CDP", "CalComp" },
+ { "KSX", "King Tester Corporation" },
+ { "AMI", "American Megatrends Inc" },
+ { "KBI", "Kidboard Inc" },
+ { "COO", "coolux GmbH" },
+ { "CBR", "Cebra Tech A/S" },
+ { "ANA", "Anakron" },
+ { "ACT", "Applied Creative Technology" },
+ { "PGS", "Princeton Graphic Systems" },
+ { "DCL", "Dynamic Controls Ltd" },
+ { "TCH", "Interaction Systems, Inc" },
+ { "STP", "StreamPlay Ltd" },
+ { "PCG", "First Industrial Computer Inc" },
+ { "SSE", "Samsung Electronic Co." },
+ { "TXT", "Textron Defense System" },
+ { "XRO", "XORO ELECTRONICS (CHENGDU) LIMITED" },
+ { "MTU", "Mark of the Unicorn Inc" },
+ { "ERG", "Ergo System" },
+ { "GFN", "Gefen Inc." },
+ { "UNE", "Unisys Corporation" },
+ { "DDD", "Danka Data Devices" },
+ { "ZGT", "Zenith Data Systems" },
+ { "NAL", "Network Alchemy" },
+ { "FVX", "C-C-C Group Plc" },
+ { "AJA", "AJA Video Systems, Inc." },
+ { "AZT", "Aztech Systems Ltd" },
+ { "CIS", "Cisco Systems Inc" },
+ { "DUA", "Dosch & Amand GmbH & Company KG" },
+ { "INP", "Interphase Corporation" },
+ { "DMS", "DOME imaging systems" },
+ { "COW", "Polycow Productions" },
+ { "PTC", "PS Technology Corporation" },
+ { "PRD", "Praim S.R.L." },
+ { "DEC", "Digital Equipment Corporation" },
+ { "SMT", "Silcom Manufacturing Tech Inc" },
+ { "MII", "Mitec Inc" },
+ { "QLC", "Q-Logic" },
+ { "PRG", "The Phoenix Research Group Inc" },
+ { "LNV", "Lenovo" },
+ { "IND", "ILC" },
+ { "MXL", "Hitachi Maxell, Ltd." },
+ { "DAU", "Daou Tech Inc" },
+ { "SNK", "S&K Electronics" },
+ { "SYE", "SY Electronics Ltd" },
+ { "BCC", "Beaver Computer Corporaton" },
+ { "LPI", "Design Technology" },
+ { "CLO", "Clone Computers" },
+ { "CMI", "C-Media Electronics" },
+ { "ESK", "ES&S" },
+ { "HCW", "Hauppauge Computer Works Inc" },
+ { "KPC", "King Phoenix Company" },
+ { "DXS", "Signet" },
+ { "OLY", "OLYMPUS CORPORATION" },
+ { "OOS", "OSRAM" },
+ { "NOE", "NordicEye AB" },
+ { "DXP", "Data Expert Corporation" },
+ { "ITP", "IT-PRO Consulting und Systemhaus GmbH" },
+ { "MMS", "MMS Electronics" },
+ { "FDC", "Future Domain" },
+ { "ASM", "ASEM S.p.A." },
+ { "AIC", "Arnos Insturments & Computer Systems" },
+ { "ANC", "Ancot" },
+ { "SEE", "SeeColor Corporation" },
+ { "JAS", "Janz Automationssysteme AG" },
+ { "TGV", "Grass Valley Germany GmbH" },
+ { "LTI", "Jongshine Tech Inc" },
+ { "JVC", "JVC" },
+ { "TLV", "S3 Inc" },
+ { "MGC", "Mentor Graphics Corporation" },
+ { "NBS", "National Key Lab. on ISN" },
+ { "GTI", "Goldtouch" },
+ { "SPI", "SPACE-I Co., Ltd." },
+ { "ZNX", "Znyx Adv. Systems" },
+ { "EMC", "eMicro Corporation" },
+ { "WDE", "Westinghouse Digital Electronics" },
+ { "CEN", "Centurion Technologies P/L" },
+ { "BFE", "B.F. Engineering Corporation" },
+ { "DTL", "e-Net Inc" },
+ { "FTL", "FUJITSU TEN LIMITED" },
+ { "HSC", "Hagiwara Sys-Com Company Ltd" },
+ { "ECP", "Elecom Company Ltd" },
+ { "LJX", "Datalogic Corporation" },
+ { "DRC", "Data Ray Corp." },
+ { "STM", "SGS Thomson Microelectronics" },
+ { "GDT", "Vortex Computersysteme GmbH" },
+ { "JSK", "SANKEN ELECTRIC CO., LTD" },
+ { "TMC", "Techmedia Computer Systems Corporation" },
+ { "CFG", "Atlantis" },
+ { "DCO", "Dialogue Technology Corporation" },
+ { "NEC", "NEC Corporation" },
+ { "SAE", "Saab Aerotech" },
+ { "STA", "ST Electronics Systems Assembly Pte Ltd" },
+ { "GEO", "GEO Sense" },
+ { "SLH", "Silicon Library Inc." },
+ { "SAG", "Sedlbauer" },
+ { "VEK", "Vektrex" },
+ { "ADA", "Addi-Data GmbH" },
+ { "NCT", "NEC CustomTechnica, Ltd." },
+ { "STX", "ST-Ericsson" },
+ { "PRM", "Prometheus" },
+ { "DPA", "DigiTalk Pro AV" },
+ { "SLF", "StarLeaf" },
+ { "AXY", "AXYZ Automation Services, Inc" },
+ { "CPX", "Powermatic Data Systems" },
+ { "DLL", "Dell Inc" },
+ { "PLF", "Panasonic Avionics Corporation" },
+ { "FRI", "Fibernet Research Inc" },
+ { "BRM", "Braemar Inc" },
+ { "MSK", "Megasoft Inc" },
+ { "ECT", "Enciris Technologies" },
+ { "TKO", "TouchKo, Inc." },
+ { "CYC", "Cylink Corporation" },
+ { "SMR", "B.& V. s.r.l." },
+ { "SRT", "SeeReal Technologies GmbH" },
+ { "GES", "GES Singapore Pte Ltd" },
+ { "DHT", "Projectavision Inc" },
+ { "ESC", "Eden Sistemas de Computacao S/A" },
+ { "BYD", "byd:sign corporation" },
+ { "BMI", "Benson Medical Instruments Company" },
+ { "XSY", "XSYS" },
+ { "MYX", "Micronyx Inc" },
+ { "OUK", "OUK Company Ltd" },
+ { "MPI", "Mediatrix Peripherals Inc" },
+ { "BUS", "BusTek" },
+ { "LCN", "LEXICON" },
+ { "ADS", "Analog Devices Inc" },
+ { "XTL", "Crystal Computer" },
+ { "CEF", "Cefar Digital Vision" },
+ { "IPP", "IP Power Technologies GmbH" },
+ { "CDV", "Convergent Design Inc." },
+ { "OLD", "Olidata S.p.A." },
+ { "GNN", "GN Nettest Inc" },
+ { "ADH", "Aerodata Holdings Ltd" },
+ { "IMM", "Immersion Corporation" },
+ { "CBT", "Cabletime Ltd" },
+ { "RVI", "Realvision Inc" },
+ { "HNS", "Hughes Network Systems" },
+ { "HAR", "Harris Corporation" },
+ { "ACV", "ActivCard S.A" },
+ { "RUN", "RUNCO International" },
+ { "WDC", "Western Digital" },
+ { "SIG", "Sigma Designs Inc" },
+ { "PNR", "Planar Systems, Inc." },
+ { "PRS", "Leutron Vision" },
+ { "KEM", "Kontron Embedded Modules GmbH" },
+ { "LAN", "Sodeman Lancom Inc" },
+ { "CEM", "MEC Electronics GmbH" },
+ { "RHD", "RightHand Technologies" },
+ { "CHE", "Acer Inc" },
+ { "POL", "PolyComp (PTY) Ltd." },
+ { "MST", "MS Telematica" },
+ { "ALA", "Alacron Inc" },
+ { "EDI", "Edimax Tech. Company Ltd" },
+ { "EGN", "Egenera, Inc." },
+ { "PIX", "Pixie Tech Inc" },
+ { "AVN", "Advance Computer Corporation" },
+ { "CTN", "Computone Products" },
+ { "SFM", "TORNADO Company" },
+ { "ATA", "Allied Telesyn International (Asia) Pte Ltd" },
+ { "SIA", "SIEMENS AG" },
+ { "NAV", "Navigation Corporation" },
+ { "PRF", "Digital Electronics Corporation" },
+ { "HRE", "Qingdao Haier Electronics Co., Ltd." },
+ { "NAC", "Ncast Corporation" },
+ { "ELM", "Elmic Systems Inc" },
+ { "HYR", "Hypertec Pty Ltd" },
+ { "EMB", "Embedded computing inc ltd" },
+ { "MWR", "mware" },
+ { "KGL", "KEISOKU GIKEN Co.,Ltd." },
+ { "NRL", "U.S. Naval Research Lab" },
+ { "TNM", "TECNIMAGEN SA" },
+ { "GTT", "General Touch Technology Co., Ltd." },
+ { "BTE", "Brilliant Technology" },
+ { "KDS", "KDS USA" },
+ { "EEP", "E.E.P.D. GmbH" },
+ { "NCI", "NewCom Inc" },
+ { "CIP", "Ciprico Inc" },
+ { "RTL", "Realtek Semiconductor Company Ltd" },
+ { "MUK", "mainpine limited" },
+ { "SLX", "Specialix" },
+ { "HCM", "HCL Peripherals" },
+ { "CHA", "Chase Research PLC" },
+ { "VOB", "MaxData Computer AG" },
+ { "ANK", "Anko Electronic Company Ltd" },
+ { "FWR", "Flat Connections Inc" },
+ { "DXL", "Dextera Labs Inc" },
+ { "QVU", "Quartics" },
+ { "MPS", "mps Software GmbH" },
+ { "AVM", "AVM GmbH" },
+ { "TDY", "Tandy Electronics" },
+ { "MJS", "MJS Designs" },
+ { "SNC", "Sentronic International Corp." },
+ { "IPT", "International Power Technologies" },
+ { "API", "A Plus Info Corporation" },
+ { "TLT", "Dai Telecom S.p.A." },
+ { "PCC", "PowerCom Technology Company Ltd" },
+ { "TRM", "Tekram Technology Company Ltd" },
+ { "DEL", "Dell Inc." },
+ { "CYW", "Cyberware" },
+ { "TDS", "Tri-Data Systems Inc" },
+ { "FPE", "Fujitsu Peripherals Ltd" },
+ { "SPN", "Sapience Corporation" },
+ { "COX", "Comrex" },
+ { "STE", "SII Ido-Tsushin Inc" },
+ { "RVC", "RSI Systems Inc" },
+ { "HMK", "hmk Daten-System-Technik BmbH" },
+ { "TTA", "Topson Technology Co., Ltd." },
+ { "CSM", "Cosmic Engineering Inc." },
+ { "PTL", "Pantel Inc" },
+ { "EQX", "Equinox Systems Inc" },
+ { "HEL", "Hitachi Micro Systems Europe Ltd" },
+ { "TIX", "Tixi.Com GmbH" },
+ { "CMD", "Colorado MicroDisplay, Inc." },
+ { "VIS", "Visioneer" },
+ { "MTH", "Micro-Tech Hearing Instruments" },
+ { "ISR", "INSIS Co., LTD." },
+ { "EME", "EMiNE TECHNOLOGY COMPANY, LTD." },
+ { "DMT", "Distributed Management Task Force, Inc. (DMTF)" },
+ { "JFX", "Jones Futurex Inc" },
+ { "SMB", "Schlumberger" },
+ { "GTM", "Garnet System Company Ltd" },
+ { "DBK", "Databook Inc" },
+ { "IQT", "IMAGEQUEST Co., Ltd" },
+ { "DTX", "Data Translation" },
+ { "QSI", "Quantum Solutions, Inc." },
+ { "BEL", "Beltronic Industrieelektronik GmbH" },
+ { "PJT", "Pan Jit International Inc." },
+ { "WST", "Wistron Corporation" },
+ { "ASN", "Asante Tech Inc" },
+ { "ROS", "Rohde & Schwarz" },
+ { "NWP", "NovaWeb Technologies Inc" },
+ { "CLG", "CoreLogic" },
+ { "ECS", "Elitegroup Computer Systems Company Ltd" },
+ { "PER", "Perceptive Signal Technologies" },
+ { "SPR", "pmns GmbH" },
+ { "DLB", "Dolby Laboratories Inc." },
+ { "SRF", "Surf Communication Solutions Ltd" },
+ { "ATM", "ATM Ltd" },
+ { "MED", "Messeltronik Dresden GmbH" },
+ { "SGD", "Sigma Designs, Inc." },
+ { "RJA", "Roland Corporation" },
+ { "EDC", "e.Digital Corporation" },
+ { "CON", "Contec Company Ltd" },
+ { "CCJ", "CONTEC CO.,LTD." },
+ { "GVC", "GVC Corporation" },
+ { "TRI", "Tricord Systems" },
+ { "SLB", "Shlumberger Ltd" },
+ { "PRO", "Proteon" },
+ { "DSI", "Digitan Systems Inc" },
+ { "SDF", "SODIFF E&T CO., Ltd." },
+ { "VDC", "VDC Display Systems" },
+ { "PSL", "Perle Systems Limited" },
+ { "SCR", "Systran Corporation" },
+ { "DEX", "idex displays" },
+ { "CDS", "Computer Diagnostic Systems" },
+ { "RAY", "Raylar Design, Inc." },
+ { "MMF", "Minnesota Mining and Manufacturing" },
+ { "MMA", "Micromedia AG" },
+ { "FUS", "Fujitsu Siemens Computers GmbH" },
+ { "ESS", "ESS Technology Inc" },
+ { "SIX", "Zuniq Data Corporation" },
+ { "ISS", "ISS Inc" },
+ { "PFT", "Telia ProSoft AB" },
+ { "SOL", "Solitron Technologies Inc" },
+ { "ZTM", "ZT Group Int'l Inc." },
+ { "GZE", "GUNZE Limited" },
+ { "CHS", "Agentur Chairos" },
+ { "CBI", "ComputerBoards Inc" },
+ { "DTA", "DELTATEC" },
+ { "CSC", "Crystal Semiconductor" },
+ { "MPC", "M-Pact Inc" },
+ { "HHI", "Fraunhofer Heinrich-Hertz-Institute" },
+ { "BIT", "Bit 3 Computer" },
+ { "ICP", "ICP Electronics, Inc./iEi Technology Corp." },
+ { "FOA", "FOR-A Company Limited" },
+ { "NWC", "NW Computer Engineering" },
+ { "MRO", "Medikro Oy" },
+ { "IDT", "International Display Technology" },
+ { "NMV", "NEC-Mitsubishi Electric Visual Systems Corporation" },
+ { "COT", "Core Technology Inc" },
+ { "PEL", "Primax Electric Ltd" },
+ { "ZMZ", "Z Microsystems" },
+ { "TYN", "Tyan Computer Corporation" },
+ { "DIN", "Daintelecom Co., Ltd" },
+ { "QTH", "Questech Ltd" },
+ { "CYL", "Cyberlabs" },
+ { "DGC", "Data General Corporation" },
+ { "PPM", "Clinton Electronics Corp." },
+ { "ITD", "Internet Technology Corporation" },
+ { "MMM", "Electronic Measurements" },
+ { "CMM", "Comtime GmbH" },
+ { "NDC", "National DataComm Corporaiton" },
+ { "TAS", "Taskit Rechnertechnik GmbH" },
+ { "MFR", "MediaFire Corp." },
+ { "HIC", "Hitachi Information Technology Co., Ltd." },
+ { "CMC", "CMC Ltd" },
+ { "TSE", "Tottori Sanyo Electric" },
+ { "TMR", "Taicom International Inc" },
+ { "SIE", "Siemens" },
+ { "IMD", "ImasDe Canarias S.A." },
+ { "SCE", "Sun Corporation" },
+ { "PJD", "Projectiondesign AS" },
+ { "VML", "Vine Micros Limited" },
+ { "ETL", "Evertz Microsystems Ltd." },
+ { "MAZ", "MAZeT GmbH" },
+ { "UNC", "Unisys Corporation" },
+ { "MEG", "Abeam Tech Ltd" },
+ { "FCS", "Focus Enhancements, Inc." },
+ { "MDV", "MET Development Inc" },
+ { "GLD", "Goldmund - Digital Audio SA" },
+ { "MRC", "Marconi Simulation & Ty-Coch Way Training" },
+ { "FEC", "FURUNO ELECTRIC CO., LTD." },
+ { "ALR", "Advanced Logic" },
+ { "AEJ", "Alpha Electronics Company" },
+ { "QCC", "QuakeCom Company Ltd" },
+ { "TDK", "TDK USA Corporation" },
+ { "TKN", "Teknor Microsystem Inc" },
+ { "FMC", "Ford Microelectronics Inc" },
+ { "KTI", "Konica Technical Inc" },
+ { "AEI", "Actiontec Electric Inc" },
+ { "TGI", "TriGem Computer Inc" },
+ { "HIL", "Hilevel Technology" },
+ { "WNI", "WillNet Inc." },
+ { "FTI", "FastPoint Technologies, Inc." },
+ { "ASU", "Asuscom Network Inc" },
+ { "MEJ", "Mac-Eight Co., LTD." },
+ { "SLS", "Schnick-Schnack-Systems GmbH" },
+ { "SXG", "SELEX GALILEO" },
+ { "EXP", "Data Export Corporation" },
+ { "TPR", "Topro Technology Inc" },
+ { "RCE", "Parc d'Activite des Bellevues" },
+ { "VIK", "Viking Connectors" },
+ { "TGS", "Torus Systems Ltd" },
+ { "IDO", "IDEO Product Development" },
+ { "MCE", "Metz-Werke GmbH & Co KG" },
+ { "PHC", "Pijnenburg Beheer N.V." },
+ { "BTF", "Bitfield Oy" },
+ { "MCD", "McDATA Corporation" },
+ { "EXY", "Exterity Ltd" },
+ { "ZTI", "Zoom Telephonics Inc" },
+ { "MTI", "Motorola Inc." },
+ { "ONK", "ONKYO Corporation" },
+ { "SEC", "Seiko Epson Corporation" },
+ { "TTB", "National Semiconductor Japan Ltd" },
+ { "SNO", "SINOSUN TECHNOLOGY CO., LTD" },
+ { "SHG", "Soft & Hardware development Goldammer GmbH" },
+ { "GEM", "Gem Plus" },
+ { "BOS", "BOS" },
+ { "SAK", "Saitek Ltd" },
+ { "CNE", "Cine-tal" },
+ { "BOB", "Rainy Orchard" },
+ { "UNF", "Unisys Corporation" },
+ { "MCG", "Motorola Computer Group" },
+ { "RTC", "Relia Technologies" },
+ { "ASD", "USC Information Sciences Institute" },
+ { "BMS", "BIOMEDISYS" },
+ { "LPE", "El-PUSK Co., Ltd." },
+ { "CTA", "CoSystems Inc" },
+ { "SVI", "Sun Microsystems" },
+ { "PCS", "TOSHIBA PERSONAL COMPUTER SYSTEM CORPRATION" },
+ { "GEN", "Genesys ATE Inc" },
+ { "CRI", "Crio Inc." },
+ { "TOG", "The OPEN Group" },
+ { "SYT", "Seyeon Tech Company Ltd" },
+ { "CRE", "Creative Labs Inc" },
+ { "ALK", "Acrolink Inc" },
+ { "TNC", "TNC Industrial Company Ltd" },
+ { "PLV", "PLUS Vision Corp." },
+ { "CCL", "CCL/ITRI" },
+ { "PLY", "Polycom Inc." },
+ { "RMC", "Raritan Computer, Inc" },
+ { "XRC", "Xircom Inc" },
+ { "BRC", "BARC" },
+ { "CUK", "Calibre UK Ltd" },
+ { "KME", "KIMIN Electronics Co., Ltd." },
+ { "TBS", "Turtle Beach System" },
+ { "ASY", "Rockwell Collins / Airshow Systems" },
+ { "ALV", "AlphaView LCD" },
+ { "VSD", "3M" },
+ { "MTN", "Mtron Storage Technology Co., Ltd." },
+ { "LMG", "Lucent Technologies" },
+ { "HWP", "Hewlett Packard" },
+ { "UEG", "Elitegroup Computer Systems Company Ltd" },
+ { "FIC", "Formosa Industrial Computing Inc" },
+ { "CRV", "Cerevo Inc." },
+ { "AIL", "Altos India Ltd" },
+ { "EMI", "Ex Machina Inc" },
+ { "DPC", "Delta Electronics Inc" },
+ { "ADN", "Analog & Digital Devices Tel. Inc" },
+ { "LGC", "Logic Ltd" },
+ { "DMP", "D&M Holdings Inc, Professional Business Company" },
+ { "CEC", "Chicony Electronics Company Ltd" },
+ { "BTC", "Bit 3 Computer" },
+ { "IWX", "Intelliworxx, Inc." },
+ { "SML", "Sumitomo Metal Industries, Ltd." },
+ { "JWY", "Jetway Information Co., Ltd" },
+ { "OMC", "OBJIX Multimedia Corporation" },
+ { "CIT", "Citifax Limited" },
+ { "AOE", "Advanced Optics Electronics, Inc." },
+ { "SYC", "Sysmic" },
+ { "ZTT", "Z3 Technology" },
+ { "LCS", "Longshine Electronics Company" },
+ { "NXQ", "Nexiq Technologies, Inc." },
+ { "PSY", "Prodea Systems Inc." },
+ { "CUB", "Cubix Corporation" },
+ { "JWL", "Jewell Instruments, LLC" },
+ { "SUB", "Subspace Comm. Inc" },
+ { "PTG", "Cipher Systems Inc" },
+ { "TON", "TONNA" },
+ { "VBR", "VBrick Systems Inc." },
+ { "RTI", "Rancho Tech Inc" },
+ { "IMG", "IMAGENICS Co., Ltd." },
+ { "AEP", "Aetas Peripheral International" },
+ { "PTH", "Pathlight Technology Inc" },
+ { "ZYX", "Zyxel" },
+ { "NXP", "NXP Semiconductors bv." },
+ { "OYO", "Shadow Systems" },
+ { "PVM", "Penta Studiotechnik GmbH" },
+ { "AVC", "Auravision Corporation" },
+ { "SYM", "Symicron Computer Communications Ltd." },
+ { "AVI", "Nippon Avionics Co.,Ltd" },
+ { "EYE", "eyevis GmbH" },
+ { "PLM", "PROLINK Microsystems Corp." },
+ { "NFC", "BTC Korea Co., Ltd" },
+ { "PIE", "Pacific Image Electronics Company Ltd" },
+ { "SRC", "Integrated Tech Express Inc" },
+ { "CMX", "Comex Electronics AB" },
+ { "OPP", "OPPO Digital, Inc." },
+ { "GAL", "Galil Motion Control" },
+ { "YHW", "Exacom SA" },
+ { "SSD", "FlightSafety International" },
+ { "FSC", "Future Systems Consulting KK" },
+ { "HRI", "Hall Research" },
+ { "PSA", "Advanced Signal Processing Technologies" },
+ { "MSI", "Microstep" },
+ { "IMI", "International Microsystems Inc" },
+ { "IDX", "IDEXX Labs" },
+ { "SCO", "SORCUS Computer GmbH" },
+ { "DIS", "Diseda S.A." },
+ { "SVA", "SGEG" },
+ { "SMA", "SMART Modular Technologies" },
+ { "SXL", "SolutionInside" },
+ { "WRC", "WiNRADiO Communications" },
+ { "NIT", "Network Info Technology" },
+ { "EKS", "EKSEN YAZILIM" },
+ { "GEF", "GE Fanuc Embedded Systems" },
+ { "DEI", "Deico Electronics" },
+ { "DCD", "Datacast LLC" },
+ { "MEE", "Mitsubishi Electric Engineering Co., Ltd." },
+ { "LSC", "LifeSize Communications" },
+ { "PDV", "Prodrive B.V." },
+ { "HIB", "Hibino Corporation" },
+ { "SKT", "Samsung Electro-Mechanics Company Ltd" },
+ { "SAN", "Sanyo Electric Co.,Ltd." },
+ { "RCO", "Rockwell Collins" },
+ { "SNY", "Sony" },
+ { "ANR", "ANR Ltd" },
+ { "DKY", "Datakey Inc" },
+ { "OPC", "Opcode Inc" },
+ { "TBC", "Turbo Communication, Inc" },
+ { "CNT", "COINT Multimedia Systems" },
+ { "HDC", "HardCom Elektronik & Datateknik" },
+ { "UNB", "Unisys Corporation" },
+ { "IOD", "I-O Data Device Inc" },
+ { "APR", "Aprilia s.p.a." },
+ { "AXX", "Axxon Computer Corporation" },
+ { "AED", "Advanced Electronic Designs, Inc." },
+ { "MTX", "Matrox" },
+ { "TAX", "Taxan (Europe) Ltd" },
+ { "TVS", "TVS Electronics Limited" },
+ { "CZE", "Carl Zeiss AG" },
+ { "SMI", "SpaceLabs Medical Inc" },
+ { "FCB", "Furukawa Electric Company Ltd" },
+ { "AXP", "American Express" },
+ { "FST", "Modesto PC Inc" },
+ { "PSI", "PSI-Perceptive Solutions Inc" },
+ { "MCR", "Marina Communicaitons" },
+ { "JCE", "Jace Tech Inc" },
+ { "GRE", "GOLD RAIN ENTERPRISES CORP." },
+ { "SYN", "Synaptics Inc" },
+ { "MBC", "MBC" },
+ { "SIB", "Sanyo Electric Company Ltd" },
+ { "TCT", "Telecom Technology Centre Co. Ltd." },
+ { "BIC", "Big Island Communications" },
+ { "UNI", "Unisys Corporation" },
+ { "ELX", "Elonex PLC" },
+ { "ZDS", "Zenith Data Systems" },
+ { "XLX", "Xilinx, Inc." },
+ { "MIC", "Micom Communications Inc" },
+ { "SEB", "system elektronik GmbH" },
+ { "WIN", "Wintop Technology Inc" },
+ { "CDG", "Christie Digital Systems Inc" },
+ { "HUB", "GAI-Tronics, A Hubbell Company" },
+ { "CSE", "Concept Solutions & Engineering" },
+ { "SUR", "Surenam Computer Corporation" },
+ { "VTM", "Miltope Corporation" },
+ { "ATK", "Allied Telesyn Int'l" },
+ { "MGT", "Megatech R & D Company" },
+ { "SLK", "Silitek Corporation" },
+ { "DYN", "Askey Computer Corporation" },
+ { "KEY", "Key Tech Inc" },
+ { "DVD", "Dictaphone Corporation" },
+ { "OTT", "OPTO22, Inc." },
+ { "TCI", "Tulip Computers Int'l B.V." },
+ { "ACB", "Aculab Ltd" },
+ { "PAD", "Promotion and Display Technology Ltd." },
+ { "CMG", "Chenming Mold Ind. Corp." },
+ { "UJR", "Ueda Japan Radio Co., Ltd." },
+ { "LHA", "Lars Haagh ApS" },
+ { "SIM", "S3 Inc" },
+ { "TPC", "Touch Panel Systems Corporation" },
+ { "TVD", "Tecnovision" },
+ { "FZI", "FZI Forschungszentrum Informatik" },
+ { "AIW", "Aiwa Company Ltd" },
+ { "LTW", "Lightware, Inc" },
+ { "DSP", "Domain Technology Inc" },
+ { "ILS", "Innotech Corporation" },
+ { "VDM", "Vadem" },
+ { "KYK", "Samsung Electronics America Inc" },
+ { "NTW", "Networth Inc" },
+ { "SID", "Seiko Instruments Information Devices Inc" },
+ { "MRT", "Merging Technologies" },
+ { "MGL", "M-G Technology Ltd" },
+ { "UBL", "Ubinetics Ltd." },
+ { "PSM", "Prosum" },
+ { "MDR", "Medar Inc" },
+ { "STN", "Samsung Electronics America" },
+ { "NCR", "NCR Electronics" },
+ { "INU", "Inovatec S.p.A." },
+ { "WAL", "Wave Access" },
+ { "BLN", "BioLink Technologies" },
+ { "RXT", "Tectona SoftSolutions (P) Ltd.," },
+ { "MRL", "Miratel" },
+ { "ZAZ", "Zazzle Technologies" },
+ { "NIC", "National Instruments Corporation" },
+ { "FMZ", "Formoza-Altair" },
+ { "MDG", "Madge Networks" },
+ { "VIA", "VIA Tech Inc" },
+ { "KOD", "Eastman Kodak Company" },
+ { "SAI", "Sage Inc" },
+ { "FEL", "Fellowes & Questec" },
+ { "SLI", "Symbios Logic Inc" },
+ { "ELE", "Elecom Company Ltd" },
+ { "FRE", "Forvus Research Inc" },
+ { "TTL", "2-Tel B.V." },
+ { "PPX", "Perceptive Pixel Inc." },
+ { "NAT", "NaturalPoint Inc." },
+ { "SLC", "Syslogic Datentechnik AG" },
+ { "PAM", "Peter Antesberger Messtechnik" },
+ { "JPW", "Wallis Hamilton Industries" },
+ { "AVA", "Avaya Communication" },
+ { "EEH", "EEH Datalink GmbH" },
+ { "WMT", "Winmate Communication Inc" },
+ { "LWC", "Labway Corporation" },
+ { "HYO", "HYC CO., LTD." },
+ { "MCC", "Micro Industries" },
+ { "IOA", "CRE Technology Corporation" },
+ { "AGI", "Artish Graphics Inc" },
+ { "TDT", "TDT" },
+ { "UNO", "Unisys Corporation" },
+ { "LIN", "Lenovo Beijing Co. Ltd." },
+ { "MAG", "MAG InnoVision" },
+ { "HCL", "HCL America Inc" },
+ { "BWK", "Bitworks Inc." },
+ { "BSN", "BRIGHTSIGN, LLC" },
+ { "INM", "InnoMedia Inc" },
+ { "MIN", "Minicom Digital Signage" },
+ { "ARE", "ICET S.p.A." },
+ { "TPZ", "Ypoaz Systems Inc" },
+ { "BRO", "BROTHER INDUSTRIES,LTD." },
+ { "MEX", "MSC Vertriebs GmbH" },
+ { "FJC", "Fujitsu Takamisawa Component Limited" },
+ { "HRT", "HERCULES" },
+ { "MOM", "Momentum Data Systems" },
+ { "RSV", "Ross Video Ltd" },
+ { "RAN", "Rancho Tech Inc" },
+ { "HOL", "Holoeye Photonics AG" },
+ { "SOT", "Sotec Company Ltd" },
+ { "AAE", "Anatek Electronics Inc." },
+ { "ZYT", "Zytex Computers" },
+ { "APP", "Apple Computer Inc" },
+ { "MCM", "Metricom Inc" },
+ { "NXC", "NextCom K.K." },
+ { "CBX", "Cybex Computer Products Corporation" },
+ { "FJS", "Fujitsu Spain" },
+ { "SNI", "Siemens Microdesign GmbH" },
+ { "MPL", "Maple Research Inst. Company Ltd" },
+ { "PLX", "Parallax Graphics" },
+ { "EAS", "Evans and Sutherland Computer" },
+ { "ZBR", "Zebra Technologies International, LLC" },
+ { "MSL", "MicroSlate Inc." },
+ { "XOC", "DO NOT USE - XOC" },
+ { "EMG", "EMG Consultants Inc" },
+ { "SMC", "Standard Microsystems Corporation" },
+ { "RAD", "Radisys Corporation" },
+ { "NMS", "Natural Micro System" },
+ { "APT", "Audio Processing Technology Ltd" },
+ { "MLI", "McIntosh Laboratory Inc." },
+ { "ISI", "Interface Solutions" },
+ { "RAT", "Rent-A-Tech" },
+ { "BAN", "Banyan" },
+ { "PCL", "pentel.co.,ltd" },
+ { "CSI", "Cabletron System Inc" },
+ { "IVS", "Intevac Photonics Inc." },
+ { "MAT", "Matsushita Electric Ind. Company Ltd" },
+ { "LWR", "Lightware Visual Engineering" },
+ { "FWA", "Attero Tech, LLC" },
+ { "ORI", "OSR Open Systems Resources, Inc." },
+ { "ARG", "Argus Electronics Co., LTD" },
+ { "CAS", "CASIO COMPUTER CO.,LTD" },
+ { "DHP", "DH Print" },
+ { "TTS", "TechnoTrend Systemtechnik GmbH" },
+ { "HHC", "HIRAKAWA HEWTECH CORP." },
+ { "GRM", "Garmin International" },
+ { "BUL", "Bull" },
+ { "AFA", "Alfa Inc" },
+ { "OVR", "Oculus VR, Inc." },
+ { "EPI", "Envision Peripherals, Inc" },
+ { "GSC", "General Standards Corporation" },
+ { "DNG", "Apache Micro Peripherals Inc" },
+ { "VIN", "Vine Micros Ltd" },
+ { "PTW", "DO NOT USE - PTW" },
+ { "MFI", "Micro Firmware" },
+ { "SMP", "Simple Computing" },
+ { "HCA", "DAT" },
+ { "PHL", "Philips Consumer Electronics Company" },
+ { "ADC", "Acnhor Datacomm" },
+ { "VBT", "Valley Board Ltda" },
+ { "MPX", "Micropix Technologies, Ltd." },
+ { "VSP", "Vision Systems GmbH" },
+ { "PJA", "Projecta" },
+ { "AMT", "AMT International Industry" },
+ { "VCI", "VistaCom Inc" },
+ { "XIR", "Xirocm Inc" },
+ { "MBV", "Moreton Bay" },
+ { "NSC", "National Semiconductor Corporation" },
+ { "TPV", "Top Victory Electronics ( Fujian ) Company Ltd" },
+ { "HAE", "Haider electronics" },
+ { "PKA", "Acco UK ltd." },
+ { "PXC", "Phoenix Contact" },
+ { "BXE", "Buxco Electronics" },
+ { "OZC", "OZ Corporation" },
+ { "TXL", "Trixel Ltd" },
+ { "MXD", "MaxData Computer GmbH & Co.KG" },
+ { "ASK", "Ask A/S" },
+ { "KSC", "Kinetic Systems Corporation" },
+ { "XAD", "Alpha Data" },
+ { "MVI", "Media Vision Inc" },
+ { "BPU", "Best Power" },
+ { "LAF", "Microline" },
+ { "SPS", "Synopsys Inc" },
+ { "WXT", "Woxter Technology Co. Ltd" },
+ { "NIX", "Seanix Technology Inc" },
+ { "HPA", "Zytor Communications" },
+ { "SPK", "SpeakerCraft" },
+ { "CHP", "CH Products" },
+ { "SNX", "Sonix Comm. Ltd" },
+ { "LZX", "Lightwell Company Ltd" },
+ { "ART", "Corion Industrial Corporation" },
+ { "IFS", "In Focus Systems Inc" },
+ { "DAL", "Digital Audio Labs Inc" },
+ { "STR", "Starlight Networks Inc" },
+ { "PRT", "Parade Technologies, Ltd." },
+ { "VRC", "Virtual Resources Corporation" },
+ { "IIC", "ISIC Innoscan Industrial Computers A/S" },
+ { "AUR", "Aureal Semiconductor" },
+ { "ATC", "Ably-Tech Corporation" },
+ { "ODR", "Odrac" },
+ { "LIP", "Linked IP GmbH" },
+ { "FLI", "Faroudja Laboratories" },
+ { "AVV", "SBS Technologies (Canada), Inc. (was Avvida Systems, Inc.)" },
+ { "ECM", "E-Cmos Tech Corporation" },
+ { "LAG", "Laguna Systems" },
+ { "FFC", "FUJIFILM Corporation" },
+ { "MAX", "Rogen Tech Distribution Inc" },
+ { "HUM", "IMP Electronics Ltd." },
+ { "VTX", "Vestax Corporation" },
+ { "NST", "Network Security Technology Co" },
+ { "FLY", "Butterfly Communications" },
+ { "ETT", "E-Tech Inc" },
+ { "NXS", "Technology Nexus Secure Open Systems AB" },
+ { "VES", "Vestel Elektronik Sanayi ve Ticaret A. S." },
+ { "EBT", "HUALONG TECHNOLOGY CO., LTD" },
+ { "HPK", "HAMAMATSU PHOTONICS K.K." },
+ { "RGB", "RGB Spectrum" },
+ { "AUI", "Alps Electric Inc" },
+ { "ICI", "Infotek Communication Inc" },
+ { "NTS", "Nits Technology Inc." },
+ { "EVI", "eviateg GmbH" },
+ { "CRD", "Cardinal Technical Inc" },
+ { "MOD", "Modular Technology" },
+ { "CCP", "Capetronic USA Inc" },
+ { "DGS", "Diagsoft Inc" },
+ { "IFT", "Informtech" },
+ { "LWW", "Lanier Worldwide" },
+ { "SDK", "SAIT-Devlonics" },
+ { "UWC", "Uniwill Computer Corp." },
+ { "MXV", "MaxVision Corporation" },
+ { "HOE", "Hosiden Corporation" },
+ { "SGE", "Kansai Electric Company Ltd" },
+ { "URD", "Video Computer S.p.A." },
+ { "TSV", "TRANSVIDEO" },
+ { "MBM", "Marshall Electronics" },
+ { "TLA", "Ferrari Electronic GmbH" },
+ { "GLM", "Genesys Logic" },
+ { "LEN", "Lenovo Group Limited" },
+ { "SAM", "Samsung Electric Company" },
+ { "VTL", "Vivid Technology Pte Ltd" },
+ { "UTD", "Up to Date Tech" },
+ { "ITC", "Intercom Inc" },
+ { "ENI", "Efficient Networks" },
+ { "GDC", "General Datacom" },
+ { "XIT", "Xitel Pty ltd" },
+ { "CMN", "Chimei Innolux Corporation" },
+ { "AVE", "Add Value Enterpises (Asia) Pte Ltd" },
+ { "WEC", "Winbond Electronics Corporation" },
+ { "OAK", "Oak Tech Inc" },
+ { "DON", "DENON, Ltd." },
+ { "ITR", "Infotronic America, Inc." },
+ { "CAC", "CA & F Elettronica" },
+ { "VIM", "Via Mons Ltd." },
+ { "DGP", "Digicorp European sales S.A." },
+ { "HPD", "Hewlett Packard" },
+ { "USD", "U.S. Digital Corporation" },
+ { "TAM", "Tamura Seisakusyo Ltd" },
+ { "SGZ", "Systec Computer GmbH" },
+ { "NGS", "A D S Exports" },
+ { "FSI", "Fore Systems Inc" },
+ { "SIL", "Silicon Laboratories, Inc" },
+ { "QCP", "Qualcomm Inc" },
+ { "SDA", "SAT (Societe Anonyme)" },
+ { "SEI", "Seitz & Associates Inc" },
+ { "RSI", "Rampage Systems Inc" },
+ { "VIZ", "VIZIO, Inc" },
+ { "EPN", "EPiCON Inc." },
+ { "OIC", "Option Industrial Computers" },
+ { "KDE", "KDE" },
+ { "CLV", "Clevo Company" },
+ { "GRA", "Graphica Computer" },
+ { "HIK", "Hikom Co., Ltd." },
+ { "LCE", "La Commande Electronique" },
+ { "MNP", "Microcom" },
+ { "ERI", "Ericsson Mobile Communications AB" },
+ { "REX", "RATOC Systems, Inc." },
+ { "PPP", "Purup Prepress AS" },
+ { "JAT", "Jaton Corporation" },
+ { "GLE", "AD electronics" },
+ { "VAL", "Valence Computing Corporation" },
+ { "CDN", "Codenoll Technical Corporation" },
+ { "SDT", "Siemens AG" },
+ { "RSC", "PhotoTelesis" },
+ { "FFI", "Fairfield Industries" },
+ { "VPR", "Best Buy" },
+ { "IPM", "IPM Industria Politecnica Meridionale SpA" },
+ { "HSM", "AT&T Microelectronics" },
+ { "YHQ", "Yokogawa Electric Corporation" },
+ { "UEC", "Ultima Electronics Corporation" },
+ { "NME", "Navico, Inc." },
+ { "GVL", "Global Village Communication" },
+ { "TEK", "Tektronix Inc" },
+ { "SBD", "Softbed - Consulting & Development Ltd" },
+ { "PSD", "Peus-Systems GmbH" },
+ { "DCA", "Digital Communications Association" },
+ { "HWC", "DBA Hans Wedemeyer" },
+ { "DFK", "SharkTec A/S" },
+ { "DMB", "Digicom Systems Inc" },
+ { "IPW", "IPWireless, Inc" },
+ { "ACC", "Accton Technology Corporation" },
+ { "CPM", "Capella Microsystems Inc." },
+ { "AAT", "Ann Arbor Technologies" },
+ { "LAS", "LASAT Comm. A/S" },
+ { "TWI", "Easytel oy" },
+ { "HJI", "Harris & Jeffries Inc" },
+ { "SGX", "Silicon Graphics Inc" },
+ { "TSL", "Tottori SANYO Electric Co., Ltd." },
+ { "SVD", "SVD Computer" },
+ { "CLT", "automated computer control systems" },
+ { "WLD", "Wildfire Communications Inc" },
+ { "LCI", "Lite-On Communication Inc" },
+ { "AEC", "Antex Electronics Corporation" },
+ { "ACA", "Ariel Corporation" },
+ { "KML", "Kensington Microware Ltd" },
+ { "KDT", "KDDI Technology Corporation" },
+ { "BSE", "Bose Corporation" },
+ { "WSP", "Wireless And Smart Products Inc." },
+ { "GNZ", "Gunze Ltd" },
+ { "PMM", "Point Multimedia System" },
+ { "ASC", "Ascom Strategic Technology Unit" },
+ { "EVX", "Everex" },
+ { "WBN", "MicroSoftWare" },
+ { "FGL", "Fujitsu General Limited." },
+ { "JSI", "Jupiter Systems, Inc." },
+ { "SII", "Silicon Image, Inc." },
+ { "SMM", "Shark Multimedia Inc" },
+ { "XYC", "Xycotec Computer GmbH" },
+ { "PEC", "POTRANS Electrical Corp." },
+ { "TSD", "TechniSat Digital GmbH" },
+ { "ZSE", "Zenith Data Systems" },
+ { "ENC", "Eizo Nanao Corporation" },
+ { "MWY", "Microway Inc" },
+ { "OLI", "Olivetti" },
+ { "WIL", "WIPRO Information Technology Ltd" },
+ { "LKM", "Likom Technology Sdn. Bhd." },
+ { "KOU", "KOUZIRO Co.,Ltd." },
+ { "VHI", "Macrocad Development Inc." },
+ { "FIT", "Feature Integration Technology Inc." },
+ { "MXP", "Maxpeed Corporation" },
+ { "SCD", "Sanyo Electric Company Ltd" },
+ { "NBL", "N*Able Technologies Inc" },
+ { "SPT", "Sceptre Tech Inc" },
+ { "IPN", "Performance Technologies" },
+ { "BMD", "Blackmagic Design" },
+ { "MDK", "Mediatek Corporation" },
+ { "DCS", "Diamond Computer Systems Inc" },
+ { "ICE", "IC Ensemble" },
+ { "LSY", "LSI Systems Inc" },
+ { "AMC", "Attachmate Corporation" },
+ { "TCO", "Thomas-Conrad Corporation" },
+ { "NOK", "Nokia Display Products" },
+ { "VFI", "VeriFone Inc" },
+ { "OPV", "Optivision Inc" },
+ { "LCM", "Latitude Comm." },
+ { "LSL", "Logical Solutions" },
+ { "TVO", "TV One Ltd" },
+ { "KVA", "Kvaser AB" },
+ { "PMT", "Promate Electronic Co., Ltd." },
+ { "ZZZ", "Boca Research Inc" },
+ { "ELC", "Electro Scientific Ind" },
+ { "SIR", "Sirius Technologies Pty Ltd" },
+ { "DCE", "dSPACE GmbH" },
+ { "WAN", "DO NOT USE - WAN" },
+ { "PCT", "PC-Tel Inc" },
+ { "BEO", "Baug & Olufsen" },
+ { "LUM", "Lumagen, Inc." },
+ { "DNA", "DNA Enterprises, Inc." },
+ { "WEY", "WEY Design AG" },
+ { "IAF", "Institut f r angewandte Funksystemtechnik GmbH" },
+ { "QFF", "Padix Co., Inc." },
+ { "JIC", "Jaeik Information & Communication Co., Ltd." },
+ { "VIT", "Visitech AS" },
+ { "QUA", "Quatographic AG" },
+ { "BNK", "Banksia Tech Pty Ltd" },
+ { "TME", "AT&T Microelectronics" },
+ { "DRB", "Dr. Bott KG" },
+ { "NET", "Mettler Toledo" },
+ { "CDE", "Colin.de" },
+ { "ATI", "Allied Telesis KK" },
+ { "PMD", "TDK USA Corporation" },
+ { "SKY", "SKYDATA S.P.A." },
+ { "FTN", "Fountain Technologies Inc" },
+ { "DBD", "Diebold Inc." },
+ { "ECA", "Electro Cam Corp." },
+ { "TLI", "TOSHIBA TELI CORPORATION" },
+ { "CTC", "CTC Communication Development Company Ltd" },
+ { "NVT", "Navatek Engineering Corporation" },
+ { "CKC", "The Concept Keyboard Company Ltd" },
+ { "FIR", "Chaplet Systems Inc" },
+ { "HYD", "Hydis Technologies.Co.,LTD" },
+ { "TTY", "TRIDELITY Display Solutions GmbH" },
+ { "DAE", "Digatron Industrie Elektronik GmbH" },
+ { "AUT", "Autotime Corporation" },
+ { "GTC", "Graphtec Corporation" },
+ { "MYR", "Myriad Solutions Ltd" },
+ { "DLT", "Digitelec Informatique Park Cadera" },
+ { "SDR", "SDR Systems" },
+ { "ACS", "Altos Computer Systems" },
+ { "SVC", "Intellix Corp." },
+ { "ZTE", "ZTE Corporation" },
+ { "ERT", "Escort Insturments Corporation" },
+ { "WII", "Innoware Inc" },
+ { "DOL", "Dolman Technologies Group Inc" },
+ { "RLD", "MEPCO" },
+ { "HRL", "Herolab GmbH" },
+ { "IRD", "IRdata" },
+ { "IVI", "Intervoice Inc" },
+ { "ICS", "Integrated Circuit Systems" },
+ { "ASE", "AseV Display Labs" },
+ { "SYX", "Prime Systems, Inc." },
+ { "SOI", "Silicon Optix Corporation" },
+ { "OCS", "Open Connect Solutions" },
+ { "HON", "Sonitronix" },
+ { "TAG", "Teles AG" },
+ { "PEP", "Peppercon AG" },
+ { "INT", "Interphase Corporation" },
+ { "IBR", "IBR GmbH" },
+ { "WYS", "Wyse Technology" },
+ { "TRE", "Tremetrics" },
+ { "RKC", "Reakin Technolohy Corporation" },
+ { "SEG", "DO NOT USE - SEG" },
+ { "CAV", "Cavium Networks, Inc" },
+ { "ELA", "ELAD srl" },
+ { "MMD", "Micromed Biotecnologia Ltd" },
+ { "SGL", "Super Gate Technology Company Ltd" },
+ { "SIS", "Silicon Integrated Systems Corporation" },
+ { "XFO", "EXFO Electro Optical Engineering" },
+ { "ING", "Integraph Corporation" },
+ { "NEU", "NEUROTEC - EMPRESA DE PESQUISA E DESENVOLVIMENTO EM BIOMEDICINA" },
+ { "ZIC", "Nationz Technologies Inc." },
+ { "CVI", "Colorado Video, Inc." },
+ { "VCC", "Virtual Computer Corporation" },
+ { "INZ", "Best Buy" },
+ { "ELO", "Tyco Electronics" },
+ { "EPH", "Epiphan Systems Inc." },
+ { "SYL", "Sylvania Computer Products" },
+ { "MXI", "Macronix Inc" },
+ { "GEH", "GE Intelligent Platforms - Huntsville" },
+ { "BBB", "an-najah university" },
+ { "ARK", "Ark Logic Inc" },
+ { "IVM", "Iiyama North America" },
+ { "XTE", "X2E GmbH" },
+ { "DMV", "NDS Ltd" },
+ { "CPD", "CompuAdd" },
+ { "CYD", "Cyclades Corporation" },
+ { "ALX", "ALEXON Co.,Ltd." },
+ { "COB", "COBY Electronics Co., Ltd" },
+ { "HCE", "Hitachi Consumer Electronics Co., Ltd" },
+ { "EXX", "Exxact GmbH" },
+ { "TAB", "Todos Data System AB" },
+ { "MPN", "Mainpine Limited" },
+ { "ATH", "Athena Informatica S.R.L." },
+ { "AWL", "Aironet Wireless Communications, Inc" },
+ { "FNI", "Funai Electric Co., Ltd." },
+ { "PLT", "PT Hartono Istana Teknologi" },
+ { "DEN", "Densitron Computers Ltd" },
+ { "MIM", "Mimio – A Newell Rubbermaid Company" },
+ { "GER", "GERMANEERS GmbH" },
+ { "CAI", "Canon Inc." },
+ { "DNI", "Deterministic Networks Inc." },
+ { "DOT", "Dotronic Mikroelektronik GmbH" },
+ { "MVX", "COM 1" },
+ { "WTC", "ACC Microelectronics" },
+ { "HIT", "Hitachi America Ltd" },
+ { "ALM", "Acutec Ltd." },
+ { "TIP", "TIPTEL AG" },
+ { "END", "ENIDAN Technologies Ltd" },
+ { "PAR", "Parallan Comp Inc" },
+ { "DVL", "Devolo AG" },
+ { "ADV", "Advanced Micro Devices Inc" },
+ { "TKS", "TimeKeeping Systems, Inc." },
+ { "MLD", "Deep Video Imaging Ltd" },
+ { "IUC", "ICSL" },
+ { "MNL", "Monorail Inc" },
+ { "HRC", "Hercules" },
+ { "ANS", "Ansel Communication Company" },
+ { "UAS", "Ultima Associates Pte Ltd" },
+ { "SBS", "SBS-or Industrial Computers GmbH" },
+ { "DVT", "Data Video" },
+ { "PTS", "Plain Tree Systems Inc" },
+ { "CSD", "Cresta Systems Inc" },
+ { "LDT", "LogiDataTech Electronic GmbH" },
+ { "AGM", "Advan Int'l Corporation" },
+ { "TLD", "Telindus" },
+ { "SPU", "SIM2 Multimedia S.P.A." },
+ { "BCS", "Booria CAD/CAM systems" },
+ { "CRQ", "Cirque Corporation" },
+ { "MIL", "Marconi Instruments Ltd" },
+ { "FTE", "Frontline Test Equipment Inc." },
+ { "RWC", "Red Wing Corporation" },
+ { "TLS", "Teleste Educational OY" },
+ { "DAT", "Datel Inc" },
+ { "SIT", "Sitintel" },
+ { "QTI", "Quicknet Technologies Inc" },
+ { "EBH", "Data Price Informatica" },
+ { "PCK", "PCBANK21" },
+ { "VSC", "ViewSonic Corporation" },
+ { "BBL", "Brain Boxes Limited" },
+ { "UFO", "UFO Systems Inc" },
+ { "NTI", "New Tech Int'l Company" },
+ { "WAV", "Wavephore" },
+ { "NOT", "Not Limited Inc" },
+ { "GRH", "Granch Ltd" },
+ { "VTC", "VTel Corporation" },
+ { "UNA", "Unisys DSD" },
+ { "LAB", "ACT Labs Ltd" },
+ { "UIC", "Uniform Industrial Corporation" },
+ { "IDK", "IDK Corporation" },
+ { "CHI", "Chrontel Inc" },
+ { "QCH", "Metronics Inc" },
+ { "CER", "Ceronix" },
+ { "PCB", "OCTAL S.A." },
+ { "VTV", "VATIV Technologies" },
+ { "BTI", "BusTech Inc" },
+ { "RVL", "Reveal Computer Prod" },
+ { "CHC", "Chic Technology Corp." },
+ { "QDS", "Quanta Display Inc." },
+ { "DAW", "DA2 Technologies Inc" },
+ { "MTR", "Mitron computer Inc" },
+ { "PCP", "Procomp USA Inc" },
+ { "AZM", "AZ Middelheim - Radiotherapy" },
+ { "NHT", "Vinci Labs" },
+ { "ROB", "Robust Electronics GmbH" },
+ { "RIC", "RICOH COMPANY, LTD." },
+ { "PCI", "Pioneer Computer Inc" },
+ { "EKA", "MagTek Inc." },
+ { "SWL", "Sharedware Ltd" },
+ { "GSM", "Goldstar Company Ltd" },
+ { "IDP", "Integrated Device Technology, Inc." },
+ { "BPD", "Micro Solutions, Inc." },
+ { "UNS", "Unisys Corporation" },
+ { "PBN", "Packard Bell NEC" },
+ { "KRM", "Kroma Telecom" },
+ { "ENT", "Enterprise Comm. & Computing Inc" },
+ { "ATL", "Arcus Technology Ltd" },
+ { "VDT", "Viditec, Inc." },
+ { "JUK", "Janich & Klass Computertechnik GmbH" },
+ { "PVG", "Proview Global Co., Ltd" },
+ { "INX", "Communications Supply Corporation (A division of WESCO)" },
+ { "GDS", "GDS" },
+ { "UHB", "XOCECO" },
+ { "MEI", "Panasonic Industry Company" },
+ { "OXU", "Oxus Research S.A." },
+ { "SGO", "Logos Design A/S" },
+ { "STU", "Sentelic Corporation" },
+ { "PUL", "Pulse-Eight Ltd" },
+ { "BRA", "Braemac Pty Ltd" },
+ { "MBD", "Microbus PLC" },
+ { "OAS", "Oasys Technology Company" },
+ { "MDS", "Micro Display Systems Inc" },
+ { "SCS", "Nanomach Anstalt" },
+ { "DAS", "DAVIS AS" },
+ { "NLC", "Next Level Communications" },
+ { "MSU", "motorola" },
+ { "MAD", "Xedia Corporation" },
+ { "LOE", "Loewe Opta GmbH" },
+ { "EEE", "ET&T Technology Company Ltd" },
+ { "ANX", "Acer Netxus Inc" },
+ { "IEE", "IEE" },
+ { "ALL", "Alliance Semiconductor Corporation" },
+ { "DCT", "Dancall Telecom A/S" },
+ { "AII", "Amptron International Inc." },
+ { "DPT", "DPT" },
+ { "TNJ", "DO NOT USE - TNJ" },
+ { "FTC", "Futuretouch Corporation" },
+ { "ESG", "ELCON Systemtechnik GmbH" },
+ { "SYV", "SYVAX Inc" },
+ { "RAC", "Racore Computer Products Inc" },
+ { "IBM", "IBM France" },
+ { "LTV", "Leitch Technology International Inc." },
+ { "AKE", "AKAMI Electric Co.,Ltd" },
+ { "VDO", "Video & Display Oriented Corporation" },
+ { "MEN", "MEN Mikroelectronik Nueruberg GmbH" },
+ { "UNT", "Unisys Corporation" },
+ { "TTK", "Totoku Electric Company Ltd" },
+ { "DII", "Dataq Instruments Inc" },
+ { "AMO", "Amino Technologies PLC and Amino Communications Limited" },
+ { "IMC", "IMC Networks" },
+ { "STG", "StereoGraphics Corp." },
+ { "RRI", "Radicom Research Inc" },
+ { "HTI", "Hampshire Company, Inc." },
+ { "SOR", "Sorcus Computer GmbH" },
+ { "AXL", "Axel" },
+ { "SNS", "Cirtech (UK) Ltd" },
+ { "IPD", "Industrial Products Design, Inc." },
+ { "FMI", "Fujitsu Microelect Inc" },
+ { "FMA", "Fast Multimedia AG" },
+ { "MIT", "MCM Industrial Technology GmbH" },
+ { "RII", "Racal Interlan Inc" },
+ { "PDN", "AT&T Paradyne" },
+ { "TRU", "Aashima Technology B.V." },
+ { "BEI", "Beckworth Enterprises Inc" },
+ { "RSS", "Rockwell Semiconductor Systems" },
+ { "SHR", "Digital Discovery" },
+ { "CDT", "IBM Corporation" },
+ { "TKC", "Taiko Electric Works.LTD" },
+ { "ITM", "ITM inc." },
+ { "QUE", "Questra Consulting" },
+ { "CMR", "Cambridge Research Systems Ltd" },
+ { "LCC", "LCI" },
+ { "MDO", "Panasonic" },
+ { "IEC", "Interlace Engineering Corporation" },
+ { "DPL", "Digital Projection Limited" },
+ { "INV", "Inviso, Inc." },
+ { "JSD", "JS DigiTech, Inc" },
+ { "TOE", "TOEI Electronics Co., Ltd." },
+ { "HAY", "Hayes Microcomputer Products Inc" },
+ { "SSJ", "Sankyo Seiki Mfg.co., Ltd" },
+ { "NNC", "NNC" },
+ { "PHE", "Philips Medical Systems Boeblingen GmbH" },
+ { "MWI", "Multiwave Innovation Pte Ltd" },
+ { "WYT", "Wooyoung Image & Information Co.,Ltd." },
+ { "AIM", "AIMS Lab Inc" },
+ { "CSS", "CSS Laboratories" },
+ { "TRS", "Torus Systems Ltd" },
+ { "ROK", "Rockwell International" },
+ { "SXD", "Silex technology, Inc." },
+ { "PHS", "Philips Communication Systems" },
+ { "CLM", "CrystaLake Multimedia" },
+ { "ALO", "Algolith Inc." },
+ { "SIU", "Seiko Instruments USA Inc" },
+ { "TUA", "T+A elektroakustik GmbH" },
+ { "CTE", "Chunghwa Telecom Co., Ltd." },
+ { "SDD", "Intrada-SDD Ltd" },
+ { "RMT", "Roper Mobile" },
+ { "SSP", "Spectrum Signal Proecessing Inc" },
+ { "VTN", "VIDEOTRON CORP." },
+ { "VAD", "Vaddio, LLC" },
+ { "SFT", "Mikroforum Ring 3" },
+ { "DGK", "DugoTech Co., LTD" },
+ { "ACH", "Archtek Telecom Corporation" },
+ { "ABT", "Anchor Bay Technologies, Inc." },
+ { "STC", "STAC Electronics" },
+ { "DRS", "DRS Defense Solutions, LLC" },
+ { "OQI", "Oksori Company Ltd" },
+ { "IMT", "Inmax Technology Corporation" },
+ { "ENE", "ENE Technology Inc." },
+ { "WBS", "WB Systemtechnik GmbH" },
+ { "PRC", "PerComm" },
+ { "PSC", "Philips Semiconductors" },
+ { "RJS", "Advanced Engineering" },
+ { "STS", "SITECSYSTEM CO., LTD." },
+ { "LAV", "Lava Computer MFG Inc" },
+ { "RCH", "Reach Technology Inc" },
+ { "DWE", "Daewoo Electronics Company Ltd" },
+ { "KTC", "Kingston Tech Corporation" },
+ { "GLS", "Gadget Labs LLC" },
+ { "COS", "CoStar Corporation" },
+ { "SBI", "SMART Technologies Inc." },
+ { "ATP", "Alpha-Top Corporation" },
+ { "DQB", "Datacube Inc" },
+ { "INN", "Innovent Systems, Inc." },
+ { "DNT", "Dr. Neuhous Telekommunikation GmbH" },
+ { "KFX", "Kofax Image Products" },
+ { "APE", "Alpine Electronics, Inc." },
+ { "DSM", "DSM Digital Services GmbH" },
+ { "RES", "ResMed Pty Ltd" },
+ { "HMX", "HUMAX Co., Ltd." },
+ { "PCW", "Pacific CommWare Inc" },
+ { "KYC", "Kyocera Corporation" },
+ { "VSN", "Ingram Macrotron" },
+ { "SNT", "SuperNet Inc" },
+ { "TEL", "Promotion and Display Technology Ltd." },
+ { "IFX", "Infineon Technologies AG" },
+ { "PVC", "DO NOT USE - PVC" },
+ { "JKC", "JVC KENWOOD Corporation" },
+ { "MSV", "Mosgi Corporation" },
+ { "BUR", "Bernecker & Rainer Ind-Eletronik GmbH" },
+ { "PTA", "PAR Tech Inc." },
+ { "GGL", "Google Inc." },
+ { "COM", "Comtrol Corporation" },
+ { "JEN", "N-Vision" },
+ { "AMP", "AMP Inc" },
+ { "HDI", "HD-INFO d.o.o." },
+ { "BOE", "BOE" },
+ { "ICM", "Intracom SA" },
+ { "ADD", "Advanced Peripheral Devices Inc" },
+ { "PRI", "Priva Hortimation BV" },
+ { "ANL", "Analogix Semiconductor, Inc" },
+ { "AVO", "Avocent Corporation" },
+ { "LEG", "Legerity, Inc" },
+ { "DTE", "Dimension Technologies, Inc." },
+ { "WPA", "Matsushita Communication Industrial Co., Ltd." },
+ { "OLV", "Olitec S.A." },
+ { "RNB", "Rainbow Technologies" },
+ { "LVI", "LVI Low Vision International AB" },
+ { "LOC", "Locamation B.V." },
+ { "TGC", "Toshiba Global Commerce Solutions, Inc." },
+ { "STI", "Smart Tech Inc" },
+ { "TLF", "Teleforce.,co,ltd" },
+ { "PLC", "Pro-Log Corporation" },
+ { "HSD", "HannStar Display Corp" },
+ { "ONE", "Oneac Corporation" },
+ { "CLE", "Classe Audio" },
+ { "MCI", "Micronics Computers" },
+ { "VTG", "Voice Technologies Group Inc" },
+ { "VTI", "VLSI Tech Inc" },
+ { "DAI", "DAIS SET Ltd." },
+ { "UNM", "Unisys Corporation" },
+ { "MCQ", "Mat's Computers" },
+ { "IPC", "IPC Corporation" },
+ { "ADE", "Arithmos, Inc." },
+ { "PON", "Perpetual Technologies, LLC" },
+ { "EXA", "Exabyte" },
+ { "CHD", "ChangHong Electric Co.,Ltd" },
+ { "FDT", "Fujitsu Display Technologies Corp." },
+ { "DBL", "Doble Engineering Company" },
+ { "CTP", "Computer Technology Corporation" },
+ { "CLD", "COMMAT L.t.d." },
+ { "BLI", "Busicom" },
+ { "FRS", "South Mountain Technologies, LTD" },
+ { "CDD", "Convergent Data Devices" },
+ { "SHT", "Shin Ho Tech" },
+ { "EPC", "Empac" },
+ { "RDS", "Radius Inc" },
+ { "NEX", "Nexgen Mediatech Inc.," },
+ { "AGC", "Beijing Aerospace Golden Card Electronic Engineering Co.,Ltd." },
+ { "MCP", "Magni Systems Inc" },
+ { "WMO", "Westermo Teleindustri AB" },
+ { "NMX", "Neomagic" },
+ { "BDS", "Barco Display Systems" },
+ { "RIV", "Rivulet Communications" },
+ { "TRA", "TriTech Microelectronics International" },
+ { "CYX", "Cyrix Corporation" },
+ { "TCM", "3Com Corporation" },
+ { "ZYP", "Zypcom Inc" },
+ { "VIB", "Tatung UK Ltd" },
+ { "IEI", "Interlink Electronics" },
+ { "BGB", "Barco Graphics N.V" },
+ { "ISP", "IntreSource Systems Pte Ltd" },
+ { "BGT", "Budzetron Inc" },
+ { "DPS", "Digital Processing Systems" },
+ { "SSS", "S3 Inc" },
+ { "AXB", "Adrienne Electronics Corporation" },
+ { "HKA", "HONKO MFG. CO., LTD." },
+ { "TPK", "TOPRE CORPORATION" },
+ { "NPI", "Network Peripherals Inc" },
+ { "LMP", "Leda Media Products" },
+ { "MAI", "Mutoh America Inc" },
+ { "ATX", "Athenix Corporation" },
+ { "MVM", "SOBO VISION" },
+ { "ALI", "Acer Labs" },
+ { "HPR", "H.P.R. Electronics GmbH" },
+ { "BIL", "Billion Electric Company Ltd" },
+ { "CRO", "Extraordinary Technologies PTY Limited" },
+ { "KTG", "Kayser-Threde GmbH" },
+ { "SCI", "System Craft" },
+ { "MVD", "Microvitec PLC" },
+ { "IST", "Intersolve Technologies" },
+ { "ICD", "ICD Inc" },
+ { "PDS", "PD Systems International Ltd" },
+ { "CPQ", "Compaq Computer Company" },
+ { "QCL", "Quadrant Components Inc" },
+ { "PRA", "PRO/AUTOMATION" },
+ { "MAC", "MAC System Company Ltd" },
+ { "TOP", "Orion Communications Co., Ltd." },
+ { "AGT", "Agilent Technologies" },
+ { "SWI", "Sierra Wireless Inc." },
+ { "ATT", "AT&T" },
+ { "MCL", "Motorola Communications Israel" },
+ { "NCS", "Northgate Computer Systems" },
+ { "RSX", "Rapid Tech Corporation" },
+ { "ATV", "Office Depot, Inc." },
+ { "MRD", "MicroDisplay Corporation" },
+ { "SCH", "Schlumberger Cards" },
+ { "ONW", "OPEN Networks Ltd" },
+ { "DTC", "DTC Tech Corporation" },
+ { "HYV", "Hynix Semiconductor" },
+ { "WEL", "W-DEV" },
+ { "AND", "Adtran Inc" },
+ { "AMN", "Amimon LTD." },
+ { "PXL", "The Moving Pixel Company" },
+ { "ZCT", "ZeitControl cardsystems GmbH" },
+ { "ALH", "AL Systems" },
+ { "VCJ", "Victor Company of Japan, Limited" },
+ { "COD", "CODAN Pty. Ltd." },
+ { "TMM", "Time Management, Inc." },
+ { "PPR", "PicPro" },
+ { "INL", "InnoLux Display Corporation" },
+ { "LTC", "Labtec Inc" },
+ { "PNP", "Microsoft" },
+ { "FIL", "Forefront Int'l Ltd" },
+ { "OSR", "Oksori Company Ltd" },
+ { "PEI", "PEI Electronics Inc" },
+ { "EZP", "Storm Technology" },
+ { "TCE", "Century Corporation" },
+ { "KAR", "Karna" },
+ { "ALS", "Texas Advanced optoelectronics Solutions, Inc" },
+ { "COI", "Codec Inc." },
+ { "NRT", "Beijing Northern Radiantelecom Co." },
+ { "FTR", "Mediasonic" },
+ { "SUN", "Sun Electronics Corporation" },
+ { "OZO", "Tribe Computer Works Inc" },
+ { "MCO", "Motion Computing Inc." },
+ { "UBI", "Ungermann-Bass Inc" },
+ { "ZNI", "Zetinet Inc" },
+ { "FUN", "sisel muhendislik" },
+ { "RMP", "Research Machines" },
+ { "DGT", "The Dearborn Group" },
+ { "SPX", "Simplex Time Recorder Co." },
+ { "COR", "Corollary Inc" },
+ { "AMX", "AMX LLC" },
+ { "AKY", "Askey Computer Corporation" },
+ { "RAR", "Raritan, Inc." },
+ { "VDS", "Vidisys GmbH & Company" },
+ { "SCL", "Sigmacom Co., Ltd." },
+ { "KSL", "Karn Solutions Ltd." },
+ { "ACK", "Acksys" },
+ { "NWS", "Newisys, Inc." },
+ { "TRX", "Trex Enterprises" },
+ { "BOI", "NINGBO BOIGLE DIGITAL TECHNOLOGY CO.,LTD" },
+ { "NTT", "NTT Advanced Technology Corporation" },
+ { "GUZ", "Guzik Technical Enterprises" },
+ { "MDY", "Microdyne Inc" },
+ { "EDM", "EDMI" },
+ { "DTI", "Diversified Technology, Inc." },
+ { "MMI", "Multimax" },
+ { "SCB", "SeeCubic B.V." },
+ { "UPS", "Systems Enhancement" },
+ { "AKB", "Akebia Ltd" },
+ { "NBT", "NingBo Bestwinning Technology CO., Ltd" },
+ { "TCD", "Taicom Data Systems Co., Ltd." },
+ { "XMM", "C3PO S.L." },
+ { "OIM", "Option International" },
+ { "DAV", "Davicom Semiconductor Inc" },
+ { "CKJ", "Carina System Co., Ltd." },
+ { "ATD", "Alpha Telecom Inc" },
+ { "XQU", "SHANGHAI SVA-DAV ELECTRONICS CO., LTD" },
+ { "KOL", "Kollmorgen Motion Technologies Group" },
+ { "HWA", "Harris Canada Inc" },
+ { "INE", "Inventec Electronics (M) Sdn. Bhd." },
+ { "ORN", "ORION ELECTRIC CO., LTD." },
+ { "KES", "Kesa Corporation" },
+ { "CRC", "CONRAC GmbH" },
+ { "AXT", "Axtend Technologies Inc" },
+ { "NAX", "Naxos Tecnologia" },
+ { "DAN", "Danelec Marine A/S" },
+ { "ADP", "Adaptec Inc" },
+ { "ICA", "ICA Inc" },
+ { "AGL", "Argolis" },
+ { "ECC", "ESSential Comm. Corporation" },
+ { "AWS", "Wave Systems" },
+ { "APN", "Appian Tech Inc" },
+ { "DGI", "DIGI International" },
+ { "MCS", "Micro Computer Systems" },
+ { "ITA", "Itausa Export North America" },
+ { "CII", "Cromack Industries Inc" },
+ { "IPS", "IPS, Inc. (Intellectual Property Solutions, Inc.)" },
+ { "KOE", "KOLTER ELECTRONIC" },
+ { "MEP", "Meld Technology" },
+ { "IMA", "Imagraph" },
+ { "DDV", "Delta Information Systems, Inc" },
+ { "GML", "General Information Systems" },
+ { "SSC", "Sierra Semiconductor Inc" },
+ { "WNX", "Wincor Nixdorf International GmbH" },
+ { "ABD", "Allen Bradley Company" },
+ { "CMS", "CompuMaster Srl" },
+ { "INK", "Indtek Co., Ltd." },
+ { "DTT", "Design & Test Technology, Inc." },
+ { "MGA", "Mega System Technologies, Inc." },
+ { "SMO", "STMicroelectronics" },
+ { "SSI", "S-S Technology Inc" },
+ { "CIR", "Cirrus Logic Inc" },
+ { "EKC", "Eastman Kodak Company" },
+ { "LNR", "Linear Systems Ltd." },
+ { "VCM", "Vector Magnetics, LLC" },
+ { "HKG", "Josef Heim KG" },
+ { "ORG", "ORGA Kartensysteme GmbH" },
+ { "ELG", "Elmeg GmbH Kommunikationstechnik" },
+ { "NSI", "NISSEI ELECTRIC CO.,LTD" },
+ { "RDM", "Tremon Enterprises Company Ltd" },
+ { "HAI", "Haivision Systems Inc." },
+ { "CIC", "Comm. Intelligence Corporation" },
+ { "LTS", "LTS Scale LLC" },
+ { "SAS", "Stores Automated Systems Inc" },
+ { "OEC", "ORION ELECTRIC CO.,LTD" },
+ { "BRG", "Bridge Information Co., Ltd" },
+ { "SQT", "Sequent Computer Systems Inc" },
+ { "CCI", "Cache" },
+ { "PRX", "Proxima Corporation" },
+ { "ADR", "Nasa Ames Research Center" },
+ { "SNW", "Snell & Wilcox" },
+ { "CDI", "Concept Development Inc" },
+ { "SEA", "Seanix Technology Inc." },
+ { "STY", "SDS Technologies" },
+ { "PCA", "Philips BU Add On Card" },
+ { "NYC", "nakayo telecommunications,inc." },
+ { "JMT", "Micro Technical Company Ltd" },
+ { "MTD", "MindTech Display Co. Ltd" },
+ { "NSP", "Nspire System Inc." },
+ { "DSD", "DS Multimedia Pte Ltd" },
+ { "PBI", "Pitney Bowes" },
+ { "ARO", "Poso International B.V." },
+ { "TTE", "TTE, Inc." },
+ { "DDA", "DA2 Technologies Corporation" },
+ { "MAS", "Mass Inc." },
+ { "LAC", "LaCie" },
+ { "CRX", "Cyrix Corporation" },
+ { "EMO", "ELMO COMPANY, LIMITED" },
+ { "OSP", "OPTI-UPS Corporation" },
+ { "GED", "General Dynamics C4 Systems" },
+ { "PPI", "Practical Peripherals" },
+ { "VPI", "Video Products Inc" },
+ { "TOS", "Toshiba Corporation" },
+ { "ASL", "AccuScene Corporation Ltd" },
+ { "ANT", "Ace CAD Enterprise Company Ltd" },
+ { "GRV", "Advanced Gravis" },
+ { "ANO", "Anorad Corporation" },
+ { "LNK", "Link Tech Inc" },
+ { "DIG", "Digicom S.p.A." },
+ { "ALC", "Altec Corporation" },
+ { "IAI", "Integration Associates, Inc." },
+ { "APG", "Horner Electric Inc" },
+ { "TWK", "TOWITOKO electronics GmbH" },
+ { "BRI", "Boca Research Inc" },
+ { "SVS", "SVSI" },
+ { "QCI", "Quanta Computer Inc" },
+ { "MDD", "MODIS" },
+ { "PDT", "PDTS - Prozessdatentechnik und Systeme" },
+ { "IMP", "Impression Products Incorporated" },
+ { "EXI", "Exide Electronics" },
+ { "WNV", "Winnov L.P." },
+ { "ALG", "Realtek Semiconductor Corp." },
+ { "ESA", "Elbit Systems of America" },
+ { "OLC", "Olicom A/S" },
+ { "DPX", "DpiX, Inc." },
+ { "GSB", "NIPPONDENCHI CO,.LTD" },
+ { "MCA", "American Nuclear Systems Inc" },
+ { "EST", "Embedded Solution Technology" },
+ { "ADX", "Adax Inc" },
+ { "MSA", "Micro Systemation AB" },
+ { "HDV", "Holografika kft." },
+ { "GIP", "GI Provision Ltd" },
+ { "XTN", "X-10 (USA) Inc" },
+ { "VEC", "Vector Informatik GmbH" },
+ { "DTN", "Datang Telephone Co" },
+ { "CST", "CSTI Inc" },
+ { "ECO", "Echo Speech Corporation" },
+ { "TDD", "Tandberg Data Display AS" },
+ { "NVL", "Novell Inc" },
+ { "CHT", "Chunghwa Picture Tubes,LTD." },
+ { "SCP", "Scriptel Corporation" },
+ { "TMS", "Trident Microsystems Ltd" },
+ { "ABO", "D-Link Systems Inc" },
+ { "JTY", "jetway security micro,inc" },
+ { "LSD", "Intersil Corporation" },
+ { "SEP", "SEP Eletronica Ltda." },
+ { "SHI", "Jiangsu Shinco Electronic Group Co., Ltd" },
+ { "FTG", "FTG Data Systems" },
+ { "ESN", "eSATURNUS" },
+ { "DJE", "Capstone Visual Product Development" },
+ { "BEC", "Elektro Beckhoff GmbH" },
+ { "FVC", "First Virtual Corporation" },
+ { "JUP", "Jupiter Systems" },
+ { "XNT", "XN Technologies, Inc." },
+ { "RTK", "DO NOT USE - RTK" },
+ { "ACL", "Apricot Computers" },
+ { "TAA", "Tandberg" },
+ { "WIP", "Wipro Infotech" },
+ { "KRL", "Krell Industries Inc." },
+ { "INO", "Innolab Pte Ltd" },
+ { "ELT", "Element Labs, Inc." },
+ { "KTE", "K-Tech" },
+ { "CVA", "Covia Inc." },
+ { "SIC", "Sysmate Corporation" },
+ { "STH", "Semtech Corporation" },
+ { "ACD", "AWETA BV" },
+ { "EHN", "Enhansoft" },
+ { "VMI", "Vermont Microsystems" },
+ { "TTC", "Telecommunications Techniques Corporation" },
+ { "KYE", "KYE Syst Corporation" },
+ { "QDI", "Quantum Data Incorporated" },
+ { "ELL", "Electrosonic Ltd" },
+ { "FLE", "ADTI Media, Inc" },
+ { "KTD", "Takahata Electronics Co.,Ltd." },
+ { "MAL", "Meridian Audio Ltd" },
+ { "TRV", "Trivisio Prototyping GmbH" },
+ { "TWH", "Twinhead International Corporation" },
+ { "SYP", "SYPRO Co Ltd" },
+ { "GCC", "GCC Technologies Inc" },
+ { "POR", "Portalis LC" },
+ { "PIM", "Prism, LLC" },
+ { "MLX", "Mylex Corporation" },
+ { "ONL", "OnLive, Inc" },
+ { "NIS", "Nissei Electric Company" },
+ { "ISM", "Image Stream Medical" },
+ { "EPS", "KEPS" },
+ { "PAC", "Pacific Avionics Corporation" },
+ { "AXC", "AXIOMTEK CO., LTD." },
+ { "DYX", "Dynax Electronics (HK) Ltd" },
+ { "WEB", "WebGear Inc" },
+ { "RIT", "Ritech Inc" },
+ { "INI", "Initio Corporation" },
+ { "LBO", "Lubosoft" },
+ { "PGM", "Paradigm Advanced Research Centre" },
+ { "OSA", "OSAKA Micro Computer, Inc." },
+ { "SIN", "Singular Technology Co., Ltd." },
+ { "CIN", "Citron GmbH" },
+ { "OTB", "outsidetheboxstuff.com" },
+ { "ARL", "Arlotto Comnet Inc" },
+ { "HOB", "HOB Electronic GmbH" },
+ { "QQQ", "Chuomusen Co., Ltd." },
+ { "AXE", "D-Link Systems Inc" },
+ { "CCC", "C-Cube Microsystems" },
+ { "CPT", "cPATH" },
+ { "SEM", "Samsung Electronics Company Ltd" },
+ { "PVI", "Prime view international Co., Ltd" },
+ { "TAT", "Teleliaison Inc" },
+ { "SON", "Sony" },
+ { "ITT", "I&T Telecom." },
+ { "SLM", "Solomon Technology Corporation" },
+ { "MAN", "LGIC" },
+ { "AIX", "ALTINEX, INC." },
+ { "ASP", "ASP Microelectronics Ltd" },
+ { "VUT", "Vutrix (UK) Ltd" },
+ { "MTE", "MediaTec GmbH" },
+ { "UPP", "UPPI" },
+ { "DCM", "DCM Data Products" },
+ { "DYC", "Dycam Inc" },
+ { "DAK", "Daktronics" },
+ { "JAZ", "Carrera Computer Inc" },
+ { "FOX", "HON HAI PRECISON IND.CO.,LTD." },
+ { "UEI", "Universal Electronics Inc" },
+ { "OPI", "D.N.S. Corporation" },
+ { "CXT", "Conexant Systems" },
+ { "VTK", "Viewteck Co., Ltd." },
+ { "AVL", "Avalue Technology Inc." },
+ { "TSI", "TeleVideo Systems" },
+ { "PAN", "The Panda Project" },
+ { "CED", "Cambridge Electronic Design Ltd" },
+ { "RUP", "Ups Manufactoring s.r.l." },
+ { "MIP", "micronpc.com" },
+ { "REM", "SCI Systems Inc." },
+ { "NSS", "Newport Systems Solutions" },
+ { "FBI", "Interface Corporation" },
+ { "FER", "Ferranti Int'L" },
+ { "DLG", "Digital-Logic GmbH" },
+ { "TSY", "TouchSystems" },
+ { "PIO", "Pioneer Electronic Corporation" },
+ { "PNG", "P.I. Engineering Inc" },
+ { "OIN", "Option International" },
+ { "RED", "Research Electronics Development Inc" },
+ { "NOI", "North Invent A/S" },
+ { "MAY", "Maynard Electronics" },
+ { "BTO", "BioTao Ltd" },
+ { "ZYD", "Zydacron Inc" },
+ { "KCD", "Chunichi Denshi Co.,LTD." },
+ { "TTI", "Trenton Terminals Inc" },
+ { "TRD", "Trident Microsystem Inc" },
+ { "TDP", "3D Perception" },
+ { "TER", "TerraTec Electronic GmbH" },
+ { "AEM", "ASEM S.p.A." },
+ { "IBI", "INBINE.CO.LTD" },
+ { "ECK", "Eugene Chukhlomin Sole Proprietorship, d.b.a." },
+ { "AVT", "Avtek (Electronics) Pty Ltd" },
+ { "PST", "Global Data SA" },
+ { "FPS", "Deltec Corporation" },
+ { "SHP", "Sharp Corporation" },
+ { "RDN", "RADIODATA GmbH" },
+ { "TRC", "Trioc AB" },
+ { "ABE", "Alcatel Bell" },
+ { "VCX", "VCONEX" },
+ { "PBL", "Packard Bell Electronics" },
+ { "TLK", "Telelink AG" },
+ { "DMM", "Dimond Multimedia Systems Inc" },
+ { "IGM", "IGM Communi" },
+ { "KFC", "SCD Tech" },
+ { "GUD", "Guntermann & Drunck GmbH" },
+ { "MDA", "Media4 Inc" },
+ { "VWB", "Vweb Corp." },
+ { "ISG", "Insignia Solutions Inc" },
+ { "AMS", "ARMSTEL, Inc." },
+ { "NTL", "National Transcomm. Ltd" },
+ { "LSJ", "LSI Japan Company Ltd" },
+ { "NDL", "Network Designers" },
+ { "DIA", "Diadem" },
+ { "SDX", "SDX Business Systems Ltd" },
+ { "LPL", "LG Philips" },
+ { "CAG", "CalComp" },
+ { "FZC", "Founder Group Shenzhen Co." },
+ { "PCX", "PC Xperten" },
+ { "TSF", "Racal-Airtech Software Forge Ltd" },
+ { "RGL", "Robertson Geologging Ltd" },
+ { "MSD", "Datenerfassungs- und Informationssysteme" },
+ { "NVC", "NetVision Corporation" },
+ { "SKD", "Schneider & Koch" },
+ { "CRS", "Crescendo Communication Inc" },
+ { "AXI", "American Magnetics" },
+ { "HRS", "Harris Semiconductor" },
+ { "AEN", "Avencall" },
+ { "TCL", "Technical Concepts Ltd" },
+ { "SST", "SystemSoft Corporation" },
+ { "OMN", "Omnitel" },
+ { "GCI", "Gateway Comm. Inc" },
+ { "SEN", "Sencore" },
+ { "MDT", "Magus Data Tech" },
+ { "ALN", "Alana Technologies" },
+ { "AVD", "Avid Electronics Corporation" },
+ { "DOM", "Dome Imaging Systems" },
+ { "KBL", "Kobil Systems GmbH" },
+ { "ITS", "IDTECH" },
+ { "CGS", "Chyron Corp" },
+ { "CYV", "Cyviz AS" },
+ { "CSO", "California Institute of Technology" },
+ { "ADT", "Aved Display Technologies" },
+ { "ACP", "Aspen Tech Inc" },
+ { "AKI", "AKIA Corporation" },
+ { "LCT", "Labcal Technologies" },
+ { "NDS", "Nokia Data" },
+ { "WCS", "Woodwind Communications Systems Inc" },
+ { "XFG", "Jan Strapko - FOTO" },
+ { "CPI", "Computer Peripherals Inc" },
+ { "FCG", "First International Computer Ltd" },
+ { "EVE", "Advanced Micro Peripherals Ltd" },
+ { "ATO", "ASTRO DESIGN, INC." },
+ { "SGW", "Shanghai Guowei Science and Technology Co., Ltd." },
+ { "CNB", "American Power Conversion" },
+ { "TCX", "FREEMARS Heavy Industries" },
+ { "ITN", "The NTI Group" },
+ { "HWD", "Highwater Designs Ltd" },
+ { "NUG", "NU Technology, Inc." },
+ { "ISL", "Isolation Systems" },
+ { "CIL", "Citicom Infotech Private Limited" },
+ { "IOT", "I/OTech Inc" },
+ { "GET", "Getac Technology Corporation" },
+ { "ULT", "Ultra Network Tech" },
+ { "TVV", "TV1 GmbH" },
+ { "OWL", "Mediacom Technologies Pte Ltd" },
+ { "TMX", "Thermotrex Corporation" },
+ { "ARC", "Alta Research Corporation" },
+ { "SEL", "Way2Call Communications" },
+ { "ELS", "ELSA GmbH" },
+ { "STD", "STD Computer Inc" },
+ { "GST", "Graphic SystemTechnology" },
+ { "SME", "Sysmate Company" },
+ { "ARS", "Arescom Inc" },
+ { "SCN", "Scanport, Inc." },
+ { "CTX", "Creatix Polymedia GmbH" },
+ { "DIM", "dPict Imaging, Inc." },
+ { "MDI", "Micro Design Inc" },
+ { "SCM", "SCM Microsystems Inc" },
+ { "CEA", "Consumer Electronics Association" },
+ { "OTI", "Orchid Technology" },
+ { "ADK", "Adtek System Science Company Ltd" },
+ { "ETC", "Everton Technology Company Ltd" },
+ { "PCO", "Performance Concepts Inc.," },
+ { "DMC", "Dune Microsystems Corporation" },
+ { "SGM", "SAGEM" },
+ { "OBS", "Optibase Technologies" },
+ { "PMX", "Photomatrix" },
+ { "SDI", "Samtron Displays Inc" },
+ { "GMM", "GMM Research Inc" },
+ { "DUN", "NCR Corporation" },
+ { "CAL", "Acon" },
+ { "MIR", "Miro Computer Prod." },
+ { "PEN", "Interactive Computer Products Inc" },
+ { "CRL", "Creative Logic" },
+ { "SBT", "Senseboard Technologies AB" },
+ { "AST", "AST Research Inc" },
+ { "INS", "Ines GmbH" },
+ { "SGC", "Spectragraphics Corporation" },
+ { "DBI", "DigiBoard Inc" },
+ { "LEO", "First International Computer Inc" },
+ { "TSP", "U.S. Navy" },
+ { "MTK", "Microtek International Inc." },
+ { "TCN", "Tecnetics (PTY) Ltd" },
+ { "DPM", "ADPM Synthesis sas" },
+ { "LGS", "LG Semicom Company Ltd" },
+ { "LGI", "Logitech Inc" },
+ { "PBV", "Pitney Bowes" },
+ { "ELI", "Edsun Laboratories" },
+ { "HPQ", "HP" },
+ { "RPT", "R.P.T.Intergroups" },
+ { "BDO", "Brahler ICS" },
+ { "ARM", "Arima" },
+ { "JTS", "JS Motorsports" },
+ { "TNY", "Tennyson Tech Pty Ltd" },
+ { "UDN", "Uniden Corporation" },
+ { "KNC", "Konica corporation" },
+ { "GND", "Gennum Corporation" },
+ { "MSG", "MSI GmbH" },
+ { "REH", "Rehan Electronics Ltd." },
+ { "COL", "Rockwell Collins, Inc." },
+ { "MDC", "Midori Electronics" },
+ { "TRN", "Datacommunicatie Tron B.V." },
+ { "VDA", "Victor Data Systems" },
+ { "TOU", "Touchstone Technology" },
+ { "ETD", "ELAN MICROELECTRONICS CORPORATION" },
+ { "CYB", "CyberVision" },
+ { "SWC", "Software Café" },
+ { "EXN", "RGB Systems, Inc. dba Extron Electronics" },
+ { "HSP", "HannStar Display Corp" },
+ { "WTK", "Wearnes Thakral Pte" },
+ { "GFM", "GFMesstechnik GmbH" },
+ { "INC", "Home Row Inc" },
+ { "LEC", "Lectron Company Ltd" },
+ { "WTS", "Restek Electric Company Ltd" },
+ { "ACE", "Actek Engineering Pty Ltd" },
+ { "MSH", "Microsoft" },
+ { "CHL", "Chloride-R&D" },
+ { "ALT", "Altra" },
+ { "EES", "EE Solutions, Inc." },
+ { "ASX", "AudioScience" },
+ { "DAC", "Digital Acoustics Corporation" },
+ { "HAL", "Halberthal" },
+ { "HPC", "Hewlett Packard Co." },
+ { "GRY", "Robert Gray Company" },
+ { "AXO", "Axonic Labs LLC" },
+ { "ALJ", "Altec Lansing" },
+ { "SMS", "Silicom Multimedia Systems Inc" },
+ { "HPI", "Headplay, Inc." },
+ { "FRO", "FARO Technologies" },
+ { "GAU", "Gaudi Co., Ltd." },
+ { "SRS", "SR-Systems e.K." },
+ { "APL", "Aplicom Oy" },
+ { "JGD", "University College" },
+ { "NVD", "Nvidia" },
+ { "CEP", "C-DAC" },
+ { "BDR", "Blonder Tongue Labs, Inc." },
+ { "AUO", "AU Optronics" },
+ { "DCR", "Decros Ltd" },
+ { "DLK", "D-Link Systems Inc" },
+ { "SWS", "Static" },
+ { "WSC", "CIS Technology Inc" },
+ { "ESL", "Esterline Technologies" },
+ { "ISC", "Id3 Semiconductors" },
+ { "XSN", "Xscreen AS" },
+ { "FML", "Fujitsu Microelect Ltd" },
+ { "WPI", "Wearnes Peripherals International (Pte) Ltd" },
+ { "EGL", "Eagle Technology" },
+ { "EGA", "Elgato Systems LLC" },
+ { "GAG", "Gage Applied Sciences Inc" },
+ { "HCP", "Hitachi Computer Products Inc" },
+ { "UET", "Universal Empowering Technologies" },
+ { "ITL", "Inter-Tel" },
+ { "SDE", "Sherwood Digital Electronics Corporation" },
+ { "CAA", "Castles Automation Co., Ltd" },
+ { "ZRN", "Zoran Corporation" },
+ { "VLT", "VideoLan Technologies" },
+ { "EUT", "Ericsson Mobile Networks B.V." },
+ { "REA", "Real D" },
+ { "BUT", "21ST CENTURY ENTERTAINMENT" },
+ { "THN", "Thundercom Holdings Sdn. Bhd." },
+ { "CHO", "Sichuang Changhong Corporation" },
+ { "SCC", "SORD Computer Corporation" },
+ { "MSY", "MicroTouch Systems Inc" },
+ { "ERP", "Euraplan GmbH" },
+ { "CPL", "Compal Electronics Inc" },
+ { "ACM", "Acroloop Motion Control Systems Inc" },
+ { "VTS", "VTech Computers Ltd" },
+ { "ETH", "Etherboot Project" },
+ { "CGT", "congatec AG" },
+ { "FEN", "Fen Systems Ltd." },
+ { "MLN", "Mark Levinson" },
+ { "UMC", "United Microelectr Corporation" },
+ { "CAR", "Cardinal Company Ltd" },
+ { "LIT", "Lithics Silicon Technology" },
+ { "AWC", "Access Works Comm Inc" },
+ { "PPC", "Phoenixtec Power Company Ltd" },
+ { "SVT", "SEVIT Co., Ltd." },
+ { "MDX", "MicroDatec GmbH" },
+ { "XIN", "Xinex Networks Inc" },
+ { "KTN", "Katron Tech Inc" },
+ { "MJI", "MARANTZ JAPAN, INC." },
+ { "CTM", "Computerm Corporation" },
+ { "PDM", "Psion Dacom Plc." },
+ { "AKM", "Asahi Kasei Microsystems Company Ltd" },
+ { "GSY", "Grossenbacher Systeme AG" },
+ { "OMR", "Omron Corporation" },
+ { "RSH", "ADC-Centre" },
+ { "MTM", "Motium" },
+ { "XDM", "XDM Ltd." },
+ { "MSX", "Micomsoft Co., Ltd." },
+ { "VNC", "Vinca Corporation" },
+ { "STK", "SANTAK CORP." },
+ { "JET", "JET POWER TECHNOLOGY CO., LTD." },
+ { "SLR", "Schlumberger Technology Corporate" },
+ { "GWI", "GW Instruments" },
+ { "TMI", "Texas Microsystem" },
+ { "EXT", "Exatech Computadores & Servicos Ltda" },
+ { "SXB", "Syntax-Brillian" },
+ { "HYT", "Heng Yu Technology (HK) Limited" },
+ { "TST", "Transtream Inc" },
+ { "FIS", "FLY-IT Simulators" },
+ { "VMW", "VMware Inc.," },
+ { "PET", "Practical Electronic Tools" },
+ { "BLP", "Bloomberg L.P." },
+ { "MVS", "Microvision" },
+ { "ZMT", "Zalman Tech Co., Ltd." },
+ { "QTD", "Quantum 3D Inc" },
+ { "ITE", "Integrated Tech Express Inc" },
+ { "MIS", "Modular Industrial Solutions Inc" },
+ { "KOB", "Kobil Systems GmbH" },
+ { "KOW", "KOWA Company,LTD." },
+ { "SHC", "ShibaSoku Co., Ltd." },
+ { "IKS", "Ikos Systems Inc" },
+ { "PGP", "propagamma kommunikation" },
+ { "AYD", "Aydin Displays" },
+ { "MFG", "MicroField Graphics Inc" },
+ { "APS", "Autologic Inc" },
+ { "APM", "Applied Memory Tech" },
+ { "ACO", "Allion Computer Inc." },
+ { "IWR", "Icuiti Corporation" },
+ { "RCI", "RC International" },
+ { "YMH", "Yamaha Corporation" },
+ { "SPE", "SPEA Software AG" },
+ { "ADL", "ASTRA Security Products Ltd" },
+ { "QFI", "Quickflex, Inc" },
+ { "FRD", "Freedom Scientific BLV" },
+ { "PCM", "PCM Systems Corporation" },
+ { "RHM", "Rohm Company Ltd" },
+ { "EQP", "Equipe Electronics Ltd." },
+ { "UND", "Unisys Corporation" },
+ { "ITX", "integrated Technology Express Inc" },
+ { "WML", "Wolfson Microelectronics Ltd" },
+ { "IPR", "Ithaca Peripherals" },
+ { "NCE", "Norcent Technology, Inc." },
+ { "GWY", "Gateway 2000" },
+ { "DAX", "Data Apex Ltd" },
+ { "MKT", "MICROTEK Inc." },
+ { "AOL", "America OnLine" },
+ { "BIO", "BioLink Technologies International, Inc." },
+ { "DCI", "Concepts Inc" },
+ { "LOL", "Litelogic Operations Ltd" },
+ { "ADI", "ADI Systems Inc" },
+ { "TPJ", "Junnila" },
+ { "JDL", "Japan Digital Laboratory Co.,Ltd." },
+ { "MMN", "MiniMan Inc" },
+ { "MNC", "Mini Micro Methods Ltd" },
+ { "SUM", "Summagraphics Corporation" },
+ { "SXT", "SHARP TAKAYA ELECTRONIC INDUSTRY CO.,LTD." },
+ { "CAT", "Consultancy in Advanced Technology" },
+ { "MSM", "Advanced Digital Systems" },
+ { "CHY", "Cherry GmbH" },
+ { "VLB", "ValleyBoard Ltda." },
+ { "DDS", "Barco, n.v." },
+ { "STL", "SigmaTel Inc" },
+ { "AIE", "Altmann Industrieelektronik" },
+ { "CHM", "CHIC TECHNOLOGY CORP." },
+ { "KTK", "Key Tronic Corporation" },
+ { "LTN", "Litronic Inc" },
+ { "IDC", "International Datacasting Corporation" },
+ { "TWA", "Tidewater Association" },
+ { "ARI", "Argosy Research Inc" },
+ { "STT", "Star Paging Telecom Tech (Shenzhen) Co. Ltd." },
+ { "MYA", "Monydata" },
+ { "JAE", "Japan Aviation Electronics Industry, Limited" },
+ { "BBH", "B&Bh" },
+ { "GIC", "General Inst. Corporation" },
+ { "TIV", "OOO Technoinvest" },
+ { "ION", "Inside Out Networks" },
+ { "KZI", "K-Zone International co. Ltd." },
+ { "IDE", "IDE Associates" },
+ { "IQI", "IneoQuest Technologies, Inc" },
+ { "NDI", "National Display Systems" },
+ { "REL", "Reliance Electric Ind Corporation" },
+ { "SPH", "G&W Instruments GmbH" },
+ { "RPI", "RoomPro Technologies" },
+ { "LUC", "Lucent Technologies" },
+ { "CTL", "Creative Technology Ltd" },
+ { "SDS", "SunRiver Data System" },
+ { "USR", "U.S. Robotics Inc" },
+ { "GJN", "Grand Junction Networks" },
+ { "YED", "Y-E Data Inc" },
+ { "RHT", "Red Hat, Inc." },
+ { "AOT", "Alcatel" },
+ { "TCR", "Thomson Consumer Electronics" },
+ { "ILC", "Image Logic Corporation" },
+ { "IGC", "Intergate Pty Ltd" },
+ { "HYC", "Hypercope Gmbh Aachen" },
+ { "SPL", "Smart Silicon Systems Pty Ltd" },
+ { "DLC", "Diamond Lane Comm. Corporation" },
+ { "TBB", "Triple S Engineering Inc" },
+ { "MLS", "Milestone EPE" },
+ { "QDM", "Quadram" },
+ { "AIR", "Advanced Integ. Research Inc" },
+ { "SLA", "Systeme Lauer GmbH&Co KG" },
+ { "IBP", "IBP Instruments GmbH" },
+ { "DDI", "Data Display AG" },
+ { "LED", "Long Engineering Design Inc" },
+ { "MSC", "Mouse Systems Corporation" },
+ { "LXS", "ELEA CardWare" },
+ { "ATE", "Innovate Ltd" },
+ { "APV", "A+V Link" },
+ { "FRC", "Force Computers" },
+ { "ZTC", "ZyDAS Technology Corporation" },
+ { "ANP", "Andrew Network Production" },
+ { "LOG", "Logicode Technology Inc" },
+ { "RAI", "Rockwell Automation/Intecolor" },
+ { "MPJ", "Microlab" },
+ { "CMO", "Chi Mei Optoelectronics corp." },
+ { "ROH", "Rohm Co., Ltd." },
+ { "HYP", "Hyphen Ltd" },
+ { "ICO", "Intel Corp" },
+ { "ACI", "Ancor Communications Inc" },
+ { "SLT", "Salt Internatioinal Corp." },
+ { "TSC", "Sanyo Electric Company Ltd" },
+ { "APC", "American Power Conversion" },
+ { "PSE", "Practical Solutions Pte., Ltd." },
+ { "MET", "Metheus Corporation" },
+ { "SAT", "Shuttle Tech" },
+ { "SYK", "Stryker Communications" },
+ { "BCQ", "Deutsche Telekom Berkom GmbH" },
+ { "DPI", "DocuPoint" },
+ { "FAR", "Farallon Computing" },
+ { "ROP", "Roper International Ltd" },
+ { "STB", "STB Systems Inc" },
+ { "CNC", "Alvedon Computers Ltd" },
+ { "DGA", "Digiital Arts Inc" },
+ { "EDT", "Emerging Display Technologies Corp" },
+ { "IPI", "Intelligent Platform Management Interface (IPMI) forum (Intel, HP, NEC, Dell)" },
+ { "VQ@", "Vision Quest" },
+ { "EMK", "Emcore Corporation" },
+ { "XTD", "Icuiti Corporation" },
+ { "KNX", "Nutech Marketing PTL" },
+ { "WHI", "Whistle Communications" },
+ { "KDM", "Korea Data Systems Co., Ltd." },
+ { "QCK", "Quick Corporation" },
+ { "QTR", "Qtronix Corporation" },
+ { "NFS", "Number Five Software" },
+ { "HTK", "Holtek Microelectronics Inc" },
+ { "TRL", "Royal Information" },
+ { "LXN", "Luxeon" },
+ { "VLK", "Vislink International Ltd" },
+ { "TWE", "Kontron Electronik" },
+ { "DFI", "DFI" },
+ { "JWS", "JWSpencer & Co." },
+ { "FTW", "MindTribe Product Engineering, Inc." },
+ { "TDM", "Tandem Computer Europe Inc" },
+ { "RAS", "RAScom Inc" },
+ { "KVX", "KeyView" },
+ { "MOS", "Moses Corporation" },
+ { "ONX", "SOMELEC Z.I. Du Vert Galanta" },
+ { "STF", "Starflight Electronics" },
+ { "HER", "Ascom Business Systems" },
+ { "GTS", "Geotest Marvin Test Systems Inc" },
+ { "KEC", "Kyushu Electronics Systems Inc" },
+ { "MQP", "MultiQ Products AB" },
+ { "LUX", "Luxxell Research Inc" },
+ { "HEC", "Hitachi Engineering Company Ltd" },
+ { "NXG", "Nexgen" },
+ { "CNI", "Connect Int'l A/S" },
+ { "FUJ", "Fujitsu Ltd" },
+ { "APD", "AppliAdata" },
+ { "LHE", "Lung Hwa Electronics Company Ltd" },
+ { "SCT", "Smart Card Technology" },
+ { "SOY", "SOYO Group, Inc" },
+ { "ICN", "Sanyo Icon" },
+ { "TDV", "TDVision Systems, Inc." },
+ { "AHC", "Advantech Co., Ltd." },
+ { "GTK", "G-Tech Corporation" },
+ { "BII", "Boeckeler Instruments Inc" },
+ { "TCC", "Tandon Corporation" },
+ { "BUJ", "ATI Tech Inc" },
+ { "SAA", "Sanritz Automation Co.,Ltd." },
+ { "DTK", "Dynax Electronics (HK) Ltd" },
+ { "HXM", "Hexium Ltd." },
+ { "EGD", "EIZO GmbH Display Technologies" },
+ { "NDK", "Naitoh Densei CO., LTD." },
+ { "TVR", "TV Interactive Corporation" },
+ { "PNL", "Panelview, Inc." },
+ { "AET", "Aethra Telecomunicazioni S.r.l." },
+ { "REC", "ReCom" },
+ { "HET", "HETEC Datensysteme GmbH" },
+ { "ZOW", "Zowie Intertainment, Inc" },
+ { "MEQ", "Matelect Ltd." },
+ { "DRD", "DIGITAL REFLECTION INC." },
+ { "MRA", "Miranda Technologies Inc" },
+ { "QTM", "Quantum" },
+ { "REN", "Renesas Technology Corp." },
+ { "XIO", "Xiotech Corporation" },
+ { "GIS", "AT&T Global Info Solutions" },
+ { "TEA", "TEAC System Corporation" },
+ { "EMU", "Emulex Corporation" },
+ { "VIC", "Victron B.V." },
+ { "ATN", "Athena Smartcard Solutions Ltd." },
+ { "SYS", "Sysgration Ltd" },
+ { "CVS", "Clarity Visual Systems" },
+ { "CWR", "Connectware Inc" },
+ { "TVI", "Truevision" },
+ { "AMB", "Ambient Technologies, Inc." },
+ { "USA", "Utimaco Safeware AG" },
+ { "LNT", "LANETCO International" },
+ { "EDG", "Electronic-Design GmbH" },
+ { "MKV", "Trtheim Technology" },
+ { "SGT", "Stargate Technology" },
+ { "RTS", "Raintree Systems" },
+ { "PXM", "Proxim Inc" },
+ { "ACG", "A&R Cambridge Ltd" },
+ { "FJT", "F.J. Tieman BV" },
+ { "LCD", "Toshiba Matsushita Display Technology Co., Ltd" },
+ { "IDS", "Interdigital Sistemas de Informacao" },
+ { "AOA", "AOpen Inc." },
+ { "ACR", "Acer Technologies" },
+ { "AKL", "AMiT Ltd" },
+ { "IOS", "i-O Display System" },
+ { "NOR", "Norand Corporation" },
+ { "XST", "XS Technologies Inc" },
+ { "BUG", "B.U.G., Inc." },
+ { "RCN", "Radio Consult SRL" },
+ { "ESI", "Extended Systems, Inc." },
+ { "TUT", "Tut Systems" },
+ { "VAR", "Varian Australia Pty Ltd" },
+ { "DIT", "Dragon Information Technology" },
+ { "CET", "TEC CORPORATION" },
+ { "WKH", "Uni-Take Int'l Inc." },
+ { "BHZ", "BitHeadz, Inc." },
+ { "PTI", "Promise Technology Inc" },
+ { "HIQ", "Kaohsiung Opto Electronics Americas, Inc." },
+ { "SET", "SendTek Corporation" },
+ { "KCL", "Keycorp Ltd" },
+ { "EIC", "Eicon Technology Corporation" },
+ { "TRT", "Tritec Electronic AG" },
+ { "ZAN", "Zandar Technologies plc" },
+ { "NTN", "Nuvoton Technology Corporation" },
+ { "MTC", "Mars-Tech Corporation" },
+ { "JQE", "CNet Technical Inc" },
+ { "SRG", "Intuitive Surgical, Inc." },
+ { "VIR", "Visual Interface, Inc" },
+ { "HTX", "Hitex Systementwicklung GmbH" },
+ { "TLX", "Telxon Corporation" },
+ { "NGC", "Network General" },
+ { "TSB", "Toshiba America Info Systems Inc" },
+ { "SGI", "Scan Group Ltd" },
+ { "AIS", "Alien Internet Services" },
+ { "MUD", "Multi-Dimension Institute" },
+ { "PNS", "PanaScope" },
+ { "NEO", "NEO TELECOM CO.,LTD." },
+ { "IMB", "ART s.r.l." },
+ { "SRD", "Setred" },
+ { "LEX", "Lexical Ltd" },
+ { "LMI", "Lexmark Int'l Inc" },
+ { "ECL", "Excel Company Ltd" },
+ { "EXC", "Excession Audio" },
+ { "ABA", "ABBAHOME INC." },
+ { "CLI", "Cirrus Logic Inc" },
+ { "DYM", "Dymo-CoStar Corporation" },
+ { "MEL", "Mitsubishi Electric Corporation" },
+ { "ZAX", "Zefiro Acoustics" },
+ { "TEC", "Tecmar Inc" },
+ { "WTI", "WorkStation Tech" },
+ { "APX", "AP Designs Ltd" },
+ { "MLM", "Millennium Engineering Inc" },
+ { "BAC", "Biometric Access Corporation" },
+ { "DDE", "Datasat Digital Entertainment" },
+ { "GIM", "Guillemont International" },
+ { "TVM", "Taiwan Video & Monitor Corporation" },
+ { "KWD", "Kenwood Corporation" },
+ { "STW", "Starwin Inc." },
+ { "NRV", "Taugagreining hf" },
+ { "SUP", "Supra Corporation" },
+ { "MTB", "Media Technologies Ltd." },
+ { "INF", "Inframetrics Inc" },
+ { "OTM", "Optoma Corporation" },
+ { "NTX", "Netaccess Inc" },
+ { "LXC", "LXCO Technologies AG" },
+ { "CRN", "Cornerstone Imaging" },
+ { "PVP", "Klos Technologies, Inc." },
+ { "TCJ", "TEAC America Inc" },
+ { "WVM", "Wave Systems Corporation" },
+ { "ERN", "Ericsson, Inc." },
+ { "PVN", "Pixel Vision" },
+ { "LMT", "Laser Master" },
+ { "MID", "miro Displays" },
+ { "VID", "Ingram Macrotron Germany" },
+ { "IFZ", "Infinite Z" },
+ { "ODM", "ODME Inc." },
+ { "ASI", "Ahead Systems" },
+ { "ISY", "International Integrated Systems,Inc.(IISI)" },
+ { "NCL", "NetComm Ltd" },
+ { "ITK", "ITK Telekommunikation AG" },
+ { "EZE", "EzE Technologies" },
+ { "VSR", "V-Star Electronics Inc." },
+ { "CPC", "Ciprico Inc" },
+ { "JWD", "Video International Inc." },
+ { "MEC", "Mega System Technologies Inc" },
+ { "NVI", "NuVision US, Inc." },
+ { "MRK", "Maruko & Company Ltd" },
+ { "AAA", "Avolites Ltd" },
+ { "CHG", "Sichuan Changhong Electric CO, LTD." },
+ { "WWV", "World Wide Video, Inc." },
+ { "SEO", "SEOS Ltd" },
+ { "XER", "DO NOT USE - XER" },
+ { "MCN", "Micron Electronics Inc" },
+ { "DXC", "Digipronix Control Systems" },
+ { "RSN", "Radiospire Networks, Inc." },
+ { "FGD", "Lisa Draexlmaier GmbH" },
+ { "SES", "Session Control LLC" },
+ { "IIN", "IINFRA Co., Ltd" },
+ { "ETI", "Eclipse Tech Inc" },
+ { "DXD", "DECIMATOR DESIGN PTY LTD" },
+ { "BST", "BodySound Technologies, Inc." },
+ { "MTL", "Mitel Corporation" },
+ { "LGX", "Lasergraphics, Inc." },
+ { "MSP", "Mistral Solutions [P] Ltd." },
+ { "SER", "Sony Ericsson Mobile Communications Inc." },
+ { "IHE", "InHand Electronics" },
+ { "STO", "Stollmann E+V GmbH" },
+ { "RET", "Resonance Technology, Inc." },
+ { "PXE", "PIXELA CORPORATION" },
+ { "USI", "Universal Scientific Industrial Co., Ltd." },
+ { "JAC", "Astec Inc" },
+ { "WAC", "Wacom Tech" },
+ { "BUF", "Yasuhiko Shirai Melco Inc" },
+ { "LSI", "Loughborough Sound Images" },
+ { "AMA", "Asia Microelectronic Development Inc" },
+ { "DJP", "Maygay Machines, Ltd" },
+ { "CAN", "CORNEA" },
+ { "UMM", "Universal Multimedia" },
+ { "ECI", "Enciris Technologies" },
+ { "DDT", "Datadesk Technologies Inc" },
+ { "MLG", "Micrologica AG" },
+ { "NCA", "Nixdorf Company" },
+ { "ENS", "Ensoniq Corporation" },
+ { "MOT", "Motorola UDS" },
+ { "WCI", "Wisecom Inc" },
+ { "MXT", "Maxtech Corporation" },
+ { "EHJ", "Epson Research" },
+ { "KUR", "Kurta Corporation" },
+ { "DFT", "DEI Holdings dba Definitive Technology" },
+ { "NAD", "NAD Electronics" },
+ { "GMK", "GMK Electronic Design GmbH" },
+ { "TAI", "Toshiba America Info Systems Inc" },
+ { "SNP", "Siemens Nixdorf Info Systems" },
+ { "KFE", "Komatsu Forest" },
+ { "PPD", "MEPhI" },
+ { "UMG", "Umezawa Giken Co.,Ltd" },
+ { "PMC", "PMC Consumer Electronics Ltd" },
+ { "KIS", "KiSS Technology A/S" },
+ { "ABV", "Advanced Research Technology" },
+ { "ISA", "Symbol Technologies" },
+ { "GMN", "GEMINI 2000 Ltd" },
+ { "VSI", "VideoServer" },
+ { "DTO", "Deutsche Thomson OHG" },
+ { "OCN", "Olfan" },
+ { "LTK", "Lucidity Technology Company Ltd" },
+ { "CLX", "CardLogix" },
+ { "TPT", "Thruput Ltd" },
+ { "IXD", "Intertex Data AB" },
+ { "ICX", "ICCC A/S" },
+ { "REF", "Reflectivity, Inc." },
+ { "CDK", "Cray Communications" },
+ { "PNX", "Phoenix Technologies, Ltd." },
+ { "MCT", "Microtec" },
+ { "ESD", "Ensemble Designs, Inc" },
+ { "CTS", "Comtec Systems Co., Ltd." },
+ { "ADB", "Aldebbaron" },
+ { "AML", "Anderson Multimedia Communications (HK) Limited" },
+ { "FIN", "Finecom Co., Ltd." },
+ { "NCC", "NCR Corporation" },
+ { "ONS", "On Systems Inc" },
+ { "CGA", "Chunghwa Picture Tubes, LTD" },
+ { "NTC", "NeoTech S.R.L" },
+ { "AMD", "Amdek Corporation" },
+ { "WVV", "WolfVision GmbH" },
+ { "PHO", "Photonics Systems Inc." },
+ { "AVX", "AVerMedia Technologies, Inc." },
+ { "SJE", "Sejin Electron Inc" },
+ { "BCM", "Broadcom" },
+ { "RLN", "RadioLAN Inc" },
+ { "CAM", "Cambridge Audio" },
+ { "TCS", "Tatung Company of America Inc" },
+ { "RIO", "Rios Systems Company Ltd" },
+ { "SWT", "Software Technologies Group,Inc." },
+ { "BSL", "Biomedical Systems Laboratory" },
+ { "DCV", "Datatronics Technology Inc" },
+ { "JPC", "JPC Technology Limited" },
+ { "ICC", "BICC Data Networks Ltd" },
+ { "CEI", "Crestron Electronics, Inc." },
+ { "NUI", "NU Inc." },
+ { "MAE", "Maestro Pty Ltd" },
+ { "AYR", "Airlib, Inc" },
+ { "TPS", "Teleprocessing Systeme GmbH" },
+ { "SMK", "SMK CORPORATION" },
+ { "IAT", "IAT Germany GmbH" },
+ { "BNO", "Bang & Olufsen" },
+ { "KRY", "Kroy LLC" },
+ { "OLT", "Olitec S.A." },
+ { "ABC", "AboCom System Inc" },
+ { "FXX", "Fuji Xerox" },
+ { "ANI", "Anigma Inc" },
+ { "OEI", "Optum Engineering Inc." },
+ { "TPE", "Technology Power Enterprises Inc" },
+ { "RDI", "Rainbow Displays, Inc." },
+ { "KDK", "Kodiak Tech" },
+ { "LHT", "Lighthouse Technologies Limited" },
+ { "BEK", "Beko Elektronik A.S." },
+ { "LND", "Land Computer Company Ltd" },
+ { "CDC", "Core Dynamics Corporation" },
+ { "FHL", "FHLP" },
+ { "UNP", "Unitop" },
+ { "MSR", "MASPRO DENKOH Corp." },
+ { "MKC", "Media Tek Inc." },
+ { "BCD", "Barco GmbH" },
+ { "PQI", "Pixel Qi" },
+ { "ALD", "In4S Inc" },
+ { "HTC", "Hitachi Ltd" },
+ { "OCD", "Macraigor Systems Inc" },
+ { "PHY", "Phylon Communications" },
+ { "MSF", "M-Systems Flash Disk Pioneers" },
+ { "ETK", "eTEK Labs Inc." },
+ { "DVS", "Digital Video System" },
+ { "ACU", "Acculogic" },
+ { "YOW", "American Biometric Company" },
+ { "MGE", "Schneider Electric S.A." },
+ { "AKP", "Atom Komplex Prylad" },
+ { "PGI", "PACSGEAR, Inc." },
+ { "III", "Intelligent Instrumentation" },
+ { "BML", "BIOMED Lab" },
+ { "KMC", "Mitsumi Company Ltd" },
+ { "RSQ", "R Squared" },
+ { "SBC", "Shanghai Bell Telephone Equip Mfg Co" },
+ { "FPX", "Cirel Systemes" },
+ { "IDN", "Idneo Technologies" },
+ { "BNE", "Bull AB" },
+};
+
+QT_END_NAMESPACE
+
+#endif // QEDIDVENDORTABLE_P_H
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
index dc4785071f..06f0aa6747 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
@@ -48,78 +48,26 @@
QT_BEGIN_NAMESPACE
-struct GUserEventSource
-{
- GSource source;
- QPAEventDispatcherGlib *q;
-};
-
-static gboolean userEventSourcePrepare(GSource *source, gint *timeout)
-{
- Q_UNUSED(timeout)
- GUserEventSource *userEventSource = reinterpret_cast<GUserEventSource *>(source);
- QPAEventDispatcherGlib *dispatcher = userEventSource->q;
- if (dispatcher->m_flags & QEventLoop::ExcludeUserInputEvents)
- return QWindowSystemInterface::nonUserInputEventsQueued();
- else
- return QWindowSystemInterface::windowSystemEventsQueued() > 0;
-}
-
-static gboolean userEventSourceCheck(GSource *source)
-{
- return userEventSourcePrepare(source, 0);
-}
-
-static gboolean userEventSourceDispatch(GSource *source, GSourceFunc, gpointer)
-{
- GUserEventSource *userEventSource = reinterpret_cast<GUserEventSource *>(source);
- QPAEventDispatcherGlib *dispatcher = userEventSource->q;
- QWindowSystemInterface::sendWindowSystemEvents(dispatcher->m_flags);
- return true;
-}
-
-static GSourceFuncs userEventSourceFuncs = {
- userEventSourcePrepare,
- userEventSourceCheck,
- userEventSourceDispatch,
- NULL,
- NULL,
- NULL
-};
-
QPAEventDispatcherGlibPrivate::QPAEventDispatcherGlibPrivate(GMainContext *context)
: QEventDispatcherGlibPrivate(context)
{
- Q_Q(QPAEventDispatcherGlib);
- userEventSource = reinterpret_cast<GUserEventSource *>(g_source_new(&userEventSourceFuncs,
- sizeof(GUserEventSource)));
- userEventSource->q = q;
- g_source_set_can_recurse(&userEventSource->source, true);
- g_source_attach(&userEventSource->source, mainContext);
}
-
QPAEventDispatcherGlib::QPAEventDispatcherGlib(QObject *parent)
: QEventDispatcherGlib(*new QPAEventDispatcherGlibPrivate, parent)
, m_flags(QEventLoop::AllEvents)
{
- Q_D(QPAEventDispatcherGlib);
- d->userEventSource->q = this;
}
QPAEventDispatcherGlib::~QPAEventDispatcherGlib()
{
- Q_D(QPAEventDispatcherGlib);
-
- g_source_destroy(&d->userEventSource->source);
- g_source_unref(&d->userEventSource->source);
- d->userEventSource = 0;
}
bool QPAEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
{
m_flags = flags;
- return QEventDispatcherGlib::processEvents(m_flags);
+ const bool didSendEvents = QEventDispatcherGlib::processEvents(m_flags);
+ return QWindowSystemInterface::sendWindowSystemEvents(m_flags) || didSendEvents;
}
QT_END_NAMESPACE
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
index 6d148753bf..bed2532856 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
@@ -71,14 +71,11 @@ public:
QEventLoop::ProcessEventsFlags m_flags;
};
-struct GUserEventSource;
-
class QPAEventDispatcherGlibPrivate : public QEventDispatcherGlibPrivate
{
Q_DECLARE_PUBLIC(QPAEventDispatcherGlib)
public:
QPAEventDispatcherGlibPrivate(GMainContext *context = 0);
- GUserEventSource *userEventSource;
};
diff --git a/src/platformsupport/fbconvenience/qfbwindow.cpp b/src/platformsupport/fbconvenience/qfbwindow.cpp
index 7e016f2f49..36f92b8cea 100644
--- a/src/platformsupport/fbconvenience/qfbwindow.cpp
+++ b/src/platformsupport/fbconvenience/qfbwindow.cpp
@@ -106,7 +106,7 @@ void QFbWindow::setVisible(bool visible)
}
}
-void QFbWindow::setWindowState(Qt::WindowState state)
+void QFbWindow::setWindowState(Qt::WindowStates state)
{
QPlatformWindow::setWindowState(state);
mWindowState = state;
diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h
index c201302a50..20bac46c69 100644
--- a/src/platformsupport/fbconvenience/qfbwindow_p.h
+++ b/src/platformsupport/fbconvenience/qfbwindow_p.h
@@ -70,7 +70,7 @@ public:
void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
void setVisible(bool visible) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
void setWindowFlags(Qt::WindowFlags type) Q_DECL_OVERRIDE;
Qt::WindowFlags windowFlags() const;
@@ -93,7 +93,7 @@ protected:
QFbBackingStore *mBackingStore;
QRect mOldGeometry;
Qt::WindowFlags mWindowFlags;
- Qt::WindowState mWindowState;
+ Qt::WindowStates mWindowState;
WId mWindowId;
};
diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri
index 2a9b32f65a..af75aa3281 100644
--- a/src/platformsupport/fontdatabases/mac/coretext.pri
+++ b/src/platformsupport/fontdatabases/mac/coretext.pri
@@ -18,18 +18,4 @@ macos: \
else: \
LIBS_PRIVATE += -framework UIKit
-# CoreText is documented to be available on watchOS, but the headers aren't present
-# in the watchOS Simulator SDK like they are supposed to be. Work around the problem
-# by adding the device SDK's headers to the search path as a fallback.
-# rdar://25314492, rdar://27844864
-watchos:simulator {
- simulator_system_frameworks = $$xcodeSDKInfo(Path, $${simulator.sdk})/System/Library/Frameworks
- device_system_frameworks = $$xcodeSDKInfo(Path, $${device.sdk})/System/Library/Frameworks
- for (arch, QMAKE_APPLE_SIMULATOR_ARCHS) {
- QMAKE_CXXFLAGS += \
- -Xarch_$${arch} \
- -F$$simulator_system_frameworks \
- -Xarch_$${arch} \
- -F$$device_system_frameworks
- }
-}
+CONFIG += watchos_coretext
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index 9612b909f1..2b4c4e3ceb 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -57,12 +57,8 @@
#include <qpa/qplatformtheme.h>
#include <private/qcore_mac_p.h>
-#ifdef Q_OS_OSX
-#include <ApplicationServices/ApplicationServices.h>
-#else
-#include <CoreText/CoreText.h>
-#include <CoreGraphics/CoreGraphics.h>
-#endif
+Q_FORWARD_DECLARE_CF_TYPE(CTFontDescriptor);
+Q_FORWARD_DECLARE_CF_TYPE(CTFont);
Q_DECLARE_METATYPE(QCFType<CGFontRef>);
Q_DECLARE_METATYPE(QCFType<CFURLRef>);
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
index 1389b497d5..a337332b53 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
@@ -132,20 +132,6 @@ bool QWindowsFontEngine::hasCMapTable() const
return GetFontData(hdc, MAKE_LITTLE_ENDIAN_TAG('c', 'm', 'a', 'p'), 0, 0, 0) != GDI_ERROR;
}
-bool QWindowsFontEngine::hasGlyfTable() const
-{
- HDC hdc = m_fontEngineData->hdc;
- SelectObject(hdc, hfont);
- return GetFontData(hdc, MAKE_LITTLE_ENDIAN_TAG('g', 'l', 'y', 'f'), 0, 0, 0) != GDI_ERROR;
-}
-
-bool QWindowsFontEngine::hasEbdtTable() const
-{
- HDC hdc = m_fontEngineData->hdc;
- SelectObject(hdc, hfont);
- return GetFontData(hdc, MAKE_LITTLE_ENDIAN_TAG('E', 'B', 'D', 'T'), 0, 0, 0) != GDI_ERROR;
-}
-
static inline QString stringFromOutLineTextMetric(const OUTLINETEXTMETRIC *otm, PSTR offset)
{
const uchar *p = reinterpret_cast<const uchar *>(otm) + quintptr(offset);
@@ -276,7 +262,7 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name,
userData.insert(QStringLiteral("trueType"), QVariant(bool(ttf)));
setUserData(userData);
- hasUnreliableOutline = hasGlyfTable() && hasEbdtTable();
+ hasUnreliableOutline = (tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) == 0;
}
QWindowsFontEngine::~QWindowsFontEngine()
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
index 5119adc0eb..76b45d7a7b 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
@@ -138,8 +138,6 @@ private:
QImage::Format mask_format);
bool hasCFFTable() const;
bool hasCMapTable() const;
- bool hasGlyfTable() const;
- bool hasEbdtTable() const;
const QSharedPointer<QWindowsFontEngineData> m_fontEngineData;
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp
index 8c26550c1e..0c2b757920 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
+++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
@@ -72,7 +72,11 @@ enum {
#undef FontChange
#endif
-QVector<int> qglx_buildSpec(const QSurfaceFormat &format, int drawableBit)
+#ifndef GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
+#endif
+
+QVector<int> qglx_buildSpec(const QSurfaceFormat &format, int drawableBit, int flags)
{
QVector<int> spec;
@@ -116,6 +120,10 @@ QVector<int> qglx_buildSpec(const QSurfaceFormat &format, int drawableBit)
<< GLX_SAMPLES_ARB
<< format.samples();
+ if ((flags & QGLX_SUPPORTS_SRGB) && format.colorSpace() == QSurfaceFormat::sRGBColorSpace)
+ spec << GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB
+ << True;
+
spec << GLX_DRAWABLE_TYPE
<< drawableBit
@@ -175,14 +183,14 @@ template <class T>
using QXlibArrayPointer = QScopedArrayPointer<T, QXlibScopedPointerDeleter<T>>;
}
-GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format, bool highestPixelFormat, int drawableBit)
+GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format, bool highestPixelFormat, int drawableBit, int flags)
{
QXcbSoftwareOpenGLEnforcer softwareOpenGLEnforcer;
GLXFBConfig config = 0;
do {
- const QVector<int> spec = qglx_buildSpec(format, drawableBit);
+ const QVector<int> spec = qglx_buildSpec(format, drawableBit, flags);
int confcount = 0;
QXlibArrayPointer<GLXFBConfig> configs(glXChooseFBConfig(display, screen, spec.constData(), &confcount));
@@ -201,6 +209,13 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format
for (int i = 0; i < confcount; i++) {
GLXFBConfig candidate = configs[i];
+ if ((flags & QGLX_SUPPORTS_SRGB) && format.colorSpace() == QSurfaceFormat::sRGBColorSpace) {
+ int srgbCapable = 0;
+ glXGetFBConfigAttrib(display, candidate, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, &srgbCapable);
+ if (!srgbCapable)
+ continue;
+ }
+
QXlibPointer<XVisualInfo> visual(glXGetVisualFromFBConfig(display, candidate));
const int actualRed = qPopulationCount(visual->red_mask);
@@ -224,28 +239,28 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format
return config;
}
-XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *format, int drawableBit)
+XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *format, int drawableBit, int flags)
{
Q_ASSERT(format);
XVisualInfo *visualInfo = 0;
- GLXFBConfig config = qglx_findConfig(display, screen, *format, false, drawableBit);
+ GLXFBConfig config = qglx_findConfig(display, screen, *format, false, drawableBit, flags);
if (config)
visualInfo = glXGetVisualFromFBConfig(display, config);
if (visualInfo) {
- qglx_surfaceFormatFromGLXFBConfig(format, display, config);
+ qglx_surfaceFormatFromGLXFBConfig(format, display, config, flags);
return visualInfo;
}
// attempt to fall back to glXChooseVisual
do {
- QVector<int> attribs = qglx_buildSpec(*format, drawableBit);
+ QVector<int> attribs = qglx_buildSpec(*format, drawableBit, flags);
visualInfo = glXChooseVisual(display, screen, attribs.data());
if (visualInfo) {
- qglx_surfaceFormatFromVisualInfo(format, display, visualInfo);
+ qglx_surfaceFormatFromVisualInfo(format, display, visualInfo, flags);
return visualInfo;
}
} while (qglx_reduceFormat(format));
@@ -253,7 +268,7 @@ XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *f
return visualInfo;
}
-void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display, GLXFBConfig config)
+void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display, GLXFBConfig config, int flags)
{
int redSize = 0;
int greenSize = 0;
@@ -264,6 +279,7 @@ void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display,
int sampleBuffers = 0;
int sampleCount = 0;
int stereo = 0;
+ int srgbCapable = 0;
glXGetFBConfigAttrib(display, config, GLX_RED_SIZE, &redSize);
glXGetFBConfigAttrib(display, config, GLX_GREEN_SIZE, &greenSize);
@@ -273,6 +289,8 @@ void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display,
glXGetFBConfigAttrib(display, config, GLX_STENCIL_SIZE, &stencilSize);
glXGetFBConfigAttrib(display, config, GLX_SAMPLES_ARB, &sampleBuffers);
glXGetFBConfigAttrib(display, config, GLX_STEREO, &stereo);
+ if (flags & QGLX_SUPPORTS_SRGB)
+ glXGetFBConfigAttrib(display, config, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, &srgbCapable);
format->setRedBufferSize(redSize);
format->setGreenBufferSize(greenSize);
@@ -284,11 +302,12 @@ void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display,
glXGetFBConfigAttrib(display, config, GLX_SAMPLES_ARB, &sampleCount);
format->setSamples(sampleCount);
}
+ format->setColorSpace(srgbCapable ? QSurfaceFormat::sRGBColorSpace : QSurfaceFormat::DefaultColorSpace);
format->setStereo(stereo);
}
-void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, XVisualInfo *visualInfo)
+void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, XVisualInfo *visualInfo, int flags)
{
int redSize = 0;
int greenSize = 0;
@@ -299,6 +318,7 @@ void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display,
int sampleBuffers = 0;
int sampleCount = 0;
int stereo = 0;
+ int srgbCapable = 0;
glXGetConfig(display, visualInfo, GLX_RED_SIZE, &redSize);
glXGetConfig(display, visualInfo, GLX_GREEN_SIZE, &greenSize);
@@ -308,6 +328,8 @@ void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display,
glXGetConfig(display, visualInfo, GLX_STENCIL_SIZE, &stencilSize);
glXGetConfig(display, visualInfo, GLX_SAMPLES_ARB, &sampleBuffers);
glXGetConfig(display, visualInfo, GLX_STEREO, &stereo);
+ if (flags & QGLX_SUPPORTS_SRGB)
+ glXGetConfig(display, visualInfo, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, &srgbCapable);
format->setRedBufferSize(redSize);
format->setGreenBufferSize(greenSize);
@@ -319,6 +341,7 @@ void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display,
glXGetConfig(display, visualInfo, GLX_SAMPLES_ARB, &sampleCount);
format->setSamples(sampleCount);
}
+ format->setColorSpace(srgbCapable ? QSurfaceFormat::sRGBColorSpace : QSurfaceFormat::DefaultColorSpace);
format->setStereo(stereo);
}
@@ -387,5 +410,10 @@ bool qglx_reduceFormat(QSurfaceFormat *format)
return true;
}
+ if (format->colorSpace() == QSurfaceFormat::sRGBColorSpace) {
+ format->setColorSpace(QSurfaceFormat::DefaultColorSpace);
+ return true;
+ }
+
return false;
}
diff --git a/src/platformsupport/glxconvenience/qglxconvenience_p.h b/src/platformsupport/glxconvenience/qglxconvenience_p.h
index d422668584..f9647bfd9a 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience_p.h
+++ b/src/platformsupport/glxconvenience/qglxconvenience_p.h
@@ -57,11 +57,16 @@
#include <X11/Xlib.h>
#include <GL/glx.h>
-QVector<int> qglx_buildSpec(const QSurfaceFormat &format, int drawableBit = GLX_WINDOW_BIT);
-XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *format, int drawableBit = GLX_WINDOW_BIT);
-GLXFBConfig qglx_findConfig(Display *display, int screen, QSurfaceFormat format, bool highestPixelFormat = false, int drawableBit = GLX_WINDOW_BIT);
-void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display, GLXFBConfig config);
-void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, XVisualInfo *visualInfo);
+enum QGlxFlags
+{
+ QGLX_SUPPORTS_SRGB = 0x01
+};
+
+QVector<int> qglx_buildSpec(const QSurfaceFormat &format, int drawableBit = GLX_WINDOW_BIT, int flags = 0);
+XVisualInfo *qglx_findVisualInfo(Display *display, int screen, QSurfaceFormat *format, int drawableBit = GLX_WINDOW_BIT, int flags = 0);
+GLXFBConfig qglx_findConfig(Display *display, int screen, QSurfaceFormat format, bool highestPixelFormat = false, int drawableBit = GLX_WINDOW_BIT, int flags = 0);
+void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display, GLXFBConfig config, int flags = 0);
+void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, XVisualInfo *visualInfo, int flags = 0);
bool qglx_reduceFormat(QSurfaceFormat *format);
#endif // QGLXCONVENIENCE_H
diff --git a/src/platformsupport/graphics/qrasterbackingstore.cpp b/src/platformsupport/graphics/qrasterbackingstore.cpp
index b8d393844c..a3ffe11d19 100644
--- a/src/platformsupport/graphics/qrasterbackingstore.cpp
+++ b/src/platformsupport/graphics/qrasterbackingstore.cpp
@@ -59,20 +59,7 @@ QRasterBackingStore::~QRasterBackingStore()
void QRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(staticContents);
-
- // We can't guarantee that we have a platform-window at this point, so we have
- // to pull out the DPR using QWindow and its QScreen fallback, and then remove
- // the Qt scaling factor.
- qreal nativeWindowDevicePixelRatio = window()->devicePixelRatio() / QHighDpiScaling::factor(window());
- QSize effectiveBufferSize = size * nativeWindowDevicePixelRatio;
-
- if (m_image.size() == effectiveBufferSize)
- return;
-
- m_image = QImage(effectiveBufferSize, format());
- m_image.setDevicePixelRatio(nativeWindowDevicePixelRatio);
- if (m_image.format() == QImage::Format_ARGB32_Premultiplied)
- m_image.fill(Qt::transparent);
+ m_requestedSize = size;
}
QImage::Format QRasterBackingStore::format() const
@@ -111,11 +98,13 @@ bool QRasterBackingStore::scroll(const QRegion &region, int dx, int dy)
void QRasterBackingStore::beginPaint(const QRegion &region)
{
- // Keep backing store device pixel ratio in sync with window
qreal nativeWindowDevicePixelRatio = window()->handle()->devicePixelRatio();
- if (m_image.devicePixelRatio() != nativeWindowDevicePixelRatio) {
- const QSize nativeSize = QHighDpi::toNativePixels(backingStore()->size(), window());
- resize(nativeSize, backingStore()->staticContents());
+ QSize effectiveBufferSize = m_requestedSize * nativeWindowDevicePixelRatio;
+ if (m_image.devicePixelRatio() != nativeWindowDevicePixelRatio || m_image.size() != effectiveBufferSize) {
+ m_image = QImage(effectiveBufferSize, format());
+ m_image.setDevicePixelRatio(nativeWindowDevicePixelRatio);
+ if (m_image.format() == QImage::Format_ARGB32_Premultiplied)
+ m_image.fill(Qt::transparent);
}
if (!m_image.hasAlphaChannel())
@@ -123,9 +112,8 @@ void QRasterBackingStore::beginPaint(const QRegion &region)
QPainter painter(&m_image);
painter.setCompositionMode(QPainter::CompositionMode_Source);
- const QColor blank = Qt::transparent;
for (const QRect &rect : region)
- painter.fillRect(rect, blank);
+ painter.fillRect(rect, Qt::transparent);
}
QT_END_NAMESPACE
diff --git a/src/platformsupport/graphics/qrasterbackingstore_p.h b/src/platformsupport/graphics/qrasterbackingstore_p.h
index 55976d2ceb..2764fd6432 100644
--- a/src/platformsupport/graphics/qrasterbackingstore_p.h
+++ b/src/platformsupport/graphics/qrasterbackingstore_p.h
@@ -73,6 +73,7 @@ protected:
virtual QImage::Format format() const;
QImage m_image;
+ QSize m_requestedSize;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index 5c87cb7c9c..960f1d2f12 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -87,7 +87,7 @@ QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, QFdContainer
// socket notifier for events on the keyboard device
m_notify = new QSocketNotifier(m_fd.get(), QSocketNotifier::Read, this);
- connect(m_notify, SIGNAL(activated(int)), this, SLOT(readKeycode()));
+ connect(m_notify, &QSocketNotifier::activated, this, &QEvdevKeyboardHandler::readKeycode);
}
QEvdevKeyboardHandler::~QEvdevKeyboardHandler()
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
index 1ec4915855..7c64c4febb 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
@@ -145,7 +145,6 @@ public:
class QEvdevKeyboardHandler : public QObject
{
- Q_OBJECT
public:
QEvdevKeyboardHandler(const QString &device, QFdContainer &fd, bool disableZap, bool enableCompose, const QString &keymapFile);
~QEvdevKeyboardHandler();
@@ -190,7 +189,6 @@ public:
bool loadKeymap(const QString &file);
void unloadKeymap();
-private slots:
void readKeycode();
KeycodeAction processKeycode(quint16 keycode, bool pressed, bool autorepeat);
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index 94ebae8f42..85e6a80879 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -88,8 +88,10 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
for (const QString &device : devices)
addKeyboard(device);
- connect(m_deviceDiscovery, SIGNAL(deviceDetected(QString)), this, SLOT(addKeyboard(QString)));
- connect(m_deviceDiscovery, SIGNAL(deviceRemoved(QString)), this, SLOT(removeKeyboard(QString)));
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ this, &QEvdevKeyboardManager::addKeyboard);
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ this, &QEvdevKeyboardManager::removeKeyboard);
}
}
}
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
index d2e34fead3..27ea7e468e 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
@@ -63,14 +63,12 @@ QT_BEGIN_NAMESPACE
class QEvdevKeyboardManager : public QObject
{
- Q_OBJECT
public:
QEvdevKeyboardManager(const QString &key, const QString &specification, QObject *parent = 0);
~QEvdevKeyboardManager();
void loadKeymap(const QString &file);
-private slots:
void addKeyboard(const QString &deviceNode = QString());
void removeKeyboard(const QString &deviceNode);
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 9b4bcf1575..8614de066f 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -116,7 +116,8 @@ QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool abs,
// socket notifier for events on the mouse device
m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
- connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData()));
+ connect(m_notify, &QSocketNotifier::activated,
+ this, &QEvdevMouseHandler::readMouseData);
}
QEvdevMouseHandler::~QEvdevMouseHandler()
@@ -236,6 +237,7 @@ void QEvdevMouseHandler::readMouseData()
posChanged = true;
}
} else if (data->type == EV_REL) {
+ QPoint delta;
if (data->code == REL_X) {
m_x += data->value;
posChanged = true;
@@ -244,12 +246,18 @@ void QEvdevMouseHandler::readMouseData()
posChanged = true;
} else if (data->code == ABS_WHEEL) { // vertical scroll
// data->value: 1 == up, -1 == down
- const int delta = 120 * data->value;
- emit handleWheelEvent(delta, Qt::Vertical);
+ if (data->value == 1)
+ delta.setY(120);
+ else
+ delta.setY(-120);
+ emit handleWheelEvent(delta);
} else if (data->code == ABS_THROTTLE) { // horizontal scroll
// data->value: 1 == right, -1 == left
- const int delta = 120 * -data->value;
- emit handleWheelEvent(delta, Qt::Horizontal);
+ if (data->value == 1)
+ delta.setX(-120);
+ else
+ delta.setX(120);
+ emit handleWheelEvent(delta);
}
} else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
// We care about touchpads only, not touchscreens -> don't map to button press.
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
index eb34334b12..6cad4b9173 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
@@ -53,6 +53,7 @@
#include <QObject>
#include <QString>
+#include <QPoint>
QT_BEGIN_NAMESPACE
@@ -65,12 +66,11 @@ public:
static QEvdevMouseHandler *create(const QString &device, const QString &specification);
~QEvdevMouseHandler();
+ void readMouseData();
+
signals:
void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons);
- void handleWheelEvent(int delta, Qt::Orientation orientation);
-
-private slots:
- void readMouseData();
+ void handleWheelEvent(QPoint delta);
private:
QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit);
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index b2f3fe5787..ba94bcd460 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -94,13 +94,19 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
for (const QString &device : devices)
addMouse(device);
- connect(m_deviceDiscovery, SIGNAL(deviceDetected(QString)), this, SLOT(addMouse(QString)));
- connect(m_deviceDiscovery, SIGNAL(deviceRemoved(QString)), this, SLOT(removeMouse(QString)));
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ this, &QEvdevMouseManager::addMouse);
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ this, &QEvdevMouseManager::removeMouse);
}
}
- connect(QGuiApplicationPrivate::inputDeviceManager(), SIGNAL(cursorPositionChangeRequested(QPoint)),
- this, SLOT(handleCursorPositionChange(QPoint)));
+ QInputDeviceManager *manager = QGuiApplicationPrivate::inputDeviceManager();
+ connect(manager, &QInputDeviceManager::cursorPositionChangeRequested, [=](const QPoint &pos) {
+ m_x = pos.x();
+ m_y = pos.y();
+ clampPosition();
+ });
}
QEvdevMouseManager::~QEvdevMouseManager()
@@ -144,20 +150,21 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto
QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, QGuiApplication::keyboardModifiers());
}
-void QEvdevMouseManager::handleWheelEvent(int delta, Qt::Orientation orientation)
+void QEvdevMouseManager::handleWheelEvent(QPoint delta)
{
QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
- QWindowSystemInterface::handleWheelEvent(0, pos, pos, delta, orientation, QGuiApplication::keyboardModifiers());
+ QWindowSystemInterface::handleWheelEvent(0, pos, pos, QPoint(), delta, QGuiApplication::keyboardModifiers());
}
void QEvdevMouseManager::addMouse(const QString &deviceNode)
{
qCDebug(qLcEvdevMouse) << "Adding mouse at" << deviceNode;
- QEvdevMouseHandler *handler;
- handler = QEvdevMouseHandler::create(deviceNode, m_spec);
+ QEvdevMouseHandler *handler = QEvdevMouseHandler::create(deviceNode, m_spec);
if (handler) {
- connect(handler, SIGNAL(handleMouseEvent(int,int,bool,Qt::MouseButtons)), this, SLOT(handleMouseEvent(int,int,bool,Qt::MouseButtons)));
- connect(handler, SIGNAL(handleWheelEvent(int,Qt::Orientation)), this, SLOT(handleWheelEvent(int,Qt::Orientation)));
+ connect(handler, &QEvdevMouseHandler::handleMouseEvent,
+ this, &QEvdevMouseManager::handleMouseEvent);
+ connect(handler, &QEvdevMouseHandler::handleWheelEvent,
+ this, &QEvdevMouseManager::handleWheelEvent);
m_mice.insert(deviceNode, handler);
QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
QInputDeviceManager::DeviceTypePointer, m_mice.count());
@@ -178,11 +185,4 @@ void QEvdevMouseManager::removeMouse(const QString &deviceNode)
}
}
-void QEvdevMouseManager::handleCursorPositionChange(const QPoint &pos)
-{
- m_x = pos.x();
- m_y = pos.y();
- clampPosition();
-}
-
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
index 08b5409d31..10703655b3 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
@@ -56,6 +56,7 @@
#include <QObject>
#include <QHash>
#include <QSocketNotifier>
+#include <QPoint>
QT_BEGIN_NAMESPACE
@@ -63,19 +64,15 @@ class QDeviceDiscovery;
class QEvdevMouseManager : public QObject
{
- Q_OBJECT
public:
QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent = 0);
~QEvdevMouseManager();
-public slots:
void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons);
- void handleWheelEvent(int delta, Qt::Orientation orientation);
+ void handleWheelEvent(QPoint delta);
-private slots:
void addMouse(const QString &deviceNode = QString());
void removeMouse(const QString &deviceNode);
- void handleCursorPositionChange(const QPoint &pos);
private:
void clampPosition();
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
index cfc17a79c3..dbab2f6a24 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
+++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
@@ -149,9 +149,11 @@ void QEvdevTabletData::report()
qreal pressure = pressureRange ? (state.p - minValues.p) / qreal(pressureRange) : qreal(1);
if (state.down || state.lastReportDown) {
- QWindowSystemInterface::handleTabletEvent(0, state.down, QPointF(), globalPos,
+ QWindowSystemInterface::handleTabletEvent(0, QPointF(), globalPos,
QTabletEvent::Stylus, pointer,
- pressure, 0, 0, 0, 0, 0, q->deviceId(), qGuiApp->keyboardModifiers());
+ state.down ? Qt::LeftButton : Qt::NoButton,
+ pressure, 0, 0, 0, 0, 0, q->deviceId(),
+ qGuiApp->keyboardModifiers());
}
if (state.lastReportTool && !state.tool)
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
index 20dfda89f7..8d848d6ebb 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
@@ -63,15 +63,12 @@ class QEvdevTabletData;
class QEvdevTabletHandler : public QObject
{
- Q_OBJECT
-
public:
explicit QEvdevTabletHandler(const QString &device, const QString &spec = QString(), QObject *parent = 0);
~QEvdevTabletHandler();
qint64 deviceId() const;
-private slots:
void readData();
private:
diff --git a/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp b/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp
index 4b00424e92..90949408ac 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp
+++ b/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp
@@ -88,8 +88,11 @@ QEvdevTabletManager::QEvdevTabletManager(const QString &key, const QString &spec
const QStringList devices = m_deviceDiscovery->scanConnectedDevices();
for (const QString &device : devices)
addDevice(device);
- connect(m_deviceDiscovery, SIGNAL(deviceDetected(QString)), this, SLOT(addDevice(QString)));
- connect(m_deviceDiscovery, SIGNAL(deviceRemoved(QString)), this, SLOT(removeDevice(QString)));
+
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ this, &QEvdevTabletManager::addDevice);
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ this, &QEvdevTabletManager::removeDevice);
}
}
}
diff --git a/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h b/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h
index d166c06cf3..cde91c55aa 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h
@@ -62,12 +62,10 @@ class QEvdevTabletHandlerThread;
class QEvdevTabletManager : public QObject
{
- Q_OBJECT
public:
QEvdevTabletManager(const QString &key, const QString &spec, QObject *parent = 0);
~QEvdevTabletManager();
-private slots:
void addDevice(const QString &deviceNode);
void removeDevice(const QString &deviceNode);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 11f7311bb7..df2c079f24 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -229,7 +229,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
if (m_fd >= 0) {
m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
- connect(m_notify, SIGNAL(activated(int)), this, SLOT(readData()));
+ connect(m_notify, &QSocketNotifier::activated, this, &QEvdevTouchScreenHandler::readData);
} else {
qErrnoWarning(errno, "evdevtouch: Cannot open input device %s", qPrintable(device));
return;
@@ -883,7 +883,7 @@ void QEvdevTouchScreenHandlerThread::filterAndSendTouchPoints()
}
QList<QWindowSystemInterface::TouchPoint> points = m_handler->d->m_touchPoints;
- const QList<QWindowSystemInterface::TouchPoint> &lastPoints = m_handler->d->m_lastTouchPoints;
+ QList<QWindowSystemInterface::TouchPoint> lastPoints = m_handler->d->m_lastTouchPoints;
m_handler->d->m_mutex.unlock();
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
index d22aca3266..a0b689a89e 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
@@ -82,7 +82,6 @@ public:
bool isFiltered() const;
-private slots:
void readData();
signals:
@@ -116,7 +115,6 @@ public:
bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
-public slots:
void scheduleTouchPointUpdate();
signals:
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
index ab71d08fb1..4cacbf03e5 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
@@ -88,8 +88,11 @@ QEvdevTouchManager::QEvdevTouchManager(const QString &key, const QString &specif
const QStringList devices = m_deviceDiscovery->scanConnectedDevices();
for (const QString &device : devices)
addDevice(device);
- connect(m_deviceDiscovery, SIGNAL(deviceDetected(QString)), this, SLOT(addDevice(QString)));
- connect(m_deviceDiscovery, SIGNAL(deviceRemoved(QString)), this, SLOT(removeDevice(QString)));
+
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ this, &QEvdevTouchManager::addDevice);
+ connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ this, &QEvdevTouchManager::removeDevice);
}
}
}
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
index 84e857ca57..e524c516f1 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
@@ -62,12 +62,10 @@ class QEvdevTouchScreenHandlerThread;
class QEvdevTouchManager : public QObject
{
- Q_OBJECT
public:
QEvdevTouchManager(const QString &key, const QString &spec, QObject *parent = 0);
~QEvdevTouchManager();
-private slots:
void addDevice(const QString &deviceNode);
void removeDevice(const QString &deviceNode);
diff --git a/src/platformsupport/input/libinput/qlibinputhandler.cpp b/src/platformsupport/input/libinput/qlibinputhandler.cpp
index 961eb3539f..733cf7d409 100644
--- a/src/platformsupport/input/libinput/qlibinputhandler.cpp
+++ b/src/platformsupport/input/libinput/qlibinputhandler.cpp
@@ -107,14 +107,17 @@ QLibInputHandler::QLibInputHandler(const QString &key, const QString &spec)
m_liFd = libinput_get_fd(m_li);
m_notifier.reset(new QSocketNotifier(m_liFd, QSocketNotifier::Read));
- connect(m_notifier.data(), SIGNAL(activated(int)), SLOT(onReadyRead()));
+
+ connect(m_notifier.data(), &QSocketNotifier::activated, this, &QLibInputHandler::onReadyRead);
m_pointer.reset(new QLibInputPointer);
m_keyboard.reset(new QLibInputKeyboard);
m_touch.reset(new QLibInputTouch);
- connect(QGuiApplicationPrivate::inputDeviceManager(), SIGNAL(cursorPositionChangeRequested(QPoint)),
- this, SLOT(onCursorPositionChangeRequested(QPoint)));
+ QInputDeviceManager *manager = QGuiApplicationPrivate::inputDeviceManager();
+ connect(manager, &QInputDeviceManager::cursorPositionChangeRequested, [=](const QPoint &pos) {
+ m_pointer->setPos(pos);
+ });
// Process the initial burst of DEVICE_ADDED events.
onReadyRead();
@@ -154,10 +157,6 @@ void QLibInputHandler::processEvent(libinput_event *ev)
// This is not just for hotplugging, it is also called for each input
// device libinput reads from on startup. Hence it is suitable for doing
// touch device registration.
- const char *sysname = libinput_device_get_sysname(dev); // node name without path
- const char *name = libinput_device_get_name(dev);
- emit deviceAdded(QString::fromUtf8(sysname), QString::fromUtf8(name));
-
QInputDeviceManagerPrivate *inputManagerPriv = QInputDeviceManagerPrivate::get(
QGuiApplicationPrivate::inputDeviceManager());
if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_TOUCH)) {
@@ -180,10 +179,6 @@ void QLibInputHandler::processEvent(libinput_event *ev)
}
case LIBINPUT_EVENT_DEVICE_REMOVED:
{
- const char *sysname = libinput_device_get_sysname(dev);
- const char *name = libinput_device_get_name(dev);
- emit deviceRemoved(QString::fromUtf8(sysname), QString::fromUtf8(name));
-
QInputDeviceManagerPrivate *inputManagerPriv = QInputDeviceManagerPrivate::get(
QGuiApplicationPrivate::inputDeviceManager());
if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_TOUCH)) {
@@ -236,9 +231,4 @@ void QLibInputHandler::processEvent(libinput_event *ev)
}
}
-void QLibInputHandler::onCursorPositionChangeRequested(const QPoint &pos)
-{
- m_pointer->setPos(pos);
-}
-
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/libinput/qlibinputhandler_p.h b/src/platformsupport/input/libinput/qlibinputhandler_p.h
index f3dcf0f0be..ac7a267a4d 100644
--- a/src/platformsupport/input/libinput/qlibinputhandler_p.h
+++ b/src/platformsupport/input/libinput/qlibinputhandler_p.h
@@ -68,19 +68,11 @@ class QLibInputTouch;
class QLibInputHandler : public QObject
{
- Q_OBJECT
-
public:
QLibInputHandler(const QString &key, const QString &spec);
~QLibInputHandler();
-signals:
- void deviceAdded(const QString &sysname, const QString &name);
- void deviceRemoved(const QString &sysname, const QString &name);
-
-private slots:
void onReadyRead();
- void onCursorPositionChangeRequested(const QPoint &pos);
private:
void processEvent(libinput_event *ev);
diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard_p.h b/src/platformsupport/input/libinput/qlibinputkeyboard_p.h
index 12a3eb06eb..b7ee8a363f 100644
--- a/src/platformsupport/input/libinput/qlibinputkeyboard_p.h
+++ b/src/platformsupport/input/libinput/qlibinputkeyboard_p.h
@@ -64,8 +64,6 @@ QT_BEGIN_NAMESPACE
class QLibInputKeyboard : public QObject
{
- Q_OBJECT
-
public:
QLibInputKeyboard();
~QLibInputKeyboard();
@@ -73,7 +71,6 @@ public:
void processKey(libinput_event_keyboard *e);
#ifndef QT_NO_XKBCOMMON_EVDEV
-private slots:
void handleRepeat();
private:
diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp
index bdeac8db7e..6879d0cd83 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer.cpp
+++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp
@@ -96,21 +96,28 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e)
void QLibInputPointer::processAxis(libinput_event_pointer *e)
{
+ double value; // default axis value is 15 degrees per wheel click
+ QPoint angleDelta;
#if !QT_CONFIG(libinput_axis_api)
- const double v = libinput_event_pointer_get_axis_value(e) * 120;
- const Qt::Orientation ori = libinput_event_pointer_get_axis(e) == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL
- ? Qt::Vertical : Qt::Horizontal;
- QWindowSystemInterface::handleWheelEvent(Q_NULLPTR, m_pos, m_pos, qRound(-v), ori, QGuiApplication::keyboardModifiers());
+ value = libinput_event_pointer_get_axis_value(e);
+ if (libinput_event_pointer_get_axis(e) == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL)
+ angleDelta.setY(qRound(value));
+ else
+ angleDelta.setX(qRound(value));
#else
if (libinput_event_pointer_has_axis(e, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL)) {
- const double v = libinput_event_pointer_get_axis_value(e, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL) * 120;
- QWindowSystemInterface::handleWheelEvent(Q_NULLPTR, m_pos, m_pos, qRound(-v), Qt::Vertical, QGuiApplication::keyboardModifiers());
+ value = libinput_event_pointer_get_axis_value(e, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
+ angleDelta.setY(qRound(value));
}
if (libinput_event_pointer_has_axis(e, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL)) {
- const double v = libinput_event_pointer_get_axis_value(e, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL) * 120;
- QWindowSystemInterface::handleWheelEvent(Q_NULLPTR, m_pos, m_pos, qRound(-v), Qt::Horizontal, QGuiApplication::keyboardModifiers());
+ value = libinput_event_pointer_get_axis_value(e, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
+ angleDelta.setX(qRound(value));
}
#endif
+ const int factor = 8;
+ angleDelta *= -factor;
+ Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers();
+ QWindowSystemInterface::handleWheelEvent(nullptr, m_pos, m_pos, QPoint(), angleDelta, mods);
}
void QLibInputPointer::setPos(const QPoint &pos)
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
index 669abab331..71b7633e6c 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp
+++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
@@ -330,11 +330,13 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
crtc_id,
physSize,
selected_mode,
+ selected_mode,
false,
drmModeGetCrtc(m_dri_fd, crtc_id),
modes,
connector->subpixel,
connectorProperty(connector, QByteArrayLiteral("DPMS")),
+ connectorPropertyBlob(connector, QByteArrayLiteral("EDID")),
false,
0,
false
@@ -382,6 +384,23 @@ drmModePropertyPtr QKmsDevice::connectorProperty(drmModeConnectorPtr connector,
return Q_NULLPTR;
}
+drmModePropertyBlobPtr QKmsDevice::connectorPropertyBlob(drmModeConnectorPtr connector, const QByteArray &name)
+{
+ drmModePropertyPtr prop;
+ drmModePropertyBlobPtr blob = nullptr;
+
+ for (int i = 0; i < connector->count_props && !blob; i++) {
+ prop = drmModeGetProperty(m_dri_fd, connector->props[i]);
+ if (!prop)
+ continue;
+ if ((prop->flags & DRM_MODE_PROP_BLOB) && (strcmp(prop->name, name.constData()) == 0))
+ blob = drmModeGetPropertyBlob(m_dri_fd, connector->prop_values[i]);
+ drmModeFreeProperty(prop);
+ }
+
+ return blob;
+}
+
QKmsDevice::QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path)
: m_screenConfig(screenConfig)
, m_path(path)
@@ -626,6 +645,11 @@ void QKmsOutput::cleanup(QKmsDevice *device)
dpms_prop = nullptr;
}
+ if (edid_blob) {
+ drmModeFreePropertyBlob(edid_blob);
+ edid_blob = nullptr;
+ }
+
restoreMode(device);
if (saved_crtc) {
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
index 35a51c18b1..964a0b1775 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h
+++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
@@ -100,12 +100,14 @@ struct QKmsOutput
uint32_t connector_id;
uint32_t crtc_id;
QSizeF physical_size;
+ int preferred_mode; // index of preferred mode in list below
int mode; // index of selected mode in list below
bool mode_set;
drmModeCrtcPtr saved_crtc;
QList<drmModeModeInfo> modes;
int subpixel;
drmModePropertyPtr dpms_prop;
+ drmModePropertyBlobPtr edid_blob;
bool wants_plane;
uint32_t plane_id;
bool plane_set;
@@ -153,6 +155,7 @@ protected:
drmModeConnectorPtr connector,
VirtualDesktopInfo *vinfo);
drmModePropertyPtr connectorProperty(drmModeConnectorPtr connector, const QByteArray &name);
+ drmModePropertyBlobPtr connectorPropertyBlob(drmModeConnectorPtr connector, const QByteArray &name);
QKmsScreenConfig *m_screenConfig;
QString m_path;
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 6561e95a0d..a936ec7aad 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -45,7 +45,7 @@
#include <qdbusreply.h>
#include <qclipboard.h>
-#include <qdebug.h>
+#include <QtCore/qloggingcategory.h>
#ifndef QT_NO_ACCESSIBILITY
#include "socket_interface.h"
@@ -65,8 +65,8 @@
QT_BEGIN_NAMESPACE
-static bool isDebugging = false;
-#define qAtspiDebug if (!::isDebugging); else qDebug
+Q_LOGGING_CATEGORY(lcAccessibilityAtspi, "qt.accessibility.atspi")
+Q_LOGGING_CATEGORY(lcAccessibilityAtspiCreation, "qt.accessibility.atspi.creation")
AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)
: QDBusVirtualObject(parent), m_dbus(connection)
@@ -128,8 +128,6 @@ AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)
, sendWindow_shade(0)
, sendWindow_unshade(0)
{
- ::isDebugging = qEnvironmentVariableIsSet("QT_DEBUG_ACCESSIBILITY");
-
m_applicationAdaptor = new QSpiApplicationAdaptor(m_dbus->connection(), this);
connect(m_applicationAdaptor, SIGNAL(windowActivated(QObject*,bool)), this, SLOT(windowActivated(QObject*,bool)));
@@ -140,9 +138,6 @@ AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)
success = success && m_dbus->connection().connect(QLatin1String("org.a11y.atspi.Registry"), QLatin1String("/org/a11y/atspi/registry"),
QLatin1String("org.a11y.atspi.Registry"), QLatin1String("EventListenerDeregistered"), this,
SLOT(eventListenerDeregistered(QString,QString)));
-#ifdef QT_ATSPI_DEBUG
- qAtspiDebug() << "Registered event listener change listener: " << success;
-#endif
}
AtSpiAdaptor::~AtSpiAdaptor()
@@ -589,7 +584,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
QAccessibleInterface * interface = interfaceFromPath(path);
if (!interface) {
- qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << path;
+ qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << path;
return QString();
}
@@ -698,7 +693,7 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
|| right.startsWith(QLatin1String("VisibledataChanged"))) { // typo in libatspi
sendObject_visible_data_changed = 1;
} else {
- qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: subscription string not handled:" << flag;
}
}
break;
@@ -744,7 +739,7 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
} else if (right.startsWith(QLatin1String("DesktopDestroy"))) {
// ignore this one
} else {
- qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: subscription string not handled:" << flag;
}
}
break;
@@ -763,7 +758,7 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
break;
}
default:
- qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: subscription string not handled:" << flag;
}
}
@@ -782,19 +777,19 @@ void AtSpiAdaptor::updateEventListeners()
setBitFlag(ev.eventName);
m_applicationAdaptor->sendEvents(!evList.isEmpty());
} else {
- qAtspiDebug("Could not query active accessibility event listeners.");
+ qCDebug(lcAccessibilityAtspi) << "Could not query active accessibility event listeners.";
}
}
void AtSpiAdaptor::eventListenerDeregistered(const QString &/*bus*/, const QString &/*path*/)
{
-// qAtspiDebug() << "AtSpiAdaptor::eventListenerDeregistered: " << bus << path;
+// qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::eventListenerDeregistered: " << bus << path;
updateEventListeners();
}
void AtSpiAdaptor::eventListenerRegistered(const QString &/*bus*/, const QString &/*path*/)
{
-// qAtspiDebug() << "AtSpiAdaptor::eventListenerRegistered: " << bus << path;
+// qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::eventListenerRegistered: " << bus << path;
updateEventListeners();
}
@@ -859,7 +854,7 @@ QAccessibleInterface *AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) c
QStringList parts = dbusPath.split(QLatin1Char('/'));
if (parts.size() != 6) {
- qAtspiDebug() << "invalid path: " << dbusPath;
+ qCDebug(lcAccessibilityAtspi) << "invalid path: " << dbusPath;
return 0;
}
@@ -868,7 +863,7 @@ QAccessibleInterface *AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) c
// The id is always in the range [INT_MAX+1, UINT_MAX]
if ((int)id >= 0)
- qWarning() << "No accessible object found for id: " << id;
+ qCWarning(lcAccessibilityAtspi) << "No accessible object found for id: " << id;
return QAccessible::accessibleInterface(id);
}
@@ -943,7 +938,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (sendObject || sendObject_text_changed) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface || !iface->textInterface()) {
- qAtspiDebug("Received text event for invalid interface.");
+ qCDebug(lcAccessibilityAtspi) << "Received text event for invalid interface.";
return;
}
QString path = pathForInterface(iface);
@@ -1001,7 +996,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (sendObject || sendObject_text_caret_moved) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface || !iface->textInterface()) {
- qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface;
+ qCWarning(lcAccessibilityAtspi) << "Sending TextCaretMoved from object that does not implement text interface: " << iface;
return;
}
@@ -1029,7 +1024,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface) {
- qWarning("ValueChanged event from invalid accessible.");
+ qCWarning(lcAccessibilityAtspi) << "ValueChanged event from invalid accessible.";
return;
}
if (iface->valueInterface()) {
@@ -1048,7 +1043,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
QLatin1String("SelectionChanged"), args2);
} else {
- qWarning() << "ValueChanged event and no ValueInterface or ComboBox: " << iface;
+ qCWarning(lcAccessibilityAtspi) << "ValueChanged event and no ValueInterface or ComboBox: " << iface;
}
}
break;
@@ -1058,7 +1053,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::Selection: {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface) {
- qWarning("Selection event from invalid accessible.");
+ qCWarning(lcAccessibilityAtspi) << "Selection event from invalid accessible.";
return;
}
QString path = pathForInterface(iface);
@@ -1075,7 +1070,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (stateChange.checked) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface) {
- qWarning("StateChanged event from invalid accessible.");
+ qCWarning(lcAccessibilityAtspi) << "StateChanged event from invalid accessible.";
return;
}
int checked = iface->state().checked;
@@ -1206,7 +1201,7 @@ void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *interface) const
// notify about the new child of our parent
QAccessibleInterface * parent = interface->parent();
if (!parent) {
- qAtspiDebug() << "AtSpiAdaptor::notifyAboutCreation: Could not find parent for " << interface->object();
+ qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::notifyAboutCreation: Could not find parent for " << interface->object();
return;
}
QString path = pathForInterface(interface);
@@ -1223,7 +1218,7 @@ void AtSpiAdaptor::notifyAboutDestruction(QAccessibleInterface *interface) const
QAccessibleInterface * parent = interface->parent();
if (!parent) {
- qAtspiDebug() << "AtSpiAdaptor::notifyAboutDestruction: Could not find parent for " << interface->object();
+ qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::notifyAboutDestruction: Could not find parent for " << interface->object();
return;
}
QString path = pathForInterface(interface);
@@ -1251,18 +1246,18 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
// get accessible interface
QAccessibleInterface * accessible = interfaceFromPath(message.path());
if (!accessible) {
- qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << message.path();
return false;
}
if (!accessible->isValid()) {
- qWarning() << "WARNING Qt AtSpiAdaptor: Accessible invalid: " << accessible << message.path();
+ qCWarning(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Accessible invalid: " << accessible << message.path();
return false;
}
QString interface = message.interface();
QString function = message.member();
- // qAtspiDebug() << "AtSpiAdaptor::handleMessage: " << interface << function;
+ // qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::handleMessage: " << interface << function;
if (function == QLatin1String("Introspect")) {
//introspect(message.path());
@@ -1294,7 +1289,7 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_TABLE))
return tableInterface(accessible, function, message, connection);
- qAtspiDebug() << "AtSpiAdaptor::handleMessage with unknown interface: " << message.path() << interface << function;
+ qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::handleMessage with unknown interface: " << message.path() << interface << function;
return false;
}
@@ -1302,7 +1297,7 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
if (message.path() != QLatin1String(ATSPI_DBUS_PATH_ROOT)) {
- qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find application interface for: " << message.path() << interface;
+ qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find application interface for: " << message.path() << interface;
return false;
}
@@ -1333,7 +1328,7 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q
QDBusMessage reply = message.createReply(QVariant::fromValue(QLocale().name()));
return connection.send(reply);
}
- qAtspiDebug() << "AtSpiAdaptor::applicationInterface " << message.path() << interface << function;
+ qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::applicationInterface " << message.path() << interface << function;
return false;
}
@@ -1354,7 +1349,7 @@ void AtSpiAdaptor::registerApplication()
const QSpiObjectReference &socket = reply.value();
accessibilityRegistry = QSpiObjectReference(socket);
} else {
- qAtspiDebug() << "Error in contacting registry: "
+ qCDebug(lcAccessibilityAtspi) << "Error in contacting registry: "
<< reply.error().name()
<< reply.error().message();
}
@@ -1380,7 +1375,7 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
if (parent) {
childIndex = parent->indexOfChild(interface);
if (childIndex < 0) {
- qAtspiDebug() << "GetIndexInParent get invalid index: " << childIndex << interface;
+ qCDebug(lcAccessibilityAtspi) << "GetIndexInParent get invalid index: " << childIndex << interface;
}
}
sendReply(connection, message, childIndex);
@@ -1445,7 +1440,7 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
}
connection.send(message.createReply(QVariant::fromValue(children)));
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::accessibleInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::accessibleInterface does not implement " << function << message.path();
return false;
}
return true;
@@ -1458,14 +1453,10 @@ AtspiRole AtSpiAdaptor::getRole(QAccessibleInterface *interface) const
return qSpiRoleMapping[interface->role()].spiRole();
}
-//#define ACCESSIBLE_CREATION_DEBUG
-
QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface) const
{
QStringList ifaces;
-#ifdef ACCESSIBLE_CREATION_DEBUG
- qAtspiDebug() << "AtSpiAdaptor::accessibleInterfaces create: " << interface->object();
-#endif
+ qCDebug(lcAccessibilityAtspiCreation) << "AtSpiAdaptor::accessibleInterfaces create: " << interface->object();
ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_ACCESSIBLE);
if ( (!interface->rect().isEmpty()) ||
@@ -1477,12 +1468,9 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
(interface->object() && interface->object()->inherits("QSGItem"))
) {
ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT);
- }
-#ifdef ACCESSIBLE_CREATION_DEBUG
- else {
- qAtspiDebug(" IS NOT a component");
+ } else {
+ qCDebug(lcAccessibilityAtspiCreation) << " IS NOT a component";
}
-#endif
if (interface->role() == QAccessible::Application)
ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_APPLICATION);
@@ -1536,7 +1524,7 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const
Q_ASSERT(object);
if (inheritsQAction(object)) {
- qAtspiDebug("AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.");
+ qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.";
}
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(object);
@@ -1667,21 +1655,21 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt
// int width = message.arguments().at(2).toInt();
// int height = message.arguments().at(3).toInt();
// uint coordinateType = message.arguments().at(4).toUInt();
- qAtspiDebug("SetExtents is not implemented.");
+ qCDebug(lcAccessibilityAtspi) << "SetExtents is not implemented.";
sendReply(connection, message, false);
} else if (function == QLatin1String("SetPosition")) {
// int x = message.arguments().at(0).toInt();
// int y = message.arguments().at(1).toInt();
// uint coordinateType = message.arguments().at(2).toUInt();
- qAtspiDebug("SetPosition is not implemented.");
+ qCDebug(lcAccessibilityAtspi) << "SetPosition is not implemented.";
sendReply(connection, message, false);
} else if (function == QLatin1String("SetSize")) {
// int width = message.arguments().at(0).toInt();
// int height = message.arguments().at(1).toInt();
- qAtspiDebug("SetSize is not implemented.");
+ qCDebug(lcAccessibilityAtspi) << "SetSize is not implemented.";
sendReply(connection, message, false);
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path();
return false;
}
return true;
@@ -1743,7 +1731,7 @@ bool AtSpiAdaptor::actionInterface(QAccessibleInterface *interface, const QStrin
else
sendReply(connection, message, QString());
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::actionInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::actionInterface does not implement " << function << message.path();
return false;
}
return true;
@@ -1815,7 +1803,7 @@ bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString
Q_UNUSED(x) Q_UNUSED (y) Q_UNUSED(width)
Q_UNUSED(height) Q_UNUSED(coordType)
Q_UNUSED(xClipType) Q_UNUSED(yClipType)
- qAtspiDebug("Not implemented: QSpiAdaptor::GetBoundedRanges");
+ qCDebug(lcAccessibilityAtspi) << "Not implemented: QSpiAdaptor::GetBoundedRanges";
sendReply(connection, message, QVariant::fromValue(QSpiTextRangeList()));
} else if (function == QLatin1String("GetCharacterAtOffset")) {
int offset = message.arguments().at(0).toInt();
@@ -1834,7 +1822,7 @@ bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString
} else if (function == QLatin1String("GetNSelections")) {
sendReply(connection, message, interface->textInterface()->selectionCount());
} else if (function == QLatin1String("GetOffsetAtPoint")) {
- qAtspiDebug() << message.signature();
+ qCDebug(lcAccessibilityAtspi) << message.signature();
Q_ASSERT(!message.signature().isEmpty());
QPoint point(message.arguments().at(0).toInt(), message.arguments().at(1).toInt());
uint coordType = message.arguments().at(2).toUInt();
@@ -1903,7 +1891,7 @@ bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString
interface->textInterface()->setSelection(selectionNum, startOffset, endOffset);
sendReply(connection, message, true);
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::textInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::textInterface does not implement " << function << message.path();
return false;
}
return true;
@@ -1979,7 +1967,7 @@ namespace
value != QLatin1String("center")
) {
value = QString();
- qAtspiDebug() << "Unknown text-align attribute value \"" << value << "\" cannot be translated to AT-SPI.";
+ qCDebug(lcAccessibilityAtspi) << "Unknown text-align attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
}
} else if (ia2Name == QLatin1String("font-size")) {
@@ -1992,7 +1980,7 @@ namespace
value != QLatin1String("oblique")
) {
value = QString();
- qAtspiDebug() << "Unknown font-style attribute value \"" << value << "\" cannot be translated to AT-SPI.";
+ qCDebug(lcAccessibilityAtspi) << "Unknown font-style attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
} else if (ia2Name == QLatin1String("text-underline-type")) {
name = QStringLiteral("underline");
@@ -2001,7 +1989,7 @@ namespace
value != QLatin1String("double")
) {
value = QString();
- qAtspiDebug() << "Unknown text-underline-type attribute value \"" << value << "\" cannot be translated to AT-SPI.";
+ qCDebug(lcAccessibilityAtspi) << "Unknown text-underline-type attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
} else if (ia2Name == QLatin1String("font-weight")) {
name = QStringLiteral("weight");
@@ -2017,7 +2005,7 @@ namespace
value != QLatin1String("sub")
) {
value = QString();
- qAtspiDebug() << "Unknown text-position attribute value \"" << value << "\" cannot be translated to AT-SPI.";
+ qCDebug(lcAccessibilityAtspi) << "Unknown text-position attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
} else if (ia2Name == QLatin1String("writing-mode")) {
name = QStringLiteral("direction");
@@ -2028,10 +2016,10 @@ namespace
else if (value == QLatin1String("tb")) {
// IAccessible2 docs refer to XSL, which specifies "tb" is shorthand for "tb-rl"; so at least give a hint about the horizontal direction (ATK does not support vertical direction in this attribute (yet))
value = QStringLiteral("rtl");
- qAtspiDebug() << "writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored";
+ qCDebug(lcAccessibilityAtspi) << "writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored";
} else {
value = QString();
- qAtspiDebug() << "Unknown writing-mode attribute value \"" << value << "\" cannot be translated to AT-SPI.";
+ qCDebug(lcAccessibilityAtspi) << "Unknown writing-mode attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
} else if (ia2Name == QLatin1String("language")) {
// OK - ATK has no docs on the format of the value, IAccessible2 has reasonable format - leave it at that now
@@ -2223,7 +2211,7 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const
} else if (function == QLatin1String("")) {
connection.send(message.createReply());
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::editableTextInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::editableTextInterface does not implement " << function << message.path();
return false;
}
return true;
@@ -2254,11 +2242,11 @@ bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString
else if (function == QLatin1String("GetMinimumValue"))
value = valueIface->minimumValue();
else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path();
return false;
}
if (!value.canConvert(QVariant::Double)) {
- qAtspiDebug() << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function;
+ qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function;
}
// explicitly convert to dbus-variant containing one double since atspi expects that
@@ -2273,7 +2261,7 @@ bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString
bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
if (!(interface->tableInterface() || interface->tableCellInterface())) {
- qAtspiDebug() << "WARNING Qt AtSpiAdaptor: Could not find table interface for: " << message.path() << interface;
+ qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find table interface for: " << message.path() << interface;
return false;
}
@@ -2311,7 +2299,7 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
(column < 0) ||
(row >= interface->tableInterface()->rowCount()) ||
(column >= interface->tableInterface()->columnCount())) {
- qAtspiDebug() << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ')';
+ qCDebug(lcAccessibilityAtspi) << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ')';
return false;
}
@@ -2320,7 +2308,7 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
if (cell) {
ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(cell)));
} else {
- qAtspiDebug() << "WARNING: no cell interface returned for " << interface->object() << row << column;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: no cell interface returned for " << interface->object() << row << column;
ref = QSpiObjectReference();
}
connection.send(message.createReply(QVariant::fromValue(ref)));
@@ -2330,11 +2318,11 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
int column = message.arguments().at(1).toInt();
QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, column);
if (!cell) {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell. " << interface;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell. " << interface;
return false;
}
int index = interface->indexOfChild(cell);
- qAtspiDebug() << "QSpiAdaptor::GetIndexAt row:" << row << " col:" << column << " logical index:" << index;
+ qCDebug(lcAccessibilityAtspi) << "QSpiAdaptor::GetIndexAt row:" << row << " col:" << column << " logical index:" << index;
Q_ASSERT(index > 0);
connection.send(message.createReply(index));
} else if ((function == QLatin1String("GetColumnAtIndex")) || (function == QLatin1String("GetRowAtIndex"))) {
@@ -2350,7 +2338,7 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
ret = -1;
} else {
if (!cell->tableCellInterface()) {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
return false;
}
ret = cell->tableCellInterface()->columnIndex();
@@ -2362,14 +2350,14 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
ret = index % interface->tableInterface()->columnCount();
} else {
if (!cell->tableCellInterface()) {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
return false;
}
ret = cell->tableCellInterface()->rowIndex();
}
}
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::" << function << " No cell at index: " << index << interface;
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::" << function << " No cell at index: " << index << interface;
return false;
}
}
@@ -2475,7 +2463,7 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
int row = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->unselectRow(row)));
} else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::tableInterface does not implement " << function << message.path();
+ qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::tableInterface does not implement " << function << message.path();
return false;
}
return true;
diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
index dbaaf524e8..b24491b187 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company 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.
@@ -101,7 +101,7 @@ QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore()
ctx->makeCurrent(tempSurface.data());
}
- if (ctx && m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup())
+ if (m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup())
glDeleteTextures(1, &m_bsTexture);
else
qWarning("QOpenGLCompositorBackingStore: Texture is not valid in the current context");
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 7db6de78b4..5549984d6a 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -2,6 +2,7 @@ TEMPLATE = subdirs
QT_FOR_CONFIG += gui-private
SUBDIRS = \
+ edid \
eventdispatchers \
devicediscovery \
fbconvenience \
@@ -39,6 +40,7 @@ darwin {
SUBDIRS += \
clipboard \
graphics
- macos: \
- SUBDIRS += cglconvenience
}
+
+qtConfig(vulkan): \
+ SUBDIRS += vkconvenience
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp
index 4b099e5c0e..51c690d43a 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp
@@ -50,9 +50,8 @@ Q_LOGGING_CATEGORY(qLcMenu, "qt.qpa.menu")
static int nextDBusID = 1;
QHash<int, QDBusPlatformMenuItem *> menuItemsByID;
-QDBusPlatformMenuItem::QDBusPlatformMenuItem(quintptr tag)
- : m_tag(tag ? tag : reinterpret_cast<quintptr>(this)) // QMenu will overwrite this later
- , m_subMenu(Q_NULLPTR)
+QDBusPlatformMenuItem::QDBusPlatformMenuItem()
+ : m_subMenu(nullptr)
, m_role(NoRole)
, m_isEnabled(true)
, m_isVisible(true)
@@ -72,11 +71,6 @@ QDBusPlatformMenuItem::~QDBusPlatformMenuItem()
static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(Q_NULLPTR);
}
-void QDBusPlatformMenuItem::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
void QDBusPlatformMenuItem::setText(const QString &text)
{
qCDebug(qLcMenu) << m_dbusID << text;
@@ -167,9 +161,8 @@ QList<const QDBusPlatformMenuItem *> QDBusPlatformMenuItem::byIds(const QList<in
}
-QDBusPlatformMenu::QDBusPlatformMenu(quintptr tag)
- : m_tag(tag ? tag : reinterpret_cast<quintptr>(this))
- , m_isEnabled(true)
+QDBusPlatformMenu::QDBusPlatformMenu()
+ : m_isEnabled(true)
, m_isVisible(true)
, m_revision(1)
, m_containingMenuItem(Q_NULLPTR)
@@ -252,11 +245,6 @@ void QDBusPlatformMenu::emitUpdated()
emit updated(++m_revision, 0);
}
-void QDBusPlatformMenu::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
void QDBusPlatformMenu::setText(const QString &text)
{
m_text = text;
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h
index 49b7316d11..5458e2fdd5 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h
@@ -73,12 +73,9 @@ class QDBusPlatformMenuItem : public QPlatformMenuItem
Q_OBJECT
public:
- QDBusPlatformMenuItem(quintptr tag = 0LL);
+ QDBusPlatformMenuItem();
~QDBusPlatformMenuItem();
- quintptr tag()const Q_DECL_OVERRIDE { return m_tag; }
- void setTag(quintptr tag) Q_DECL_OVERRIDE;
-
const QString text() const { return m_text; }
void setText(const QString &text) Q_DECL_OVERRIDE;
QIcon icon() const { return m_icon; }
@@ -110,13 +107,10 @@ public:
void trigger();
- bool operator==(const QDBusPlatformMenuItem& other) { return m_tag == other.m_tag; }
-
static QDBusPlatformMenuItem *byId(int id);
static QList<const QDBusPlatformMenuItem *> byIds(const QList<int> &ids);
private:
- quintptr m_tag;
QString m_text;
QIcon m_icon;
QPlatformMenu *m_subMenu;
@@ -137,7 +131,7 @@ class QDBusPlatformMenu : public QPlatformMenu
Q_OBJECT
public:
- QDBusPlatformMenu(quintptr tag = 0LL);
+ QDBusPlatformMenu();
~QDBusPlatformMenu();
void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
@@ -145,9 +139,6 @@ public:
void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE { Q_UNUSED(enable); }
- quintptr tag()const Q_DECL_OVERRIDE { return m_tag; }
- void setTag(quintptr tag) Q_DECL_OVERRIDE;
-
const QString text() const { return m_text; }
void setText(const QString &text) Q_DECL_OVERRIDE;
QIcon icon() const { return m_icon; }
@@ -172,8 +163,6 @@ public:
QPlatformMenuItem *createMenuItem() const Q_DECL_OVERRIDE;
QPlatformMenu *createSubMenu() const Q_DECL_OVERRIDE;
- bool operator==(const QDBusPlatformMenu& other) { return m_tag == other.m_tag; }
-
uint revision() const { return m_revision; }
void emitUpdated();
@@ -184,7 +173,6 @@ signals:
void popupRequested(int id, uint timestamp);
private:
- quintptr m_tag;
QString m_text;
QIcon m_icon;
bool m_isEnabled;
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustraytypes.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustraytypes.cpp
index fc0fa00655..fc49fcbea9 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustraytypes.cpp
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustraytypes.cpp
@@ -104,7 +104,7 @@ QXdgDBusImageVector iconToQXdgDBusImageVector(const QIcon &icon)
}
// copy and endian-convert
QXdgDBusImageStruct kim(im.width(), im.height());
- const uchar *end = im.constBits() + im.byteCount();
+ const uchar *end = im.constBits() + im.sizeInBytes();
uchar *dest = reinterpret_cast<uchar *>(kim.data.data());
for (const uchar *src = im.constBits(); src < end; src += 4, dest += 4)
qToUnaligned(qToBigEndian<quint32>(qFromUnaligned<quint32>(src)), dest);
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 323e8fd13b..be0fac4b55 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -87,14 +87,6 @@ void ResourceHelper::clear()
std::fill(fonts, fonts + QPlatformTheme::NFonts, static_cast<QFont *>(0));
}
-/*!
- \class QGenericX11ThemeQKdeTheme
- \brief QGenericX11Theme is a generic theme implementation for X11.
- \since 5.0
- \internal
- \ingroup qpa
-*/
-
const char *QGenericUnixTheme::name = "generic";
// Default system font, corresponding to the value returned by 4.8 for
diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
new file mode 100644
index 0000000000..1a2a07260a
--- /dev/null
+++ b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
@@ -0,0 +1,357 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 "qbasicvulkanplatforminstance_p.h"
+#include <QLibrary>
+#include <QCoreApplication>
+#include <QVector>
+#include <QLoggingCategory>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcVk, "qt.vulkan")
+
+/*!
+ \class QBasicPlatformVulkanInstance
+ \brief A generic platform Vulkan instance implementation.
+ \since 5.10
+ \internal
+ \ingroup qpa
+
+ Implements QPlatformVulkanInstance, serving as a base for platform-specific
+ implementations. The library loading and any WSI-specifics are excluded.
+
+ Subclasses are expected to call init() from their constructor and
+ initInstance() from their createOrAdoptInstance() implementation.
+ */
+
+QBasicPlatformVulkanInstance::QBasicPlatformVulkanInstance()
+ : m_vkInst(VK_NULL_HANDLE),
+ m_vkGetInstanceProcAddr(nullptr),
+ m_ownsVkInst(false),
+ m_errorCode(VK_SUCCESS),
+ m_debugCallback(0)
+{
+}
+
+QBasicPlatformVulkanInstance::~QBasicPlatformVulkanInstance()
+{
+ if (!m_vkInst)
+ return;
+
+ if (m_debugCallback && m_vkDestroyDebugReportCallbackEXT)
+ m_vkDestroyDebugReportCallbackEXT(m_vkInst, m_debugCallback, nullptr);
+
+ if (m_ownsVkInst)
+ m_vkDestroyInstance(m_vkInst, nullptr);
+}
+
+void QBasicPlatformVulkanInstance::init(QLibrary *lib)
+{
+ if (m_vkGetInstanceProcAddr)
+ return;
+
+ qCDebug(lcVk, "Vulkan init (%s)", qPrintable(lib->fileName()));
+
+ // While not strictly required with every implementation, try to follow the spec
+ // and do not rely on core functions being exported.
+ //
+ // 1. dlsym vkGetInstanceProcAddr
+ // 2. with a special null instance resolve vkCreateInstance and vkEnumerateInstance*
+ // 3. all other core functions are resolved with the created instance
+
+ m_vkGetInstanceProcAddr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(lib->resolve("vkGetInstanceProcAddr"));
+ if (!m_vkGetInstanceProcAddr) {
+ qWarning("Failed to find vkGetInstanceProcAddr");
+ return;
+ }
+
+ m_vkCreateInstance = reinterpret_cast<PFN_vkCreateInstance>(m_vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkCreateInstance"));
+ if (!m_vkCreateInstance) {
+ qWarning("Failed to find vkCreateInstance");
+ return;
+ }
+ m_vkEnumerateInstanceLayerProperties = reinterpret_cast<PFN_vkEnumerateInstanceLayerProperties>(
+ m_vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceLayerProperties"));
+ if (!m_vkEnumerateInstanceLayerProperties) {
+ qWarning("Failed to find vkEnumerateInstanceLayerProperties");
+ return;
+ }
+ m_vkEnumerateInstanceExtensionProperties = reinterpret_cast<PFN_vkEnumerateInstanceExtensionProperties>(
+ m_vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"));
+ if (!m_vkEnumerateInstanceExtensionProperties) {
+ qWarning("Failed to find vkEnumerateInstanceExtensionProperties");
+ return;
+ }
+
+ uint32_t layerCount = 0;
+ m_vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
+ if (layerCount) {
+ QVector<VkLayerProperties> layerProps(layerCount);
+ m_vkEnumerateInstanceLayerProperties(&layerCount, layerProps.data());
+ m_supportedLayers.reserve(layerCount);
+ for (const VkLayerProperties &p : qAsConst(layerProps)) {
+ QVulkanLayer layer;
+ layer.name = p.layerName;
+ layer.version = p.implementationVersion;
+ layer.specVersion = QVersionNumber(VK_VERSION_MAJOR(p.specVersion),
+ VK_VERSION_MINOR(p.specVersion),
+ VK_VERSION_PATCH(p.specVersion));
+ layer.description = p.description;
+ m_supportedLayers.append(layer);
+ }
+ }
+ qCDebug(lcVk) << "Supported Vulkan instance layers:" << m_supportedLayers;
+
+ uint32_t extCount = 0;
+ m_vkEnumerateInstanceExtensionProperties(nullptr, &extCount, nullptr);
+ if (extCount) {
+ QVector<VkExtensionProperties> extProps(extCount);
+ m_vkEnumerateInstanceExtensionProperties(nullptr, &extCount, extProps.data());
+ m_supportedExtensions.reserve(extCount);
+ for (const VkExtensionProperties &p : qAsConst(extProps)) {
+ QVulkanExtension ext;
+ ext.name = p.extensionName;
+ ext.version = p.specVersion;
+ m_supportedExtensions.append(ext);
+ }
+ }
+ qDebug(lcVk) << "Supported Vulkan instance extensions:" << m_supportedExtensions;
+}
+
+QVulkanInfoVector<QVulkanLayer> QBasicPlatformVulkanInstance::supportedLayers() const
+{
+ return m_supportedLayers;
+}
+
+QVulkanInfoVector<QVulkanExtension> QBasicPlatformVulkanInstance::supportedExtensions() const
+{
+ return m_supportedExtensions;
+}
+
+void QBasicPlatformVulkanInstance::initInstance(QVulkanInstance *instance, const QByteArrayList &extraExts)
+{
+ if (!m_vkGetInstanceProcAddr) {
+ qWarning("initInstance: No Vulkan library available");
+ return;
+ }
+
+ m_vkInst = instance->vkInstance(); // when non-null we are adopting an existing instance
+
+ QVulkanInstance::Flags flags = instance->flags();
+ m_enabledLayers = instance->layers();
+ m_enabledExtensions = instance->extensions();
+
+ if (!m_vkInst) {
+ VkApplicationInfo appInfo;
+ memset(&appInfo, 0, sizeof(appInfo));
+ appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
+ QByteArray appName = QCoreApplication::applicationName().toUtf8();
+ appInfo.pApplicationName = appName.constData();
+ const QVersionNumber apiVersion = instance->apiVersion();
+ if (!apiVersion.isNull()) {
+ appInfo.apiVersion = VK_MAKE_VERSION(apiVersion.majorVersion(),
+ apiVersion.minorVersion(),
+ apiVersion.microVersion());
+ }
+
+ if (!flags.testFlag(QVulkanInstance::NoDebugOutputRedirect))
+ m_enabledExtensions.append("VK_EXT_debug_report");
+
+ m_enabledExtensions.append("VK_KHR_surface");
+
+ for (const QByteArray &ext : extraExts)
+ m_enabledExtensions.append(ext);
+
+ // No clever stuff with QSet and friends: the order for layers matters
+ // and the user-provided order must be kept.
+ for (int i = 0; i < m_enabledLayers.count(); ++i) {
+ const QByteArray &layerName(m_enabledLayers[i]);
+ if (!m_supportedLayers.contains(layerName))
+ m_enabledLayers.removeAt(i--);
+ }
+ qDebug(lcVk) << "Enabling Vulkan instance layers:" << m_enabledLayers;
+ for (int i = 0; i < m_enabledExtensions.count(); ++i) {
+ const QByteArray &extName(m_enabledExtensions[i]);
+ if (!m_supportedExtensions.contains(extName))
+ m_enabledExtensions.removeAt(i--);
+ }
+ qDebug(lcVk) << "Enabling Vulkan instance extensions:" << m_enabledExtensions;
+
+ VkInstanceCreateInfo instInfo;
+ memset(&instInfo, 0, sizeof(instInfo));
+ instInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
+ instInfo.pApplicationInfo = &appInfo;
+
+ QVector<const char *> layerNameVec;
+ for (const QByteArray &ba : qAsConst(m_enabledLayers))
+ layerNameVec.append(ba.constData());
+ if (!layerNameVec.isEmpty()) {
+ instInfo.enabledLayerCount = layerNameVec.count();
+ instInfo.ppEnabledLayerNames = layerNameVec.constData();
+ }
+
+ QVector<const char *> extNameVec;
+ for (const QByteArray &ba : qAsConst(m_enabledExtensions))
+ extNameVec.append(ba.constData());
+ if (!extNameVec.isEmpty()) {
+ instInfo.enabledExtensionCount = extNameVec.count();
+ instInfo.ppEnabledExtensionNames = extNameVec.constData();
+ }
+
+ m_errorCode = m_vkCreateInstance(&instInfo, nullptr, &m_vkInst);
+ if (m_errorCode != VK_SUCCESS || !m_vkInst) {
+ qWarning("Failed to create Vulkan instance: %d", m_errorCode);
+ return;
+ }
+
+ m_vkDestroyInstance = reinterpret_cast<PFN_vkDestroyInstance>(m_vkGetInstanceProcAddr(m_vkInst, "vkDestroyInstance"));
+ if (!m_vkDestroyInstance) {
+ qWarning("Failed to find vkDestroyInstance");
+ m_vkInst = VK_NULL_HANDLE;
+ return;
+ }
+
+ m_ownsVkInst = true;
+ }
+
+ m_getPhysDevSurfaceSupport = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkGetPhysicalDeviceSurfaceSupportKHR"));
+ if (!m_getPhysDevSurfaceSupport)
+ qWarning("Failed to find vkGetPhysicalDeviceSurfaceSupportKHR");
+
+ if (!flags.testFlag(QVulkanInstance::NoDebugOutputRedirect))
+ setupDebugOutput();
+}
+
+bool QBasicPlatformVulkanInstance::isValid() const
+{
+ return m_vkInst != VK_NULL_HANDLE;
+}
+
+VkResult QBasicPlatformVulkanInstance::errorCode() const
+{
+ return m_errorCode;
+}
+
+VkInstance QBasicPlatformVulkanInstance::vkInstance() const
+{
+ return m_vkInst;
+}
+
+QByteArrayList QBasicPlatformVulkanInstance::enabledLayers() const
+{
+ return m_enabledLayers;
+}
+
+QByteArrayList QBasicPlatformVulkanInstance::enabledExtensions() const
+{
+ return m_enabledExtensions;
+}
+
+PFN_vkVoidFunction QBasicPlatformVulkanInstance::getInstanceProcAddr(const char *name)
+{
+ if (!name)
+ return nullptr;
+
+ const bool needsNullInstance = !strcmp(name, "vkEnumerateInstanceLayerProperties")
+ || !strcmp(name, "vkEnumerateInstanceExtensionProperties");
+
+ return m_vkGetInstanceProcAddr(needsNullInstance ? 0 : m_vkInst, name);
+}
+
+bool QBasicPlatformVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice,
+ uint32_t queueFamilyIndex,
+ QWindow *window)
+{
+ if (!m_getPhysDevSurfaceSupport)
+ return true;
+
+ VkSurfaceKHR surface = QVulkanInstance::surfaceForWindow(window);
+ VkBool32 supported = false;
+ m_getPhysDevSurfaceSupport(physicalDevice, queueFamilyIndex, surface, &supported);
+
+ return supported;
+}
+
+static VKAPI_ATTR VkBool32 VKAPI_CALL defaultDebugCallbackFunc(VkDebugReportFlagsEXT flags,
+ VkDebugReportObjectTypeEXT objectType,
+ uint64_t object,
+ size_t location,
+ int32_t messageCode,
+ const char *pLayerPrefix,
+ const char *pMessage,
+ void *pUserData)
+{
+ Q_UNUSED(flags);
+ Q_UNUSED(objectType);
+ Q_UNUSED(object);
+ Q_UNUSED(location);
+ Q_UNUSED(pUserData);
+
+ // not categorized, just route to plain old qDebug
+ qDebug("vkDebug: %s: %d: %s", pLayerPrefix, messageCode, pMessage);
+
+ return VK_FALSE;
+}
+
+void QBasicPlatformVulkanInstance::setupDebugOutput()
+{
+ if (!m_enabledExtensions.contains("VK_EXT_debug_report"))
+ return;
+
+ PFN_vkCreateDebugReportCallbackEXT createDebugReportCallback = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkCreateDebugReportCallbackEXT"));
+ m_vkDestroyDebugReportCallbackEXT = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkDestroyDebugReportCallbackEXT"));
+
+ VkDebugReportCallbackCreateInfoEXT dbgCallbackInfo;
+ memset(&dbgCallbackInfo, 0, sizeof(dbgCallbackInfo));
+ dbgCallbackInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
+ dbgCallbackInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT
+ | VK_DEBUG_REPORT_WARNING_BIT_EXT
+ | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
+ dbgCallbackInfo.pfnCallback = defaultDebugCallbackFunc;
+
+ VkResult err = createDebugReportCallback(m_vkInst, &dbgCallbackInfo, nullptr, &m_debugCallback);
+ if (err != VK_SUCCESS)
+ qWarning("Failed to create debug report callback: %d", err);
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
new file mode 100644
index 0000000000..748b138f01
--- /dev/null
+++ b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QBASICVULKANPLATFORMINSTANCE_P_H
+#define QBASICVULKANPLATFORMINSTANCE_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 <qpa/qplatformvulkaninstance.h>
+
+QT_BEGIN_NAMESPACE
+
+class QLibrary;
+
+class QBasicPlatformVulkanInstance : public QPlatformVulkanInstance
+{
+public:
+ QBasicPlatformVulkanInstance();
+ ~QBasicPlatformVulkanInstance();
+
+ QVulkanInfoVector<QVulkanLayer> supportedLayers() const override;
+ QVulkanInfoVector<QVulkanExtension> supportedExtensions() const override;
+ bool isValid() const override;
+ VkResult errorCode() const override;
+ VkInstance vkInstance() const override;
+ QByteArrayList enabledLayers() const override;
+ QByteArrayList enabledExtensions() const override;
+ PFN_vkVoidFunction getInstanceProcAddr(const char *name) override;
+ bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override;
+
+protected:
+ void init(QLibrary *lib);
+ void initInstance(QVulkanInstance *instance, const QByteArrayList &extraExts);
+
+ VkInstance m_vkInst;
+ PFN_vkGetInstanceProcAddr m_vkGetInstanceProcAddr;
+ PFN_vkGetPhysicalDeviceSurfaceSupportKHR m_getPhysDevSurfaceSupport;
+
+private:
+ void setupDebugOutput();
+
+ bool m_ownsVkInst;
+ VkResult m_errorCode;
+ QVulkanInfoVector<QVulkanLayer> m_supportedLayers;
+ QVulkanInfoVector<QVulkanExtension> m_supportedExtensions;
+ QByteArrayList m_enabledLayers;
+ QByteArrayList m_enabledExtensions;
+
+ PFN_vkCreateInstance m_vkCreateInstance;
+ PFN_vkEnumerateInstanceLayerProperties m_vkEnumerateInstanceLayerProperties;
+ PFN_vkEnumerateInstanceExtensionProperties m_vkEnumerateInstanceExtensionProperties;
+
+ PFN_vkDestroyInstance m_vkDestroyInstance;
+
+ VkDebugReportCallbackEXT m_debugCallback;
+ PFN_vkDestroyDebugReportCallbackEXT m_vkDestroyDebugReportCallbackEXT;
+};
+
+QT_END_NAMESPACE
+
+#endif // QBASICVULKANPLATFORMINSTANCE_P_H
diff --git a/src/platformsupport/vkconvenience/vkconvenience.pro b/src/platformsupport/vkconvenience/vkconvenience.pro
new file mode 100644
index 0000000000..7a4cdb041d
--- /dev/null
+++ b/src/platformsupport/vkconvenience/vkconvenience.pro
@@ -0,0 +1,16 @@
+TARGET = QtVulkanSupport
+MODULE = vulkan_support
+
+QT = core-private gui-private
+CONFIG += static internal_module
+
+DEFINES += QT_NO_CAST_FROM_ASCII
+PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h
+
+SOURCES += \
+ qbasicvulkanplatforminstance.cpp
+
+HEADERS += \
+ qbasicvulkanplatforminstance_p.h
+
+load(qt_module)
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
index adf7feef2e..897ee953c0 100644
--- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
+++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
@@ -118,7 +118,7 @@ QString QOfonoManagerInterface::currentModem()
for (const QString &modem : modems) {
QOfonoModemInterface device(modem);
if (device.isPowered() && device.isOnline()
- && device.interfaces().contains(QStringLiteral("org.ofono.NetworkRegistration")))
+ && device.interfaces().contains(QLatin1String("org.ofono.NetworkRegistration")))
return modem;
}
return QString();
diff --git a/src/plugins/generic/tuiotouch/qoscbundle.cpp b/src/plugins/generic/tuiotouch/qoscbundle.cpp
index b84ae39aca..e9166922a1 100644
--- a/src/plugins/generic/tuiotouch/qoscbundle.cpp
+++ b/src/plugins/generic/tuiotouch/qoscbundle.cpp
@@ -125,7 +125,7 @@ QOscBundle::QOscBundle(const QByteArray &data)
if (size == 0) {
// empty bundle; these are valid, but should they be allowed? the
// spec is unclear on this...
- qWarning("Empty bundle?");
+ qCWarning(lcTuioBundle, "Empty bundle?");
m_isValid = true;
m_immediate = isImmediate;
m_timeEpoch = oscTimeEpoch;
@@ -155,7 +155,7 @@ QOscBundle::QOscBundle(const QByteArray &data)
m_timePico = oscTimePico;
m_messages.append(subMessage);
} else {
- qWarning("Invalid sub-message");
+ qCWarning(lcTuioBundle, "Invalid sub-message");
return;
}
} else if (subdata.startsWith(bundleIdentifier)) {
@@ -169,7 +169,7 @@ QOscBundle::QOscBundle(const QByteArray &data)
m_bundles.append(subBundle);
}
} else {
- qWarning("Malformed sub-data!");
+ qCWarning(lcTuioBundle, "Malformed sub-data!");
return;
}
}
diff --git a/src/plugins/generic/tuiotouch/qoscmessage.cpp b/src/plugins/generic/tuiotouch/qoscmessage.cpp
index b2004903bd..3c30caa923 100644
--- a/src/plugins/generic/tuiotouch/qoscmessage.cpp
+++ b/src/plugins/generic/tuiotouch/qoscmessage.cpp
@@ -113,7 +113,7 @@ QOscMessage::QOscMessage(const QByteArray &data)
parsedBytes += sizeof(quint32);
arguments.append(value.f);
} else {
- qWarning() << "Reading argument of unknown type " << typeTag;
+ qCWarning(lcTuioMessage) << "Reading argument of unknown type " << typeTag;
return;
}
}
diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
index eb646644ec..bb18ba5085 100644
--- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp
+++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
@@ -57,6 +57,7 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcTuioHandler, "qt.qpa.tuio.handler")
Q_LOGGING_CATEGORY(lcTuioSource, "qt.qpa.tuio.source")
Q_LOGGING_CATEGORY(lcTuioSet, "qt.qpa.tuio.set")
@@ -82,7 +83,7 @@ QTuioHandler::QTuioHandler(const QString &specification)
} else if (args.at(i).startsWith("tcp=")) {
QString portString = args.at(i).section('=', 1, 1);
portNumber = portString.toInt();
- qWarning() << "TCP is not yet supported. Falling back to UDP on " << portNumber;
+ qCWarning(lcTuioHandler) << "TCP is not yet supported. Falling back to UDP on " << portNumber;
} else if (args.at(i) == "invertx") {
invertx = true;
} else if (args.at(i) == "inverty") {
@@ -119,7 +120,7 @@ QTuioHandler::QTuioHandler(const QString &specification)
QWindowSystemInterface::registerTouchDevice(m_device);
if (!m_socket.bind(QHostAddress::Any, portNumber)) {
- qWarning() << "Failed to bind TUIO socket: " << m_socket.errorString();
+ qCWarning(lcTuioHandler) << "Failed to bind TUIO socket: " << m_socket.errorString();
return;
}
@@ -172,7 +173,7 @@ void QTuioHandler::processPackets()
if (message.addressPattern() == "/tuio/2Dcur") {
QList<QVariant> arguments = message.arguments();
if (arguments.count() == 0) {
- qWarning("Ignoring TUIO message with no arguments");
+ qCWarning(lcTuioHandler, "Ignoring TUIO message with no arguments");
continue;
}
@@ -186,13 +187,13 @@ void QTuioHandler::processPackets()
} else if (messageType == "fseq") {
process2DCurFseq(message);
} else {
- qWarning() << "Ignoring unknown TUIO message type: " << messageType;
+ qCWarning(lcTuioHandler) << "Ignoring unknown TUIO message type: " << messageType;
continue;
}
} else if (message.addressPattern() == "/tuio/2Dobj") {
QList<QVariant> arguments = message.arguments();
if (arguments.count() == 0) {
- qWarning("Ignoring TUIO message with no arguments");
+ qCWarning(lcTuioHandler, "Ignoring TUIO message with no arguments");
continue;
}
@@ -206,11 +207,11 @@ void QTuioHandler::processPackets()
} else if (messageType == "fseq") {
process2DObjFseq(message);
} else {
- qWarning() << "Ignoring unknown TUIO message type: " << messageType;
+ qCWarning(lcTuioHandler) << "Ignoring unknown TUIO message type: " << messageType;
continue;
}
} else {
- qWarning() << "Ignoring unknown address pattern " << message.addressPattern();
+ qCWarning(lcTuioHandler) << "Ignoring unknown address pattern " << message.addressPattern();
continue;
}
}
@@ -221,12 +222,12 @@ void QTuioHandler::process2DCurSource(const QOscMessage &message)
{
QList<QVariant> arguments = message.arguments();
if (arguments.count() != 2) {
- qWarning() << "Ignoring malformed TUIO source message: " << arguments.count();
+ qCWarning(lcTuioSource) << "Ignoring malformed TUIO source message: " << arguments.count();
return;
}
if (QMetaType::Type(arguments.at(1).type()) != QMetaType::QByteArray) {
- qWarning("Ignoring malformed TUIO source message (bad argument type)");
+ qCWarning(lcTuioSource, "Ignoring malformed TUIO source message (bad argument type)");
return;
}
@@ -248,7 +249,7 @@ void QTuioHandler::process2DCurAlive(const QOscMessage &message)
for (int i = 1; i < arguments.count(); ++i) {
if (QMetaType::Type(arguments.at(i).type()) != QMetaType::Int) {
- qWarning() << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')';
+ qCWarning(lcTuioHandler) << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')';
return;
}
@@ -288,7 +289,7 @@ void QTuioHandler::process2DCurSet(const QOscMessage &message)
{
QList<QVariant> arguments = message.arguments();
if (arguments.count() < 7) {
- qWarning() << "Ignoring malformed TUIO set message with too few arguments: " << arguments.count();
+ qCWarning(lcTuioSet) << "Ignoring malformed TUIO set message with too few arguments: " << arguments.count();
return;
}
@@ -299,7 +300,7 @@ void QTuioHandler::process2DCurSet(const QOscMessage &message)
QMetaType::Type(arguments.at(5).type()) != QMetaType::Float ||
QMetaType::Type(arguments.at(6).type()) != QMetaType::Float
) {
- qWarning() << "Ignoring malformed TUIO set message with bad types: " << arguments;
+ qCWarning(lcTuioSet) << "Ignoring malformed TUIO set message with bad types: " << arguments;
return;
}
@@ -312,7 +313,7 @@ void QTuioHandler::process2DCurSet(const QOscMessage &message)
QMap<int, QTuioCursor>::Iterator it = m_activeCursors.find(cursorId);
if (it == m_activeCursors.end()) {
- qWarning() << "Ignoring malformed TUIO set for nonexistent cursor " << cursorId;
+ qCWarning(lcTuioSet) << "Ignoring malformed TUIO set for nonexistent cursor " << cursorId;
return;
}
@@ -386,12 +387,12 @@ void QTuioHandler::process2DObjSource(const QOscMessage &message)
{
QList<QVariant> arguments = message.arguments();
if (arguments.count() != 2) {
- qWarning() << "Ignoring malformed TUIO source message: " << arguments.count();
+ qCWarning(lcTuioSource, ) << "Ignoring malformed TUIO source message: " << arguments.count();
return;
}
if (QMetaType::Type(arguments.at(1).type()) != QMetaType::QByteArray) {
- qWarning("Ignoring malformed TUIO source message (bad argument type)");
+ qCWarning(lcTuioSource, "Ignoring malformed TUIO source message (bad argument type)");
return;
}
@@ -413,7 +414,7 @@ void QTuioHandler::process2DObjAlive(const QOscMessage &message)
for (int i = 1; i < arguments.count(); ++i) {
if (QMetaType::Type(arguments.at(i).type()) != QMetaType::Int) {
- qWarning() << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')';
+ qCWarning(lcTuioHandler) << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')';
return;
}
@@ -453,7 +454,7 @@ void QTuioHandler::process2DObjSet(const QOscMessage &message)
{
QList<QVariant> arguments = message.arguments();
if (arguments.count() < 7) {
- qWarning() << "Ignoring malformed TUIO set message with too few arguments: " << arguments.count();
+ qCWarning(lcTuioSet) << "Ignoring malformed TUIO set message with too few arguments: " << arguments.count();
return;
}
@@ -467,7 +468,7 @@ void QTuioHandler::process2DObjSet(const QOscMessage &message)
QMetaType::Type(arguments.at(8).type()) != QMetaType::Float ||
QMetaType::Type(arguments.at(9).type()) != QMetaType::Float ||
QMetaType::Type(arguments.at(10).type()) != QMetaType::Float) {
- qWarning() << "Ignoring malformed TUIO set message with bad types: " << arguments;
+ qCWarning(lcTuioSet) << "Ignoring malformed TUIO set message with bad types: " << arguments;
return;
}
@@ -484,7 +485,7 @@ void QTuioHandler::process2DObjSet(const QOscMessage &message)
QMap<int, QTuioToken>::Iterator it = m_activeTokens.find(id);
if (it == m_activeTokens.end()) {
- qWarning() << "Ignoring malformed TUIO set for nonexistent token " << classId;
+ qCWarning(lcTuioSet) << "Ignoring malformed TUIO set for nonexistent token " << classId;
return;
}
@@ -522,7 +523,7 @@ QWindowSystemInterface::TouchPoint QTuioHandler::tokenToTouchPoint(const QTuioTo
QPointF delta = relPos - relPos.toPoint();
tp.area.moveCenter(win->mapToGlobal(relPos.toPoint()) + delta);
tp.velocity = QVector2D(win->size().width() * tc.vx(), win->size().height() * tc.vy());
- tp.rotation = tc.angle() * 180.0 / M_PI; // convert radians to degrees
+ tp.rotation = qRadiansToDegrees(tc.angle());
return tp;
}
diff --git a/src/plugins/imageformats/gif/main.h b/src/plugins/imageformats/gif/main.h
index 4287a8a39c..84913a31d7 100644
--- a/src/plugins/imageformats/gif/main.h
+++ b/src/plugins/imageformats/gif/main.h
@@ -55,8 +55,8 @@ public:
QGifPlugin();
~QGifPlugin();
- Capabilities capabilities(QIODevice *device, const QByteArray &format) const Q_DECL_OVERRIDE;
- QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const Q_DECL_OVERRIDE;
+ Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
+ QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp
index bae74bf9a1..e0f7f44701 100644
--- a/src/plugins/imageformats/gif/qgifhandler.cpp
+++ b/src/plugins/imageformats/gif/qgifhandler.cpp
@@ -354,7 +354,7 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length,
(*image) = QImage(swidth, sheight, format);
bpl = image->bytesPerLine();
bits = image->bits();
- memset(bits, 0, image->byteCount());
+ memset(bits, 0, image->sizeInBytes());
}
// Check if the previous attempt to create the image failed. If it
@@ -415,7 +415,7 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length,
backingstore = QImage(qMax(backingstore.width(), w),
qMax(backingstore.height(), h),
QImage::Format_RGB32);
- memset(backingstore.bits(), 0, backingstore.byteCount());
+ memset(backingstore.bits(), 0, backingstore.sizeInBytes());
}
const int dest_bpl = backingstore.bytesPerLine();
unsigned char *dest_data = backingstore.bits();
diff --git a/src/plugins/imageformats/gif/qgifhandler_p.h b/src/plugins/imageformats/gif/qgifhandler_p.h
index bc3debe83c..b004ee610d 100644
--- a/src/plugins/imageformats/gif/qgifhandler_p.h
+++ b/src/plugins/imageformats/gif/qgifhandler_p.h
@@ -69,22 +69,22 @@ public:
QGifHandler();
~QGifHandler();
- bool canRead() const Q_DECL_OVERRIDE;
- bool read(QImage *image) Q_DECL_OVERRIDE;
- bool write(const QImage &image) Q_DECL_OVERRIDE;
+ bool canRead() const override;
+ bool read(QImage *image) override;
+ bool write(const QImage &image) override;
- QByteArray name() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
static bool canRead(QIODevice *device);
- QVariant option(ImageOption option) const Q_DECL_OVERRIDE;
- void setOption(ImageOption option, const QVariant &value) Q_DECL_OVERRIDE;
- bool supportsOption(ImageOption option) const Q_DECL_OVERRIDE;
+ QVariant option(ImageOption option) const override;
+ void setOption(ImageOption option, const QVariant &value) override;
+ bool supportsOption(ImageOption option) const override;
- int imageCount() const Q_DECL_OVERRIDE;
- int loopCount() const Q_DECL_OVERRIDE;
- int nextImageDelay() const Q_DECL_OVERRIDE;
- int currentImageNumber() const Q_DECL_OVERRIDE;
+ int imageCount() const override;
+ int loopCount() const override;
+ int nextImageDelay() const override;
+ int currentImageNumber() const override;
private:
bool imageIsComing() const;
diff --git a/src/plugins/imageformats/ico/ico.pro b/src/plugins/imageformats/ico/ico.pro
index 7ca1f18cb1..c8bb37eff2 100644
--- a/src/plugins/imageformats/ico/ico.pro
+++ b/src/plugins/imageformats/ico/ico.pro
@@ -3,6 +3,7 @@ TARGET = qico
HEADERS += main.h qicohandler.h
SOURCES += main.cpp qicohandler.cpp
OTHER_FILES += ico.json
+QT += core-private
PLUGIN_TYPE = imageformats
PLUGIN_CLASS_NAME = QICOPlugin
diff --git a/src/plugins/imageformats/ico/main.h b/src/plugins/imageformats/ico/main.h
index 8e54d7c643..b5875183c1 100644
--- a/src/plugins/imageformats/ico/main.h
+++ b/src/plugins/imageformats/ico/main.h
@@ -52,8 +52,8 @@ class QICOPlugin : public QImageIOPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "ico.json")
public:
- Capabilities capabilities(QIODevice *device, const QByteArray &format) const Q_DECL_OVERRIDE;
- QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const Q_DECL_OVERRIDE;
+ Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
+ QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 17d1aeeb5d..e61173db30 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -48,6 +48,7 @@
#include "qicohandler.h"
#include <QtCore/qendian.h>
+#include <private/qendian_p.h>
#include <QtGui/QImage>
#include <QtCore/QFile>
#include <QtCore/QBuffer>
@@ -63,34 +64,34 @@ typedef struct
quint8 bHeight; // Height of the image (actual height, not times 2)
quint8 bColorCount; // Number of colors in image (0 if >=8bpp) [ not ture ]
quint8 bReserved; // Reserved
- quint16 wPlanes; // Color Planes
- quint16 wBitCount; // Bits per pixel
- quint32 dwBytesInRes; // how many bytes in this resource?
- quint32 dwImageOffset; // where in the file is this image
+ quint16_le wPlanes; // Color Planes
+ quint16_le wBitCount; // Bits per pixel
+ quint32_le dwBytesInRes; // how many bytes in this resource?
+ quint32_le dwImageOffset; // where in the file is this image
} ICONDIRENTRY, *LPICONDIRENTRY;
#define ICONDIRENTRY_SIZE 16
typedef struct
{
- quint16 idReserved; // Reserved
- quint16 idType; // resource type (1 for icons, 2 for cursors)
- quint16 idCount; // how many images?
+ quint16_le idReserved; // Reserved
+ quint16_le idType; // resource type (1 for icons, 2 for cursors)
+ quint16_le idCount; // how many images?
ICONDIRENTRY idEntries[1]; // the entries for each image
} ICONDIR, *LPICONDIR;
#define ICONDIR_SIZE 6 // Exclude the idEntries field
typedef struct { // BMP information header
- quint32 biSize; // size of this struct
- quint32 biWidth; // pixmap width
- quint32 biHeight; // pixmap height (specifies the combined height of the XOR and AND masks)
- quint16 biPlanes; // should be 1
- quint16 biBitCount; // number of bits per pixel
- quint32 biCompression; // compression method
- quint32 biSizeImage; // size of image
- quint32 biXPelsPerMeter; // horizontal resolution
- quint32 biYPelsPerMeter; // vertical resolution
- quint32 biClrUsed; // number of colors used
- quint32 biClrImportant; // number of important colors
+ quint32_le biSize; // size of this struct
+ quint32_le biWidth; // pixmap width
+ quint32_le biHeight; // pixmap height (specifies the combined height of the XOR and AND masks)
+ quint16_le biPlanes; // should be 1
+ quint16_le biBitCount; // number of bits per pixel
+ quint32_le biCompression; // compression method
+ quint32_le biSizeImage; // size of image
+ quint32_le biXPelsPerMeter; // horizontal resolution
+ quint32_le biYPelsPerMeter; // vertical resolution
+ quint32_le biClrUsed; // number of colors used
+ quint32_le biClrImportant; // number of important colors
} BMP_INFOHDR ,*LPBMP_INFOHDR;
#define BMP_INFOHDR_SIZE 40
@@ -140,108 +141,43 @@ private:
// Data readers and writers that takes care of alignment and endian stuff.
static bool readIconDirEntry(QIODevice *iodev, ICONDIRENTRY *iconDirEntry)
{
- if (iodev) {
- uchar tmp[ICONDIRENTRY_SIZE];
- if (iodev->read((char*)tmp, ICONDIRENTRY_SIZE) == ICONDIRENTRY_SIZE) {
- iconDirEntry->bWidth = tmp[0];
- iconDirEntry->bHeight = tmp[1];
- iconDirEntry->bColorCount = tmp[2];
- iconDirEntry->bReserved = tmp[3];
-
- iconDirEntry->wPlanes = qFromLittleEndian<quint16>(&tmp[4]);
- iconDirEntry->wBitCount = qFromLittleEndian<quint16>(&tmp[6]);
- iconDirEntry->dwBytesInRes = qFromLittleEndian<quint32>(&tmp[8]);
- iconDirEntry->dwImageOffset = qFromLittleEndian<quint32>(&tmp[12]);
- return true;
- }
- }
+ if (iodev)
+ return (iodev->read((char*)iconDirEntry, ICONDIRENTRY_SIZE) == ICONDIRENTRY_SIZE);
return false;
}
static bool writeIconDirEntry(QIODevice *iodev, const ICONDIRENTRY &iconEntry)
{
- if (iodev) {
- uchar tmp[ICONDIRENTRY_SIZE];
- tmp[0] = iconEntry.bWidth;
- tmp[1] = iconEntry.bHeight;
- tmp[2] = iconEntry.bColorCount;
- tmp[3] = iconEntry.bReserved;
- qToLittleEndian<quint16>(iconEntry.wPlanes, &tmp[4]);
- qToLittleEndian<quint16>(iconEntry.wBitCount, &tmp[6]);
- qToLittleEndian<quint32>(iconEntry.dwBytesInRes, &tmp[8]);
- qToLittleEndian<quint32>(iconEntry.dwImageOffset, &tmp[12]);
- return iodev->write((char*)tmp, ICONDIRENTRY_SIZE) == ICONDIRENTRY_SIZE;
- }
-
+ if (iodev)
+ return iodev->write((char*)&iconEntry, ICONDIRENTRY_SIZE) == ICONDIRENTRY_SIZE;
return false;
}
static bool readIconDir(QIODevice *iodev, ICONDIR *iconDir)
{
- if (iodev) {
- uchar tmp[ICONDIR_SIZE];
- if (iodev->read((char*)tmp, ICONDIR_SIZE) == ICONDIR_SIZE) {
- iconDir->idReserved = qFromLittleEndian<quint16>(&tmp[0]);
- iconDir->idType = qFromLittleEndian<quint16>(&tmp[2]);
- iconDir->idCount = qFromLittleEndian<quint16>(&tmp[4]);
- return true;
- }
- }
+ if (iodev)
+ return (iodev->read((char*)iconDir, ICONDIR_SIZE) == ICONDIR_SIZE);
return false;
}
static bool writeIconDir(QIODevice *iodev, const ICONDIR &iconDir)
{
- if (iodev) {
- uchar tmp[6];
- qToLittleEndian(iconDir.idReserved, tmp);
- qToLittleEndian(iconDir.idType, &tmp[2]);
- qToLittleEndian(iconDir.idCount, &tmp[4]);
- return iodev->write((char*)tmp, 6) == 6;
- }
+ if (iodev)
+ return iodev->write((char*)&iconDir, 6) == 6;
return false;
}
static bool readBMPInfoHeader(QIODevice *iodev, BMP_INFOHDR *pHeader)
{
- if (iodev) {
- uchar header[BMP_INFOHDR_SIZE];
- if (iodev->read((char*)header, BMP_INFOHDR_SIZE) == BMP_INFOHDR_SIZE) {
- pHeader->biSize = qFromLittleEndian<quint32>(&header[0]);
- pHeader->biWidth = qFromLittleEndian<quint32>(&header[4]);
- pHeader->biHeight = qFromLittleEndian<quint32>(&header[8]);
- pHeader->biPlanes = qFromLittleEndian<quint16>(&header[12]);
- pHeader->biBitCount = qFromLittleEndian<quint16>(&header[14]);
- pHeader->biCompression = qFromLittleEndian<quint32>(&header[16]);
- pHeader->biSizeImage = qFromLittleEndian<quint32>(&header[20]);
- pHeader->biXPelsPerMeter = qFromLittleEndian<quint32>(&header[24]);
- pHeader->biYPelsPerMeter = qFromLittleEndian<quint32>(&header[28]);
- pHeader->biClrUsed = qFromLittleEndian<quint32>(&header[32]);
- pHeader->biClrImportant = qFromLittleEndian<quint32>(&header[36]);
- return true;
- }
- }
+ if (iodev)
+ return (iodev->read((char*)pHeader, BMP_INFOHDR_SIZE) == BMP_INFOHDR_SIZE);
return false;
}
static bool writeBMPInfoHeader(QIODevice *iodev, const BMP_INFOHDR &header)
{
- if (iodev) {
- uchar tmp[BMP_INFOHDR_SIZE];
- qToLittleEndian<quint32>(header.biSize, &tmp[0]);
- qToLittleEndian<quint32>(header.biWidth, &tmp[4]);
- qToLittleEndian<quint32>(header.biHeight, &tmp[8]);
- qToLittleEndian<quint16>(header.biPlanes, &tmp[12]);
- qToLittleEndian<quint16>(header.biBitCount, &tmp[14]);
- qToLittleEndian<quint32>(header.biCompression, &tmp[16]);
- qToLittleEndian<quint32>(header.biSizeImage, &tmp[20]);
- qToLittleEndian<quint32>(header.biXPelsPerMeter, &tmp[24]);
- qToLittleEndian<quint32>(header.biYPelsPerMeter, &tmp[28]);
- qToLittleEndian<quint32>(header.biClrUsed, &tmp[32]);
- qToLittleEndian<quint32>(header.biClrImportant, &tmp[36]);
-
- return iodev->write((char*)tmp, BMP_INFOHDR_SIZE) == BMP_INFOHDR_SIZE;
- }
+ if (iodev)
+ return iodev->write((char*)&header, BMP_INFOHDR_SIZE) == BMP_INFOHDR_SIZE;
return false;
}
@@ -561,7 +497,7 @@ QImage ICOReader::iconAt(int index)
if (icoAttrib.depth == 32) // there's no colormap
icoAttrib.ncolors = 0;
else // # colors used
- icoAttrib.ncolors = header.biClrUsed ? header.biClrUsed : 1 << icoAttrib.nbits;
+ icoAttrib.ncolors = header.biClrUsed ? uint(header.biClrUsed) : 1 << icoAttrib.nbits;
if (icoAttrib.ncolors > 256) //color table can't be more than 256
return img;
icoAttrib.w = iconEntry.bWidth;
diff --git a/src/plugins/imageformats/ico/qicohandler.h b/src/plugins/imageformats/ico/qicohandler.h
index eea894a950..435f036113 100644
--- a/src/plugins/imageformats/ico/qicohandler.h
+++ b/src/plugins/imageformats/ico/qicohandler.h
@@ -50,20 +50,20 @@ public:
QtIcoHandler(QIODevice *device);
virtual ~QtIcoHandler();
- bool canRead() const Q_DECL_OVERRIDE;
- bool read(QImage *image) Q_DECL_OVERRIDE;
- bool write(const QImage &image) Q_DECL_OVERRIDE;
+ bool canRead() const override;
+ bool read(QImage *image) override;
+ bool write(const QImage &image) override;
- QByteArray name() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
- int imageCount() const Q_DECL_OVERRIDE;
- bool jumpToImage(int imageNumber) Q_DECL_OVERRIDE;
- bool jumpToNextImage() Q_DECL_OVERRIDE;
+ int imageCount() const override;
+ bool jumpToImage(int imageNumber) override;
+ bool jumpToNextImage() override;
static bool canRead(QIODevice *device);
- bool supportsOption(ImageOption option) const Q_DECL_OVERRIDE;
- QVariant option(ImageOption option) const Q_DECL_OVERRIDE;
+ bool supportsOption(ImageOption option) const override;
+ QVariant option(ImageOption option) const override;
private:
int m_currentIconIndex;
diff --git a/src/plugins/imageformats/jpeg/main.h b/src/plugins/imageformats/jpeg/main.h
index 10619757c4..1845c8c124 100644
--- a/src/plugins/imageformats/jpeg/main.h
+++ b/src/plugins/imageformats/jpeg/main.h
@@ -51,8 +51,8 @@ class QJpegPlugin : public QImageIOPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "jpeg.json")
public:
- Capabilities capabilities(QIODevice *device, const QByteArray &format) const Q_DECL_OVERRIDE;
- QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const Q_DECL_OVERRIDE;
+ Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
+ QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler_p.h b/src/plugins/imageformats/jpeg/qjpeghandler_p.h
index 534ce12115..d832bf82f3 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler_p.h
+++ b/src/plugins/imageformats/jpeg/qjpeghandler_p.h
@@ -64,17 +64,17 @@ public:
QJpegHandler();
~QJpegHandler();
- bool canRead() const Q_DECL_OVERRIDE;
- bool read(QImage *image) Q_DECL_OVERRIDE;
- bool write(const QImage &image) Q_DECL_OVERRIDE;
+ bool canRead() const override;
+ bool read(QImage *image) override;
+ bool write(const QImage &image) override;
- QByteArray name() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
static bool canRead(QIODevice *device);
- QVariant option(ImageOption option) const Q_DECL_OVERRIDE;
- void setOption(ImageOption option, const QVariant &value) Q_DECL_OVERRIDE;
- bool supportsOption(ImageOption option) const Q_DECL_OVERRIDE;
+ QVariant option(ImageOption option) const override;
+ void setOption(ImageOption option, const QVariant &value) override;
+ bool supportsOption(ImageOption option) const override;
private:
QJpegHandlerPrivate *d;
diff --git a/src/plugins/platforms/android/android.pro b/src/plugins/platforms/android/android.pro
index 03592bfa7d..73db9e93a3 100644
--- a/src/plugins/platforms/android/android.pro
+++ b/src/plugins/platforms/android/android.pro
@@ -11,6 +11,8 @@ QT += \
eventdispatcher_support-private accessibility_support-private \
fontdatabase_support-private egl_support-private
+qtConfig(vulkan): QT += vulkan_support-private
+
OTHER_FILES += $$PWD/android.json
INCLUDEPATH += \
@@ -78,6 +80,13 @@ HEADERS += $$PWD/qandroidplatformintegration.h \
qtConfig(android-style-assets): SOURCES += $$PWD/extract.cpp
else: SOURCES += $$PWD/extract-dummy.cpp
+qtConfig(vulkan) {
+ SOURCES += $$PWD/qandroidplatformvulkaninstance.cpp \
+ $$PWD/qandroidplatformvulkanwindow.cpp
+ HEADERS += $$PWD/qandroidplatformvulkaninstance.h \
+ $$PWD/qandroidplatformvulkanwindow.h
+}
+
PLUGIN_TYPE = platforms
load(qt_plugin)
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp
index dc55ccd615..dabab553c2 100644
--- a/src/plugins/platforms/android/androidjniinput.cpp
+++ b/src/plugins/platforms/android/androidjniinput.cpp
@@ -50,7 +50,7 @@
#include <QGuiApplication>
#include <QDebug>
-#include <math.h>
+#include <QtMath>
QT_BEGIN_NAMESPACE
@@ -252,7 +252,7 @@ namespace QtAndroidInput
QWindowSystemInterface::TouchPoint touchPoint;
touchPoint.id = id;
touchPoint.pressure = pressure;
- touchPoint.rotation = rotation * 180 / M_PI;
+ touchPoint.rotation = qRadiansToDegrees(rotation);
touchPoint.normalPosition = QPointF(double(x / dw), double(y / dh));
touchPoint.state = state;
touchPoint.area = QRectF(x - double(minor),
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index ad2fef7070..8b0b18a846 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -529,7 +529,14 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para
if (sem_init(&m_terminateSemaphore, 0, 0) == -1)
return false;
- return pthread_create(&m_qtAppThread, nullptr, startMainMethod, nullptr) == 0;
+ jboolean res = pthread_create(&m_qtAppThread, nullptr, startMainMethod, nullptr) == 0;
+
+ // The service must wait until the QCoreApplication starts otherwise onBind will be
+ // called too early
+ if (m_serviceObject)
+ QtAndroidPrivate::waitForServiceSetup();
+
+ return res;
}
static void quitQtCoreApplication(JNIEnv *env, jclass /*clazz*/)
@@ -734,6 +741,11 @@ static void onNewIntent(JNIEnv *env, jclass /*cls*/, jobject data)
QtAndroidPrivate::handleNewIntent(env, data);
}
+static jobject onBind(JNIEnv */*env*/, jclass /*cls*/, jobject intent)
+{
+ return QtAndroidPrivate::callOnBindListener(intent);
+}
+
static JNINativeMethod methods[] = {
{"startQtAndroidPlugin", "()Z", (void *)startQtAndroidPlugin},
{"startQtApplication", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)startQtApplication},
@@ -746,7 +758,8 @@ static JNINativeMethod methods[] = {
{"updateApplicationState", "(I)V", (void *)updateApplicationState},
{"handleOrientationChanged", "(II)V", (void *)handleOrientationChanged},
{"onActivityResult", "(IILandroid/content/Intent;)V", (void *)onActivityResult},
- {"onNewIntent", "(Landroid/content/Intent;)V", (void *)onNewIntent}
+ {"onNewIntent", "(Landroid/content/Intent;)V", (void *)onNewIntent},
+ {"onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", (void *)onBind}
};
#define FIND_AND_CHECK_CLASS(CLASS_NAME) \
diff --git a/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp b/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
index 08498d0582..ced35c4cfa 100644
--- a/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
+++ b/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
@@ -103,11 +103,7 @@ bool QAndroidPlatformMessageDialogHelper::show(Qt::WindowFlags windowFlags
if (!str.isEmpty())
m_javaMessageDialog.callMethod<void>("setDetailedText", "(Ljava/lang/String;)V", QJNIObjectPrivate::fromString(str).object());
- // http://developer.android.com/design/building-blocks/dialogs.html
- // dismissive action on the left, affirmative on the right
- // There don't seem to be more fine-grained rules, but the OS X layout
- // at least conforms to this one rule and makes the rest deterministic.
- const int * currentLayout = buttonLayout(Qt::Horizontal, MacLayout);
+ const int * currentLayout = buttonLayout(Qt::Horizontal, AndroidLayout);
while (*currentLayout != QPlatformDialogHelper::EOL) {
int role = (*currentLayout & ~QPlatformDialogHelper::Reverse);
addButtons(opt, static_cast<ButtonRole>(role));
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp
index 7185b573cd..763b294660 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp
@@ -69,6 +69,11 @@
#include <QtPlatformHeaders/QEGLNativeContext>
+#if QT_CONFIG(vulkan)
+#include "qandroidplatformvulkanwindow.h"
+#include "qandroidplatformvulkaninstance.h"
+#endif
+
QT_BEGIN_NAMESPACE
int QAndroidPlatformIntegration::m_defaultGeometryWidth = 320;
@@ -119,6 +124,23 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA
return 0;
}
+void *QAndroidPlatformNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
+{
+#if QT_CONFIG(vulkan)
+ if (resource == "vkSurface") {
+ if (window->surfaceType() == QSurface::VulkanSurface) {
+ QAndroidPlatformVulkanWindow *w = static_cast<QAndroidPlatformVulkanWindow *>(window->handle());
+ // return a pointer to the VkSurfaceKHR, not the value
+ return w ? w->vkSurface() : nullptr;
+ }
+ }
+#else
+ Q_UNUSED(resource);
+ Q_UNUSED(window);
+#endif
+ return nullptr;
+}
+
void QAndroidPlatformNativeInterface::customEvent(QEvent *event)
{
if (event->type() != QEvent::User)
@@ -243,6 +265,7 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
case ForeignWindows: return QtAndroid::activity();
case ThreadedOpenGL: return !needsBasicRenderloopWorkaround() && QtAndroid::activity();
case RasterGLSurface: return QtAndroid::activity();
+ case TopStackedNativeChildWindows: return false;
default:
return QPlatformIntegration::hasCapability(cap);
}
@@ -295,6 +318,11 @@ QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *wind
if (!QtAndroid::activity())
return nullptr;
+#if QT_CONFIG(vulkan)
+ if (window->surfaceType() == QSurface::VulkanSurface)
+ return new QAndroidPlatformVulkanWindow(window);
+#endif
+
return new QAndroidPlatformOpenGLWindow(window, m_eglDisplay);
}
@@ -443,4 +471,13 @@ void QAndroidPlatformIntegration::setScreenSize(int width, int height)
QMetaObject::invokeMethod(m_primaryScreen, "setSize", Qt::AutoConnection, Q_ARG(QSize, QSize(width, height)));
}
+#if QT_CONFIG(vulkan)
+
+QPlatformVulkanInstance *QAndroidPlatformIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const
+{
+ return new QAndroidPlatformVulkanInstance(instance);
+}
+
+#endif // QT_CONFIG(vulkan)
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h
index 337f4a9279..c795c499bc 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.h
+++ b/src/plugins/platforms/android/qandroidplatformintegration.h
@@ -40,6 +40,8 @@
#ifndef QANDROIDPLATFORMINTERATION_H
#define QANDROIDPLATFORMINTERATION_H
+#include <QtGui/qtguiglobal.h>
+
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformmenu.h>
#include <qpa/qplatformnativeinterface.h>
@@ -64,6 +66,7 @@ class QAndroidPlatformNativeInterface: public QPlatformNativeInterface
{
public:
void *nativeResourceForIntegration(const QByteArray &resource) override;
+ void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) override;
std::shared_ptr<AndroidStyle> m_androidStyle;
protected:
@@ -128,6 +131,10 @@ public:
void flushPendingUpdates();
+#if QT_CONFIG(vulkan)
+ QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
+#endif
+
private:
EGLDisplay m_eglDisplay;
QTouchDevice *m_touchDevice;
diff --git a/src/plugins/platforms/android/qandroidplatformmenu.cpp b/src/plugins/platforms/android/qandroidplatformmenu.cpp
index 06b297a1ad..d9cecebf2c 100644
--- a/src/plugins/platforms/android/qandroidplatformmenu.cpp
+++ b/src/plugins/platforms/android/qandroidplatformmenu.cpp
@@ -46,7 +46,6 @@ QT_BEGIN_NAMESPACE
QAndroidPlatformMenu::QAndroidPlatformMenu()
{
- m_tag = reinterpret_cast<quintptr>(this); // QMenu will overwrite this later, but we need a unique ID for QtQuick
m_enabled = true;
m_isVisible = true;
}
@@ -92,16 +91,6 @@ void QAndroidPlatformMenu::syncSeparatorsCollapsible(bool enable)
Q_UNUSED(enable)
}
-void QAndroidPlatformMenu::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
-quintptr QAndroidPlatformMenu::tag() const
-{
- return m_tag;
-}
-
void QAndroidPlatformMenu::setText(const QString &text)
{
m_text = text;
diff --git a/src/plugins/platforms/android/qandroidplatformmenu.h b/src/plugins/platforms/android/qandroidplatformmenu.h
index 00968672c5..47e650f2d7 100644
--- a/src/plugins/platforms/android/qandroidplatformmenu.h
+++ b/src/plugins/platforms/android/qandroidplatformmenu.h
@@ -61,8 +61,6 @@ public:
void syncMenuItem(QPlatformMenuItem *menuItem) override;
void syncSeparatorsCollapsible(bool enable) override;
- void setTag(quintptr tag) override;
- quintptr tag() const override;
void setText(const QString &text) override;
QString text() const;
void setIcon(const QIcon &icon) override;
@@ -81,7 +79,6 @@ public:
private:
PlatformMenuItemsType m_menuItems;
- quintptr m_tag;
QString m_text;
QIcon m_icon;
bool m_enabled;
diff --git a/src/plugins/platforms/android/qandroidplatformmenuitem.cpp b/src/plugins/platforms/android/qandroidplatformmenuitem.cpp
index 0591522e55..e24c5f974e 100644
--- a/src/plugins/platforms/android/qandroidplatformmenuitem.cpp
+++ b/src/plugins/platforms/android/qandroidplatformmenuitem.cpp
@@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE
QAndroidPlatformMenuItem::QAndroidPlatformMenuItem()
{
- m_tag = reinterpret_cast<quintptr>(this); // QMenu will overwrite this later, but we need a unique ID for QtQuick
m_menu = 0;
m_isVisible = true;
m_isSeparator = false;
@@ -54,16 +53,6 @@ QAndroidPlatformMenuItem::QAndroidPlatformMenuItem()
m_isEnabled = true;
}
-void QAndroidPlatformMenuItem::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
-quintptr QAndroidPlatformMenuItem::tag() const
-{
- return m_tag;
-}
-
void QAndroidPlatformMenuItem::setText(const QString &text)
{
m_text = text;
diff --git a/src/plugins/platforms/android/qandroidplatformmenuitem.h b/src/plugins/platforms/android/qandroidplatformmenuitem.h
index be5240cfa6..b8782f995d 100644
--- a/src/plugins/platforms/android/qandroidplatformmenuitem.h
+++ b/src/plugins/platforms/android/qandroidplatformmenuitem.h
@@ -49,8 +49,6 @@ class QAndroidPlatformMenuItem: public QPlatformMenuItem
{
public:
QAndroidPlatformMenuItem();
- void setTag(quintptr tag) override;
- quintptr tag() const override;
void setText(const QString &text) override;
QString text() const;
@@ -86,7 +84,6 @@ public:
void setIconSize(int size) override;
private:
- quintptr m_tag;
QString m_text;
QIcon m_icon;
QAndroidPlatformMenu *m_menu;
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp
index 3b59b293a5..3a79e32abe 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.cpp
+++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp
@@ -85,7 +85,8 @@ private:
# define PROFILE_SCOPE
#endif
-QAndroidPlatformScreen::QAndroidPlatformScreen():QObject(),QPlatformScreen()
+QAndroidPlatformScreen::QAndroidPlatformScreen()
+ : QObject(), QPlatformScreen()
{
m_availableGeometry = QRect(0, 0, QAndroidPlatformIntegration::m_defaultGeometryWidth, QAndroidPlatformIntegration::m_defaultGeometryHeight);
m_size = QSize(QAndroidPlatformIntegration::m_defaultScreenWidth, QAndroidPlatformIntegration::m_defaultScreenHeight);
@@ -100,9 +101,6 @@ QAndroidPlatformScreen::QAndroidPlatformScreen():QObject(),QPlatformScreen()
}
m_physicalSize.setHeight(QAndroidPlatformIntegration::m_defaultPhysicalSizeHeight);
m_physicalSize.setWidth(QAndroidPlatformIntegration::m_defaultPhysicalSizeWidth);
- m_redrawTimer.setSingleShot(true);
- m_redrawTimer.setInterval(0);
- connect(&m_redrawTimer, SIGNAL(timeout()), this, SLOT(doRedraw()));
connect(qGuiApp, &QGuiApplication::applicationStateChanged, this, &QAndroidPlatformScreen::applicationStateChanged);
}
@@ -136,6 +134,16 @@ QWindow *QAndroidPlatformScreen::topLevelAt(const QPoint &p) const
return 0;
}
+bool QAndroidPlatformScreen::event(QEvent *event)
+{
+ if (event->type() == QEvent::UpdateRequest) {
+ doRedraw();
+ m_updatePending = false;
+ return true;
+ }
+ return QObject::event(event);
+}
+
void QAndroidPlatformScreen::addWindow(QAndroidPlatformWindow *window)
{
if (window->parent() && window->isRaster())
@@ -209,8 +217,10 @@ void QAndroidPlatformScreen::lower(QAndroidPlatformWindow *window)
void QAndroidPlatformScreen::scheduleUpdate()
{
- if (!m_redrawTimer.isActive())
- m_redrawTimer.start();
+ if (!m_updatePending) {
+ m_updatePending = true;
+ QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
+ }
}
void QAndroidPlatformScreen::setDirty(const QRect &rect)
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h
index 923c9e8832..f15aeae3fd 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.h
+++ b/src/plugins/platforms/android/qandroidplatformscreen.h
@@ -89,10 +89,12 @@ public slots:
void setSize(const QSize &size);
protected:
+ bool event(QEvent *event) override;
+
typedef QList<QAndroidPlatformWindow *> WindowStackType;
WindowStackType m_windowStack;
QRect m_dirtyRect;
- QTimer m_redrawTimer;
+ bool m_updatePending = false;
QRect m_availableGeometry;
int m_depth;
diff --git a/src/plugins/platforms/android/qandroidplatformvulkaninstance.cpp b/src/plugins/platforms/android/qandroidplatformvulkaninstance.cpp
new file mode 100644
index 0000000000..a411d0f007
--- /dev/null
+++ b/src/plugins/platforms/android/qandroidplatformvulkaninstance.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 "qandroidplatformvulkaninstance.h"
+
+QT_BEGIN_NAMESPACE
+
+QAndroidPlatformVulkanInstance::QAndroidPlatformVulkanInstance(QVulkanInstance *instance)
+ : m_instance(instance)
+{
+ m_lib.setFileName(QStringLiteral("vulkan"));
+
+ if (!m_lib.load()) {
+ qWarning("Failed to load %s", qPrintable(m_lib.fileName()));
+ return;
+ }
+
+ init(&m_lib);
+}
+
+void QAndroidPlatformVulkanInstance::createOrAdoptInstance()
+{
+ initInstance(m_instance, QByteArrayList() << QByteArrayLiteral("VK_KHR_android_surface"));
+}
+
+QAndroidPlatformVulkanInstance::~QAndroidPlatformVulkanInstance()
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidplatformvulkaninstance.h b/src/plugins/platforms/android/qandroidplatformvulkaninstance.h
new file mode 100644
index 0000000000..67edcceed9
--- /dev/null
+++ b/src/plugins/platforms/android/qandroidplatformvulkaninstance.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 QANDROIDPLATFORMVULKANINSTANCE_H
+#define QANDROIDPLATFORMVULKANINSTANCE_H
+
+#include <QtVulkanSupport/private/qbasicvulkanplatforminstance_p.h>
+#include <QLibrary>
+
+QT_BEGIN_NAMESPACE
+
+class QAndroidPlatformVulkanInstance : public QBasicPlatformVulkanInstance
+{
+public:
+ QAndroidPlatformVulkanInstance(QVulkanInstance *instance);
+ ~QAndroidPlatformVulkanInstance();
+
+ void createOrAdoptInstance() override;
+
+private:
+ QVulkanInstance *m_instance;
+ QLibrary m_lib;
+};
+
+QT_END_NAMESPACE
+
+#endif // QANDROIDPLATFORMVULKANINSTANCE_H
diff --git a/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp b/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp
new file mode 100644
index 0000000000..cc41a871f3
--- /dev/null
+++ b/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 "qandroidplatformvulkanwindow.h"
+#include "qandroidplatformscreen.h"
+#include "androidjnimain.h"
+#include "qandroideventdispatcher.h"
+#include "androiddeadlockprotector.h"
+
+#include <QSurfaceFormat>
+#include <qpa/qwindowsysteminterface.h>
+#include <qpa/qplatformscreen.h>
+
+#include <android/native_window.h>
+#include <android/native_window_jni.h>
+
+QT_BEGIN_NAMESPACE
+
+QAndroidPlatformVulkanWindow::QAndroidPlatformVulkanWindow(QWindow *window)
+ : QAndroidPlatformWindow(window),
+ m_nativeSurfaceId(-1),
+ m_nativeWindow(nullptr),
+ m_vkSurface(0),
+ m_createVkSurface(nullptr),
+ m_destroyVkSurface(nullptr)
+{
+}
+
+QAndroidPlatformVulkanWindow::~QAndroidPlatformVulkanWindow()
+{
+ m_surfaceWaitCondition.wakeOne();
+ lockSurface();
+ if (m_nativeSurfaceId != -1)
+ QtAndroid::destroySurface(m_nativeSurfaceId);
+ clearSurface();
+ unlockSurface();
+}
+
+void QAndroidPlatformVulkanWindow::setGeometry(const QRect &rect)
+{
+ if (rect == geometry())
+ return;
+
+ m_oldGeometry = geometry();
+
+ QAndroidPlatformWindow::setGeometry(rect);
+ if (m_nativeSurfaceId != -1)
+ QtAndroid::setSurfaceGeometry(m_nativeSurfaceId, rect);
+
+ QRect availableGeometry = screen()->availableGeometry();
+ if (m_oldGeometry.width() == 0
+ && m_oldGeometry.height() == 0
+ && rect.width() > 0
+ && rect.height() > 0
+ && availableGeometry.width() > 0
+ && availableGeometry.height() > 0) {
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), rect.size()));
+ }
+
+ if (rect.topLeft() != m_oldGeometry.topLeft())
+ repaint(QRegion(rect));
+}
+
+void QAndroidPlatformVulkanWindow::applicationStateChanged(Qt::ApplicationState state)
+{
+ QAndroidPlatformWindow::applicationStateChanged(state);
+ if (state <= Qt::ApplicationHidden) {
+ lockSurface();
+ if (m_nativeSurfaceId != -1) {
+ QtAndroid::destroySurface(m_nativeSurfaceId);
+ m_nativeSurfaceId = -1;
+ }
+ clearSurface();
+ unlockSurface();
+ }
+}
+
+QSurfaceFormat QAndroidPlatformVulkanWindow::format() const
+{
+ return window()->requestedFormat();
+}
+
+void QAndroidPlatformVulkanWindow::clearSurface()
+{
+ if (m_vkSurface && m_destroyVkSurface) {
+ m_destroyVkSurface(window()->vulkanInstance()->vkInstance(), m_vkSurface, nullptr);
+ m_vkSurface = 0;
+ }
+
+ if (m_nativeWindow) {
+ ANativeWindow_release(m_nativeWindow);
+ m_nativeWindow = nullptr;
+ }
+}
+
+void QAndroidPlatformVulkanWindow::sendExpose()
+{
+ QRect availableGeometry = screen()->availableGeometry();
+ if (geometry().width() > 0 && geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
+ QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(), geometry().size())));
+}
+
+void QAndroidPlatformVulkanWindow::surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h)
+{
+ Q_UNUSED(jniEnv);
+ Q_UNUSED(w);
+ Q_UNUSED(h);
+
+ lockSurface();
+ m_androidSurfaceObject = surface;
+ if (surface)
+ m_surfaceWaitCondition.wakeOne();
+ unlockSurface();
+
+ if (surface)
+ sendExpose();
+}
+
+VkSurfaceKHR *QAndroidPlatformVulkanWindow::vkSurface()
+{
+ if (QAndroidEventDispatcherStopper::stopped())
+ return &m_vkSurface;
+
+ bool needsExpose = false;
+ if (!m_vkSurface) {
+ clearSurface();
+
+ QMutexLocker lock(&m_surfaceMutex);
+ if (m_nativeSurfaceId == -1) {
+ AndroidDeadlockProtector protector;
+ if (!protector.acquire())
+ return &m_vkSurface;
+ const bool windowStaysOnTop = bool(window()->flags() & Qt::WindowStaysOnTopHint);
+ m_nativeSurfaceId = QtAndroid::createSurface(this, geometry(), windowStaysOnTop, 32);
+ m_surfaceWaitCondition.wait(&m_surfaceMutex);
+ }
+
+ if (m_nativeSurfaceId == -1 || !m_androidSurfaceObject.isValid())
+ return &m_vkSurface;
+
+ QJNIEnvironmentPrivate env;
+ m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object());
+
+ VkAndroidSurfaceCreateInfoKHR surfaceInfo;
+ memset(&surfaceInfo, 0, sizeof(surfaceInfo));
+ surfaceInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
+ surfaceInfo.window = m_nativeWindow;
+ QVulkanInstance *inst = window()->vulkanInstance();
+ if (!inst) {
+ qWarning("Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?");
+ return &m_vkSurface;
+ }
+ if (!m_createVkSurface) {
+ m_createVkSurface = reinterpret_cast<PFN_vkCreateAndroidSurfaceKHR>(
+ inst->getInstanceProcAddr("vkCreateAndroidSurfaceKHR"));
+ }
+ if (!m_destroyVkSurface) {
+ m_destroyVkSurface = reinterpret_cast<PFN_vkDestroySurfaceKHR>(
+ inst->getInstanceProcAddr("vkDestroySurfaceKHR"));
+ }
+ VkResult err = m_createVkSurface(inst->vkInstance(), &surfaceInfo, nullptr, &m_vkSurface);
+ if (err != VK_SUCCESS)
+ qWarning("Failed to create Android VkSurface: %d", err);
+
+ needsExpose = true;
+ }
+
+ if (needsExpose)
+ sendExpose();
+
+ return &m_vkSurface;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidplatformvulkanwindow.h b/src/plugins/platforms/android/qandroidplatformvulkanwindow.h
new file mode 100644
index 0000000000..19eca98720
--- /dev/null
+++ b/src/plugins/platforms/android/qandroidplatformvulkanwindow.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 QANDROIDPLATFORMVULKANWINDOW_H
+#define QANDROIDPLATFORMVULKANWINDOW_H
+
+#if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+#error "vulkan.h included without Android WSI"
+#endif
+
+#define VK_USE_PLATFORM_ANDROID_KHR
+
+#include <QWaitCondition>
+#include <QtCore/private/qjni_p.h>
+
+#include "androidsurfaceclient.h"
+#include "qandroidplatformwindow.h"
+
+#include "qandroidplatformvulkaninstance.h"
+
+QT_BEGIN_NAMESPACE
+
+class QAndroidPlatformVulkanWindow : public QAndroidPlatformWindow, public AndroidSurfaceClient
+{
+public:
+ explicit QAndroidPlatformVulkanWindow(QWindow *window);
+ ~QAndroidPlatformVulkanWindow();
+
+ void setGeometry(const QRect &rect) override;
+ QSurfaceFormat format() const override;
+ void applicationStateChanged(Qt::ApplicationState) override;
+
+ VkSurfaceKHR *vkSurface();
+
+protected:
+ void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h) override;
+
+private:
+ void sendExpose();
+ void clearSurface();
+
+ int m_nativeSurfaceId;
+ ANativeWindow *m_nativeWindow;
+ QJNIObjectPrivate m_androidSurfaceObject;
+ QWaitCondition m_surfaceWaitCondition;
+ QSurfaceFormat m_format;
+ QRect m_oldGeometry;
+ VkSurfaceKHR m_vkSurface;
+ PFN_vkCreateAndroidSurfaceKHR m_createVkSurface;
+ PFN_vkDestroySurfaceKHR m_destroyVkSurface;
+};
+
+QT_END_NAMESPACE
+
+#endif // QANDROIDPLATFORMVULKANWINDOW_H
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.cpp b/src/plugins/platforms/android/qandroidplatformwindow.cpp
index 424cfefc6c..c095f51fa3 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.cpp
+++ b/src/plugins/platforms/android/qandroidplatformwindow.cpp
@@ -56,7 +56,7 @@ QAndroidPlatformWindow::QAndroidPlatformWindow(QWindow *window)
m_windowState = Qt::WindowNoState;
static QAtomicInt winIdGenerator(1);
m_windowId = winIdGenerator.fetchAndAddRelaxed(1);
- setWindowState(window->windowState());
+ setWindowState(window->windowStates());
}
void QAndroidPlatformWindow::lower()
@@ -73,7 +73,6 @@ void QAndroidPlatformWindow::raise()
void QAndroidPlatformWindow::setGeometry(const QRect &rect)
{
QWindowSystemInterface::handleGeometryChange(window(), rect);
- QPlatformWindow::setGeometry(rect);
}
void QAndroidPlatformWindow::setVisible(bool visible)
@@ -98,7 +97,7 @@ void QAndroidPlatformWindow::setVisible(bool visible)
QPlatformWindow::setVisible(visible);
}
-void QAndroidPlatformWindow::setWindowState(Qt::WindowState state)
+void QAndroidPlatformWindow::setWindowState(Qt::WindowStates state)
{
if (m_windowState == state)
return;
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h
index 91cb1e76e6..f2e51bd3df 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.h
+++ b/src/plugins/platforms/android/qandroidplatformwindow.h
@@ -59,7 +59,7 @@ public:
void setVisible(bool visible) override;
- void setWindowState(Qt::WindowState state) override;
+ void setWindowState(Qt::WindowStates state) override;
void setWindowFlags(Qt::WindowFlags flags) override;
Qt::WindowFlags windowFlags() const;
void setParent(const QPlatformWindow *window) override;
@@ -91,7 +91,7 @@ protected:
protected:
Qt::WindowFlags m_windowFlags;
- Qt::WindowState m_windowState;
+ Qt::WindowStates m_windowState;
WId m_windowId;
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index 13e59906ca..6ac5021ea9 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -6,6 +6,7 @@ OBJECTIVE_SOURCES += main.mm \
qcocoabackingstore.mm \
qcocoawindow.mm \
qnsview.mm \
+ qnswindow.mm \
qnsviewaccessibility.mm \
qnswindowdelegate.mm \
qcocoanativeinterface.mm \
@@ -39,6 +40,7 @@ HEADERS += qcocoaintegration.h \
qcocoabackingstore.h \
qcocoawindow.h \
qnsview.h \
+ qnswindow.h \
qnswindowdelegate.h \
qcocoanativeinterface.h \
qcocoaeventdispatcher.h \
@@ -73,12 +75,12 @@ qtConfig(opengl.*) {
RESOURCES += qcocoaresources.qrc
-LIBS += -framework AppKit -framework Carbon -framework IOKit -lcups
+LIBS += -framework AppKit -framework Carbon -framework IOKit -framework QuartzCore -lcups
QT += \
core-private gui-private \
accessibility_support-private clipboard_support-private theme_support-private \
- fontdatabase_support-private graphics_support-private cgl_support-private
+ fontdatabase_support-private graphics_support-private
CONFIG += no_app_extension_api_only
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index b15c486e9d..8b6dcb35a6 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -41,8 +41,6 @@
#include <QtGui/qaccessible.h>
#include <private/qcore_mac_p.h>
-#include <Carbon/Carbon.h>
-
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
@@ -369,7 +367,7 @@ id getValueAttribute(QAccessibleInterface *interface)
QString text;
if (interface->state().passwordEdit) {
// return round password replacement chars
- text = QString(end, QChar(kBulletUnicode));
+ text = QString(end, QChar(0x2022));
} else {
// VoiceOver will read out the entire text string at once when returning
// text as a value. For large text edits the size of the returned string
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index 5ed455fd71..002e5b40a8 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -42,6 +42,8 @@
#include <QtGraphicsSupport/private/qrasterbackingstore_p.h>
+#include <private/qcore_mac_p.h>
+
QT_BEGIN_NAMESPACE
class QCocoaBackingStore : public QRasterBackingStore
@@ -50,10 +52,16 @@ public:
QCocoaBackingStore(QWindow *window);
~QCocoaBackingStore();
+ void beginPaint(const QRegion &) override;
+ void endPaint() override;
+
void flush(QWindow *, const QRegion &, const QPoint &) Q_DECL_OVERRIDE;
private:
+ bool windowHasUnifiedToolbar() const;
QImage::Format format() const Q_DECL_OVERRIDE;
+ void redrawRoundedBottomCorners(CGRect) const;
+ QCFType<CGImageRef> m_cgImage;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index 1d7ad772dc..1f39d787be 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -44,33 +44,260 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcCocoaBackingStore, "qt.qpa.cocoa.backingstore");
+
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
: QRasterBackingStore(window)
+ , m_cgImage(nullptr)
{
}
QCocoaBackingStore::~QCocoaBackingStore()
{
- if (QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window()->handle()))
- [qnsview_cast(cocoaWindow->view()) clearBackingStore:this];
+}
+
+bool QCocoaBackingStore::windowHasUnifiedToolbar() const
+{
+ Q_ASSERT(window()->handle());
+ return static_cast<QCocoaWindow *>(window()->handle())->m_drawContentBorderGradient;
}
QImage::Format QCocoaBackingStore::format() const
{
- QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window()->handle());
- if (cocoaWindow && cocoaWindow->m_drawContentBorderGradient)
+ if (windowHasUnifiedToolbar())
return QImage::Format_ARGB32_Premultiplied;
return QRasterBackingStore::format();
}
+void QCocoaBackingStore::beginPaint(const QRegion &region)
+{
+ m_cgImage = nullptr;
+ QRasterBackingStore::beginPaint(region);
+}
+
+void QCocoaBackingStore::endPaint()
+{
+ QRasterBackingStore::endPaint();
+
+ // Prevent potentially costly color conversion by assiging the display
+ // color space to the backingstore image.
+ NSView *view = static_cast<QCocoaWindow *>(window()->handle())->view();
+ CGColorSpaceRef displayColorSpace = view.window.screen.colorSpace.CGColorSpace;
+ QCFType<CGImageRef> displayColorSpaceImage =
+ CGImageCreateCopyWithColorSpace(m_image.toCGImage(), displayColorSpace);
+
+ m_cgImage = displayColorSpaceImage;
+}
+
+#if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
+static const NSCompositingOperation NSCompositingOperationCopy = NSCompositeCopy;
+static const NSCompositingOperation NSCompositingOperationSourceOver = NSCompositeSourceOver;
+#endif
+
+/*!
+ Flushes the given \a region from the specified \a window onto the
+ screen.
+
+ The \a window is the top level window represented by this backingstore,
+ or a non-transient child of that window.
+
+ If the \a window is a child window, the \a region will be in child window
+ coordinates, and the \a offset will be the child window's offset in relation
+ to the backingstore's top level window.
+*/
void QCocoaBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
if (m_image.isNull())
return;
- if (QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle()))
- [qnsview_cast(cocoaWindow->view()) flushBackingStore:this region:region offset:offset];
+ const QWindow *topLevelWindow = this->window();
+
+ Q_ASSERT(topLevelWindow->handle() && window->handle());
+ Q_ASSERT(!topLevelWindow->handle()->isForeignWindow() && !window->handle()->isForeignWindow());
+
+ QNSView *topLevelView = qnsview_cast(static_cast<QCocoaWindow *>(topLevelWindow->handle())->view());
+ QNSView *view = qnsview_cast(static_cast<QCocoaWindow *>(window->handle())->view());
+
+ if (lcCocoaBackingStore().isDebugEnabled()) {
+ QString targetViewDescription;
+ if (view != topLevelView) {
+ QDebug targetDebug(&targetViewDescription);
+ targetDebug << "onto" << topLevelView << "at" << offset;
+ }
+ qCDebug(lcCocoaBackingStore) << "Flushing" << region << "of" << view << qPrintable(targetViewDescription);
+ }
+
+ if (view.layer) {
+ // In layer-backed mode, locking focus on a view does not give the right
+ // view transformation, and doesn't give us a graphics context to render
+ // via when drawing outside of the display cycle. Instead we tell AppKit
+ // that we want to update the layer's content, via [NSView wantsUpdateLayer],
+ // which result in AppKit not creating a backingstore for each layer, and
+ // we then directly set the layer's backingstore (content) to our backingstore,
+ // masked to the part of the subview that is relevant.
+ // FIXME: Figure out if there's a way to do partial updates
+ view.layer.contents = (__bridge id)static_cast<CGImageRef>(m_cgImage);
+ if (view != topLevelView) {
+ view.layer.contentsRect = CGRectApplyAffineTransform(
+ [view convertRect:view.bounds toView:topLevelView],
+ // The contentsRect is in unit coordinate system
+ CGAffineTransformMakeScale(1.0 / m_image.width(), 1.0 / m_image.height()));
+ }
+ return;
+ }
+
+ // Normally a NSView is drawn via drawRect, as part of the display cycle in the
+ // main runloop, via setNeedsDisplay and friends. AppKit will lock focus on each
+ // individual view, starting with the top level and then traversing any subviews,
+ // calling drawRect for each of them. This pull model results in expose events
+ // sent to Qt, which result in drawing to the backingstore and flushing it.
+ // Qt may also decide to paint and flush the backingstore via e.g. timers,
+ // or other events such as mouse events, in which case we're in a push model.
+ // If there is no focused view, it means we're in the latter case, and need
+ // to manually flush the NSWindow after drawing to its graphic context.
+ const bool drawingOutsideOfDisplayCycle = ![NSView focusView];
+
+ // We also need to ensure the flushed view has focus, so that the graphics
+ // 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
+ // 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.
+ const bool shouldHandleViewLockManually = [NSView focusView] != view;
+ if (shouldHandleViewLockManually && ![view lockFocusIfCanDraw]) {
+ qWarning() << "failed to lock focus of" << view;
+ return;
+ }
+
+ const qreal devicePixelRatio = m_image.devicePixelRatio();
+
+ // If the flushed window is a content view, and not in unified toolbar mode,
+ // we can get away with copying the backingstore instead of blending.
+ const NSCompositingOperation compositingOperation = static_cast<QCocoaWindow *>(
+ window->handle())->isContentView() && !windowHasUnifiedToolbar() ?
+ NSCompositingOperationCopy : NSCompositingOperationSourceOver;
+
+#ifdef QT_DEBUG
+ static bool debugBackingStoreFlush = [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"QtCocoaDebugBackingStoreFlush"];
+#endif
+
+ // -------------------------------------------------------------------------
+
+ // The current contexts is typically a NSWindowGraphicsContext, but can be
+ // NSBitmapGraphicsContext e.g. when debugging the view hierarchy in Xcode.
+ // If we need to distinguish things here in the future, we can use e.g.
+ // [NSGraphicsContext drawingToScreen], or the attributes of the context.
+ NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
+ Q_ASSERT_X(graphicsContext, "QCocoaBackingStore",
+ "Focusing the view should give us a current graphics context");
+
+ // Create temporary image to use for blitting, without copying image data
+ NSImage *backingStoreImage = [[[NSImage alloc] initWithCGImage:m_cgImage size:NSZeroSize] autorelease];
+
+ QRegion clippedRegion = region;
+ for (QWindow *w = window; w; w = w->parent()) {
+ if (!w->mask().isEmpty()) {
+ clippedRegion &= w == window ? w->mask()
+ : w->mask().translated(window->mapFromGlobal(w->mapToGlobal(QPoint(0, 0))));
+ }
+ }
+
+ for (const QRect &viewLocalRect : clippedRegion) {
+ QPoint backingStoreOffset = viewLocalRect.topLeft() + offset;
+ QRect backingStoreRect(backingStoreOffset * devicePixelRatio, viewLocalRect.size() * devicePixelRatio);
+ if (graphicsContext.flipped) // Flip backingStoreRect to match graphics context
+ backingStoreRect.moveTop(m_image.height() - (backingStoreRect.y() + backingStoreRect.height()));
+
+ CGRect viewRect = viewLocalRect.toCGRect();
+
+ if (windowHasUnifiedToolbar())
+ NSDrawWindowBackground(viewRect);
+
+ [backingStoreImage drawInRect:viewRect fromRect:backingStoreRect.toCGRect()
+ operation:compositingOperation fraction:1.0 respectFlipped:YES hints:nil];
+
+#ifdef QT_DEBUG
+ if (Q_UNLIKELY(debugBackingStoreFlush)) {
+ [[NSColor colorWithCalibratedRed:drand48() green:drand48() blue:drand48() alpha:0.3] set];
+ [NSBezierPath fillRect:viewRect];
+
+ if (drawingOutsideOfDisplayCycle) {
+ [[[NSColor magentaColor] colorWithAlphaComponent:0.5] set];
+ [NSBezierPath strokeLineFromPoint:viewLocalRect.topLeft().toCGPoint()
+ toPoint:viewLocalRect.bottomRight().toCGPoint()];
+ }
+ }
+#endif
+ }
+
+ QCocoaWindow *topLevelCocoaWindow = static_cast<QCocoaWindow *>(topLevelWindow->handle());
+ if (Q_UNLIKELY(topLevelCocoaWindow->m_needsInvalidateShadow)) {
+ [topLevelView.window invalidateShadow];
+ topLevelCocoaWindow->m_needsInvalidateShadow = false;
+ }
+
+ // -------------------------------------------------------------------------
+
+ if (shouldHandleViewLockManually)
+ [view unlockFocus];
+
+ if (drawingOutsideOfDisplayCycle) {
+ redrawRoundedBottomCorners([view convertRect:region.boundingRect().toCGRect() toView:nil]);
+ [view.window flushWindow];
+ }
+}
+
+/*
+ When drawing outside of the display cycle, which Qt Widget does a lot,
+ we end up drawing over the NSThemeFrame, losing the rounded corners of
+ windows in the process.
+
+ To work around this, until we've enabled updates via setNeedsDisplay and/or
+ enabled layer-backed views, we ask the NSWindow to redraw the bottom corners
+ if they intersect with the flushed region.
+
+ This is the same logic used internally by e.g [NSView displayIfNeeded],
+ [NSRulerView _scrollToMatchContentView], and [NSClipView _immediateScrollToPoint:],
+ as well as the workaround used by WebKit to fix a similar bug:
+
+ https://trac.webkit.org/changeset/85376/webkit
+*/
+void QCocoaBackingStore::redrawRoundedBottomCorners(CGRect windowRect) const
+{
+#if !defined(QT_APPLE_NO_PRIVATE_APIS)
+ Q_ASSERT(this->window()->handle());
+ NSWindow *window = static_cast<QCocoaWindow *>(this->window()->handle())->nativeWindow();
+
+ static SEL intersectBottomCornersWithRect = NSSelectorFromString(
+ [NSString stringWithFormat:@"_%s%s:", "intersectBottomCorners", "WithRect"]);
+ if (NSMethodSignature *signature = [window methodSignatureForSelector:intersectBottomCornersWithRect]) {
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ invocation.target = window;
+ invocation.selector = intersectBottomCornersWithRect;
+ [invocation setArgument:&windowRect atIndex:2];
+ [invocation invoke];
+
+ NSRect cornerOverlap = NSZeroRect;
+ [invocation getReturnValue:&cornerOverlap];
+ if (!NSIsEmptyRect(cornerOverlap)) {
+ static SEL maskRoundedBottomCorners = NSSelectorFromString(
+ [NSString stringWithFormat:@"_%s%s:", "maskRounded", "BottomCorners"]);
+ if ((signature = [window methodSignatureForSelector:maskRoundedBottomCorners])) {
+ invocation = [NSInvocation invocationWithMethodSignature:signature];
+ invocation.target = window;
+ invocation.selector = maskRoundedBottomCorners;
+ [invocation setArgument:&cornerOverlap atIndex:2];
+ [invocation invoke];
+ }
+ }
+ }
+#else
+ Q_UNUSED(windowRect);
+#endif
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index 9ebb090989..c7277a47bf 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -55,7 +55,7 @@ public:
QCocoaDrag();
~QCocoaDrag();
- QMimeData *platformDropData() Q_DECL_OVERRIDE;
+ QMimeData *dragMimeData();
Qt::DropAction drag(QDrag *m_drag) Q_DECL_OVERRIDE;
Qt::DropAction defaultAction(Qt::DropActions possibleActions,
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index c71e80d191..3bd0b05725 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -68,7 +68,7 @@ void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view)
m_lastView = view;
}
-QMimeData *QCocoaDrag::platformDropData()
+QMimeData *QCocoaDrag::dragMimeData()
{
if (m_drag)
return m_drag->mimeData();
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
index 70887c41c9..2ffc1395ba 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
@@ -177,8 +177,6 @@ public:
void maybeCancelWaitForMoreEvents();
void ensureNSAppInitialized();
- void removeQueuedUserInputEvents(int nsWinNumber);
-
QCFSocketNotifier cfSocketNotifier;
QList<void *> queuedUserInputEvents; // NSEvent *
CFRunLoopSourceRef postedEventsSource;
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index b22f1b1f54..bf9ba4eccf 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -86,7 +86,6 @@
#include <qdebug.h>
#include <AppKit/AppKit.h>
-#include <Carbon/Carbon.h>
QT_BEGIN_NAMESPACE
@@ -285,7 +284,7 @@ bool QCocoaEventDispatcher::hasPendingEvents()
{
extern uint qGlobalPostedEventsCount();
extern bool qt_is_gui_used; //qapplication.cpp
- return qGlobalPostedEventsCount() || (qt_is_gui_used && GetNumEventsInQueue(GetMainEventQueue()));
+ return qGlobalPostedEventsCount() || (qt_is_gui_used && !CFRunLoopIsWaiting(CFRunLoopGetMain()));
}
static bool IsMouseOrKeyEvent( NSEvent* event )
@@ -900,21 +899,6 @@ void QCocoaEventDispatcherPrivate::processPostedEvents()
}
}
-void QCocoaEventDispatcherPrivate::removeQueuedUserInputEvents(int nsWinNumber)
-{
- if (nsWinNumber) {
- int eventIndex = queuedUserInputEvents.size();
-
- while (--eventIndex >= 0) {
- NSEvent * nsevent = static_cast<NSEvent *>(queuedUserInputEvents.at(eventIndex));
- if ([nsevent windowNumber] == nsWinNumber) {
- queuedUserInputEvents.removeAt(eventIndex);
- [nsevent release];
- }
- }
- }
-}
-
void QCocoaEventDispatcherPrivate::firstLoopEntry(CFRunLoopObserverRef ref,
CFRunLoopActivity activity,
void *info)
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 74148b7cbf..9a00eb89b7 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -231,7 +231,7 @@ static QString strippedText(QString s)
[mOpenPanel beginWithCompletionHandler:^(NSInteger result){
mReturnCode = result;
if (mHelper)
- mHelper->QNSOpenSavePanelDelegate_panelClosed(result == NSOKButton);
+ mHelper->QNSOpenSavePanelDelegate_panelClosed(result == NSModalResponseOK);
}];
}
}
@@ -260,12 +260,12 @@ static QString strippedText(QString s)
QCocoaMenuBar::resetKnownMenuItemsToQt();
QAbstractEventDispatcher::instance()->interrupt();
- return (mReturnCode == NSOKButton);
+ return (mReturnCode == NSModalResponseOK);
}
- (QPlatformDialogHelper::DialogCode)dialogResultCode
{
- return (mReturnCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
+ return (mReturnCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
}
- (void)showWindowModalSheet:(QWindow *)parent
@@ -286,7 +286,7 @@ static QString strippedText(QString s)
[mSavePanel beginSheetModalForWindow:nsparent completionHandler:^(NSInteger result){
mReturnCode = result;
if (mHelper)
- mHelper->QNSOpenSavePanelDelegate_panelClosed(result == NSOKButton);
+ mHelper->QNSOpenSavePanelDelegate_panelClosed(result == NSModalResponseOK);
}];
}
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 9e688f4d1b..75ac348802 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -42,7 +42,6 @@
#include "qcocoahelpers.h"
#include <qdebug.h>
#include <QtCore/private/qcore_mac_p.h>
-#include <QtCglSupport/private/cglconvenience_p.h>
#include <QtPlatformHeaders/qcocoanativecontext.h>
#include <dlfcn.h>
@@ -154,7 +153,7 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo
QMacAutoReleasePool pool; // For the SG Canvas render thread
// create native context for the requested pixel format and share
- NSOpenGLPixelFormat *pixelFormat = static_cast <NSOpenGLPixelFormat *>(qcgl_createNSOpenGLPixelFormat(m_format));
+ NSOpenGLPixelFormat *pixelFormat = createNSOpenGLPixelFormat(m_format);
m_shareContext = share ? static_cast<QCocoaGLContext *>(share)->nsOpenGLContext() : nil;
m_context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:m_shareContext];
@@ -202,7 +201,6 @@ QVariant QCocoaGLContext::nativeHandle() const
return QVariant::fromValue<QCocoaNativeContext>(QCocoaNativeContext(m_context));
}
-// Match up with createNSOpenGLPixelFormat!
QSurfaceFormat QCocoaGLContext::format() const
{
return m_format;
@@ -362,7 +360,64 @@ void QCocoaGLContext::update()
NSOpenGLPixelFormat *QCocoaGLContext::createNSOpenGLPixelFormat(const QSurfaceFormat &format)
{
- return static_cast<NSOpenGLPixelFormat *>(qcgl_createNSOpenGLPixelFormat(format));
+ QVector<NSOpenGLPixelFormatAttribute> attrs;
+
+ if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer
+ || format.swapBehavior() == QSurfaceFormat::DefaultSwapBehavior)
+ attrs.append(NSOpenGLPFADoubleBuffer);
+ else if (format.swapBehavior() == QSurfaceFormat::TripleBuffer)
+ attrs.append(NSOpenGLPFATripleBuffer);
+
+
+ // Select OpenGL profile
+ attrs << NSOpenGLPFAOpenGLProfile;
+ if (format.profile() == QSurfaceFormat::CoreProfile) {
+ if (format.version() >= qMakePair(4, 1))
+ attrs << NSOpenGLProfileVersion4_1Core;
+ else if (format.version() >= qMakePair(3, 2))
+ attrs << NSOpenGLProfileVersion3_2Core;
+ else
+ attrs << NSOpenGLProfileVersionLegacy;
+ } else {
+ attrs << NSOpenGLProfileVersionLegacy;
+ }
+
+ if (format.depthBufferSize() > 0)
+ attrs << NSOpenGLPFADepthSize << format.depthBufferSize();
+ if (format.stencilBufferSize() > 0)
+ attrs << NSOpenGLPFAStencilSize << format.stencilBufferSize();
+ if (format.alphaBufferSize() > 0)
+ attrs << NSOpenGLPFAAlphaSize << format.alphaBufferSize();
+ if ((format.redBufferSize() > 0) &&
+ (format.greenBufferSize() > 0) &&
+ (format.blueBufferSize() > 0)) {
+ const int colorSize = format.redBufferSize() +
+ format.greenBufferSize() +
+ format.blueBufferSize();
+ attrs << NSOpenGLPFAColorSize << colorSize << NSOpenGLPFAMinimumPolicy;
+ }
+
+ if (format.samples() > 0) {
+ attrs << NSOpenGLPFAMultisample
+ << NSOpenGLPFASampleBuffers << (NSOpenGLPixelFormatAttribute) 1
+ << NSOpenGLPFASamples << (NSOpenGLPixelFormatAttribute) format.samples();
+ }
+
+ if (format.stereo())
+ attrs << NSOpenGLPFAStereo;
+
+ attrs << NSOpenGLPFAAllowOfflineRenderers;
+
+ 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;
+ }
+
+ attrs << 0;
+
+ return [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs.constData()];
}
NSOpenGLContext *QCocoaGLContext::nsOpenGLContext() const
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h
index 4478895538..7810733255 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.h
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.h
@@ -55,6 +55,9 @@
#include <QtGui/qpalette.h>
#include <QtGui/qscreen.h>
+#include <objc/runtime.h>
+#include <objc/message.h>
+
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSView));
QT_BEGIN_NAMESPACE
@@ -188,5 +191,131 @@ QT_END_NAMESPACE
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanelContentsWrapper);
+// -------------------------------------------------------------------------
+
+// Depending on the ABI of the platform, we may need to use objc_msgSendSuper_stret:
+// - http://www.sealiesoftware.com/blog/archive/2008/10/30/objc_explain_objc_msgSend_stret.html
+// - https://lists.apple.com/archives/cocoa-dev/2008/Feb/msg02338.html
+template <typename T>
+struct objc_msgsend_requires_stret
+{ static const bool value =
+#if defined(Q_PROCESSOR_X86)
+ // Any return value larger than two registers on i386/x86_64
+ sizeof(T) > sizeof(void*) * 2;
+#elif defined(Q_PROCESSOR_ARM_32)
+ // Any return value larger than a single register on arm
+ sizeof(T) > sizeof(void*);
+#elif defined(Q_PROCESSOR_ARM_64)
+ // Stret not used on arm64
+ false;
+#endif
+};
+
+template <>
+struct objc_msgsend_requires_stret<void>
+{ static const bool value = false; };
+
+template <typename ReturnType, typename... Args>
+ReturnType qt_msgSendSuper(id receiver, SEL selector, Args... args)
+{
+ static_assert(!objc_msgsend_requires_stret<ReturnType>::value,
+ "The given return type requires stret on this platform");
+
+ typedef ReturnType (*SuperFn)(objc_super *, SEL, Args...);
+ SuperFn superFn = reinterpret_cast<SuperFn>(objc_msgSendSuper);
+ objc_super sup = { receiver, [receiver superclass] };
+ return superFn(&sup, selector, args...);
+}
+
+template <typename ReturnType, typename... Args>
+ReturnType qt_msgSendSuper_stret(id receiver, SEL selector, Args... args)
+{
+ static_assert(objc_msgsend_requires_stret<ReturnType>::value,
+ "The given return type does not use stret on this platform");
+
+ typedef void (*SuperStretFn)(ReturnType *, objc_super *, SEL, Args...);
+ SuperStretFn superStretFn = reinterpret_cast<SuperStretFn>(objc_msgSendSuper_stret);
+
+ objc_super sup = { receiver, [receiver superclass] };
+ ReturnType ret;
+ superStretFn(&ret, &sup, selector, args...);
+ return ret;
+}
+
+template<typename... Args>
+class QSendSuperHelper {
+public:
+ QSendSuperHelper(id receiver, SEL sel, Args... args)
+ : m_receiver(receiver), m_selector(sel), m_args(std::make_tuple(args...)), m_sent(false)
+ {
+ }
+
+ ~QSendSuperHelper()
+ {
+ if (!m_sent)
+ msgSendSuper<void>(m_args);
+ }
+
+ template <typename ReturnType>
+ operator ReturnType()
+ {
+#if defined(QT_DEBUG)
+ Method method = class_getInstanceMethod(object_getClass(m_receiver), m_selector);
+ char returnTypeEncoding[256];
+ method_getReturnType(method, returnTypeEncoding, sizeof(returnTypeEncoding));
+ NSUInteger alignedReturnTypeSize = 0;
+ NSGetSizeAndAlignment(returnTypeEncoding, nullptr, &alignedReturnTypeSize);
+ Q_ASSERT(alignedReturnTypeSize == sizeof(ReturnType));
+#endif
+ m_sent = true;
+ return msgSendSuper<ReturnType>(m_args);
+ }
+
+private:
+ template <std::size_t... Ts>
+ struct index {};
+
+ template <std::size_t N, std::size_t... Ts>
+ struct gen_seq : gen_seq<N - 1, N - 1, Ts...> {};
+
+ template <std::size_t... Ts>
+ struct gen_seq<0, Ts...> : index<Ts...> {};
+
+ template <typename ReturnType, bool V>
+ using if_requires_stret = typename std::enable_if<objc_msgsend_requires_stret<ReturnType>::value == V, ReturnType>::type;
+
+ template <typename ReturnType, std::size_t... Is>
+ if_requires_stret<ReturnType, false> msgSendSuper(std::tuple<Args...>& args, index<Is...>)
+ {
+ return qt_msgSendSuper<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...);
+ }
+
+ template <typename ReturnType, std::size_t... Is>
+ if_requires_stret<ReturnType, true> msgSendSuper(std::tuple<Args...>& args, index<Is...>)
+ {
+ return qt_msgSendSuper_stret<ReturnType>(m_receiver, m_selector, std::get<Is>(args)...);
+ }
+
+ template <typename ReturnType>
+ ReturnType msgSendSuper(std::tuple<Args...>& args)
+ {
+ return msgSendSuper<ReturnType>(args, gen_seq<sizeof...(Args)>{});
+ }
+
+ id m_receiver;
+ SEL m_selector;
+ std::tuple<Args...> m_args;
+ bool m_sent;
+};
+
+template<typename... Args>
+QSendSuperHelper<Args...> qt_objcDynamicSuperHelper(id receiver, SEL selector, Args... args)
+{
+ return QSendSuperHelper<Args...>(receiver, selector, args...);
+}
+
+// Same as calling super, but the super_class field resolved at runtime instead of compile time
+#define qt_objcDynamicSuper(...) qt_objcDynamicSuperHelper(self, _cmd, ##__VA_ARGS__)
+
#endif //QCOCOAHELPERS_H
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 5d0f13c5a9..9f9618177d 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -55,8 +55,6 @@
#include <algorithm>
-#include <Carbon/Carbon.h>
-
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaCocoaWindow, "qt.qpa.cocoa.window");
@@ -407,6 +405,7 @@ QT_END_NAMESPACE
self.panelContents.needsDisplay = YES;
self.needsDisplay = YES;
+ [super layout];
}
@end
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h
index ecdd20c4dc..d3f2079042 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.h
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.h
@@ -92,6 +92,8 @@ public:
QPointF mapFromNative(const QPointF &pos) const { return flipCoordinate(pos); }
QRectF mapFromNative(const QRectF &rect) const { return flipCoordinate(rect); }
+ static QCocoaScreen *primaryScreen();
+
private:
QPointF flipCoordinate(const QPointF &pos) const;
QRectF flipCoordinate(const QRectF &rect) const;
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index bac49cfad9..7b1e689388 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -145,7 +145,7 @@ void QCocoaScreen::updateGeometry()
// we may be in the process of creating and registering the primary screen, we
// must special-case that and assign it direcly.
QCocoaScreen *primaryScreen = (nsScreen == [[NSScreen screens] firstObject]) ?
- this : static_cast<QCocoaScreen*>(QGuiApplication::primaryScreen()->handle());
+ this : QCocoaScreen::primaryScreen();
m_geometry = primaryScreen->mapFromNative(m_geometry).toRect();
m_availableGeometry = primaryScreen->mapFromNative(m_availableGeometry).toRect();
@@ -218,7 +218,7 @@ QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const
continue;
id<QNSWindowProtocol> proto = static_cast<id<QNSWindowProtocol> >(nsWindow);
- QCocoaWindow *cocoaWindow = proto.helper.platformWindow;
+ QCocoaWindow *cocoaWindow = proto.platformWindow;
if (!cocoaWindow)
continue;
window = cocoaWindow->window();
@@ -293,6 +293,14 @@ QPixmap QCocoaScreen::grabWindow(WId window, int x, int y, int width, int height
return windowPixmap;
}
+/*!
+ The screen used as a reference for global window geometry
+*/
+QCocoaScreen *QCocoaScreen::primaryScreen()
+{
+ return static_cast<QCocoaScreen *>(QGuiApplication::primaryScreen()->handle());
+}
+
static QCocoaIntegration::Options parseOptions(const QStringList &paramList)
{
QCocoaIntegration::Options options;
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
index 1ef7f11011..5fa062bbe0 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -72,14 +72,6 @@ static const Qt::KeyboardModifiers ModsTbl[] = {
bool qt_mac_eat_unicode_key = false;
-Q_GUI_EXPORT void qt_mac_secure_keyboard(bool b)
-{
- static bool secure = false;
- if (b != secure){
- b ? EnableSecureEventInput() : DisableSecureEventInput();
- secure = b;
- }
-}
/* key maps */
struct qt_mac_enum_mapper
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index 06688dbf3d..484f185fc0 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -55,11 +55,6 @@ public:
QCocoaMenu();
~QCocoaMenu();
- void setTag(quintptr tag) Q_DECL_OVERRIDE
- { m_tag = tag; }
- quintptr tag() const Q_DECL_OVERRIDE
- { return m_tag; }
-
void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
@@ -106,7 +101,6 @@ private:
QList<QCocoaMenuItem *> m_menuItems;
NSMenu *m_nativeMenu;
NSMenuItem *m_attachedItem;
- quintptr m_tag;
int m_updateTimer;
bool m_enabled:1;
bool m_parentEnabled:1;
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 3a11023a4d..eeb4c01791 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -259,7 +259,6 @@ QT_BEGIN_NAMESPACE
QCocoaMenu::QCocoaMenu() :
m_attachedItem(0),
- m_tag(0),
m_updateTimer(0),
m_enabled(true),
m_parentEnabled(true),
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.h b/src/plugins/platforms/cocoa/qcocoamenuitem.h
index 23f788687c..53862d0484 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.h
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.h
@@ -78,11 +78,6 @@ public:
QCocoaMenuItem();
~QCocoaMenuItem();
- void setTag(quintptr tag) Q_DECL_OVERRIDE
- { m_tag = tag; }
- quintptr tag() const Q_DECL_OVERRIDE
- { return m_tag; }
-
void setText(const QString &text) Q_DECL_OVERRIDE;
void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
@@ -129,7 +124,6 @@ private:
#ifndef QT_NO_SHORTCUT
QKeySequence m_shortcut;
#endif
- quintptr m_tag;
int m_iconSize;
bool m_textSynced:1;
bool m_isVisible:1;
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index 21f2b4de85..d135b244e0 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -95,7 +95,6 @@ QCocoaMenuItem::QCocoaMenuItem() :
m_itemView(nil),
m_menu(NULL),
m_role(NoRole),
- m_tag(0),
m_iconSize(16),
m_textSynced(false),
m_isVisible(true),
diff --git a/src/plugins/platforms/cocoa/qcocoamimetypes.mm b/src/plugins/platforms/cocoa/qcocoamimetypes.mm
index 093f86da6e..f7662a92a4 100644
--- a/src/plugins/platforms/cocoa/qcocoamimetypes.mm
+++ b/src/plugins/platforms/cocoa/qcocoamimetypes.mm
@@ -105,101 +105,9 @@ QList<QByteArray> QMacPasteboardMimeTraditionalMacPlainText::convertFromMime(con
return ret;
}
-class QMacPasteboardMimeTiff : public QMacInternalPasteboardMime {
-public:
- QMacPasteboardMimeTiff() : QMacInternalPasteboardMime(MIME_ALL) { }
- QString convertorName();
-
- QString flavorFor(const QString &mime);
- QString mimeFor(QString flav);
- bool canConvert(const QString &mime, QString flav);
- QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav);
- QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav);
-};
-
-QString QMacPasteboardMimeTiff::convertorName()
-{
- return QLatin1String("Tiff");
-}
-
-QString QMacPasteboardMimeTiff::flavorFor(const QString &mime)
-{
- if (mime.startsWith(QLatin1String("application/x-qt-image")))
- return QLatin1String("public.tiff");
- return QString();
-}
-
-QString QMacPasteboardMimeTiff::mimeFor(QString flav)
-{
- if (flav == QLatin1String("public.tiff"))
- return QLatin1String("application/x-qt-image");
- return QString();
-}
-
-bool QMacPasteboardMimeTiff::canConvert(const QString &mime, QString flav)
-{
- return flav == QLatin1String("public.tiff") && mime == QLatin1String("application/x-qt-image");
-}
-
-QVariant QMacPasteboardMimeTiff::convertToMime(const QString &mime, QList<QByteArray> data, QString flav)
-{
- if (data.count() > 1)
- qWarning("QMacPasteboardMimeTiff: Cannot handle multiple member data");
- QVariant ret;
- if (!canConvert(mime, flav))
- return ret;
- const QByteArray &a = data.first();
- QCFType<CGImageRef> image;
- QCFType<CFDataRef> tiffData = CFDataCreateWithBytesNoCopy(0,
- reinterpret_cast<const UInt8 *>(a.constData()),
- a.size(), kCFAllocatorNull);
- QCFType<CGImageSourceRef> imageSource = CGImageSourceCreateWithData(tiffData, 0);
- image = CGImageSourceCreateImageAtIndex(imageSource, 0, 0);
- if (image != 0)
- ret = QVariant(qt_mac_toQImage(image));
- return ret;
-}
-
-QList<QByteArray> QMacPasteboardMimeTiff::convertFromMime(const QString &mime, QVariant variant, QString flav)
-{
- QList<QByteArray> ret;
- if (!canConvert(mime, flav))
- return ret;
-
- QImage img = qvariant_cast<QImage>(variant);
- QCFType<CGImageRef> cgimage = qt_mac_toCGImage(img);
-
- QCFType<CFMutableDataRef> data = CFDataCreateMutable(0, 0);
- QCFType<CGImageDestinationRef> imageDestination = CGImageDestinationCreateWithData(data, kUTTypeTIFF, 1, 0);
- if (imageDestination != 0) {
- CFTypeRef keys[2];
- QCFType<CFTypeRef> values[2];
- QCFType<CFDictionaryRef> options;
- keys[0] = kCGImagePropertyPixelWidth;
- keys[1] = kCGImagePropertyPixelHeight;
- int width = img.width();
- int height = img.height();
- values[0] = CFNumberCreate(0, kCFNumberIntType, &width);
- values[1] = CFNumberCreate(0, kCFNumberIntType, &height);
- options = CFDictionaryCreate(0, reinterpret_cast<const void **>(keys),
- reinterpret_cast<const void **>(values), 2,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- CGImageDestinationAddImage(imageDestination, cgimage, options);
- CGImageDestinationFinalize(imageDestination);
- }
- QByteArray ar(CFDataGetLength(data), 0);
- CFDataGetBytes(data,
- CFRangeMake(0, ar.size()),
- reinterpret_cast<UInt8 *>(ar.data()));
- ret.append(ar);
- return ret;
-}
-
void QCocoaMimeTypes::initializeMimeTypes()
{
new QMacPasteboardMimeTraditionalMacPlainText;
- new QMacPasteboardMimeTiff;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index 26ab07ffaf..8943cb6cd5 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -103,7 +103,7 @@ void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceS
return static_cast<QCocoaWindow *>(window->handle())->currentContext()->nsOpenGLContext();
#endif
} else if (resourceString == "nswindow") {
- return static_cast<QCocoaWindow *>(window->handle())->m_nsWindow;
+ return static_cast<QCocoaWindow *>(window->handle())->nativeWindow();
}
return 0;
}
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 9ddad7fc7a..91fb6e973d 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company 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.
@@ -45,49 +45,8 @@
#include <QtGui/qfont.h>
#include <QtGui/private/qcoregraphics_p.h>
-#include <Carbon/Carbon.h>
-
QT_BEGIN_NAMESPACE
-QBrush qt_mac_brushForTheme(ThemeBrush brush)
-{
- QMacAutoReleasePool pool;
-
- QCFType<CGColorRef> cgClr = 0;
- HIThemeBrushCreateCGColor(brush, &cgClr);
- return qt_mac_toQBrush(cgClr);
-}
-
-QColor qt_mac_colorForThemeTextColor(ThemeTextColor themeColor)
-{
- // No GetThemeTextColor in 64-bit mode, use hardcoded values:
- switch (themeColor) {
- case kThemeTextColorAlertActive:
- case kThemeTextColorTabFrontActive:
- case kThemeTextColorBevelButtonActive:
- case kThemeTextColorListView:
- case kThemeTextColorPlacardActive:
- case kThemeTextColorPopupButtonActive:
- case kThemeTextColorPopupLabelActive:
- case kThemeTextColorPushButtonActive:
- return Qt::black;
- case kThemeTextColorAlertInactive:
- case kThemeTextColorDialogInactive:
- case kThemeTextColorPlacardInactive:
- case kThemeTextColorPopupButtonInactive:
- case kThemeTextColorPopupLabelInactive:
- case kThemeTextColorPushButtonInactive:
- case kThemeTextColorTabFrontInactive:
- case kThemeTextColorBevelButtonInactive:
- case kThemeTextColorMenuItemDisabled:
- return QColor(127, 127, 127, 255);
- case kThemeTextColorMenuItemSelected:
- return Qt::white;
- default:
- return QColor(0, 0, 0, 255); // ### TODO: Sample color like Qt 4.
- }
-}
-
QPalette * qt_mac_createSystemPalette()
{
QColor qc;
@@ -119,7 +78,7 @@ QPalette * qt_mac_createSystemPalette()
palette->setBrush(QPalette::Shadow, background.darker(170));
- qc = qt_mac_colorForThemeTextColor(kThemeTextColorDialogActive);
+ qc = qt_mac_toQColor([NSColor controlTextColor]);
palette->setColor(QPalette::Active, QPalette::Text, qc);
palette->setColor(QPalette::Active, QPalette::WindowText, qc);
palette->setColor(QPalette::Active, QPalette::HighlightedText, qc);
@@ -127,7 +86,7 @@ QPalette * qt_mac_createSystemPalette()
palette->setColor(QPalette::Inactive, QPalette::WindowText, qc);
palette->setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
- qc = qt_mac_colorForThemeTextColor(kThemeTextColorDialogInactive);
+ qc = qt_mac_toQColor([NSColor disabledControlTextColor]);
palette->setColor(QPalette::Disabled, QPalette::Text, qc);
palette->setColor(QPalette::Disabled, QPalette::WindowText, qc);
palette->setColor(QPalette::Disabled, QPalette::HighlightedText, qc);
@@ -136,60 +95,67 @@ QPalette * qt_mac_createSystemPalette()
}
struct QMacPaletteMap {
- inline QMacPaletteMap(QPlatformTheme::Palette p, ThemeBrush a, ThemeBrush i) :
+ inline QMacPaletteMap(QPlatformTheme::Palette p, NSColor *a, NSColor *i) :
paletteRole(p), active(a), inactive(i) { }
QPlatformTheme::Palette paletteRole;
- ThemeBrush active, inactive;
+ NSColor *active, *inactive;
};
+#define MAC_PALETTE_ENTRY(pal, active, inactive) \
+ QMacPaletteMap(pal, [NSColor active], [NSColor inactive])
static QMacPaletteMap mac_widget_colors[] = {
- QMacPaletteMap(QPlatformTheme::ToolButtonPalette, kThemeTextColorBevelButtonActive, kThemeTextColorBevelButtonInactive),
- QMacPaletteMap(QPlatformTheme::ButtonPalette, kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
- QMacPaletteMap(QPlatformTheme::HeaderPalette, kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
- QMacPaletteMap(QPlatformTheme::ComboBoxPalette, kThemeTextColorPopupButtonActive, kThemeTextColorPopupButtonInactive),
- QMacPaletteMap(QPlatformTheme::ItemViewPalette, kThemeTextColorListView, kThemeTextColorDialogInactive),
- QMacPaletteMap(QPlatformTheme::MessageBoxLabelPalette, kThemeTextColorAlertActive, kThemeTextColorAlertInactive),
- QMacPaletteMap(QPlatformTheme::TabBarPalette, kThemeTextColorTabFrontActive, kThemeTextColorTabFrontInactive),
- QMacPaletteMap(QPlatformTheme::LabelPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
- QMacPaletteMap(QPlatformTheme::GroupBoxPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
- QMacPaletteMap(QPlatformTheme::MenuPalette, kThemeTextColorMenuItemActive, kThemeTextColorMenuItemDisabled),
- QMacPaletteMap(QPlatformTheme::MenuBarPalette, kThemeTextColorMenuItemActive, kThemeTextColorMenuItemDisabled),
- //### TODO: The zeros below gives white-on-black text.
- QMacPaletteMap(QPlatformTheme::TextEditPalette, 0, 0),
- QMacPaletteMap(QPlatformTheme::TextLineEditPalette, 0, 0),
- QMacPaletteMap(QPlatformTheme::NPalettes, 0, 0) };
+ MAC_PALETTE_ENTRY(QPlatformTheme::ToolButtonPalette, controlTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::ButtonPalette, controlTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::HeaderPalette, headerTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::ComboBoxPalette, controlTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::ItemViewPalette, textColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::MessageBoxLabelPalette, textColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::TabBarPalette, controlTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::LabelPalette, textColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::GroupBoxPalette, textColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::MenuPalette, controlTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::MenuBarPalette, controlTextColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::TextEditPalette, textColor, disabledControlTextColor),
+ MAC_PALETTE_ENTRY(QPlatformTheme::TextLineEditPalette, textColor, disabledControlTextColor)
+};
+#undef MAC_PALETTE_ENTRY
+
+static const int mac_widget_colors_count = sizeof(mac_widget_colors) / sizeof(mac_widget_colors[0]);
QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
{
QHash<QPlatformTheme::Palette, QPalette*> palettes;
QColor qc;
- for (int i = 0; mac_widget_colors[i].paletteRole != QPlatformTheme::NPalettes; i++) {
+ for (int i = 0; i < mac_widget_colors_count; i++) {
QPalette &pal = *qt_mac_createSystemPalette();
if (mac_widget_colors[i].active != 0) {
- qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].active);
+ qc = qt_mac_toQColor(mac_widget_colors[i].active);
pal.setColor(QPalette::Active, QPalette::Text, qc);
pal.setColor(QPalette::Inactive, QPalette::Text, qc);
pal.setColor(QPalette::Active, QPalette::WindowText, qc);
pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Active, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
- qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].inactive);
+ qc = qt_mac_toQColor(mac_widget_colors[i].inactive);
pal.setColor(QPalette::Disabled, QPalette::Text, qc);
pal.setColor(QPalette::Disabled, QPalette::WindowText, qc);
pal.setColor(QPalette::Disabled, QPalette::HighlightedText, qc);
}
if (mac_widget_colors[i].paletteRole == QPlatformTheme::MenuPalette
|| mac_widget_colors[i].paletteRole == QPlatformTheme::MenuBarPalette) {
- pal.setBrush(QPalette::Background, qt_mac_brushForTheme(kThemeBrushMenuBackground));
- qc = qt_mac_colorForThemeTextColor(kThemeTextColorMenuItemActive);
+ pal.setBrush(QPalette::Background, qt_mac_toQColor([NSColor windowBackgroundColor]));
+ pal.setBrush(QPalette::Highlight, qt_mac_toQColor([NSColor selectedMenuItemColor]));
+ qc = qt_mac_toQColor([NSColor labelColor]);
pal.setBrush(QPalette::ButtonText, qc);
- qc = qt_mac_colorForThemeTextColor(kThemeTextColorMenuItemSelected);
+ pal.setBrush(QPalette::Text, qc);
+ qc = qt_mac_toQColor([NSColor selectedMenuItemTextColor]);
pal.setBrush(QPalette::HighlightedText, qc);
- qc = qt_mac_colorForThemeTextColor(kThemeTextColorMenuItemDisabled);
+ qc = qt_mac_toQColor([NSColor disabledControlTextColor]);
pal.setBrush(QPalette::Disabled, QPalette::Text, qc);
} else if ((mac_widget_colors[i].paletteRole == QPlatformTheme::ButtonPalette)
- || (mac_widget_colors[i].paletteRole == QPlatformTheme::HeaderPalette)) {
+ || (mac_widget_colors[i].paletteRole == QPlatformTheme::HeaderPalette)
+ || (mac_widget_colors[i].paletteRole == QPlatformTheme::TabBarPalette)) {
pal.setColor(QPalette::Disabled, QPalette::ButtonText,
pal.color(QPalette::Disabled, QPalette::Text));
pal.setColor(QPalette::Inactive, QPalette::ButtonText,
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index a1c1b379f7..04dce802f3 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -341,7 +341,7 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const
case IconPixmapSizes:
return QVariant::fromValue(QCocoaFileIconEngine::availableIconSizes());
case QPlatformTheme::PasswordMaskCharacter:
- return QVariant(QChar(kBulletUnicode));
+ return QVariant(QChar(0x2022));
case QPlatformTheme::UiEffects:
return QVariant(int(HoverEffect));
default:
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index deba861fcc..c650c86379 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -50,79 +50,15 @@
#include "qcocoaglcontext.h"
#endif
#include "qnsview.h"
+#include "qnswindow.h"
#include "qt_mac_p.h"
-QT_FORWARD_DECLARE_CLASS(QCocoaWindow)
-
-@class QT_MANGLE_NAMESPACE(QNSWindowHelper);
-
-@protocol QNSWindowProtocol
-
-@property (nonatomic, readonly) QT_MANGLE_NAMESPACE(QNSWindowHelper) *helper;
-
-- (void)superSendEvent:(NSEvent *)theEvent;
-- (void)closeAndRelease;
-
-@end
-
-typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow;
-
-@interface QT_MANGLE_NAMESPACE(QNSWindowHelper) : NSObject
-{
- QCocoaNSWindow *_window;
- QPointer<QCocoaWindow> _platformWindow;
- BOOL _grabbingMouse;
- BOOL _releaseOnMouseUp;
-}
-
-@property (nonatomic, readonly) QCocoaNSWindow *window;
-@property (nonatomic, readonly) QCocoaWindow *platformWindow;
-@property (nonatomic) BOOL grabbingMouse;
-@property (nonatomic) BOOL releaseOnMouseUp;
-
-- (id)initWithNSWindow:(QCocoaNSWindow *)window platformWindow:(QCocoaWindow *)platformWindow;
-- (void)handleWindowEvent:(NSEvent *)theEvent;
-- (void) clearWindow;
-
-@end
-
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowHelper);
-
-@interface QT_MANGLE_NAMESPACE(QNSWindow) : NSWindow<QNSWindowProtocol>
-{
- QNSWindowHelper *_helper;
-}
-
-@property (nonatomic, readonly) QNSWindowHelper *helper;
-
-- (id)initWithContentRect:(NSRect)contentRect
- screen:(NSScreen*)screen
- styleMask:(NSUInteger)windowStyle
- qPlatformWindow:(QCocoaWindow *)qpw;
-
-@end
-
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindow);
-
-@interface QT_MANGLE_NAMESPACE(QNSPanel) : NSPanel<QNSWindowProtocol>
-{
- QNSWindowHelper *_helper;
-}
-
-@property (nonatomic, readonly) QNSWindowHelper *helper;
-
-- (id)initWithContentRect:(NSRect)contentRect
- screen:(NSScreen*)screen
- styleMask:(NSUInteger)windowStyle
- qPlatformWindow:(QCocoaWindow *)qpw;
-
-@end
-
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanel);
+QT_BEGIN_NAMESPACE
-@class QT_MANGLE_NAMESPACE(QNSWindowDelegate);
+#ifndef QT_NO_DEBUG_STREAM
+class QDebug;
+#endif
-QT_BEGIN_NAMESPACE
// QCocoaWindow
//
// QCocoaWindow is an NSView (not an NSWindow!) in the sense
@@ -159,16 +95,15 @@ public:
QCocoaWindow(QWindow *tlw, WId nativeHandle = 0);
~QCocoaWindow();
+ void initialize() override;
+
void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
QRect geometry() const Q_DECL_OVERRIDE;
void setCocoaGeometry(const QRect &rect);
- void clipChildWindows();
- void clipWindow(const NSRect &clipRect);
- void show(bool becauseOfAncestor = false);
- void hide(bool becauseOfAncestor = false);
+
void setVisible(bool visible) Q_DECL_OVERRIDE;
void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
void setWindowTitle(const QString &title) Q_DECL_OVERRIDE;
void setWindowFilePath(const QString &filePath) Q_DECL_OVERRIDE;
void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE;
@@ -188,6 +123,7 @@ public:
bool isForeignWindow() const Q_DECL_OVERRIDE;
+ void requestUpdate() override;
void requestActivateWindow() Q_DECL_OVERRIDE;
WId winId() const Q_DECL_OVERRIDE;
@@ -221,11 +157,8 @@ public:
bool windowShouldClose();
bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const;
- void reportCurrentWindowState(bool unconditionally = false);
-
NSInteger windowLevel(Qt::WindowFlags flags);
NSUInteger windowStyleMask(Qt::WindowFlags flags);
- void setWindowShadow(Qt::WindowFlags flags);
void setWindowZoomButton(Qt::WindowFlags flags);
#ifndef QT_NO_OPENGL
@@ -242,8 +175,6 @@ public:
void setMenubar(QCocoaMenuBar *mb);
QCocoaMenuBar *menubar() const;
- NSCursor *effectiveWindowCursor() const;
- void applyEffectiveWindowCursor();
void setWindowCursor(NSCursor *cursor);
void registerTouch(bool enable);
@@ -252,14 +183,10 @@ public:
void setContentBorderAreaEnabled(quintptr identifier, bool enable);
void setContentBorderEnabled(bool enable);
bool testContentBorderAreaPosition(int position) const;
- void applyContentBorderThickness(NSWindow *window);
+ void applyContentBorderThickness(NSWindow *window = nullptr);
void updateNSToolbar();
qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- bool isWindowExposable();
- void exposeWindow();
- void obscureWindow();
- void updateExposedGeometry();
QWindow *childWindowAt(QPoint windowPoint);
bool shouldRefuseKeyWindowAndFirstResponder();
@@ -271,7 +198,6 @@ public:
ParentChanged = 0x1,
MissingWindow = 0x2,
WindowModalityChanged = 0x4,
- ChildNSWindowChanged = 0x8,
ContentViewChanged = 0x10,
PanelChanged = 0x20,
};
@@ -279,20 +205,13 @@ public:
Q_FLAG(RecreationReasons)
protected:
- bool isChildNSWindow() const;
- bool isContentView() const;
-
- void foreachChildNSWindow(void (^block)(QCocoaWindow *));
-
void recreateWindowIfNeeded();
- QCocoaNSWindow *createNSWindow(bool shouldBeChildNSWindow, bool shouldBePanel);
+ QCocoaNSWindow *createNSWindow(bool shouldBePanel);
QRect nativeWindowGeometry() const;
- void reinsertChildWindow(QCocoaWindow *child);
- void removeChildWindow(QCocoaWindow *child);
Qt::WindowState windowState() const;
- void applyWindowState(Qt::WindowState newState);
+ void applyWindowState(Qt::WindowStates newState);
void toggleMaximized();
void toggleFullScreen();
bool isTransitioningToFullScreen() const;
@@ -302,24 +221,34 @@ public: // for QNSView
friend class QCocoaBackingStore;
friend class QCocoaNativeInterface;
+ bool isContentView() const;
+
bool alwaysShowToolWindow() const;
void removeMonitor();
+ enum HandleFlags {
+ NoHandleFlags = 0,
+ HandleUnconditionally = 1
+ };
+
+ void handleGeometryChange();
+ void handleWindowStateChanged(HandleFlags flags = NoHandleFlags);
+ void handleExposeEvent(const QRegion &region);
+
NSView *m_view;
QCocoaNSWindow *m_nsWindow;
- QPointer<QCocoaWindow> m_forwardWindow;
// TODO merge to one variable if possible
bool m_viewIsEmbedded; // true if the m_view is actually embedded in a "foreign" NSView hiearchy
bool m_viewIsToBeEmbedded; // true if the m_view is intended to be embedded in a "foreign" NSView hiearchy
Qt::WindowFlags m_windowFlags;
- Qt::WindowState m_lastReportedWindowState;
+ Qt::WindowStates m_lastReportedWindowState;
Qt::WindowModality m_windowModality;
QPointer<QWindow> m_enterLeaveTargetWindow;
bool m_windowUnderMouse;
- bool m_inConstructor;
+ bool m_initialized;
bool m_inSetVisible;
bool m_inSetGeometry;
bool m_inSetStyleMask;
@@ -327,18 +256,14 @@ public: // for QNSView
QCocoaGLContext *m_glContext;
#endif
QCocoaMenuBar *m_menubar;
- NSCursor *m_windowCursor;
+
+ bool m_needsInvalidateShadow;
bool m_hasModalSession;
bool m_frameStrutEventsEnabled;
- bool m_geometryUpdateExposeAllowed;
bool m_isExposed;
- QRect m_exposedGeometry;
- qreal m_exposedDevicePixelRatio;
int m_registerTouchCount;
bool m_resizableTransientParent;
- bool m_hiddenByClipping;
- bool m_hiddenByAncestor;
static const int NoAlertRequest;
NSInteger m_alertRequest;
@@ -363,6 +288,10 @@ public: // for QNSView
bool m_hasWindowFilePath;
};
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QCocoaWindow *window);
+#endif
+
QT_END_NAMESPACE
#endif // QCOCOAWINDOW_H
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 6ef459566a..63ee8c10ac 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -46,6 +46,7 @@
#include "qcocoahelpers.h"
#include "qcocoanativeinterface.h"
#include "qnsview.h"
+#include "qnswindow.h"
#include <QtCore/qfileinfo.h>
#include <QtCore/private/qcore_mac_p.h>
#include <qwindow.h>
@@ -53,34 +54,22 @@
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformscreen.h>
#include <QtGui/private/qcoregraphics_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <AppKit/AppKit.h>
+#include <QuartzCore/QuartzCore.h>
#include <QDebug>
#include <vector>
+QT_BEGIN_NAMESPACE
+
enum {
defaultWindowWidth = 160,
defaultWindowHeight = 160
};
-static bool isMouseEvent(NSEvent *ev)
-{
- switch ([ev type]) {
- case NSLeftMouseDown:
- case NSLeftMouseUp:
- case NSRightMouseDown:
- case NSRightMouseUp:
- case NSMouseMoved:
- case NSLeftMouseDragged:
- case NSRightMouseDragged:
- return true;
- default:
- return false;
- }
-}
-
static void qt_closePopups()
{
while (QCocoaWindow *popup = QCocoaIntegration::instance()->popPopupWindow()) {
@@ -89,373 +78,6 @@ static void qt_closePopups()
}
}
-@interface NSWindow (FullScreenProperty)
-@property(readonly) BOOL qt_fullScreen;
-@end
-
-@implementation NSWindow (FullScreenProperty)
-
-+ (void)load
-{
- NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
- [center addObserverForName:NSWindowDidEnterFullScreenNotification object:nil queue:nil
- usingBlock:^(NSNotification *notification) {
- objc_setAssociatedObject(notification.object, @selector(qt_fullScreen),
- [NSNumber numberWithBool:YES], OBJC_ASSOCIATION_RETAIN);
- }
- ];
- [center addObserverForName:NSWindowDidExitFullScreenNotification object:nil queue:nil
- usingBlock:^(NSNotification *notification) {
- objc_setAssociatedObject(notification.object, @selector(qt_fullScreen),
- nil, OBJC_ASSOCIATION_RETAIN);
- }
- ];
-}
-
-- (BOOL)qt_fullScreen
-{
- NSNumber *number = objc_getAssociatedObject(self, @selector(qt_fullScreen));
- return [number boolValue];
-}
-@end
-
-@implementation QNSWindowHelper
-
-@synthesize window = _window;
-@synthesize grabbingMouse = _grabbingMouse;
-@synthesize releaseOnMouseUp = _releaseOnMouseUp;
-
-- (QCocoaWindow *)platformWindow
-{
- return _platformWindow.data();
-}
-
-- (id)initWithNSWindow:(QCocoaNSWindow *)window platformWindow:(QCocoaWindow *)platformWindow
-{
- self = [super init];
- if (self) {
- _window = window;
- _platformWindow = platformWindow;
-
- _window.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:_platformWindow];
-
- // Prevent Cocoa from releasing the window on close. Qt
- // handles the close event asynchronously and we want to
- // make sure that m_nsWindow stays valid until the
- // QCocoaWindow is deleted by Qt.
- [_window setReleasedWhenClosed:NO];
- }
-
- return self;
-}
-
-- (void)handleWindowEvent:(NSEvent *)theEvent
-{
- QCocoaWindow *pw = self.platformWindow;
- if (pw && pw->m_forwardWindow) {
- if (theEvent.type == NSLeftMouseUp || theEvent.type == NSLeftMouseDragged) {
- QNSView *forwardView = qnsview_cast(pw->view());
- if (theEvent.type == NSLeftMouseUp) {
- [forwardView mouseUp:theEvent];
- pw->m_forwardWindow.clear();
- } else {
- [forwardView mouseDragged:theEvent];
- }
- }
- if (pw->window()->isTopLevel() && theEvent.type == NSLeftMouseDown) {
- pw->m_forwardWindow.clear();
- }
- }
-
- if (theEvent.type == NSLeftMouseDown) {
- self.grabbingMouse = YES;
- } else if (theEvent.type == NSLeftMouseUp) {
- self.grabbingMouse = NO;
- if (self.releaseOnMouseUp) {
- [self detachFromPlatformWindow];
- [self.window release];
- return;
- }
- }
-
- // The call to -[NSWindow sendEvent] may result in the window being deleted
- // (e.g., when closing the window by pressing the title bar close button).
- [self retain];
- [self.window superSendEvent:theEvent];
- bool windowStillAlive = self.window != nil; // We need to read before releasing
- [self release];
- if (!windowStillAlive)
- return;
-
- if (!self.window.delegate)
- return; // Already detached, pending NSAppKitDefined event
-
- if (pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
- NSPoint loc = [theEvent locationInWindow];
- NSRect windowFrame = [self.window convertRectFromScreen:[self.window frame]];
- NSRect contentFrame = [[self.window contentView] frame];
- if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
- [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
- }
-}
-
-- (void)detachFromPlatformWindow
-{
- _platformWindow.clear();
- [self.window.delegate release];
- self.window.delegate = nil;
-}
-
-- (void)clearWindow
-{
- if (_window) {
- QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
- if (cocoaEventDispatcher) {
- QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher));
- cocoaEventDispatcherPrivate->removeQueuedUserInputEvents([_window windowNumber]);
- }
-
- _window = nil;
- }
-}
-
-- (void)dealloc
-{
- _window = nil;
- _platformWindow.clear();
- [super dealloc];
-}
-
-@end
-
-@implementation QNSWindow
-
-@synthesize helper = _helper;
-
-- (id)initWithContentRect:(NSRect)contentRect
- screen:(NSScreen*)screen
- styleMask:(NSUInteger)windowStyle
- qPlatformWindow:(QCocoaWindow *)qpw
-{
- self = [super initWithContentRect:contentRect
- styleMask:windowStyle
- backing:NSBackingStoreBuffered
- defer:NO screen:screen]; // Deferring window creation breaks OpenGL (the GL context is
- // set up before the window is shown and needs a proper window)
-
- if (self) {
- _helper = [[QNSWindowHelper alloc] initWithNSWindow:self platformWindow:qpw];
- }
- return self;
-}
-
-- (BOOL)canBecomeKeyWindow
-{
- // Prevent child NSWindows from becoming the key window in
- // order keep the active apperance of the top-level window.
- QCocoaWindow *pw = self.helper.platformWindow;
- if (!pw || !pw->window()->isTopLevel())
- return NO;
-
- if (pw->shouldRefuseKeyWindowAndFirstResponder())
- return NO;
-
- // The default implementation returns NO for title-bar less windows,
- // override and return yes here to make sure popup windows such as
- // the combobox popup can become the key window.
- return YES;
-}
-
-- (BOOL)canBecomeMainWindow
-{
- BOOL canBecomeMain = YES; // By default, windows can become the main window
-
- // Windows with a transient parent (such as combobox popup windows)
- // cannot become the main window:
- QCocoaWindow *pw = self.helper.platformWindow;
- if (!pw || !pw->window()->isTopLevel() || pw->window()->transientParent())
- canBecomeMain = NO;
-
- return canBecomeMain;
-}
-
-- (void) sendEvent: (NSEvent*) theEvent
-{
- [self.helper handleWindowEvent:theEvent];
-}
-
-- (void)superSendEvent:(NSEvent *)theEvent
-{
- [super sendEvent:theEvent];
-}
-
-- (void)closeAndRelease
-{
- qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
-
- [self close];
-
- if (self.helper.grabbingMouse) {
- self.helper.releaseOnMouseUp = YES;
- } else {
- [self.helper detachFromPlatformWindow];
- [self release];
- }
-}
-
-- (void)dealloc
-{
- [_helper clearWindow];
- [_helper release];
- _helper = nil;
- [super dealloc];
-}
-
-@end
-
-@implementation QNSPanel
-
-@synthesize helper = _helper;
-
-+ (void)applicationActivationChanged:(NSNotification*)notification
-{
- const id sender = self;
- NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
- NSApplication *application = [NSApplication sharedApplication];
-
-#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {
- // Unfortunately there's no NSWindowListOrderedBackToFront,
- // so we have to manually reverse the order using an array.
- NSMutableArray *windows = [[[NSMutableArray alloc] init] autorelease];
- [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack
- usingBlock:^(NSWindow *window, BOOL *) {
- // For some reason AppKit will give us nil-windows, skip those
- if (!window)
- return;
-
- [(NSMutableArray*)windows addObject:window];
- }
- ];
-
- windowEnumerator = windows.reverseObjectEnumerator;
- } else
-#endif
- {
- // No way to get ordered list of windows, so fall back to unordered,
- // list, which typically corresponds to window creation order.
- windowEnumerator = application.windows.objectEnumerator;
- }
-
- for (NSWindow *window in windowEnumerator) {
- // We're meddling with normal and floating windows, so leave others alone
- if (!(window.level == NSNormalWindowLevel || window.level == NSFloatingWindowLevel))
- continue;
-
- // Windows that hide automatically will keep their NSFloatingWindowLevel,
- // and hence be on top of the window stack. We don't want to affect these
- // windows, as otherwise we might end up with key windows being ordered
- // behind these auto-hidden windows when activating the application by
- // clicking on a new tool window.
- if (window.hidesOnDeactivate)
- continue;
-
- if ([window conformsToProtocol:@protocol(QNSWindowProtocol)]) {
- QCocoaWindow *cocoaWindow = static_cast<id<QNSWindowProtocol>>(window).helper.platformWindow;
- window.level = notification.name == NSApplicationWillResignActiveNotification ?
- NSNormalWindowLevel : cocoaWindow->windowLevel(cocoaWindow->window()->flags());
- }
-
- // The documentation says that "when a window enters a new level, it’s ordered
- // in front of all its peers in that level", but that doesn't seem to be the
- // case in practice. To keep the order correct after meddling with the window
- // levels, we explicitly order each window to the front. Since we are iterating
- // the windows in back-to-front order, this is okey. The call also triggers AppKit
- // to re-evaluate the level in relation to windows from other applications,
- // working around an issue where our tool windows would stay on top of other
- // application windows if activation was transferred to another application by
- // clicking on it instead of via the application switcher or Dock. Finally, we
- // do this re-ordering for all windows (except auto-hiding ones), otherwise we would
- // end up triggering a bug in AppKit where the tool windows would disappear behind
- // the application window.
- [window orderFront:sender];
- }
-}
-
-- (id)initWithContentRect:(NSRect)contentRect
- screen:(NSScreen*)screen
- styleMask:(NSUInteger)windowStyle
- qPlatformWindow:(QCocoaWindow *)qpw
-{
- self = [super initWithContentRect:contentRect
- styleMask:windowStyle
- backing:NSBackingStoreBuffered
- defer:NO screen:screen]; // Deferring window creation breaks OpenGL (the GL context is
- // set up before the window is shown and needs a proper window)
-
- if (self) {
- _helper = [[QNSWindowHelper alloc] initWithNSWindow:self platformWindow:qpw];
-
- if (qpw->alwaysShowToolWindow()) {
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
- [center addObserver:[self class] selector:@selector(applicationActivationChanged:)
- name:NSApplicationWillResignActiveNotification object:nil];
- [center addObserver:[self class] selector:@selector(applicationActivationChanged:)
- name:NSApplicationWillBecomeActiveNotification object:nil];
- });
- }
- }
- return self;
-}
-
-- (BOOL)canBecomeKeyWindow
-{
- QCocoaWindow *pw = self.helper.platformWindow;
- if (!pw)
- return NO;
-
- if (pw->shouldRefuseKeyWindowAndFirstResponder())
- return NO;
-
- // Only tool or dialog windows should become key:
- Qt::WindowType type = pw->window()->type();
- if (type == Qt::Tool || type == Qt::Dialog)
- return YES;
-
- return NO;
-}
-
-- (void) sendEvent: (NSEvent*) theEvent
-{
- [self.helper handleWindowEvent:theEvent];
-}
-
-- (void)superSendEvent:(NSEvent *)theEvent
-{
- [super sendEvent:theEvent];
-}
-
-- (void)closeAndRelease
-{
- qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
-
- [self.helper detachFromPlatformWindow];
- [self close];
- [self release];
-}
-
-- (void)dealloc
-{
- [_helper clearWindow];
- [_helper release];
- _helper = nil;
- [super dealloc];
-}
-
-@end
-
static void qRegisterNotificationCallbacks()
{
static const QLatin1String notificationHandlerPrefix(Q_NOTIFICATION_PREFIX);
@@ -478,10 +100,6 @@ static void qRegisterNotificationCallbacks()
NSView *view = nullptr;
if ([notification.object isKindOfClass:[NSWindow class]]) {
NSWindow *window = notification.object;
- // Only top level NSWindows should notify their QNSViews
- if (window.parentWindow)
- return;
-
if (!window.contentView)
return;
@@ -515,8 +133,8 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterNotificationCallbacks)
const int QCocoaWindow::NoAlertRequest = -1;
-QCocoaWindow::QCocoaWindow(QWindow *tlw, WId nativeHandle)
- : QPlatformWindow(tlw)
+QCocoaWindow::QCocoaWindow(QWindow *win, WId nativeHandle)
+ : QPlatformWindow(win)
, m_view(nil)
, m_nsWindow(0)
, m_viewIsEmbedded(false)
@@ -524,7 +142,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw, WId nativeHandle)
, m_lastReportedWindowState(Qt::WindowNoState)
, m_windowModality(Qt::NonModal)
, m_windowUnderMouse(false)
- , m_inConstructor(true)
+ , m_initialized(false)
, m_inSetVisible(false)
, m_inSetGeometry(false)
, m_inSetStyleMask(false)
@@ -532,15 +150,12 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw, WId nativeHandle)
, m_glContext(0)
#endif
, m_menubar(0)
- , m_windowCursor(0)
+ , m_needsInvalidateShadow(false)
, m_hasModalSession(false)
, m_frameStrutEventsEnabled(false)
- , m_geometryUpdateExposeAllowed(false)
, m_isExposed(false)
, m_registerTouchCount(0)
, m_resizableTransientParent(false)
- , m_hiddenByClipping(false)
- , m_hiddenByAncestor(false)
, m_alertRequest(NoAlertRequest)
, monitor(nil)
, m_drawContentBorderGradient(false)
@@ -550,24 +165,31 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw, WId nativeHandle)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::QCocoaWindow" << window();
- QMacAutoReleasePool pool;
-
if (nativeHandle) {
m_view = reinterpret_cast<NSView *>(nativeHandle);
[m_view retain];
- } else {
+ }
+}
+
+void QCocoaWindow::initialize()
+{
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::initialize" << window();
+
+ QMacAutoReleasePool pool;
+
+ if (!m_view) {
m_view = [[QNSView alloc] initWithCocoaWindow:this];
// 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 appilcation wants to have a "custom" viewport.
// (like the hellogl example)
- if (tlw->supportsOpenGL()) {
- BOOL enable = qt_mac_resolveOption(YES, tlw, "_q_mac_wantsBestResolutionOpenGLSurface",
+ if (window()->supportsOpenGL()) {
+ BOOL enable = qt_mac_resolveOption(YES, window(), "_q_mac_wantsBestResolutionOpenGLSurface",
"QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE");
[m_view setWantsBestResolutionOpenGLSurface:enable];
}
- BOOL enable = qt_mac_resolveOption(NO, tlw, "_q_mac_wantsLayer",
+ BOOL enable = qt_mac_resolveOption(NO, window(), "_q_mac_wantsLayer",
"QT_MAC_WANTS_LAYER");
[m_view setWantsLayer:enable];
}
@@ -575,10 +197,11 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw, WId nativeHandle)
setGeometry(initialGeometry(window(), windowGeometry(), defaultWindowWidth, defaultWindowHeight));
recreateWindowIfNeeded();
- tlw->setGeometry(geometry());
- if (tlw->isTopLevel())
- setWindowIcon(tlw->icon());
- m_inConstructor = false;
+ window()->setGeometry(geometry());
+ if (window()->isTopLevel())
+ setWindowIcon(window()->icon());
+
+ m_initialized = true;
}
QCocoaWindow::~QCocoaWindow()
@@ -588,10 +211,7 @@ QCocoaWindow::~QCocoaWindow()
QMacAutoReleasePool pool;
[m_nsWindow makeFirstResponder:nil];
[m_nsWindow setContentView:nil];
- [m_nsWindow.helper detachFromPlatformWindow];
- if (m_view.window.parentWindow)
- [m_view.window.parentWindow removeChildWindow:m_view.window];
- else if ([m_view superview])
+ if ([m_view superview])
[m_view removeFromSuperview];
removeMonitor();
@@ -607,13 +227,8 @@ QCocoaWindow::~QCocoaWindow()
QCocoaIntegration::instance()->popupWindowStack()->removeAll(this);
}
- foreachChildNSWindow(^(QCocoaWindow *childWindow) {
- [m_nsWindow removeChildWindow:childWindow->m_nsWindow];
- });
-
[m_view release];
[m_nsWindow release];
- [m_windowCursor release];
}
QSurfaceFormat QCocoaWindow::format() const
@@ -674,134 +289,29 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setCocoaGeometry" << window() << rect;
QMacAutoReleasePool pool;
+ QPlatformWindow::setGeometry(rect);
+
if (m_viewIsEmbedded) {
if (!isForeignWindow()) {
[m_view setFrame:NSMakeRect(0, 0, rect.width(), rect.height())];
- } else {
- QPlatformWindow::setGeometry(rect);
}
return;
}
- if (isChildNSWindow()) {
- QPlatformWindow::setGeometry(rect);
- NSWindow *parentNSWindow = m_view.window.parentWindow;
- NSRect parentWindowFrame = [parentNSWindow contentRectForFrameRect:parentNSWindow.frame];
- clipWindow(parentWindowFrame);
-
- // call this here: updateGeometry in qnsview.mm is a no-op for this case
- QWindowSystemInterface::handleGeometryChange(window(), rect);
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), rect.size()));
- } else if (m_nsWindow) {
+ if (isContentView()) {
NSRect bounds = qt_mac_flipRect(rect);
- [m_nsWindow setFrame:[m_nsWindow frameRectForContentRect:bounds] display:YES animate:NO];
+ [m_view.window setFrame:[m_view.window frameRectForContentRect:bounds] display:YES animate:NO];
} else {
[m_view setFrame:NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height())];
}
- if (isForeignWindow())
- QPlatformWindow::setGeometry(rect);
-
// will call QPlatformWindow::setGeometry(rect) during resize confirmation (see qnsview.mm)
}
-void QCocoaWindow::clipChildWindows()
-{
- foreachChildNSWindow(^(QCocoaWindow *childWindow) {
- childWindow->clipWindow(m_nsWindow.frame);
- });
-}
-
-void QCocoaWindow::clipWindow(const NSRect &clipRect)
-{
- if (!isChildNSWindow())
- return;
-
- NSRect clippedWindowRect = NSZeroRect;
- if (!NSIsEmptyRect(clipRect)) {
- NSRect windowFrame = qt_mac_flipRect(QRect(window()->mapToGlobal(QPoint(0, 0)), geometry().size()));
- clippedWindowRect = NSIntersectionRect(windowFrame, clipRect);
- // Clipping top/left offsets the content. Move it back.
- NSPoint contentViewOffset = NSMakePoint(qMax(CGFloat(0), NSMinX(clippedWindowRect) - NSMinX(windowFrame)),
- qMax(CGFloat(0), NSMaxY(windowFrame) - NSMaxY(clippedWindowRect)));
- [m_view setBoundsOrigin:contentViewOffset];
- }
-
- if (NSIsEmptyRect(clippedWindowRect)) {
- if (!m_hiddenByClipping) {
- // We dont call hide() here as we will recurse further down
- [m_nsWindow orderOut:nil];
- m_hiddenByClipping = true;
- }
- } else {
- [m_nsWindow setFrame:clippedWindowRect display:YES animate:NO];
- if (m_hiddenByClipping) {
- m_hiddenByClipping = false;
- if (!m_hiddenByAncestor) {
- [m_nsWindow orderFront:nil];
- static_cast<QCocoaWindow *>(QPlatformWindow::parent())->reinsertChildWindow(this);
- }
- }
- }
-
- // recurse
- foreachChildNSWindow(^(QCocoaWindow *childWindow) {
- childWindow->clipWindow(clippedWindowRect);
- });
-}
-
-void QCocoaWindow::hide(bool becauseOfAncestor)
-{
- bool visible = [m_nsWindow isVisible];
-
- if (!m_hiddenByAncestor && !visible) // Already explicitly hidden
- return;
- if (m_hiddenByAncestor && becauseOfAncestor) // Trying to hide some child again
- return;
-
- m_hiddenByAncestor = becauseOfAncestor;
-
- if (!visible) // Could have been clipped before
- return;
-
- foreachChildNSWindow(^(QCocoaWindow *childWindow) {
- childWindow->hide(true);
- });
-
- [m_nsWindow orderOut:nil];
-}
-
-void QCocoaWindow::show(bool becauseOfAncestor)
-{
- if ([m_nsWindow isVisible])
- return;
-
- if (m_view.window.parentWindow && !m_view.window.parentWindow.visible) {
- m_hiddenByAncestor = true; // Parent still hidden, don't show now
- } else if ((becauseOfAncestor == m_hiddenByAncestor) // Was NEITHER explicitly hidden
- && !m_hiddenByClipping) { // ... NOR clipped
- if (isChildNSWindow()) {
- m_hiddenByAncestor = false;
- setCocoaGeometry(windowGeometry());
- }
- if (!m_hiddenByClipping) { // setCocoaGeometry() can change the clipping status
- [m_nsWindow orderFront:nil];
- if (isChildNSWindow())
- static_cast<QCocoaWindow *>(QPlatformWindow::parent())->reinsertChildWindow(this);
- foreachChildNSWindow(^(QCocoaWindow *childWindow) {
- childWindow->show(true);
- });
- }
- }
-}
-
void QCocoaWindow::setVisible(bool visible)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setVisible" << window() << visible;
- if (isChildNSWindow() && m_hiddenByClipping)
- return;
-
m_inSetVisible = true;
QMacAutoReleasePool pool;
@@ -813,6 +323,12 @@ void QCocoaWindow::setVisible(bool visible)
// We need to recreate if the modality has changed as the style mask will need updating
recreateWindowIfNeeded();
+ // We didn't send geometry changes during creation, as that would have confused
+ // Qt, which expects a show-event to be sent before any resize events. But now
+ // that the window is made visible, we know that the show-event has been sent
+ // so we can send the geometry change. FIXME: Get rid of this workaround.
+ handleGeometryChange();
+
// Register popup windows. The Cocoa platform plugin will forward mouse events
// to them and close them when needed.
if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
@@ -826,34 +342,28 @@ void QCocoaWindow::setVisible(bool visible)
if (window()->type() == Qt::Popup) {
// QTBUG-30266: a window should not be resizable while a transient popup is open
// Since this isn't a native popup, the window manager doesn't close the popup when you click outside
- NSUInteger parentStyleMask = [parentCocoaWindow->m_nsWindow styleMask];
+ NSWindow *nativeParentWindow = parentCocoaWindow->nativeWindow();
+ NSUInteger parentStyleMask = nativeParentWindow.styleMask;
if ((m_resizableTransientParent = (parentStyleMask & NSResizableWindowMask))
- && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask))
- [parentCocoaWindow->m_nsWindow setStyleMask:parentStyleMask & ~NSResizableWindowMask];
+ && !(nativeParentWindow.styleMask & NSFullScreenWindowMask))
+ nativeParentWindow.styleMask &= ~NSResizableWindowMask;
}
}
- // This call is here to handle initial window show correctly:
- // - top-level windows need to have backing store content ready when the
- // window is shown, sendin the expose event here makes that more likely.
- // - QNSViews for child windows are initialy not hidden and won't get the
- // viewDidUnhide message.
- exposeWindow();
-
- if (m_nsWindow) {
+ if (isContentView()) {
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
// setWindowState might have been called while the window was hidden and
// will not change the NSWindow state in that case. Sync up here:
- applyWindowState(window()->windowState());
+ applyWindowState(window()->windowStates());
if (window()->windowState() != Qt::WindowMinimized) {
if ((window()->modality() == Qt::WindowModal
|| window()->type() == Qt::Sheet)
&& parentCocoaWindow) {
// show the window as a sheet
- [parentCocoaWindow->m_nsWindow beginSheet:m_nsWindow completionHandler:nil];
+ [parentCocoaWindow->nativeWindow() beginSheet:m_view.window completionHandler:nil];
} else if (window()->modality() != Qt::NonModal) {
// show the window as application modal
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
@@ -861,28 +371,24 @@ void QCocoaWindow::setVisible(bool visible)
QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher));
cocoaEventDispatcherPrivate->beginModalSession(window());
m_hasModalSession = true;
- } else if ([m_nsWindow canBecomeKeyWindow]) {
+ } else if ([m_view.window canBecomeKeyWindow]) {
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = 0;
if (cocoaEventDispatcher)
cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher));
if (cocoaEventDispatcherPrivate && cocoaEventDispatcherPrivate->cocoaModalSessionStack.isEmpty())
- [m_nsWindow makeKeyAndOrderFront:nil];
+ [m_view.window makeKeyAndOrderFront:nil];
else
- [m_nsWindow orderFront:nil];
-
- foreachChildNSWindow(^(QCocoaWindow *childWindow) {
- childWindow->show(true);
- });
+ [m_view.window orderFront:nil];
} else {
- show();
+ [m_view.window orderFront:nil];
}
// We want the events to properly reach the popup, dialog, and tool
if ((window()->type() == Qt::Popup || window()->type() == Qt::Dialog || window()->type() == Qt::Tool)
- && [m_nsWindow isKindOfClass:[NSPanel class]]) {
- [(NSPanel *)m_nsWindow setWorksWhenModal:YES];
+ && [m_view.window isKindOfClass:[NSPanel class]]) {
+ ((NSPanel *)m_view.window).worksWhenModal = YES;
if (!(parentCocoaWindow && window()->transientParent()->isActive()) && window()->type() == Qt::Popup) {
removeMonitor();
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
@@ -909,20 +415,21 @@ void QCocoaWindow::setVisible(bool visible)
QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = 0;
if (cocoaEventDispatcher)
cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher));
- if (m_nsWindow) {
+ if (isContentView()) {
if (m_hasModalSession) {
if (cocoaEventDispatcherPrivate)
cocoaEventDispatcherPrivate->endModalSession(window());
m_hasModalSession = false;
} else {
- if ([m_nsWindow isSheet]) {
+ if ([m_view.window isSheet]) {
Q_ASSERT_X(parentCocoaWindow, "QCocoaWindow", "Window modal dialog has no transient parent.");
- [parentCocoaWindow->m_nsWindow endSheet:m_nsWindow];
+ [parentCocoaWindow->nativeWindow() endSheet:m_view.window];
}
}
- hide();
- if (m_nsWindow == [NSApp keyWindow]
+ [m_view.window orderOut:nil];
+
+ if (m_view.window == [NSApp keyWindow]
&& !(cocoaEventDispatcherPrivate && cocoaEventDispatcherPrivate->currentModalSession())) {
// Probably because we call runModalSession: outside [NSApp run] in QCocoaEventDispatcher
// (e.g., when show()-ing a modal QDialog instead of exec()-ing it), it can happen that
@@ -941,10 +448,11 @@ void QCocoaWindow::setVisible(bool visible)
QCocoaIntegration::instance()->popupWindowStack()->removeAll(this);
if (parentCocoaWindow && window()->type() == Qt::Popup) {
+ NSWindow *nativeParentWindow = parentCocoaWindow->nativeWindow();
if (m_resizableTransientParent
- && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask))
- // QTBUG-30266: a window should not be resizable while a transient popup is open
- [parentCocoaWindow->m_nsWindow setStyleMask:[parentCocoaWindow->m_nsWindow styleMask] | NSResizableWindowMask];
+ && !(nativeParentWindow.styleMask & NSFullScreenWindowMask))
+ // A window should not be resizable while a transient popup is open
+ nativeParentWindow.styleMask |= NSResizableWindowMask;
}
}
@@ -974,7 +482,7 @@ NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags)
const QWindow * const transientParent = window()->transientParent();
const QCocoaWindow * const transientParentWindow = transientParent ? static_cast<QCocoaWindow *>(transientParent->handle()) : 0;
if (transientParentWindow)
- windowLevel = qMax([transientParentWindow->m_nsWindow level], windowLevel);
+ windowLevel = qMax([transientParentWindow->nativeWindow() level], windowLevel);
}
return windowLevel;
@@ -982,70 +490,46 @@ NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags)
NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
{
- Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask));
- NSInteger styleMask = NSBorderlessWindowMask;
- if (flags & Qt::FramelessWindowHint)
- return styleMask;
- if ((type & Qt::Popup) == Qt::Popup) {
- if (!windowIsPopupType(type)) {
- styleMask = NSUtilityWindowMask | NSResizableWindowMask;
- if (!(flags & Qt::CustomizeWindowHint)) {
- styleMask |= NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask;
- } else {
- if (flags & Qt::WindowTitleHint)
- styleMask |= NSTitledWindowMask;
- if (flags & Qt::WindowCloseButtonHint)
- styleMask |= NSClosableWindowMask;
- if (flags & Qt::WindowMinimizeButtonHint)
- styleMask |= NSMiniaturizableWindowMask;
- }
- }
+ const Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask));
+ const bool frameless = (flags & Qt::FramelessWindowHint) || windowIsPopupType(type);
+
+ // Select base window type.
+ NSUInteger styleMask = frameless ? NSBorderlessWindowMask : NSResizableWindowMask;
+
+ if (frameless) {
+ // No further customizations for frameless since there are no window decorations.
+ } else if (flags & Qt::CustomizeWindowHint) {
+ if (flags & Qt::WindowTitleHint)
+ styleMask |= NSTitledWindowMask;
+ if (flags & Qt::WindowCloseButtonHint)
+ styleMask |= NSClosableWindowMask;
+ if (flags & Qt::WindowMinimizeButtonHint)
+ styleMask |= NSMiniaturizableWindowMask;
} else {
- if (type == Qt::Window && !(flags & Qt::CustomizeWindowHint)) {
- styleMask = (NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask);
- } else if (type == Qt::Dialog) {
- if (flags & Qt::CustomizeWindowHint) {
- if (flags & Qt::WindowMaximizeButtonHint)
- styleMask = NSResizableWindowMask;
- if (flags & Qt::WindowTitleHint)
- styleMask |= NSTitledWindowMask;
- if (flags & Qt::WindowCloseButtonHint)
- styleMask |= NSClosableWindowMask;
- if (flags & Qt::WindowMinimizeButtonHint)
- styleMask |= NSMiniaturizableWindowMask;
- } else {
- styleMask = NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask;
- }
- } else {
- if (flags & Qt::WindowMaximizeButtonHint)
- styleMask |= NSResizableWindowMask;
- if (flags & Qt::WindowTitleHint)
- styleMask |= NSTitledWindowMask;
- if (flags & Qt::WindowCloseButtonHint)
- styleMask |= NSClosableWindowMask;
- if (flags & Qt::WindowMinimizeButtonHint)
- styleMask |= NSMiniaturizableWindowMask;
- }
+ styleMask |= NSClosableWindowMask | NSTitledWindowMask;
+
+ if (type != Qt::Dialog)
+ styleMask |= NSMiniaturizableWindowMask;
}
+ if (type == Qt::Tool)
+ styleMask |= NSUtilityWindowMask;
+
if (m_drawContentBorderGradient)
styleMask |= NSTexturedBackgroundWindowMask;
// Don't wipe fullscreen state
- if (m_nsWindow.styleMask & NSFullScreenWindowMask)
+ if (m_view.window.styleMask & NSFullScreenWindowMask)
styleMask |= NSFullScreenWindowMask;
return styleMask;
}
-void QCocoaWindow::setWindowShadow(Qt::WindowFlags flags)
-{
- bool keepShadow = !(flags & Qt::NoDropShadowWindowHint);
- [m_nsWindow setHasShadow:(keepShadow ? YES : NO)];
-}
-
void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags)
{
+ if (!isContentView())
+ return;
+
// Disable the zoom (maximize) button for fixed-sized windows and customized
// no-WindowMaximizeButtonHint windows. From a Qt perspective it migth be expected
// that the button would be removed in the latter case, but disabling it is more
@@ -1054,28 +538,27 @@ void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags)
&& windowMinimumSize() == windowMaximumSize());
bool customizeNoZoom = ((flags & Qt::CustomizeWindowHint)
&& !(flags & (Qt::WindowMaximizeButtonHint | Qt::WindowFullscreenButtonHint)));
- [[m_nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:!(fixedSizeNoZoom || customizeNoZoom)];
+ [[m_view.window standardWindowButton:NSWindowZoomButton] setEnabled:!(fixedSizeNoZoom || customizeNoZoom)];
}
void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
{
- if (m_nsWindow && !isChildNSWindow()) {
- NSUInteger styleMask = windowStyleMask(flags);
- NSInteger level = this->windowLevel(flags);
- // While setting style mask we can have -updateGeometry calls on a content
+ if (isContentView()) {
+ // While setting style mask we can have handleGeometryChange calls on a content
// view with null geometry, reporting an invalid coordinates as a result.
m_inSetStyleMask = true;
- [m_nsWindow setStyleMask:styleMask];
+ m_view.window.styleMask = windowStyleMask(flags);
m_inSetStyleMask = false;
- [m_nsWindow setLevel:level];
- setWindowShadow(flags);
- if (!(flags & Qt::FramelessWindowHint)) {
+ m_view.window.level = this->windowLevel(flags);
+
+ m_view.window.hasShadow = !(flags & Qt::NoDropShadowWindowHint);
+
+ if (!(flags & Qt::FramelessWindowHint))
setWindowTitle(window()->title());
- }
Qt::WindowType type = window()->type();
if ((type & Qt::Popup) != Qt::Popup && (type & Qt::Dialog) != Qt::Dialog) {
- NSWindowCollectionBehavior behavior = [m_nsWindow collectionBehavior];
+ NSWindowCollectionBehavior behavior = m_view.window.collectionBehavior;
if (flags & Qt::WindowFullscreenButtonHint) {
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
behavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary;
@@ -1083,28 +566,26 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
behavior |= NSWindowCollectionBehaviorFullScreenAuxiliary;
behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
}
- [m_nsWindow setCollectionBehavior:behavior];
+ m_view.window.collectionBehavior = behavior;
}
setWindowZoomButton(flags);
- }
- // Make window ignore mouse events if WindowTransparentForInput is set.
- // Note that ignoresMouseEvents has a special initial state where events
- // are ignored (passed through) based on window transparency, and that
- // setting the property to false does not return us to that state. Instead,
- // this makes the window capture all mouse events. Take care to only
- // set the property if needed. FIXME: recreate window if needed or find
- // some other way to implement WindowTransparentForInput.
- if (m_nsWindow) {
+ // Make window ignore mouse events if WindowTransparentForInput is set.
+ // Note that ignoresMouseEvents has a special initial state where events
+ // are ignored (passed through) based on window transparency, and that
+ // setting the property to false does not return us to that state. Instead,
+ // this makes the window capture all mouse events. Take care to only
+ // set the property if needed. FIXME: recreate window if needed or find
+ // some other way to implement WindowTransparentForInput.
bool ignoreMouse = flags & Qt::WindowTransparentForInput;
- if (m_nsWindow.ignoresMouseEvents != ignoreMouse)
- m_nsWindow.ignoresMouseEvents = ignoreMouse;
+ if (m_view.window.ignoresMouseEvents != ignoreMouse)
+ m_view.window.ignoresMouseEvents = ignoreMouse;
}
m_windowFlags = flags;
}
-void QCocoaWindow::setWindowState(Qt::WindowState state)
+void QCocoaWindow::setWindowState(Qt::WindowStates state)
{
if (window()->isVisible())
applyWindowState(state); // Window state set for hidden windows take effect when show() is called
@@ -1112,37 +593,38 @@ void QCocoaWindow::setWindowState(Qt::WindowState state)
void QCocoaWindow::setWindowTitle(const QString &title)
{
- QMacAutoReleasePool pool;
- if (!m_nsWindow)
+ if (!isContentView())
return;
- CFStringRef windowTitle = title.toCFString();
- [m_nsWindow setTitle: const_cast<NSString *>(reinterpret_cast<const NSString *>(windowTitle))];
- CFRelease(windowTitle);
+ QMacAutoReleasePool pool;
+ m_view.window.title = title.toNSString();
}
void QCocoaWindow::setWindowFilePath(const QString &filePath)
{
- QMacAutoReleasePool pool;
- if (!m_nsWindow)
+ if (!isContentView())
return;
+ QMacAutoReleasePool pool;
QFileInfo fi(filePath);
- [m_nsWindow setRepresentedFilename:fi.exists() ? filePath.toNSString() : @""];
+ [m_view.window setRepresentedFilename:fi.exists() ? filePath.toNSString() : @""];
m_hasWindowFilePath = fi.exists();
}
void QCocoaWindow::setWindowIcon(const QIcon &icon)
{
+ if (!isContentView())
+ return;
+
QMacAutoReleasePool pool;
- NSButton *iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];
+ NSButton *iconButton = [m_view.window standardWindowButton:NSWindowDocumentIconButton];
if (iconButton == nil) {
if (icon.isNull())
return;
NSString *title = window()->title().toNSString();
- [m_nsWindow setRepresentedURL:[NSURL fileURLWithPath:title]];
- iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];
+ [m_view.window setRepresentedURL:[NSURL fileURLWithPath:title]];
+ iconButton = [m_view.window standardWindowButton:NSWindowDocumentIconButton];
}
if (icon.isNull()) {
[iconButton setImage:nil];
@@ -1174,34 +656,22 @@ void QCocoaWindow::raise()
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::raise" << window();
// ### handle spaces (see Qt 4 raise_sys in qwidget_mac.mm)
- if (!m_nsWindow)
+ if (!isContentView())
return;
- if (isChildNSWindow()) {
- if (m_hiddenByClipping)
- return;
- }
- if ([m_nsWindow isVisible]) {
- if (isChildNSWindow()) {
- // -[NSWindow orderFront:] doesn't work with attached windows.
- // The only solution is to remove and add the child window.
- // This will place it on top of all the other NSWindows.
- NSWindow *parentNSWindow = m_view.window.parentWindow;
- [parentNSWindow removeChildWindow:m_nsWindow];
- [parentNSWindow addChildWindow:m_nsWindow ordered:NSWindowAbove];
- } else {
- {
- // Clean up autoreleased temp objects from orderFront immediately.
- // Failure to do so has been observed to cause leaks also beyond any outer
- // autorelease pool (for example around a complete QWindow
- // construct-show-raise-hide-delete cyle), counter to expected autoreleasepool
- // behavior.
- QMacAutoReleasePool pool;
- [m_nsWindow orderFront: m_nsWindow];
- }
- static bool raiseProcess = qt_mac_resolveOption(true, "QT_MAC_SET_RAISE_PROCESS");
- if (raiseProcess) {
- [NSApp activateIgnoringOtherApps:YES];
- }
+
+ if (m_view.window.visible) {
+ {
+ // Clean up autoreleased temp objects from orderFront immediately.
+ // Failure to do so has been observed to cause leaks also beyond any outer
+ // autorelease pool (for example around a complete QWindow
+ // construct-show-raise-hide-delete cyle), counter to expected autoreleasepool
+ // behavior.
+ QMacAutoReleasePool pool;
+ [m_view.window orderFront:m_view.window];
+ }
+ static bool raiseProcess = qt_mac_resolveOption(true, "QT_MAC_SET_RAISE_PROCESS");
+ if (raiseProcess) {
+ [NSApp activateIgnoringOtherApps:YES];
}
}
}
@@ -1209,29 +679,11 @@ void QCocoaWindow::raise()
void QCocoaWindow::lower()
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::lower" << window();
- if (!m_nsWindow)
+ if (!isContentView())
return;
- if (isChildNSWindow()) {
- if (m_hiddenByClipping)
- return;
- }
- if ([m_nsWindow isVisible]) {
- if (isChildNSWindow()) {
- // -[NSWindow orderBack:] doesn't work with attached windows.
- // The only solution is to remove and add all the child windows except this one.
- // This will keep the current window at the bottom while adding the others on top of it,
- // hopefully in the same order (this is not documented anywhere in the Cocoa documentation).
- NSWindow *parentNSWindow = m_view.window.parentWindow;
- NSArray *children = [parentNSWindow.childWindows copy];
- for (NSWindow *child in children)
- if (m_nsWindow != child) {
- [parentNSWindow removeChildWindow:child];
- [parentNSWindow addChildWindow:child ordered:NSWindowAbove];
- }
- } else {
- [m_nsWindow orderBack: m_nsWindow];
- }
- }
+
+ if (m_view.window.visible)
+ [m_view.window orderBack:m_view.window];
}
bool QCocoaWindow::isExposed() const
@@ -1247,7 +699,7 @@ bool QCocoaWindow::isOpaque() const
bool translucent = window()->format().alphaBufferSize() > 0
|| window()->opacity() < 1
- || [qnsview_cast(m_view) hasMask]
+ || !window()->mask().isEmpty()
|| (surface()->supportsOpenGL() && openglSourfaceOrder == -1);
return !translucent;
}
@@ -1255,24 +707,24 @@ bool QCocoaWindow::isOpaque() const
void QCocoaWindow::propagateSizeHints()
{
QMacAutoReleasePool pool;
- if (!m_nsWindow)
+ if (!isContentView())
return;
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::propagateSizeHints" << window() << "\n"
- << " min/max" << windowMinimumSize() << windowMaximumSize()
- << "size increment" << windowSizeIncrement()
- << " basesize" << windowBaseSize()
- << " geometry" << windowGeometry();
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::propagateSizeHints" << window()
+ << "min:" << windowMinimumSize() << "max:" << windowMaximumSize()
+ << "increment:" << windowSizeIncrement()
+ << "base:" << windowBaseSize();
+
+ const NSWindow *window = m_view.window;
// Set the minimum content size.
- const QSize minimumSize = windowMinimumSize();
+ QSize minimumSize = windowMinimumSize();
if (!minimumSize.isValid()) // minimumSize is (-1, -1) when not set. Make that (0, 0) for Cocoa.
- [m_nsWindow setContentMinSize : NSMakeSize(0.0, 0.0)];
- [m_nsWindow setContentMinSize : NSMakeSize(minimumSize.width(), minimumSize.height())];
+ minimumSize = QSize(0, 0);
+ window.contentMinSize = NSSizeFromCGSize(minimumSize.toCGSize());
// Set the maximum content size.
- const QSize maximumSize = windowMaximumSize();
- [m_nsWindow setContentMaxSize : NSMakeSize(maximumSize.width(), maximumSize.height())];
+ window.contentMaxSize = NSSizeFromCGSize(windowMaximumSize().toCGSize());
// The window may end up with a fixed size; in this case the zoom button should be disabled.
setWindowZoomButton(m_windowFlags);
@@ -1282,42 +734,65 @@ void QCocoaWindow::propagateSizeHints()
QSize sizeIncrement = windowSizeIncrement();
if (sizeIncrement.isEmpty())
sizeIncrement = QSize(1, 1);
- [m_nsWindow setResizeIncrements:NSSizeFromCGSize(sizeIncrement.toCGSize())];
+ window.resizeIncrements = NSSizeFromCGSize(sizeIncrement.toCGSize());
QRect rect = geometry();
QSize baseSize = windowBaseSize();
- if (!baseSize.isNull() && baseSize.isValid()) {
- [m_nsWindow setFrame:NSMakeRect(rect.x(), rect.y(), baseSize.width(), baseSize.height()) display:YES];
- }
+ if (!baseSize.isNull() && baseSize.isValid())
+ [window setFrame:NSMakeRect(rect.x(), rect.y(), baseSize.width(), baseSize.height()) display:YES];
}
void QCocoaWindow::setOpacity(qreal level)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setOpacity" << level;
- if (m_nsWindow) {
- [m_nsWindow setAlphaValue:level];
- [m_nsWindow setOpaque: isOpaque()];
- }
+ if (!isContentView())
+ return;
+
+ m_view.window.alphaValue = level;
}
void QCocoaWindow::setMask(const QRegion &region)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setMask" << window() << region;
- if (m_nsWindow)
- [m_nsWindow setBackgroundColor:[NSColor clearColor]];
- [qnsview_cast(m_view) setMaskRegion:&region];
- [m_nsWindow setOpaque:isOpaque()];
+ if (m_view.layer) {
+ if (!region.isEmpty()) {
+ QCFType<CGMutablePathRef> maskPath = CGPathCreateMutable();
+ for (const QRect &r : region)
+ CGPathAddRect(maskPath, nullptr, r.toCGRect());
+ CAShapeLayer *maskLayer = [CAShapeLayer layer];
+ maskLayer.path = maskPath;
+ m_view.layer.mask = maskLayer;
+ } else {
+ m_view.layer.mask = nil;
+ }
+ }
+
+ if (isContentView()) {
+ // Setting the mask requires invalidating the NSWindow shadow, but that needs
+ // to happen after the backingstore has been redrawn, so that AppKit can pick
+ // up the new window shape based on the backingstore content. Doing a display
+ // directly here is not an option, as the window might not be exposed at this
+ // time, and so would not result in an updated backingstore.
+ m_needsInvalidateShadow = true;
+ [m_view setNeedsDisplay:YES];
+
+ // FIXME: [NSWindow invalidateShadow] has no effect when in layer-backed mode,
+ // so if the mask is changed after the initial mask is applied, it will not
+ // result in any visual change to the shadow. This is an Apple bug, and there
+ // may be ways to work around it, such as calling setFrame on the window to
+ // trigger some internal invalidation, but that needs more research.
+ }
}
bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setKeyboardGrabEnabled" << window() << grab;
- if (!m_nsWindow)
+ if (!isContentView())
return false;
- if (grab && ![m_nsWindow isKeyWindow])
- [m_nsWindow makeKeyWindow];
+ if (grab && ![m_view.window isKeyWindow])
+ [m_view.window makeKeyWindow];
return true;
}
@@ -1325,11 +800,11 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
bool QCocoaWindow::setMouseGrabEnabled(bool grab)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setMouseGrabEnabled" << window() << grab;
- if (!m_nsWindow)
+ if (!isContentView())
return false;
- if (grab && ![m_nsWindow isKeyWindow])
- [m_nsWindow makeKeyWindow];
+ if (grab && ![m_view.window isKeyWindow])
+ [m_view.window makeKeyWindow];
return true;
}
@@ -1358,7 +833,7 @@ NSView *QCocoaWindow::view() const
NSWindow *QCocoaWindow::nativeWindow() const
{
- return m_nsWindow;
+ return m_view.window;
}
void QCocoaWindow::setEmbeddedInForeignView(bool embedded)
@@ -1379,33 +854,26 @@ void QCocoaWindow::windowWillMove()
void QCocoaWindow::windowDidMove()
{
- if (isChildNSWindow())
- return;
-
- [qnsview_cast(m_view) updateGeometry];
+ handleGeometryChange();
// Moving a window might bring it out of maximized state
- reportCurrentWindowState();
+ handleWindowStateChanged();
}
void QCocoaWindow::windowDidResize()
{
- if (!m_nsWindow)
- return;
-
- if (isChildNSWindow())
+ if (!isContentView())
return;
- clipChildWindows();
- [qnsview_cast(m_view) updateGeometry];
+ handleGeometryChange();
if (!m_view.inLiveResize)
- reportCurrentWindowState();
+ handleWindowStateChanged();
}
void QCocoaWindow::viewDidChangeFrame()
{
- [qnsview_cast(m_view) updateGeometry];
+ handleGeometryChange();
}
/*!
@@ -1417,12 +885,12 @@ void QCocoaWindow::viewDidChangeFrame()
*/
void QCocoaWindow::viewDidChangeGlobalFrame()
{
- updateExposedGeometry();
+ [m_view setNeedsDisplay:YES];
}
void QCocoaWindow::windowDidEndLiveResize()
{
- reportCurrentWindowState();
+ handleWindowStateChanged();
}
void QCocoaWindow::windowDidBecomeKey()
@@ -1459,12 +927,12 @@ void QCocoaWindow::windowDidResignKey()
void QCocoaWindow::windowDidMiniaturize()
{
- reportCurrentWindowState();
+ handleWindowStateChanged();
}
void QCocoaWindow::windowDidDeminiaturize()
{
- reportCurrentWindowState();
+ handleWindowStateChanged();
}
void QCocoaWindow::windowWillEnterFullScreen()
@@ -1472,30 +940,30 @@ void QCocoaWindow::windowWillEnterFullScreen()
// The NSWindow needs to be resizable, otherwise we'll end up with
// the normal window geometry, centered in the middle of the screen
// on a black background. The styleMask will be reset below.
- m_nsWindow.styleMask |= NSResizableWindowMask;
+ m_view.window.styleMask |= NSResizableWindowMask;
}
void QCocoaWindow::windowDidEnterFullScreen()
{
- Q_ASSERT_X(m_nsWindow.qt_fullScreen, "QCocoaWindow",
+ Q_ASSERT_X(m_view.window.qt_fullScreen, "QCocoaWindow",
"FullScreen category processes window notifications first");
// Reset to original styleMask
setWindowFlags(m_windowFlags);
- reportCurrentWindowState();
+ handleWindowStateChanged();
}
void QCocoaWindow::windowWillExitFullScreen()
{
// The NSWindow needs to be resizable, otherwise we'll end up with
// a weird zoom animation. The styleMask will be reset below.
- m_nsWindow.styleMask |= NSResizableWindowMask;
+ m_view.window.styleMask |= NSResizableWindowMask;
}
void QCocoaWindow::windowDidExitFullScreen()
{
- Q_ASSERT_X(!m_nsWindow.qt_fullScreen, "QCocoaWindow",
+ Q_ASSERT_X(!m_view.window.qt_fullScreen, "QCocoaWindow",
"FullScreen category processes window notifications first");
// Reset to original styleMask
@@ -1504,7 +972,7 @@ void QCocoaWindow::windowDidExitFullScreen()
Qt::WindowState requestedState = window()->windowState();
// Deliver update of QWindow state
- reportCurrentWindowState();
+ handleWindowStateChanged();
if (requestedState != windowState() && requestedState != Qt::WindowFullScreen) {
// We were only going out of full screen as an intermediate step before
@@ -1515,28 +983,20 @@ void QCocoaWindow::windowDidExitFullScreen()
void QCocoaWindow::windowDidOrderOffScreen()
{
- obscureWindow();
+ handleExposeEvent(QRegion());
}
void QCocoaWindow::windowDidOrderOnScreen()
{
- exposeWindow();
+ [m_view setNeedsDisplay:YES];
}
void QCocoaWindow::windowDidChangeOcclusionState()
{
- // Several unit tests expect paint and/or expose events for windows that are
- // sometimes (unpredictably) occluded and some unit tests depend on QWindow::isExposed.
- // Don't send Expose/Obscure events when running under QTestLib.
- static const bool onTestLib = qt_mac_resolveOption(false, "QT_QTESTLIB_RUNNING");
- if (!onTestLib) {
- if ((NSUInteger)[m_view.window occlusionState] & NSWindowOcclusionStateVisible) {
- exposeWindow();
- } else {
- // Send Obscure events on window occlusion to stop animations.
- obscureWindow();
- }
- }
+ if (m_view.window.occlusionState & NSWindowOcclusionStateVisible)
+ [m_view setNeedsDisplay:YES];
+ else
+ handleExposeEvent(QRegion());
}
void QCocoaWindow::windowDidChangeScreen()
@@ -1546,8 +1006,6 @@ void QCocoaWindow::windowDidChangeScreen()
if (QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenForNSScreen(m_view.window.screen))
QWindowSystemInterface::handleWindowScreenChanged(window(), cocoaScreen->screen());
-
- updateExposedGeometry();
}
void QCocoaWindow::windowWillClose()
@@ -1572,6 +1030,99 @@ bool QCocoaWindow::windowShouldClose()
return accepted;
}
+// ----------------------------- QPA forwarding -----------------------------
+
+void QCocoaWindow::handleGeometryChange()
+{
+ // Prevent geometry change during initialization, as that will result
+ // in a resize event, and Qt expects those to come after the show event.
+ // FIXME: Remove once we've clarified the Qt behavior for this.
+ if (!m_initialized)
+ return;
+
+ // Don't send the geometry change if the QWindow is designated to be
+ // embedded in a foreign view hierarchy but has not actually been
+ // embedded yet - it's too early.
+ if (m_viewIsToBeEmbedded && !m_viewIsEmbedded)
+ return;
+
+ // It can happen that the current NSWindow is nil (if we are changing styleMask
+ // from/to borderless, and the content view is being re-parented), which results
+ // in invalid coordinates.
+ if (m_inSetStyleMask && !m_view.window)
+ return;
+
+ const bool isEmbedded = m_viewIsToBeEmbedded || m_viewIsEmbedded;
+
+ QRect newGeometry;
+ if (isContentView() && !isEmbedded) {
+ // Content views are positioned at (0, 0) in the window, so we resolve via the window
+ CGRect contentRect = [m_view.window contentRectForFrameRect:m_view.window.frame];
+
+ // The result above is in native screen coordinates, so remap to the Qt coordinate system
+ newGeometry = QCocoaScreen::primaryScreen()->mapFromNative(QRectF::fromCGRect(contentRect)).toRect();
+ } else {
+ // QNSView has isFlipped set, so no need to remap the geometry
+ newGeometry = QRectF::fromCGRect(m_view.frame).toRect();
+ }
+
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleGeometryChange" << window()
+ << "current" << geometry() << "new" << newGeometry;
+
+ QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
+
+ // Guard against processing window system events during QWindow::setGeometry
+ // calls, which Qt and Qt applications do not expect.
+ if (!m_inSetGeometry)
+ QWindowSystemInterface::flushWindowSystemEvents();
+}
+
+void QCocoaWindow::handleExposeEvent(const QRegion &region)
+{
+ // Ideally we'd implement isExposed() in terms of these properties,
+ // plus the occlusionState of the NSWindow, and let the expose event
+ // pull the exposed state out when needed. However, when the window
+ // is first shown we receive a drawRect call where the occlusionState
+ // of the window is still hidden, but we still want to prepare the
+ // window for display by issuing an expose event to Qt. To work around
+ // this we don't use the occlusionState directly, but instead base
+ // the exposed state on the region we get in, which in the case of
+ // a window being obscured is an empty region, and in the case of
+ // a drawRect call is a non-null region, even if occlusionState
+ // is still hidden. This ensures the window is prepared for display.
+ m_isExposed = m_view.window.visible
+ && m_view.window.screen
+ && !geometry().size().isEmpty()
+ && !region.isEmpty()
+ && !m_view.hiddenOrHasHiddenAncestor;
+
+
+ QWindowPrivate *windowPrivate = qt_window_private(window());
+ if (m_isExposed && windowPrivate->updateRequestPending) {
+ // FIXME: Should this logic for expose events be in QGuiApplication?
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleExposeEvent" << window() << region << "as update request";
+ windowPrivate->deliverUpdateRequest();
+ return;
+ }
+
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleExposeEvent" << window() << region << "isExposed" << isExposed();
+ QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(window(), region);
+}
+
+void QCocoaWindow::handleWindowStateChanged(HandleFlags flags)
+{
+ Qt::WindowState currentState = windowState();
+ if (!(flags & HandleUnconditionally) && currentState == m_lastReportedWindowState)
+ return;
+
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::handleWindowStateChanged" <<
+ m_lastReportedWindowState << "-->" << currentState;
+
+ QWindowSystemInterface::handleWindowStateChanged<QWindowSystemInterface::SynchronousDelivery>(
+ window(), currentState, m_lastReportedWindowState);
+ m_lastReportedWindowState = currentState;
+}
+
// --------------------------------------------------------------------------
bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const
@@ -1597,26 +1148,13 @@ QCocoaGLContext *QCocoaWindow::currentContext() const
#endif
/*!
- Checks if the window is a non-top level QWindow with a NSWindow.
-
- \sa _q_platform_MacUseNSWindow, QT_MAC_USE_NSWINDOW
-*/
-bool QCocoaWindow::isChildNSWindow() const
-{
- return m_view.window.parentWindow != nil;
-}
-
-/*!
Checks if the window is the content view of its immediate NSWindow.
Being the content view of a NSWindow means the QWindow is
the highest accessible NSView object in the window's view
hierarchy.
- This can only happen in two cases, either if the QWindow is
- itself a top level window, or if it's a child NSWindow.
-
- \sa isChildNSWindow
+ This is the case if the QWindow is a top level window.
*/
bool QCocoaWindow::isContentView() const
{
@@ -1624,33 +1162,16 @@ bool QCocoaWindow::isContentView() const
}
/*!
- Iterates child NSWindows that have a corresponding QCocoaWindow.
-*/
-void QCocoaWindow::foreachChildNSWindow(void (^block)(QCocoaWindow *))
-{
- NSArray *windows = m_view.window.childWindows;
- [windows enumerateObjectsUsingBlock:^(NSWindow *window, NSUInteger index, BOOL *stop) {
- Q_UNUSED(index);
- Q_UNUSED(stop);
- if (QNSView *view = qnsview_cast(window.contentView))
- block(view.platformWindow);
- }];
-}
-
-/*!
Recreates (or removes) the NSWindow for this QWindow, if needed.
- A QWindow may need a corresponding NSWindow, depending on whether
- or not it's a top level or not (or explicitly set to be a child
- NSWindow), whether it is a NSPanel or not, etc.
+ A QWindow may need a corresponding NSWindow/NSPanel, depending on
+ whether or not it's a top level or not, window flags, etc.
*/
void QCocoaWindow::recreateWindowIfNeeded()
{
QMacAutoReleasePool pool;
QPlatformWindow *parentWindow = QPlatformWindow::parent();
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindowIfNeeded" << window()
- << "parent" << (parentWindow ? parentWindow->window() : 0);
RecreationReasons recreateReason = RecreationNotNeeded;
@@ -1668,79 +1189,56 @@ void QCocoaWindow::recreateWindowIfNeeded()
if (m_windowModality != window()->modality())
recreateReason |= WindowModalityChanged;
- const bool shouldBeChildNSWindow = parentWindow && qt_mac_resolveOption(NO,
- window(), "_q_platform_MacUseNSWindow", "QT_MAC_USE_NSWINDOW");
-
- if (isChildNSWindow() != shouldBeChildNSWindow)
- recreateReason |= ChildNSWindowChanged;
-
- const bool shouldBeContentView = (!parentWindow && !m_viewIsEmbedded) || shouldBeChildNSWindow;
+ const bool shouldBeContentView = !parentWindow && !m_viewIsEmbedded;
if (isContentView() != shouldBeContentView)
recreateReason |= ContentViewChanged;
Qt::WindowType type = window()->type();
const bool isPanel = isContentView() && [m_view.window isKindOfClass:[QNSPanel class]];
- const bool shouldBePanel = shouldBeContentView && !shouldBeChildNSWindow &&
+ const bool shouldBePanel = shouldBeContentView &&
((type & Qt::Popup) == Qt::Popup || (type & Qt::Dialog) == Qt::Dialog);
if (isPanel != shouldBePanel)
recreateReason |= PanelChanged;
- if (recreateReason == RecreationNotNeeded) {
- qCDebug(lcQpaCocoaWindow) << "No need to recreate NSWindow";
- return;
- }
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindowIfNeeded" << window() << recreateReason;
- qCDebug(lcQpaCocoaWindow) << "Reconfiguring NSWindow due to" << recreateReason;
+ if (recreateReason == RecreationNotNeeded)
+ return;
QCocoaWindow *parentCocoaWindow = static_cast<QCocoaWindow *>(parentWindow);
- if (shouldBeChildNSWindow) {
- QWindow *parentQWindow = parentWindow->window();
- // Ensure that all parents in the hierarchy are also child NSWindows
- if (!parentQWindow->property("_q_platform_MacUseNSWindow").toBool()) {
- parentQWindow->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
- parentCocoaWindow->recreateWindowIfNeeded();
- }
- }
-
// Remove current window (if any)
if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) {
- qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow;
- [m_nsWindow closeAndRelease];
- if (isChildNSWindow())
- [m_view.window.parentWindow removeChildWindow:m_view.window];
- if (isContentView()) {
- // We explicitly disassociate m_view from the window's contentView,
- // as AppKit does not automatically do this in response to removing
- // the view from the NSThemeFrame subview list, so we might end up
- // with a NSWindow contentView pointing to a deallocated NSView.
- m_view.window.contentView = nil;
+ if (m_nsWindow) {
+ qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow;
+ [m_nsWindow closeAndRelease];
+ if (isContentView()) {
+ // We explicitly disassociate m_view from the window's contentView,
+ // as AppKit does not automatically do this in response to removing
+ // the view from the NSThemeFrame subview list, so we might end up
+ // with a NSWindow contentView pointing to a deallocated NSView.
+ m_view.window.contentView = nil;
+ }
+ m_nsWindow = 0;
}
- m_nsWindow = 0;
}
if (shouldBeContentView) {
bool noPreviousWindow = m_nsWindow == 0;
+ QCocoaNSWindow *newWindow = nullptr;
if (noPreviousWindow)
- m_nsWindow = createNSWindow(shouldBeChildNSWindow, shouldBePanel);
-
- if (m_view.window.parentWindow) {
- if (!shouldBeChildNSWindow || (recreateReason & ParentChanged))
- [m_view.window.parentWindow removeChildWindow:m_view.window];
- m_forwardWindow = oldParentCocoaWindow;
- }
+ newWindow = createNSWindow(shouldBePanel);
// Move view to new NSWindow if needed
- if (m_nsWindow.contentView != m_view) {
- qCDebug(lcQpaCocoaWindow) << "Ensuring that view is content view for" << m_nsWindow;
+ if (newWindow) {
+ qCDebug(lcQpaCocoaWindow) << "Ensuring that" << m_view << "is content view for" << newWindow;
[m_view setPostsFrameChangedNotifications:NO];
- [m_view retain];
- if (m_view.superview) // m_view comes from another NSWindow
- [m_view removeFromSuperview];
- [m_nsWindow setContentView:m_view];
- [m_view release];
+ [newWindow setContentView:m_view];
[m_view setPostsFrameChangedNotifications:YES];
+
+ m_nsWindow = newWindow;
+ Q_ASSERT(m_view.window == m_nsWindow);
}
}
@@ -1752,20 +1250,8 @@ void QCocoaWindow::recreateWindowIfNeeded()
setWindowFlags(window()->flags());
setWindowTitle(window()->title());
setWindowState(window()->windowState());
- } else if (shouldBeChildNSWindow) {
- if (!m_hiddenByClipping) {
- [parentCocoaWindow->m_nsWindow addChildWindow:m_nsWindow ordered:NSWindowAbove];
- parentCocoaWindow->reinsertChildWindow(this);
- }
-
- // Set properties after the window has been made a child NSWindow
- setCocoaGeometry(windowGeometry());
- setWindowFlags(window()->flags());
} else {
// Child windows have no NSWindow, link the NSViews instead.
- if ([m_view superview])
- [m_view removeFromSuperview];
-
[parentCocoaWindow->m_view addSubview:m_view];
QRect rect = windowGeometry();
// Prevent setting a (0,0) window size; causes opengl context
@@ -1781,29 +1267,18 @@ void QCocoaWindow::recreateWindowIfNeeded()
if (!qFuzzyCompare(opacity, qreal(1.0)))
setOpacity(opacity);
+ setMask(QHighDpi::toNativeLocalRegion(window()->mask(), window()));
+
// top-level QWindows may have an attached NSToolBar, call
// update function which will attach to the NSWindow.
if (!parentWindow)
updateNSToolbar();
}
-void QCocoaWindow::reinsertChildWindow(QCocoaWindow *child)
+void QCocoaWindow::requestUpdate()
{
- const QObjectList &childWindows = window()->children();
- int childIndex = childWindows.indexOf(child->window());
- Q_ASSERT(childIndex != -1);
-
- for (int i = childIndex; i < childWindows.size(); ++i) {
- QWindow *window = static_cast<QWindow *>(childWindows.at(i));
- QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
- if (!cocoaWindow)
- continue;
-
- NSWindow *nsChild = cocoaWindow->m_nsWindow;
- if (i != childIndex)
- [m_nsWindow removeChildWindow:nsChild];
- [m_nsWindow addChildWindow:nsChild ordered:NSWindowAbove];
- }
+ qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::requestUpdate" << window();
+ [m_view setNeedsDisplay:YES];
}
void QCocoaWindow::requestActivateWindow()
@@ -1813,10 +1288,8 @@ void QCocoaWindow::requestActivateWindow()
[window makeKeyWindow];
}
-QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool shouldBePanel)
+QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
{
- qCDebug(lcQpaCocoaWindow) << "createNSWindow" << shouldBeChildNSWindow << shouldBePanel;
-
QMacAutoReleasePool pool;
QRect rect = geometry();
@@ -1848,46 +1321,60 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool sh
// Create NSWindow
Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class];
- NSUInteger styleMask = shouldBeChildNSWindow ? NSBorderlessWindowMask : windowStyleMask(flags);
- QCocoaNSWindow *window = [[windowClass alloc] initWithContentRect:frame
- screen:cocoaScreen->nativeScreen() styleMask:styleMask qPlatformWindow:this];
-
- window.restorable = NO;
- window.level = shouldBeChildNSWindow ? NSNormalWindowLevel : windowLevel(flags);
-
- if (!isOpaque()) {
- window.backgroundColor = [NSColor clearColor];
- window.opaque = NO;
+ QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:frame
+ styleMask:windowStyleMask(flags)
+ // Deferring window creation breaks OpenGL (the GL context is
+ // set up before the window is shown and needs a proper window)
+ backing:NSBackingStoreBuffered defer:NO
+ screen:cocoaScreen->nativeScreen()];
+
+ Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow",
+ "Resulting NSScreen should match the requested NSScreen");
+
+ nsWindow.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this];
+
+ // Prevent Cocoa from releasing the window on close. Qt
+ // handles the close event asynchronously and we want to
+ // make sure that NSWindow stays valid until the
+ // QCocoaWindow is deleted by Qt.
+ [nsWindow setReleasedWhenClosed:NO];
+
+ if (alwaysShowToolWindow()) {
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+ [center addObserver:[QNSWindow class] selector:@selector(applicationActivationChanged:)
+ name:NSApplicationWillResignActiveNotification object:nil];
+ [center addObserver:[QNSWindow class] selector:@selector(applicationActivationChanged:)
+ name:NSApplicationWillBecomeActiveNotification object:nil];
+ });
}
- Q_ASSERT(!(shouldBePanel && shouldBeChildNSWindow));
+ if (targetScreen != window()->screen())
+ QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen);
+
+ nsWindow.restorable = NO;
+ nsWindow.level = windowLevel(flags);
if (shouldBePanel) {
// Qt::Tool windows hide on app deactivation, unless Qt::WA_MacAlwaysShowToolWindow is set
- window.hidesOnDeactivate = ((type & Qt::Tool) == Qt::Tool) && !alwaysShowToolWindow();
+ nsWindow.hidesOnDeactivate = ((type & Qt::Tool) == Qt::Tool) && !alwaysShowToolWindow();
// Make popup windows show on the same desktop as the parent full-screen window
- window.collectionBehavior = NSWindowCollectionBehaviorFullScreenAuxiliary;
+ nsWindow.collectionBehavior = NSWindowCollectionBehaviorFullScreenAuxiliary;
if ((type & Qt::Popup) == Qt::Popup) {
- window.hasShadow = YES;
- window.animationBehavior = NSWindowAnimationBehaviorUtilityWindow;
+ nsWindow.hasShadow = YES;
+ nsWindow.animationBehavior = NSWindowAnimationBehaviorUtilityWindow;
}
- } else if (shouldBeChildNSWindow) {
- window.collectionBehavior =
- NSWindowCollectionBehaviorManaged
- | NSWindowCollectionBehaviorIgnoresCycle
- | NSWindowCollectionBehaviorFullScreenAuxiliary;
- window.hasShadow = NO;
- window.animationBehavior = NSWindowAnimationBehaviorNone;
}
// Persist modality so we can detect changes later on
m_windowModality = QPlatformWindow::window()->modality();
- applyContentBorderThickness(window);
+ applyContentBorderThickness(nsWindow);
- return window;
+ return nsWindow;
}
bool QCocoaWindow::alwaysShowToolWindow() const
@@ -1906,10 +1393,10 @@ void QCocoaWindow::removeMonitor()
// Returns the current global screen geometry for the nswindow associated with this window.
QRect QCocoaWindow::nativeWindowGeometry() const
{
- if (!m_nsWindow || isChildNSWindow())
+ if (!isContentView())
return geometry();
- NSRect rect = [m_nsWindow frame];
+ NSRect rect = m_view.window.frame;
QPlatformScreen *onScreen = QPlatformScreen::platformScreenForWindow(window());
int flippedY = onScreen->geometry().height() - rect.origin.y - rect.size.height; // account for nswindow inverted y.
QRect qRect = QRect(rect.origin.x, flippedY, rect.size.width, rect.size.height);
@@ -1923,13 +1410,15 @@ QRect QCocoaWindow::nativeWindowGeometry() const
updated yet, so window()->windowState() will reflect the previous state that was
reported to QtGui.
*/
-void QCocoaWindow::applyWindowState(Qt::WindowState newState)
+void QCocoaWindow::applyWindowState(Qt::WindowStates requestedState)
{
const Qt::WindowState currentState = windowState();
+ const Qt::WindowState newState = QWindowPrivate::effectiveState(requestedState);
+
if (newState == currentState)
return;
- if (!m_nsWindow)
+ if (!isContentView())
return;
const NSSize contentSize = m_view.frame.size;
@@ -1937,23 +1426,25 @@ void QCocoaWindow::applyWindowState(Qt::WindowState newState)
// If content view width or height is 0 then the window animations will crash so
// do nothing. We report the current state back to reflect the failed operation.
qWarning("invalid window content view size, check your window geometry");
- reportCurrentWindowState(true);
+ handleWindowStateChanged(HandleUnconditionally);
return;
}
- if (m_nsWindow.styleMask & NSUtilityWindowMask) {
- // Utility panels cannot be fullscreen
- qWarning() << window()->type() << "windows can not be made full screen";
- reportCurrentWindowState(true);
+ const NSWindow *nsWindow = m_view.window;
+
+ if (nsWindow.styleMask & NSUtilityWindowMask
+ && newState & (Qt::WindowMinimized | Qt::WindowFullScreen)) {
+ qWarning() << window()->type() << "windows can not be made" << newState;
+ handleWindowStateChanged(HandleUnconditionally);
return;
}
- const id sender = m_nsWindow;
+ const id sender = nsWindow;
// First we need to exit states that can't transition directly to other states
switch (currentState) {
case Qt::WindowMinimized:
- [m_nsWindow deminiaturize:sender];
+ [nsWindow deminiaturize:sender];
Q_ASSERT_X(windowState() != Qt::WindowMinimized, "QCocoaWindow",
"[NSWindow deminiaturize:] is synchronous");
break;
@@ -1979,7 +1470,7 @@ void QCocoaWindow::applyWindowState(Qt::WindowState newState)
toggleMaximized();
break;
case Qt::WindowMinimized:
- [m_nsWindow miniaturize:sender];
+ [nsWindow miniaturize:sender];
break;
case Qt::WindowNoState:
if (windowState() == Qt::WindowMaximized)
@@ -1992,27 +1483,31 @@ void QCocoaWindow::applyWindowState(Qt::WindowState newState)
void QCocoaWindow::toggleMaximized()
{
+ const NSWindow *window = m_view.window;
+
// The NSWindow needs to be resizable, otherwise the window will
// not be possible to zoom back to non-zoomed state.
- const bool wasResizable = m_nsWindow.styleMask & NSResizableWindowMask;
- m_nsWindow.styleMask |= NSResizableWindowMask;
+ const bool wasResizable = window.styleMask & NSResizableWindowMask;
+ window.styleMask |= NSResizableWindowMask;
- const id sender = m_nsWindow;
- [m_nsWindow zoom:sender];
+ const id sender = window;
+ [window zoom:sender];
if (!wasResizable)
- m_nsWindow.styleMask &= ~NSResizableWindowMask;
+ window.styleMask &= ~NSResizableWindowMask;
}
void QCocoaWindow::toggleFullScreen()
{
+ const NSWindow *window = m_view.window;
+
// The window needs to have the correct collection behavior for the
// toggleFullScreen call to have an effect. The collection behavior
// will be reset in windowDidEnterFullScreen/windowDidLeaveFullScreen.
- m_nsWindow.collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary;
+ window.collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary;
- const id sender = m_nsWindow;
- [m_nsWindow toggleFullScreen:sender];
+ const id sender = window;
+ [window toggleFullScreen:sender];
}
bool QCocoaWindow::isTransitioningToFullScreen() const
@@ -2040,22 +1535,12 @@ Qt::WindowState QCocoaWindow::windowState() const
return Qt::WindowNoState;
}
-void QCocoaWindow::reportCurrentWindowState(bool unconditionally)
-{
- Qt::WindowState currentState = windowState();
- if (!unconditionally && currentState == m_lastReportedWindowState)
- return;
-
- QWindowSystemInterface::handleWindowStateChanged<QWindowSystemInterface::SynchronousDelivery>(
- window(), currentState, m_lastReportedWindowState);
- m_lastReportedWindowState = currentState;
-}
-
bool QCocoaWindow::setWindowModified(bool modified)
{
- if (!m_nsWindow)
+ if (!isContentView())
return false;
- [m_nsWindow setDocumentEdited:(modified?YES:NO)];
+
+ m_view.window.documentEdited = modified;
return true;
}
@@ -2069,51 +1554,19 @@ QCocoaMenuBar *QCocoaWindow::menubar() const
return m_menubar;
}
-// Finds the effective cursor for this window by walking up the
-// ancestor chain (including this window) until a set cursor is
-// found. Returns nil if there is not set cursor.
-NSCursor *QCocoaWindow::effectiveWindowCursor() const
-{
-
- if (m_windowCursor)
- return m_windowCursor;
- if (!QPlatformWindow::parent())
- return nil;
- return static_cast<QCocoaWindow *>(QPlatformWindow::parent())->effectiveWindowCursor();
-}
-
-// Applies the cursor as returned by effectiveWindowCursor(), handles
-// the special no-cursor-set case by setting the arrow cursor.
-void QCocoaWindow::applyEffectiveWindowCursor()
-{
- NSCursor *effectiveCursor = effectiveWindowCursor();
- if (effectiveCursor) {
- [effectiveCursor set];
- } else {
- // We wold like to _unset_ the cursor here; but there is no such
- // API. Fall back to setting the default arrow cursor.
- [[NSCursor arrowCursor] set];
- }
-}
-
void QCocoaWindow::setWindowCursor(NSCursor *cursor)
{
- if (m_windowCursor == cursor)
+ // Setting a cursor in a foreign view is not supported
+ if (isForeignWindow())
return;
- // Setting a cursor in a foregin view is not supported.
- if (isForeignWindow())
+ QNSView *view = qnsview_cast(m_view);
+ if (cursor == view.cursor)
return;
- [m_windowCursor release];
- m_windowCursor = cursor;
- [m_windowCursor retain];
+ view.cursor = cursor;
- // The installed view tracking area (see QNSView updateTrackingAreas) will
- // handle cursor updates on mouse enter/leave. Handle the case where the
- // mouse is on the this window by changing the cursor immediately.
- if (m_windowUnderMouse)
- applyEffectiveWindowCursor();
+ [m_view.window invalidateCursorRectsForView:m_view];
}
void QCocoaWindow::registerTouch(bool enable)
@@ -2132,35 +1585,38 @@ void QCocoaWindow::setContentBorderThickness(int topThickness, int bottomThickne
bool enable = (topThickness > 0 || bottomThickness > 0);
m_drawContentBorderGradient = enable;
- applyContentBorderThickness(m_nsWindow);
+ applyContentBorderThickness();
}
void QCocoaWindow::registerContentBorderArea(quintptr identifier, int upper, int lower)
{
m_contentBorderAreas.insert(identifier, BorderRange(identifier, upper, lower));
- applyContentBorderThickness(m_nsWindow);
+ applyContentBorderThickness();
}
void QCocoaWindow::setContentBorderAreaEnabled(quintptr identifier, bool enable)
{
m_enabledContentBorderAreas.insert(identifier, enable);
- applyContentBorderThickness(m_nsWindow);
+ applyContentBorderThickness();
}
void QCocoaWindow::setContentBorderEnabled(bool enable)
{
m_drawContentBorderGradient = enable;
- applyContentBorderThickness(m_nsWindow);
+ applyContentBorderThickness();
}
void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
{
+ if (!window && isContentView())
+ window = m_view.window;
+
if (!window)
return;
if (!m_drawContentBorderGradient) {
- [window setStyleMask:[window styleMask] & ~NSTexturedBackgroundWindowMask];
- [[[window contentView] superview] setNeedsDisplay:YES];
+ window.styleMask = window.styleMask & ~NSTexturedBackgroundWindowMask;
+ [window.contentView.superview setNeedsDisplay:YES];
return;
}
@@ -2197,22 +1653,23 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
void QCocoaWindow::updateNSToolbar()
{
- if (!m_nsWindow)
+ if (!isContentView())
return;
NSToolbar *toolbar = QCocoaIntegration::instance()->toolbar(window());
+ const NSWindow *window = m_view.window;
- if ([m_nsWindow toolbar] == toolbar)
+ if (window.toolbar == toolbar)
return;
- [m_nsWindow setToolbar: toolbar];
- [m_nsWindow setShowsToolbarButton:YES];
+ window.toolbar = toolbar;
+ window.showsToolbarButton = YES;
}
bool QCocoaWindow::testContentBorderAreaPosition(int position) const
{
- return m_nsWindow && m_drawContentBorderGradient &&
- 0 <= position && position < [m_nsWindow contentBorderThicknessForEdge: NSMaxYEdge];
+ return isContentView() && m_drawContentBorderGradient &&
+ 0 <= position && position < [m_view.window contentBorderThicknessForEdge:NSMaxYEdge];
}
qreal QCocoaWindow::devicePixelRatio() const
@@ -2226,85 +1683,6 @@ qreal QCocoaWindow::devicePixelRatio() const
return backingSize.height;
}
-// Returns whether the window can be expose, which it can
-// if it is on screen and has a valid geometry.
-bool QCocoaWindow::isWindowExposable()
-{
- QSize size = geometry().size();
- bool validGeometry = (size.width() > 0 && size.height() > 0);
- bool validScreen = ([[m_view window] screen] != 0);
- bool nonHiddenSuperView = ![[m_view superview] isHidden];
- return (validGeometry && validScreen && nonHiddenSuperView);
-}
-
-// Exposes the window by posting an expose event to QWindowSystemInterface
-void QCocoaWindow::exposeWindow()
-{
- m_geometryUpdateExposeAllowed = true;
-
- if (!isWindowExposable())
- return;
-
- if (window()->isTopLevel()) {
- // Update the QWindow's screen property. This property is set
- // to QGuiApplication::primaryScreen() at QWindow construciton
- // time, and we won't get a NSWindowDidChangeScreenNotification
- // on show. The case where the window is initially displayed
- // on a non-primary screen needs special handling here.
- if (QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenForNSScreen(m_nsWindow.screen))
- window()->setScreen(cocoaScreen->screen());
- }
-
- if (!m_isExposed) {
- m_isExposed = true;
- m_exposedGeometry = geometry();
- m_exposedDevicePixelRatio = devicePixelRatio();
- QRect geometry(QPoint(0, 0), m_exposedGeometry.size());
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow: exposeWindow" << window() << geometry;
- QWindowSystemInterface::handleExposeEvent(window(), geometry);
- }
-}
-
-// Obscures the window by posting an empty expose event to QWindowSystemInterface
-void QCocoaWindow::obscureWindow()
-{
- if (m_isExposed) {
- m_geometryUpdateExposeAllowed = false;
- m_isExposed = false;
-
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::obscureWindow" << window();
- QWindowSystemInterface::handleExposeEvent(window(), QRegion());
- }
-}
-
-// Updates window geometry by posting an expose event to QWindowSystemInterface
-void QCocoaWindow::updateExposedGeometry()
-{
- // updateExposedGeometry is not allowed to send the initial expose. If you want
- // that call exposeWindow();
- if (!m_geometryUpdateExposeAllowed)
- return;
-
- // Do not send incorrect exposes in case the window is not even visible yet.
- // We might get here as a result of a resize() from QWidget's show(), for instance.
- if (!window()->isVisible())
- return;
-
- if (!isWindowExposable())
- return;
-
- if (m_exposedGeometry.size() == geometry().size() && m_exposedDevicePixelRatio == devicePixelRatio())
- return;
-
- m_isExposed = true;
- m_exposedGeometry = geometry();
- m_exposedDevicePixelRatio = devicePixelRatio();
-
- QRect geometry(QPoint(0, 0), m_exposedGeometry.size());
- qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::updateExposedGeometry" << window() << geometry;
- QWindowSystemInterface::handleExposeEvent(window(), geometry);
-}
-
QWindow *QCocoaWindow::childWindowAt(QPoint windowPoint)
{
QWindow *targetWindow = window();
@@ -2354,8 +1732,11 @@ QPoint QCocoaWindow::bottomLeftClippedByNSWindowOffset() const
QMargins QCocoaWindow::frameMargins() const
{
- NSRect frameW = [m_nsWindow frame];
- NSRect frameC = [m_nsWindow contentRectForFrameRect:frameW];
+ if (!isContentView())
+ return QMargins();
+
+ NSRect frameW = m_view.window.frame;
+ NSRect frameC = [m_view.window contentRectForFrameRect:frameW];
return QMargins(frameW.origin.x - frameC.origin.x,
(frameW.origin.y + frameW.size.height) - (frameC.origin.y + frameC.size.height),
@@ -2368,4 +1749,19 @@ void QCocoaWindow::setFrameStrutEventsEnabled(bool enabled)
m_frameStrutEventsEnabled = enabled;
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QCocoaWindow *window)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QCocoaWindow(" << (const void *)window;
+ if (window)
+ debug << ", window=" << window->window();
+ debug << ')';
+ return debug;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
#include "moc_qcocoawindow.cpp"
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 384f14ba3a..f8903725a6 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -51,19 +51,12 @@
QT_BEGIN_NAMESPACE
class QCocoaWindow;
-class QCocoaBackingStore;
class QCocoaGLContext;
QT_END_NAMESPACE
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
@interface QT_MANGLE_NAMESPACE(QNSView) : NSView <NSTextInputClient> {
- QCocoaBackingStore* m_backingStore;
- QPoint m_backingStoreOffset;
- QRegion m_maskRegion;
- CGImageRef m_maskImage;
- uchar *m_maskData;
- bool m_shouldInvalidateWindowShadow;
QPointer<QCocoaWindow> m_platformWindow;
NSTrackingArea *m_trackingArea;
Qt::MouseButtons m_buttons;
@@ -73,6 +66,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
QPointer<QObject> m_composingFocusObject;
bool m_sendKeyEvent;
QStringList *currentCustomDragTypes;
+ bool m_dontOverrideCtrlLMB;
bool m_sendUpAsRightButton;
Qt::KeyboardModifiers currentWheelModifiers;
#ifndef QT_NO_OPENGL
@@ -89,28 +83,22 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
QSet<quint32> m_acceptedKeyDowns;
}
+@property (nonatomic, retain) NSCursor *cursor;
+
- (id)init;
- (id)initWithCocoaWindow:(QCocoaWindow *)platformWindow;
#ifndef QT_NO_OPENGL
- (void)setQCocoaGLContext:(QCocoaGLContext *)context;
#endif
-- (void)flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset;
-- (void)clearBackingStore:(QCocoaBackingStore *)backingStore;
-- (void)setMaskRegion:(const QRegion *)region;
-- (void)invalidateWindowShadowIfNeeded;
- (void)drawRect:(NSRect)dirtyRect;
-- (void)drawBackingStoreUsingCoreGraphics:(NSRect)dirtyRect;
-- (void)updateGeometry;
- (void)textInputContextKeyboardSelectionDidChangeNotification : (NSNotification *) textInputContextKeyboardSelectionDidChangeNotification;
- (void)viewDidHide;
-- (void)viewDidUnhide;
- (void)removeFromSuperview;
- (void)cancelComposingText;
- (BOOL)isFlipped;
- (BOOL)acceptsFirstResponder;
- (BOOL)becomeFirstResponder;
-- (BOOL)hasMask;
- (BOOL)isOpaque;
- (void)convertFromScreen:(NSPoint)mouseLocation toWindowPoint:(QPointF *)qtWindowPoint andScreenPoint:(QPointF *)qtScreenPoint;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 04e02a274a..011bbd9d08 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -53,6 +53,7 @@
#include <QtCore/qsysinfo.h>
#include <private/qguiapplication_p.h>
#include <private/qcoregraphics_p.h>
+#include <private/qwindow_p.h>
#include "qcocoabackingstore.h"
#ifndef QT_NO_OPENGL
#include "qcocoaglcontext.h"
@@ -71,14 +72,6 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
static QTouchDevice *touchDevice = 0;
-static bool _q_dontOverrideCtrlLMB = false;
-
-@interface NSEvent (Qt_Compile_Leopard_DeviceDelta)
- - (CGFloat)deviceDeltaX;
- - (CGFloat)deviceDeltaY;
- - (CGFloat)deviceDeltaZ;
-@end
-
@interface QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) : NSObject
{
QNSView *view;
@@ -121,7 +114,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)cursorUpdate:(NSEvent *)theEvent
{
- [self cursorUpdate:theEvent];
+ [view cursorUpdate:theEvent];
}
@end
@@ -133,17 +126,9 @@ static bool _q_dontOverrideCtrlLMB = false;
@implementation QT_MANGLE_NAMESPACE(QNSView)
-+ (void)initialize
-{
- _q_dontOverrideCtrlLMB = qt_mac_resolveOption(false, "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
-}
-
- (id) init
{
if (self = [super initWithFrame:NSZeroRect]) {
- m_backingStore = 0;
- m_maskImage = 0;
- m_shouldInvalidateWindowShadow = false;
m_buttons = Qt::NoButton;
m_acceptedMouseDowns = Qt::NoButton;
m_frameStrutButtons = Qt::NoButton;
@@ -153,6 +138,7 @@ static bool _q_dontOverrideCtrlLMB = false;
m_shouldSetGLContextinDrawRect = false;
#endif
currentCustomDragTypes = 0;
+ m_dontOverrideCtrlLMB = false;
m_sendUpAsRightButton = false;
m_inputSource = 0;
m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
@@ -170,18 +156,17 @@ static bool _q_dontOverrideCtrlLMB = false;
m_isMenuView = false;
self.focusRingType = NSFocusRingTypeNone;
+ self.cursor = nil;
}
return self;
}
- (void)dealloc
{
- CGImageRelease(m_maskImage);
if (m_trackingArea) {
[self removeTrackingArea:m_trackingArea];
[m_trackingArea release];
}
- m_maskImage = 0;
[m_inputSource release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[m_mouseMoveHelper release];
@@ -199,6 +184,7 @@ static bool _q_dontOverrideCtrlLMB = false;
m_platformWindow = platformWindow;
m_sendKeyEvent = false;
+ m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, platformWindow->window(), "_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
m_trackingArea = nil;
#ifdef QT_COCOA_ENABLE_ACCESSIBILITY_INSPECTOR
@@ -226,6 +212,22 @@ static bool _q_dontOverrideCtrlLMB = false;
return self;
}
+- (NSString *)description
+{
+ NSMutableString *description = [NSMutableString stringWithString:[super description]];
+
+#ifndef QT_NO_DEBUG_STREAM
+ QString platformWindowDescription;
+ QDebug debug(&platformWindowDescription);
+ debug.nospace() << "; " << m_platformWindow << ">";
+
+ NSRange lastCharacter = [description rangeOfComposedCharacterSequenceAtIndex:description.length - 1];
+ [description replaceCharactersInRange:lastCharacter withString:platformWindowDescription.toNSString()];
+#endif
+
+ return description;
+}
+
#ifndef QT_NO_OPENGL
- (void) setQCocoaGLContext:(QCocoaGLContext *)context
{
@@ -249,18 +251,13 @@ static bool _q_dontOverrideCtrlLMB = false;
if ([self superview]) {
m_platformWindow->m_viewIsEmbedded = true;
QWindowSystemInterface::handleGeometryChange(m_platformWindow->window(), m_platformWindow->geometry());
- m_platformWindow->updateExposedGeometry();
+ [self setNeedsDisplay:YES];
QWindowSystemInterface::flushWindowSystemEvents();
} else {
m_platformWindow->m_viewIsEmbedded = false;
}
}
-- (void)viewDidMoveToWindow
-{
- m_backingStore = Q_NULLPTR;
-}
-
- (QWindow *)topLevelWindow
{
if (!m_platformWindow)
@@ -279,77 +276,6 @@ static bool _q_dontOverrideCtrlLMB = false;
return focusWindow;
}
-- (void)updateGeometry
-{
- if (!m_platformWindow)
- return;
-
- QRect geometry;
-
- if (self.window.parentWindow) {
- return;
-#if 0
- //geometry = QRectF::fromCGRect([self frame]).toRect();
- qDebug() << "nsview updateGeometry" << m_platformWindow->window();
- QRect screenRect = QRectF::fromCGRect([m_platformWindow->m_nsWindow convertRectToScreen:[self frame]]).toRect();
- qDebug() << "screenRect" << screenRect;
-
- screenRect.moveTop(qt_mac_flipYCoordinate(screenRect.y() + screenRect.height()));
- geometry = QRect(m_platformWindow->window()->parent()->mapFromGlobal(screenRect.topLeft()), screenRect.size());
- qDebug() << "geometry" << geometry;
-#endif
- //geometry = QRect(screenRect.origin.x, qt_mac_flipYCoordinate(screenRect.origin.y + screenRect.size.height), screenRect.size.width, screenRect.size.height);
- } else if (m_platformWindow->m_nsWindow) {
- // top level window, get window rect and flip y.
- NSRect rect = [self frame];
- NSRect windowRect = [[self window] frame];
- geometry = QRect(windowRect.origin.x, qt_mac_flipYCoordinate(windowRect.origin.y + rect.size.height), rect.size.width, rect.size.height);
- } else if (m_platformWindow->m_viewIsToBeEmbedded) {
- // embedded child window, use the frame rect ### merge with case below
- geometry = QRectF::fromCGRect(NSRectToCGRect([self bounds])).toRect();
- } else {
- // child window, use the frame rect
- geometry = QRectF::fromCGRect(NSRectToCGRect([self frame])).toRect();
- }
-
- if (m_platformWindow->m_nsWindow && geometry == m_platformWindow->geometry())
- return;
-
- const bool isResize = geometry.size() != m_platformWindow->geometry().size();
-
- // It can happen that self.window is nil (if we are changing
- // styleMask from/to borderless and content view is being re-parented)
- // - this results in an invalid coordinates.
- if (m_platformWindow->m_inSetStyleMask && !self.window)
- return;
-
- qCDebug(lcQpaCocoaWindow) << "[QNSView udpateGeometry:]" << m_platformWindow->window()
- << "current" << m_platformWindow->geometry() << "new" << geometry;
-
- // Call setGeometry on QPlatformWindow. (not on QCocoaWindow,
- // doing that will initiate a geometry change it and possibly create
- // an infinite loop when this notification is triggered again.)
- m_platformWindow->QPlatformWindow::setGeometry(geometry);
-
- // Don't send the geometry change if the QWindow is designated to be
- // embedded in a foreign view hiearchy but has not actually been
- // embedded yet - it's too early.
- if (m_platformWindow->m_viewIsToBeEmbedded && !m_platformWindow->m_viewIsEmbedded)
- return;
-
- // Send a geometry change event to Qt, if it's ready to handle events
- if (!m_platformWindow->m_inConstructor) {
- QWindowSystemInterface::handleGeometryChange(m_platformWindow->window(), geometry);
- m_platformWindow->updateExposedGeometry();
- // Guard against processing window system events during QWindow::setGeometry
- // calles, which Qt and Qt applications do not excpect.
- if (!m_platformWindow->m_inSetGeometry)
- QWindowSystemInterface::flushWindowSystemEvents();
- else if (isResize)
- m_backingStore = 0;
- }
-}
-
- (void)textInputContextKeyboardSelectionDidChangeNotification : (NSNotification *) textInputContextKeyboardSelectionDidChangeNotification
{
Q_UNUSED(textInputContextKeyboardSelectionDidChangeNotification)
@@ -361,12 +287,13 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)viewDidHide
{
- m_platformWindow->obscureWindow();
-}
+ if (!m_platformWindow->isExposed())
+ return;
-- (void)viewDidUnhide
-{
- m_platformWindow->exposeWindow();
+ m_platformWindow->handleExposeEvent(QRegion());
+
+ // Note: setNeedsDisplay is automatically called for
+ // viewDidUnhide so no reason to override it here.
}
- (void)removeFromSuperview
@@ -375,35 +302,6 @@ static bool _q_dontOverrideCtrlLMB = false;
[super removeFromSuperview];
}
-- (void) flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset
-{
- qCDebug(lcQpaCocoaWindow) << "[QNSView flushBackingStore:]" << m_platformWindow->window() << region.rectCount() << region.boundingRect() << offset;
-
- m_backingStore = backingStore;
- m_backingStoreOffset = offset * m_backingStore->paintDevice()->devicePixelRatio();
-
- // Prevent buildup of NSDisplayCycle objects during setNeedsDisplayInRect, which
- // would normally be released as part of the root runloop's autorelease pool, but
- // can be kept alive during repeated painting which starve the root runloop.
- // FIXME: Move this to the event dispatcher, to cover more cases of starvation.
- // FIXME: Figure out if there's a way to detect and/or prevent runloop starvation.
- QMacAutoReleasePool pool;
-
- for (const QRect &rect : region)
- [self setNeedsDisplayInRect:NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height())];
-}
-
-- (void)clearBackingStore:(QCocoaBackingStore *)backingStore
-{
- if (backingStore == m_backingStore)
- m_backingStore = 0;
-}
-
-- (BOOL) hasMask
-{
- return !m_maskRegion.isEmpty();
-}
-
- (BOOL) isOpaque
{
if (!m_platformWindow)
@@ -411,49 +309,21 @@ static bool _q_dontOverrideCtrlLMB = false;
return m_platformWindow->isOpaque();
}
-- (void) setMaskRegion:(const QRegion *)region
-{
- m_shouldInvalidateWindowShadow = true;
- m_maskRegion = *region;
- if (m_maskImage)
- CGImageRelease(m_maskImage);
- if (region->isEmpty()) {
- m_maskImage = 0;
- return;
- }
-
- const QRect &rect = region->boundingRect();
- QImage tmp(rect.size(), QImage::Format_RGB32);
- tmp.fill(Qt::white);
- QPainter p(&tmp);
- p.setClipRegion(*region);
- p.fillRect(rect, Qt::black);
- p.end();
- QImage maskImage = QImage(rect.size(), QImage::Format_Indexed8);
- for (int y=0; y<rect.height(); ++y) {
- const uint *src = (const uint *) tmp.constScanLine(y);
- uchar *dst = maskImage.scanLine(y);
- for (int x=0; x<rect.width(); ++x) {
- dst[x] = src[x] & 0xff;
- }
- }
- m_maskImage = qt_mac_toCGImageMask(maskImage);
-}
-
-- (void)invalidateWindowShadowIfNeeded
-{
- if (m_shouldInvalidateWindowShadow && m_platformWindow->m_nsWindow) {
- [m_platformWindow->m_nsWindow invalidateShadow];
- m_shouldInvalidateWindowShadow = false;
- }
-}
-
- (void)drawRect:(NSRect)dirtyRect
{
+ Q_UNUSED(dirtyRect);
+
if (!m_platformWindow)
return;
- qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << QRectF::fromCGRect(NSRectToCGRect(dirtyRect));
+ 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(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion;
#ifndef QT_NO_OPENGL
if (m_glContext && m_shouldSetGLContextinDrawRect) {
@@ -462,85 +332,37 @@ static bool _q_dontOverrideCtrlLMB = false;
}
#endif
- if (m_platformWindow->m_drawContentBorderGradient)
- NSDrawWindowBackground(dirtyRect);
-
- if (m_backingStore)
- [self drawBackingStoreUsingCoreGraphics:dirtyRect];
+ m_platformWindow->handleExposeEvent(exposedRegion);
+
+ // A call to QWindow::requestUpdate was issued during the expose event, but
+ // AppKit will reset the needsDisplay state of the view after completing the
+ // current display cycle, so we need to defer the request to redisplay.
+ // FIXME: Perhaps this should be a trigger to enable CADisplayLink?
+ if (qt_window_private(m_platformWindow->window())->updateRequestPending) {
+ qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:] deferring setNeedsDisplay";
+ dispatch_async(dispatch_get_main_queue (), ^{
+ [self setNeedsDisplay:YES];
+ });
+ }
+}
- [self invalidateWindowShadowIfNeeded];
+- (BOOL)wantsUpdateLayer
+{
+ return YES;
}
-// Draws the backing store content to the QNSView using Core Graphics.
-// This function assumes that the QNSView is in a configuration that
-// supports Core Graphics, such as "classic" mode or layer mode with
-// the default layer.
-- (void)drawBackingStoreUsingCoreGraphics:(NSRect)dirtyRect
+- (void)updateLayer
{
- if (!m_backingStore)
+ if (!m_platformWindow)
return;
- // Calculate source and target rects. The target rect is the dirtyRect:
- CGRect dirtyWindowRect = NSRectToCGRect(dirtyRect);
-
- // The backing store source rect will be larger on retina displays.
- // Scale dirtyRect by the device pixel ratio:
- const qreal devicePixelRatio = m_backingStore->paintDevice()->devicePixelRatio();
- CGRect dirtyBackingRect = CGRectMake(dirtyRect.origin.x * devicePixelRatio,
- dirtyRect.origin.y * devicePixelRatio,
- dirtyRect.size.width * devicePixelRatio,
- dirtyRect.size.height * devicePixelRatio);
-
- NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext currentContext];
- CGContextRef cgContext = (CGContextRef) [nsGraphicsContext graphicsPort];
-
- // Translate coordiate system from CoreGraphics (bottom-left) to NSView (top-left):
- CGContextSaveGState(cgContext);
- int dy = dirtyWindowRect.origin.y + CGRectGetMaxY(dirtyWindowRect);
-
- CGContextTranslateCTM(cgContext, 0, dy);
- CGContextScaleCTM(cgContext, 1, -1);
-
- // If a mask is set, modify the sub image accordingly:
- CGImageRef subMask = 0;
- if (m_maskImage) {
- subMask = CGImageCreateWithImageInRect(m_maskImage, dirtyWindowRect);
- CGContextClipToMask(cgContext, dirtyWindowRect, subMask);
- }
-
- // Clip out and draw the correct sub image from the (shared) backingstore:
- CGRect backingStoreRect = CGRectMake(
- dirtyBackingRect.origin.x + m_backingStoreOffset.x(),
- dirtyBackingRect.origin.y + m_backingStoreOffset.y(),
- dirtyBackingRect.size.width,
- dirtyBackingRect.size.height
- );
- CGImageRef bsCGImage = qt_mac_toCGImage(m_backingStore->toImage());
+ qCDebug(lcQpaCocoaWindow) << "[QNSView updateLayer]" << m_platformWindow->window();
- // Prevent potentially costly color conversion by assiging the display
- // color space to the backingstore image.
- CGImageRef displayColorSpaceImage = CGImageCreateCopyWithColorSpace(bsCGImage,
- self.window.screen.colorSpace.CGColorSpace);
-
- CGImageRef cleanImg = CGImageCreateWithImageInRect(displayColorSpaceImage, backingStoreRect);
-
- // Optimization: Copy frame buffer content instead of blending for
- // top-level windows where Qt fills the entire window content area.
- // (But don't overpaint the title-bar gradient)
- if (m_platformWindow->m_nsWindow && !m_platformWindow->m_drawContentBorderGradient)
- CGContextSetBlendMode(cgContext, kCGBlendModeCopy);
-
- CGContextDrawImage(cgContext, dirtyWindowRect, cleanImg);
-
- // Clean-up:
- CGContextRestoreGState(cgContext);
- CGImageRelease(cleanImg);
- CGImageRelease(subMask);
- CGImageRelease(bsCGImage);
- CGImageRelease(displayColorSpaceImage);
+ // FIXME: Find out if there's a way to resolve the dirty rect like in drawRect:
+ m_platformWindow->handleExposeEvent(QRectF::fromCGRect(self.bounds).toRect());
}
-- (BOOL) isFlipped
+- (BOOL)isFlipped
{
return YES;
}
@@ -661,12 +483,6 @@ static bool _q_dontOverrideCtrlLMB = false;
QPointF qtWindowPoint;
QPointF qtScreenPoint;
QNSView *targetView = self;
- if (m_platformWindow && m_platformWindow->m_forwardWindow) {
- if (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp)
- targetView = qnsview_cast(m_platformWindow->m_forwardWindow->view());
- else
- m_platformWindow->m_forwardWindow.clear();
- }
if (!targetView.platformWindow)
return;
@@ -760,7 +576,8 @@ static bool _q_dontOverrideCtrlLMB = false;
Q_UNUSED(qtScreenPoint);
// Maintain masked state for the button for use by MouseDragged and MouseUp.
- const bool masked = [self hasMask] && !m_maskRegion.contains(qtWindowPoint.toPoint());
+ QRegion mask = m_platformWindow->window()->mask();
+ const bool masked = !mask.isEmpty() && !mask.contains(qtWindowPoint.toPoint());
if (masked)
m_acceptedMouseDowns &= ~button;
else
@@ -858,8 +675,8 @@ static bool _q_dontOverrideCtrlLMB = false;
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
Q_UNUSED(qtScreenPoint);
- const bool masked = [self hasMask] && !m_maskRegion.contains(qtWindowPoint.toPoint());
-
+ QRegion mask = m_platformWindow->window()->mask();
+ const bool masked = !mask.isEmpty() && !mask.contains(qtWindowPoint.toPoint());
// Maintain masked state for the button for use by MouseDragged and Up.
if (masked)
m_acceptedMouseDowns &= ~Qt::LeftButton;
@@ -875,7 +692,7 @@ static bool _q_dontOverrideCtrlLMB = false;
if ([self hasMarkedText]) {
[[NSTextInputContext currentInputContext] handleEvent:theEvent];
} else {
- if (!_q_dontOverrideCtrlLMB && [QNSView convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) {
+ if (!m_dontOverrideCtrlLMB && [QNSView convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) {
m_buttons |= Qt::RightButton;
m_sendUpAsRightButton = true;
} else {
@@ -972,8 +789,16 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)cursorUpdate:(NSEvent *)theEvent
{
- Q_UNUSED(theEvent);
- m_platformWindow->applyEffectiveWindowCursor();
+ qCDebug(lcQpaCocoaWindow) << "[QNSView cursorUpdate:]" << self.cursor;
+
+ // Note: We do not get this callback when moving from a subview that
+ // uses the legacy cursorRect API, so the cursor is reset to the arrow
+ // cursor. See rdar://34183708
+
+ if (self.cursor)
+ [self.cursor set];
+ else
+ [super cursorUpdate:theEvent];
}
- (void)mouseMovedImpl:(NSEvent *)theEvent
@@ -994,7 +819,7 @@ static bool _q_dontOverrideCtrlLMB = false;
// the time of the leave. This is dificult to accomplish by
// handling mouseEnter and mouseLeave envents, since they are sent
// individually to different views.
- if (m_platformWindow->m_nsWindow && childWindow) {
+ if (m_platformWindow->isContentView() && childWindow) {
if (childWindow != m_platformWindow->m_enterLeaveTargetWindow) {
QWindowSystemInterface::handleEnterLeaveEvent(childWindow, m_platformWindow->m_enterLeaveTargetWindow, windowPoint, screenPoint);
m_platformWindow->m_enterLeaveTargetWindow = childWindow;
@@ -1021,7 +846,7 @@ static bool _q_dontOverrideCtrlLMB = false;
return;
// Top-level windows generate enter events for sub-windows.
- if (!m_platformWindow->m_nsWindow)
+ if (!m_platformWindow->isContentView())
return;
QPointF windowPoint;
@@ -1043,7 +868,7 @@ static bool _q_dontOverrideCtrlLMB = false;
return;
// Top-level windows generate leave events for sub-windows.
- if (!m_platformWindow->m_nsWindow)
+ if (!m_platformWindow->isContentView())
return;
QWindowSystemInterface::handleLeaveEvent(m_platformWindow->m_enterLeaveTargetWindow);
@@ -2115,7 +1940,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
if (nativeDrag->currentDrag()) {
// The drag was started from within the application
- response = QWindowSystemInterface::handleDrag(target, nativeDrag->platformDropData(), mapWindowCoordinates(m_platformWindow->window(), target, qt_windowPoint), qtAllowed);
+ response = QWindowSystemInterface::handleDrag(target, nativeDrag->dragMimeData(), mapWindowCoordinates(m_platformWindow->window(), target, qt_windowPoint), qtAllowed);
[self updateCursorFromDragResponse:response drag:nativeDrag];
} else {
QCocoaDropData mimeData([sender draggingPasteboard]);
@@ -2159,7 +1984,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
if (nativeDrag->currentDrag()) {
// The drag was started from within the application
- response = QWindowSystemInterface::handleDrop(target, nativeDrag->platformDropData(), mapWindowCoordinates(m_platformWindow->window(), target, qt_windowPoint), qtAllowed);
+ response = QWindowSystemInterface::handleDrop(target, nativeDrag->dragMimeData(), mapWindowCoordinates(m_platformWindow->window(), target, qt_windowPoint), qtAllowed);
} else {
QCocoaDropData mimeData([sender draggingPasteboard]);
response = QWindowSystemInterface::handleDrop(target, &mimeData, mapWindowCoordinates(m_platformWindow->window(), target, qt_windowPoint), qtAllowed);
diff --git a/src/plugins/platforms/cocoa/qnswindow.h b/src/plugins/platforms/cocoa/qnswindow.h
new file mode 100644
index 0000000000..1258fddb31
--- /dev/null
+++ b/src/plugins/platforms/cocoa/qnswindow.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QNSWINDOW_H
+#define QNSWINDOW_H
+
+#include <qglobal.h>
+#include <QPointer>
+#include "qt_mac_p.h"
+
+#include <AppKit/AppKit.h>
+
+QT_FORWARD_DECLARE_CLASS(QCocoaWindow)
+
+@interface NSWindow (FullScreenProperty)
+@property(readonly) BOOL qt_fullScreen;
+@end
+
+@protocol QNSWindowProtocol
+@optional
+- (BOOL)canBecomeKeyWindow;
+- (void)sendEvent:(NSEvent*)theEvent;
+- (void)closeAndRelease;
+- (void)dealloc;
+- (BOOL)isOpaque;
+- (NSColor *)backgroundColor;
+@property (nonatomic, readonly) QCocoaWindow *platformWindow;
+@end
+
+typedef NSWindow<QNSWindowProtocol> QCocoaNSWindow;
+
+@interface QT_MANGLE_NAMESPACE(QNSWindow) : NSWindow<QNSWindowProtocol> @end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindow);
+
+@interface QT_MANGLE_NAMESPACE(QNSPanel) : NSPanel<QNSWindowProtocol> @end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanel);
+
+#endif // QNSWINDOW_H
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
new file mode 100644
index 0000000000..513c7f22b5
--- /dev/null
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -0,0 +1,299 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 "qnswindow.h"
+#include "qnswindowdelegate.h"
+#include "qcocoawindow.h"
+#include "qcocoahelpers.h"
+#include "qcocoaeventdispatcher.h"
+
+#include <qpa/qwindowsysteminterface.h>
+#include <qoperatingsystemversion.h>
+
+static bool isMouseEvent(NSEvent *ev)
+{
+ switch ([ev type]) {
+ case NSLeftMouseDown:
+ case NSLeftMouseUp:
+ case NSRightMouseDown:
+ case NSRightMouseUp:
+ case NSMouseMoved:
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ return true;
+ default:
+ return false;
+ }
+}
+
+@implementation NSWindow (FullScreenProperty)
+
++ (void)load
+{
+ NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+ [center addObserverForName:NSWindowDidEnterFullScreenNotification object:nil queue:nil
+ usingBlock:^(NSNotification *notification) {
+ objc_setAssociatedObject(notification.object, @selector(qt_fullScreen),
+ [NSNumber numberWithBool:YES], OBJC_ASSOCIATION_RETAIN);
+ }
+ ];
+ [center addObserverForName:NSWindowDidExitFullScreenNotification object:nil queue:nil
+ usingBlock:^(NSNotification *notification) {
+ objc_setAssociatedObject(notification.object, @selector(qt_fullScreen),
+ nil, OBJC_ASSOCIATION_RETAIN);
+ }
+ ];
+}
+
+- (BOOL)qt_fullScreen
+{
+ NSNumber *number = objc_getAssociatedObject(self, @selector(qt_fullScreen));
+ return [number boolValue];
+}
+@end
+
+#define super USE_qt_objcDynamicSuper_INSTEAD
+
+@implementation QNSWindow
+
++ (void)load
+{
+ const Class windowClass = [self class];
+ const Class panelClass = [QNSPanel class];
+
+ unsigned int methodDescriptionsCount;
+ objc_method_description *methods = protocol_copyMethodDescriptionList(
+ objc_getProtocol("QNSWindowProtocol"), NO, YES, &methodDescriptionsCount);
+
+ for (unsigned int i = 0; i < methodDescriptionsCount; ++i) {
+ objc_method_description method = methods[i];
+ class_addMethod(panelClass, method.name,
+ class_getMethodImplementation(windowClass, method.name),
+ method.types);
+ }
+
+ free(methods);
+}
+
+- (QCocoaWindow *)platformWindow
+{
+ return qnsview_cast(self.contentView).platformWindow;
+}
+
+- (BOOL)canBecomeKeyWindow
+{
+ QCocoaWindow *pw = self.platformWindow;
+ if (!pw)
+ return NO;
+
+ if (pw->shouldRefuseKeyWindowAndFirstResponder())
+ return NO;
+
+ if ([self isKindOfClass:[QNSPanel class]]) {
+ // Only tool or dialog windows should become key:
+ Qt::WindowType type = pw->window()->type();
+ if (type == Qt::Tool || type == Qt::Dialog)
+ return YES;
+
+ return NO;
+ } else {
+ // The default implementation returns NO for title-bar less windows,
+ // override and return yes here to make sure popup windows such as
+ // the combobox popup can become the key window.
+ return YES;
+ }
+}
+
+- (BOOL)canBecomeMainWindow
+{
+ BOOL canBecomeMain = YES; // By default, windows can become the main window
+
+ // Windows with a transient parent (such as combobox popup windows)
+ // cannot become the main window:
+ QCocoaWindow *pw = self.platformWindow;
+ if (!pw || pw->window()->transientParent())
+ canBecomeMain = NO;
+
+ return canBecomeMain;
+}
+
+- (BOOL)isOpaque
+{
+ return self.platformWindow ?
+ self.platformWindow->isOpaque() : qt_objcDynamicSuper();
+}
+
+/*!
+ Borderless windows need a transparent background
+
+ Technically windows with NSTexturedBackgroundWindowMask (such
+ as windows with unified toolbars) need to draw the textured
+ background of the NSWindow, and can't have a transparent
+ background, but as NSBorderlessWindowMask is 0, you can't
+ have a window with NSTexturedBackgroundWindowMask that is
+ also borderless.
+*/
+- (NSColor *)backgroundColor
+{
+ return self.styleMask == NSBorderlessWindowMask
+ ? [NSColor clearColor] : qt_objcDynamicSuper();
+}
+
+- (void)sendEvent:(NSEvent*)theEvent
+{
+ // We might get events for a NSWindow after the corresponding platform
+ // window has been deleted, as the NSWindow can outlive the QCocoaWindow
+ // e.g. if being retained by other parts of AppKit, or in an auto-release
+ // pool. We guard against this in QNSView as well, as not all callbacks
+ // come via events, but if they do there's no point in propagating them.
+ if (!self.platformWindow)
+ return;
+
+ const char *eventType = object_getClassName(theEvent);
+ if (QWindowSystemInterface::handleNativeEvent(self.platformWindow->window(),
+ QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) {
+ return;
+ }
+
+ qt_objcDynamicSuper(theEvent);
+
+ if (!self.platformWindow)
+ return; // Platform window went away while processing event
+
+ QCocoaWindow *pw = self.platformWindow;
+ if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
+ NSPoint loc = [theEvent locationInWindow];
+ NSRect windowFrame = [self convertRectFromScreen:self.frame];
+ NSRect contentFrame = self.contentView.frame;
+ if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
+ [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
+ }
+}
+
+- (void)closeAndRelease
+{
+ qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
+
+ [self.delegate release];
+ self.delegate = nil;
+
+ [self close];
+ [self release];
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
+- (void)dealloc
+{
+ qt_objcDynamicSuper();
+}
+#pragma clang diagnostic pop
+
++ (void)applicationActivationChanged:(NSNotification*)notification
+{
+ const id sender = self;
+ NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
+ NSApplication *application = [NSApplication sharedApplication];
+
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
+ if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {
+ // Unfortunately there's no NSWindowListOrderedBackToFront,
+ // so we have to manually reverse the order using an array.
+ NSMutableArray *windows = [[[NSMutableArray alloc] init] autorelease];
+ [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack
+ usingBlock:^(NSWindow *window, BOOL *) {
+ // For some reason AppKit will give us nil-windows, skip those
+ if (!window)
+ return;
+
+ [(NSMutableArray*)windows addObject:window];
+ }
+ ];
+
+ windowEnumerator = windows.reverseObjectEnumerator;
+ } else
+#endif
+ {
+ // No way to get ordered list of windows, so fall back to unordered,
+ // list, which typically corresponds to window creation order.
+ windowEnumerator = application.windows.objectEnumerator;
+ }
+
+ for (NSWindow *window in windowEnumerator) {
+ // We're meddling with normal and floating windows, so leave others alone
+ if (!(window.level == NSNormalWindowLevel || window.level == NSFloatingWindowLevel))
+ continue;
+
+ // Windows that hide automatically will keep their NSFloatingWindowLevel,
+ // and hence be on top of the window stack. We don't want to affect these
+ // windows, as otherwise we might end up with key windows being ordered
+ // behind these auto-hidden windows when activating the application by
+ // clicking on a new tool window.
+ if (window.hidesOnDeactivate)
+ continue;
+
+ if ([window conformsToProtocol:@protocol(QNSWindowProtocol)]) {
+ QCocoaWindow *cocoaWindow = static_cast<QCocoaNSWindow *>(window).platformWindow;
+ window.level = notification.name == NSApplicationWillResignActiveNotification ?
+ NSNormalWindowLevel : cocoaWindow->windowLevel(cocoaWindow->window()->flags());
+ }
+
+ // The documentation says that "when a window enters a new level, it’s ordered
+ // in front of all its peers in that level", but that doesn't seem to be the
+ // case in practice. To keep the order correct after meddling with the window
+ // levels, we explicitly order each window to the front. Since we are iterating
+ // the windows in back-to-front order, this is okey. The call also triggers AppKit
+ // to re-evaluate the level in relation to windows from other applications,
+ // working around an issue where our tool windows would stay on top of other
+ // application windows if activation was transferred to another application by
+ // clicking on it instead of via the application switcher or Dock. Finally, we
+ // do this re-ordering for all windows (except auto-hiding ones), otherwise we would
+ // end up triggering a bug in AppKit where the tool windows would disappear behind
+ // the application window.
+ [window orderFront:sender];
+ }
+}
+
+@end
+
+@implementation QNSPanel
+// Implementation shared with QNSWindow, see +[QNSWindow load] above
+@end
+
+#undef super
diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro
index 224f122fc4..87405ae19f 100644
--- a/src/plugins/platforms/direct2d/direct2d.pro
+++ b/src/plugins/platforms/direct2d/direct2d.pro
@@ -5,6 +5,8 @@ QT += \
eventdispatcher_support-private accessibility_support-private \
fontdatabase_support-private theme_support-private
+qtConfig(vulkan): QT += vulkan_support-private
+
LIBS += -ldwmapi -ld2d1 -ld3d11 -ldwrite -lVersion -lgdi32
include(../windows/windows.pri)
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 9b4732eab4..f3efbea60b 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -41,6 +41,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
+#include <private/qwindow_p.h>
#ifndef QT_NO_OPENGL
# include <QtGui/private/qopenglcontext_p.h>
# include <QtGui/QOpenGLContext>
@@ -99,7 +100,6 @@ void QEglFSWindow::create()
if (window()->type() == Qt::Desktop) {
QRect fullscreenRect(QPoint(), screen()->availableGeometry().size());
- QPlatformWindow::setGeometry(fullscreenRect);
QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect);
return;
}
@@ -235,21 +235,16 @@ void QEglFSWindow::setVisible(bool visible)
void QEglFSWindow::setGeometry(const QRect &r)
{
- QRect rect;
- bool forceFullscreen = m_flags.testFlag(HasNativeWindow);
- if (forceFullscreen)
+ QRect rect = r;
+ if (m_flags.testFlag(HasNativeWindow))
rect = screen()->availableGeometry();
- else
- rect = r;
- const bool changed = rect != QPlatformWindow::geometry();
QPlatformWindow::setGeometry(rect);
- // if we corrected the size, trigger a resize event
- if (rect != r)
- QWindowSystemInterface::handleGeometryChange(window(), rect, r);
+ QWindowSystemInterface::handleGeometryChange(window(), rect);
- if (changed)
+ const QRect lastReportedGeometry = qt_window_private(window())->geometry;
+ if (rect != lastReportedGeometry)
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), rect.size()));
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.h
index 513a5063fb..be5524cba3 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.h
@@ -45,7 +45,7 @@
#include <QtCore/QLoggingCategory>
#include <QtCore/QFunctionPointer>
-typedef const char *(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC) ();
+typedef QByteArray (EGLAPIENTRYP PFNQGSGETDISPLAYSPROC) ();
typedef void (EGLAPIENTRYP PFNQGSSETDISPLAYPROC) (uint screen);
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp
index 4546088327..7654034f85 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp
@@ -110,6 +110,11 @@ uint QEglFSEmulatorScreen::id() const
return m_id;
}
+QString QEglFSEmulatorScreen::name() const
+{
+ return m_description;
+}
+
void QEglFSEmulatorScreen::initFromJsonObject(const QJsonObject &description)
{
QJsonValue value;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.h
index 3e5113c9c2..c4994720fa 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.h
@@ -62,6 +62,7 @@ public:
qreal refreshRate() const override;
Qt::ScreenOrientation nativeOrientation() const override;
Qt::ScreenOrientation orientation() const override;
+ QString name() const override;
uint id() const;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
index e522c0ee1b..27c0af1f08 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
@@ -4,7 +4,7 @@ PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSKmsGbmIntegrationPlugin
load(qt_plugin)
-QT += core-private gui-private eglfsdeviceintegration-private eglfs_kms_support-private kms_support-private
+QT += core-private gui-private eglfsdeviceintegration-private eglfs_kms_support-private kms_support-private edid_support-private
INCLUDEPATH += $$PWD/../../api $$PWD/../eglfs_kms_support
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
index 19790e5c45..800118362d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
@@ -204,7 +204,7 @@ void QEglFSKmsGbmCursor::changeCursor(QCursor *windowCursor, QWindow *window)
painter.drawImage(0, 0, *m_cursorImage.image());
painter.end();
- gbm_bo_write(m_bo, cursorImage.constBits(), cursorImage.byteCount());
+ gbm_bo_write(m_bo, cursorImage.constBits(), cursorImage.sizeInBytes());
uint32_t handle = gbm_bo_get_handle(m_bo).u32;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp
index b6cdcf92b6..058791e473 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp
@@ -43,9 +43,11 @@
#include "qeglfskmsgbmdevice.h"
#include "qeglfskmsgbmscreen.h"
#include "qeglfskmsgbmcursor.h"
+#include "private/qeglfswindow_p.h"
#include "private/qeglfscursor_p.h"
#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QtCore/QLoggingCategory>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
@@ -67,20 +69,35 @@ QEglFSKmsGbmIntegration::QEglFSKmsGbmIntegration()
qCDebug(qLcEglfsKmsDebug, "New DRM/KMS via GBM integration created");
}
-EGLNativeWindowType QEglFSKmsGbmIntegration::createNativeWindow(QPlatformWindow *platformWindow,
- const QSize &size,
- const QSurfaceFormat &format)
+#ifndef EGL_EXT_platform_base
+typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
+#endif
+
+#ifndef EGL_PLATFORM_GBM_KHR
+#define EGL_PLATFORM_GBM_KHR 0x31D7
+#endif
+
+EGLDisplay QEglFSKmsGbmIntegration::createDisplay(EGLNativeDisplayType nativeDisplay)
{
- Q_UNUSED(size);
- Q_UNUSED(format);
+ qCDebug(qLcEglfsKmsDebug, "Querying EGLDisplay");
+ EGLDisplay display;
+
+ PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = nullptr;
+ const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ if (extensions && (strstr(extensions, "EGL_KHR_platform_gbm") || strstr(extensions, "EGL_MESA_platform_gbm"))) {
+ getPlatformDisplay = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
+ eglGetProcAddress("eglGetPlatformDisplayEXT"));
+ }
- QEglFSKmsGbmScreen *screen = static_cast<QEglFSKmsGbmScreen *>(platformWindow->screen());
- if (screen->surface()) {
- qWarning("Only single window per screen supported!");
- return 0;
+ if (getPlatformDisplay) {
+ display = getPlatformDisplay(EGL_PLATFORM_GBM_KHR, nativeDisplay, nullptr);
+ } else {
+ qCDebug(qLcEglfsKmsDebug, "No eglGetPlatformDisplay for GBM, falling back to eglGetDisplay");
+ display = eglGetDisplay(nativeDisplay);
}
- return reinterpret_cast<EGLNativeWindowType>(screen->createSurface());
+ return display;
}
EGLNativeWindowType QEglFSKmsGbmIntegration::createNativeOffscreenWindow(const QSurfaceFormat &format)
@@ -143,4 +160,49 @@ QKmsDevice *QEglFSKmsGbmIntegration::createDevice()
return new QEglFSKmsGbmDevice(screenConfig(), path);
}
+class QEglFSKmsGbmWindow : public QEglFSWindow
+{
+public:
+ QEglFSKmsGbmWindow(QWindow *w, const QEglFSKmsGbmIntegration *integration)
+ : QEglFSWindow(w)
+ , m_integration(integration)
+ {}
+ void resetSurface() override;
+ const QEglFSKmsGbmIntegration *m_integration;
+};
+
+void QEglFSKmsGbmWindow::resetSurface()
+{
+ QEglFSKmsGbmScreen *gbmScreen = static_cast<QEglFSKmsGbmScreen *>(screen());
+ if (gbmScreen->surface()) {
+ qWarning("Only single window per screen supported!");
+ return;
+ }
+
+ EGLDisplay display = gbmScreen->display();
+ QSurfaceFormat platformFormat = m_integration->surfaceFormatFor(window()->requestedFormat());
+ m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat);
+ m_format = q_glFormatFromConfig(display, m_config, platformFormat);
+ m_window = reinterpret_cast<EGLNativeWindowType>(gbmScreen->createSurface());
+
+ PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
+ const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ if (extensions && (strstr(extensions, "EGL_KHR_platform_gbm") || strstr(extensions, "EGL_MESA_platform_gbm"))) {
+ createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
+ eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
+ }
+
+ if (createPlatformWindowSurface) {
+ m_surface = createPlatformWindowSurface(display, m_config, reinterpret_cast<void *>(m_window), nullptr);
+ } else {
+ qCDebug(qLcEglfsKmsDebug, "No eglCreatePlatformWindowSurface for GBM, falling back to eglCreateWindowSurface");
+ m_surface = eglCreateWindowSurface(display, m_config, m_window, nullptr);
+ }
+}
+
+QEglFSWindow *QEglFSKmsGbmIntegration::createWindow(QWindow *window) const
+{
+ return new QEglFSKmsGbmWindow(window, this);
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.h
index 38f132d72e..71f232abf9 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.h
@@ -55,14 +55,13 @@ class QEglFSKmsGbmIntegration : public QEglFSKmsIntegration
public:
QEglFSKmsGbmIntegration();
- EGLNativeWindowType createNativeWindow(QPlatformWindow *platformWindow,
- const QSize &size,
- const QSurfaceFormat &format) override;
+ EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay) override;
EGLNativeWindowType createNativeOffscreenWindow(const QSurfaceFormat &format) override;
void destroyNativeWindow(EGLNativeWindowType window) override;
QPlatformCursor *createCursor(QPlatformScreen *screen) const override;
void presentBuffer(QPlatformSurface *surface) override;
+ QEglFSWindow *createWindow(QWindow *window) const override;
protected:
QKmsDevice *createDevice() override;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
index a2dc9c4a50..36f037ac6c 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
@@ -1,6 +1,6 @@
TARGET = qeglfs-kms-egldevice-integration
-QT += core-private gui-private eglfsdeviceintegration-private eglfs_kms_support-private kms_support-private
+QT += core-private gui-private eglfsdeviceintegration-private eglfs_kms_support-private kms_support-private edid_support-private
INCLUDEPATH += $$PWD/../../api $$PWD/../eglfs_kms_support
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
index 0a66a897a1..cca413ff2d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
@@ -77,9 +77,9 @@ void QEglFSKmsEglDevice::close()
setFd(-1);
}
-EGLNativeDisplayType QEglFSKmsEglDevice::nativeDisplay() const
+void *QEglFSKmsEglDevice::nativeDisplay() const
{
- return reinterpret_cast<EGLNativeDisplayType>(m_devInt->eglDevice());
+ return m_devInt->eglDevice();
}
QPlatformScreen *QEglFSKmsEglDevice::createScreen(const QKmsOutput &output)
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro
index 3c0a0ce30f..88cf6db33b 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro
@@ -2,7 +2,7 @@ TARGET = QtEglFsKmsSupport
CONFIG += no_module_headers internal_module
load(qt_module)
-QT += core-private gui-private eglfsdeviceintegration-private kms_support-private
+QT += core-private gui-private eglfsdeviceintegration-private kms_support-private edid_support-private
INCLUDEPATH += $$PWD/../../api
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
index 3951f46a82..734f5cd611 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+** Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
@@ -69,13 +69,29 @@ private:
};
QEglFSKmsScreen::QEglFSKmsScreen(QKmsDevice *device, const QKmsOutput &output)
- : QEglFSScreen(eglGetDisplay((EGLNativeDisplayType) device->nativeDisplay()))
+ : QEglFSScreen(static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration())->display())
, m_device(device)
, m_output(output)
, m_powerState(PowerStateOn)
, m_interruptHandler(new QEglFSKmsInterruptHandler(this))
{
m_siblings << this; // gets overridden later
+
+ if (m_output.edid_blob) {
+ QByteArray edid(reinterpret_cast<const char *>(m_output.edid_blob->data), m_output.edid_blob->length);
+ if (m_edid.parse(edid))
+ qCDebug(qLcEglfsKmsDebug, "EDID data for output \"%s\": identifier '%s', manufacturer '%s', model '%s', serial '%s', physical size: %.2fx%.2f",
+ name().toLatin1().constData(),
+ m_edid.identifier.toLatin1().constData(),
+ m_edid.manufacturer.toLatin1().constData(),
+ m_edid.model.toLatin1().constData(),
+ m_edid.serialNumber.toLatin1().constData(),
+ m_edid.physicalSize.width(), m_edid.physicalSize.height());
+ else
+ qCDebug(qLcEglfsKmsDebug) << "Failed to parse EDID data for output" << name(); // keep this debug, not warning
+ } else {
+ qCDebug(qLcEglfsKmsDebug) << "No EDID data for output" << name();
+ }
}
QEglFSKmsScreen::~QEglFSKmsScreen()
@@ -146,6 +162,21 @@ QString QEglFSKmsScreen::name() const
return m_output.name;
}
+QString QEglFSKmsScreen::manufacturer() const
+{
+ return m_edid.manufacturer;
+}
+
+QString QEglFSKmsScreen::model() const
+{
+ return m_edid.model.isEmpty() ? m_edid.identifier : m_edid.model;
+}
+
+QString QEglFSKmsScreen::serialNumber() const
+{
+ return m_edid.serialNumber;
+}
+
void QEglFSKmsScreen::destroySurface()
{
}
@@ -173,6 +204,28 @@ qreal QEglFSKmsScreen::refreshRate() const
return refresh > 0 ? refresh : 60;
}
+QVector<QPlatformScreen::Mode> QEglFSKmsScreen::modes() const
+{
+ QVector<QPlatformScreen::Mode> list;
+ list.reserve(m_output.modes.size());
+
+ for (const drmModeModeInfo &info : qAsConst(m_output.modes))
+ list.append({QSize(info.hdisplay, info.vdisplay),
+ qreal(info.vrefresh > 0 ? info.vrefresh : 60)});
+
+ return list;
+}
+
+int QEglFSKmsScreen::currentMode() const
+{
+ return m_output.mode;
+}
+
+int QEglFSKmsScreen::preferredMode() const
+{
+ return m_output.preferred_mode;
+}
+
QPlatformScreen::SubpixelAntialiasingType QEglFSKmsScreen::subpixelAntialiasingTypeHint() const
{
return m_output.subpixelAntialiasingTypeHint();
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
index 80bbb0c7f1..4e09929189 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
@@ -47,6 +47,7 @@
#include <QtCore/QMutex>
#include <QtKmsSupport/private/qkmsdevice_p.h>
+#include <QtEdidSupport/private/qedidparser_p.h>
QT_BEGIN_NAMESPACE
@@ -72,11 +73,20 @@ public:
QString name() const override;
+ QString manufacturer() const override;
+ QString model() const override;
+ QString serialNumber() const override;
+
qreal refreshRate() const override;
QList<QPlatformScreen *> virtualSiblings() const override { return m_siblings; }
void setVirtualSiblings(QList<QPlatformScreen *> sl) { m_siblings = sl; }
+ QVector<QPlatformScreen::Mode> modes() const override;
+
+ int currentMode() const override;
+ int preferredMode() const override;
+
QKmsDevice *device() const { return m_device; }
void destroySurface();
@@ -97,6 +107,7 @@ protected:
QKmsDevice *m_device;
QKmsOutput m_output;
+ QEdidParser m_edid;
QPoint m_pos;
QList<QPlatformScreen *> m_siblings;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
index 64d0d9b515..2e84915c80 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
@@ -63,83 +63,12 @@ private:
QAtomicInt running;
-static Qt::MouseButtons translateMouseButtons(int s)
-{
- Qt::MouseButtons ret = 0;
- if (s & XCB_BUTTON_MASK_1)
- ret |= Qt::LeftButton;
- if (s & XCB_BUTTON_MASK_2)
- ret |= Qt::MidButton;
- if (s & XCB_BUTTON_MASK_3)
- ret |= Qt::RightButton;
- return ret;
-}
-
-static Qt::MouseButton translateMouseButton(xcb_button_t s)
-{
- switch (s) {
- case 1: return Qt::LeftButton;
- case 2: return Qt::MidButton;
- case 3: return Qt::RightButton;
- // Button values 4-7 were already handled as Wheel events, and won't occur here.
- case 8: return Qt::BackButton; // Also known as Qt::ExtraButton1
- case 9: return Qt::ForwardButton; // Also known as Qt::ExtraButton2
- case 10: return Qt::ExtraButton3;
- case 11: return Qt::ExtraButton4;
- case 12: return Qt::ExtraButton5;
- case 13: return Qt::ExtraButton6;
- case 14: return Qt::ExtraButton7;
- case 15: return Qt::ExtraButton8;
- case 16: return Qt::ExtraButton9;
- case 17: return Qt::ExtraButton10;
- case 18: return Qt::ExtraButton11;
- case 19: return Qt::ExtraButton12;
- case 20: return Qt::ExtraButton13;
- case 21: return Qt::ExtraButton14;
- case 22: return Qt::ExtraButton15;
- case 23: return Qt::ExtraButton16;
- case 24: return Qt::ExtraButton17;
- case 25: return Qt::ExtraButton18;
- case 26: return Qt::ExtraButton19;
- case 27: return Qt::ExtraButton20;
- case 28: return Qt::ExtraButton21;
- case 29: return Qt::ExtraButton22;
- case 30: return Qt::ExtraButton23;
- case 31: return Qt::ExtraButton24;
- default: return Qt::NoButton;
- }
-}
-
void EventReader::run()
{
- Qt::MouseButtons buttons;
-
xcb_generic_event_t *event = nullptr;
while (running.load() && (event = xcb_wait_for_event(m_integration->connection()))) {
uint response_type = event->response_type & ~0x80;
switch (response_type) {
- case XCB_BUTTON_PRESS: {
- xcb_button_press_event_t *press = (xcb_button_press_event_t *)event;
- QPoint p(press->event_x, press->event_y);
- buttons = (buttons & ~0x7) | translateMouseButtons(press->state);
- buttons |= translateMouseButton(press->detail);
- QWindowSystemInterface::handleMouseEvent(0, press->time, p, p, buttons);
- break;
- }
- case XCB_BUTTON_RELEASE: {
- xcb_button_release_event_t *release = (xcb_button_release_event_t *)event;
- QPoint p(release->event_x, release->event_y);
- buttons = (buttons & ~0x7) | translateMouseButtons(release->state);
- buttons &= ~translateMouseButton(release->detail);
- QWindowSystemInterface::handleMouseEvent(0, release->time, p, p, buttons);
- break;
- }
- case XCB_MOTION_NOTIFY: {
- xcb_motion_notify_event_t *motion = (xcb_motion_notify_event_t *)event;
- QPoint p(motion->event_x, motion->event_y);
- QWindowSystemInterface::handleMouseEvent(0, motion->time, p, p, buttons);
- break;
- }
case XCB_CLIENT_MESSAGE: {
xcb_client_message_event_t *client = (xcb_client_message_event_t *) event;
const xcb_atom_t *atoms = m_integration->atoms();
diff --git a/src/plugins/platforms/haiku/qhaikuwindow.cpp b/src/plugins/platforms/haiku/qhaikuwindow.cpp
index 4634012eda..4bea7f7ff6 100644
--- a/src/plugins/platforms/haiku/qhaikuwindow.cpp
+++ b/src/plugins/platforms/haiku/qhaikuwindow.cpp
@@ -205,26 +205,23 @@ void QHaikuWindow::requestActivateWindow()
m_window->Activate(true);
}
-void QHaikuWindow::setWindowState(Qt::WindowState state)
+void QHaikuWindow::setWindowState(Qt::WindowStates state)
{
if (m_windowState == state)
return;
- const Qt::WindowState oldState = m_windowState;
+ const Qt::WindowStates oldState = m_windowState;
m_windowState = state;
- if (m_windowState == Qt::WindowMaximized) {
- m_window->zoomByQt();
- } else if (m_windowState == Qt::WindowMinimized) {
+ if (m_windowState & Qt::WindowMinimized)
m_window->Minimize(true);
- } else if (m_windowState == Qt::WindowNoState) {
- if (oldState == Qt::WindowMaximized)
- m_window->zoomByQt(); // undo zoom
-
- if (oldState == Qt::WindowMinimized)
- m_window->Minimize(false); // undo minimize
- }
+ else if (m_windowState & Qt::WindowMaximized)
+ m_window->zoomByQt();
+ else if (oldState & Qt::WindowMinimized)
+ m_window->Minimize(false); // undo minimize
+ else if (oldState & Qt::WindowMaximized)
+ m_window->zoomByQt(); // undo zoom
}
void QHaikuWindow::setWindowFlags(Qt::WindowFlags flags)
@@ -312,7 +309,6 @@ void QHaikuWindow::haikuWindowMoved(const QPoint &pos)
{
const QRect newGeometry(pos, geometry().size());
- QPlatformWindow::setGeometry(newGeometry);
QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), newGeometry.size()));
}
@@ -321,7 +317,6 @@ void QHaikuWindow::haikuWindowResized(const QSize &size, bool zoomInProgress)
{
const QRect newGeometry(geometry().topLeft(), size);
- QPlatformWindow::setGeometry(newGeometry);
QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), newGeometry.size()));
diff --git a/src/plugins/platforms/haiku/qhaikuwindow.h b/src/plugins/platforms/haiku/qhaikuwindow.h
index 75403fb421..5bfb99e532 100644
--- a/src/plugins/platforms/haiku/qhaikuwindow.h
+++ b/src/plugins/platforms/haiku/qhaikuwindow.h
@@ -94,7 +94,7 @@ public:
BWindow* nativeHandle() const;
void requestActivateWindow() Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
void setWindowTitle(const QString &title) Q_DECL_OVERRIDE;
@@ -120,7 +120,7 @@ private Q_SLOTS:
void haikuDrawRequest(const QRect &rect);
private:
- Qt::WindowState m_windowState;
+ Qt::WindowStates m_windowState;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosclipboard.mm b/src/plugins/platforms/ios/qiosclipboard.mm
index ef3b453bbf..15deb3332e 100644
--- a/src/plugins/platforms/ios/qiosclipboard.mm
+++ b/src/plugins/platforms/ios/qiosclipboard.mm
@@ -227,7 +227,19 @@ void QIOSClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
if (uti.isEmpty() || !converter->canConvert(mimeType, uti))
continue;
- QByteArray byteArray = converter->convertFromMime(mimeType, mimeData->data(mimeType), uti).first();
+ QVariant mimeDataAsVariant;
+ if (mimeData->hasImage()) {
+ mimeDataAsVariant = mimeData->imageData();
+ } else if (mimeData->hasUrls()) {
+ QVariantList urlList;
+ for (QUrl url : mimeData->urls())
+ urlList << url;
+ mimeDataAsVariant = QVariant(urlList);
+ } else {
+ mimeDataAsVariant = QVariant(mimeData->data(mimeType));
+ }
+
+ QByteArray byteArray = converter->convertFromMime(mimeType, mimeDataAsVariant, uti).first();
NSData *nsData = [NSData dataWithBytes:byteArray.constData() length:byteArray.size()];
[pbItem setValue:nsData forKey:uti.toNSString()];
break;
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm
index f49f81912e..cf7680529a 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.mm
+++ b/src/plugins/platforms/ios/qioseventdispatcher.mm
@@ -372,7 +372,7 @@ static bool rootLevelRunLoopIntegration()
// We treat applicationWillTerminate as SIGTERM, even if it can't be ignored,
// and follow the bash convention of encoding the signal number in the upper
// four bits of the exit code (exit(3) will only pass on the lower 8 bits).
-static const char kApplicationWillTerminateExitCode = SIGTERM | 0x80;
+static const char kApplicationWillTerminateExitCode = char(SIGTERM | 0x80);
+ (void)applicationWillTerminate
{
diff --git a/src/plugins/platforms/ios/qiosmenu.h b/src/plugins/platforms/ios/qiosmenu.h
index b7371a5f49..61cadab56d 100644
--- a/src/plugins/platforms/ios/qiosmenu.h
+++ b/src/plugins/platforms/ios/qiosmenu.h
@@ -56,9 +56,6 @@ class QIOSMenuItem : public QPlatformMenuItem
public:
QIOSMenuItem();
- void setTag(quintptr tag) Q_DECL_OVERRIDE;
- quintptr tag()const Q_DECL_OVERRIDE;
-
void setText(const QString &text) Q_DECL_OVERRIDE;
void setIcon(const QIcon &) Q_DECL_OVERRIDE {}
void setMenu(QPlatformMenu *) Q_DECL_OVERRIDE;
@@ -74,7 +71,6 @@ public:
void setEnabled(bool enabled) Q_DECL_OVERRIDE;
void setIconSize(int) Q_DECL_OVERRIDE {}
- quintptr m_tag;
bool m_visible;
QString m_text;
MenuRole m_role;
@@ -97,9 +93,6 @@ public:
void syncMenuItem(QPlatformMenuItem *) Q_DECL_OVERRIDE;
void syncSeparatorsCollapsible(bool) Q_DECL_OVERRIDE {}
- void setTag(quintptr tag) Q_DECL_OVERRIDE;
- quintptr tag()const Q_DECL_OVERRIDE;
-
void setText(const QString &) Q_DECL_OVERRIDE;
void setIcon(const QIcon &) Q_DECL_OVERRIDE {}
void setEnabled(bool enabled) Q_DECL_OVERRIDE;
@@ -121,7 +114,6 @@ protected:
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
private:
- quintptr m_tag;
bool m_enabled;
bool m_visible;
QString m_text;
diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm
index 01cb3badea..6c70676a31 100644
--- a/src/plugins/platforms/ios/qiosmenu.mm
+++ b/src/plugins/platforms/ios/qiosmenu.mm
@@ -259,7 +259,6 @@ static NSString *const kSelectorPrefix = @"_qtMenuItem_";
QIOSMenuItem::QIOSMenuItem()
: QPlatformMenuItem()
- , m_tag(0)
, m_visible(true)
, m_text(QString())
, m_role(MenuRole(0))
@@ -269,16 +268,6 @@ QIOSMenuItem::QIOSMenuItem()
{
}
-void QIOSMenuItem::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
-quintptr QIOSMenuItem::tag() const
-{
- return m_tag;
-}
-
void QIOSMenuItem::setText(const QString &text)
{
m_text = QPlatformTheme::removeMnemonics(text);
@@ -319,7 +308,6 @@ void QIOSMenuItem::setEnabled(bool enabled)
QIOSMenu::QIOSMenu()
: QPlatformMenu()
- , m_tag(0)
, m_enabled(true)
, m_visible(false)
, m_text(QString())
@@ -371,16 +359,6 @@ void QIOSMenu::syncMenuItem(QPlatformMenuItem *)
}
}
-void QIOSMenu::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
-quintptr QIOSMenu::tag() const
-{
- return m_tag;
-}
-
void QIOSMenu::setText(const QString &text)
{
m_text = text;
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index 001985a128..84946a5c0f 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -880,9 +880,10 @@
- (UITextPosition *)closestPositionToPoint:(CGPoint)point
{
- // No API in Qt for determining this. Use sensible default instead:
- Q_UNUSED(point);
- return [QUITextPosition positionWithIndex:[self currentImeState:Qt::ImCursorPosition].toInt()];
+ QPointF p = QPointF::fromCGPoint(point);
+ const QTransform mapToLocal = QGuiApplication::inputMethod()->inputItemTransform().inverted();
+ int textPos = QInputMethod::queryFocusObject(Qt::ImCursorPosition, p * mapToLocal).toInt();
+ return [QUITextPosition positionWithIndex:textPos];
}
- (UITextPosition *)closestPositionToPoint:(CGPoint)point withinRange:(UITextRange *)range
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm
index c47b6d68b1..a4c151ed8b 100644
--- a/src/plugins/platforms/ios/qiosviewcontroller.mm
+++ b/src/plugins/platforms/ios/qiosviewcontroller.mm
@@ -176,8 +176,8 @@
return;
// Re-apply window states to update geometry
- if (window->windowState() & (Qt::WindowFullScreen | Qt::WindowMaximized))
- window->handle()->setWindowState(window->windowState());
+ if (window->windowStates() & (Qt::WindowFullScreen | Qt::WindowMaximized))
+ window->handle()->setWindowState(window->windowStates());
}
// Even if the root view controller has both wantsFullScreenLayout and
diff --git a/src/plugins/platforms/ios/qioswindow.h b/src/plugins/platforms/ios/qioswindow.h
index 81fad420f6..da8a6aabdc 100644
--- a/src/plugins/platforms/ios/qioswindow.h
+++ b/src/plugins/platforms/ios/qioswindow.h
@@ -62,7 +62,7 @@ public:
void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE;
void handleContentOrientationChange(Qt::ScreenOrientation orientation) Q_DECL_OVERRIDE;
void setVisible(bool visible) Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index 8ff0dfbd5f..4e6d48423d 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -73,7 +73,7 @@ QIOSWindow::QIOSWindow(QWindow *window)
m_normalGeometry = initialGeometry(window, QPlatformWindow::geometry(),
screen()->availableGeometry().width(), screen()->availableGeometry().height());
- setWindowState(window->windowState());
+ setWindowState(window->windowStates());
setOpacity(window->opacity());
Qt::ScreenOrientation initialOrientation = window->contentOrientation();
@@ -229,7 +229,7 @@ bool QIOSWindow::isExposed() const
&& window()->isVisible() && !window()->geometry().isEmpty();
}
-void QIOSWindow::setWindowState(Qt::WindowState state)
+void QIOSWindow::setWindowState(Qt::WindowStates state)
{
// Update the QWindow representation straight away, so that
// we can update the statusbar visibility based on the new
@@ -239,25 +239,15 @@ void QIOSWindow::setWindowState(Qt::WindowState state)
if (window()->isTopLevel() && window()->isVisible() && window()->isActive())
[m_view.qtViewController updateProperties];
- switch (state) {
- case Qt::WindowNoState:
- applyGeometry(m_normalGeometry);
- break;
- case Qt::WindowMaximized:
+ if (state & Qt::WindowMinimized)
+ applyGeometry(QRect());
+ else if (state & Qt::WindowFullScreen)
+ applyGeometry(screen()->geometry());
+ else if (state & Qt::WindowMaximized)
applyGeometry(window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ?
screen()->geometry() : screen()->availableGeometry());
- break;
- case Qt::WindowFullScreen:
- applyGeometry(screen()->geometry());
- break;
- case Qt::WindowMinimized:
- applyGeometry(QRect());
- break;
- case Qt::WindowActive:
- Q_UNREACHABLE();
- default:
- Q_UNREACHABLE();
- }
+ else
+ applyGeometry(m_normalGeometry);
}
void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index 9966bd50a3..5ead4d0bc3 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -62,10 +62,11 @@
- (id)initWithQIOSWindow:(QT_PREPEND_NAMESPACE(QIOSWindow) *)window
{
- if (self = [self initWithFrame:window->geometry().toCGRect()])
+ if (self = [self initWithFrame:window->geometry().toCGRect()]) {
m_qioswindow = window;
+ m_accessibleElements = [[NSMutableArray alloc] init];
+ }
- m_accessibleElements = [[NSMutableArray alloc] init];
return self;
}
@@ -104,6 +105,13 @@
return self;
}
+- (void)dealloc
+{
+ [m_accessibleElements release];
+
+ [super dealloc];
+}
+
- (void)willMoveToWindow:(UIWindow *)newWindow
{
// UIKIt will normally set the scale factor of a view to match the corresponding
@@ -151,23 +159,12 @@
qWarning() << m_qioswindow->window()
<< "is backed by a UIView that has a transform set. This is not supported.";
- // The original geometry requested by setGeometry() might be different
- // from what we end up with after applying window constraints.
- QRect requestedGeometry = m_qioswindow->geometry();
-
- QRect actualGeometry = QRectF::fromCGRect(self.frame).toRect();
-
- // Persist the actual/new geometry so that QWindow::geometry() can
- // be queried on the resize event.
- m_qioswindow->QPlatformWindow::setGeometry(actualGeometry);
-
- QRect previousGeometry = requestedGeometry != actualGeometry ?
- requestedGeometry : qt_window_private(m_qioswindow->window())->geometry;
-
QWindow *window = m_qioswindow->window();
- QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, actualGeometry, previousGeometry);
+ QRect lastReportedGeometry = qt_window_private(window)->geometry;
+ QRect currentGeometry = QRectF::fromCGRect(self.frame).toRect();
+ QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, currentGeometry);
- if (actualGeometry.size() != previousGeometry.size()) {
+ if (currentGeometry.size() != lastReportedGeometry.size()) {
// Trigger expose event on resize
[self setNeedsDisplay];
diff --git a/src/plugins/platforms/ios/quiview_accessibility.mm b/src/plugins/platforms/ios/quiview_accessibility.mm
index 8dafaea552..69a4d375bd 100644
--- a/src/plugins/platforms/ios/quiview_accessibility.mm
+++ b/src/plugins/platforms/ios/quiview_accessibility.mm
@@ -50,7 +50,7 @@
return;
QAccessible::Id accessibleId = QAccessible::uniqueId(iface);
UIAccessibilityElement *elem = [[QMacAccessibilityElement alloc] initWithId: accessibleId withAccessibilityContainer: self];
- [m_accessibleElements addObject: elem];
+ [m_accessibleElements addObject:[elem autorelease]];
}
- (void)createAccessibleContainer:(QAccessibleInterface *)iface
diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.cpp b/src/plugins/platforms/mirclient/qmirclientwindow.cpp
index adc8ae652a..decd21516e 100644
--- a/src/plugins/platforms/mirclient/qmirclientwindow.cpp
+++ b/src/plugins/platforms/mirclient/qmirclientwindow.cpp
@@ -516,7 +516,6 @@ UbuntuSurface::UbuntuSurface(QMirClientWindow *platformWindow, EGLDisplay displa
// Assume that the buffer size matches the surface size at creation time
mBufferSize = geom.size();
- platformWindow->QPlatformWindow::setGeometry(geom);
QWindowSystemInterface::handleGeometryChange(mWindow, geom);
qCDebug(mirclient) << "Created surface with geometry:" << geom << "title:" << mWindow->title()
@@ -636,7 +635,6 @@ void UbuntuSurface::onSwapBuffersDone()
QRect newGeometry = mPlatformWindow->geometry();
newGeometry.setSize(mBufferSize);
- mPlatformWindow->QPlatformWindow::setGeometry(newGeometry);
QWindowSystemInterface::handleGeometryChange(mWindow, newGeometry);
} else {
qCDebug(mirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - buffer size (%d,%d)",
@@ -785,8 +783,16 @@ void QMirClientWindow::handleSurfaceStateChanged(Qt::WindowState state)
QWindowSystemInterface::handleWindowStateChanged(window(), state);
}
-void QMirClientWindow::setWindowState(Qt::WindowState 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));
diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.h b/src/plugins/platforms/mirclient/qmirclientwindow.h
index 324e7691ff..6c5695d62f 100644
--- a/src/plugins/platforms/mirclient/qmirclientwindow.h
+++ b/src/plugins/platforms/mirclient/qmirclientwindow.h
@@ -73,7 +73,7 @@ public:
WId winId() const override;
QRect geometry() const override;
void setGeometry(const QRect&) override;
- void setWindowState(Qt::WindowState state) override;
+ void setWindowState(Qt::WindowStates state) override;
void setWindowFlags(Qt::WindowFlags flags) override;
void setVisible(bool visible) override;
void setWindowTitle(const QString &title) override;
diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.h b/src/plugins/platforms/offscreen/qoffscreencommon.h
index 72d6f16d26..1a9d65972d 100644
--- a/src/plugins/platforms/offscreen/qoffscreencommon.h
+++ b/src/plugins/platforms/offscreen/qoffscreencommon.h
@@ -75,7 +75,6 @@ public:
class QOffscreenDrag : public QPlatformDrag
{
public:
- QMimeData *platformDropData() Q_DECL_OVERRIDE { return 0; }
Qt::DropAction drag(QDrag *) Q_DECL_OVERRIDE { return Qt::IgnoreAction; }
};
#endif
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
index 0c39950019..3eb8675d77 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
@@ -59,6 +59,8 @@
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qplatforminputcontext.h>
#include <qpa/qplatformservices.h>
@@ -118,6 +120,16 @@ QOffscreenIntegration::~QOffscreenIntegration()
{
}
+void QOffscreenIntegration::initialize()
+{
+ m_inputContext.reset(QPlatformInputContextFactory::create());
+}
+
+QPlatformInputContext *QOffscreenIntegration::inputContext() const
+{
+ return m_inputContext.data();
+}
+
bool QOffscreenIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
switch (cap) {
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.h b/src/plugins/platforms/offscreen/qoffscreenintegration.h
index df647a31ef..569ec8fc28 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.h
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.h
@@ -54,6 +54,7 @@ public:
QOffscreenIntegration();
~QOffscreenIntegration();
+ void initialize() Q_DECL_OVERRIDE;
bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
@@ -61,6 +62,8 @@ public:
#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *drag() const Q_DECL_OVERRIDE;
#endif
+
+ QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
QPlatformServices *services() const Q_DECL_OVERRIDE;
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
@@ -73,6 +76,7 @@ private:
#ifndef QT_NO_DRAGANDDROP
QScopedPointer<QPlatformDrag> m_drag;
#endif
+ QScopedPointer<QPlatformInputContext> m_inputContext;
QScopedPointer<QPlatformServices> m_services;
};
diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
index 81f262f9ed..832e94034d 100644
--- a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
@@ -56,7 +56,7 @@ QOffscreenWindow::QOffscreenWindow(QWindow *window)
if (window->windowState() == Qt::WindowNoState)
setGeometry(window->geometry());
else
- setWindowState(window->windowState());
+ setWindowState(window->windowStates());
QWindowSystemInterface::flushWindowSystemEvents();
@@ -166,26 +166,19 @@ void QOffscreenWindow::setFrameMarginsEnabled(bool enabled)
}
}
-void QOffscreenWindow::setWindowState(Qt::WindowState state)
+void QOffscreenWindow::setWindowState(Qt::WindowStates state)
{
- setFrameMarginsEnabled(state != Qt::WindowFullScreen);
+ setFrameMarginsEnabled(!(state & Qt::WindowFullScreen));
m_positionIncludesFrame = false;
- switch (state) {
- case Qt::WindowFullScreen:
+ if (state & Qt::WindowMinimized)
+ ; // nothing to do
+ else if (state & Qt::WindowFullScreen)
setGeometryImpl(screen()->geometry());
- break;
- case Qt::WindowMaximized:
+ else if (state & Qt::WindowMaximized)
setGeometryImpl(screen()->availableGeometry().adjusted(m_margins.left(), m_margins.top(), -m_margins.right(), -m_margins.bottom()));
- break;
- case Qt::WindowMinimized:
- break;
- case Qt::WindowNoState:
+ else
setGeometryImpl(m_normalGeometry);
- break;
- default:
- break;
- }
QWindowSystemInterface::handleWindowStateChanged(window(), state);
}
diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.h b/src/plugins/platforms/offscreen/qoffscreenwindow.h
index f75458eb8e..0dced9680a 100644
--- a/src/plugins/platforms/offscreen/qoffscreenwindow.h
+++ b/src/plugins/platforms/offscreen/qoffscreenwindow.h
@@ -54,7 +54,7 @@ public:
~QOffscreenWindow();
void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates states) Q_DECL_OVERRIDE;
QMargins frameMargins() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 30288ccb20..2253e3b23d 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -586,7 +586,7 @@ void QQnxWindow::setFocus(screen_window_t newFocusWindow)
}
}
-void QQnxWindow::setWindowState(Qt::WindowState state)
+void QQnxWindow::setWindowState(Qt::WindowStates state)
{
qWindowDebug() << "state =" << state;
@@ -749,32 +749,19 @@ void QQnxWindow::updateZorder(screen_window_t window, int &topZorder)
void QQnxWindow::applyWindowState()
{
- switch (m_windowState) {
-
- // WindowActive is not an accepted parameter according to the docs
- case Qt::WindowActive:
- return;
-
- case Qt::WindowMinimized:
+ if (m_windowState & Qt::WindowMinimized) {
minimize();
if (m_unmaximizedGeometry.isValid())
setGeometry(m_unmaximizedGeometry);
else
setGeometry(m_screen->geometry());
-
- break;
-
- case Qt::WindowMaximized:
- case Qt::WindowFullScreen:
+ } else if (m_windowState & (Qt::WindowMaximized | Qt::WindowFullScreen)) {
m_unmaximizedGeometry = geometry();
- setGeometry(m_windowState == Qt::WindowMaximized ? m_screen->availableGeometry() : m_screen->geometry());
- break;
-
- case Qt::WindowNoState:
- if (m_unmaximizedGeometry.isValid())
- setGeometry(m_unmaximizedGeometry);
- break;
+ setGeometry(m_windowState & Qt::WindowFullScreen ? m_screen->geometry()
+ : m_screen->availableGeometry());
+ } else if (m_unmaximizedGeometry.isValid()) {
+ setGeometry(m_unmaximizedGeometry);
}
}
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index e248e04462..f96edc49e4 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -85,7 +85,7 @@ public:
void raise() override;
void lower() override;
void requestActivateWindow() override;
- void setWindowState(Qt::WindowState state) override;
+ void setWindowState(Qt::WindowStates state) override;
void setExposed(bool exposed);
void propagateSizeHints() override;
@@ -141,7 +141,7 @@ private:
bool m_visible;
bool m_exposed;
QRect m_unmaximizedGeometry;
- Qt::WindowState m_windowState;
+ Qt::WindowStates m_windowState;
QString m_mmRendererWindowName;
screen_window_t m_mmRendererWindow;
diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp
index 8516e994f5..1e2cf6292c 100644
--- a/src/plugins/platforms/vnc/qvncintegration.cpp
+++ b/src/plugins/platforms/vnc/qvncintegration.cpp
@@ -52,9 +52,6 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
#include <private/qinputdevicemanager_p_p.h>
-#if QT_CONFIG(libinput)
-#include <QtInputSupport/private/qlibinputhandler_p.h>
-#endif
#include <QtCore/QRegularExpression>
diff --git a/src/plugins/platforms/windows/accessible/accessible.pri b/src/plugins/platforms/windows/accessible/accessible.pri
index 0e3aacc558..557bdfe307 100644
--- a/src/plugins/platforms/windows/accessible/accessible.pri
+++ b/src/plugins/platforms/windows/accessible/accessible.pri
@@ -6,13 +6,14 @@ HEADERS += \
$$PWD/qwindowsaccessibility.h \
$$PWD/comutils.h
-SOURCES += $$PWD/qwindowsmsaaaccessible.cpp
-HEADERS += $$PWD/qwindowsmsaaaccessible.h
+SOURCES += \
+ $$PWD/qwindowsmsaaaccessible.cpp \
+ $$PWD/iaccessible2.cpp
+
+HEADERS += \
+ $$PWD/qwindowsmsaaaccessible.h \
+ $$PWD/iaccessible2.h
-!mingw: {
- SOURCES += $$PWD/iaccessible2.cpp
- HEADERS += $$PWD/iaccessible2.h
- include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
-}
+include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
mingw: LIBS *= -luuid
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
index f9e8231843..9239facb0c 100644
--- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp
+++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
@@ -61,40 +61,7 @@ static inline T *coTaskMemAllocArray(int size)
/**************************************************************\
* AccessibleApplication *
**************************************************************/
-// IUnknown
-HRESULT STDMETHODCALLTYPE AccessibleApplication::QueryInterface(REFIID id, LPVOID *iface)
-{
- *iface = 0;
- if (id == IID_IUnknown) {
- qCDebug(lcQpaAccessibility) << "AccessibleApplication::QI(): IID_IUnknown";
- *iface = static_cast<IUnknown *>(this);
- } else if (id == IID_IAccessibleApplication) {
- qCDebug(lcQpaAccessibility) << "AccessibleApplication::QI(): IID_IAccessibleApplication";
- *iface = static_cast<IAccessibleApplication*>(this);
- }
-
- if (*iface) {
- AddRef();
- return S_OK;
- }
- return E_NOINTERFACE;
-}
-
-ULONG STDMETHODCALLTYPE AccessibleApplication::AddRef()
-{
- return ++m_ref;
-}
-ULONG STDMETHODCALLTYPE AccessibleApplication::Release()
-{
- if (!--m_ref) {
- delete this;
- return 0;
- }
- return m_ref;
-}
-
-/* IAccessibleApplication */
HRESULT STDMETHODCALLTYPE AccessibleApplication::get_appName(/* [retval][out] */ BSTR *name)
{
const QString appName = QGuiApplication::applicationName();
@@ -127,40 +94,11 @@ HRESULT STDMETHODCALLTYPE AccessibleApplication::get_toolkitVersion(/* [retval][
**************************************************************/
AccessibleRelation::AccessibleRelation(const QList<QAccessibleInterface *> &targets,
QAccessible::Relation relation)
- : m_targets(targets), m_relation(relation), m_ref(1)
+ : m_targets(targets), m_relation(relation)
{
Q_ASSERT(m_targets.count());
}
-/* IUnknown */
-HRESULT STDMETHODCALLTYPE AccessibleRelation::QueryInterface(REFIID id, LPVOID *iface)
-{
- *iface = 0;
- if (id == IID_IUnknown || id == IID_IAccessibleRelation)
- *iface = static_cast<IUnknown *>(this);
-
- if (*iface) {
- AddRef();
- return S_OK;
- }
-
- return E_NOINTERFACE;
-}
-
-ULONG STDMETHODCALLTYPE AccessibleRelation::AddRef()
-{
- return ++m_ref;
-}
-
-ULONG STDMETHODCALLTYPE AccessibleRelation::Release()
-{
- if (!--m_ref) {
- delete this;
- return 0;
- }
- return m_ref;
-}
-
/* IAccessibleRelation */
HRESULT STDMETHODCALLTYPE AccessibleRelation::get_relationType(
/* [retval][out] */ BSTR *relationType)
@@ -237,56 +175,53 @@ HRESULT STDMETHODCALLTYPE AccessibleRelation::get_targets(
**************************************************************/
HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryInterface(REFIID id, LPVOID *iface)
{
+ *iface = nullptr;
QAccessibleInterface *accessible = accessibleInterface();
if (!accessible)
return E_NOINTERFACE;
- HRESULT hr = QWindowsMsaaAccessible::QueryInterface(id, iface);
- if (!SUCCEEDED(hr)) {
- if (id == IID_IServiceProvider) {
- *iface = static_cast<IServiceProvider *>(this);
- } else if (id == IID_IAccessible2) {
- *iface = static_cast<IAccessible2 *>(this);
- } else if (id == IID_IAccessibleAction) {
- if (accessible->actionInterface())
- *iface = static_cast<IAccessibleAction *>(this);
- } else if (id == IID_IAccessibleComponent) {
- *iface = static_cast<IAccessibleComponent *>(this);
- } else if (id == IID_IAccessibleEditableText) {
- if (accessible->editableTextInterface() ||
- accessible->role() == QAccessible::EditableText)
- {
- *iface = static_cast<IAccessibleEditableText *>(this);
- }
- } else if (id == IID_IAccessibleHyperlink) {
- //*iface = static_cast<IAccessibleHyperlink *>(this);
- } else if (id == IID_IAccessibleHypertext) {
- //*iface = static_cast<IAccessibleHypertext *>(this);
- } else if (id == IID_IAccessibleImage) {
- //*iface = static_cast<IAccessibleImage *>(this);
- } else if (id == IID_IAccessibleTable) {
- //*iface = static_cast<IAccessibleTable *>(this); // not supported
- } else if (id == IID_IAccessibleTable2) {
- if (accessible->tableInterface())
- *iface = static_cast<IAccessibleTable2 *>(this);
- } else if (id == IID_IAccessibleTableCell) {
- if (accessible->tableCellInterface())
- *iface = static_cast<IAccessibleTableCell *>(this);
- } else if (id == IID_IAccessibleText) {
- if (accessible->textInterface())
- *iface = static_cast<IAccessibleText *>(this);
- } else if (id == IID_IAccessibleValue) {
- if (accessible->valueInterface())
- *iface = static_cast<IAccessibleValue *>(this);
- }
- if (*iface) {
- AddRef();
- hr = S_OK;
- } else {
- hr = E_NOINTERFACE;
+ if (SUCCEEDED(QWindowsMsaaAccessible::QueryInterface(id, iface))
+ || qWindowsComQueryInterface<IServiceProvider>(this, id, iface)
+ || qWindowsComQueryInterface<IAccessible2>(this, id, iface)
+ || qWindowsComQueryInterface<IAccessibleComponent>(this, id, iface)) {
+ return S_OK;
+ }
+
+ if (id == IID_IAccessibleAction) {
+ if (accessible->actionInterface())
+ *iface = static_cast<IAccessibleAction *>(this);
+ } else if (id == IID_IAccessibleEditableText) {
+ if (accessible->editableTextInterface() ||
+ accessible->role() == QAccessible::EditableText)
+ {
+ *iface = static_cast<IAccessibleEditableText *>(this);
}
+ } else if (id == IID_IAccessibleHyperlink) {
+ //*iface = static_cast<IAccessibleHyperlink *>(this);
+ } else if (id == IID_IAccessibleHypertext) {
+ //*iface = static_cast<IAccessibleHypertext *>(this);
+ } else if (id == IID_IAccessibleImage) {
+ //*iface = static_cast<IAccessibleImage *>(this);
+ } else if (id == IID_IAccessibleTable) {
+ //*iface = static_cast<IAccessibleTable *>(this); // not supported
+ } else if (id == IID_IAccessibleTable2) {
+ if (accessible->tableInterface())
+ *iface = static_cast<IAccessibleTable2 *>(this);
+ } else if (id == IID_IAccessibleTableCell) {
+ if (accessible->tableCellInterface())
+ *iface = static_cast<IAccessibleTableCell *>(this);
+ } else if (id == IID_IAccessibleText) {
+ if (accessible->textInterface())
+ *iface = static_cast<IAccessibleText *>(this);
+ } else if (id == IID_IAccessibleValue) {
+ if (accessible->valueInterface())
+ *iface = static_cast<IAccessibleValue *>(this);
}
- return hr;
+ if (*iface) {
+ AddRef();
+ return S_OK;
+ }
+ return E_NOINTERFACE;
}
@@ -1593,7 +1528,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryService(REFGUID guidServic
return E_POINTER;
Q_UNUSED(guidService);
*iface = 0;
- qCDebug(lcQpaAccessibility) << "QWindowsIA2Accessible::QS(): " << IIDToString(riid);
+ qCDebug(lcQpaAccessibility) << "QWindowsIA2Accessible::QS(): " << QWindowsAccessibleGuid(riid);
if (guidService == IID_IAccessible) {
@@ -1692,45 +1627,6 @@ HRESULT QWindowsIA2Accessible::wrapListOfCells(const QList<QAccessibleInterface*
return count > 0 ? S_OK : S_FALSE;
}
-#define IF_EQUAL_RETURN_IIDSTRING(id, iid) if (id == iid) return QByteArray(#iid)
-
-QByteArray QWindowsIA2Accessible::IIDToString(REFIID id)
-{
- QByteArray strGuid = QWindowsMsaaAccessible::IIDToString(id);
- if (!strGuid.isEmpty())
- return strGuid;
-
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IUnknown);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IDispatch);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessible);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IOleWindow);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IServiceProvider);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessible2);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleAction);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleApplication);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleComponent);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleEditableText);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleHyperlink);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleHypertext);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleImage);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleRelation);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleTable);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleTable2);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleTableCell);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleText);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleValue);
-
- // else...
-#if 0 // Can be useful for debugging, but normally we'd like to reduce the noise a bit...
- OLECHAR szGuid[39]={0};
- ::StringFromGUID2(id, szGuid, 39);
- strGuid.reserve(40);
- ::WideCharToMultiByte(CP_UTF8, 0, szGuid, 39, strGuid.data(), 39, NULL, NULL);
- strGuid[38] = '\0';
-#endif
- return strGuid;
-}
-
// Q_STATIC_ASSERT(IA2_ROLE_CANVAS == QAccessible::Canvas); // ### Qt 6: make them the same
Q_STATIC_ASSERT(IA2_ROLE_COLOR_CHOOSER == static_cast<IA2Role>(QAccessible::ColorChooser));
Q_STATIC_ASSERT(IA2_ROLE_FOOTER == static_cast<IA2Role>(QAccessible::Footer));
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.h b/src/plugins/platforms/windows/accessible/iaccessible2.h
index bc5f5be60f..e56106f247 100644
--- a/src/plugins/platforms/windows/accessible/iaccessible2.h
+++ b/src/plugins/platforms/windows/accessible/iaccessible2.h
@@ -42,6 +42,7 @@
#include <QtCore/QtConfig>
#ifndef QT_NO_ACCESSIBILITY
+#include "qwindowscombase.h"
#include "qwindowsmsaaaccessible.h"
#include "comutils.h"
@@ -51,6 +52,13 @@
QT_BEGIN_NAMESPACE
+#ifdef Q_CC_MINGW
+QT_WARNING_DISABLE_GCC("-Wunused-function") // MinGW 7.X claims it is unused
+// MinGW's __uuidof operator does not work for the Accessible2 interfaces
+template <>
+IID qUuidOf<IAccessibleComponent>() { return IID_IAccessibleComponent; }
+#endif // Q_CC_MINGW
+
class QWindowsIA2Accessible : public QWindowsMsaaAccessible,
public IAccessibleAction,
public IAccessibleComponent,
@@ -249,7 +257,6 @@ private:
HRESULT getRelationsHelper(IAccessibleRelation **relations, int startIndex, long maxRelations, long *nRelations = 0);
HRESULT wrapListOfCells(const QList<QAccessibleInterface*> &inputCells, IUnknown ***outputAccessibles, long *nCellCount);
- QByteArray IIDToString(REFIID id);
QString textForRange(int startOffset, int endOffset) const;
void replaceTextFallback(long startOffset, long endOffset, const QString &txt);
@@ -258,28 +265,31 @@ private:
/**************************************************************\
* AccessibleApplication *
**************************************************************/
-class AccessibleApplication : public IAccessibleApplication
+
+#ifdef Q_CC_MINGW
+// MinGW's __uuidof operator does not work for the IAccessible2 interfaces
+template <>
+IID qUuidOf<IAccessibleApplication>() { return IID_IAccessibleApplication; }
+
+template <>
+IID qUuidOf<IAccessible2>() { return IID_IAccessible2; }
+
+template <>
+IID qUuidOf<IAccessibleRelation>() { return IID_IAccessibleRelation; }
+#endif // Q_CC_MINGW
+
+class AccessibleApplication : public QWindowsComBase<IAccessibleApplication>
{
public:
- AccessibleApplication() : m_ref(1)
- {
-
- }
+ AccessibleApplication() {}
virtual ~AccessibleApplication() {}
- /* IUnknown */
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
/* IAccessibleApplication */
HRESULT STDMETHODCALLTYPE get_appName(/* [retval][out] */ BSTR *name);
HRESULT STDMETHODCALLTYPE get_appVersion(/* [retval][out] */ BSTR *version);
HRESULT STDMETHODCALLTYPE get_toolkitName(/* [retval][out] */ BSTR *name);
HRESULT STDMETHODCALLTYPE get_toolkitVersion(/* [retval][out] */ BSTR *version);
-private:
- ULONG m_ref;
};
@@ -287,7 +297,10 @@ private:
/**************************************************************\
* AccessibleRelation *
**************************************************************/
-class AccessibleRelation : public IAccessibleRelation
+
+
+
+class AccessibleRelation : public QWindowsComBase<IAccessibleRelation>
{
public:
AccessibleRelation(const QList<QAccessibleInterface *> &targets,
@@ -295,11 +308,6 @@ public:
virtual ~AccessibleRelation() {}
- /* IUnknown */
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
/* IAccessibleRelation */
HRESULT STDMETHODCALLTYPE get_relationType(BSTR *relationType);
HRESULT STDMETHODCALLTYPE get_localizedRelationType(BSTR *localizedRelationType);
@@ -341,7 +349,6 @@ private:
QList<QAccessibleInterface *> m_targets;
QAccessible::Relation m_relation;
- ULONG m_ref;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
index aed9c94003..e214d47137 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
@@ -56,11 +56,7 @@
#include <QtFontDatabaseSupport/private/qwindowsfontdatabase_p.h> // registry helper
#include "qwindowsaccessibility.h"
-#ifdef Q_CC_MINGW
-# include "qwindowsmsaaaccessible.h"
-#else
-# include "iaccessible2.h"
-#endif
+#include "iaccessible2.h"
#include "comutils.h"
#include <oleacc.h>
@@ -198,11 +194,7 @@ IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
if (!QAccessible::uniqueId(acc))
QAccessible::registerAccessibleInterface(acc);
-# ifdef Q_CC_MINGW
- QWindowsMsaaAccessible *wacc = new QWindowsMsaaAccessible(acc);
-# else
QWindowsIA2Accessible *wacc = new QWindowsIA2Accessible(acc);
-# endif
IAccessible *iacc = 0;
wacc->QueryInterface(IID_IAccessible, reinterpret_cast<void **>(&iacc));
return iacc;
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
index 25b1577772..47b179250a 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
@@ -42,6 +42,7 @@
#include "qwindowsmsaaaccessible.h"
#include "qwindowsaccessibility.h"
+#include "qwindowscombase.h"
#include <oleacc.h>
#include <servprov.h>
#include <winuser.h>
@@ -71,61 +72,22 @@
QT_BEGIN_NAMESPACE
-class QWindowsEnumerate : public IEnumVARIANT
+class QWindowsEnumerate : public QWindowsComBase<IEnumVARIANT>
{
public:
- QWindowsEnumerate(const QVector<int> &a)
- : ref(0), current(0),array(a)
- {
- }
-
+ QWindowsEnumerate(const QVector<int> &a) : QWindowsComBase<IEnumVARIANT>(0), current(0),array(a) {}
virtual ~QWindowsEnumerate() {}
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
HRESULT STDMETHODCALLTYPE Clone(IEnumVARIANT **ppEnum);
HRESULT STDMETHODCALLTYPE Next(unsigned long celt, VARIANT FAR* rgVar, unsigned long FAR* pCeltFetched);
HRESULT STDMETHODCALLTYPE Reset();
HRESULT STDMETHODCALLTYPE Skip(unsigned long celt);
private:
- ULONG ref;
ULONG current;
QVector<int> array;
};
-HRESULT STDMETHODCALLTYPE QWindowsEnumerate::QueryInterface(REFIID id, LPVOID *iface)
-{
- *iface = 0;
- if (id == IID_IUnknown)
- *iface = static_cast<IUnknown *>(this);
- else if (id == IID_IEnumVARIANT)
- *iface = static_cast<IEnumVARIANT *>(this);
-
- if (*iface) {
- AddRef();
- return S_OK;
- }
-
- return E_NOINTERFACE;
-}
-
-ULONG STDMETHODCALLTYPE QWindowsEnumerate::AddRef()
-{
- return ++ref;
-}
-
-ULONG STDMETHODCALLTYPE QWindowsEnumerate::Release()
-{
- if (!--ref) {
- delete this;
- return 0;
- }
- return ref;
-}
-
HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Clone(IEnumVARIANT **ppEnum)
{
QWindowsEnumerate *penum = 0;
@@ -193,29 +155,17 @@ void accessibleDebugClientCalls_helper(const char* funcName, const QAccessibleIn
**************************************************************/
HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::QueryInterface(REFIID id, LPVOID *iface)
{
- *iface = 0;
-
- QByteArray strIID = IIDToString(id);
- if (!strIID.isEmpty()) {
- qCDebug(lcQpaAccessibility) << "QWindowsIA2Accessible::QI() - IID:"
- << strIID << ", iface:" << accessibleInterface();
+ *iface = nullptr;
+ const bool result = qWindowsComQueryUnknownInterfaceMulti<IAccessible2>(this, id, iface)
+ || qWindowsComQueryInterface<IDispatch>(this, id, iface)
+ || qWindowsComQueryInterface<IAccessible>(this, id, iface)
+ || qWindowsComQueryInterface<IOleWindow>(this, id, iface);
+
+ if (result) {
+ qCDebug(lcQpaAccessibility) << "QWindowsIA2Accessible::QI() - "
+ << QWindowsAccessibleGuid(id) << ", iface:" << accessibleInterface();
}
- if (id == IID_IUnknown) {
- *iface = static_cast<IUnknown *>(static_cast<IDispatch *>(this));
- } else if (id == IID_IDispatch) {
- *iface = static_cast<IDispatch *>(this);
- } else if (id == IID_IAccessible) {
- *iface = static_cast<IAccessible *>(this);
- } else if (id == IID_IOleWindow) {
- *iface = static_cast<IOleWindow *>(this);
- }
-
- if (*iface) {
- AddRef();
- return S_OK;
- }
-
- return E_NOINTERFACE;
+ return result ? S_OK : E_NOINTERFACE;
}
ULONG STDMETHODCALLTYPE QWindowsMsaaAccessible::AddRef()
@@ -1209,16 +1159,64 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::ContextSensitiveHelp(BOOL)
return S_OK;
}
-#define IF_EQUAL_RETURN_IIDSTRING(id, iid) if (id == iid) return QByteArray(#iid)
-QByteArray QWindowsMsaaAccessible::IIDToString(REFIID id)
+const char *QWindowsAccessibleGuid::iidToString(const GUID &id)
{
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IUnknown);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IDispatch);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessible);
- IF_EQUAL_RETURN_IIDSTRING(id, IID_IOleWindow);
+ const char *result = nullptr;
+ if (id == IID_IUnknown)
+ result = "IID_IUnknown";
+ else if (id == IID_IDispatch)
+ result = "IID_IDispatch";
+ else if (id == IID_IAccessible)
+ result = "IID_IAccessible";
+ else if (id == IID_IOleWindow)
+ result = "IID_IOleWindow";
+ else if (id == IID_IServiceProvider)
+ result = "IID_IServiceProvider";
+ else if (id == IID_IAccessible2)
+ result = "IID_IAccessible2";
+ else if (id == IID_IAccessibleAction)
+ result = "IID_IAccessibleAction";
+ else if (id == IID_IAccessibleApplication)
+ result = "IID_IAccessibleApplication";
+ else if (id == IID_IAccessibleComponent)
+ result = "IID_IAccessibleComponent";
+ else if (id == IID_IAccessibleEditableText)
+ result = "IID_IAccessibleEditableText";
+ else if (id == IID_IAccessibleHyperlink)
+ result = "IID_IAccessibleHyperlink";
+ else if (id == IID_IAccessibleHypertext)
+ result = "IID_IAccessibleHypertext";
+ else if (id == IID_IAccessibleImage)
+ result = "IID_IAccessibleImage";
+ else if (id == IID_IAccessibleRelation)
+ result = "IID_IAccessibleRelation";
+ else if (id == IID_IAccessibleTable)
+ result = "IID_IAccessibleTable";
+ else if (id == IID_IAccessibleTable2)
+ result = "IID_IAccessibleTable2";
+ else if (id == IID_IAccessibleTableCell)
+ result = "IID_IAccessibleTableCell";
+ else if (id == IID_IAccessibleText)
+ result = "IID_IAccessibleText";
+ else if (id == IID_IAccessibleValue)
+ result = "IID_IAccessibleValue";
+ return result;
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug, const GUID &);
- return QByteArray();
+QDebug operator<<(QDebug d, const QWindowsAccessibleGuid &aguid)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ if (const char *ids = QWindowsAccessibleGuid::iidToString(aguid.guid()))
+ d << ids;
+ else
+ d << aguid.guid();
+ return d;
}
+#endif // !QT_NO_DEBUG_STREAM
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
index fd00f8ac8b..e654f262da 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
+++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
@@ -46,14 +46,8 @@
#include <QtCore/qt_windows.h>
#include <QtCore/qsharedpointer.h>
#include <QtGui/qaccessible.h>
-#ifndef Q_CC_MINGW
-# include <oleacc.h>
-# include "ia2_api_all.h" // IAccessible2 inherits from IAccessible
-#else
- // MinGW
-# include <basetyps.h>
-# include <oleacc.h>
-#endif
+#include <oleacc.h>
+#include "ia2_api_all.h" // IAccessible2 inherits from IAccessible
QT_BEGIN_NAMESPACE
@@ -69,16 +63,26 @@ void accessibleDebugClientCalls_helper(const char* funcName, const QAccessibleIn
QWindow *window_helper(const QAccessibleInterface *iface);
+class QWindowsAccessibleGuid // Helper for QDebug, outputs known ids by name.
+{
+public:
+ explicit QWindowsAccessibleGuid(const GUID &g) : m_guid(g) {}
+ GUID guid () const { return m_guid; }
+ static const char *iidToString(const GUID &id);
+
+private:
+ GUID m_guid;
+};
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const QWindowsAccessibleGuid &aguid);
+#endif
+
/**************************************************************\
* QWindowsAccessible *
**************************************************************/
-class QWindowsMsaaAccessible : public
-#ifdef Q_CC_MINGW
- IAccessible
-#else
- IAccessible2
-#endif
- , public IOleWindow
+
+class QWindowsMsaaAccessible : public IAccessible2, public IOleWindow
{
public:
QWindowsMsaaAccessible(QAccessibleInterface *a)
@@ -132,8 +136,6 @@ public:
HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
protected:
- virtual QByteArray IIDToString(REFIID id);
-
QAccessible::Id id;
QAccessibleInterface *accessibleInterface() const
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index b2152e7ed4..d9c342be27 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -121,6 +121,9 @@ enum WindowsEventType // Simplify event types
EndSessionApplicationEvent = ApplicationEventFlag + 5,
AppCommandEvent = ApplicationEventFlag + 6,
DeviceChangeEvent = ApplicationEventFlag + 7,
+ MenuAboutToShowEvent = ApplicationEventFlag + 8,
+ AcceleratorCommandEvent = ApplicationEventFlag + 9,
+ MenuCommandEvent = ApplicationEventFlag + 10,
InputMethodStartCompositionEvent = InputMethodEventFlag + 1,
InputMethodCompositionEvent = InputMethodEventFlag + 2,
InputMethodEndCompositionEvent = InputMethodEventFlag + 3,
@@ -272,6 +275,11 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
return QtWindows::GestureEvent;
case WM_DEVICECHANGE:
return QtWindows::DeviceChangeEvent;
+ case WM_INITMENU:
+ case WM_INITMENUPOPUP:
+ return QtWindows::MenuAboutToShowEvent;
+ case WM_COMMAND:
+ return HIWORD(wParamIn) ? QtWindows::AcceleratorCommandEvent : QtWindows::MenuCommandEvent;
case WM_DPICHANGED:
return QtWindows::DpiChangedEvent;
default:
diff --git a/src/plugins/platforms/windows/qwindowscombase.h b/src/plugins/platforms/windows/qwindowscombase.h
new file mode 100644
index 0000000000..5e51b6b7b7
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowscombase.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QWINDOWSCOMBASE_H
+#define QWINDOWSCOMBASE_H
+
+#include <QtCore/QtGlobal>
+
+#include <unknwn.h>
+
+QT_BEGIN_NAMESPACE
+
+// The __uuidof operator of MinGW does not work for all interfaces (for example,
+// IAccessible2). Specializations of this function can be provides to work
+// around this.
+template <class DesiredInterface>
+static IID qUuidOf() { return __uuidof(DesiredInterface); }
+
+// Helper for implementing IUnknown::QueryInterface.
+template <class DesiredInterface, class Derived>
+bool qWindowsComQueryInterface(Derived *d, REFIID id, LPVOID *iface)
+{
+ if (id == qUuidOf<DesiredInterface>()) {
+ *iface = static_cast<DesiredInterface *>(d);
+ d->AddRef();
+ return true;
+ }
+ return false;
+}
+
+// Helper for implementing IUnknown::QueryInterface for IUnknown
+// in the case of multiple inheritance via the first inherited class.
+template <class FirstInheritedInterface, class Derived>
+bool qWindowsComQueryUnknownInterfaceMulti(Derived *d, REFIID id, LPVOID *iface)
+{
+ if (id == __uuidof(IUnknown)) {
+ *iface = static_cast<FirstInheritedInterface *>(d);
+ d->AddRef();
+ return true;
+ }
+ return false;
+}
+
+// Helper base class to provide IUnknown methods for COM classes (single inheritance)
+template <class ComInterface> class QWindowsComBase : public ComInterface
+{
+ Q_DISABLE_COPY(QWindowsComBase)
+public:
+ explicit QWindowsComBase(ULONG initialRefCount = 1) : m_ref(initialRefCount) {}
+ virtual ~QWindowsComBase() {}
+
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface)
+ {
+ *iface = nullptr;
+ return qWindowsComQueryInterface<IUnknown>(this, id, iface) || qWindowsComQueryInterface<ComInterface>(this, id, iface)
+ ? S_OK : E_NOINTERFACE;
+ }
+
+ ULONG STDMETHODCALLTYPE AddRef() { return ++m_ref; }
+
+ ULONG STDMETHODCALLTYPE Release()
+ {
+ if (!--m_ref) {
+ delete this;
+ return 0;
+ }
+ return m_ref;
+ }
+
+private:
+ ULONG m_ref;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSCOMBASE_H
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index e6e6ee8b1a..7683f0da4d 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -44,6 +44,7 @@
#include "qwindowskeymapper.h"
#include "qwindowsmousehandler.h"
#include "qtwindowsglobal.h"
+#include "qwindowsmenu.h"
#include "qwindowsmime.h"
#include "qwindowsinputcontext.h"
#include "qwindowstabletsupport.h"
@@ -92,8 +93,10 @@ Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl")
Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime")
Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods")
Q_LOGGING_CATEGORY(lcQpaDialogs, "qt.qpa.dialogs")
+Q_LOGGING_CATEGORY(lcQpaMenus, "qt.qpa.menus")
Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility")
+Q_LOGGING_CATEGORY(lcQpaTrayIcon, "qt.qpa.trayicon")
int QWindowsContext::verbose = 0;
@@ -124,11 +127,19 @@ static inline bool useRTL_Extensions()
}
#if QT_CONFIG(sessionmanager)
-static inline QWindowsSessionManager *platformSessionManager() {
+static inline QWindowsSessionManager *platformSessionManager()
+{
QGuiApplicationPrivate *guiPrivate = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
QSessionManagerPrivate *managerPrivate = static_cast<QSessionManagerPrivate*>(QObjectPrivate::get(guiPrivate->session_manager));
return static_cast<QWindowsSessionManager *>(managerPrivate->platformSessionManager);
}
+
+static inline bool sessionManagerInteractionBlocked()
+{
+ return platformSessionManager()->isInteractionBlocked();
+}
+#else // QT_CONFIG(sessionmanager)
+static inline bool sessionManagerInteractionBlocked() { return false; }
#endif
static inline int windowDpiAwareness(HWND hwnd)
@@ -395,9 +406,11 @@ QList<int> QWindowsContext::possibleKeys(const QKeyEvent *e) const
return d->m_keyMapper.possibleKeys(e);
}
-void QWindowsContext::setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx)
+QSharedPointer<QWindowCreationContext> QWindowsContext::setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx)
{
+ const QSharedPointer<QWindowCreationContext> old = d->m_creationContext;
d->m_creationContext = ctx;
+ return old;
}
QSharedPointer<QWindowCreationContext> QWindowsContext::windowCreationContext() const
@@ -595,6 +608,15 @@ void QWindowsContext::removeWindow(HWND hwnd)
}
}
+QWindowsWindow *QWindowsContext::findPlatformWindow(const QWindowsMenuBar *mb) const
+{
+ for (auto it = d->m_windows.cbegin(), end = d->m_windows.cend(); it != end; ++it) {
+ if ((*it)->menuBar() == mb)
+ return *it;
+ }
+ return nullptr;
+}
+
QWindowsWindow *QWindowsContext::findPlatformWindow(HWND hwnd) const
{
return d->m_windows.value(hwnd);
@@ -932,11 +954,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
switch (et) {
case QtWindows::GestureEvent:
-#if QT_CONFIG(sessionmanager)
- return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
-#else
- return d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
-#endif
+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
case QtWindows::InputMethodOpenCandidateWindowEvent:
case QtWindows::InputMethodCloseCandidateWindowEvent:
// TODO: Release/regrab mouse if a popup has mouse grab.
@@ -1025,11 +1043,23 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
case QtWindows::InputMethodKeyEvent:
case QtWindows::InputMethodKeyDownEvent:
case QtWindows::AppCommandEvent:
-#if QT_CONFIG(sessionmanager)
- return platformSessionManager()->isInteractionBlocked() ? true : d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
-#else
- return d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
-#endif
+ return sessionManagerInteractionBlocked() || d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
+ case QtWindows::MenuAboutToShowEvent:
+ if (sessionManagerInteractionBlocked())
+ return true;
+ if (QWindowsPopupMenu::notifyAboutToShow(reinterpret_cast<HMENU>(wParam)))
+ return true;
+ if (platformWindow == nullptr || platformWindow->menuBar() == nullptr)
+ return false;
+ return platformWindow->menuBar()->notifyAboutToShow(reinterpret_cast<HMENU>(wParam));
+ case QtWindows::MenuCommandEvent:
+ if (sessionManagerInteractionBlocked())
+ return true;
+ if (QWindowsPopupMenu::notifyTriggered(LOWORD(wParam)))
+ return true;
+ if (platformWindow == nullptr || platformWindow->menuBar() == nullptr)
+ return false;
+ return platformWindow->menuBar()->notifyTriggered(LOWORD(wParam));
case QtWindows::MoveEvent:
platformWindow->handleMoved();
return true;
@@ -1049,18 +1079,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return platformWindow->handleWmPaint(hwnd, message, wParam, lParam);
case QtWindows::NonClientMouseEvent:
if (platformWindow->frameStrutEventsEnabled())
-#if QT_CONFIG(sessionmanager)
- return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
-#else
- return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
-#endif
+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
break;
case QtWindows::ScrollEvent:
-#if QT_CONFIG(sessionmanager)
- return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateScrollEvent(platformWindow->window(), hwnd, msg, result);
-#else
- return d->m_mouseHandler.translateScrollEvent(platformWindow->window(), hwnd, msg, result);
-#endif
+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.translateScrollEvent(platformWindow->window(), hwnd, msg, result);
case QtWindows::MouseWheelEvent:
case QtWindows::MouseEvent:
case QtWindows::LeaveEvent:
@@ -1070,18 +1092,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
window = window->parent();
if (!window)
return false;
-#if QT_CONFIG(sessionmanager)
- return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateMouseEvent(window, hwnd, et, msg, result);
-#else
- return d->m_mouseHandler.translateMouseEvent(window, hwnd, et, msg, result);
-#endif
+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.translateMouseEvent(window, hwnd, et, msg, result);
}
case QtWindows::TouchEvent:
-#if QT_CONFIG(sessionmanager)
- return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
-#else
- return d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
-#endif
+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
case QtWindows::FocusInEvent: // see QWindowsWindow::requestActivateWindow().
case QtWindows::FocusOutEvent:
handleFocusEvent(et, platformWindow);
@@ -1283,6 +1297,29 @@ QTouchDevice *QWindowsContext::touchDevice() const
return 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, 0, &type, 0, 0) == ERROR_SUCCESS && type == REG_DWORD) {
+ DWORD value;
+ DWORD size = sizeof(result);
+ if (RegQueryValueEx(handle, subKey, 0, 0, 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);
+}
+
static inline bool isEmptyRect(const RECT &rect)
{
return rect.right - rect.left == 0 && rect.bottom - rect.top == 0;
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index b50010321b..5c39b6068b 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -63,11 +63,14 @@ Q_DECLARE_LOGGING_CATEGORY(lcQpaGl)
Q_DECLARE_LOGGING_CATEGORY(lcQpaMime)
Q_DECLARE_LOGGING_CATEGORY(lcQpaInputMethods)
Q_DECLARE_LOGGING_CATEGORY(lcQpaDialogs)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaMenus)
Q_DECLARE_LOGGING_CATEGORY(lcQpaTablet)
Q_DECLARE_LOGGING_CATEGORY(lcQpaAccessibility)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaTrayIcon)
class QWindow;
class QPlatformScreen;
+class QWindowsMenuBar;
class QWindowsScreenManager;
class QWindowsTabletSupport;
class QWindowsWindow;
@@ -177,6 +180,7 @@ public:
QWindowsWindow *findClosestPlatformWindow(HWND) const;
QWindowsWindow *findPlatformWindow(HWND) const;
+ QWindowsWindow *findPlatformWindow(const QWindowsMenuBar *mb) const;
QWindow *findWindow(HWND) const;
QWindowsWindow *findPlatformWindowAt(HWND parent, const QPoint &screenPoint,
unsigned cwex_flags) const;
@@ -192,7 +196,7 @@ public:
QWindow *keyGrabber() const;
void setKeyGrabber(QWindow *hwnd);
- void setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx);
+ QSharedPointer<QWindowCreationContext> setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx);
QSharedPointer<QWindowCreationContext> windowCreationContext() const;
void setTabletAbsoluteRange(int a);
@@ -216,6 +220,8 @@ public:
bool asyncExpose() const;
void setAsyncExpose(bool value);
+ static DWORD readAdvancedExplorerSettings(const wchar_t *subKey, DWORD defaultValue);
+
QTouchDevice *touchDevice() const;
private:
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index 0a09b87ba3..e7ba08b719 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -586,6 +586,13 @@ QWindowsCursor::QWindowsCursor(const QPlatformScreen *screen)
Q_UNUSED(dummy)
}
+inline CursorHandlePtr QWindowsCursor::cursorHandle(const QCursor &cursor)
+{
+ return cursor.shape() == Qt::BitmapCursor
+ ? pixmapWindowCursor(cursor)
+ : standardWindowCursor(cursor.shape());
+}
+
/*!
\brief Set a cursor on a window.
@@ -603,9 +610,7 @@ void QWindowsCursor::changeCursor(QCursor *cursorIn, QWindow *window)
platformWindow->setCursor(CursorHandlePtr(new CursorHandle));
return;
}
- const CursorHandlePtr wcursor =
- cursorIn->shape() == Qt::BitmapCursor ?
- pixmapWindowCursor(*cursorIn) : standardWindowCursor(cursorIn->shape());
+ const CursorHandlePtr wcursor = cursorHandle(*cursorIn);
if (wcursor->handle()) {
platformWindow->setCursor(wcursor);
} else {
@@ -614,6 +619,25 @@ void QWindowsCursor::changeCursor(QCursor *cursorIn, QWindow *window)
}
}
+void QWindowsCursor::setOverrideCursor(const QCursor &cursor)
+{
+ const CursorHandlePtr wcursor = cursorHandle(cursor);
+ if (wcursor->handle()) {
+ m_overriddenCursor = SetCursor(wcursor->handle());
+ } else {
+ qWarning("%s: Unable to obtain system cursor for %d",
+ __FUNCTION__, cursor.shape());
+ }
+}
+
+void QWindowsCursor::clearOverrideCursor()
+{
+ if (m_overriddenCursor) {
+ SetCursor(m_overriddenCursor);
+ m_overriddenCursor = nullptr;
+ }
+}
+
QPoint QWindowsCursor::mousePosition()
{
POINT p;
diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h
index df2e22733b..9aa9523ac8 100644
--- a/src/plugins/platforms/windows/qwindowscursor.h
+++ b/src/plugins/platforms/windows/qwindowscursor.h
@@ -105,6 +105,9 @@ public:
explicit QWindowsCursor(const QPlatformScreen *screen);
void changeCursor(QCursor * widgetCursor, QWindow * widget) override;
+ void setOverrideCursor(const QCursor &cursor) override;
+ void clearOverrideCursor() override;
+
QPoint pos() const override;
void setPos(const QPoint &pos) override;
@@ -127,6 +130,8 @@ private:
typedef QHash<Qt::CursorShape, CursorHandlePtr> StandardCursorCache;
typedef QHash<QWindowsPixmapCursorCacheKey, CursorHandlePtr> PixmapCursorCache;
+ CursorHandlePtr cursorHandle(const QCursor &c);
+
const QPlatformScreen *const m_screen;
StandardCursorCache m_standardCursorCache;
PixmapCursorCache m_pixmapCursorCache;
@@ -135,6 +140,8 @@ private:
mutable QPixmap m_moveDragCursor;
mutable QPixmap m_linkDragCursor;
mutable QPixmap m_ignoreDragCursor;
+
+ HCURSOR m_overriddenCursor = nullptr;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index f4527bcc60..c4aeb15bd1 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -41,6 +41,7 @@
#define _WIN32_WINNT 0x0600
+#include "qwindowscombase.h"
#include "qwindowsdialoghelpers.h"
#include "qwindowscontext.h"
@@ -52,7 +53,7 @@
#include <QtGui/QColor>
#include <QtCore/QDebug>
-#include <QtCore/QRegExp>
+#include <QtCore/QRegularExpression>
#include <QtCore/QTimer>
#include <QtCore/QDir>
#include <QtCore/QScopedArrayPointer>
@@ -504,33 +505,11 @@ inline void QWindowsFileDialogSharedData::fromOptions(const QSharedPointer<QFile
class QWindowsNativeFileDialogBase;
-class QWindowsNativeFileDialogEventHandler : public IFileDialogEvents
+class QWindowsNativeFileDialogEventHandler : public QWindowsComBase<IFileDialogEvents>
{
public:
static IFileDialogEvents *create(QWindowsNativeFileDialogBase *nativeFileDialog);
- // IUnknown methods
- IFACEMETHODIMP QueryInterface(REFIID riid, void** ppv)
- {
- if (riid != IID_IUnknown && riid != IID_IFileDialogEvents) {
- *ppv = NULL;
- return ResultFromScode(E_NOINTERFACE);
- }
- *ppv = this;
- AddRef();
- return NOERROR;
- }
-
- IFACEMETHODIMP_(ULONG) AddRef() { return InterlockedIncrement(&m_ref); }
-
- IFACEMETHODIMP_(ULONG) Release()
- {
- const long ref = InterlockedDecrement(&m_ref);
- if (!ref)
- delete this;
- return ref;
- }
-
// IFileDialogEvents methods
IFACEMETHODIMP OnFileOk(IFileDialog *);
IFACEMETHODIMP OnFolderChange(IFileDialog *) { return S_OK; }
@@ -546,7 +525,6 @@ public:
virtual ~QWindowsNativeFileDialogEventHandler() {}
private:
- long m_ref = 1;
QWindowsNativeFileDialogBase *m_nativeFileDialog;
};
@@ -931,7 +909,7 @@ IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url)
// (see https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx)
// specified as "clsid:<GUID>" (without '{', '}').
IShellItem *result = Q_NULLPTR;
- const QUuid uuid(url.path());
+ const auto uuid = QUuid::fromString(url.path());
if (uuid.isNull()) {
qWarning() << __FUNCTION__ << ": Invalid CLSID: " << url.path();
return Q_NULLPTR;
@@ -995,7 +973,9 @@ void QWindowsNativeFileDialogBase::setMode(QFileDialogOptions::FileMode mode,
QFileDialogOptions::AcceptMode acceptMode,
QFileDialogOptions::FileDialogOptions options)
{
- DWORD flags = FOS_PATHMUSTEXIST | FOS_FORCESHOWHIDDEN;
+ DWORD flags = FOS_PATHMUSTEXIST;
+ if (QWindowsContext::readAdvancedExplorerSettings(L"Hidden", 1) == 1) // 1:show, 2:hidden
+ flags |= FOS_FORCESHOWHIDDEN;
if (options & QFileDialogOptions::DontResolveSymlinks)
flags |= FOS_NODEREFERENCELINKS;
switch (mode) {
@@ -1039,7 +1019,7 @@ static QList<FilterSpec> filterSpecs(const QStringList &filters,
result.reserve(filters.size());
*totalStringLength = 0;
- const QRegExp filterSeparatorRE(QStringLiteral("[;\\s]+"));
+ const QRegularExpression filterSeparatorRE(QStringLiteral("[;\\s]+"));
const QString separator = QStringLiteral(";");
Q_ASSERT(filterSeparatorRE.isValid());
// Split filter specification as 'Texts (*.txt[;] *.doc)', '*.txt[;] *.doc'
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index 26403b68e5..aa6454ef63 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -44,7 +44,7 @@
# include "qwindowsclipboard.h"
#endif
#include "qwindowsintegration.h"
-#include "qwindowsole.h"
+#include "qwindowsdropdataobject.h"
#include <QtCore/qt_windows.h>
#include "qwindowswindow.h"
#include "qwindowsmousehandler.h"
@@ -215,7 +215,7 @@ static inline Qt::MouseButtons toQtMouseButtons(DWORD keyState)
\ingroup qt-lighthouse-win
*/
-class QWindowsOleDropSource : public IDropSource
+class QWindowsOleDropSource : public QWindowsComBase<IDropSource>
{
public:
enum Mode {
@@ -228,11 +228,6 @@ public:
void createCursors();
- // IUnknown methods
- STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObj);
- STDMETHOD_(ULONG,AddRef)(void);
- STDMETHOD_(ULONG,Release)(void);
-
// IDropSource methods
STDMETHOD(QueryContinueDrag)(BOOL fEscapePressed, DWORD grfKeyState);
STDMETHOD(GiveFeedback)(DWORD dwEffect);
@@ -257,7 +252,6 @@ private:
ActionCursorMap m_cursors;
QWindowsDragCursorWindow *m_touchDragWindow;
- ULONG m_refs;
#ifndef QT_NO_DEBUG_STREAM
friend QDebug operator<<(QDebug, const QWindowsOleDropSource::CursorEntry &);
#endif
@@ -268,7 +262,6 @@ QWindowsOleDropSource::QWindowsOleDropSource(QWindowsDrag *drag)
, m_drag(drag)
, m_currentButtons(Qt::NoButton)
, m_touchDragWindow(0)
- , m_refs(1)
{
qCDebug(lcQpaMime) << __FUNCTION__ << m_mode;
}
@@ -373,38 +366,6 @@ void QWindowsOleDropSource::createCursors()
#endif // !QT_NO_DEBUG_OUTPUT
}
-//---------------------------------------------------------------------
-// IUnknown Methods
-//---------------------------------------------------------------------
-
-STDMETHODIMP
-QWindowsOleDropSource::QueryInterface(REFIID iid, void FAR* FAR* ppv)
-{
- if (iid == IID_IUnknown || iid == IID_IDropSource) {
- *ppv = this;
- ++m_refs;
- return NOERROR;
- }
- *ppv = NULL;
- return ResultFromScode(E_NOINTERFACE);
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleDropSource::AddRef(void)
-{
- return ++m_refs;
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleDropSource::Release(void)
-{
- if (--m_refs == 0) {
- delete this;
- return 0;
- }
- return m_refs;
-}
-
/*!
\brief Check for cancel.
*/
@@ -509,34 +470,6 @@ QWindowsOleDropTarget::~QWindowsOleDropTarget()
qCDebug(lcQpaMime) << __FUNCTION__ << this;
}
-STDMETHODIMP
-QWindowsOleDropTarget::QueryInterface(REFIID iid, void FAR* FAR* ppv)
-{
- if (iid == IID_IUnknown || iid == IID_IDropTarget) {
- *ppv = this;
- AddRef();
- return NOERROR;
- }
- *ppv = NULL;
- return ResultFromScode(E_NOINTERFACE);
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleDropTarget::AddRef(void)
-{
- return ++m_refs;
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleDropTarget::Release(void)
-{
- if (--m_refs == 0) {
- delete this;
- return 0;
- }
- return m_refs;
-}
-
void QWindowsOleDropTarget::handleDrag(QWindow *window, DWORD grfKeyState,
const QPoint &point, LPDWORD pdwEffect)
{
@@ -740,7 +673,7 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag)
QWindowsDrag::m_canceled = false;
QWindowsOleDropSource *windowDropSource = new QWindowsOleDropSource(this);
windowDropSource->createCursors();
- QWindowsOleDataObject *dropDataObject = new QWindowsOleDataObject(dropData);
+ QWindowsDropDataObject *dropDataObject = new QWindowsDropDataObject(dropData);
const Qt::DropActions possibleActions = drag->supportedActions();
const DWORD allowedEffects = translateToWinDragEffects(possibleActions);
qCDebug(lcQpaMime) << '>' << __FUNCTION__ << "possible Actions=0x"
diff --git a/src/plugins/platforms/windows/qwindowsdrag.h b/src/plugins/platforms/windows/qwindowsdrag.h
index 983f3a67b4..2b4ca2dce1 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.h
+++ b/src/plugins/platforms/windows/qwindowsdrag.h
@@ -40,6 +40,7 @@
#ifndef QWINDOWSDRAG_H
#define QWINDOWSDRAG_H
+#include "qwindowscombase.h"
#include "qwindowsinternalmimedata.h"
#include <qpa/qplatformdrag.h>
@@ -57,17 +58,12 @@ public:
IDataObject *retrieveDataObject() const override;
};
-class QWindowsOleDropTarget : public IDropTarget
+class QWindowsOleDropTarget : public QWindowsComBase<IDropTarget>
{
public:
explicit QWindowsOleDropTarget(QWindow *w);
virtual ~QWindowsOleDropTarget();
- // IUnknown methods
- STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppvObj);
- STDMETHOD_(ULONG, AddRef)(void);
- STDMETHOD_(ULONG, Release)(void);
-
// IDropTarget methods
STDMETHOD(DragEnter)(LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect);
STDMETHOD(DragOver)(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect);
@@ -77,7 +73,6 @@ public:
private:
void handleDrag(QWindow *window, DWORD grfKeyState, const QPoint &, LPDWORD pdwEffect);
- ULONG m_refs = 1;
QWindow *const m_window;
QRect m_answerRect;
QPoint m_lastPoint;
@@ -91,8 +86,6 @@ public:
QWindowsDrag();
virtual ~QWindowsDrag();
- QMimeData *platformDropData() override { return &m_dropData; }
-
Qt::DropAction drag(QDrag *drag) override;
static QWindowsDrag *instance();
diff --git a/src/plugins/platforms/windows/qwindowsdropdataobject.cpp b/src/plugins/platforms/windows/qwindowsdropdataobject.cpp
new file mode 100644
index 0000000000..bd532ab70e
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowsdropdataobject.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 "qwindowsdropdataobject.h"
+
+#include <QtCore/QUrl>
+#include <QtCore/QMimeData>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWindowsDropDataObject
+ \brief QWindowsOleDataObject subclass specialized for handling Drag&Drop.
+
+ Only allows "text/uri-list" data to be exported as CF_HDROP, to allow dropped
+ files to be attached to Office applications (instead of adding an URL link).
+
+ \internal
+ \ingroup qt-lighthouse-win
+*/
+
+QWindowsDropDataObject::QWindowsDropDataObject(QMimeData *mimeData) :
+ QWindowsOleDataObject(mimeData)
+{
+}
+
+QWindowsDropDataObject::~QWindowsDropDataObject()
+{
+}
+
+STDMETHODIMP
+QWindowsDropDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)
+{
+ if (shouldIgnore(pformatetc))
+ return ResultFromScode(DATA_E_FORMATETC);
+
+ return QWindowsOleDataObject::GetData(pformatetc, pmedium);
+}
+
+STDMETHODIMP
+QWindowsDropDataObject::QueryGetData(LPFORMATETC pformatetc)
+{
+ if (shouldIgnore(pformatetc))
+ return ResultFromScode(DATA_E_FORMATETC);
+
+ return QWindowsOleDataObject::QueryGetData(pformatetc);
+}
+
+// If the data is text/uri-list for local files, tell we can only export it as CF_HDROP.
+bool QWindowsDropDataObject::shouldIgnore(LPFORMATETC pformatetc) const
+{
+ QMimeData *dropData = mimeData();
+
+ if (dropData && dropData->hasFormat(QStringLiteral("text/uri-list")) && (pformatetc->cfFormat != CF_HDROP)) {
+ QList<QUrl> urls = dropData->urls();
+ return std::any_of(urls.cbegin(), urls.cend(), [] (const QUrl &u) { return u.isLocalFile(); });
+ }
+
+ return false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsdropdataobject.h b/src/plugins/platforms/windows/qwindowsdropdataobject.h
new file mode 100644
index 0000000000..5ef72c9336
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowsdropdataobject.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QWINDOWSDROPDATAOBJECT_H
+#define QWINDOWSDROPDATAOBJECT_H
+
+#include "qwindowsole.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWindowsDropDataObject : public QWindowsOleDataObject
+{
+public:
+ explicit QWindowsDropDataObject(QMimeData *mimeData);
+ virtual ~QWindowsDropDataObject();
+
+ // overridden IDataObject methods
+ STDMETHOD(GetData)(LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium);
+ STDMETHOD(QueryGetData)(LPFORMATETC pformatetc);
+
+private:
+ bool shouldIgnore(LPFORMATETC pformatetc) const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSDROPDATAOBJECT_H
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 751807e897..78368d87de 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -145,6 +145,10 @@
#define RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#ifndef WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
+#endif
+
QT_BEGIN_NAMESPACE
QWindowsOpengl32DLL QOpenGLStaticContext::opengl32;
@@ -489,7 +493,7 @@ static int choosePixelFormat(HDC hdc,
const QWindowsOpenGLAdditionalFormat &additional,
PIXELFORMATDESCRIPTOR *obtainedPfd)
{
- enum { attribSize =40 };
+ enum { attribSize = 42 };
if ((additional.formatFlags & QWindowsGLRenderToPixmap) || !staticContext.hasExtensions())
return 0;
@@ -570,7 +574,15 @@ static int choosePixelFormat(HDC hdc,
iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB;
iAttributes[i++] = FALSE;
}
- // If sample buffer request cannot be satisfied, reduce request.
+ // must be the last
+ bool srgbRequested = format.colorSpace() == QSurfaceFormat::sRGBColorSpace;
+ int srgbValuePosition = 0;
+ if (srgbRequested) {
+ srgbValuePosition = i;
+ iAttributes[i++] = WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT;
+ iAttributes[i++] = TRUE;
+ }
+ // If sample or sRGB request cannot be satisfied, reduce request.
int pixelFormat = 0;
uint numFormats = 0;
while (true) {
@@ -578,20 +590,25 @@ static int choosePixelFormat(HDC hdc,
staticContext.wglChoosePixelFormatARB(hdc, iAttributes, 0, 1,
&pixelFormat, &numFormats)
&& numFormats >= 1;
- if (valid || !sampleBuffersRequested)
- break;
- if (iAttributes[samplesValuePosition] > 1) {
- iAttributes[samplesValuePosition] /= 2;
- } else if (iAttributes[samplesValuePosition] == 1) {
- // Fallback in case it is unable to initialize with any
- // samples to avoid falling back to the GDI path
- // NB: The sample attributes needs to be at the end for this
- // to work correctly
- iAttributes[samplesValuePosition - 1] = FALSE;
- iAttributes[samplesValuePosition] = 0;
- iAttributes[samplesValuePosition + 1] = 0;
- } else {
+ if (valid || (!sampleBuffersRequested && !srgbRequested))
break;
+ if (srgbRequested) {
+ iAttributes[srgbValuePosition] = 0;
+ srgbRequested = false;
+ } else if (sampleBuffersRequested) {
+ if (iAttributes[samplesValuePosition] > 1) {
+ iAttributes[samplesValuePosition] /= 2;
+ } else if (iAttributes[samplesValuePosition] == 1) {
+ // Fallback in case it is unable to initialize with any
+ // samples to avoid falling back to the GDI path
+ // NB: The sample attributes needs to be at the end for this
+ // to work correctly
+ iAttributes[samplesValuePosition - 1] = FALSE;
+ iAttributes[samplesValuePosition] = 0;
+ iAttributes[samplesValuePosition + 1] = 0;
+ } else {
+ break;
+ }
}
}
// Verify if format is acceptable. Note that the returned
@@ -628,7 +645,7 @@ static QSurfaceFormat
HDC hdc, int pixelFormat,
QWindowsOpenGLAdditionalFormat *additionalIn = 0)
{
- enum { attribSize =40 };
+ enum { attribSize = 42 };
QSurfaceFormat result;
result.setRenderableType(QSurfaceFormat::OpenGL);
@@ -641,6 +658,7 @@ static QSurfaceFormat
int i = 0;
const bool hasSampleBuffers = testFlag(staticContext.extensions, QOpenGLStaticContext::SampleBuffers);
+ const bool hasSrgbSupport = testFlag(staticContext.extensions, QOpenGLStaticContext::sRGBCapableFramebuffer);
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; // 0
iAttributes[i++] = WGL_DEPTH_BITS_ARB; // 1
@@ -658,6 +676,9 @@ static QSurfaceFormat
iAttributes[i++] = WGL_SAMPLE_BUFFERS_ARB; // 12
iAttributes[i++] = WGL_SAMPLES_ARB; // 13
}
+ if (hasSrgbSupport)
+ iAttributes[i++] = WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT; // 12 or 14
+
if (!staticContext.wglGetPixelFormatAttribIVARB(hdc, pixelFormat, 0, i,
iAttributes, iValues)) {
qErrnoWarning("%s: wglGetPixelFormatAttribIVARB() failed for basic parameters.", __FUNCTION__);
@@ -673,8 +694,14 @@ static QSurfaceFormat
if (iValues[9])
result.setOption(QSurfaceFormat::StereoBuffers);
- if (hasSampleBuffers)
+ if (hasSampleBuffers) {
result.setSamples(iValues[13]);
+ if (hasSrgbSupport && iValues[14])
+ result.setColorSpace(QSurfaceFormat::sRGBColorSpace);
+ } else {
+ if (hasSrgbSupport && iValues[12])
+ result.setColorSpace(QSurfaceFormat::sRGBColorSpace);
+ }
if (additionalIn) {
if (iValues[7])
additionalIn->formatFlags |= QWindowsGLAccumBuffer;
@@ -947,7 +974,8 @@ QOpenGLStaticContext::QOpenGLStaticContext() :
wglChoosePixelFormatARB((WglChoosePixelFormatARB)QOpenGLStaticContext::opengl32.wglGetProcAddress("wglChoosePixelFormatARB")),
wglCreateContextAttribsARB((WglCreateContextAttribsARB)QOpenGLStaticContext::opengl32.wglGetProcAddress("wglCreateContextAttribsARB")),
wglSwapInternalExt((WglSwapInternalExt)QOpenGLStaticContext::opengl32.wglGetProcAddress("wglSwapIntervalEXT")),
- wglGetSwapInternalExt((WglGetSwapInternalExt)QOpenGLStaticContext::opengl32.wglGetProcAddress("wglGetSwapIntervalEXT"))
+ wglGetSwapInternalExt((WglGetSwapInternalExt)QOpenGLStaticContext::opengl32.wglGetProcAddress("wglGetSwapIntervalEXT")),
+ wglGetExtensionsStringARB((WglGetExtensionsStringARB)QOpenGLStaticContext::opengl32.wglGetProcAddress("wglGetExtensionsStringARB"))
{
if (extensionNames.startsWith(SAMPLE_BUFFER_EXTENSION " ")
|| extensionNames.indexOf(" " SAMPLE_BUFFER_EXTENSION " ") != -1)
@@ -1091,6 +1119,14 @@ QWindowsGLContext::QWindowsGLContext(QOpenGLStaticContext *staticContext,
&& !(QWindowsIntegration::instance()->options() & QWindowsIntegration::DisableArb);
QWindowsOpenGLAdditionalFormat obtainedAdditional;
if (tryExtensions) {
+ if (m_staticContext->wglGetExtensionsStringARB) {
+ const char *exts = m_staticContext->wglGetExtensionsStringARB(hdc);
+ if (exts) {
+ qCDebug(lcQpaGl) << __FUNCTION__ << "WGL extensions:" << exts;
+ if (strstr(exts, "WGL_EXT_framebuffer_sRGB"))
+ m_staticContext->extensions |= QOpenGLStaticContext::sRGBCapableFramebuffer;
+ }
+ }
m_pixelFormat =
ARB::choosePixelFormat(hdc, *m_staticContext, format,
requestedAdditional, &m_obtainedPixelFormatDescriptor);
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index dfaa428520..2d5b94af0e 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -139,7 +139,8 @@ class QOpenGLStaticContext : public QWindowsStaticOpenGLContext
public:
enum Extensions
{
- SampleBuffers = 0x1
+ SampleBuffers = 0x1,
+ sRGBCapableFramebuffer = 0x2
};
typedef bool
@@ -160,6 +161,9 @@ public:
typedef int
(APIENTRY *WglGetSwapInternalExt)(void);
+ typedef const char *
+ (APIENTRY *WglGetExtensionsStringARB)(HDC);
+
bool hasExtensions() const
{ return wglGetPixelFormatAttribIVARB && wglChoosePixelFormatARB && wglCreateContextAttribsARB; }
@@ -185,6 +189,7 @@ public:
WglCreateContextAttribsARB wglCreateContextAttribsARB;
WglSwapInternalExt wglSwapInternalExt;
WglGetSwapInternalExt wglGetSwapInternalExt;
+ WglGetExtensionsStringARB wglGetExtensionsStringARB;
static QWindowsOpengl32DLL opengl32;
};
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 17cab69891..f9bac3920b 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -42,6 +42,7 @@
#include "qwindowswindow.h"
#include "qwindowscontext.h"
#include "qwin10helpers.h"
+#include "qwindowsmenu.h"
#include "qwindowsopenglcontext.h"
#include "qwindowsscreen.h"
@@ -71,6 +72,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qpa/qplatforminputcontextfactory_p.h>
+#include <QtGui/qpa/qplatformcursor.h>
#include <QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h>
@@ -206,6 +208,10 @@ static inline unsigned parseOptions(const QStringList &paramList,
} else if (parseIntOption(param, QLatin1String("verbose"), 0, INT_MAX, &QWindowsContext::verbose)
|| parseIntOption(param, QLatin1String("tabletabsoluterange"), 0, INT_MAX, tabletAbsoluteRange)
|| parseIntOption(param, QLatin1String("dpiawareness"), QtWindows::ProcessDpiUnaware, QtWindows::ProcessPerMonitorDpiAware, dpiAwareness)) {
+ } else if (param == QLatin1String("menus=native")) {
+ options |= QWindowsIntegration::AlwaysUseNativeMenus;
+ } else if (param == QLatin1String("menus=none")) {
+ options |= QWindowsIntegration::NoNativeMenus;
} else {
qWarning() << "Unknown option" << param;
}
@@ -237,6 +243,7 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList &paramL
}
m_context.initTouch(m_options);
+ QPlatformCursor::setCapability(QPlatformCursor::OverrideCursor);
}
QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()
@@ -334,20 +341,8 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
QWindowsWindow *result = createPlatformWindowHelper(window, obtained);
Q_ASSERT(result);
- if (requested.flags != obtained.flags)
- window->setFlags(obtained.flags);
- // Trigger geometry change (unless it has a special state in which case setWindowState()
- // will send the message) and screen change signals of QWindow.
- if ((obtained.flags & Qt::Desktop) != Qt::Desktop) {
- const Qt::WindowState state = window->windowState();
- if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen
- && requested.geometry != obtained.geometry) {
- QWindowSystemInterface::handleGeometryChange(window, obtained.geometry);
- }
- QPlatformScreen *screen = result->screenForGeometry(obtained.geometry);
- if (screen && result->screen() != screen)
- QWindowSystemInterface::handleWindowScreenChanged(window, screen->screen());
- }
+ if (QWindowsMenuBar *menuBarToBeInstalled = QWindowsMenuBar::menuBarOf(window))
+ menuBarToBeInstalled->install(result);
return result;
}
@@ -611,4 +606,11 @@ void QWindowsIntegration::beep() const
MessageBeep(MB_OK); // For QApplication
}
+#if QT_CONFIG(vulkan)
+QPlatformVulkanInstance *QWindowsIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const
+{
+ return new QWindowsVulkanInstance(instance);
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index 28d4fd3026..23f3d9ef4e 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -64,7 +64,9 @@ public:
DontPassOsMouseEventsSynthesizedFromTouch = 0x20, // Do not pass OS-generated mouse events from touch.
// Keep in sync with QWindowsFontDatabase::FontOptions
DontUseDirectWriteFonts = QWindowsFontDatabase::DontUseDirectWriteFonts,
- DontUseColorFonts = QWindowsFontDatabase::DontUseColorFonts
+ DontUseColorFonts = QWindowsFontDatabase::DontUseColorFonts,
+ AlwaysUseNativeMenus = 0x100,
+ NoNativeMenus = 0x200
};
explicit QWindowsIntegration(const QStringList &paramList);
@@ -113,6 +115,10 @@ public:
QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override;
#endif
+#if QT_CONFIG(vulkan)
+ QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
+#endif
+
protected:
virtual QWindowsWindow *createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &) const;
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 3987d8ca29..af62936a18 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -903,6 +903,12 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
return true;
}
+ // Enable Alt accelerators ("&File") on menus
+ if (msgType == WM_SYSKEYDOWN && (nModifiers & AltAny) != 0 && GetMenu(msg.hwnd) != nullptr)
+ return false;
+ if (msgType == WM_SYSKEYUP && nModifiers == 0 && GetMenu(msg.hwnd) != nullptr)
+ return false;
+
bool result = false;
// handle Directionality changes (BiDi) with RTL extensions
if (m_useRTLExtensions) {
diff --git a/src/plugins/platforms/windows/qwindowsmenu.cpp b/src/plugins/platforms/windows/qwindowsmenu.cpp
new file mode 100644
index 0000000000..4e1997c4f8
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowsmenu.cpp
@@ -0,0 +1,962 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 "qwindowsmenu.h"
+#include "qwindowscontext.h"
+#include "qwindowswindow.h"
+
+#include <QtGui/qwindow.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qpointer.h>
+
+#include <algorithm>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWindowsMenuBar
+ \brief Windows native menu bar
+
+ \list
+ \li \l{https://msdn.microsoft.com/de-de/library/windows/desktop/ms647553(v=vs.85).aspx#_win32_Menu_Creation_Functions},
+ \e{About Menus}
+ \endlist
+
+ \note The destruction order of the QWindowsMenu/Item/Bar instances is
+ arbitrary depending on whether the application is Qt Quick or
+ Qt Widgets, either the containers or the items might be deleted first.
+
+ \internal
+ \ingroup qt-lighthouse-win
+*/
+
+static uint nextId = 1;
+
+// Find a QPlatformMenu[Item]* in a vector of QWindowsMenu[Item], where
+// QVector::indexOf() cannot be used since it wants a QWindowsMenu[Item]*
+template <class Derived, class Needle>
+static int indexOf(const QVector<Derived *> &v, const Needle *needle)
+{
+ for (int i = 0, size = v.size(); i < size; ++i) {
+ if (v.at(i) == needle)
+ return i;
+ }
+ return -1;
+}
+
+// Helper for inserting a QPlatformMenu[Item]* into a vector of QWindowsMenu[Item].
+template <class Derived, class Base>
+static int insertBefore(QVector<Derived *> *v, Base *newItemIn, const Base *before = nullptr)
+{
+ int index = before ? indexOf(*v, before) : -1;
+ if (index != -1) {
+ v->insert(index, static_cast<Derived *>(newItemIn));
+ } else {
+ index = v->size();
+ v->append(static_cast<Derived *>(newItemIn));
+ }
+ return index;
+}
+
+static inline const wchar_t *qStringToWChar(const QString &s)
+{
+ return reinterpret_cast<const wchar_t *>(s.utf16());
+}
+
+// Traverse menu and return the item for which predicate
+// "bool Function(QWindowsMenuItem *)" returns true
+template <class Predicate>
+static QWindowsMenuItem *traverseMenuItems(const QWindowsMenu *menu, Predicate p)
+{
+ const QWindowsMenu::MenuItems &items = menu->menuItems();
+ for (QWindowsMenuItem *item : items) {
+ if (p(item))
+ return item;
+ if (item->subMenu()) {
+ if (QWindowsMenuItem *subMenuItem = traverseMenuItems(item->subMenu(), p))
+ return subMenuItem;
+ }
+ }
+ return nullptr;
+}
+
+// Traverse menu bar return the item for which predicate
+// "bool Function(QWindowsMenuItem *)" returns true
+template <class Predicate>
+static QWindowsMenuItem *traverseMenuItems(const QWindowsMenuBar *menuBar, Predicate p)
+{
+ const QWindowsMenuBar::Menus &menus = menuBar->menus();
+ for (QWindowsMenu *menu : menus) {
+ if (QWindowsMenuItem *item = traverseMenuItems(menu, p))
+ return item;
+ }
+ return nullptr;
+}
+
+template <class Menu /* Menu[Bar] */>
+static QWindowsMenuItem *findMenuItemById(const Menu *menu, uint id)
+{
+ return traverseMenuItems(menu, [id] (const QWindowsMenuItem *i) { return i->id() == id; });
+}
+
+// Traverse menu and return the menu for which predicate
+// "bool Function(QWindowsMenu *)" returns true
+template <class Predicate>
+static QWindowsMenu *traverseMenus(const QWindowsMenu *menu, Predicate p)
+{
+ const QWindowsMenu::MenuItems &items = menu->menuItems();
+ for (QWindowsMenuItem *item : items) {
+ if (QWindowsMenu *subMenu = item->subMenu()) {
+ if (p(subMenu))
+ return subMenu;
+ if (QWindowsMenu *menu = traverseMenus(subMenu, p))
+ return menu;
+ }
+ }
+ return nullptr;
+}
+
+// Traverse menu bar return the item for which
+// function "bool Function(QWindowsMenu *)" returns true
+template <class Predicate>
+static QWindowsMenu *traverseMenus(const QWindowsMenuBar *menuBar, Predicate p)
+{
+ const QWindowsMenuBar::Menus &menus = menuBar->menus();
+ for (QWindowsMenu *menu : menus) {
+ if (p(menu))
+ return menu;
+ if (QWindowsMenu *subMenu = traverseMenus(menu, p))
+ return subMenu;
+ }
+ return nullptr;
+}
+
+template <class Menu /* Menu[Bar] */>
+static QWindowsMenu *findMenuByHandle(const Menu *menu, HMENU hMenu)
+{
+ return traverseMenus(menu, [hMenu] (const QWindowsMenu *i) { return i->menuHandle() == hMenu; });
+}
+
+template <class MenuType>
+static int findNextVisibleEntry(const QVector<MenuType *> &entries, int pos)
+{
+ for (int i = pos, size = entries.size(); i < size; ++i) {
+ if (entries.at(i)->isVisible())
+ return i;
+ }
+ return -1;
+}
+
+static inline void menuItemInfoInit(MENUITEMINFO &menuItemInfo)
+{
+ memset(&menuItemInfo, 0, sizeof(MENUITEMINFO));
+ menuItemInfo.cbSize = sizeof(MENUITEMINFO);
+}
+
+static inline void menuItemInfoSetText(MENUITEMINFO &menuItemInfo, const QString &text)
+{
+ menuItemInfoInit(menuItemInfo);
+ menuItemInfo.fMask = MIIM_STRING;
+ menuItemInfo.dwTypeData = const_cast<wchar_t *>(qStringToWChar(text));
+ menuItemInfo.cch = UINT(text.size());
+}
+
+static UINT menuItemState(HMENU hMenu, UINT uItem, BOOL fByPosition)
+{
+ MENUITEMINFO menuItemInfo;
+ menuItemInfoInit(menuItemInfo);
+ menuItemInfo.fMask = MIIM_STATE;
+ return GetMenuItemInfo(hMenu, uItem, fByPosition, &menuItemInfo) == TRUE ? menuItemInfo.fState : 0;
+}
+
+static void menuItemSetState(HMENU hMenu, UINT uItem, BOOL fByPosition, UINT flags)
+{
+ MENUITEMINFO menuItemInfo;
+ menuItemInfoInit(menuItemInfo);
+ menuItemInfo.fMask = MIIM_STATE;
+ menuItemInfo.fState = flags;
+ SetMenuItemInfo(hMenu, uItem, fByPosition, &menuItemInfo);
+}
+
+static void menuItemSetChangeState(HMENU hMenu, UINT uItem, BOOL fByPosition,
+ bool value, UINT trueState, UINT falseState)
+{
+ const UINT oldState = menuItemState(hMenu, uItem, fByPosition);
+ UINT newState = oldState;
+ if (value) {
+ newState |= trueState;
+ newState &= ~falseState;
+ } else {
+ newState &= ~trueState;
+ newState |= falseState;
+ }
+ if (oldState != newState)
+ menuItemSetState(hMenu, uItem, fByPosition, newState);
+}
+
+// ------------ QWindowsMenuItem
+QWindowsMenuItem::QWindowsMenuItem(QWindowsMenu *parentMenu)
+ : m_parentMenu(parentMenu)
+ , m_id(0)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << static_cast<const void *>(this)
+ << "parentMenu=" << parentMenu;
+}
+
+QWindowsMenuItem::~QWindowsMenuItem()
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << static_cast<const void *>(this);
+ removeFromMenu();
+ freeBitmap();
+}
+
+void QWindowsMenuItem::freeBitmap()
+{
+ if (m_hbitmap) {
+ DeleteObject(m_hbitmap);
+ m_hbitmap = nullptr;
+ }
+}
+
+void QWindowsMenuItem::setIcon(const QIcon &icon)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << icon << ')' << this;
+ if (m_icon.cacheKey() == icon.cacheKey())
+ return;
+ m_icon = icon;
+ if (m_parentMenu != nullptr)
+ updateBitmap();
+}
+
+Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);
+
+void QWindowsMenuItem::updateBitmap()
+{
+ freeBitmap();
+ if (!m_icon.isNull()) {
+ const int size = m_iconSize ? m_iconSize : GetSystemMetrics(SM_CYMENUCHECK);
+ m_hbitmap = qt_pixmapToWinHBITMAP(m_icon.pixmap(QSize(size, size)), 1);
+ }
+ MENUITEMINFO itemInfo;
+ menuItemInfoInit(itemInfo);
+ itemInfo.fMask = MIIM_BITMAP;
+ itemInfo.hbmpItem = m_hbitmap;
+ SetMenuItemInfo(parentMenuHandle(), m_id, FALSE, &itemInfo);
+}
+
+void QWindowsMenuItem::setText(const QString &text)
+{
+ qCDebug(lcQpaMenus).nospace().noquote()
+ << __FUNCTION__ << "(\"" << text << "\") " << this;
+ if (m_text == text)
+ return;
+ m_text = text;
+ if (m_parentMenu != nullptr)
+ updateText();
+}
+
+void QWindowsMenuItem::updateText()
+{
+ MENUITEMINFO menuItemInfo;
+ const QString &text = nativeText();
+ menuItemInfoSetText(menuItemInfo, text);
+ SetMenuItemInfo(parentMenuHandle(), m_id, FALSE, &menuItemInfo);
+}
+
+void QWindowsMenuItem::setMenu(QPlatformMenu *menuIn)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << menuIn << ')' << this;
+ if (menuIn == m_subMenu)
+ return;
+ const uint oldId = m_id;
+ if (menuIn != nullptr) { // Set submenu
+ m_subMenu = static_cast<QWindowsMenu *>(menuIn);
+ m_subMenu->setAsItemSubMenu(this);
+ m_id = m_subMenu->id();
+ if (m_parentMenu != nullptr) {
+ ModifyMenu(m_parentMenu->menuHandle(), oldId, MF_BYCOMMAND | MF_POPUP,
+ m_id, qStringToWChar(m_text));
+ }
+ return;
+ }
+ // Clear submenu
+ m_subMenu = nullptr;
+ if (m_parentMenu != nullptr) {
+ m_id = nextId++;
+ ModifyMenu(m_parentMenu->menuHandle(), oldId, MF_BYCOMMAND,
+ m_id, qStringToWChar(m_text));
+ } else {
+ m_id = 0;
+ }
+}
+
+void QWindowsMenuItem::setVisible(bool isVisible)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << isVisible << ')' << this;
+ if (m_visible == isVisible)
+ return;
+ m_visible = isVisible;
+ if (m_parentMenu == nullptr)
+ return;
+ // Windows menu items do not implement settable visibility, we need to work
+ // around by removing the item from the menu. It will be kept in the list.
+ if (isVisible)
+ insertIntoMenuHelper(m_parentMenu, false, m_parentMenu->menuItems().indexOf(this));
+ else
+ RemoveMenu(parentMenuHandle(), m_id, MF_BYCOMMAND);
+}
+
+void QWindowsMenuItem::setIsSeparator(bool isSeparator)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << isSeparator << ')' << this;
+ if (m_separator == isSeparator)
+ return;
+ m_separator = isSeparator;
+}
+
+void QWindowsMenuItem::setCheckable(bool checkable)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << checkable << ')' << this;
+ if (m_checkable == checkable)
+ return;
+ m_checkable = checkable;
+ if (m_parentMenu == nullptr)
+ return;
+ UINT state = menuItemState(parentMenuHandle(), m_id, FALSE);
+ if (m_checkable)
+ state |= m_checked ? MF_CHECKED : MF_UNCHECKED;
+ else
+ state &= ~(MF_CHECKED | MF_UNCHECKED);
+ menuItemSetState(parentMenuHandle(), m_id, FALSE, state);
+}
+
+void QWindowsMenuItem::setChecked(bool isChecked)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << isChecked << ')' << this;
+ if (m_checked == isChecked)
+ return;
+ m_checked = isChecked;
+ // Convenience: Allow to set checkable by calling setChecked(true) for
+ // Quick Controls 1
+ if (isChecked)
+ m_checkable = true;
+ if (m_parentMenu == nullptr || !m_checkable)
+ return;
+ menuItemSetChangeState(parentMenuHandle(), m_id, FALSE, m_checked, MF_CHECKED, MF_UNCHECKED);
+}
+
+void QWindowsMenuItem::setShortcut(const QKeySequence &shortcut)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << shortcut << ')' << this;
+ if (m_shortcut == shortcut)
+ return;
+ m_shortcut = shortcut;
+ if (m_parentMenu != nullptr)
+ updateText();
+}
+
+void QWindowsMenuItem::setEnabled(bool enabled)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << enabled << ')' << this;
+ if (m_enabled == enabled)
+ return;
+ m_enabled = enabled;
+ if (m_parentMenu != nullptr)
+ menuItemSetChangeState(parentMenuHandle(), m_id, FALSE, m_enabled, MF_ENABLED, MF_GRAYED);
+}
+
+void QWindowsMenuItem::setIconSize(int size)
+{
+ if (m_iconSize == size)
+ return;
+ m_iconSize = size;
+ if (m_parentMenu != nullptr)
+ updateBitmap();
+}
+
+HMENU QWindowsMenuItem::parentMenuHandle() const
+{
+ return m_parentMenu ? m_parentMenu->menuHandle() : nullptr;
+}
+
+UINT QWindowsMenuItem::state() const
+{
+ if (m_separator)
+ return MF_SEPARATOR;
+ UINT result = MF_STRING | (m_enabled ? MF_ENABLED : MF_GRAYED);
+ if (m_subMenu != nullptr)
+ result |= MF_POPUP;
+ if (m_checkable)
+ result |= m_checked ? MF_CHECKED : MF_UNCHECKED;
+ if (QGuiApplication::layoutDirection() == Qt::RightToLeft)
+ result |= MFT_RIGHTORDER;
+ return result;
+}
+
+QString QWindowsMenuItem::nativeText() const
+{
+ QString result = m_text;
+ if (!m_shortcut.isEmpty()) {
+ result += QLatin1Char('\t');
+ result += m_shortcut.toString(QKeySequence::NativeText);
+ }
+ return result;
+}
+
+void QWindowsMenuItem::insertIntoMenu(QWindowsMenu *menu, bool append, int index)
+{
+ if (m_id == 0 && m_subMenu == nullptr)
+ m_id = nextId++;
+ insertIntoMenuHelper(menu, append, index);
+ m_parentMenu = menu;
+}
+
+void QWindowsMenuItem::insertIntoMenuHelper(QWindowsMenu *menu, bool append, int index)
+{
+ const QString &text = nativeText();
+
+ UINT_PTR idBefore = 0;
+ if (!append) {
+ // Skip over self (either newly inserted or when called from setVisible()
+ const int nextIndex = findNextVisibleEntry(menu->menuItems(), index + 1);
+ if (nextIndex != -1)
+ idBefore = menu->menuItems().at(nextIndex)->id();
+ }
+
+ if (idBefore)
+ InsertMenu(menu->menuHandle(), idBefore, state(), m_id, qStringToWChar(text));
+ else
+ AppendMenu(menu->menuHandle(), state(), m_id, qStringToWChar(text));
+
+ updateBitmap();
+}
+
+bool QWindowsMenuItem::removeFromMenu()
+{
+ if (QWindowsMenu *parentMenu = m_parentMenu) {
+ m_parentMenu = nullptr;
+ RemoveMenu(parentMenu->menuHandle(), m_id, MF_BYCOMMAND);
+ parentMenu->notifyRemoved(this);
+ return true;
+ }
+ return false;
+}
+
+// ------------ QWindowsMenu
+
+QWindowsMenu::QWindowsMenu() : QWindowsMenu(nullptr, CreateMenu())
+{
+}
+
+QWindowsMenu::QWindowsMenu(QWindowsMenu *parentMenu, HMENU menu)
+ : m_parentMenu(parentMenu)
+ , m_hMenu(menu)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << static_cast<const void *>(this)
+ << "parentMenu=" << parentMenu << "HMENU=" << m_hMenu;
+}
+
+QWindowsMenu::~QWindowsMenu()
+{
+ qCDebug(lcQpaMenus).noquote().nospace() << __FUNCTION__
+ << " \"" <<m_text << "\", " << static_cast<const void *>(this);
+ for (int i = m_menuItems.size() - 1; i>= 0; --i)
+ m_menuItems.at(i)->removeFromMenu();
+ removeFromParent();
+ DestroyMenu(m_hMenu);
+}
+
+void QWindowsMenu::insertMenuItem(QPlatformMenuItem *menuItemIn, QPlatformMenuItem *before)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << menuItemIn << ", before=" << before << ')' << this;
+ QWindowsMenuItem *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);
+}
+
+void QWindowsMenu::removeMenuItem(QPlatformMenuItem *menuItemIn)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << menuItemIn << ')' << this;
+ static_cast<QWindowsMenuItem *>(menuItemIn)->removeFromMenu();
+}
+
+void QWindowsMenu::setText(const QString &text)
+{
+ qCDebug(lcQpaMenus).nospace().noquote()
+ << __FUNCTION__ << "(\"" << text << "\") " << this;
+ if (m_text == text)
+ return;
+ m_text = text;
+ if (!m_visible)
+ return;
+ const HMENU ph = parentHandle();
+ if (ph == nullptr)
+ return;
+ MENUITEMINFO menuItemInfo;
+ menuItemInfoSetText(menuItemInfo, m_text);
+ SetMenuItemInfo(ph, id(), FALSE, &menuItemInfo);
+}
+
+void QWindowsMenu::setIcon(const QIcon &icon)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << icon << ')' << this;
+ m_icon = icon;
+}
+
+void QWindowsMenu::setEnabled(bool enabled)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << enabled << ')' << this;
+ if (m_enabled == enabled)
+ return;
+ m_enabled = enabled;
+ if (!m_visible)
+ return;
+ if (const HMENU ph = parentHandle())
+ menuItemSetChangeState(ph, id(), FALSE, m_enabled, MF_ENABLED, MF_GRAYED);
+}
+
+QWindowsMenuItem *QWindowsMenu::itemForSubMenu(const QWindowsMenu *subMenu) const
+{
+ const auto it = std::find_if(m_menuItems.cbegin(), m_menuItems.cend(),
+ [subMenu] (const QWindowsMenuItem *i) { return i->subMenu() == subMenu; });
+ return it != m_menuItems.cend() ? *it : nullptr;
+}
+
+void QWindowsMenu::insertIntoMenuBar(QWindowsMenuBar *bar, bool append, int index)
+{
+ UINT_PTR idBefore = 0;
+ if (!append) {
+ // Skip over self (either newly inserted or when called from setVisible()
+ const int nextIndex = findNextVisibleEntry(bar->menus(), index + 1);
+ if (nextIndex != -1)
+ idBefore = bar->menus().at(nextIndex)->id();
+ }
+ m_parentMenuBar = bar;
+ m_parentMenu = nullptr;
+ if (idBefore)
+ InsertMenu(bar->menuBarHandle(), idBefore, MF_POPUP | MF_BYCOMMAND, id(), qStringToWChar(m_text));
+ else
+ AppendMenu(bar->menuBarHandle(), MF_POPUP, id(), qStringToWChar(m_text));
+}
+
+bool QWindowsMenu::removeFromParent()
+{
+ if (QWindowsMenuBar *bar = m_parentMenuBar) {
+ m_parentMenuBar = nullptr;
+ bar->notifyRemoved(this);
+ return RemoveMenu(bar->menuBarHandle(), id(), MF_BYCOMMAND) == TRUE;
+ }
+ if (QWindowsMenu *menu = m_parentMenu) {
+ m_parentMenu = nullptr;
+ QWindowsMenuItem *item = menu->itemForSubMenu(this);
+ if (item)
+ item->setMenu(nullptr);
+ return item != nullptr;
+ }
+ return false;
+}
+
+void QWindowsMenu::setVisible(bool visible)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << visible << ')' << this;
+ if (m_visible == visible)
+ return;
+ m_visible = visible;
+ const HMENU ph = parentHandle();
+ if (ph == nullptr)
+ return;
+ // Windows menus do not implement settable visibility, we need to work
+ // around by removing the menu from the parent. It will be kept in the list.
+ if (visible) {
+ if (m_parentMenuBar)
+ insertIntoMenuBar(m_parentMenuBar, false, m_parentMenuBar->menus().indexOf(this));
+ } else {
+ RemoveMenu(ph, id(), MF_BYCOMMAND);
+ }
+ if (m_parentMenuBar)
+ m_parentMenuBar->redraw();
+}
+
+QPlatformMenuItem *QWindowsMenu::menuItemAt(int position) const
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << position;
+ return position >= 0 && position < m_menuItems.size()
+ ? m_menuItems.at(position) : nullptr;
+}
+
+QPlatformMenuItem *QWindowsMenu::menuItemForTag(quintptr tag) const
+{
+ return traverseMenuItems(this, [tag] (const QPlatformMenuItem *i) { return i->tag() == tag; });
+}
+
+QPlatformMenuItem *QWindowsMenu::createMenuItem() const
+{
+ QPlatformMenuItem *result = new QWindowsMenuItem;
+ qCDebug(lcQpaMenus) << __FUNCTION__ << this << "returns" << result;
+ return result;
+}
+
+QPlatformMenu *QWindowsMenu::createSubMenu() const
+{
+ QPlatformMenu *result = new QWindowsMenu;
+ qCDebug(lcQpaMenus) << __FUNCTION__ << this << "returns" << result;
+ return result;
+}
+
+void QWindowsMenu::setAsItemSubMenu(QWindowsMenuItem *item)
+{
+ m_parentMenu = item->parentMenu();
+}
+
+HMENU QWindowsMenu::parentMenuHandle() const
+{
+ return m_parentMenu ? m_parentMenu->menuHandle() : nullptr;
+}
+
+HMENU QWindowsMenu::parentMenuBarHandle() const
+{
+ return m_parentMenuBar ? m_parentMenuBar->menuBarHandle() : nullptr;
+}
+
+HMENU QWindowsMenu::parentHandle() const
+{
+ if (m_parentMenuBar)
+ return m_parentMenuBar->menuBarHandle();
+ if (m_parentMenu)
+ return m_parentMenu->menuHandle();
+ return nullptr;
+}
+
+// --------------- QWindowsPopupMenu
+
+static QPointer<QWindowsPopupMenu> lastShownPopupMenu;
+
+QWindowsPopupMenu::QWindowsPopupMenu() : QWindowsMenu(nullptr, CreatePopupMenu())
+{
+}
+
+void QWindowsPopupMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
+ const QPlatformMenuItem *item)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '>' << this << parentWindow << targetRect << item;
+ const QWindowsBaseWindow *window = static_cast<const QWindowsBaseWindow *>(parentWindow->handle());
+ const QPoint globalPos = window->mapToGlobal(targetRect.topLeft());
+ trackPopupMenu(window->handle(), globalPos.x(), globalPos.y());
+}
+
+bool QWindowsPopupMenu::trackPopupMenu(HWND windowHandle, int x, int y)
+{
+ lastShownPopupMenu = this;
+ return TrackPopupMenu(menuHandle(),
+ QGuiApplication::layoutDirection() == Qt::RightToLeft ? UINT(TPM_RIGHTALIGN) : UINT(0),
+ x, y, 0, windowHandle, nullptr) == TRUE;
+}
+
+bool QWindowsPopupMenu::notifyTriggered(uint id)
+{
+ QPlatformMenuItem *result = lastShownPopupMenu.isNull()
+ ? nullptr
+ : findMenuItemById(lastShownPopupMenu.data(), id);
+ if (result != nullptr) {
+ qCDebug(lcQpaMenus) << __FUNCTION__ << "id=" << id;
+ emit result->activated();
+ }
+ lastShownPopupMenu = nullptr;
+ return result != nullptr;
+}
+
+bool QWindowsPopupMenu::notifyAboutToShow(HMENU hmenu)
+{
+ if (lastShownPopupMenu.isNull())
+ return false;
+ if (lastShownPopupMenu->menuHandle() == hmenu) {
+ emit lastShownPopupMenu->aboutToShow();
+ return true;
+ }
+ if (QWindowsMenu *menu = findMenuByHandle(lastShownPopupMenu.data(), hmenu)) {
+ emit menu->aboutToShow();
+ return true;
+ }
+ return false;
+}
+
+// --------------- QWindowsMenuBar
+
+QWindowsMenuBar::QWindowsMenuBar() : m_hMenuBar(CreateMenu())
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << static_cast<const void *>(this);
+}
+
+QWindowsMenuBar::~QWindowsMenuBar()
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << static_cast<const void *>(this);
+ for (int m = m_menus.size() - 1; m >= 0; --m)
+ m_menus.at(m)->removeFromParent();
+ removeFromWindow();
+ DestroyMenu(m_hMenuBar);
+}
+
+void QWindowsMenuBar::insertMenu(QPlatformMenu *menuIn, QPlatformMenu *before)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << menuIn << "before=" << before;
+ QWindowsMenu *menu = static_cast<QWindowsMenu *>(menuIn);
+ const int index = insertBefore(&m_menus, menuIn, before);
+ menu->insertIntoMenuBar(this, index == m_menus.size() - 1, index);
+}
+
+void QWindowsMenuBar::removeMenu(QPlatformMenu *menu)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << menu << ')' << this;
+ const int index = indexOf(m_menus, menu);
+ if (index != -1)
+ m_menus[index]->removeFromParent();
+}
+
+// When calling handleReparent() for a QWindow instances that does not have
+// a platform window yet, set the menubar as dynamic property to be installed
+// on platform window creation.
+static const char menuBarPropertyName[] = "_q_windowsNativeMenuBar";
+
+void QWindowsMenuBar::handleReparent(QWindow *newParentWindow)
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << newParentWindow << ')' << this;
+ if (newParentWindow == nullptr) {
+ removeFromWindow();
+ return; // Happens during Quick Controls 1 property setup
+ }
+ if (QPlatformWindow *platWin = newParentWindow->handle())
+ install(static_cast<QWindowsWindow *>(platWin));
+ else // Store for later creation, see menuBarOf()
+ newParentWindow->setProperty(menuBarPropertyName, qVariantFromValue<QObject *>(this));
+}
+
+QWindowsMenuBar *QWindowsMenuBar::menuBarOf(const QWindow *notYetCreatedWindow)
+{
+ const QVariant menuBarV = notYetCreatedWindow->property(menuBarPropertyName);
+ return menuBarV.canConvert<QObject *>()
+ ? qobject_cast<QWindowsMenuBar *>(menuBarV.value<QObject *>()) : nullptr;
+}
+
+static inline void forceNcCalcSize(HWND hwnd)
+{
+ // Force WM_NCCALCSIZE to adjust margin: Does not appear to work?
+ SetWindowPos(hwnd, 0, 0, 0, 0, 0,
+ SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
+}
+
+void QWindowsMenuBar::install(QWindowsWindow *window)
+{
+ const HWND hwnd = window->handle();
+ const BOOL result = SetMenu(hwnd, m_hMenuBar);
+ if (result) {
+ window->setMenuBar(this);
+ forceNcCalcSize(hwnd);
+ }
+}
+
+void QWindowsMenuBar::removeFromWindow()
+{
+ if (QWindowsWindow *window = platformWindow()) {
+ const HWND hwnd = window->handle();
+ SetMenu(hwnd, nullptr);
+ window->setMenuBar(nullptr);
+ forceNcCalcSize(hwnd);
+ }
+}
+
+QPlatformMenu *QWindowsMenuBar::menuForTag(quintptr tag) const
+{
+ return traverseMenus(this, [tag] (const QWindowsMenu *m) { return m->tag() == tag; });
+}
+
+QPlatformMenu *QWindowsMenuBar::createMenu() const
+{
+ QPlatformMenu *result = new QWindowsMenu;
+ qCDebug(lcQpaMenus) << __FUNCTION__ << this << "returns" << result;
+ return result;
+}
+
+bool QWindowsMenuBar::notifyTriggered(uint id)
+{
+ QPlatformMenuItem *result = findMenuItemById(this, id);
+ if (result != nullptr) {
+ qCDebug(lcQpaMenus) << __FUNCTION__ << "id=" << id;
+ emit result->activated();
+ }
+ return result != nullptr;
+}
+
+bool QWindowsMenuBar::notifyAboutToShow(HMENU hmenu)
+{
+ if (QWindowsMenu *menu = findMenuByHandle(this, hmenu)) {
+ emit menu->aboutToShow();
+ return true;
+ }
+ return false;
+}
+
+QWindowsWindow *QWindowsMenuBar::platformWindow() const
+{
+ if (const QWindowsContext *ctx = QWindowsContext::instance()) {
+ if (QWindowsWindow *w = ctx->findPlatformWindow(this))
+ return w;
+ }
+ return nullptr;
+}
+
+void QWindowsMenuBar::redraw() const
+{
+ if (const QWindowsWindow *window = platformWindow())
+ DrawMenuBar(window->handle());
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+
+template <class M> /* Menu[Item] */
+static void formatTextSequence(QDebug &d, const QVector<M *> &v)
+{
+ if (const int size = v.size()) {
+ d << '[' << size << "](";
+ for (int i = 0; i < size; ++i) {
+ if (i)
+ d << ", ";
+ if (!v.at(i)->isVisible())
+ d << "[hidden] ";
+ d << '"' << v.at(i)->text() << '"';
+ }
+ d << ')';
+ }
+}
+
+void QWindowsMenuItem::formatDebug(QDebug &d) const
+{
+ if (m_separator)
+ d << "separator, ";
+ else
+ d << '"' << m_text << "\", ";
+ d << static_cast<const void *>(this);
+ if (m_parentMenu)
+ 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;
+ if (!m_shortcut.isEmpty())
+ d << ", shortcut=" << m_shortcut;
+ if (m_visible)
+ d << " [visible]";
+ if (m_enabled)
+ d << " [enabled]";
+ if (m_checkable)
+ d << ", checked=" << m_checked;
+}
+
+QDebug operator<<(QDebug d, const QPlatformMenuItem *i)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d.noquote();
+ d << "QPlatformMenuItem(";
+ if (i)
+ static_cast<const QWindowsMenuItem *>(i)->formatDebug(d);
+ else
+ d << '0';
+ d << ')';
+ return d;
+}
+
+void QWindowsMenu::formatDebug(QDebug &d) const
+{
+ d << '"' << m_text << "\", " << static_cast<const void *>(this)
+ << ", handle=" << m_hMenu;
+ if (m_parentMenuBar != nullptr)
+ d << " [on menubar]";
+ if (m_parentMenu != nullptr)
+ d << " [on menu]";
+ if (tag())
+ d << ", tag=" << showbase << hex << tag() << noshowbase << dec;
+ if (m_visible)
+ d << " [visible]";
+ if (m_enabled)
+ d << " [enabled]";
+ d <<' ';
+ formatTextSequence(d, m_menuItems);
+}
+
+void QWindowsMenuBar::formatDebug(QDebug &d) const
+{
+ d << static_cast<const void *>(this) << ' ';
+ formatTextSequence(d, m_menus);
+}
+
+QDebug operator<<(QDebug d, const QPlatformMenu *m)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d.noquote();
+ if (m) {
+ d << m->metaObject()->className() << '(';
+ static_cast<const QWindowsMenu *>(m)->formatDebug(d);
+ d << ')';
+ } else {
+ d << "QPlatformMenu(0)";
+ }
+ return d;
+}
+
+QDebug operator<<(QDebug d, const QPlatformMenuBar *mb)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d.noquote();
+ d << "QPlatformMenuBar(";
+ if (mb)
+ static_cast<const QWindowsMenuBar *>(mb)->formatDebug(d);
+ else
+ d << '0';
+ d << ')';
+ return d;
+}
+
+#endif // !QT_NO_DEBUG_STREAM
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsmenu.h b/src/plugins/platforms/windows/qwindowsmenu.h
new file mode 100644
index 0000000000..d51a29676e
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowsmenu.h
@@ -0,0 +1,243 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QWINDOWSMENU_H
+#define QWINDOWSMENU_H
+
+#include "qtwindowsglobal.h"
+
+#include <qpa/qplatformmenu.h>
+
+#include <QtCore/QVector>
+#include <QtCore/QPair>
+
+QT_BEGIN_NAMESPACE
+
+class QDebug;
+
+class QWindowsMenu;
+class QWindowsMenuBar;
+class QWindowsWindow;
+
+class QWindowsMenuItem : public QPlatformMenuItem
+{
+ Q_OBJECT
+public:
+ explicit QWindowsMenuItem(QWindowsMenu *parentMenu = nullptr);
+ ~QWindowsMenuItem();
+
+ void setText(const QString &text) override;
+ void setIcon(const QIcon &icon) override;
+ void setMenu(QPlatformMenu *menu) override;
+ void setVisible(bool isVisible) override;
+ void setIsSeparator(bool isSeparator) override;
+ void setFont(const QFont &) override {}
+ void setRole(MenuRole) override {}
+ void setCheckable(bool checkable) override;
+ void setChecked(bool isChecked) override;
+#ifndef QT_NO_SHORTCUT
+ void setShortcut(const QKeySequence& shortcut) override;
+#endif
+ void setEnabled(bool enabled) override;
+ void setIconSize(int size) override;
+
+ const QWindowsMenu *parentMenu() const { return m_parentMenu; }
+ QWindowsMenu *parentMenu() { return m_parentMenu; }
+ HMENU parentMenuHandle() const;
+ QWindowsMenu *subMenu() const { return m_subMenu; }
+ UINT_PTR id() const { return m_id; }
+ void setId(uint id) { m_id = id; }
+ UINT state() const;
+ QString text() const { return m_text; }
+ QString nativeText() const;
+ bool isVisible() const { return m_visible; }
+
+ void insertIntoMenu(QWindowsMenu *menuItem, bool append, int index);
+ bool removeFromMenu();
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const;
+#endif
+
+private:
+ void updateBitmap();
+ void freeBitmap();
+ void updateText();
+ void insertIntoMenuHelper(QWindowsMenu *menu, bool append, int index);
+
+ QWindowsMenu *m_parentMenu = nullptr;
+ QWindowsMenu *m_subMenu = nullptr;
+ UINT_PTR m_id; // Windows Id sent as wParam with WM_COMMAND or submenu handle.
+ QString m_text;
+ QIcon m_icon;
+ HBITMAP m_hbitmap = nullptr;
+ int m_iconSize = 0;
+ bool m_separator = false;
+ bool m_visible = true;
+ bool m_checkable = false;
+ bool m_checked = false;
+ bool m_enabled = true;
+ QKeySequence m_shortcut;
+};
+
+class QWindowsMenu : public QPlatformMenu
+{
+ Q_OBJECT
+public:
+ typedef QVector<QWindowsMenuItem *> MenuItems;
+
+ QWindowsMenu();
+ ~QWindowsMenu();
+
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override;
+ void removeMenuItem(QPlatformMenuItem *menuItem) override;
+ void syncMenuItem(QPlatformMenuItem *) override {}
+ void syncSeparatorsCollapsible(bool) override {}
+
+ void setText(const QString &text) override;
+ void setIcon(const QIcon &icon) override;
+ void setEnabled(bool enabled) override;
+ bool isEnabled() const override { return m_enabled; }
+ void setVisible(bool visible) override;
+
+ QPlatformMenuItem *menuItemAt(int position) const override;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const override;
+
+ QPlatformMenuItem *createMenuItem() const override;
+ QPlatformMenu *createSubMenu() const override;
+
+ HMENU menuHandle() const { return m_hMenu; }
+ UINT_PTR id() const { return reinterpret_cast<UINT_PTR>(m_hMenu); }
+ QString text() const { return m_text; }
+ const MenuItems &menuItems() const { return m_menuItems; }
+ QWindowsMenuItem *itemForSubMenu(const QWindowsMenu *subMenu) const;
+
+ const QWindowsMenuBar *parentMenuBar() const { return m_parentMenuBar; }
+ HMENU parentMenuBarHandle() const;
+ const QWindowsMenu *parentMenu() const { return m_parentMenu; }
+ void setAsItemSubMenu(QWindowsMenuItem *item);
+ void notifyRemoved(QWindowsMenuItem *item) { m_menuItems.removeOne(item); }
+ HMENU parentMenuHandle() const;
+ HMENU parentHandle() const;
+ bool isVisible() const { return m_visible; }
+ void insertIntoMenuBar(QWindowsMenuBar *bar, bool append, int index);
+ bool removeFromParent();
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const;
+#endif
+
+protected:
+ explicit QWindowsMenu(QWindowsMenu *parentMenu, HMENU menu);
+
+private:
+ QWindowsMenuBar *m_parentMenuBar = nullptr;
+ QWindowsMenu *m_parentMenu = nullptr;
+ MenuItems m_menuItems;
+ HMENU m_hMenu = nullptr;
+ QString m_text;
+ QIcon m_icon;
+ bool m_visible = true;
+ bool m_enabled = true;
+};
+
+class QWindowsPopupMenu : public QWindowsMenu
+{
+ Q_OBJECT
+public:
+ QWindowsPopupMenu();
+
+ static bool notifyTriggered(uint id);
+ static bool notifyAboutToShow(HMENU hmenu);
+
+ void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override;
+ void dismiss() override {}
+
+ bool trackPopupMenu(HWND windowHandle, int x, int y);
+};
+
+class QWindowsMenuBar : public QPlatformMenuBar
+{
+ Q_OBJECT
+public:
+ typedef QVector<QWindowsMenu *> Menus;
+
+ QWindowsMenuBar();
+ ~QWindowsMenuBar();
+
+ void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override;
+ void removeMenu(QPlatformMenu *menu) override;
+ void syncMenu(QPlatformMenu *) override {}
+ void handleReparent(QWindow *newParentWindow) override;
+
+ QPlatformMenu *menuForTag(quintptr tag) const override;
+ QPlatformMenu *createMenu() const override;
+
+ HMENU menuBarHandle() const { return m_hMenuBar; }
+ const Menus &menus() const { return m_menus; }
+ bool notifyTriggered(uint id);
+ bool notifyAboutToShow(HMENU hmenu);
+ void notifyRemoved(QWindowsMenu *menu) { m_menus.removeOne(menu); }
+ void redraw() const;
+
+ void install(QWindowsWindow *window);
+
+ static QWindowsMenuBar *menuBarOf(const QWindow *notYetCreatedWindow);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const;
+#endif
+
+private:
+ QWindowsWindow *platformWindow() const;
+ void removeFromWindow();
+
+ Menus m_menus;
+ HMENU m_hMenuBar = nullptr;
+};
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const QPlatformMenuItem *);
+QDebug operator<<(QDebug d, const QPlatformMenu *);
+QDebug operator<<(QDebug d, const QPlatformMenuBar *);
+#endif // !QT_NO_DEBUG_STREAM
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSMENU_H
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index 9c9382c44c..b892f1610d 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -41,6 +41,7 @@
#include "qwindowscontext.h"
#include <QtGui/private/qdnd_p.h>
+#include <QtCore/QByteArrayMatcher>
#include <QtCore/QTextCodec>
#include <QtCore/QMap>
#include <QtCore/QUrl>
@@ -955,9 +956,11 @@ QVariant QWindowsMimeHtml::convertToMime(const QString &mime, IDataObject *pData
QVariant result;
if (canConvertToMime(mime, pDataObj)) {
QByteArray html = getData(CF_HTML, pDataObj);
+ static Q_RELAXED_CONSTEXPR auto startMatcher = qMakeStaticByteArrayMatcher("StartHTML:");
+ static Q_RELAXED_CONSTEXPR auto endMatcher = qMakeStaticByteArrayMatcher("EndHTML:");
qCDebug(lcQpaMime) << __FUNCTION__ << "raw:" << html;
- int start = html.indexOf("StartHTML:");
- int end = html.indexOf("EndHTML:");
+ int start = startMatcher.indexIn(html);
+ int end = endMatcher.indexIn(html);
if (start != -1) {
int startOffset = start + 10;
@@ -997,10 +1000,13 @@ bool QWindowsMimeHtml::convertFromMime(const FORMATETC &formatetc, const QMimeDa
"StartFragment:0000000000\r\n" // 56-81
"EndFragment:0000000000\r\n\r\n"; // 82-107
- if (data.indexOf("<!--StartFragment-->") == -1)
+ static Q_RELAXED_CONSTEXPR auto startFragmentMatcher = qMakeStaticByteArrayMatcher("<!--StartFragment-->");
+ static Q_RELAXED_CONSTEXPR auto endFragmentMatcher = qMakeStaticByteArrayMatcher("<!--EndFragment-->");
+
+ if (startFragmentMatcher.indexIn(data) == -1)
result += "<!--StartFragment-->";
result += data;
- if (data.indexOf("<!--EndFragment-->") == -1)
+ if (endFragmentMatcher.indexIn(data) == -1)
result += "<!--EndFragment-->";
// set the correct number for EndHTML
@@ -1008,9 +1014,9 @@ bool QWindowsMimeHtml::convertFromMime(const FORMATETC &formatetc, const QMimeDa
memcpy(reinterpret_cast<char *>(result.data() + 53 - pos.length()), pos.constData(), size_t(pos.length()));
// set correct numbers for StartFragment and EndFragment
- pos = QByteArray::number(result.indexOf("<!--StartFragment-->") + 20);
+ pos = QByteArray::number(startFragmentMatcher.indexIn(result) + 20);
memcpy(reinterpret_cast<char *>(result.data() + 79 - pos.length()), pos.constData(), size_t(pos.length()));
- pos = QByteArray::number(result.indexOf("<!--EndFragment-->"));
+ pos = QByteArray::number(endFragmentMatcher.indexIn(result));
memcpy(reinterpret_cast<char *>(result.data() + 103 - pos.length()), pos.constData(), size_t(pos.length()));
return setData(result, pmedium);
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index d21581ba8a..af4304cb19 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -573,7 +573,8 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
QWindowSystemInterface::handleTouchEvent(window,
m_touchDevice,
- touchPoints);
+ touchPoints,
+ QWindowsKeyMapper::queryKeyboardModifiers());
return true;
}
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
index d750eef19d..dc8e97c886 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
@@ -64,7 +64,8 @@ enum ResourceType {
HandleType,
GlHandleType,
GetDCType,
- ReleaseDCType
+ ReleaseDCType,
+ VkSurface
};
static int resourceType(const QByteArray &key)
@@ -77,7 +78,8 @@ static int resourceType(const QByteArray &key)
"handle",
"glhandle",
"getdc",
- "releasedc"
+ "releasedc",
+ "vkSurface"
};
const char ** const end = names + sizeof(names) / sizeof(names[0]);
const char **result = std::find(names, end, key);
@@ -112,6 +114,12 @@ void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resourc
case QWindow::OpenGLSurface:
case QWindow::OpenVGSurface:
break;
+ case QWindow::VulkanSurface:
+#if QT_CONFIG(vulkan)
+ if (type == VkSurface)
+ return bw->surface(nullptr, nullptr); // returns the address of the VkSurfaceKHR, not the value, as expected
+#endif
+ break;
}
qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
return 0;
diff --git a/src/plugins/platforms/windows/qwindowsole.cpp b/src/plugins/platforms/windows/qwindowsole.cpp
index 9b71061aa5..0ceb0d82fa 100644
--- a/src/plugins/platforms/windows/qwindowsole.cpp
+++ b/src/plugins/platforms/windows/qwindowsole.cpp
@@ -99,39 +99,6 @@ DWORD QWindowsOleDataObject::reportedPerformedEffect() const
return performedEffect;
}
-//---------------------------------------------------------------------
-// IUnknown Methods
-//---------------------------------------------------------------------
-
-STDMETHODIMP
-QWindowsOleDataObject::QueryInterface(REFIID iid, void FAR* FAR* ppv)
-{
- if (iid == IID_IUnknown || iid == IID_IDataObject) {
- *ppv = this;
- AddRef();
- return NOERROR;
- }
- *ppv = NULL;
- return ResultFromScode(E_NOINTERFACE);
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleDataObject::AddRef(void)
-{
- return ++m_refs;
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleDataObject::Release(void)
-{
- if (--m_refs == 0) {
- releaseQt();
- delete this;
- return 0;
- }
- return m_refs;
-}
-
STDMETHODIMP
QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)
{
@@ -323,35 +290,6 @@ bool QWindowsOleEnumFmtEtc::isNull() const
return m_isNull;
}
-// IUnknown methods
-STDMETHODIMP
-QWindowsOleEnumFmtEtc::QueryInterface(REFIID riid, void FAR* FAR* ppvObj)
-{
- if (riid == IID_IUnknown || riid == IID_IEnumFORMATETC) {
- *ppvObj = this;
- AddRef();
- return NOERROR;
- }
- *ppvObj = NULL;
- return ResultFromScode(E_NOINTERFACE);
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleEnumFmtEtc::AddRef(void)
-{
- return ++m_dwRefs;
-}
-
-STDMETHODIMP_(ULONG)
-QWindowsOleEnumFmtEtc::Release(void)
-{
- if (--m_dwRefs == 0) {
- delete this;
- return 0;
- }
- return m_dwRefs;
-}
-
// IEnumFORMATETC methods
STDMETHODIMP
QWindowsOleEnumFmtEtc::Next(ULONG celt, LPFORMATETC rgelt, ULONG FAR* pceltFetched)
diff --git a/src/plugins/platforms/windows/qwindowsole.h b/src/plugins/platforms/windows/qwindowsole.h
index 643011272b..fc58858f2c 100644
--- a/src/plugins/platforms/windows/qwindowsole.h
+++ b/src/plugins/platforms/windows/qwindowsole.h
@@ -40,6 +40,7 @@
#ifndef QWINDOWSOLE_H
#define QWINDOWSOLE_H
+#include "qwindowscombase.h"
#include <QtCore/qt_windows.h>
#include <QtCore/QMap>
@@ -53,7 +54,7 @@ QT_BEGIN_NAMESPACE
class QMimeData;
class QWindow;
-class QWindowsOleDataObject : public IDataObject
+class QWindowsOleDataObject : public QWindowsComBase<IDataObject>
{
public:
explicit QWindowsOleDataObject(QMimeData *mimeData);
@@ -63,11 +64,6 @@ public:
QMimeData *mimeData() const;
DWORD reportedPerformedEffect() const;
- // IUnknown methods
- STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppvObj);
- STDMETHOD_(ULONG,AddRef)(void);
- STDMETHOD_(ULONG,Release)(void);
-
// IDataObject methods
STDMETHOD(GetData)(LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium);
STDMETHOD(GetDataHere)(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium);
@@ -82,13 +78,12 @@ public:
STDMETHOD(EnumDAdvise)(LPENUMSTATDATA FAR* ppenumAdvise);
private:
- ULONG m_refs = 1;
QPointer<QMimeData> data;
const int CF_PERFORMEDDROPEFFECT;
DWORD performedEffect = DROPEFFECT_NONE;
};
-class QWindowsOleEnumFmtEtc : public IEnumFORMATETC
+class QWindowsOleEnumFmtEtc : public QWindowsComBase<IEnumFORMATETC>
{
public:
explicit QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs);
@@ -97,11 +92,6 @@ public:
bool isNull() const;
- // IUnknown methods
- STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppvObj);
- STDMETHOD_(ULONG,AddRef)(void);
- STDMETHOD_(ULONG,Release)(void);
-
// IEnumFORMATETC methods
STDMETHOD(Next)(ULONG celt, LPFORMATETC rgelt, ULONG FAR* pceltFetched);
STDMETHOD(Skip)(ULONG celt);
@@ -111,7 +101,6 @@ public:
private:
bool copyFormatEtc(LPFORMATETC dest, const FORMATETC *src) const;
- ULONG m_dwRefs = 1;
ULONG m_nIndex = 0;
QVector<LPFORMATETC> m_lpfmtetcs;
bool m_isNull = false;
diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
new file mode 100644
index 0000000000..3ee591de8c
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
@@ -0,0 +1,443 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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$
+**
+****************************************************************************/
+
+#if defined(WINVER) && WINVER < 0x0601
+# undef WINVER
+#endif
+#if !defined(WINVER)
+# define WINVER 0x0601 // required for NOTIFYICONDATA_V2_SIZE, ChangeWindowMessageFilterEx() (MinGW 5.3)
+#endif
+
+#if defined(NTDDI_VERSION) && NTDDI_VERSION < 0x06010000
+# undef NTDDI_VERSION
+#endif
+#if !defined(NTDDI_VERSION)
+# define NTDDI_VERSION 0x06010000 // required for Shell_NotifyIconGetRect (MinGW 5.3)
+#endif
+
+#include "qwindowssystemtrayicon.h"
+#include "qwindowscontext.h"
+#include "qwindowstheme.h"
+#include "qwindowsmenu.h"
+#include "qwindowsscreen.h"
+
+#include <QtGui/qpixmap.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qsettings.h>
+
+#include <qt_windows.h>
+#include <commctrl.h>
+#include <shellapi.h>
+#include <shlobj.h>
+#include <windowsx.h>
+
+QT_BEGIN_NAMESPACE
+
+static const UINT q_uNOTIFYICONID = 0;
+
+static uint MYWM_TASKBARCREATED = 0;
+#define MYWM_NOTIFYICON (WM_APP+101)
+
+Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &);
+
+// Copy QString data to a limited wchar_t array including \0.
+static inline void qStringToLimitedWCharArray(QString in, wchar_t *target, int maxLength)
+{
+ const int length = qMin(maxLength - 1, in.size());
+ if (length < in.size())
+ in.truncate(length);
+ in.toWCharArray(target);
+ target[length] = wchar_t(0);
+}
+
+static inline void initNotifyIconData(NOTIFYICONDATA &tnd)
+{
+ memset(&tnd, 0, sizeof(NOTIFYICONDATA));
+ tnd.cbSize = sizeof(NOTIFYICONDATA);
+ tnd.uVersion = NOTIFYICON_VERSION_4;
+}
+
+static void setIconContents(NOTIFYICONDATA &tnd, const QString &tip, HICON hIcon)
+{
+ tnd.uFlags |= NIF_MESSAGE | NIF_ICON | NIF_TIP;
+ tnd.uCallbackMessage = MYWM_NOTIFYICON;
+ tnd.hIcon = hIcon;
+ qStringToLimitedWCharArray(tip, tnd.szTip, sizeof(tnd.szTip) / sizeof(wchar_t));
+}
+
+// Match the HWND of the dummy window to the instances
+struct QWindowsHwndSystemTrayIconEntry
+{
+ HWND hwnd;
+ QWindowsSystemTrayIcon *trayIcon;
+};
+
+typedef QVector<QWindowsHwndSystemTrayIconEntry> HwndTrayIconEntries;
+
+Q_GLOBAL_STATIC(HwndTrayIconEntries, hwndTrayIconEntries)
+
+static int indexOfHwnd(HWND hwnd)
+{
+ const HwndTrayIconEntries *entries = hwndTrayIconEntries();
+ for (int i = 0, size = entries->size(); i < size; ++i) {
+ if (entries->at(i).hwnd == hwnd)
+ return i;
+ }
+ return -1;
+}
+
+extern "C" LRESULT QT_WIN_CALLBACK qWindowsTrayIconWndProc(HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ if (message == MYWM_TASKBARCREATED || message == MYWM_NOTIFYICON
+ || message == WM_INITMENU || message == WM_INITMENUPOPUP
+ || message == WM_COMMAND) {
+ const int index = indexOfHwnd(hwnd);
+ if (index >= 0) {
+ MSG msg;
+ msg.hwnd = hwnd; // re-create MSG structure
+ msg.message = message; // time and pt fields ignored
+ msg.wParam = wParam;
+ msg.lParam = lParam;
+ msg.pt.x = GET_X_LPARAM(lParam);
+ msg.pt.y = GET_Y_LPARAM(lParam);
+ long result = 0;
+ if (hwndTrayIconEntries()->at(index).trayIcon->winEvent(msg, &result))
+ return result;
+ }
+ }
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
+
+// Note: Message windows (HWND_MESSAGE) are not sufficient, they
+// will not receive the "TaskbarCreated" message.
+static inline HWND createTrayIconMessageWindow()
+{
+ QWindowsContext *ctx = QWindowsContext::instance();
+ if (!ctx)
+ return 0;
+ // Register window class in the platform plugin.
+ const QString className =
+ ctx->registerWindowClass(QStringLiteral("QTrayIconMessageWindowClass"),
+ qWindowsTrayIconWndProc);
+ const wchar_t windowName[] = L"QTrayIconMessageWindow";
+ return CreateWindowEx(0, reinterpret_cast<const wchar_t *>(className.utf16()),
+ windowName, WS_OVERLAPPED,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ NULL, NULL, (HINSTANCE)GetModuleHandle(0), NULL);
+}
+
+/*!
+ \class QWindowsSystemTrayIcon
+ \brief Windows native system tray icon
+
+ \internal
+ \ingroup qt-lighthouse-win
+*/
+
+QWindowsSystemTrayIcon::QWindowsSystemTrayIcon()
+{
+ // For restoring the tray icon after explorer crashes
+ if (!MYWM_TASKBARCREATED)
+ MYWM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated");
+ // Allow the WM_TASKBARCREATED message through the UIPI filter
+ ChangeWindowMessageFilterEx(m_hwnd, MYWM_TASKBARCREATED, MSGFLT_ALLOW, 0);
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << this << "MYWM_TASKBARCREATED=" << MYWM_TASKBARCREATED;
+}
+
+QWindowsSystemTrayIcon::~QWindowsSystemTrayIcon()
+{
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << this;
+ ensureCleanup();
+}
+
+void QWindowsSystemTrayIcon::init()
+{
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << this;
+ ensureInstalled();
+}
+
+void QWindowsSystemTrayIcon::cleanup()
+{
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << this;
+ ensureCleanup();
+}
+
+void QWindowsSystemTrayIcon::updateIcon(const QIcon &icon)
+{
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << '(' << icon << ')' << this;
+ if (icon.cacheKey() == m_icon.cacheKey())
+ return;
+ const HICON hIconToDestroy = createIcon(icon);
+ if (ensureInstalled())
+ sendTrayMessage(NIM_MODIFY);
+ if (hIconToDestroy)
+ DestroyIcon(hIconToDestroy);
+}
+
+void QWindowsSystemTrayIcon::updateToolTip(const QString &tooltip)
+{
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << '(' << tooltip << ')' << this;
+ if (m_toolTip == tooltip)
+ return;
+ m_toolTip = tooltip;
+ if (isInstalled())
+ sendTrayMessage(NIM_MODIFY);
+}
+
+QRect QWindowsSystemTrayIcon::geometry() const
+{
+ NOTIFYICONIDENTIFIER nid;
+ memset(&nid, 0, sizeof(nid));
+ nid.cbSize = sizeof(nid);
+ nid.hWnd = m_hwnd;
+ nid.uID = q_uNOTIFYICONID;
+ RECT rect;
+ const QRect result = SUCCEEDED(Shell_NotifyIconGetRect(&nid, &rect))
+ ? QRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top)
+ : QRect();
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << this << "returns" << result;
+ return result;
+}
+
+void QWindowsSystemTrayIcon::showMessage(const QString &title, const QString &messageIn,
+ const QIcon &icon,
+ QPlatformSystemTrayIcon::MessageIcon iconType,
+ int msecsIn)
+{
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << '(' << title << messageIn << icon
+ << iconType << msecsIn << ')' << this;
+ if (!supportsMessages())
+ return;
+ // For empty messages, ensures that they show when only title is set
+ QString message = messageIn;
+ if (message.isEmpty() && !title.isEmpty())
+ message.append(QLatin1Char(' '));
+
+ NOTIFYICONDATA tnd;
+ initNotifyIconData(tnd);
+ qStringToLimitedWCharArray(message, tnd.szInfo, 256);
+ qStringToLimitedWCharArray(title, tnd.szInfoTitle, 64);
+
+ tnd.uID = q_uNOTIFYICONID;
+ tnd.dwInfoFlags = NIIF_USER;
+
+ QSize size(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
+ const QSize largeIcon(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
+ const QSize more = icon.actualSize(largeIcon);
+ if (more.height() > (largeIcon.height() * 3/4) || more.width() > (largeIcon.width() * 3/4)) {
+ tnd.dwInfoFlags |= NIIF_LARGE_ICON;
+ size = largeIcon;
+ }
+ QPixmap pm = icon.pixmap(size);
+ if (pm.isNull()) {
+ tnd.dwInfoFlags = NIIF_INFO;
+ } else {
+ if (pm.size() != size) {
+ qWarning("QSystemTrayIcon::showMessage: Wrong icon size (%dx%d), please add standard one: %dx%d",
+ pm.size().width(), pm.size().height(), size.width(), size.height());
+ pm = pm.scaled(size, Qt::IgnoreAspectRatio);
+ }
+ tnd.hBalloonIcon = qt_pixmapToWinHICON(pm);
+ }
+ tnd.hWnd = m_hwnd;
+ tnd.uTimeout = msecsIn <= 0 ? UINT(10000) : UINT(msecsIn); // 10s default
+ tnd.uFlags = NIF_INFO | NIF_SHOWTIP;
+
+ Shell_NotifyIcon(NIM_MODIFY, &tnd);
+}
+
+bool QWindowsSystemTrayIcon::supportsMessages() const
+{
+ // The key does typically not exist on Windows 10, default to true.
+ return QWindowsContext::readAdvancedExplorerSettings(L"EnableBalloonTips", 1) != 0;
+}
+
+QPlatformMenu *QWindowsSystemTrayIcon::createMenu() const
+{
+ if (QWindowsTheme::useNativeMenus() && m_menu.isNull())
+ m_menu = new QWindowsPopupMenu;
+ qCDebug(lcQpaTrayIcon) << __FUNCTION__ << this << "returns" << m_menu.data();
+ return m_menu.data();
+}
+
+// Delay-install until an Icon exists
+bool QWindowsSystemTrayIcon::ensureInstalled()
+{
+ if (isInstalled())
+ return true;
+ if (m_hIcon == nullptr)
+ return false;
+ m_hwnd = createTrayIconMessageWindow();
+ if (Q_UNLIKELY(m_hwnd == nullptr))
+ return false;
+ QWindowsHwndSystemTrayIconEntry entry{m_hwnd, this};
+ hwndTrayIconEntries()->append(entry);
+ sendTrayMessage(NIM_ADD);
+ return true;
+}
+
+void QWindowsSystemTrayIcon::ensureCleanup()
+{
+ if (isInstalled()) {
+ const int index = indexOfHwnd(m_hwnd);
+ if (index >= 0)
+ hwndTrayIconEntries()->removeAt(index);
+ sendTrayMessage(NIM_DELETE);
+ DestroyWindow(m_hwnd);
+ m_hwnd = nullptr;
+ }
+ if (m_hIcon != nullptr)
+ DestroyIcon(m_hIcon);
+ m_hIcon = nullptr;
+ m_menu = nullptr; // externally owned
+ m_toolTip.clear();
+}
+
+bool QWindowsSystemTrayIcon::sendTrayMessage(DWORD msg)
+{
+ NOTIFYICONDATA tnd;
+ initNotifyIconData(tnd);
+ tnd.uID = q_uNOTIFYICONID;
+ tnd.hWnd = m_hwnd;
+ tnd.uFlags = NIF_SHOWTIP;
+ if (msg == NIM_ADD || msg == NIM_MODIFY)
+ setIconContents(tnd, m_toolTip, m_hIcon);
+ if (!Shell_NotifyIcon(msg, &tnd))
+ return false;
+ return msg != NIM_ADD || Shell_NotifyIcon(NIM_SETVERSION, &tnd);
+}
+
+// Return the old icon to be freed after modifying the tray icon.
+HICON QWindowsSystemTrayIcon::createIcon(const QIcon &icon)
+{
+ const HICON oldIcon = m_hIcon;
+ m_hIcon = nullptr;
+ if (icon.isNull())
+ return oldIcon;
+ const QSize requestedSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
+ const QSize size = icon.actualSize(requestedSize);
+ const QPixmap pm = icon.pixmap(size);
+ if (!pm.isNull())
+ m_hIcon = qt_pixmapToWinHICON(pm);
+ return oldIcon;
+}
+
+bool QWindowsSystemTrayIcon::winEvent(const MSG &message, long *result)
+{
+ *result = 0;
+ switch (message.message) {
+ case MYWM_NOTIFYICON: {
+ Q_ASSERT(q_uNOTIFYICONID == HIWORD(message.lParam));
+ const int trayMessage = LOWORD(message.lParam);
+ switch (trayMessage) {
+ case NIN_SELECT:
+ case NIN_KEYSELECT:
+ if (m_ignoreNextMouseRelease)
+ m_ignoreNextMouseRelease = false;
+ else
+ emit activated(Trigger);
+ break;
+ case WM_LBUTTONDBLCLK:
+ m_ignoreNextMouseRelease = true; // Since DBLCLICK Generates a second mouse
+ emit activated(DoubleClick); // release we must ignore it
+ break;
+ case WM_CONTEXTMENU: {
+ const QPoint globalPos = QPoint(GET_X_LPARAM(message.wParam), GET_Y_LPARAM(message.wParam));
+ const QPlatformScreen *screen = QWindowsContext::instance()->screenManager().screenAtDp(globalPos);
+ emit contextMenuRequested(globalPos, screen);
+ emit activated(Context);
+ if (m_menu)
+ m_menu->trackPopupMenu(message.hwnd, globalPos.x(), globalPos.y());
+ }
+ break;
+ case NIN_BALLOONUSERCLICK:
+ emit messageClicked();
+ break;
+ case WM_MBUTTONUP:
+ emit activated(MiddleClick);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case WM_INITMENU:
+ case WM_INITMENUPOPUP:
+ QWindowsPopupMenu::notifyAboutToShow(reinterpret_cast<HMENU>(message.wParam));
+ break;
+ case WM_COMMAND:
+ QWindowsPopupMenu::notifyTriggered(LOWORD(message.wParam));
+ break;
+ default:
+ if (message.message == MYWM_TASKBARCREATED) // self-registered message id (tray crashed)
+ sendTrayMessage(NIM_ADD);
+ break;
+ }
+ return false;
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+
+void QWindowsSystemTrayIcon::formatDebug(QDebug &d) const
+{
+ d << static_cast<const void *>(this) << ", \"" << m_toolTip
+ << "\", hwnd=" << m_hwnd << ", m_hIcon=" << m_hIcon << ", menu="
+ << m_menu.data();
+}
+
+QDebug operator<<(QDebug d, const QWindowsSystemTrayIcon *t)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d.noquote();
+ d << "QWindowsSystemTrayIcon(";
+ if (t)
+ t->formatDebug(d);
+ else
+ d << '0';
+ d << ')';
+ return d;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.h b/src/plugins/platforms/windows/qwindowssystemtrayicon.h
new file mode 100644
index 0000000000..1f696180cd
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QWINDOWSSYSTEMTRAYICON_H
+#define QWINDOWSSYSTEMTRAYICON_H
+
+#include <QtGui/qicon.h>
+#include <QtGui/qpa/qplatformsystemtrayicon.h>
+
+#include <QtCore/qpointer.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qt_windows.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDebug;
+
+class QWindowsPopupMenu;
+
+class QWindowsSystemTrayIcon : public QPlatformSystemTrayIcon
+{
+public:
+ QWindowsSystemTrayIcon();
+ ~QWindowsSystemTrayIcon();
+
+ void init() override;
+ void cleanup() override;
+ void updateIcon(const QIcon &icon) override;
+ void updateToolTip(const QString &tooltip) override;
+ void updateMenu(QPlatformMenu *) override {}
+ QRect geometry() const override;
+ void showMessage(const QString &title, const QString &msg,
+ const QIcon &icon, MessageIcon iconType, int msecs) override;
+
+ bool isSystemTrayAvailable() const override { return true; }
+ bool supportsMessages() const override;
+
+ QPlatformMenu *createMenu() const override;
+
+ bool winEvent(const MSG &message, long *result);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const;
+#endif
+
+private:
+ bool isInstalled() const { return m_hwnd != nullptr; }
+ bool ensureInstalled();
+ void ensureCleanup();
+ bool sendTrayMessage(DWORD msg);
+ HICON createIcon(const QIcon &icon);
+
+ QIcon m_icon;
+ QString m_toolTip;
+ HWND m_hwnd = nullptr;
+ HICON m_hIcon = nullptr;
+ mutable QPointer<QWindowsPopupMenu> m_menu;
+ bool m_ignoreNextMouseRelease = false;
+};
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const QWindowsSystemTrayIcon *);
+#endif // !QT_NO_DEBUG_STREAM
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSSYSTEMTRAYICON_H
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 7e1017426f..b1f0062979 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -463,13 +463,13 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
// Z = sin(altitude)
// X Tilt = arctan(X / Z)
// Y Tilt = arctan(Y / Z)
- const double radAzim = (packet.pkOrientation.orAzimuth / 10.0) * (M_PI / 180);
- const double tanAlt = std::tan((std::abs(packet.pkOrientation.orAltitude / 10.0)) * (M_PI / 180));
+ const double radAzim = qDegreesToRadians(packet.pkOrientation.orAzimuth / 10.0);
+ const double tanAlt = std::tan(qDegreesToRadians(std::abs(packet.pkOrientation.orAltitude / 10.0)));
- const double degX = std::atan(std::sin(radAzim) / tanAlt);
- const double degY = std::atan(std::cos(radAzim) / tanAlt);
- tiltX = int(degX * (180 / M_PI));
- tiltY = int(-degY * (180 / M_PI));
+ const double radX = std::atan(std::sin(radAzim) / tanAlt);
+ const double radY = std::atan(std::cos(radAzim) / tanAlt);
+ tiltX = int(qRadiansToDegrees(radX));
+ tiltY = int(qRadiansToDegrees(-radY));
rotation = 360.0 - (packet.pkOrientation.orTwist / 10.0);
if (rotation > 180.0)
rotation -= 360.0;
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 7916211219..a1ccf1f83c 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -44,9 +44,13 @@
#endif
#include "qwindowstheme.h"
+#include "qwindowsmenu.h"
#include "qwindowsdialoghelpers.h"
#include "qwindowscontext.h"
#include "qwindowsintegration.h"
+#if QT_CONFIG(systemtrayicon)
+# include "qwindowssystemtrayicon.h"
+#endif
#include "qt_windows.h"
#include <commctrl.h>
#include <objbase.h>
@@ -415,13 +419,7 @@ static inline QStringList iconThemeSearchPaths()
static inline QStringList styleNames()
{
- QStringList result;
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
- result.append(QStringLiteral("WindowsVista"));
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP)
- result.append(QStringLiteral("WindowsXP"));
- result.append(QStringLiteral("Windows"));
- return result;
+ return { QStringLiteral("WindowsVista"), QStringLiteral("Windows") };
}
static inline int uiEffects()
@@ -554,6 +552,13 @@ QPlatformDialogHelper *QWindowsTheme::createPlatformDialogHelper(DialogType type
return QWindowsDialogs::createHelper(type);
}
+#if QT_CONFIG(systemtrayicon)
+QPlatformSystemTrayIcon *QWindowsTheme::createPlatformSystemTrayIcon() const
+{
+ return new QWindowsSystemTrayIcon;
+}
+#endif
+
void QWindowsTheme::windowsThemeChanged(QWindow * window)
{
refresh();
@@ -922,4 +927,55 @@ QIcon QWindowsTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOpt
return QIcon(new QWindowsFileIconEngine(fileInfo, iconOptions));
}
+static inline bool doUseNativeMenus()
+{
+ const unsigned options = QWindowsIntegration::instance()->options();
+ if ((options & QWindowsIntegration::NoNativeMenus) != 0)
+ return false;
+ if ((options & QWindowsIntegration::AlwaysUseNativeMenus) != 0)
+ return true;
+ // "Auto" mode: For non-widget or Quick Controls 2 applications
+ if (!QCoreApplication::instance()->inherits("QApplication"))
+ return true;
+ const QWindowList &topLevels = QGuiApplication::topLevelWindows();
+ for (const QWindow *t : topLevels) {
+ if (t->inherits("QQuickApplicationWindow"))
+ return true;
+ }
+ return false;
+}
+
+bool QWindowsTheme::useNativeMenus()
+{
+ static const bool result = doUseNativeMenus();
+ return result;
+}
+
+QPlatformMenuItem *QWindowsTheme::createPlatformMenuItem() const
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__;
+ return QWindowsTheme::useNativeMenus() ? new QWindowsMenuItem : nullptr;
+}
+
+QPlatformMenu *QWindowsTheme::createPlatformMenu() const
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__;
+ // We create a popup menu here, since it will likely be used as context
+ // menu. Submenus should be created the factory functions of
+ // QPlatformMenu/Bar. Note though that Quick Controls 1 will use this
+ // function for submenus as well, but this has been found to work.
+ return QWindowsTheme::useNativeMenus() ? new QWindowsPopupMenu : nullptr;
+}
+
+QPlatformMenuBar *QWindowsTheme::createPlatformMenuBar() const
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__;
+ return QWindowsTheme::useNativeMenus() ? new QWindowsMenuBar : nullptr;
+}
+
+void QWindowsTheme::showPlatformMenuBar()
+{
+ qCDebug(lcQpaMenus) << __FUNCTION__;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h
index a3019ff6eb..237e8158fa 100644
--- a/src/plugins/platforms/windows/qwindowstheme.h
+++ b/src/plugins/platforms/windows/qwindowstheme.h
@@ -59,6 +59,9 @@ public:
bool usePlatformNativeDialog(DialogType type) const override;
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
+#if QT_CONFIG(systemtrayicon)
+ QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
+#endif
QVariant themeHint(ThemeHint) const override;
const QPalette *palette(Palette type = SystemPalette) const override
{ return m_palettes[type]; }
@@ -74,6 +77,13 @@ public:
QList<QSize> availableFileIconSizes() const { return m_fileIconSizes; }
+ QPlatformMenuItem *createPlatformMenuItem() const override;
+ QPlatformMenu *createPlatformMenu() const override;
+ QPlatformMenuBar *createPlatformMenuBar() const override;
+ void showPlatformMenuBar() override;
+
+ static bool useNativeMenus();
+
static const char *name;
private:
diff --git a/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp b/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp
new file mode 100644
index 0000000000..d81ee8ba29
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 "qwindowsvulkaninstance.h"
+
+QT_BEGIN_NAMESPACE
+
+QWindowsVulkanInstance::QWindowsVulkanInstance(QVulkanInstance *instance)
+ : m_instance(instance),
+ m_getPhysDevPresSupport(nullptr),
+ m_createSurface(nullptr),
+ m_destroySurface(nullptr)
+{
+ if (qEnvironmentVariableIsSet("QT_VULKAN_LIB"))
+ m_lib.setFileName(QString::fromUtf8(qgetenv("QT_VULKAN_LIB")));
+ else
+ m_lib.setFileName(QStringLiteral("vulkan-1"));
+
+ if (!m_lib.load()) {
+ qWarning("Failed to load %s: %s", qPrintable(m_lib.fileName()), qPrintable(m_lib.errorString()));
+ return;
+ }
+
+ init(&m_lib);
+}
+
+void QWindowsVulkanInstance::createOrAdoptInstance()
+{
+ initInstance(m_instance, QByteArrayList() << QByteArrayLiteral("VK_KHR_win32_surface"));
+
+ if (!m_vkInst)
+ return;
+
+ m_getPhysDevPresSupport = reinterpret_cast<PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkGetPhysicalDeviceWin32PresentationSupportKHR"));
+ if (!m_getPhysDevPresSupport)
+ qWarning("Failed to find vkGetPhysicalDeviceWin32PresentationSupportKHR");
+}
+
+QWindowsVulkanInstance::~QWindowsVulkanInstance()
+{
+}
+
+bool QWindowsVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice,
+ uint32_t queueFamilyIndex,
+ QWindow *window)
+{
+ if (!m_getPhysDevPresSupport || !m_getPhysDevSurfaceSupport)
+ return true;
+
+ bool ok = m_getPhysDevPresSupport(physicalDevice, queueFamilyIndex);
+
+ VkSurfaceKHR surface = QVulkanInstance::surfaceForWindow(window);
+ VkBool32 supported = false;
+ m_getPhysDevSurfaceSupport(physicalDevice, queueFamilyIndex, surface, &supported);
+ ok &= bool(supported);
+
+ return ok;
+}
+
+VkSurfaceKHR QWindowsVulkanInstance::createSurface(HWND win)
+{
+ VkSurfaceKHR surface = 0;
+
+ if (!m_createSurface) {
+ m_createSurface = reinterpret_cast<PFN_vkCreateWin32SurfaceKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkCreateWin32SurfaceKHR"));
+ }
+ if (!m_createSurface) {
+ qWarning("Failed to find vkCreateWin32SurfaceKHR");
+ return surface;
+ }
+ if (!m_destroySurface) {
+ m_destroySurface = reinterpret_cast<PFN_vkDestroySurfaceKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkDestroySurfaceKHR"));
+ }
+ if (!m_destroySurface) {
+ qWarning("Failed to find vkDestroySurfaceKHR");
+ return surface;
+ }
+
+ VkWin32SurfaceCreateInfoKHR surfaceInfo;
+ memset(&surfaceInfo, 0, sizeof(surfaceInfo));
+ surfaceInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
+ surfaceInfo.hinstance = GetModuleHandle(nullptr);
+ surfaceInfo.hwnd = win;
+ VkResult err = m_createSurface(m_vkInst, &surfaceInfo, nullptr, &surface);
+ if (err != VK_SUCCESS)
+ qWarning("Failed to create Vulkan surface: %d", err);
+
+ return surface;
+}
+
+void QWindowsVulkanInstance::destroySurface(VkSurfaceKHR surface)
+{
+ if (m_destroySurface && surface)
+ m_destroySurface(m_vkInst, surface, nullptr);
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsvulkaninstance.h b/src/plugins/platforms/windows/qwindowsvulkaninstance.h
new file mode 100644
index 0000000000..ca60ab7627
--- /dev/null
+++ b/src/plugins/platforms/windows/qwindowsvulkaninstance.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 QWINDOWSVULKANINSTANCE_H
+#define QWINDOWSVULKANINSTANCE_H
+
+#if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_WIN32_KHR)
+#error "vulkan.h included without Win32 WSI"
+#endif
+
+#define VK_USE_PLATFORM_WIN32_KHR
+
+#include <QtVulkanSupport/private/qbasicvulkanplatforminstance_p.h>
+#include <QLibrary>
+
+QT_BEGIN_NAMESPACE
+
+class QWindowsVulkanInstance : public QBasicPlatformVulkanInstance
+{
+public:
+ QWindowsVulkanInstance(QVulkanInstance *instance);
+ ~QWindowsVulkanInstance();
+
+ void createOrAdoptInstance() override;
+ bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override;
+
+ VkSurfaceKHR createSurface(HWND win);
+ void destroySurface(VkSurfaceKHR surface);
+
+private:
+ QVulkanInstance *m_instance;
+ QLibrary m_lib;
+ PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR m_getPhysDevPresSupport;
+ PFN_vkCreateWin32SurfaceKHR m_createSurface;
+ PFN_vkDestroySurfaceKHR m_destroySurface;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSVULKANINSTANCE_H
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 5e0fd77776..3f417fde27 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -44,6 +44,7 @@
#endif
#include "qwindowsscreen.h"
#include "qwindowsintegration.h"
+#include "qwindowsmenu.h"
#include "qwindowsnativeinterface.h"
#if QT_CONFIG(dynamicgl)
# include "qwindowsglcontext.h"
@@ -69,8 +70,14 @@
#include <dwmapi.h>
+#if QT_CONFIG(vulkan)
+#include "qwindowsvulkaninstance.h"
+#endif
+
QT_BEGIN_NAMESPACE
+typedef QSharedPointer<QWindowCreationContext> QWindowCreationContextPtr;
+
enum {
defaultWindowWidth = 160,
defaultWindowHeight = 160
@@ -226,6 +233,23 @@ QDebug operator<<(QDebug d, const WINDOWPLACEMENT &wp)
<< ", rcNormalPosition=" << wp.rcNormalPosition;
return d;
}
+
+QDebug operator<<(QDebug d, const GUID &guid)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << '{' << hex << uppercasedigits << qSetPadChar(QLatin1Char('0'))
+ << qSetFieldWidth(8) << guid.Data1
+ << qSetFieldWidth(0) << '-' << qSetFieldWidth(4)
+ << guid.Data2 << qSetFieldWidth(0) << '-' << qSetFieldWidth(4)
+ << guid.Data3 << qSetFieldWidth(0) << '-' << qSetFieldWidth(4)
+ << qSetFieldWidth(2) << guid.Data4[0] << guid.Data4[1]
+ << qSetFieldWidth(0) << '-' << qSetFieldWidth(2);
+ for (int i = 2; i < 8; ++i)
+ d << guid.Data4[i];
+ d << qSetFieldWidth(0) << '}';
+ return d;
+}
#endif // !QT_NO_DEBUG_STREAM
// QTBUG-43872, for windows that do not have WS_EX_TOOLWINDOW set, WINDOWPLACEMENT
@@ -293,13 +317,15 @@ static QWindow::Visibility windowVisibility_sys(HWND hwnd)
return QWindow::Windowed;
}
-static inline bool windowIsOpenGL(const QWindow *w)
+static inline bool windowIsAccelerated(const QWindow *w)
{
switch (w->surfaceType()) {
case QSurface::OpenGLSurface:
return true;
case QSurface::RasterGLSurface:
return qt_window_private(const_cast<QWindow *>(w))->compositing;
+ case QSurface::VulkanSurface:
+ return true;
default:
return false;
}
@@ -360,11 +386,11 @@ bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool has
return needsLayered;
}
-static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool openGL, qreal level)
+static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool accelerated, qreal level)
{
if (QWindowsWindow::setWindowLayered(hwnd, flags, hasAlpha, level)) {
const BYTE alpha = BYTE(qRound(255.0 * level));
- if (hasAlpha && !openGL && (flags & Qt::FramelessWindowHint)) {
+ if (hasAlpha && !accelerated && (flags & Qt::FramelessWindowHint)) {
// Non-GL windows with alpha: Use blend function to update.
BLENDFUNCTION blend = {AC_SRC_OVER, 0, alpha, AC_SRC_ALPHA};
UpdateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA);
@@ -378,13 +404,13 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bo
static inline void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::WindowFlags flags, qreal opacity)
{
- const bool isGL = windowIsOpenGL(w);
+ const bool isAccelerated = windowIsAccelerated(w);
const bool hasAlpha = w->format().hasAlpha();
- if (isGL && hasAlpha)
+ if (isAccelerated && hasAlpha)
applyBlurBehindWindow(hwnd);
- setWindowOpacity(hwnd, flags, hasAlpha, isGL, opacity);
+ setWindowOpacity(hwnd, flags, hasAlpha, isAccelerated, opacity);
}
/*!
@@ -597,8 +623,6 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
QWindowsWindowData
WindowCreationData::create(const QWindow *w, const WindowData &data, QString title) const
{
- typedef QSharedPointer<QWindowCreationContext> QWindowCreationContextPtr;
-
WindowData result;
result.flags = flags;
@@ -616,7 +640,7 @@ QWindowsWindowData
// Capture events before CreateWindowEx() returns. The context is cleared in
// the QWindowsWindow constructor.
- const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle));
+ const QWindowCreationContextPtr context(new QWindowCreationContext(w, data.geometry, rect, data.customMargins, style, exStyle));
QWindowsContext::instance()->setWindowCreationContext(context);
qCDebug(lcQpaWindows).nospace()
@@ -982,10 +1006,11 @@ void QWindowsForeignWindow::setVisible(bool visible)
*/
QWindowCreationContext::QWindowCreationContext(const QWindow *w,
- const QRect &geometry,
+ const QRect &geometryIn, const QRect &geometry,
const QMargins &cm,
DWORD style_, DWORD exStyle_) :
geometryHint(w, cm), window(w), style(style_), exStyle(exStyle_),
+ requestedGeometryIn(geometryIn),
requestedGeometry(geometry), obtainedGeometry(geometry),
margins(QWindowsGeometryHint::frame(style, exStyle)), customMargins(cm)
{
@@ -999,6 +1024,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
const QMargins effectiveMargins = margins + customMargins;
frameWidth = effectiveMargins.left() + geometry.width() + effectiveMargins.right();
frameHeight = effectiveMargins.top() + geometry.height() + effectiveMargins.bottom();
+ if (QWindowsMenuBar::menuBarOf(w) != nullptr)
+ frameHeight += GetSystemMetrics(SM_CYMENU);
const bool isDefaultPosition = !frameX && !frameY && w->isTopLevel();
if (!QWindowsGeometryHint::positionIncludesFrame(w) && !isDefaultPosition) {
frameX -= effectiveMargins.left();
@@ -1044,9 +1071,10 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
m_data(data),
m_cursor(new CursorHandle),
m_format(aWindow->requestedFormat())
+#if QT_CONFIG(vulkan)
+ , m_vkSurface(0)
+#endif
{
- // Clear the creation context as the window can be found in QWindowsContext's map.
- QWindowsContext::instance()->setWindowCreationContext(QSharedPointer<QWindowCreationContext>());
QWindowsContext::instance()->addWindow(m_data.hwnd, this);
const Qt::WindowType type = aWindow->type();
if (type == Qt::Desktop)
@@ -1059,13 +1087,20 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
setFlag(OpenGL_ES2);
}
#endif // QT_NO_OPENGL
+#if QT_CONFIG(vulkan)
+ if (aWindow->surfaceType() == QSurface::VulkanSurface)
+ setFlag(VulkanSurface);
+#endif
updateDropSite(window()->isTopLevel());
registerTouchWindow();
- setWindowState(aWindow->windowState());
+ setWindowState(aWindow->windowStates());
const qreal opacity = qt_window_private(aWindow)->opacity;
if (!qFuzzyCompare(opacity, qreal(1.0)))
setOpacity(opacity);
+
+ setMask(QHighDpi::toNativeLocalRegion(window()->mask(), window()));
+
if (aWindow->isTopLevel())
setWindowIcon(aWindow->icon());
clearFlag(WithinCreate);
@@ -1080,6 +1115,27 @@ QWindowsWindow::~QWindowsWindow()
destroyIcon();
}
+void QWindowsWindow::initialize()
+{
+ // Clear the creation context as the window can be found in QWindowsContext's map.
+ QWindowCreationContextPtr creationContext =
+ QWindowsContext::instance()->setWindowCreationContext(QWindowCreationContextPtr());
+
+ // Trigger geometry change (unless it has a special state in which case setWindowState()
+ // will send the message) and screen change signals of QWindow.
+ QWindow *w = window();
+ if (w->type() != Qt::Desktop) {
+ const Qt::WindowState state = w->windowState();
+ if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen
+ && creationContext->requestedGeometryIn != creationContext->obtainedGeometry) {
+ QWindowSystemInterface::handleGeometryChange(w, creationContext->obtainedGeometry);
+ }
+ QPlatformScreen *obtainedScreen = screenForGeometry(creationContext->obtainedGeometry);
+ if (obtainedScreen && screen() != obtainedScreen)
+ QWindowSystemInterface::handleWindowScreenChanged(w, obtainedScreen->screen());
+ }
+}
+
void QWindowsWindow::fireExpose(const QRegion &region, bool force)
{
if (region.isEmpty() && !force)
@@ -1112,6 +1168,14 @@ void QWindowsWindow::destroyWindow()
if (hasMouseCapture())
setMouseGrabEnabled(false);
setDropSiteEnabled(false);
+#if QT_CONFIG(vulkan)
+ if (m_vkSurface) {
+ QVulkanInstance *inst = window()->vulkanInstance();
+ if (inst)
+ static_cast<QWindowsVulkanInstance *>(inst->handle())->destroySurface(m_vkSurface);
+ m_vkSurface = 0;
+ }
+#endif
#ifndef QT_NO_OPENGL
if (m_surface) {
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
@@ -1329,20 +1393,48 @@ static inline bool testShowWithoutActivating(const QWindow *window)
return showWithoutActivating.isValid() && showWithoutActivating.toBool();
}
+static void setMinimizedGeometry(HWND hwnd, const QRect &r)
+{
+ WINDOWPLACEMENT windowPlacement;
+ windowPlacement.length = sizeof(WINDOWPLACEMENT);
+ if (GetWindowPlacement(hwnd, &windowPlacement)) {
+ windowPlacement.showCmd = SW_SHOWMINIMIZED;
+ windowPlacement.rcNormalPosition = RECTfromQRect(r);
+ SetWindowPlacement(hwnd, &windowPlacement);
+ }
+}
+
+static void setRestoreMaximizedFlag(HWND hwnd, bool set = true)
+{
+ // Let Windows know that we need to restore as maximized
+ WINDOWPLACEMENT windowPlacement;
+ windowPlacement.length = sizeof(WINDOWPLACEMENT);
+ if (GetWindowPlacement(hwnd, &windowPlacement)) {
+ if (set)
+ windowPlacement.flags |= WPF_RESTORETOMAXIMIZED;
+ else
+ windowPlacement.flags &= ~WPF_RESTORETOMAXIMIZED;
+ SetWindowPlacement(hwnd, &windowPlacement);
+ }
+}
+
// partially from QWidgetPrivate::show_sys()
void QWindowsWindow::show_sys() const
{
int sm = SW_SHOWNORMAL;
bool fakedMaximize = false;
+ bool restoreMaximize = false;
const QWindow *w = window();
const Qt::WindowFlags flags = w->flags();
const Qt::WindowType type = w->type();
if (w->isTopLevel()) {
- const Qt::WindowState state = w->windowState();
+ const Qt::WindowStates state = w->windowStates();
if (state & Qt::WindowMinimized) {
sm = SW_SHOWMINIMIZED;
if (!isVisible())
sm = SW_SHOWMINNOACTIVE;
+ if (state & Qt::WindowMaximized)
+ restoreMaximize = true;
} else {
updateTransientParent();
if (state & Qt::WindowMaximized) {
@@ -1363,7 +1455,7 @@ void QWindowsWindow::show_sys() const
if (type == Qt::Popup || type == Qt::ToolTip || type == Qt::Tool || testShowWithoutActivating(w))
sm = SW_SHOWNOACTIVATE;
- if (w->windowState() & Qt::WindowMaximized)
+ if (w->windowStates() & Qt::WindowMaximized)
setFlag(WithinMaximize); // QTBUG-8361
ShowWindow(m_data.hwnd, sm);
@@ -1376,6 +1468,8 @@ void QWindowsWindow::show_sys() const
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER
| SWP_FRAMECHANGED);
}
+ if (restoreMaximize)
+ setRestoreMaximizedFlag(m_data.hwnd);
}
void QWindowsWindow::setParent(const QPlatformWindow *newParent)
@@ -1431,8 +1525,10 @@ void QWindowsWindow::handleHidden()
void QWindowsWindow::handleCompositionSettingsChanged()
{
const QWindow *w = window();
- if (w->surfaceType() == QWindow::OpenGLSurface && w->format().hasAlpha())
+ if ((w->surfaceType() == QWindow::OpenGLSurface || w->surfaceType() == QWindow::VulkanSurface)
+ && w->format().hasAlpha()) {
applyBlurBehindWindow(handle());
+ }
}
static QRect normalFrameGeometry(HWND hwnd)
@@ -1449,7 +1545,8 @@ static QRect normalFrameGeometry(HWND hwnd)
QRect QWindowsWindow::normalGeometry() const
{
// Check for fake 'fullscreen' mode.
- const bool fakeFullScreen = m_savedFrameGeometry.isValid() && window()->windowState() == Qt::WindowFullScreen;
+ const bool fakeFullScreen =
+ m_savedFrameGeometry.isValid() && (window()->windowStates() & Qt::WindowFullScreen);
const QRect frame = fakeFullScreen ? m_savedFrameGeometry : normalFrameGeometry(m_data.hwnd);
const QMargins margins = fakeFullScreen ? QWindowsGeometryHint::frame(m_savedStyle, 0) : frameMargins();
return frame.isValid() ? frame.marginsRemoved(margins) : frame;
@@ -1464,13 +1561,15 @@ void QWindowsWindow::setGeometry(const QRect &rectIn)
const QMargins margins = frameMargins();
rect.moveTopLeft(rect.topLeft() + QPoint(margins.left(), margins.top()));
}
- if (m_windowState == Qt::WindowMinimized)
+ if (m_windowState & Qt::WindowMinimized)
m_data.geometry = rect; // Otherwise set by handleGeometryChange() triggered by event.
if (m_data.hwnd) {
// A ResizeEvent with resulting geometry will be sent. If we cannot
// achieve that size (for example, window title minimal constraint),
// notify and warn.
+ setFlag(WithinSetGeometry);
setGeometry_sys(rect);
+ clearFlag(WithinSetGeometry);
if (m_data.geometry != rect) {
qWarning("%s: Unable to set geometry %dx%d+%d+%d on %s/'%s'."
" Resulting geometry: %dx%d+%d+%d "
@@ -1507,18 +1606,21 @@ void QWindowsWindow::handleResized(int wParam)
case SIZE_MAXSHOW:
return;
case SIZE_MINIMIZED: // QTBUG-53577, prevent state change events during programmatic state change
- if (!testFlag(WithinSetStyle))
- handleWindowStateChange(Qt::WindowMinimized);
+ if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry))
+ handleWindowStateChange(m_windowState | Qt::WindowMinimized);
return;
case SIZE_MAXIMIZED:
- if (!testFlag(WithinSetStyle))
- handleWindowStateChange(Qt::WindowMaximized);
+ if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry))
+ handleWindowStateChange(Qt::WindowMaximized | (isFullScreen_sys() ? Qt::WindowFullScreen
+ : Qt::WindowNoState));
handleGeometryChange();
break;
case SIZE_RESTORED:
- if (!testFlag(WithinSetStyle)) {
+ if (!testFlag(WithinSetStyle) && !testFlag(WithinSetGeometry)) {
if (isFullScreen_sys())
- handleWindowStateChange(Qt::WindowFullScreen);
+ handleWindowStateChange(
+ Qt::WindowFullScreen
+ | (testFlag(MaximizeToFullScreen) ? Qt::WindowMaximized : Qt::WindowNoState));
else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
handleWindowStateChange(Qt::WindowNoState);
}
@@ -1531,7 +1633,6 @@ void QWindowsWindow::handleGeometryChange()
{
const QRect previousGeometry = m_data.geometry;
m_data.geometry = geometry_sys();
- QPlatformWindow::setGeometry(m_data.geometry);
QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry);
// QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive
// expose events when shrinking, synthesize.
@@ -1653,8 +1754,11 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
BeginPaint(hwnd, &ps);
// Observed painting problems with Aero style disabled (QTBUG-7865).
- if (Q_UNLIKELY(testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered) && !dwmIsCompositionEnabled()))
+ if (Q_UNLIKELY(!dwmIsCompositionEnabled())
+ && ((testFlag(OpenGLSurface) && testFlag(OpenGLDoubleBuffered)) || testFlag(VulkanSurface)))
+ {
SelectClipRgn(ps.hdc, NULL);
+ }
// If the a window is obscured by another window (such as a child window)
// we still need to send isExposed=true, for compatibility.
@@ -1710,20 +1814,16 @@ QWindowsWindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
return result;
}
-void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
+void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window()
<< "\n from " << m_windowState << " to " << state;
m_windowState = state;
QWindowSystemInterface::handleWindowStateChanged(window(), state);
- switch (state) {
- case Qt::WindowMinimized:
+ if (state & Qt::WindowMinimized) {
handleHidden();
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); // Tell QQuickWindow to stop rendering now.
- break;
- case Qt::WindowMaximized:
- case Qt::WindowFullScreen:
- case Qt::WindowNoState: {
+ } else {
// QTBUG-17548: We send expose events when receiving WM_Paint, but for
// layered windows and transient children, we won't receive any WM_Paint.
QWindow *w = window();
@@ -1744,13 +1844,9 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
if (exposeEventsSent && !QWindowsContext::instance()->asyncExpose())
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
}
- break;
- default:
- break;
- }
}
-void QWindowsWindow::setWindowState(Qt::WindowState state)
+void QWindowsWindow::setWindowState(Qt::WindowStates state)
{
if (m_data.hwnd) {
setWindowState_sys(state);
@@ -1781,18 +1877,19 @@ bool QWindowsWindow::isFullScreen_sys() const
to ShowWindow.
*/
-void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
+void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState)
{
- const Qt::WindowState oldState = m_windowState;
+ const Qt::WindowStates oldState = m_windowState;
if (oldState == newState)
return;
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window()
<< " from " << oldState << " to " << newState;
const bool visible = isVisible();
+ auto stateChange = oldState ^ newState;
- if ((oldState == Qt::WindowFullScreen) != (newState == Qt::WindowFullScreen)) {
- if (newState == Qt::WindowFullScreen) {
+ if (stateChange & Qt::WindowFullScreen) {
+ if (newState & Qt::WindowFullScreen) {
#ifndef Q_FLATTEN_EXPOSE
UINT newStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP;
#else
@@ -1803,7 +1900,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
// Window state but emulated by changing geometry and style.
if (!m_savedStyle) {
m_savedStyle = style();
- if (oldState == Qt::WindowMinimized || oldState == Qt::WindowMaximized) {
+ if ((oldState & Qt::WindowMinimized) || (oldState & Qt::WindowMaximized)) {
const QRect nf = normalFrameGeometry(m_data.hwnd);
if (nf.isValid())
m_savedFrameGeometry = nf;
@@ -1811,6 +1908,8 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
m_savedFrameGeometry = frameGeometry_sys();
}
}
+ if (newState & Qt::WindowMaximized)
+ setFlag(MaximizeToFullScreen);
if (m_savedStyle & WS_SYSMENU)
newStyle |= WS_SYSMENU;
if (visible)
@@ -1824,15 +1923,23 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
if (!screen)
screen = QGuiApplication::primaryScreen();
const QRect r = screen ? QHighDpi::toNativePixels(screen->geometry(), window()) : m_savedFrameGeometry;
- const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE;
- const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
- setFlag(SynchronousGeometryChangeEvent);
- SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf);
- if (!wasSync)
- clearFlag(SynchronousGeometryChangeEvent);
- QWindowSystemInterface::handleGeometryChange(window(), r);
- QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
- } else if (newState != Qt::WindowMinimized) {
+
+ if (newState & Qt::WindowMinimized) {
+ setMinimizedGeometry(m_data.hwnd, r);
+ if (stateChange & Qt::WindowMaximized)
+ setRestoreMaximizedFlag(m_data.hwnd, newState & Qt::WindowMaximized);
+ } else {
+ const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE;
+ const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
+ setFlag(SynchronousGeometryChangeEvent);
+ SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf);
+ if (!wasSync)
+ clearFlag(SynchronousGeometryChangeEvent);
+ clearFlag(MaximizeToFullScreen);
+ QWindowSystemInterface::handleGeometryChange(window(), r);
+ QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
+ }
+ } else {
// Restore saved state.
unsigned newStyle = m_savedStyle ? m_savedStyle : style();
if (visible)
@@ -1846,43 +1953,58 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
if (!screen->geometry().intersects(m_savedFrameGeometry))
m_savedFrameGeometry.moveTo(screen->geometry().topLeft());
- UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE;
- if (!m_savedFrameGeometry.isValid())
- swpf |= SWP_NOSIZE | SWP_NOMOVE;
- const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
- setFlag(SynchronousGeometryChangeEvent);
- // After maximized/fullscreen; the window can be in a maximized state. Clear
- // it before applying the normal geometry.
- if (windowVisibility_sys(m_data.hwnd) == QWindow::Maximized)
- ShowWindow(m_data.hwnd, SW_SHOWNOACTIVATE);
- SetWindowPos(m_data.hwnd, 0, m_savedFrameGeometry.x(), m_savedFrameGeometry.y(),
- m_savedFrameGeometry.width(), m_savedFrameGeometry.height(), swpf);
- if (!wasSync)
- clearFlag(SynchronousGeometryChangeEvent);
- // preserve maximized state
- if (visible) {
- setFlag(WithinMaximize);
- ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNA);
- clearFlag(WithinMaximize);
+ if (newState & Qt::WindowMinimized) {
+ setMinimizedGeometry(m_data.hwnd, m_savedFrameGeometry);
+ if (stateChange & Qt::WindowMaximized)
+ setRestoreMaximizedFlag(m_data.hwnd, newState & Qt::WindowMaximized);
+ } else {
+ UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE;
+ if (!m_savedFrameGeometry.isValid())
+ swpf |= SWP_NOSIZE | SWP_NOMOVE;
+ const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
+ setFlag(SynchronousGeometryChangeEvent);
+ // After maximized/fullscreen; the window can be in a maximized state. Clear
+ // it before applying the normal geometry.
+ if (windowVisibility_sys(m_data.hwnd) == QWindow::Maximized)
+ ShowWindow(m_data.hwnd, SW_SHOWNOACTIVATE);
+ SetWindowPos(m_data.hwnd, 0, m_savedFrameGeometry.x(), m_savedFrameGeometry.y(),
+ m_savedFrameGeometry.width(), m_savedFrameGeometry.height(), swpf);
+ if (!wasSync)
+ clearFlag(SynchronousGeometryChangeEvent);
+ // preserve maximized state
+ if (visible) {
+ setFlag(WithinMaximize);
+ ShowWindow(m_data.hwnd,
+ (newState & Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNA);
+ clearFlag(WithinMaximize);
+ }
}
m_savedStyle = 0;
m_savedFrameGeometry = QRect();
}
- } else if ((oldState == Qt::WindowMaximized) != (newState == Qt::WindowMaximized)) {
- if (visible && !(newState == Qt::WindowMinimized)) {
+ } else if ((oldState & Qt::WindowMaximized) != (newState & Qt::WindowMaximized)) {
+ if (visible && !(newState & Qt::WindowMinimized)) {
setFlag(WithinMaximize);
- if (newState == Qt::WindowFullScreen)
+ if (newState & Qt::WindowFullScreen)
setFlag(MaximizeToFullScreen);
- ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
+ ShowWindow(m_data.hwnd,
+ (newState & Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
clearFlag(WithinMaximize);
clearFlag(MaximizeToFullScreen);
+ } else if (visible && (oldState & newState & Qt::WindowMinimized)) {
+ // change of the maximized state while keeping minimized
+ setRestoreMaximizedFlag(m_data.hwnd, newState & Qt::WindowMaximized);
}
}
- if ((oldState == Qt::WindowMinimized) != (newState == Qt::WindowMinimized)) {
- if (visible)
- ShowWindow(m_data.hwnd, (newState == Qt::WindowMinimized) ? SW_MINIMIZE :
- (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNORMAL);
+ if (stateChange & Qt::WindowMinimized) {
+ if (visible) {
+ ShowWindow(m_data.hwnd,
+ (newState & Qt::WindowMinimized) ? SW_MINIMIZE :
+ (newState & Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNORMAL);
+ if ((newState & Qt::WindowMinimized) && (stateChange & Qt::WindowMaximized))
+ setRestoreMaximizedFlag(m_data.hwnd, newState & Qt::WindowMaximized);
+ }
}
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << this << window() << newState;
}
@@ -1974,7 +2096,7 @@ void QWindowsWindow::setOpacity(qreal level)
m_opacity = level;
if (m_data.hwnd)
setWindowOpacity(m_data.hwnd, m_data.flags,
- window()->format().hasAlpha(), testFlag(OpenGLSurface),
+ window()->format().hasAlpha(), testFlag(OpenGLSurface) || testFlag(VulkanSurface),
level);
}
}
@@ -2143,7 +2265,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
hint.applyToMinMaxInfo(m_data.hwnd, mmi);
}
- if ((testFlag(WithinMaximize) || (window()->windowState() == Qt::WindowMinimized))
+ if ((testFlag(WithinMaximize) || (window()->windowStates() & Qt::WindowMinimized))
&& (m_data.flags & Qt::FramelessWindowHint)) {
// This block fixes QTBUG-8361: Frameless windows shouldn't cover the
// taskbar when maximized
@@ -2173,7 +2295,7 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
// QTBUG-32663, suppress resize cursor for fixed size windows.
const QWindow *w = window();
if (!w->isTopLevel() // Task 105852, minimized windows need to respond to user input.
- || (m_windowState != Qt::WindowNoState && m_windowState != Qt::WindowActive)
+ || !(m_windowState & ~Qt::WindowActive)
|| (m_data.flags & Qt::FramelessWindowHint)) {
return false;
}
@@ -2364,6 +2486,16 @@ bool QWindowsWindow::isTopLevel() const
return window()->isTopLevel() && !m_data.embedded;
}
+QWindowsMenuBar *QWindowsWindow::menuBar() const
+{
+ return m_menuBar.data();
+}
+
+void QWindowsWindow::setMenuBar(QWindowsMenuBar *mb)
+{
+ m_menuBar = mb;
+}
+
/*!
\brief Sets custom margins to be added to the default margins determined by
the windows style in the handling of the WM_NCCALCSIZE message.
@@ -2392,11 +2524,27 @@ void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
void *QWindowsWindow::surface(void *nativeConfig, int *err)
{
-#ifdef QT_NO_OPENGL
+#if QT_CONFIG(vulkan)
+ Q_UNUSED(nativeConfig);
+ Q_UNUSED(err);
+ if (window()->surfaceType() == QSurface::VulkanSurface) {
+ if (!m_vkSurface) {
+ QVulkanInstance *inst = window()->vulkanInstance();
+ if (inst)
+ m_vkSurface = static_cast<QWindowsVulkanInstance *>(inst->handle())->createSurface(handle());
+ else
+ qWarning("Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?");
+ }
+ // Different semantics for VkSurfaces: the return value is the address,
+ // not the value, given that this is a 64-bit handle even on x86.
+ return &m_vkSurface;
+ }
+#elif defined(QT_NO_OPENGL)
Q_UNUSED(err)
Q_UNUSED(nativeConfig)
return 0;
-#else
+#endif
+#ifndef QT_NO_OPENGL
if (!m_surface) {
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
m_surface = staticOpenGLContext->createWindowSurface(m_data.hwnd, nativeConfig, err);
@@ -2408,6 +2556,14 @@ void *QWindowsWindow::surface(void *nativeConfig, int *err)
void QWindowsWindow::invalidateSurface()
{
+#if QT_CONFIG(vulkan)
+ if (m_vkSurface) {
+ QVulkanInstance *inst = window()->vulkanInstance();
+ if (inst)
+ static_cast<QWindowsVulkanInstance *>(inst->handle())->destroySurface(m_vkSurface);
+ m_vkSurface = 0;
+ }
+#endif
#ifndef QT_NO_OPENGL
if (m_surface) {
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index aa8ce7e73a..f0789e5167 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -41,14 +41,20 @@
#define QWINDOWSWINDOW_H
#include <QtCore/qt_windows.h>
+#include <QtCore/QPointer>
#include "qwindowscursor.h"
#include <qpa/qplatformwindow.h>
#include <QtPlatformHeaders/qwindowswindowfunctions.h>
+#if QT_CONFIG(vulkan)
+#include "qwindowsvulkaninstance.h"
+#endif
+
QT_BEGIN_NAMESPACE
class QWindowsOleDropTarget;
+class QWindowsMenuBar;
class QDebug;
struct QWindowsGeometryHint
@@ -75,9 +81,10 @@ struct QWindowsGeometryHint
struct QWindowCreationContext
{
- QWindowCreationContext(const QWindow *w, const QRect &r,
- const QMargins &customMargins,
- DWORD style, DWORD exStyle);
+ explicit QWindowCreationContext(const QWindow *w,
+ const QRect &geometryIn, const QRect &geometry,
+ const QMargins &customMargins,
+ DWORD style, DWORD exStyle);
void applyToMinMaxInfo(MINMAXINFO *mmi) const
{ geometryHint.applyToMinMaxInfo(style, exStyle, mmi); }
@@ -85,7 +92,8 @@ struct QWindowCreationContext
const QWindow *window;
DWORD style;
DWORD exStyle;
- QRect requestedGeometry;
+ QRect requestedGeometryIn; // QWindow scaled
+ QRect requestedGeometry; // after QPlatformWindow::initialGeometry()
QRect obtainedGeometry;
QMargins margins;
QMargins customMargins; // User-defined, additional frame for WM_NCCALCSIZE
@@ -188,6 +196,7 @@ public:
{
AutoMouseCapture = 0x1, //! Automatic mouse capture on button press.
WithinSetParent = 0x2,
+ WithinSetGeometry = 0x8,
OpenGLSurface = 0x10,
OpenGL_ES2 = 0x20,
OpenGLDoubleBuffered = 0x40,
@@ -208,11 +217,14 @@ public:
Compositing = 0x200000,
HasBorderInFullScreen = 0x400000,
WithinDpiChanged = 0x800000,
+ VulkanSurface = 0x1000000
};
QWindowsWindow(QWindow *window, const QWindowsWindowData &data);
~QWindowsWindow();
+ void initialize() override;
+
using QPlatformWindow::screenForGeometry;
QSurfaceFormat format() const override { return m_format; }
@@ -230,7 +242,7 @@ public:
QPoint mapFromGlobal(const QPoint &pos) const override;
void setWindowFlags(Qt::WindowFlags flags) override;
- void setWindowState(Qt::WindowState state) override;
+ void setWindowState(Qt::WindowStates state) override;
void setParent(const QPlatformWindow *window) override;
@@ -264,6 +276,9 @@ public:
HWND handle() const override { return m_data.hwnd; }
bool isTopLevel() const override;
+ QWindowsMenuBar *menuBar() const;
+ void setMenuBar(QWindowsMenuBar *mb);
+
QMargins customMargins() const { return m_data.customMargins; }
void setCustomMargins(const QMargins &m);
@@ -325,7 +340,7 @@ private:
inline void show_sys() const;
inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const;
inline bool isFullScreen_sys() const;
- inline void setWindowState_sys(Qt::WindowState newState);
+ inline void setWindowState_sys(Qt::WindowStates newState);
inline void setParent_sys(const QPlatformWindow *parent);
inline void updateTransientParent() const;
void destroyWindow();
@@ -333,14 +348,15 @@ private:
void setDropSiteEnabled(bool enabled);
void updateDropSite(bool topLevel);
void handleGeometryChange();
- void handleWindowStateChange(Qt::WindowState state);
+ void handleWindowStateChange(Qt::WindowStates state);
inline void destroyIcon();
void fireExpose(const QRegion &region, bool force=false);
mutable QWindowsWindowData m_data;
+ QPointer<QWindowsMenuBar> m_menuBar;
mutable unsigned m_flags = WithinCreate;
HDC m_hdc = 0;
- Qt::WindowState m_windowState = Qt::WindowNoState;
+ Qt::WindowStates m_windowState = Qt::WindowNoState;
qreal m_opacity = 1;
#ifndef QT_NO_CURSOR
CursorHandlePtr m_cursor;
@@ -352,6 +368,11 @@ private:
HICON m_iconSmall = 0;
HICON m_iconBig = 0;
void *m_surface = nullptr;
+
+#if QT_CONFIG(vulkan)
+ // note: intentionally not using void * in order to avoid breaking x86
+ VkSurfaceKHR m_vkSurface = 0;
+#endif
};
#ifndef QT_NO_DEBUG_STREAM
@@ -361,6 +382,7 @@ QDebug operator<<(QDebug d, const MINMAXINFO &i);
QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p);
QDebug operator<<(QDebug d, const WINDOWPLACEMENT &);
QDebug operator<<(QDebug d, const WINDOWPOS &);
+QDebug operator<<(QDebug d, const GUID &guid);
#endif // !QT_NO_DEBUG_STREAM
// ---------- QWindowsGeometryHint inline functions.
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index 6d01d05fcc..b7790a66e3 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -19,11 +19,13 @@ SOURCES += \
$$PWD/qwindowskeymapper.cpp \
$$PWD/qwindowsmousehandler.cpp \
$$PWD/qwindowsole.cpp \
+ $$PWD/qwindowsdropdataobject.cpp \
$$PWD/qwindowsmime.cpp \
$$PWD/qwindowsinternalmimedata.cpp \
$$PWD/qwindowscursor.cpp \
$$PWD/qwindowsinputcontext.cpp \
$$PWD/qwindowstheme.cpp \
+ $$PWD/qwindowsmenu.cpp \
$$PWD/qwindowsdialoghelpers.cpp \
$$PWD/qwindowsservices.cpp \
$$PWD/qwindowsnativeinterface.cpp \
@@ -31,6 +33,7 @@ SOURCES += \
$$PWD/qwin10helpers.cpp
HEADERS += \
+ $$PWD/qwindowscombase.h \
$$PWD/qwindowswindow.h \
$$PWD/qwindowsintegration.h \
$$PWD/qwindowscontext.h \
@@ -39,11 +42,13 @@ HEADERS += \
$$PWD/qwindowsmousehandler.h \
$$PWD/qtwindowsglobal.h \
$$PWD/qwindowsole.h \
+ $$PWD/qwindowsdropdataobject.h \
$$PWD/qwindowsmime.h \
$$PWD/qwindowsinternalmimedata.h \
$$PWD/qwindowscursor.h \
$$PWD/qwindowsinputcontext.h \
$$PWD/qwindowstheme.h \
+ $$PWD/qwindowsmenu.h \
$$PWD/qwindowsdialoghelpers.h \
$$PWD/qwindowsservices.h \
$$PWD/qwindowsnativeinterface.h \
@@ -69,6 +74,16 @@ qtConfig(dynamicgl) {
HEADERS += $$PWD/qwindowseglcontext.h
}
+qtConfig(systemtrayicon) {
+ SOURCES += $$PWD/qwindowssystemtrayicon.cpp
+ HEADERS += $$PWD/qwindowssystemtrayicon.h
+}
+
+qtConfig(vulkan) {
+ SOURCES += $$PWD/qwindowsvulkaninstance.cpp
+ HEADERS += $$PWD/qwindowsvulkaninstance.h
+}
+
qtConfig(clipboard) {
SOURCES += $$PWD/qwindowsclipboard.cpp
HEADERS += $$PWD/qwindowsclipboard.h
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 23168c10dc..4d788d91f8 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -5,6 +5,8 @@ QT += \
eventdispatcher_support-private accessibility_support-private \
fontdatabase_support-private theme_support-private
+qtConfig(vulkan): QT += vulkan_support-private
+
LIBS += -lgdi32 -ldwmapi
include(windows.pri)
diff --git a/src/plugins/platforms/winrt/qwinrtdrag.cpp b/src/plugins/platforms/winrt/qwinrtdrag.cpp
index 15ae024d20..43c406e1fb 100644
--- a/src/plugins/platforms/winrt/qwinrtdrag.cpp
+++ b/src/plugins/platforms/winrt/qwinrtdrag.cpp
@@ -773,12 +773,6 @@ void QWinRTDrag::setDropTarget(QWindow *target)
m_dragTarget = target;
}
-QMimeData *QWinRTDrag::platformDropData()
-{
- qCDebug(lcQpaMime) << __FUNCTION__;
- return m_mimeData;
-}
-
void QWinRTDrag::setUiElement(ComPtr<ABI::Windows::UI::Xaml::IUIElement> &element)
{
qCDebug(lcQpaMime) << __FUNCTION__;
diff --git a/src/plugins/platforms/winrt/qwinrtdrag.h b/src/plugins/platforms/winrt/qwinrtdrag.h
index 6cbabfbf41..2371201507 100644
--- a/src/plugins/platforms/winrt/qwinrtdrag.h
+++ b/src/plugins/platforms/winrt/qwinrtdrag.h
@@ -94,7 +94,6 @@ public:
virtual ~QWinRTDrag();
static QWinRTDrag *instance();
- QMimeData *platformDropData(void) override;
Qt::DropAction drag(QDrag *) override;
void setDropTarget(QWindow *target);
diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.cpp b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
index 58375d331c..f037c516b5 100644
--- a/src/plugins/platforms/winrt/qwinrtfileengine.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
@@ -414,10 +414,11 @@ QDateTime QWinRTFileEngine::fileTime(FileTime type) const
HRESULT hr;
DateTime dateTime = { 0 };
switch (type) {
- case CreationTime:
+ case BirthTime:
hr = d->file->get_DateCreated(&dateTime);
RETURN_IF_FAILED("Failed to get file creation time", return QDateTime());
break;
+ case MetadataChangeTime:
case ModificationTime:
case AccessTime: {
ComPtr<IAsyncOperation<FileProperties::BasicProperties *>> op;
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index c40a1b8c45..cbf0ba36c9 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -91,7 +91,7 @@ public:
QSurfaceFormat surfaceFormat;
QString windowTitle;
- Qt::WindowState state;
+ Qt::WindowStates state;
EGLDisplay display;
EGLSurface surface;
@@ -158,7 +158,7 @@ QWinRTWindow::QWinRTWindow(QWindow *window)
Q_ASSERT_SUCCEEDED(hr);
setWindowFlags(window->flags());
- setWindowState(window->windowState());
+ setWindowState(window->windowStates());
setWindowTitle(window->title());
setGeometry(window->geometry());
@@ -323,7 +323,7 @@ qreal QWinRTWindow::devicePixelRatio() const
return screen()->devicePixelRatio();
}
-void QWinRTWindow::setWindowState(Qt::WindowState state)
+void QWinRTWindow::setWindowState(Qt::WindowStates state)
{
Q_D(QWinRTWindow);
qCDebug(lcQpaWindows) << __FUNCTION__ << this << state;
@@ -331,7 +331,13 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
if (d->state == state)
return;
- if (state == Qt::WindowFullScreen) {
+ if (state & Qt::WindowMinimized) {
+ setUIElementVisibility(d->uiElement.Get(), false);
+ d->state = state;
+ return;
+ }
+
+ if (state & Qt::WindowFullScreen) {
HRESULT hr;
boolean success;
hr = QEventDispatcherWinRT::runOnXamlThread([&hr, &success]() {
@@ -356,7 +362,7 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
return;
}
- if (d->state == Qt::WindowFullScreen) {
+ if (d->state & Qt::WindowFullScreen) {
HRESULT hr;
hr = QEventDispatcherWinRT::runOnXamlThread([&hr]() {
ComPtr<IApplicationViewStatics2> applicationViewStatics;
@@ -378,10 +384,7 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
}
}
- if (state == Qt::WindowMinimized)
- setUIElementVisibility(d->uiElement.Get(), false);
-
- if (d->state == Qt::WindowMinimized || state == Qt::WindowNoState || state == Qt::WindowActive)
+ if (d->state & Qt::WindowMinimized || state == Qt::WindowNoState || state == Qt::WindowActive)
setUIElementVisibility(d->uiElement.Get(), true);
d->state = state;
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.h b/src/plugins/platforms/winrt/qwinrtwindow.h
index 26c2fa800d..a8992450b9 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.h
+++ b/src/plugins/platforms/winrt/qwinrtwindow.h
@@ -68,7 +68,7 @@ public:
WId winId() const override;
qreal devicePixelRatio() const override;
- void setWindowState(Qt::WindowState state) override;
+ void setWindowState(Qt::WindowStates state) override;
bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE;
bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h
index 48e774bbb2..fe50afa62a 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h
@@ -47,38 +47,28 @@
QT_BEGIN_NAMESPACE
-//####todo remove the noops (looks like their where there in the initial commit)
class QXcbEglContext : public QEGLPlatformContext
{
public:
QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share,
- EGLDisplay display, QXcbConnection *c, const QVariant &nativeHandle)
+ EGLDisplay display, const QVariant &nativeHandle)
: QEGLPlatformContext(glFormat, share, display, 0, nativeHandle)
- , m_connection(c)
{
- Q_XCB_NOOP(m_connection);
}
void swapBuffers(QPlatformSurface *surface)
{
- Q_XCB_NOOP(m_connection);
QEGLPlatformContext::swapBuffers(surface);
- Q_XCB_NOOP(m_connection);
}
bool makeCurrent(QPlatformSurface *surface)
{
- Q_XCB_NOOP(m_connection);
- bool ret = QEGLPlatformContext::makeCurrent(surface);
- Q_XCB_NOOP(m_connection);
- return ret;
+ return QEGLPlatformContext::makeCurrent(surface);
}
void doneCurrent()
{
- Q_XCB_NOOP(m_connection);
QEGLPlatformContext::doneCurrent();
- Q_XCB_NOOP(m_connection);
}
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface)
@@ -92,9 +82,6 @@ public:
QVariant nativeHandle() const {
return QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(eglContext(), eglDisplay()));
}
-
-private:
- QXcbConnection *m_connection;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp
index 9c52733120..7aa1d631df 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp
@@ -102,7 +102,6 @@ QPlatformOpenGLContext *QXcbEglIntegration::createPlatformOpenGLContext(QOpenGLC
QXcbEglContext *platformContext = new QXcbEglContext(screen->surfaceFormatFor(context->format()),
context->shareHandle(),
eglDisplay(),
- screen->connection(),
context->nativeHandle());
context->setNativeHandle(platformContext->nativeHandle());
return platformContext;
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index e2e573f0e1..3bc8590d36 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -167,7 +167,7 @@ static void updateFormatFromContext(QSurfaceFormat &format)
QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share,
const QVariant &nativeHandle)
: QPlatformOpenGLContext()
- , m_display(DISPLAY_FROM_XCB(screen))
+ , m_display(static_cast<Display *>(screen->connection()->xlib_display()))
, m_config(0)
, m_context(0)
, m_shareContext(0)
@@ -196,7 +196,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
if (share)
m_shareContext = static_cast<const QGLXContext*>(share)->glxContext();
- GLXFBConfig config = qglx_findConfig(DISPLAY_FROM_XCB(screen),screen->screenNumber(),m_format);
+ GLXFBConfig config = qglx_findConfig(m_display, screen->screenNumber(), m_format);
m_config = config;
XVisualInfo *visualInfo = 0;
Window window = 0; // Temporary window used to query OpenGL context
@@ -304,10 +304,10 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
// Get the basic surface format details
if (m_context)
- qglx_surfaceFormatFromGLXFBConfig(&m_format, DISPLAY_FROM_XCB(screen), config);
+ qglx_surfaceFormatFromGLXFBConfig(&m_format, m_display, config);
// Create a temporary window so that we can make the new context current
- window = createDummyWindow(DISPLAY_FROM_XCB(screen), config, screen->screenNumber(), screen->root());
+ window = createDummyWindow(m_display, config, screen->screenNumber(), screen->root());
} else {
// requesting an OpenGL ES context requires glXCreateContextAttribsARB, so bail out
if (m_format.renderableType() == QSurfaceFormat::OpenGLES)
@@ -325,7 +325,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
}
// Create a temporary window so that we can make the new context current
- window = createDummyWindow(DISPLAY_FROM_XCB(screen), visualInfo, screen->screenNumber(), screen->root());
+ window = createDummyWindow(m_display, visualInfo, screen->screenNumber(), screen->root());
XFree(visualInfo);
}
@@ -360,7 +360,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const
// Use the provided Display, if available. If not, use our own. It may still work.
Display *dpy = handle.display();
if (!dpy)
- dpy = DISPLAY_FROM_XCB(screen);
+ dpy = m_display;
// Legacy contexts created using glXCreateContext are created using a visual
// and the FBConfig cannot be queried. The only way to adapt these contexts
@@ -665,8 +665,10 @@ void QGLXContext::queryDummyContext()
Display *display = glXGetCurrentDisplay();
if (!display) {
// FIXME: Since Qt 5.6 we don't need to check whether primary screen is NULL
- if (QScreen *screen = QGuiApplication::primaryScreen())
- display = DISPLAY_FROM_XCB(static_cast<QXcbScreen *>(screen->handle()));
+ if (QScreen *screen = QGuiApplication::primaryScreen()) {
+ QXcbScreen *xcbScreen = static_cast<QXcbScreen *>(screen->handle());
+ display = static_cast<Display *>(xcbScreen->connection()->xlib_display());
+ }
}
const char *glxvendor = glXGetClientString(display, GLX_VENDOR);
if (glxvendor && !strcmp(glxvendor, "ATI")) {
@@ -729,8 +731,7 @@ void QGLXContext::queryDummyContext()
bool QGLXContext::supportsThreading()
{
- if (!m_queriedDummyContext)
- queryDummyContext();
+ queryDummyContext();
return m_supportsThreading;
}
@@ -738,9 +739,10 @@ QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface)
: QPlatformOffscreenSurface(offscreenSurface)
, m_screen(static_cast<QXcbScreen *>(offscreenSurface->screen()->handle()))
, m_format(m_screen->surfaceFormatFor(offscreenSurface->requestedFormat()))
+ , m_display(static_cast<Display *>(m_screen->connection()->xlib_display()))
, m_pbuffer(0)
{
- GLXFBConfig config = qglx_findConfig(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber(), m_format);
+ GLXFBConfig config = qglx_findConfig(m_display, m_screen->screenNumber(), m_format);
if (config) {
const int attributes[] = {
@@ -751,17 +753,17 @@ QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface)
None
};
- m_pbuffer = glXCreatePbuffer(DISPLAY_FROM_XCB(m_screen), config, attributes);
+ m_pbuffer = glXCreatePbuffer(m_display, config, attributes);
if (m_pbuffer)
- qglx_surfaceFormatFromGLXFBConfig(&m_format, DISPLAY_FROM_XCB(m_screen), config);
+ qglx_surfaceFormatFromGLXFBConfig(&m_format, m_display, config);
}
}
QGLXPbuffer::~QGLXPbuffer()
{
if (m_pbuffer)
- glXDestroyPbuffer(DISPLAY_FROM_XCB(m_screen), m_pbuffer);
+ glXDestroyPbuffer(m_display, m_pbuffer);
}
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h
index 3dfe0ac618..f6372582db 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h
@@ -108,6 +108,7 @@ public:
private:
QXcbScreen *m_screen;
QSurfaceFormat m_format;
+ Display *m_display;
GLXPbuffer m_pbuffer;
};
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 fea365cabc..377066df61 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
@@ -108,18 +108,13 @@ bool QXcbGlxIntegration::initialize(QXcbConnection *connection)
m_glx_first_event = reply->first_event;
- xcb_generic_error_t *error = 0;
- xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(m_connection->xcb_connection(),
- XCB_GLX_MAJOR_VERSION,
- XCB_GLX_MINOR_VERSION);
- xcb_glx_query_version_reply_t *xglx_query = xcb_glx_query_version_reply(m_connection->xcb_connection(),
- xglx_query_cookie, &error);
- if (!xglx_query || error) {
+ auto xglx_query = Q_XCB_REPLY(xcb_glx_query_version, m_connection->xcb_connection(),
+ XCB_GLX_MAJOR_VERSION,
+ XCB_GLX_MINOR_VERSION);
+ if (!xglx_query) {
qCWarning(lcQpaGl) << "QXcbConnection: Failed to initialize GLX";
- free(error);
return false;
}
- free(xglx_query);
#endif
m_native_interface_handler.reset(new QXcbGlxNativeInterfaceHandler(connection->nativeInterface()));
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
index 8df8b28f72..145a11a5e3 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
@@ -41,6 +41,7 @@
#include "qxcbscreen.h"
#include <QtGlxSupport/private/qglxconvenience_p.h>
+#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -58,13 +59,28 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
QXcbScreen *scr = xcbScreen();
if (!scr)
return Q_NULLPTR;
- XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(scr), scr->screenNumber(), &m_format);
+
+ qDebug(lcQpaGl) << "Requested format before FBConfig/Visual selection:" << m_format;
+
+ Display *dpy = static_cast<Display *>(scr->connection()->xlib_display());
+ const char *glxExts = glXQueryExtensionsString(dpy, scr->screenNumber());
+ int flags = 0;
+ if (glxExts) {
+ qCDebug(lcQpaGl, "Available GLX extensions: %s", glxExts);
+ if (strstr(glxExts, "GLX_EXT_framebuffer_sRGB") || strstr(glxExts, "GLX_ARB_framebuffer_sRGB"))
+ flags |= QGLX_SUPPORTS_SRGB;
+ }
+
+ XVisualInfo *visualInfo = qglx_findVisualInfo(dpy, scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags);
if (!visualInfo) {
qWarning() << "No XVisualInfo for format" << m_format;
return Q_NULLPTR;
}
const xcb_visualtype_t *xcb_visualtype = scr->visualForId(visualInfo->visualid);
XFree(visualInfo);
+
+ qDebug(lcQpaGl) << "Got format:" << m_format;
+
return xcb_visualtype;
}
diff --git a/src/plugins/platforms/xcb/nativepainting/nativepainting.pri b/src/plugins/platforms/xcb/nativepainting/nativepainting.pri
new file mode 100644
index 0000000000..78ed00843f
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/nativepainting.pri
@@ -0,0 +1,22 @@
+qtConfig(xcb-native-painting) {
+ qtConfig(xrender): QMAKE_USE += xrender
+ qtConfig(fontconfig): QMAKE_USE_PRIVATE += freetype
+
+ INCLUDEPATH += $$PWD
+ HEADERS += \
+ $$PWD/qtessellator_p.h \
+ $$PWD/qpixmap_x11_p.h \
+ $$PWD/qpaintengine_x11_p.h \
+ $$PWD/qt_x11_p.h \
+ $$PWD/qcolormap_x11_p.h \
+ $$PWD/qbackingstore_x11_p.h \
+ $$PWD/qxcbnativepainting.h
+
+ SOURCES += \
+ $$PWD/qtessellator.cpp \
+ $$PWD/qpixmap_x11.cpp \
+ $$PWD/qpaintengine_x11.cpp \
+ $$PWD/qcolormap_x11.cpp \
+ $$PWD/qbackingstore_x11.cpp \
+ $$PWD/qxcbnativepainting.cpp
+}
diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
new file mode 100644
index 0000000000..2dd2cdd9e3
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbackingstore_x11_p.h"
+#include "qxcbwindow.h"
+#include "qpixmap_x11_p.h"
+
+#include <private/qhighdpiscaling_p.h>
+#include <QPainter>
+
+#if QT_CONFIG(xrender)
+# include <X11/extensions/Xrender.h>
+#endif
+
+#include <X11/Xlib.h>
+
+#ifndef None
+#define None 0L
+#endif
+
+QT_BEGIN_NAMESPACE
+
+QXcbNativeBackingStore::QXcbNativeBackingStore(QWindow *window)
+ : QPlatformBackingStore(window)
+ , m_translucentBackground(false)
+{
+ if (QXcbWindow *w = static_cast<QXcbWindow *>(window->handle()))
+ m_translucentBackground = w->connection()->hasXRender() && QImage::toPixelFormat(w->imageFormat()).alphaSize() > 0;
+}
+
+QXcbNativeBackingStore::~QXcbNativeBackingStore()
+{}
+
+QPaintDevice *QXcbNativeBackingStore::paintDevice()
+{
+ return &m_pixmap;
+}
+
+void QXcbNativeBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+{
+ if (m_pixmap.isNull())
+ return;
+
+ QSize pixmapSize = m_pixmap.size();
+
+ QRegion clipped = region;
+ clipped &= QRect(QPoint(), QHighDpi::toNativePixels(window->size(), window));
+ clipped &= QRect(0, 0, pixmapSize.width(), pixmapSize.height()).translated(-offset);
+
+ QRect br = clipped.boundingRect();
+ if (br.isNull())
+ return;
+
+ QXcbWindow *platformWindow = static_cast<QXcbWindow *>(window->handle());
+ if (!platformWindow) {
+ qWarning("QXcbBackingStore::flush: QWindow has no platform window (QTBUG-32681)");
+ return;
+ }
+
+ Window wid = platformWindow->xcb_window();
+ Pixmap pid = qt_x11PixmapHandle(m_pixmap);
+
+ QVector<XRectangle> clipRects = qt_region_to_xrectangles(clipped);
+
+#if QT_CONFIG(xrender)
+ if (m_translucentBackground)
+ {
+ XWindowAttributes attrib;
+ XGetWindowAttributes(display(), wid, &attrib);
+ XRenderPictFormat *format = XRenderFindVisualFormat(display(), attrib.visual);
+
+ Picture srcPic = qt_x11PictureHandle(m_pixmap);
+ Picture dstPic = XRenderCreatePicture(display(), wid, format, 0, 0);
+
+ XRenderSetPictureClipRectangles(display(), dstPic, 0, 0, clipRects.constData(), clipRects.size());
+
+ XRenderComposite(display(), PictOpSrc, srcPic, None, dstPic,
+ br.x() + offset.x(), br.y() + offset.y(),
+ 0, 0,
+ br.x(), br.y(),
+ br.width(), br.height());
+
+ XRenderFreePicture(display(), dstPic);
+ }
+ else
+#endif
+ {
+ GC gc = XCreateGC(display(), wid, 0, Q_NULLPTR);
+
+ if (clipRects.size() != 1)
+ XSetClipRectangles(display(), gc, 0, 0, clipRects.data(), clipRects.size(), YXBanded);
+
+ XCopyArea(display(), pid, wid, gc, br.x() + offset.x(), br.y() + offset.y(), br.width(), br.height(), br.x(), br.y());
+ XFreeGC(display(), gc);
+ }
+
+
+ if (platformWindow->needsSync()) {
+ platformWindow->updateSyncRequestCounter();
+ } else {
+ XFlush(display());
+ }
+}
+
+QImage QXcbNativeBackingStore::toImage() const
+{
+ return m_pixmap.toImage();
+}
+
+void QXcbNativeBackingStore::resize(const QSize &size, const QRegion &staticContents)
+{
+ if (size == m_pixmap.size())
+ return;
+
+ QPixmap newPixmap(size);
+
+#if QT_CONFIG(xrender)
+ if (m_translucentBackground && newPixmap.depth() != 32)
+ qt_x11Pixmap(newPixmap)->convertToARGB32();
+#endif
+
+ if (!m_pixmap.isNull()) {
+ Pixmap from = qt_x11PixmapHandle(m_pixmap);
+ Pixmap to = qt_x11PixmapHandle(newPixmap);
+ QRect br = staticContents.boundingRect().intersected(QRect(QPoint(0, 0), size));
+
+ if (!br.isEmpty()) {
+ GC gc = XCreateGC(display(), to, 0, Q_NULLPTR);
+ XCopyArea(display(), from, to, gc, br.x(), br.y(), br.width(), br.height(), br.x(), br.y());
+ XFreeGC(display(), gc);
+ }
+ }
+
+ m_pixmap = newPixmap;
+}
+
+bool QXcbNativeBackingStore::scroll(const QRegion &area, int dx, int dy)
+{
+ if (m_pixmap.isNull())
+ return false;
+
+ QRect rect = area.boundingRect();
+ Pixmap pix = qt_x11PixmapHandle(m_pixmap);
+
+ GC gc = XCreateGC(display(), pix, 0, Q_NULLPTR);
+ XCopyArea(display(), pix, pix, gc,
+ rect.x(), rect.y(), rect.width(), rect.height(),
+ rect.x()+dx, rect.y()+dy);
+ XFreeGC(display(), gc);
+ return true;
+}
+
+void QXcbNativeBackingStore::beginPaint(const QRegion &region)
+{
+#if QT_CONFIG(xrender)
+ if (m_translucentBackground) {
+ const QVector<XRectangle> xrects = qt_region_to_xrectangles(region);
+ const XRenderColor color = { 0, 0, 0, 0 };
+ XRenderFillRectangles(display(), PictOpSrc,
+ qt_x11PictureHandle(m_pixmap), &color,
+ xrects.constData(), xrects.size());
+ }
+#else
+ Q_UNUSED(region);
+#endif
+}
+
+Display *QXcbNativeBackingStore::display() const
+{
+ return static_cast<Display *>(static_cast<QXcbWindow *>(window()->handle())->connection()->xlib_display());
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h
new file mode 100644
index 0000000000..5f4c24ec11
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11_p.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBACKINGSTORE_X11_H
+#define QBACKINGSTORE_X11_H
+
+#include <qpa/qplatformbackingstore.h>
+
+typedef struct _XDisplay Display;
+
+QT_BEGIN_NAMESPACE
+
+class QXcbWindow;
+
+class QXcbNativeBackingStore : public QPlatformBackingStore
+{
+public:
+ QXcbNativeBackingStore(QWindow *window);
+ ~QXcbNativeBackingStore();
+
+ QPaintDevice *paintDevice() override;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+
+ QImage toImage() const override;
+
+ void resize(const QSize &size, const QRegion &staticContents) override;
+ bool scroll(const QRegion &area, int dx, int dy) override;
+
+ void beginPaint(const QRegion &region) override;
+
+private:
+ Display *display() const;
+
+ QPixmap m_pixmap;
+ bool m_translucentBackground;
+};
+
+QT_END_NAMESPACE
+
+#endif // QBACKINGSTORE_X11_H
diff --git a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp
new file mode 100644
index 0000000000..8554c5445d
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11.cpp
@@ -0,0 +1,644 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QVarLengthArray>
+
+#include <private/qguiapplication_p.h>
+
+#include "qcolormap_x11_p.h"
+#include "qxcbnativepainting.h"
+#include "qt_x11_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QXcbColormapPrivate
+{
+public:
+ QXcbColormapPrivate()
+ : ref(1), mode(QXcbColormap::Direct), depth(0),
+ colormap(0), defaultColormap(true),
+ visual(0), defaultVisual(true),
+ r_max(0), g_max(0), b_max(0),
+ r_shift(0), g_shift(0), b_shift(0)
+ {}
+
+ QAtomicInt ref;
+
+ QXcbColormap::Mode mode;
+ int depth;
+
+ Colormap colormap;
+ bool defaultColormap;
+
+ Visual *visual;
+ bool defaultVisual;
+
+ int r_max;
+ int g_max;
+ int b_max;
+
+ uint r_shift;
+ uint g_shift;
+ uint b_shift;
+
+ QVector<QColor> colors;
+ QVector<int> pixels;
+};
+
+static uint right_align(uint v)
+{
+ while (!(v & 0x1))
+ v >>= 1;
+ return v;
+}
+
+static int cube_root(int v)
+{
+ if (v == 1)
+ return 1;
+ // brute force algorithm
+ int i = 1;
+ for (;;) {
+ const int b = i * i * i;
+ if (b <= v) {
+ ++i;
+ } else {
+ --i;
+ break;
+ }
+ }
+ return i;
+}
+
+static Visual *find_visual(Display *display,
+ int screen,
+ int visual_class,
+ int visual_id,
+ int *depth,
+ bool *defaultVisual)
+{
+ XVisualInfo *vi, rvi;
+ int count;
+
+ uint mask = VisualScreenMask;
+ rvi.screen = screen;
+
+ if (visual_class != -1) {
+ rvi.c_class = visual_class;
+ mask |= VisualClassMask;
+ }
+ if (visual_id != -1) {
+ rvi.visualid = visual_id;
+ mask |= VisualIDMask;
+ }
+
+ Visual *visual = DefaultVisual(display, screen);
+ *defaultVisual = true;
+ *depth = DefaultDepth(display, screen);
+
+ vi = XGetVisualInfo(display, mask, &rvi, &count);
+ if (vi) {
+ int best = 0;
+ for (int x = 0; x < count; ++x) {
+ if (vi[x].depth > vi[best].depth)
+ best = x;
+ }
+ if (best >= 0 && best <= count && vi[best].visualid != XVisualIDFromVisual(visual)) {
+ visual = vi[best].visual;
+ *defaultVisual = (visual == DefaultVisual(display, screen));
+ *depth = vi[best].depth;
+ }
+ }
+ if (vi)
+ XFree((char *)vi);
+ return visual;
+}
+
+static void query_colormap(QXcbColormapPrivate *d, int screen)
+{
+ Display *display = X11->display;
+
+ // query existing colormap
+ int q_colors = (((1u << d->depth) > 256u) ? 256u : (1u << d->depth));
+ XColor queried[256];
+ memset(queried, 0, sizeof(queried));
+ for (int x = 0; x < q_colors; ++x)
+ queried[x].pixel = x;
+ XQueryColors(display, d->colormap, queried, q_colors);
+
+ d->colors.resize(q_colors);
+ for (int x = 0; x < q_colors; ++x) {
+ if (queried[x].red == 0
+ && queried[x].green == 0
+ && queried[x].blue == 0
+ && queried[x].pixel != BlackPixel(display, screen)) {
+ // unallocated color cell, skip it
+ continue;
+ }
+
+ d->colors[x] = QColor::fromRgbF(queried[x].red / float(USHRT_MAX),
+ queried[x].green / float(USHRT_MAX),
+ queried[x].blue / float(USHRT_MAX));
+ }
+
+ // for missing colors, find the closest color in the existing colormap
+ Q_ASSERT(d->pixels.size());
+ for (int x = 0; x < d->pixels.size(); ++x) {
+ if (d->pixels.at(x) != -1)
+ continue;
+
+ QRgb rgb;
+ if (d->mode == QXcbColormap::Indexed) {
+ const int r = (x / (d->g_max * d->b_max)) % d->r_max;
+ const int g = (x / d->b_max) % d->g_max;
+ const int b = x % d->b_max;
+ rgb = qRgb((r * 0xff + (d->r_max - 1) / 2) / (d->r_max - 1),
+ (g * 0xff + (d->g_max - 1) / 2) / (d->g_max - 1),
+ (b * 0xff + (d->b_max - 1) / 2) / (d->b_max - 1));
+ } else {
+ rgb = qRgb(x, x, x);
+ }
+
+ // find closest color
+ int mindist = INT_MAX, best = -1;
+ for (int y = 0; y < q_colors; ++y) {
+ int r = qRed(rgb) - (queried[y].red >> 8);
+ int g = qGreen(rgb) - (queried[y].green >> 8);
+ int b = qBlue(rgb) - (queried[y].blue >> 8);
+ int dist = (r * r) + (g * g) + (b * b);
+ if (dist < mindist) {
+ mindist = dist;
+ best = y;
+ }
+ }
+
+ Q_ASSERT(best >= 0 && best < q_colors);
+ if (d->visual->c_class & 1) {
+ XColor xcolor;
+ xcolor.red = queried[best].red;
+ xcolor.green = queried[best].green;
+ xcolor.blue = queried[best].blue;
+ xcolor.pixel = queried[best].pixel;
+
+ if (XAllocColor(display, d->colormap, &xcolor)) {
+ d->pixels[x] = xcolor.pixel;
+ } else {
+ // some weird stuff is going on...
+ d->pixels[x] = (qGray(rgb) < 127
+ ? BlackPixel(display, screen)
+ : WhitePixel(display, screen));
+ }
+ } else {
+ d->pixels[x] = best;
+ }
+ }
+}
+
+static void init_gray(QXcbColormapPrivate *d, int screen)
+{
+ d->pixels.resize(d->r_max);
+
+ for (int g = 0; g < d->g_max; ++g) {
+ const int gray = (g * 0xff + (d->r_max - 1) / 2) / (d->r_max - 1);
+ const QRgb rgb = qRgb(gray, gray, gray);
+
+ d->pixels[g] = -1;
+
+ if (d->visual->c_class & 1) {
+ XColor xcolor;
+ xcolor.red = qRed(rgb) * 0x101;
+ xcolor.green = qGreen(rgb) * 0x101;
+ xcolor.blue = qBlue(rgb) * 0x101;
+ xcolor.pixel = 0ul;
+
+ if (XAllocColor(X11->display, d->colormap, &xcolor))
+ d->pixels[g] = xcolor.pixel;
+ }
+ }
+
+ query_colormap(d, screen);
+}
+
+static void init_indexed(QXcbColormapPrivate *d, int screen)
+{
+ d->pixels.resize(d->r_max * d->g_max * d->b_max);
+
+ // create color cube
+ for (int x = 0, r = 0; r < d->r_max; ++r) {
+ for (int g = 0; g < d->g_max; ++g) {
+ for (int b = 0; b < d->b_max; ++b, ++x) {
+ const QRgb rgb = qRgb((r * 0xff + (d->r_max - 1) / 2) / (d->r_max - 1),
+ (g * 0xff + (d->g_max - 1) / 2) / (d->g_max - 1),
+ (b * 0xff + (d->b_max - 1) / 2) / (d->b_max - 1));
+
+ d->pixels[x] = -1;
+
+ if (d->visual->c_class & 1) {
+ XColor xcolor;
+ xcolor.red = qRed(rgb) * 0x101;
+ xcolor.green = qGreen(rgb) * 0x101;
+ xcolor.blue = qBlue(rgb) * 0x101;
+ xcolor.pixel = 0ul;
+
+ if (XAllocColor(X11->display, d->colormap, &xcolor))
+ d->pixels[x] = xcolor.pixel;
+ }
+ }
+ }
+ }
+
+ query_colormap(d, screen);
+}
+
+static void init_direct(QXcbColormapPrivate *d, bool ownColormap)
+{
+ if (d->visual->c_class != DirectColor || !ownColormap)
+ return;
+
+ // preallocate 768 on the stack, so that we don't have to malloc
+ // for the common case (<= 24 bpp)
+ QVarLengthArray<XColor, 768> colorTable(d->r_max + d->g_max + d->b_max);
+ int i = 0;
+
+ for (int r = 0; r < d->r_max; ++r) {
+ colorTable[i].red = r << 8 | r;
+ colorTable[i].pixel = r << d->r_shift;
+ colorTable[i].flags = DoRed;
+ ++i;
+ }
+
+ for (int g = 0; g < d->g_max; ++g) {
+ colorTable[i].green = g << 8 | g;
+ colorTable[i].pixel = g << d->g_shift;
+ colorTable[i].flags = DoGreen;
+ ++i;
+ }
+
+ for (int b = 0; b < d->b_max; ++b) {
+ colorTable[i].blue = (b << 8 | b);
+ colorTable[i].pixel = b << d->b_shift;
+ colorTable[i].flags = DoBlue;
+ ++i;
+ }
+
+ XStoreColors(X11->display, d->colormap, colorTable.data(), colorTable.count());
+}
+
+static QXcbColormap **cmaps = 0;
+
+void QXcbColormap::initialize()
+{
+ Display *display = X11->display;
+ const int screens = ScreenCount(display);
+
+ cmaps = new QXcbColormap*[screens];
+
+ for (int i = 0; i < screens; ++i) {
+ cmaps[i] = new QXcbColormap;
+ QXcbColormapPrivate * const d = cmaps[i]->d;
+
+ bool use_stdcmap = false;
+ int color_count = X11->color_count;
+
+ // defaults
+ d->depth = DefaultDepth(display, i);
+ d->colormap = DefaultColormap(display, i);
+ d->defaultColormap = true;
+ d->visual = DefaultVisual(display, i);
+ d->defaultVisual = true;
+
+ Visual *argbVisual = 0;
+
+ if (X11->visual && i == DefaultScreen(display)) {
+ // only use the outside colormap on the default screen
+ d->visual = find_visual(display, i, X11->visual->c_class,
+ XVisualIDFromVisual(X11->visual),
+ &d->depth, &d->defaultVisual);
+ } else if ((X11->visual_class != -1 && X11->visual_class >= 0 && X11->visual_class < 6)
+ || (X11->visual_id != -1)) {
+ // look for a specific visual or type of visual
+ d->visual = find_visual(display, i, X11->visual_class, X11->visual_id,
+ &d->depth, &d->defaultVisual);
+ } else if (!X11->custom_cmap) {
+ XStandardColormap *stdcmap = 0;
+ int ncmaps = 0;
+
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ int nvi;
+ XVisualInfo templ;
+ templ.screen = i;
+ templ.depth = 32;
+ templ.c_class = TrueColor;
+ XVisualInfo *xvi = XGetVisualInfo(X11->display, VisualScreenMask |
+ VisualDepthMask |
+ VisualClassMask, &templ, &nvi);
+ for (int idx = 0; idx < nvi; ++idx) {
+ XRenderPictFormat *format = XRenderFindVisualFormat(X11->display,
+ xvi[idx].visual);
+ if (format->type == PictTypeDirect && format->direct.alphaMask) {
+ argbVisual = xvi[idx].visual;
+ break;
+ }
+ }
+ XFree(xvi);
+ }
+#endif
+ if (XGetRGBColormaps(display, RootWindow(display, i),
+ &stdcmap, &ncmaps, XA_RGB_DEFAULT_MAP)) {
+ if (stdcmap) {
+ for (int c = 0; c < ncmaps; ++c) {
+ if (!stdcmap[c].red_max ||
+ !stdcmap[c].green_max ||
+ !stdcmap[c].blue_max ||
+ !stdcmap[c].red_mult ||
+ !stdcmap[c].green_mult ||
+ !stdcmap[c].blue_mult)
+ continue; // invalid stdcmap
+
+ XVisualInfo proto;
+ proto.visualid = stdcmap[c].visualid;
+ proto.screen = i;
+
+ int nvisuals = 0;
+ XVisualInfo *vi = XGetVisualInfo(display, VisualIDMask | VisualScreenMask,
+ &proto, &nvisuals);
+ if (vi) {
+ if (nvisuals > 0) {
+ use_stdcmap = true;
+
+ d->mode = ((vi[0].visual->c_class < StaticColor)
+ ? Gray
+ : ((vi[0].visual->c_class < TrueColor)
+ ? Indexed
+ : Direct));
+
+ d->depth = vi[0].depth;
+ d->colormap = stdcmap[c].colormap;
+ d->defaultColormap = true;
+ d->visual = vi[0].visual;
+ d->defaultVisual = (d->visual == DefaultVisual(display, i));
+
+ d->r_max = stdcmap[c].red_max + 1;
+ d->g_max = stdcmap[c].green_max + 1;
+ d->b_max = stdcmap[c].blue_max + 1;
+
+ if (d->mode == Direct) {
+ // calculate offsets
+ d->r_shift = lowest_bit(d->visual->red_mask);
+ d->g_shift = lowest_bit(d->visual->green_mask);
+ d->b_shift = lowest_bit(d->visual->blue_mask);
+ } else {
+ d->r_shift = 0;
+ d->g_shift = 0;
+ d->b_shift = 0;
+ }
+ }
+ XFree(vi);
+ }
+ break;
+ }
+ XFree(stdcmap);
+ }
+ }
+ }
+ if (!use_stdcmap) {
+ switch (d->visual->c_class) {
+ case StaticGray:
+ d->mode = Gray;
+
+ d->r_max = d->g_max = d->b_max = d->visual->map_entries;
+ break;
+
+ case XGrayScale:
+ d->mode = Gray;
+
+ // follow precedent set in libXmu...
+ if (color_count != 0)
+ d->r_max = d->g_max = d->b_max = color_count;
+ else if (d->visual->map_entries > 65000)
+ d->r_max = d->g_max = d->b_max = 4096;
+ else if (d->visual->map_entries > 4000)
+ d->r_max = d->g_max = d->b_max = 512;
+ else if (d->visual->map_entries > 250)
+ d->r_max = d->g_max = d->b_max = 12;
+ else
+ d->r_max = d->g_max = d->b_max = 4;
+ break;
+
+ case StaticColor:
+ d->mode = Indexed;
+
+ d->r_max = right_align(d->visual->red_mask) + 1;
+ d->g_max = right_align(d->visual->green_mask) + 1;
+ d->b_max = right_align(d->visual->blue_mask) + 1;
+ break;
+
+ case PseudoColor:
+ d->mode = Indexed;
+
+ // follow precedent set in libXmu...
+ if (color_count != 0)
+ d->r_max = d->g_max = d->b_max = cube_root(color_count);
+ else if (d->visual->map_entries > 65000)
+ d->r_max = d->g_max = d->b_max = 27;
+ else if (d->visual->map_entries > 4000)
+ d->r_max = d->g_max = d->b_max = 12;
+ else if (d->visual->map_entries > 250)
+ d->r_max = d->g_max = d->b_max = cube_root(d->visual->map_entries - 125);
+ else
+ d->r_max = d->g_max = d->b_max = cube_root(d->visual->map_entries);
+ break;
+
+ case TrueColor:
+ case DirectColor:
+ d->mode = Direct;
+
+ d->r_max = right_align(d->visual->red_mask) + 1;
+ d->g_max = right_align(d->visual->green_mask) + 1;
+ d->b_max = right_align(d->visual->blue_mask) + 1;
+
+ d->r_shift = lowest_bit(d->visual->red_mask);
+ d->g_shift = lowest_bit(d->visual->green_mask);
+ d->b_shift = lowest_bit(d->visual->blue_mask);
+ break;
+ }
+ }
+
+ bool ownColormap = false;
+ if (X11->colormap && i == DefaultScreen(display)) {
+ // only use the outside colormap on the default screen
+ d->colormap = X11->colormap;
+ d->defaultColormap = (d->colormap == DefaultColormap(display, i));
+ } else if ((!use_stdcmap
+ && (((d->visual->c_class & 1) && X11->custom_cmap)
+ || d->visual != DefaultVisual(display, i)))
+ || d->visual->c_class == DirectColor) {
+ // allocate custom colormap (we always do this when using DirectColor visuals)
+ d->colormap =
+ XCreateColormap(display, RootWindow(display, i), d->visual,
+ d->visual->c_class == DirectColor ? AllocAll : AllocNone);
+ d->defaultColormap = false;
+ ownColormap = true;
+ }
+
+ switch (d->mode) {
+ case Gray:
+ init_gray(d, i);
+ break;
+ case Indexed:
+ init_indexed(d, i);
+ break;
+ case Direct:
+ init_direct(d, ownColormap);
+ break;
+ }
+
+ QX11InfoData *screen = X11->screens + i;
+ screen->depth = d->depth;
+ screen->visual = d->visual;
+ screen->defaultVisual = d->defaultVisual;
+ screen->colormap = d->colormap;
+ screen->defaultColormap = d->defaultColormap;
+ screen->cells = screen->visual->map_entries;
+
+ if (argbVisual) {
+ X11->argbVisuals[i] = argbVisual;
+ X11->argbColormaps[i] = XCreateColormap(display, RootWindow(display, i), argbVisual, AllocNone);
+ }
+
+ // ###
+ // We assume that 8bpp == pseudocolor, but this is not
+ // always the case (according to the X server), so we need
+ // to make sure that our internal data is setup in a way
+ // that is compatible with our assumptions
+ if (screen->visual->c_class == TrueColor && screen->depth == 8 && screen->cells == 8)
+ screen->cells = 256;
+ }
+}
+
+void QXcbColormap::cleanup()
+{
+ Display *display = X11->display;
+ const int screens = ScreenCount(display);
+
+ for (int i = 0; i < screens; ++i)
+ delete cmaps[i];
+
+ delete [] cmaps;
+ cmaps = 0;
+}
+
+
+QXcbColormap QXcbColormap::instance(int screen)
+{
+ if (screen == -1)
+ screen = QXcbX11Info::appScreen();
+ return *cmaps[screen];
+}
+
+/*! \internal
+ Constructs a new colormap.
+*/
+QXcbColormap::QXcbColormap()
+ : d(new QXcbColormapPrivate)
+{}
+
+QXcbColormap::QXcbColormap(const QXcbColormap &colormap)
+ :d (colormap.d)
+{ d->ref.ref(); }
+
+QXcbColormap::~QXcbColormap()
+{
+ if (!d->ref.deref()) {
+ if (!d->defaultColormap)
+ XFreeColormap(X11->display, d->colormap);
+ delete d;
+ }
+}
+
+QXcbColormap::Mode QXcbColormap::mode() const
+{ return d->mode; }
+
+int QXcbColormap::depth() const
+{ return d->depth; }
+
+int QXcbColormap::size() const
+{
+ return (d->mode == Gray
+ ? d->r_max
+ : (d->mode == Indexed
+ ? d->r_max * d->g_max * d->b_max
+ : -1));
+}
+
+uint QXcbColormap::pixel(const QColor &color) const
+{
+ const QRgba64 rgba64 = color.rgba64();
+ // XXX We emulate the raster engine here by getting the
+ // 8-bit values, but we could instead use the 16-bit
+ // values for slightly better color accuracy
+ const uint r = (rgba64.red8() * d->r_max) >> 8;
+ const uint g = (rgba64.green8() * d->g_max) >> 8;
+ const uint b = (rgba64.blue8() * d->b_max) >> 8;
+ if (d->mode != Direct) {
+ if (d->mode == Gray)
+ return d->pixels.at((r * 30 + g * 59 + b * 11) / 100);
+ return d->pixels.at(r * d->g_max * d->b_max + g * d->b_max + b);
+ }
+ return (r << d->r_shift) + (g << d->g_shift) + (b << d->b_shift);
+}
+
+const QColor QXcbColormap::colorAt(uint pixel) const
+{
+ if (d->mode != Direct) {
+ Q_ASSERT(pixel <= (uint)d->colors.size());
+ return d->colors.at(pixel);
+ }
+
+ const int r = (((pixel & d->visual->red_mask) >> d->r_shift) << 8) / d->r_max;
+ const int g = (((pixel & d->visual->green_mask) >> d->g_shift) << 8) / d->g_max;
+ const int b = (((pixel & d->visual->blue_mask) >> d->b_shift) << 8) / d->b_max;
+ return QColor(r, g, b);
+}
+
+const QVector<QColor> QXcbColormap::colormap() const
+{ return d->colors; }
+
+QXcbColormap &QXcbColormap::operator=(const QXcbColormap &colormap)
+{
+ qAtomicAssign(d, colormap.d);
+ return *this;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h
new file mode 100644
index 0000000000..530e3113e4
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qcolormap_x11_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORMAP_X11_H
+#define QCOLORMAP_X11_H
+
+#include <QColor>
+#include <QVector>
+
+QT_BEGIN_NAMESPACE
+
+class QXcbColormapPrivate;
+class QXcbColormap
+{
+public:
+ enum Mode { Direct, Indexed, Gray };
+
+ static void initialize();
+ static void cleanup();
+
+ static QXcbColormap instance(int screen = -1);
+
+ QXcbColormap(const QXcbColormap &colormap);
+ ~QXcbColormap();
+
+ QXcbColormap &operator=(const QXcbColormap &colormap);
+
+ Mode mode() const;
+
+ int depth() const;
+ int size() const;
+
+ uint pixel(const QColor &color) const;
+ const QColor colorAt(uint pixel) const;
+
+ const QVector<QColor> colormap() const;
+
+private:
+ QXcbColormap();
+ QXcbColormapPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QCOLORMAP_X11_H
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
new file mode 100644
index 0000000000..3364b07c08
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
@@ -0,0 +1,2837 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qpixmapcache_p.h>
+#include <private/qpaintengine_p.h>
+#include <private/qpolygonclipper_p.h>
+#include <private/qpainterpath_p.h>
+#include <private/qdrawhelper_p.h>
+#include <private/qfontengineglyphcache_p.h>
+
+#if QT_CONFIG(fontconfig)
+#include <private/qfontengine_ft_p.h>
+#endif
+
+#include "qpaintengine_x11_p.h"
+#include "qtessellator_p.h"
+#include "qpixmap_x11_p.h"
+#include "qcolormap_x11_p.h"
+#include "qt_x11_p.h"
+#include "qxcbexport.h"
+#include "qxcbnativepainting.h"
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(xrender)
+
+class QXRenderTessellator : public QTessellator
+{
+public:
+ QXRenderTessellator() : traps(0), allocated(0), size(0) {}
+ ~QXRenderTessellator() { free(traps); }
+ XTrapezoid *traps;
+ int allocated;
+ int size;
+ void addTrap(const Trapezoid &trap);
+ QRect tessellate(const QPointF *points, int nPoints, bool winding) {
+ size = 0;
+ setWinding(winding);
+ return QTessellator::tessellate(points, nPoints).toRect();
+ }
+ void done() {
+ if (allocated > 64) {
+ free(traps);
+ traps = 0;
+ allocated = 0;
+ }
+ }
+};
+
+void QXRenderTessellator::addTrap(const Trapezoid &trap)
+{
+ if (size == allocated) {
+ allocated = qMax(2*allocated, 64);
+ traps = q_check_ptr((XTrapezoid *)realloc(traps, allocated * sizeof(XTrapezoid)));
+ }
+ traps[size].top = Q27Dot5ToXFixed(trap.top);
+ traps[size].bottom = Q27Dot5ToXFixed(trap.bottom);
+ traps[size].left.p1.x = Q27Dot5ToXFixed(trap.topLeft->x);
+ traps[size].left.p1.y = Q27Dot5ToXFixed(trap.topLeft->y);
+ traps[size].left.p2.x = Q27Dot5ToXFixed(trap.bottomLeft->x);
+ traps[size].left.p2.y = Q27Dot5ToXFixed(trap.bottomLeft->y);
+ traps[size].right.p1.x = Q27Dot5ToXFixed(trap.topRight->x);
+ traps[size].right.p1.y = Q27Dot5ToXFixed(trap.topRight->y);
+ traps[size].right.p2.x = Q27Dot5ToXFixed(trap.bottomRight->x);
+ traps[size].right.p2.y = Q27Dot5ToXFixed(trap.bottomRight->y);
+ ++size;
+}
+
+#endif // QT_CONFIG(xrender)
+
+class QX11PaintEnginePrivate : public QPaintEnginePrivate
+{
+ Q_DECLARE_PUBLIC(QX11PaintEngine)
+public:
+ QX11PaintEnginePrivate()
+ {
+ opacity = 1.0;
+ scrn = -1;
+ hd = 0;
+ picture = 0;
+ gc = gc_brush = 0;
+ dpy = 0;
+ xinfo = 0;
+ txop = QTransform::TxNone;
+ has_clipping = false;
+ render_hints = 0;
+ xform_scale = 1;
+#if QT_CONFIG(xrender)
+ tessellator = 0;
+#endif
+ }
+ enum GCMode {
+ PenGC,
+ BrushGC
+ };
+
+ void init();
+ void fillPolygon_translated(const QPointF *points, int pointCount, GCMode gcMode,
+ QPaintEngine::PolygonDrawMode mode);
+ void fillPolygon_dev(const QPointF *points, int pointCount, GCMode gcMode,
+ QPaintEngine::PolygonDrawMode mode);
+ void fillPath(const QPainterPath &path, GCMode gcmode, bool transform);
+ void strokePolygon_dev(const QPointF *points, int pointCount, bool close);
+ void strokePolygon_translated(const QPointF *points, int pointCount, bool close);
+ void setupAdaptedOrigin(const QPoint &p);
+ void resetAdaptedOrigin();
+ void decidePathFallback() {
+ use_path_fallback = has_alpha_brush
+ || has_alpha_pen
+ || has_custom_pen
+ || has_complex_xform
+ || (render_hints & QPainter::Antialiasing);
+ }
+ void decideCoordAdjust() {
+ adjust_coords = !(render_hints & QPainter::Antialiasing)
+ && (render_hints & QPainter::Qt4CompatiblePainting)
+ && (has_alpha_pen
+ || (has_alpha_brush && has_pen && !has_alpha_pen)
+ || (cpen.style() > Qt::SolidLine));
+ }
+ void clipPolygon_dev(const QPolygonF &poly, QPolygonF *clipped_poly);
+ void systemStateChanged() override;
+ inline bool isCosmeticPen() const {
+ if ((render_hints & QPainter::Qt4CompatiblePainting) && cpen == QPen())
+ return true;
+ return cpen.isCosmetic();
+ }
+
+ Display *dpy;
+ int scrn;
+ int pdev_depth;
+ unsigned long hd;
+ QPixmap brush_pm;
+#if QT_CONFIG(xrender)
+ unsigned long picture;
+ unsigned long current_brush;
+ QPixmap bitmap_texture;
+ int composition_mode;
+#else
+ unsigned long picture;
+#endif
+ GC gc;
+ GC gc_brush;
+
+ QPen cpen;
+ QBrush cbrush;
+ QRegion crgn;
+ QTransform matrix;
+ qreal opacity;
+
+ uint has_complex_xform : 1;
+ uint has_scaling_xform : 1;
+ uint has_non_scaling_xform : 1;
+ uint has_custom_pen : 1;
+ uint use_path_fallback : 1;
+ uint adjust_coords : 1;
+ uint has_clipping : 1;
+ uint adapted_brush_origin : 1;
+ uint adapted_pen_origin : 1;
+ uint has_pen : 1;
+ uint has_brush : 1;
+ uint has_texture : 1;
+ uint has_alpha_texture : 1;
+ uint has_pattern : 1;
+ uint has_alpha_pen : 1;
+ uint has_alpha_brush : 1;
+ uint render_hints;
+
+ const QXcbX11Info *xinfo;
+ QPointF bg_origin;
+ QTransform::TransformationType txop;
+ qreal xform_scale;
+
+ struct qt_float_point
+ {
+ qreal x, y;
+ };
+ QPolygonClipper<qt_float_point, qt_float_point, float> polygonClipper;
+
+ int xlibMaxLinePoints;
+#if QT_CONFIG(xrender)
+ QXRenderTessellator *tessellator;
+#endif
+};
+
+#if QT_CONFIG(xrender)
+class QXRenderGlyphCache : public QFontEngineGlyphCache
+{
+public:
+ QXRenderGlyphCache(QXcbX11Info x, QFontEngine::GlyphFormat format, const QTransform &matrix);
+ ~QXRenderGlyphCache();
+
+ bool addGlyphs(const QTextItemInt &ti, QVarLengthArray<glyph_t> glyphs, QVarLengthArray<QFixedPoint> positions);
+ bool draw(Drawable src, Drawable dst, const QTransform &matrix, const QTextItemInt &ti);
+
+ inline GlyphSet glyphSet();
+ inline int glyphBufferSize(const QFontEngineFT::Glyph &glyph) const;
+
+ inline QImage::Format imageFormat() const;
+ inline const XRenderPictFormat *renderPictFormat() const;
+
+ static inline QFontEngine::GlyphFormat glyphFormatForDepth(QFontEngine *fontEngine, int depth);
+ static inline Glyph glyphId(glyph_t glyph, QFixed subPixelPosition);
+
+ static inline bool isValidCoordinate(const QFixedPoint &fp);
+
+private:
+ QXcbX11Info xinfo;
+ GlyphSet gset;
+ QSet<Glyph> cachedGlyphs;
+};
+#endif // QT_CONFIG(xrender)
+
+extern QPixmap qt_pixmapForBrush(int brushStyle, bool invert); //in qbrush.cpp
+extern QPixmap qt_toX11Pixmap(const QPixmap &pixmap);
+
+extern "C" {
+Q_XCB_EXPORT Drawable qt_x11Handle(const QPaintDevice *pd)
+{
+ if (!pd)
+ return 0;
+
+// if (pd->devType() == QInternal::Widget)
+// return static_cast<const QWidget *>(pd)->handle();
+
+ if (pd->devType() == QInternal::Pixmap)
+ return qt_x11PixmapHandle(*static_cast<const QPixmap *>(pd));
+
+ return 0;
+}
+}
+
+static const QXcbX11Info *qt_x11Info(const QPaintDevice *pd)
+{
+ if (!pd)
+ return 0;
+
+// if (pd->devType() == QInternal::Widget)
+// return &static_cast<const QWidget *>(pd)->x11Info();
+
+ if (pd->devType() == QInternal::Pixmap)
+ return &qt_x11Info(*static_cast<const QPixmap *>(pd));
+
+ return 0;
+}
+
+// use the same rounding as in qrasterizer.cpp (6 bit fixed point)
+static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
+
+#undef X11 // defined in qt_x11_p.h
+extern "C" {
+/*!
+ Returns the X11 specific pen GC for the painter \a p. Note that
+ QPainter::begin() must be called before this function returns a
+ valid GC.
+*/
+GC Q_XCB_EXPORT qt_x11_get_pen_gc(QPainter *p)
+{
+ if (p && p->paintEngine()
+ && p->paintEngine()->isActive()
+ && p->paintEngine()->type() == QPaintEngine::X11) {
+ return static_cast<QX11PaintEngine *>(p->paintEngine())->d_func()->gc;
+ }
+ return 0;
+}
+
+/*!
+ Returns the X11 specific brush GC for the painter \a p. Note that
+ QPainter::begin() must be called before this function returns a
+ valid GC.
+*/
+GC Q_XCB_EXPORT qt_x11_get_brush_gc(QPainter *p)
+{
+ if (p && p->paintEngine()
+ && p->paintEngine()->isActive()
+ && p->paintEngine()->type() == QPaintEngine::X11) {
+ return static_cast<QX11PaintEngine *>(p->paintEngine())->d_func()->gc_brush;
+ }
+ return 0;
+}
+}
+#define X11 qt_x11Data
+
+// internal helper. Converts an integer value to an unique string token
+template <typename T>
+ struct HexString
+{
+ inline HexString(const T t)
+ : val(t)
+ {}
+
+ inline void write(QChar *&dest) const
+ {
+ const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+ const char *c = reinterpret_cast<const char *>(&val);
+ for (uint i = 0; i < sizeof(T); ++i) {
+ *dest++ = hexChars[*c & 0xf];
+ *dest++ = hexChars[(*c & 0xf0) >> 4];
+ ++c;
+ }
+ }
+ const T val;
+};
+
+// specialization to enable fast concatenating of our string tokens to a string
+template <typename T>
+ struct QConcatenable<HexString<T> >
+{
+ typedef HexString<T> type;
+ enum { ExactSize = true };
+ static int size(const HexString<T> &) { return sizeof(T) * 2; }
+ static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
+ typedef QString ConvertTo;
+};
+
+#if QT_CONFIG(xrender)
+static const int compositionModeToRenderOp[QPainter::CompositionMode_Xor + 1] = {
+ PictOpOver, //CompositionMode_SourceOver,
+ PictOpOverReverse, //CompositionMode_DestinationOver,
+ PictOpClear, //CompositionMode_Clear,
+ PictOpSrc, //CompositionMode_Source,
+ PictOpDst, //CompositionMode_Destination,
+ PictOpIn, //CompositionMode_SourceIn,
+ PictOpInReverse, //CompositionMode_DestinationIn,
+ PictOpOut, //CompositionMode_SourceOut,
+ PictOpOutReverse, //CompositionMode_DestinationOut,
+ PictOpAtop, //CompositionMode_SourceAtop,
+ PictOpAtopReverse, //CompositionMode_DestinationAtop,
+ PictOpXor //CompositionMode_Xor
+};
+
+static inline int qpainterOpToXrender(QPainter::CompositionMode mode)
+{
+ Q_ASSERT(mode <= QPainter::CompositionMode_Xor);
+ return compositionModeToRenderOp[mode];
+}
+
+static inline bool complexPictOp(int op)
+{
+ return op != PictOpOver && op != PictOpSrc;
+}
+#endif
+
+static inline void x11SetClipRegion(Display *dpy, GC gc, GC gc2,
+#if QT_CONFIG(xrender)
+ Picture picture,
+#else
+ Qt::HANDLE picture,
+#endif
+ const QRegion &r)
+{
+// int num;
+// XRectangle *rects = (XRectangle *)qt_getClipRects(r, num);
+ QVector<XRectangle> rects = qt_region_to_xrectangles(r);
+ int num = rects.size();
+
+ if (gc)
+ XSetClipRectangles( dpy, gc, 0, 0, rects.data(), num, Unsorted );
+ if (gc2)
+ XSetClipRectangles( dpy, gc2, 0, 0, rects.data(), num, Unsorted );
+
+#if QT_CONFIG(xrender)
+ if (picture)
+ XRenderSetPictureClipRectangles(dpy, picture, 0, 0, rects.data(), num);
+#else
+ Q_UNUSED(picture);
+#endif // QT_CONFIG(xrender)
+}
+
+
+static inline void x11ClearClipRegion(Display *dpy, GC gc, GC gc2,
+#if QT_CONFIG(xrender)
+ Picture picture
+#else
+ Qt::HANDLE picture
+#endif
+ )
+{
+ if (gc)
+ XSetClipMask(dpy, gc, XNone);
+ if (gc2)
+ XSetClipMask(dpy, gc2, XNone);
+
+#if QT_CONFIG(xrender)
+ if (picture) {
+ XRenderPictureAttributes attrs;
+ attrs.clip_mask = XNone;
+ XRenderChangePicture (dpy, picture, CPClipMask, &attrs);
+ }
+#else
+ Q_UNUSED(picture);
+#endif // QT_CONFIG(xrender)
+}
+
+
+#define DITHER_SIZE 16
+static const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE] = {
+ { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 },
+ { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },
+ { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },
+ { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },
+ { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 },
+ { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },
+ { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },
+ { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },
+ { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 },
+ { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },
+ { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },
+ { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },
+ { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 },
+ { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },
+ { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },
+ { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }
+};
+
+static QPixmap qt_patternForAlpha(uchar alpha, int screen)
+{
+ QPixmap pm;
+ QString key = QLatin1Literal("$qt-alpha-brush$")
+ % HexString<uchar>(alpha)
+ % HexString<int>(screen);
+
+ if (!QPixmapCache::find(key, pm)) {
+ // #### why not use a mono image here????
+ QImage pattern(DITHER_SIZE, DITHER_SIZE, QImage::Format_ARGB32);
+ pattern.fill(0xffffffff);
+ for (int y = 0; y < DITHER_SIZE; ++y) {
+ for (int x = 0; x < DITHER_SIZE; ++x) {
+ if (base_dither_matrix[x][y] <= alpha)
+ pattern.setPixel(x, y, 0x00000000);
+ }
+ }
+ pm = QBitmap::fromImage(pattern);
+ qt_x11SetScreen(pm, screen);
+ //pm.x11SetScreen(screen);
+ QPixmapCache::insert(key, pm);
+ }
+ return pm;
+}
+
+
+#if QT_CONFIG(xrender)
+static Picture getPatternFill(int screen, const QBrush &b)
+{
+ if (!X11->use_xrender)
+ return XNone;
+
+ XRenderColor color = X11->preMultiply(b.color());
+ XRenderColor bg_color;
+
+ bg_color = X11->preMultiply(QColor(0, 0, 0, 0));
+
+ for (int i = 0; i < X11->pattern_fill_count; ++i) {
+ if (X11->pattern_fills[i].screen == screen
+ && X11->pattern_fills[i].opaque == false
+ && X11->pattern_fills[i].style == b.style()
+ && X11->pattern_fills[i].color.alpha == color.alpha
+ && X11->pattern_fills[i].color.red == color.red
+ && X11->pattern_fills[i].color.green == color.green
+ && X11->pattern_fills[i].color.blue == color.blue
+ && X11->pattern_fills[i].bg_color.alpha == bg_color.alpha
+ && X11->pattern_fills[i].bg_color.red == bg_color.red
+ && X11->pattern_fills[i].bg_color.green == bg_color.green
+ && X11->pattern_fills[i].bg_color.blue == bg_color.blue)
+ return X11->pattern_fills[i].picture;
+ }
+ // none found, replace one
+ int i = qrand() % 16;
+
+ if (X11->pattern_fills[i].screen != screen && X11->pattern_fills[i].picture) {
+ XRenderFreePicture (QXcbX11Info::display(), X11->pattern_fills[i].picture);
+ X11->pattern_fills[i].picture = 0;
+ }
+
+ if (!X11->pattern_fills[i].picture) {
+ Pixmap pixmap = XCreatePixmap (QXcbX11Info::display(), RootWindow (QXcbX11Info::display(), screen), 8, 8, 32);
+ XRenderPictureAttributes attrs;
+ attrs.repeat = True;
+ X11->pattern_fills[i].picture = XRenderCreatePicture (QXcbX11Info::display(), pixmap,
+ XRenderFindStandardFormat(QXcbX11Info::display(), PictStandardARGB32),
+ CPRepeat, &attrs);
+ XFreePixmap (QXcbX11Info::display(), pixmap);
+ }
+
+ X11->pattern_fills[i].screen = screen;
+ X11->pattern_fills[i].color = color;
+ X11->pattern_fills[i].bg_color = bg_color;
+ X11->pattern_fills[i].opaque = false;
+ X11->pattern_fills[i].style = b.style();
+
+ XRenderFillRectangle(QXcbX11Info::display(), PictOpSrc, X11->pattern_fills[i].picture, &bg_color, 0, 0, 8, 8);
+
+ QPixmap pattern(qt_pixmapForBrush(b.style(), true));
+ XRenderPictureAttributes attrs;
+ attrs.repeat = true;
+ XRenderChangePicture(QXcbX11Info::display(), qt_x11PictureHandle(pattern), CPRepeat, &attrs);
+
+ Picture fill_fg = X11->getSolidFill(screen, b.color());
+ XRenderComposite(QXcbX11Info::display(), PictOpOver, fill_fg, qt_x11PictureHandle(pattern),
+ X11->pattern_fills[i].picture,
+ 0, 0, 0, 0, 0, 0, 8, 8);
+
+ return X11->pattern_fills[i].picture;
+}
+
+static void qt_render_bitmap(Display *dpy, int scrn, Picture src, Picture dst,
+ int sx, int sy, int x, int y, int sw, int sh,
+ const QPen &pen)
+{
+ Picture fill_fg = X11->getSolidFill(scrn, pen.color());
+ XRenderComposite(dpy, PictOpOver,
+ fill_fg, src, dst, sx, sy, sx, sy, x, y, sw, sh);
+}
+#endif
+
+void QX11PaintEnginePrivate::init()
+{
+ dpy = 0;
+ scrn = 0;
+ hd = 0;
+ picture = 0;
+ xinfo = 0;
+#if QT_CONFIG(xrender)
+ current_brush = 0;
+ composition_mode = PictOpOver;
+ tessellator = new QXRenderTessellator;
+#endif
+}
+
+void QX11PaintEnginePrivate::setupAdaptedOrigin(const QPoint &p)
+{
+ if (adapted_pen_origin)
+ XSetTSOrigin(dpy, gc, p.x(), p.y());
+ if (adapted_brush_origin)
+ XSetTSOrigin(dpy, gc_brush, p.x(), p.y());
+}
+
+void QX11PaintEnginePrivate::resetAdaptedOrigin()
+{
+ if (adapted_pen_origin)
+ XSetTSOrigin(dpy, gc, 0, 0);
+ if (adapted_brush_origin)
+ XSetTSOrigin(dpy, gc_brush, 0, 0);
+}
+
+void QX11PaintEnginePrivate::clipPolygon_dev(const QPolygonF &poly, QPolygonF *clipped_poly)
+{
+ int clipped_count = 0;
+ qt_float_point *clipped_points = 0;
+ polygonClipper.clipPolygon((qt_float_point *) poly.data(), poly.size(),
+ &clipped_points, &clipped_count);
+ clipped_poly->resize(clipped_count);
+ for (int i=0; i<clipped_count; ++i)
+ (*clipped_poly)[i] = *((QPointF *)(&clipped_points[i]));
+}
+
+void QX11PaintEnginePrivate::systemStateChanged()
+{
+ Q_Q(QX11PaintEngine);
+ QPainter *painter = q->state ? q->state->painter() : nullptr;
+ if (painter && painter->hasClipping()) {
+ if (q->testDirty(QPaintEngine::DirtyTransform))
+ q->updateMatrix(q->state->transform());
+ QPolygonF clip_poly_dev(matrix.map(painter->clipPath().toFillPolygon()));
+ QPolygonF clipped_poly_dev;
+ clipPolygon_dev(clip_poly_dev, &clipped_poly_dev);
+ q->updateClipRegion_dev(QRegion(clipped_poly_dev.toPolygon()), Qt::ReplaceClip);
+ } else {
+ q->updateClipRegion_dev(QRegion(), Qt::NoClip);
+ }
+}
+
+static QPaintEngine::PaintEngineFeatures qt_decide_features()
+{
+ QPaintEngine::PaintEngineFeatures features =
+ QPaintEngine::PrimitiveTransform
+ | QPaintEngine::PatternBrush
+ | QPaintEngine::AlphaBlend
+ | QPaintEngine::PainterPaths
+ | QPaintEngine::RasterOpModes;
+
+ if (X11->use_xrender) {
+ features |= QPaintEngine::Antialiasing;
+ features |= QPaintEngine::PorterDuff;
+ features |= QPaintEngine::MaskedBrush;
+#if 0
+ if (X11->xrender_version > 10) {
+ features |= QPaintEngine::LinearGradientFill;
+ // ###
+ }
+#endif
+ }
+
+ return features;
+}
+
+/*
+ * QX11PaintEngine members
+ */
+
+QX11PaintEngine::QX11PaintEngine()
+ : QPaintEngine(*(new QX11PaintEnginePrivate), qt_decide_features())
+{
+ Q_D(QX11PaintEngine);
+ d->init();
+}
+
+QX11PaintEngine::QX11PaintEngine(QX11PaintEnginePrivate &dptr)
+ : QPaintEngine(dptr, qt_decide_features())
+{
+ Q_D(QX11PaintEngine);
+ d->init();
+}
+
+QX11PaintEngine::~QX11PaintEngine()
+{
+#if QT_CONFIG(xrender)
+ Q_D(QX11PaintEngine);
+ delete d->tessellator;
+#endif
+}
+
+bool QX11PaintEngine::begin(QPaintDevice *pdev)
+{
+ Q_D(QX11PaintEngine);
+ d->xinfo = qt_x11Info(pdev);
+#if QT_CONFIG(xrender)
+ if (pdev->devType() == QInternal::Pixmap) {
+ const QPixmap *pm = static_cast<const QPixmap *>(pdev);
+ QX11PlatformPixmap *data = static_cast<QX11PlatformPixmap*>(pm->handle());
+ if (X11->use_xrender && data->depth() != 32 && data->x11_mask)
+ data->convertToARGB32();
+ d->picture = qt_x11PictureHandle(*static_cast<const QPixmap *>(pdev));
+ }
+#else
+ d->picture = 0;
+#endif
+ d->hd = qt_x11Handle(pdev);
+
+ Q_ASSERT(d->xinfo != 0);
+ d->dpy = d->xinfo->display(); // get display variable
+ d->scrn = d->xinfo->screen(); // get screen variable
+
+ d->crgn = QRegion();
+ d->gc = XCreateGC(d->dpy, d->hd, 0, 0);
+ d->gc_brush = XCreateGC(d->dpy, d->hd, 0, 0);
+ d->has_alpha_brush = false;
+ d->has_alpha_pen = false;
+ d->has_clipping = false;
+ d->has_complex_xform = false;
+ d->has_scaling_xform = false;
+ d->has_non_scaling_xform = true;
+ d->xform_scale = 1;
+ d->has_custom_pen = false;
+ d->matrix = QTransform();
+ d->pdev_depth = d->pdev->depth();
+ d->render_hints = 0;
+ d->txop = QTransform::TxNone;
+ d->use_path_fallback = false;
+#if QT_CONFIG(xrender)
+ d->composition_mode = PictOpOver;
+#endif
+ d->xlibMaxLinePoints = 32762; // a safe number used to avoid, call to XMaxRequestSize(d->dpy) - 3;
+ d->opacity = 1;
+
+ // Set up the polygon clipper. Note: This will only work in
+ // polyline mode as long as we have a buffer zone, since a
+ // polyline may be clipped into several non-connected polylines.
+ const int BUFFERZONE = 1000;
+ QRect devClipRect(-BUFFERZONE, -BUFFERZONE,
+ pdev->width() + 2*BUFFERZONE, pdev->height() + 2*BUFFERZONE);
+ d->polygonClipper.setBoundingRect(devClipRect);
+
+ setSystemClip(systemClip());
+ d->systemStateChanged();
+
+ qt_x11SetDefaultScreen(d->xinfo->screen());
+
+ updatePen(QPen(Qt::black));
+ updateBrush(QBrush(Qt::white), QPoint());
+
+ setDirty(QPaintEngine::DirtyClipRegion);
+ setDirty(QPaintEngine::DirtyPen);
+ setDirty(QPaintEngine::DirtyBrush);
+ setDirty(QPaintEngine::DirtyBackground);
+
+ setActive(true);
+ return true;
+}
+
+bool QX11PaintEngine::end()
+{
+ Q_D(QX11PaintEngine);
+
+#if QT_CONFIG(xrender)
+ if (d->picture) {
+ // reset clipping/subwindow mode on our render picture
+ XRenderPictureAttributes attrs;
+ attrs.subwindow_mode = ClipByChildren;
+ attrs.clip_mask = XNone;
+ XRenderChangePicture(d->dpy, d->picture, CPClipMask|CPSubwindowMode, &attrs);
+ }
+#endif
+
+ if (d->gc_brush && d->pdev->painters < 2) {
+ XFreeGC(d->dpy, d->gc_brush);
+ d->gc_brush = 0;
+ }
+
+ if (d->gc && d->pdev->painters < 2) {
+ XFreeGC(d->dpy, d->gc);
+ d->gc = 0;
+ }
+
+ // Restore system clip for alien widgets painting outside the paint event.
+// if (d->pdev->devType() == QInternal::Widget && !static_cast<QWidget *>(d->pdev)->internalWinId())
+ d->currentClipDevice = nullptr;
+ setSystemClip(QRegion());
+
+ setActive(false);
+ return true;
+}
+
+static bool clipLine(QLineF *line, const QRect &rect)
+{
+ qreal x1 = line->x1();
+ qreal x2 = line->x2();
+ qreal y1 = line->y1();
+ qreal y2 = line->y2();
+
+ qreal left = rect.x();
+ qreal right = rect.x() + rect.width() - 1;
+ qreal top = rect.y();
+ qreal bottom = rect.y() + rect.height() - 1;
+
+ enum { Left, Right, Top, Bottom };
+ // clip the lines, after cohen-sutherland, see e.g. http://www.nondot.org/~sabre/graphpro/line6.html
+ int p1 = ((x1 < left) << Left)
+ | ((x1 > right) << Right)
+ | ((y1 < top) << Top)
+ | ((y1 > bottom) << Bottom);
+ int p2 = ((x2 < left) << Left)
+ | ((x2 > right) << Right)
+ | ((y2 < top) << Top)
+ | ((y2 > bottom) << Bottom);
+
+ if (p1 & p2)
+ // completely outside
+ return false;
+
+ if (p1 | p2) {
+ qreal dx = x2 - x1;
+ qreal dy = y2 - y1;
+
+ // clip x coordinates
+ if (x1 < left) {
+ y1 += dy/dx * (left - x1);
+ x1 = left;
+ } else if (x1 > right) {
+ y1 -= dy/dx * (x1 - right);
+ x1 = right;
+ }
+ if (x2 < left) {
+ y2 += dy/dx * (left - x2);
+ x2 = left;
+ } else if (x2 > right) {
+ y2 -= dy/dx * (x2 - right);
+ x2 = right;
+ }
+ p1 = ((y1 < top) << Top)
+ | ((y1 > bottom) << Bottom);
+ p2 = ((y2 < top) << Top)
+ | ((y2 > bottom) << Bottom);
+ if (p1 & p2)
+ return false;
+ // clip y coordinates
+ if (y1 < top) {
+ x1 += dx/dy * (top - y1);
+ y1 = top;
+ } else if (y1 > bottom) {
+ x1 -= dx/dy * (y1 - bottom);
+ y1 = bottom;
+ }
+ if (y2 < top) {
+ x2 += dx/dy * (top - y2);
+ y2 = top;
+ } else if (y2 > bottom) {
+ x2 -= dx/dy * (y2 - bottom);
+ y2 = bottom;
+ }
+ *line = QLineF(QPointF(x1, y1), QPointF(x2, y2));
+ }
+ return true;
+}
+
+void QX11PaintEngine::drawLines(const QLine *lines, int lineCount)
+{
+ Q_ASSERT(lines);
+ Q_ASSERT(lineCount);
+ Q_D(QX11PaintEngine);
+
+ if (d->has_alpha_brush
+ || d->has_alpha_pen
+ || d->has_custom_pen
+ || (d->cpen.widthF() > 0 && d->has_complex_xform
+ && !d->has_non_scaling_xform)
+ || (d->render_hints & QPainter::Antialiasing)) {
+ for (int i = 0; i < lineCount; ++i) {
+ QPainterPath path(lines[i].p1());
+ path.lineTo(lines[i].p2());
+ drawPath(path);
+ }
+ return;
+ }
+
+ if (d->has_pen) {
+ for (int i = 0; i < lineCount; ++i) {
+ QLineF linef;
+ if (d->txop == QTransform::TxNone) {
+ linef = lines[i];
+ } else {
+ linef = d->matrix.map(QLineF(lines[i]));
+ }
+ if (clipLine(&linef, d->polygonClipper.boundingRect())) {
+ int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
+
+ XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
+ }
+ }
+ }
+}
+
+void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount)
+{
+ Q_ASSERT(lines);
+ Q_ASSERT(lineCount);
+ Q_D(QX11PaintEngine);
+
+ if (d->has_alpha_brush
+ || d->has_alpha_pen
+ || d->has_custom_pen
+ || (d->cpen.widthF() > 0 && d->has_complex_xform
+ && !d->has_non_scaling_xform)
+ || (d->render_hints & QPainter::Antialiasing)) {
+ for (int i = 0; i < lineCount; ++i) {
+ QPainterPath path(lines[i].p1());
+ path.lineTo(lines[i].p2());
+ drawPath(path);
+ }
+ return;
+ }
+
+ if (d->has_pen) {
+ for (int i = 0; i < lineCount; ++i) {
+ QLineF linef = d->matrix.map(lines[i]);
+ if (clipLine(&linef, d->polygonClipper.boundingRect())) {
+ int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
+
+ XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
+ }
+ }
+ }
+}
+
+static inline QLine clipStraightLine(const QRect &clip, const QLine &l)
+{
+ if (l.p1().x() == l.p2().x()) {
+ int x = qBound(clip.left(), l.p1().x(), clip.right());
+ int y1 = qBound(clip.top(), l.p1().y(), clip.bottom());
+ int y2 = qBound(clip.top(), l.p2().y(), clip.bottom());
+
+ return QLine(x, y1, x, y2);
+ } else {
+ Q_ASSERT(l.p1().y() == l.p2().y());
+
+ int x1 = qBound(clip.left(), l.p1().x(), clip.right());
+ int x2 = qBound(clip.left(), l.p2().x(), clip.right());
+ int y = qBound(clip.top(), l.p1().y(), clip.bottom());
+
+ return QLine(x1, y, x2, y);
+ }
+}
+
+void QX11PaintEngine::drawRects(const QRectF *rects, int rectCount)
+{
+ Q_D(QX11PaintEngine);
+ Q_ASSERT(rects);
+ Q_ASSERT(rectCount);
+
+ if (rectCount != 1
+ || d->has_pen
+ || d->has_alpha_brush
+ || d->has_complex_xform
+ || d->has_custom_pen
+ || d->cbrush.style() != Qt::SolidPattern
+#if QT_CONFIG(xrender)
+ || complexPictOp(d->composition_mode)
+#endif
+ )
+ {
+ QPaintEngine::drawRects(rects, rectCount);
+ return;
+ }
+
+ QPoint alignedOffset;
+ if (d->txop == QTransform::TxTranslate) {
+ QPointF offset(d->matrix.dx(), d->matrix.dy());
+ alignedOffset = offset.toPoint();
+ if (offset != QPointF(alignedOffset)) {
+ QPaintEngine::drawRects(rects, rectCount);
+ return;
+ }
+ }
+
+ const QRectF& r = rects[0];
+ QRect alignedRect = r.toAlignedRect();
+ if (r != QRectF(alignedRect)) {
+ QPaintEngine::drawRects(rects, rectCount);
+ return;
+ }
+ alignedRect.translate(alignedOffset);
+
+ QRect clip(d->polygonClipper.boundingRect());
+ alignedRect = alignedRect.intersected(clip);
+ if (alignedRect.isEmpty())
+ return;
+
+ // simple-case:
+ // the rectangle is pixel-aligned
+ // the fill brush is just a solid non-alpha color
+ // the painter transform is only integer translation
+ // ignore: antialiasing and just XFillRectangles directly
+ XRectangle xrect;
+ xrect.x = short(alignedRect.x());
+ xrect.y = short(alignedRect.y());
+ xrect.width = ushort(alignedRect.width());
+ xrect.height = ushort(alignedRect.height());
+ XFillRectangles(d->dpy, d->hd, d->gc_brush, &xrect, 1);
+}
+
+void QX11PaintEngine::drawRects(const QRect *rects, int rectCount)
+{
+ Q_D(QX11PaintEngine);
+ Q_ASSERT(rects);
+ Q_ASSERT(rectCount);
+
+ if (d->has_alpha_pen
+ || d->has_complex_xform
+ || d->has_custom_pen
+ || (d->render_hints & QPainter::Antialiasing))
+ {
+ for (int i = 0; i < rectCount; ++i) {
+ QPainterPath path;
+ path.addRect(rects[i]);
+ drawPath(path);
+ }
+ return;
+ }
+
+ QRect clip(d->polygonClipper.boundingRect());
+ QPoint offset(qRound(d->matrix.dx()), qRound(d->matrix.dy()));
+#if QT_CONFIG(xrender)
+ ::Picture pict = d->picture;
+
+ if (X11->use_xrender && pict && d->has_brush && d->pdev_depth != 1
+ && (d->has_texture || d->has_alpha_brush || complexPictOp(d->composition_mode)))
+ {
+ XRenderColor xc;
+ if (!d->has_texture && !d->has_pattern)
+ xc = X11->preMultiply(d->cbrush.color());
+
+ for (int i = 0; i < rectCount; ++i) {
+ QRect r(rects[i]);
+ if (d->txop == QTransform::TxTranslate)
+ r.translate(offset);
+
+ if (r.width() == 0 || r.height() == 0) {
+ if (d->has_pen) {
+ const QLine l = clipStraightLine(clip, QLine(r.left(), r.top(), r.left() + r.width(), r.top() + r.height()));
+ XDrawLine(d->dpy, d->hd, d->gc, l.p1().x(), l.p1().y(), l.p2().x(), l.p2().y());
+ }
+ continue;
+ }
+
+ r = r.intersected(clip);
+ if (r.isEmpty())
+ continue;
+ if (d->has_texture || d->has_pattern) {
+ XRenderComposite(d->dpy, d->composition_mode, d->current_brush, 0, pict,
+ qRound(r.x() - d->bg_origin.x()), qRound(r.y() - d->bg_origin.y()),
+ 0, 0, r.x(), r.y(), r.width(), r.height());
+ } else {
+ XRenderFillRectangle(d->dpy, d->composition_mode, pict, &xc, r.x(), r.y(), r.width(), r.height());
+ }
+ if (d->has_pen)
+ XDrawRectangle(d->dpy, d->hd, d->gc, r.x(), r.y(), r.width(), r.height());
+ }
+ } else
+#endif // QT_CONFIG(xrender)
+ {
+ if (d->has_brush && d->has_pen) {
+ for (int i = 0; i < rectCount; ++i) {
+ QRect r(rects[i]);
+ if (d->txop == QTransform::TxTranslate)
+ r.translate(offset);
+
+ if (r.width() == 0 || r.height() == 0) {
+ const QLine l = clipStraightLine(clip, QLine(r.left(), r.top(), r.left() + r.width(), r.top() + r.height()));
+ XDrawLine(d->dpy, d->hd, d->gc, l.p1().x(), l.p1().y(), l.p2().x(), l.p2().y());
+ continue;
+ }
+
+ r = r.intersected(clip);
+ if (r.isEmpty())
+ continue;
+ d->setupAdaptedOrigin(r.topLeft());
+ XFillRectangle(d->dpy, d->hd, d->gc_brush, r.x(), r.y(), r.width(), r.height());
+ XDrawRectangle(d->dpy, d->hd, d->gc, r.x(), r.y(), r.width(), r.height());
+ }
+ d->resetAdaptedOrigin();
+ } else {
+ QVarLengthArray<XRectangle> xrects(rectCount);
+ int numClipped = rectCount;
+ for (int i = 0; i < rectCount; ++i) {
+ QRect r(rects[i]);
+ if (d->txop == QTransform::TxTranslate)
+ r.translate(offset);
+
+ if (r.width() == 0 || r.height() == 0) {
+ --numClipped;
+ if (d->has_pen) {
+ const QLine l = clipStraightLine(clip, QLine(r.left(), r.top(), r.left() + r.width(), r.top() + r.height()));
+ XDrawLine(d->dpy, d->hd, d->gc, l.p1().x(), l.p1().y(), l.p2().x(), l.p2().y());
+ }
+ continue;
+ }
+
+ r = r.intersected(clip);
+ if (r.isEmpty()) {
+ --numClipped;
+ continue;
+ }
+ xrects[i].x = short(r.x());
+ xrects[i].y = short(r.y());
+ xrects[i].width = ushort(r.width());
+ xrects[i].height = ushort(r.height());
+ }
+ if (numClipped) {
+ d->setupAdaptedOrigin(rects[0].topLeft());
+ if (d->has_brush)
+ XFillRectangles(d->dpy, d->hd, d->gc_brush, xrects.data(), numClipped);
+ else if (d->has_pen)
+ XDrawRectangles(d->dpy, d->hd, d->gc, xrects.data(), numClipped);
+ d->resetAdaptedOrigin();
+ }
+ }
+ }
+}
+
+static inline void setCapStyle(int cap_style, GC gc)
+{
+ ulong mask = GCCapStyle;
+ XGCValues vals;
+ vals.cap_style = cap_style;
+ XChangeGC(QXcbX11Info::display(), gc, mask, &vals);
+}
+
+void QX11PaintEngine::drawPoints(const QPoint *points, int pointCount)
+{
+ Q_ASSERT(points);
+ Q_ASSERT(pointCount);
+ Q_D(QX11PaintEngine);
+
+ if (!d->has_pen)
+ return;
+
+ // use the same test here as in drawPath to ensure that we don't use the path fallback
+ // and end up in XDrawLines for pens with width <= 1
+ if (d->cpen.widthF() > 1.0f
+ || (X11->use_xrender && (d->has_alpha_pen || (d->render_hints & QPainter::Antialiasing)))
+ || (!d->isCosmeticPen() && d->txop > QTransform::TxTranslate))
+ {
+ Qt::PenCapStyle capStyle = d->cpen.capStyle();
+ if (capStyle == Qt::FlatCap) {
+ setCapStyle(CapProjecting, d->gc);
+ d->cpen.setCapStyle(Qt::SquareCap);
+ }
+ const QPoint *end = points + pointCount;
+ while (points < end) {
+ QPainterPath path;
+ path.moveTo(*points);
+ path.lineTo(points->x()+.005, points->y());
+ drawPath(path);
+ ++points;
+ }
+
+ if (capStyle == Qt::FlatCap) {
+ setCapStyle(CapButt, d->gc);
+ d->cpen.setCapStyle(capStyle);
+ }
+ return;
+ }
+
+ static const int BUF_SIZE = 1024;
+ XPoint xPoints[BUF_SIZE];
+ int i = 0, j = 0;
+ while (i < pointCount) {
+ while (i < pointCount && j < BUF_SIZE) {
+ const QPoint &xformed = d->matrix.map(points[i]);
+ int x = xformed.x();
+ int y = xformed.y();
+ if (x >= SHRT_MIN && y >= SHRT_MIN && x < SHRT_MAX && y < SHRT_MAX) {
+ xPoints[j].x = x;
+ xPoints[j].y = y;
+ ++j;
+ }
+ ++i;
+ }
+ if (j)
+ XDrawPoints(d->dpy, d->hd, d->gc, xPoints, j, CoordModeOrigin);
+
+ j = 0;
+ }
+}
+
+void QX11PaintEngine::drawPoints(const QPointF *points, int pointCount)
+{
+ Q_ASSERT(points);
+ Q_ASSERT(pointCount);
+ Q_D(QX11PaintEngine);
+
+ if (!d->has_pen)
+ return;
+
+ // use the same test here as in drawPath to ensure that we don't use the path fallback
+ // and end up in XDrawLines for pens with width <= 1
+ if (d->cpen.widthF() > 1.0f
+ || (X11->use_xrender && (d->has_alpha_pen || (d->render_hints & QPainter::Antialiasing)))
+ || (!d->isCosmeticPen() && d->txop > QTransform::TxTranslate))
+ {
+ Qt::PenCapStyle capStyle = d->cpen.capStyle();
+ if (capStyle == Qt::FlatCap) {
+ setCapStyle(CapProjecting, d->gc);
+ d->cpen.setCapStyle(Qt::SquareCap);
+ }
+
+ const QPointF *end = points + pointCount;
+ while (points < end) {
+ QPainterPath path;
+ path.moveTo(*points);
+ path.lineTo(points->x() + 0.005, points->y());
+ drawPath(path);
+ ++points;
+ }
+ if (capStyle == Qt::FlatCap) {
+ setCapStyle(CapButt, d->gc);
+ d->cpen.setCapStyle(capStyle);
+ }
+ return;
+ }
+
+ static const int BUF_SIZE = 1024;
+ XPoint xPoints[BUF_SIZE];
+ int i = 0, j = 0;
+ while (i < pointCount) {
+ while (i < pointCount && j < BUF_SIZE) {
+ const QPointF &xformed = d->matrix.map(points[i]);
+ int x = qFloor(xformed.x());
+ int y = qFloor(xformed.y());
+
+ if (x >= SHRT_MIN && y >= SHRT_MIN && x < SHRT_MAX && y < SHRT_MAX) {
+ xPoints[j].x = x;
+ xPoints[j].y = y;
+ ++j;
+ }
+ ++i;
+ }
+ if (j)
+ XDrawPoints(d->dpy, d->hd, d->gc, xPoints, j, CoordModeOrigin);
+
+ j = 0;
+ }
+}
+
+QPainter::RenderHints QX11PaintEngine::supportedRenderHints() const
+{
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender)
+ return QPainter::Antialiasing;
+#endif
+ return QFlag(0);
+}
+
+void QX11PaintEngine::updateState(const QPaintEngineState &state)
+{
+ Q_D(QX11PaintEngine);
+ QPaintEngine::DirtyFlags flags = state.state();
+
+
+ if (flags & DirtyOpacity) {
+ d->opacity = state.opacity();
+ // Force update pen/brush as to get proper alpha colors propagated
+ flags |= DirtyPen;
+ flags |= DirtyBrush;
+ }
+
+ if (flags & DirtyTransform) updateMatrix(state.transform());
+ if (flags & DirtyPen) updatePen(state.pen());
+ if (flags & (DirtyBrush | DirtyBrushOrigin)) updateBrush(state.brush(), state.brushOrigin());
+ if (flags & DirtyFont) updateFont(state.font());
+
+ if (state.state() & DirtyClipEnabled) {
+ if (state.isClipEnabled()) {
+ QPolygonF clip_poly_dev(d->matrix.map(painter()->clipPath().toFillPolygon()));
+ QPolygonF clipped_poly_dev;
+ d->clipPolygon_dev(clip_poly_dev, &clipped_poly_dev);
+ updateClipRegion_dev(QRegion(clipped_poly_dev.toPolygon()), Qt::ReplaceClip);
+ } else {
+ updateClipRegion_dev(QRegion(), Qt::NoClip);
+ }
+ }
+
+ if (flags & DirtyClipPath) {
+ QPolygonF clip_poly_dev(d->matrix.map(state.clipPath().toFillPolygon()));
+ QPolygonF clipped_poly_dev;
+ d->clipPolygon_dev(clip_poly_dev, &clipped_poly_dev);
+ updateClipRegion_dev(QRegion(clipped_poly_dev.toPolygon(), state.clipPath().fillRule()),
+ state.clipOperation());
+ } else if (flags & DirtyClipRegion) {
+ extern QPainterPath qt_regionToPath(const QRegion &region);
+ QPainterPath clip_path = qt_regionToPath(state.clipRegion());
+ QPolygonF clip_poly_dev(d->matrix.map(clip_path.toFillPolygon()));
+ QPolygonF clipped_poly_dev;
+ d->clipPolygon_dev(clip_poly_dev, &clipped_poly_dev);
+ updateClipRegion_dev(QRegion(clipped_poly_dev.toPolygon()), state.clipOperation());
+ }
+ if (flags & DirtyHints) updateRenderHints(state.renderHints());
+ if (flags & DirtyCompositionMode) {
+ int function = GXcopy;
+ if (state.compositionMode() >= QPainter::RasterOp_SourceOrDestination) {
+ switch (state.compositionMode()) {
+ case QPainter::RasterOp_SourceOrDestination:
+ function = GXor;
+ break;
+ case QPainter::RasterOp_SourceAndDestination:
+ function = GXand;
+ break;
+ case QPainter::RasterOp_SourceXorDestination:
+ function = GXxor;
+ break;
+ case QPainter::RasterOp_NotSourceAndNotDestination:
+ function = GXnor;
+ break;
+ case QPainter::RasterOp_NotSourceOrNotDestination:
+ function = GXnand;
+ break;
+ case QPainter::RasterOp_NotSourceXorDestination:
+ function = GXequiv;
+ break;
+ case QPainter::RasterOp_NotSource:
+ function = GXcopyInverted;
+ break;
+ case QPainter::RasterOp_SourceAndNotDestination:
+ function = GXandReverse;
+ break;
+ case QPainter::RasterOp_NotSourceAndDestination:
+ function = GXandInverted;
+ break;
+ default:
+ function = GXcopy;
+ }
+ }
+#if QT_CONFIG(xrender)
+ else {
+ d->composition_mode =
+ qpainterOpToXrender(state.compositionMode());
+ }
+#endif
+ XSetFunction(X11->display, d->gc, function);
+ XSetFunction(X11->display, d->gc_brush, function);
+ }
+ d->decidePathFallback();
+ d->decideCoordAdjust();
+}
+
+void QX11PaintEngine::updateRenderHints(QPainter::RenderHints hints)
+{
+ Q_D(QX11PaintEngine);
+ d->render_hints = hints;
+
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender && d->picture) {
+ XRenderPictureAttributes attrs;
+ attrs.poly_edge = (hints & QPainter::Antialiasing) ? PolyEdgeSmooth : PolyEdgeSharp;
+ XRenderChangePicture(d->dpy, d->picture, CPPolyEdge, &attrs);
+ }
+#endif
+}
+
+void QX11PaintEngine::updatePen(const QPen &pen)
+{
+ Q_D(QX11PaintEngine);
+ d->cpen = pen;
+ int cp = CapButt;
+ int jn = JoinMiter;
+ int ps = pen.style();
+
+ if (d->opacity < 1.0) {
+ QColor c = d->cpen.color();
+ c.setAlpha(qRound(c.alpha()*d->opacity));
+ d->cpen.setColor(c);
+ }
+
+ d->has_pen = (ps != Qt::NoPen);
+ d->has_alpha_pen = (pen.color().alpha() != 255);
+
+ switch (pen.capStyle()) {
+ case Qt::SquareCap:
+ cp = CapProjecting;
+ break;
+ case Qt::RoundCap:
+ cp = CapRound;
+ break;
+ case Qt::FlatCap:
+ default:
+ cp = CapButt;
+ break;
+ }
+ switch (pen.joinStyle()) {
+ case Qt::BevelJoin:
+ jn = JoinBevel;
+ break;
+ case Qt::RoundJoin:
+ jn = JoinRound;
+ break;
+ case Qt::MiterJoin:
+ default:
+ jn = JoinMiter;
+ break;
+ }
+
+ d->adapted_pen_origin = false;
+
+ char dashes[10]; // custom pen dashes
+ int dash_len = 0; // length of dash list
+ int xStyle = LineSolid;
+
+ /*
+ We are emulating Windows here. Windows treats cpen.width() == 1
+ (or 0) as a very special case. The fudge variable unifies this
+ case with the general case.
+ */
+ qreal pen_width = pen.widthF();
+ int scale = qRound(pen_width < 1 ? 1 : pen_width);
+ int space = (pen_width < 1 && pen_width > 0 ? 1 : (2 * scale));
+ int dot = 1 * scale;
+ int dash = 4 * scale;
+
+ d->has_custom_pen = false;
+
+ switch (ps) {
+ case Qt::NoPen:
+ case Qt::SolidLine:
+ xStyle = LineSolid;
+ break;
+ case Qt::DashLine:
+ dashes[0] = dash;
+ dashes[1] = space;
+ dash_len = 2;
+ xStyle = LineOnOffDash;
+ break;
+ case Qt::DotLine:
+ dashes[0] = dot;
+ dashes[1] = space;
+ dash_len = 2;
+ xStyle = LineOnOffDash;
+ break;
+ case Qt::DashDotLine:
+ dashes[0] = dash;
+ dashes[1] = space;
+ dashes[2] = dot;
+ dashes[3] = space;
+ dash_len = 4;
+ xStyle = LineOnOffDash;
+ break;
+ case Qt::DashDotDotLine:
+ dashes[0] = dash;
+ dashes[1] = space;
+ dashes[2] = dot;
+ dashes[3] = space;
+ dashes[4] = dot;
+ dashes[5] = space;
+ dash_len = 6;
+ xStyle = LineOnOffDash;
+ break;
+ case Qt::CustomDashLine:
+ d->has_custom_pen = true;
+ break;
+ }
+
+ ulong mask = GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth
+ | GCCapStyle | GCJoinStyle | GCLineStyle;
+ XGCValues vals;
+ vals.graphics_exposures = false;
+ if (d->pdev_depth == 1) {
+ vals.foreground = qGray(pen.color().rgb()) > 127 ? 0 : 1;
+ vals.background = qGray(QColor(Qt::transparent).rgb()) > 127 ? 0 : 1;
+ } else if (d->pdev->devType() == QInternal::Pixmap && d->pdev_depth == 32
+ && X11->use_xrender) {
+ vals.foreground = pen.color().rgba();
+ vals.background = QColor(Qt::transparent).rgba();
+ } else {
+ QXcbColormap cmap = QXcbColormap::instance(d->scrn);
+ vals.foreground = cmap.pixel(pen.color());
+ vals.background = cmap.pixel(QColor(Qt::transparent));
+ }
+
+
+ vals.line_width = qRound(pen.widthF());
+ vals.cap_style = cp;
+ vals.join_style = jn;
+ vals.line_style = xStyle;
+
+ XChangeGC(d->dpy, d->gc, mask, &vals);
+
+ if (dash_len) { // make dash list
+ XSetDashes(d->dpy, d->gc, 0, dashes, dash_len);
+ }
+
+ if (!d->has_clipping) { // if clipping is set the paintevent clip region is merged with the clip region
+ QRegion sysClip = systemClip();
+ if (!sysClip.isEmpty())
+ x11SetClipRegion(d->dpy, d->gc, 0, d->picture, sysClip);
+ else
+ x11ClearClipRegion(d->dpy, d->gc, 0, d->picture);
+ }
+}
+
+void QX11PaintEngine::updateBrush(const QBrush &brush, const QPointF &origin)
+{
+ Q_D(QX11PaintEngine);
+ d->cbrush = brush;
+ d->bg_origin = origin;
+ d->adapted_brush_origin = false;
+#if QT_CONFIG(xrender)
+ d->current_brush = 0;
+#endif
+ if (d->opacity < 1.0) {
+ QColor c = d->cbrush.color();
+ c.setAlpha(qRound(c.alpha()*d->opacity));
+ d->cbrush.setColor(c);
+ }
+
+ int s = FillSolid;
+ int bs = d->cbrush.style();
+ d->has_brush = (bs != Qt::NoBrush);
+ d->has_pattern = bs >= Qt::Dense1Pattern && bs <= Qt::DiagCrossPattern;
+ d->has_texture = bs == Qt::TexturePattern;
+ d->has_alpha_brush = brush.color().alpha() != 255;
+ d->has_alpha_texture = d->has_texture && d->cbrush.texture().hasAlphaChannel();
+
+ ulong mask = GCForeground | GCBackground | GCGraphicsExposures
+ | GCLineStyle | GCCapStyle | GCJoinStyle | GCFillStyle;
+ XGCValues vals;
+ vals.graphics_exposures = false;
+ if (d->pdev_depth == 1) {
+ vals.foreground = qGray(d->cbrush.color().rgb()) > 127 ? 0 : 1;
+ vals.background = qGray(QColor(Qt::transparent).rgb()) > 127 ? 0 : 1;
+ } else if (X11->use_xrender && d->pdev->devType() == QInternal::Pixmap
+ && d->pdev_depth == 32) {
+ vals.foreground = d->cbrush.color().rgba();
+ vals.background = QColor(Qt::transparent).rgba();
+ } else {
+ QXcbColormap cmap = QXcbColormap::instance(d->scrn);
+ vals.foreground = cmap.pixel(d->cbrush.color());
+ vals.background = cmap.pixel(QColor(Qt::transparent));
+
+ if (!X11->use_xrender && d->has_brush && !d->has_pattern && !brush.isOpaque()) {
+ QPixmap pattern = qt_patternForAlpha(brush.color().alpha(), d->scrn);
+ mask |= GCStipple;
+ vals.stipple = qt_x11PixmapHandle(pattern);
+ s = FillStippled;
+ d->adapted_brush_origin = true;
+ }
+ }
+ vals.cap_style = CapButt;
+ vals.join_style = JoinMiter;
+ vals.line_style = LineSolid;
+
+ if (d->has_pattern || d->has_texture) {
+ if (bs == Qt::TexturePattern) {
+ d->brush_pm = qt_toX11Pixmap(d->cbrush.texture());
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ XRenderPictureAttributes attrs;
+ attrs.repeat = true;
+ XRenderChangePicture(d->dpy, qt_x11PictureHandle(d->brush_pm), CPRepeat, &attrs);
+ QX11PlatformPixmap *data = static_cast<QX11PlatformPixmap*>(d->brush_pm.handle());
+ if (data->mask_picture)
+ XRenderChangePicture(d->dpy, data->mask_picture, CPRepeat, &attrs);
+ }
+#endif
+ } else {
+ d->brush_pm = qt_toX11Pixmap(qt_pixmapForBrush(bs, true));
+ }
+ qt_x11SetScreen(d->brush_pm, d->scrn);
+ if (d->brush_pm.depth() == 1) {
+ mask |= GCStipple;
+ vals.stipple = qt_x11PixmapHandle(d->brush_pm);
+ s = FillStippled;
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ d->bitmap_texture = QPixmap(d->brush_pm.size());
+ d->bitmap_texture.fill(Qt::transparent);
+ d->bitmap_texture = qt_toX11Pixmap(d->bitmap_texture);
+ qt_x11SetScreen(d->bitmap_texture, d->scrn);
+
+ ::Picture src = X11->getSolidFill(d->scrn, d->cbrush.color());
+ XRenderComposite(d->dpy, PictOpSrc, src, qt_x11PictureHandle(d->brush_pm),
+ qt_x11PictureHandle(d->bitmap_texture),
+ 0, 0, d->brush_pm.width(), d->brush_pm.height(),
+ 0, 0, d->brush_pm.width(), d->brush_pm.height());
+
+ XRenderPictureAttributes attrs;
+ attrs.repeat = true;
+ XRenderChangePicture(d->dpy, qt_x11PictureHandle(d->bitmap_texture), CPRepeat, &attrs);
+
+ d->current_brush = qt_x11PictureHandle(d->bitmap_texture);
+ }
+#endif
+ } else {
+ mask |= GCTile;
+#if QT_CONFIG(xrender)
+ if (d->pdev_depth == 32 && d->brush_pm.depth() != 32) {
+ d->brush_pm.detach();
+ QX11PlatformPixmap *brushData = static_cast<QX11PlatformPixmap*>(d->brush_pm.handle());
+ brushData->convertToARGB32();
+ }
+#endif
+ vals.tile = (d->brush_pm.depth() == d->pdev_depth
+ ? qt_x11PixmapHandle(d->brush_pm)
+ : static_cast<QX11PlatformPixmap*>(d->brush_pm.handle())->x11ConvertToDefaultDepth());
+ s = FillTiled;
+#if QT_CONFIG(xrender)
+ d->current_brush = qt_x11PictureHandle(d->cbrush.texture());
+#endif
+ }
+
+ mask |= GCTileStipXOrigin | GCTileStipYOrigin;
+ vals.ts_x_origin = qRound(origin.x());
+ vals.ts_y_origin = qRound(origin.y());
+ }
+#if QT_CONFIG(xrender)
+ else if (d->has_alpha_brush) {
+ d->current_brush = X11->getSolidFill(d->scrn, d->cbrush.color());
+ }
+#endif
+
+ vals.fill_style = s;
+ XChangeGC(d->dpy, d->gc_brush, mask, &vals);
+ if (!d->has_clipping) {
+ QRegion sysClip = systemClip();
+ if (!sysClip.isEmpty())
+ x11SetClipRegion(d->dpy, d->gc_brush, 0, d->picture, sysClip);
+ else
+ x11ClearClipRegion(d->dpy, d->gc_brush, 0, d->picture);
+ }
+}
+
+void QX11PaintEngine::drawEllipse(const QRectF &rect)
+{
+ QRect aligned = rect.toAlignedRect();
+ if (aligned == rect)
+ drawEllipse(aligned);
+ else
+ QPaintEngine::drawEllipse(rect);
+}
+
+void QX11PaintEngine::drawEllipse(const QRect &rect)
+{
+ if (rect.isEmpty()) {
+ drawRects(&rect, 1);
+ return;
+ }
+
+ Q_D(QX11PaintEngine);
+ QRect devclip(SHRT_MIN, SHRT_MIN, SHRT_MAX*2 - 1, SHRT_MAX*2 - 1);
+ QRect r(rect);
+ if (d->txop < QTransform::TxRotate) {
+ r = d->matrix.mapRect(rect);
+ } else if (d->txop == QTransform::TxRotate && rect.width() == rect.height()) {
+ QPainterPath path;
+ path.addEllipse(rect);
+ r = d->matrix.map(path).boundingRect().toRect();
+ }
+
+ if (d->has_alpha_brush || d->has_alpha_pen || d->has_custom_pen || (d->render_hints & QPainter::Antialiasing)
+ || d->has_alpha_texture || devclip.intersected(r) != r
+ || (d->has_complex_xform
+ && !(d->has_non_scaling_xform && rect.width() == rect.height())))
+ {
+ QPainterPath path;
+ path.addEllipse(rect);
+ drawPath(path);
+ return;
+ }
+
+ int x = r.x();
+ int y = r.y();
+ int w = r.width();
+ int h = r.height();
+ if (w < 1 || h < 1)
+ return;
+ if (w == 1 && h == 1) {
+ XDrawPoint(d->dpy, d->hd, d->has_pen ? d->gc : d->gc_brush, x, y);
+ return;
+ }
+ d->setupAdaptedOrigin(rect.topLeft());
+ if (d->has_brush) { // draw filled ellipse
+ XFillArc(d->dpy, d->hd, d->gc_brush, x, y, w, h, 0, 360*64);
+ if (!d->has_pen) // make smoother outline
+ XDrawArc(d->dpy, d->hd, d->gc_brush, x, y, w-1, h-1, 0, 360*64);
+ }
+ if (d->has_pen) // draw outline
+ XDrawArc(d->dpy, d->hd, d->gc, x, y, w, h, 0, 360*64);
+ d->resetAdaptedOrigin();
+}
+
+
+
+void QX11PaintEnginePrivate::fillPolygon_translated(const QPointF *polygonPoints, int pointCount,
+ QX11PaintEnginePrivate::GCMode gcMode,
+ QPaintEngine::PolygonDrawMode mode)
+{
+
+ QVarLengthArray<QPointF> translated_points(pointCount);
+ QPointF offset(matrix.dx(), matrix.dy());
+
+ qreal offs = adjust_coords ? aliasedCoordinateDelta : 0.0;
+ if (!X11->use_xrender || !(render_hints & QPainter::Antialiasing))
+ offset += QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta);
+
+ for (int i = 0; i < pointCount; ++i) {
+ translated_points[i] = polygonPoints[i] + offset;
+
+ translated_points[i].rx() = qRound(translated_points[i].x()) + offs;
+ translated_points[i].ry() = qRound(translated_points[i].y()) + offs;
+ }
+
+ fillPolygon_dev(translated_points.data(), pointCount, gcMode, mode);
+}
+
+#if QT_CONFIG(xrender)
+static void qt_XRenderCompositeTrapezoids(Display *dpy,
+ int op,
+ Picture src,
+ Picture dst,
+ _Xconst XRenderPictFormat *maskFormat,
+ int xSrc,
+ int ySrc,
+ const XTrapezoid *traps, int size)
+{
+ const int MAX_TRAPS = 50000;
+ while (size) {
+ int to_draw = size;
+ if (to_draw > MAX_TRAPS)
+ to_draw = MAX_TRAPS;
+ XRenderCompositeTrapezoids(dpy, op, src, dst,
+ maskFormat,
+ xSrc, ySrc,
+ traps, to_draw);
+ size -= to_draw;
+ traps += to_draw;
+ }
+}
+#endif
+
+void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int pointCount,
+ QX11PaintEnginePrivate::GCMode gcMode,
+ QPaintEngine::PolygonDrawMode mode)
+{
+ Q_Q(QX11PaintEngine);
+
+ int clippedCount = 0;
+ qt_float_point *clippedPoints = 0;
+
+#if QT_CONFIG(xrender)
+ //can change if we switch to pen if gcMode != BrushGC
+ bool has_fill_texture = has_texture;
+ bool has_fill_pattern = has_pattern;
+ ::Picture src;
+#endif
+ QBrush fill;
+ GC fill_gc;
+ if (gcMode == BrushGC) {
+ fill = cbrush;
+ fill_gc = gc_brush;
+#if QT_CONFIG(xrender)
+ if (current_brush)
+ src = current_brush;
+ else
+ src = X11->getSolidFill(scrn, fill.color());
+#endif
+ } else {
+ fill = QBrush(cpen.brush());
+ fill_gc = gc;
+#if QT_CONFIG(xrender)
+ //we use the pens brush
+ has_fill_texture = (fill.style() == Qt::TexturePattern);
+ has_fill_pattern = (fill.style() >= Qt::Dense1Pattern && fill.style() <= Qt::DiagCrossPattern);
+ if (has_fill_texture)
+ src = qt_x11PictureHandle(fill.texture());
+ else if (has_fill_pattern)
+ src = getPatternFill(scrn, fill);
+ else
+ src = X11->getSolidFill(scrn, fill.color());
+#endif
+ }
+
+ polygonClipper.clipPolygon((qt_float_point *) polygonPoints, pointCount,
+ &clippedPoints, &clippedCount);
+
+#if QT_CONFIG(xrender)
+ bool solid_fill = fill.color().alpha() == 255;
+ if (has_fill_texture && fill.texture().depth() == 1 && solid_fill) {
+ has_fill_texture = false;
+ has_fill_pattern = true;
+ }
+
+ bool antialias = render_hints & QPainter::Antialiasing;
+
+ if (X11->use_xrender
+ && picture
+ && !has_fill_pattern
+ && (clippedCount > 0)
+ && (fill.style() != Qt::NoBrush)
+ && ((has_fill_texture && fill.texture().hasAlpha()) || antialias || !solid_fill || has_alpha_pen != has_alpha_brush))
+ {
+ tessellator->tessellate((QPointF *)clippedPoints, clippedCount,
+ mode == QPaintEngine::WindingMode);
+ if (tessellator->size > 0) {
+ XRenderPictureAttributes attrs;
+ attrs.poly_edge = antialias ? PolyEdgeSmooth : PolyEdgeSharp;
+ XRenderChangePicture(dpy, picture, CPPolyEdge, &attrs);
+ int x_offset = int(XFixedToDouble(tessellator->traps[0].left.p1.x) - bg_origin.x());
+ int y_offset = int(XFixedToDouble(tessellator->traps[0].left.p1.y) - bg_origin.y());
+ qt_XRenderCompositeTrapezoids(dpy, composition_mode, src, picture,
+ antialias
+ ? XRenderFindStandardFormat(dpy, PictStandardA8)
+ : XRenderFindStandardFormat(dpy, PictStandardA1),
+ x_offset, y_offset,
+ tessellator->traps, tessellator->size);
+ tessellator->done();
+ }
+ } else
+#endif
+ if (fill.style() != Qt::NoBrush) {
+ if (clippedCount > 200000) {
+ QPolygon poly;
+ for (int i = 0; i < clippedCount; ++i)
+ poly << QPoint(qFloor(clippedPoints[i].x), qFloor(clippedPoints[i].y));
+
+ const QRect bounds = poly.boundingRect();
+ const QRect aligned = bounds
+ & QRect(QPoint(), QSize(pdev->width(), pdev->height()));
+
+ QImage img(aligned.size(), QImage::Format_ARGB32_Premultiplied);
+ img.fill(0);
+
+ QPainter painter(&img);
+ painter.translate(-aligned.x(), -aligned.y());
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(fill);
+ if (gcMode == BrushGC)
+ painter.setBrushOrigin(q->painter()->brushOrigin());
+ painter.drawPolygon(poly);
+ painter.end();
+
+ q->drawImage(aligned, img, img.rect(), Qt::AutoColor);
+ } else if (clippedCount > 0) {
+ QVarLengthArray<XPoint> xpoints(clippedCount);
+ for (int i = 0; i < clippedCount; ++i) {
+ xpoints[i].x = qFloor(clippedPoints[i].x);
+ xpoints[i].y = qFloor(clippedPoints[i].y);
+ }
+ if (mode == QPaintEngine::WindingMode)
+ XSetFillRule(dpy, fill_gc, WindingRule);
+ setupAdaptedOrigin(QPoint(xpoints[0].x, xpoints[0].y));
+ XFillPolygon(dpy, hd, fill_gc,
+ xpoints.data(), clippedCount,
+ mode == QPaintEngine::ConvexMode ? Convex : Complex, CoordModeOrigin);
+ resetAdaptedOrigin();
+ if (mode == QPaintEngine::WindingMode)
+ XSetFillRule(dpy, fill_gc, EvenOddRule);
+ }
+ }
+}
+
+void QX11PaintEnginePrivate::strokePolygon_translated(const QPointF *polygonPoints, int pointCount, bool close)
+{
+ QVarLengthArray<QPointF> translated_points(pointCount);
+ QPointF offset(matrix.dx(), matrix.dy());
+ for (int i = 0; i < pointCount; ++i)
+ translated_points[i] = polygonPoints[i] + offset;
+ strokePolygon_dev(translated_points.data(), pointCount, close);
+}
+
+void QX11PaintEnginePrivate::strokePolygon_dev(const QPointF *polygonPoints, int pointCount, bool close)
+{
+ int clippedCount = 0;
+ qt_float_point *clippedPoints = 0;
+ polygonClipper.clipPolygon((qt_float_point *) polygonPoints, pointCount,
+ &clippedPoints, &clippedCount, close);
+
+ if (clippedCount > 0) {
+ QVarLengthArray<XPoint> xpoints(clippedCount);
+ for (int i = 0; i < clippedCount; ++i) {
+ xpoints[i].x = qRound(clippedPoints[i].x + aliasedCoordinateDelta);
+ xpoints[i].y = qRound(clippedPoints[i].y + aliasedCoordinateDelta);
+ }
+ uint numberPoints = qMin(clippedCount, xlibMaxLinePoints);
+ XPoint *pts = xpoints.data();
+ XDrawLines(dpy, hd, gc, pts, numberPoints, CoordModeOrigin);
+ pts += numberPoints;
+ clippedCount -= numberPoints;
+ numberPoints = qMin(clippedCount, xlibMaxLinePoints-1);
+ while (clippedCount) {
+ XDrawLines(dpy, hd, gc, pts-1, numberPoints+1, CoordModeOrigin);
+ pts += numberPoints;
+ clippedCount -= numberPoints;
+ numberPoints = qMin(clippedCount, xlibMaxLinePoints-1);
+ }
+ }
+}
+
+void QX11PaintEngine::drawPolygon(const QPointF *polygonPoints, int pointCount, PolygonDrawMode mode)
+{
+ Q_D(QX11PaintEngine);
+
+ if (d->use_path_fallback) {
+ QPainterPath path(polygonPoints[0]);
+ for (int i = 1; i < pointCount; ++i)
+ path.lineTo(polygonPoints[i]);
+ if (mode == PolylineMode) {
+ QBrush oldBrush = d->cbrush;
+ d->cbrush = QBrush(Qt::NoBrush);
+ path.setFillRule(Qt::WindingFill);
+ drawPath(path);
+ d->cbrush = oldBrush;
+ } else {
+ path.setFillRule(mode == OddEvenMode ? Qt::OddEvenFill : Qt::WindingFill);
+ path.closeSubpath();
+ drawPath(path);
+ }
+ return;
+ }
+ if (mode != PolylineMode && d->has_brush)
+ d->fillPolygon_translated(polygonPoints, pointCount, QX11PaintEnginePrivate::BrushGC, mode);
+
+ if (d->has_pen)
+ d->strokePolygon_translated(polygonPoints, pointCount, mode != PolylineMode);
+}
+
+
+void QX11PaintEnginePrivate::fillPath(const QPainterPath &path, QX11PaintEnginePrivate::GCMode gc_mode, bool transform)
+{
+ qreal offs = adjust_coords ? aliasedCoordinateDelta : 0.0;
+
+ QPainterPath clippedPath;
+ QPainterPath clipPath;
+ clipPath.addRect(polygonClipper.boundingRect());
+
+ if (transform)
+ clippedPath = (path*matrix).intersected(clipPath);
+ else
+ clippedPath = path.intersected(clipPath);
+
+ QList<QPolygonF> polys = clippedPath.toFillPolygons();
+ for (int i = 0; i < polys.size(); ++i) {
+ QVarLengthArray<QPointF> translated_points(polys.at(i).size());
+
+ for (int j = 0; j < polys.at(i).size(); ++j) {
+ translated_points[j] = polys.at(i).at(j);
+ if (!X11->use_xrender || !(render_hints & QPainter::Antialiasing)) {
+ translated_points[j].rx() = qRound(translated_points[j].rx() + aliasedCoordinateDelta) + offs;
+ translated_points[j].ry() = qRound(translated_points[j].ry() + aliasedCoordinateDelta) + offs;
+ }
+ }
+
+ fillPolygon_dev(translated_points.data(), polys.at(i).size(), gc_mode,
+ path.fillRule() == Qt::OddEvenFill ? QPaintEngine::OddEvenMode : QPaintEngine::WindingMode);
+ }
+}
+
+void QX11PaintEngine::drawPath(const QPainterPath &path)
+{
+ Q_D(QX11PaintEngine);
+ if (path.isEmpty())
+ return;
+
+ if (d->has_brush)
+ d->fillPath(path, QX11PaintEnginePrivate::BrushGC, true);
+ if (d->has_pen
+ && ((X11->use_xrender && (d->has_alpha_pen || (d->render_hints & QPainter::Antialiasing)))
+ || (!d->isCosmeticPen() && d->txop > QTransform::TxTranslate
+ && !d->has_non_scaling_xform)
+ || (d->cpen.style() == Qt::CustomDashLine))) {
+ QPainterPathStroker stroker;
+ if (d->cpen.style() == Qt::CustomDashLine) {
+ stroker.setDashPattern(d->cpen.dashPattern());
+ stroker.setDashOffset(d->cpen.dashOffset());
+ } else {
+ stroker.setDashPattern(d->cpen.style());
+ }
+ stroker.setCapStyle(d->cpen.capStyle());
+ stroker.setJoinStyle(d->cpen.joinStyle());
+ QPainterPath stroke;
+ qreal width = d->cpen.widthF();
+ QPolygonF poly;
+ QRectF deviceRect(0, 0, d->pdev->width(), d->pdev->height());
+ // necessary to get aliased alphablended primitives to be drawn correctly
+ if (d->isCosmeticPen() || d->has_scaling_xform) {
+ if (d->isCosmeticPen())
+ stroker.setWidth(width == 0 ? 1 : width);
+ else
+ stroker.setWidth(width * d->xform_scale);
+ stroker.d_ptr->stroker.setClipRect(deviceRect);
+ stroke = stroker.createStroke(path * d->matrix);
+ if (stroke.isEmpty())
+ return;
+ stroke.setFillRule(Qt::WindingFill);
+ d->fillPath(stroke, QX11PaintEnginePrivate::PenGC, false);
+ } else {
+ stroker.setWidth(width);
+ stroker.d_ptr->stroker.setClipRect(d->matrix.inverted().mapRect(deviceRect));
+ stroke = stroker.createStroke(path);
+ if (stroke.isEmpty())
+ return;
+ stroke.setFillRule(Qt::WindingFill);
+ d->fillPath(stroke, QX11PaintEnginePrivate::PenGC, true);
+ }
+ } else if (d->has_pen) {
+ // if we have a cosmetic pen - use XDrawLine() for speed
+ QList<QPolygonF> polys = path.toSubpathPolygons(d->matrix);
+ for (int i = 0; i < polys.size(); ++i)
+ d->strokePolygon_dev(polys.at(i).data(), polys.at(i).size(), false);
+ }
+}
+
+Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const QImage &image,
+ Drawable hd, GC gc, Display *dpy, Visual *visual, int depth)
+{
+ Q_ASSERT(image.format() == QImage::Format_RGB32);
+ Q_ASSERT(image.depth() == 32);
+
+ XImage *xi;
+ // Note: this code assumes either RGB or BGR, 8 bpc server layouts
+ const uint red_mask = (uint) visual->red_mask;
+ bool bgr_layout = (red_mask == 0xff);
+
+ const int w = rect.width();
+ const int h = rect.height();
+
+ QImage im;
+ int image_byte_order = ImageByteOrder(QXcbX11Info::display());
+ if ((QSysInfo::ByteOrder == QSysInfo::BigEndian && ((image_byte_order == LSBFirst) || bgr_layout))
+ || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)
+ || (image_byte_order == LSBFirst && bgr_layout))
+ {
+ im = image.copy(rect);
+ const int iw = im.bytesPerLine() / 4;
+ uint *data = (uint *)im.bits();
+ for (int i=0; i < h; i++) {
+ uint *p = data;
+ uint *end = p + w;
+ if (bgr_layout && image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
+ while (p < end) {
+ *p = ((*p << 8) & 0xffffff00) | ((*p >> 24) & 0x000000ff);
+ p++;
+ }
+ } else if ((image_byte_order == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
+ || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) {
+ while (p < end) {
+ *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000)
+ | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff);
+ p++;
+ }
+ } else if ((image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
+ || (image_byte_order == LSBFirst && bgr_layout))
+ {
+ while (p < end) {
+ *p = ((*p << 16) & 0x00ff0000) | ((*p >> 16) & 0x000000ff)
+ | ((*p ) & 0xff00ff00);
+ p++;
+ }
+ }
+ data += iw;
+ }
+ xi = XCreateImage(dpy, visual, depth, ZPixmap,
+ 0, (char *) im.bits(), w, h, 32, im.bytesPerLine());
+ } else {
+ xi = XCreateImage(dpy, visual, depth, ZPixmap,
+ 0, (char *) image.scanLine(rect.y())+rect.x()*sizeof(uint), w, h, 32, image.bytesPerLine());
+ }
+ XPutImage(dpy, hd, gc, xi, 0, 0, pos.x(), pos.y(), w, h);
+ xi->data = 0; // QImage owns these bits
+ XDestroyImage(xi);
+}
+
+void QX11PaintEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags)
+{
+ Q_D(QX11PaintEngine);
+
+ if (image.format() == QImage::Format_RGB32
+ && d->pdev_depth >= 24 && image.depth() == 32
+ && r.size() == sr.size())
+ {
+ int sx = qRound(sr.x());
+ int sy = qRound(sr.y());
+ int x = qRound(r.x());
+ int y = qRound(r.y());
+ int w = qRound(r.width());
+ int h = qRound(r.height());
+
+ qt_x11_drawImage(QRect(sx, sy, w, h), QPoint(x, y), image, d->hd, d->gc, d->dpy,
+ (Visual *)d->xinfo->visual(), d->pdev_depth);
+ } else {
+ QPaintEngine::drawImage(r, image, sr, flags);
+ }
+}
+
+void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRectF &_sr)
+{
+ Q_D(QX11PaintEngine);
+ QRectF sr = _sr;
+ int x = qRound(r.x());
+ int y = qRound(r.y());
+ int sx = qRound(sr.x());
+ int sy = qRound(sr.y());
+ int sw = qRound(sr.width());
+ int sh = qRound(sr.height());
+
+ QPixmap pixmap = qt_toX11Pixmap(px);
+ if (pixmap.isNull())
+ return;
+
+ if ((d->xinfo && d->xinfo->screen() != qt_x11Info(pixmap).screen())
+ || (qt_x11Info(pixmap).screen() != DefaultScreen(QXcbX11Info::display()))) {
+ qt_x11SetScreen(pixmap, d->xinfo ? d->xinfo->screen() : DefaultScreen(X11->display));
+ }
+
+ qt_x11SetDefaultScreen(qt_x11Info(pixmap).screen());
+
+#if QT_CONFIG(xrender)
+ ::Picture src_pict = qt_x11PictureHandle(pixmap);
+ if (src_pict && d->picture) {
+ const int pDepth = pixmap.depth();
+ if (pDepth == 1 && (d->has_alpha_pen)) {
+ qt_render_bitmap(d->dpy, d->scrn, src_pict, d->picture,
+ sx, sy, x, y, sw, sh, d->cpen);
+ return;
+ } else if (pDepth != 1 && (pDepth == 32 || pDepth != d->pdev_depth)) {
+ XRenderComposite(d->dpy, d->composition_mode,
+ src_pict, 0, d->picture, sx, sy, 0, 0, x, y, sw, sh);
+ return;
+ }
+ }
+#endif
+
+ bool mono_src = pixmap.depth() == 1;
+ bool mono_dst = d->pdev_depth == 1;
+ bool restore_clip = false;
+
+ if (static_cast<QX11PlatformPixmap*>(pixmap.handle())->x11_mask) { // pixmap has a mask
+ QBitmap comb(sw, sh);
+ GC cgc = XCreateGC(d->dpy, qt_x11PixmapHandle(comb), 0, 0);
+ XSetForeground(d->dpy, cgc, 0);
+ XFillRectangle(d->dpy, qt_x11PixmapHandle(comb), cgc, 0, 0, sw, sh);
+ XSetBackground(d->dpy, cgc, 0);
+ XSetForeground(d->dpy, cgc, 1);
+ if (!d->crgn.isEmpty()) {
+ QVector<XRectangle> rects = qt_region_to_xrectangles(d->crgn);
+ XSetClipRectangles(d->dpy, cgc, -x, -y, rects.data(), rects.size(), Unsorted);
+ } else if (d->has_clipping) {
+ XSetClipRectangles(d->dpy, cgc, 0, 0, 0, 0, Unsorted);
+ }
+ XSetFillStyle(d->dpy, cgc, FillOpaqueStippled);
+ XSetTSOrigin(d->dpy, cgc, -sx, -sy);
+ XSetStipple(d->dpy, cgc,
+ static_cast<QX11PlatformPixmap*>(pixmap.handle())->x11_mask);
+ XFillRectangle(d->dpy, qt_x11PixmapHandle(comb), cgc, 0, 0, sw, sh);
+ XFreeGC(d->dpy, cgc);
+
+ XSetClipOrigin(d->dpy, d->gc, x, y);
+ XSetClipMask(d->dpy, d->gc, qt_x11PixmapHandle(comb));
+ restore_clip = true;
+ }
+
+ if (mono_src) {
+ if (!d->crgn.isEmpty()) {
+ Pixmap comb = XCreatePixmap(d->dpy, d->hd, sw, sh, 1);
+ GC cgc = XCreateGC(d->dpy, comb, 0, 0);
+ XSetForeground(d->dpy, cgc, 0);
+ XFillRectangle(d->dpy, comb, cgc, 0, 0, sw, sh);
+ QVector<XRectangle> rects = qt_region_to_xrectangles(d->crgn);
+ XSetClipRectangles(d->dpy, cgc, -x, -y, rects.data(), rects.size(), Unsorted);
+ XCopyArea(d->dpy, qt_x11PixmapHandle(pixmap), comb, cgc, sx, sy, sw, sh, 0, 0);
+ XFreeGC(d->dpy, cgc);
+
+ XSetClipMask(d->dpy, d->gc, comb);
+ XSetClipOrigin(d->dpy, d->gc, x, y);
+ XFreePixmap(d->dpy, comb);
+ } else {
+ XSetClipMask(d->dpy, d->gc, qt_x11PixmapHandle(pixmap));
+ XSetClipOrigin(d->dpy, d->gc, x - sx, y - sy);
+ }
+
+ if (mono_dst) {
+ XSetForeground(d->dpy, d->gc, qGray(d->cpen.color().rgb()) > 127 ? 0 : 1);
+ } else {
+ QXcbColormap cmap = QXcbColormap::instance(d->scrn);
+ XSetForeground(d->dpy, d->gc, cmap.pixel(d->cpen.color()));
+ }
+ XFillRectangle(d->dpy, d->hd, d->gc, x, y, sw, sh);
+ restore_clip = true;
+ } else if (mono_dst && !mono_src) {
+ QBitmap bitmap(pixmap);
+ XCopyArea(d->dpy, qt_x11PixmapHandle(bitmap), d->hd, d->gc, sx, sy, sw, sh, x, y);
+ } else {
+ XCopyArea(d->dpy, qt_x11PixmapHandle(pixmap), d->hd, d->gc, sx, sy, sw, sh, x, y);
+ }
+
+ if (d->pdev->devType() == QInternal::Pixmap) {
+ const QPixmap *px = static_cast<const QPixmap*>(d->pdev);
+ Pixmap src_mask = static_cast<QX11PlatformPixmap*>(pixmap.handle())->x11_mask;
+ Pixmap dst_mask = static_cast<QX11PlatformPixmap*>(px->handle())->x11_mask;
+ if (dst_mask) {
+ GC cgc = XCreateGC(d->dpy, dst_mask, 0, 0);
+ XSetClipOrigin(d->dpy, cgc, x, y);
+ XSetClipMask(d->dpy, cgc, src_mask);
+ if (src_mask) { // copy src mask into dst mask
+ XCopyArea(d->dpy, src_mask, dst_mask, cgc, sx, sy, sw, sh, x, y);
+ } else { // no src mask, but make sure the area copied is opaque in dest
+ XSetBackground(d->dpy, cgc, 0);
+ XSetForeground(d->dpy, cgc, 1);
+ XFillRectangle(d->dpy, dst_mask, cgc, x, y, sw, sh);
+ }
+ XFreeGC(d->dpy, cgc);
+ }
+ }
+
+ if (restore_clip) {
+ XSetClipOrigin(d->dpy, d->gc, 0, 0);
+ QVector<XRectangle> rects = qt_region_to_xrectangles(d->crgn);
+ if (rects.isEmpty())
+ XSetClipMask(d->dpy, d->gc, XNone);
+ else
+ XSetClipRectangles(d->dpy, d->gc, 0, 0, rects.data(), rects.size(), Unsorted);
+ }
+}
+
+void QX11PaintEngine::updateMatrix(const QTransform &mtx)
+{
+ Q_D(QX11PaintEngine);
+ d->txop = mtx.type();
+ d->matrix = mtx;
+
+ d->has_complex_xform = (d->txop > QTransform::TxTranslate);
+
+ extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
+ bool scaling = qt_scaleForTransform(d->matrix, &d->xform_scale);
+ d->has_scaling_xform = scaling && d->xform_scale != 1.0;
+ d->has_non_scaling_xform = scaling && d->xform_scale == 1.0;
+}
+
+/*
+ NB! the clip region is expected to be in dev coordinates
+*/
+void QX11PaintEngine::updateClipRegion_dev(const QRegion &clipRegion, Qt::ClipOperation op)
+{
+ Q_D(QX11PaintEngine);
+ QRegion sysClip = systemClip();
+ if (op == Qt::NoClip) {
+ d->has_clipping = false;
+ d->crgn = sysClip;
+ if (!sysClip.isEmpty()) {
+ x11SetClipRegion(d->dpy, d->gc, d->gc_brush, d->picture, sysClip);
+ } else {
+ x11ClearClipRegion(d->dpy, d->gc, d->gc_brush, d->picture);
+ }
+ return;
+ }
+
+ switch (op) {
+ case Qt::IntersectClip:
+ if (d->has_clipping) {
+ d->crgn &= clipRegion;
+ break;
+ }
+ // fall through
+ case Qt::ReplaceClip:
+ if (!sysClip.isEmpty())
+ d->crgn = clipRegion.intersected(sysClip);
+ else
+ d->crgn = clipRegion;
+ break;
+// case Qt::UniteClip:
+// d->crgn |= clipRegion;
+// if (!sysClip.isEmpty())
+// d->crgn = d->crgn.intersected(sysClip);
+// break;
+ default:
+ break;
+ }
+ d->has_clipping = true;
+ x11SetClipRegion(d->dpy, d->gc, d->gc_brush, d->picture, d->crgn);
+}
+
+void QX11PaintEngine::updateFont(const QFont &)
+{
+}
+
+Drawable QX11PaintEngine::handle() const
+{
+ Q_D(const QX11PaintEngine);
+ Q_ASSERT(isActive());
+ Q_ASSERT(d->hd);
+ return d->hd;
+}
+
+extern void qt_draw_tile(QPaintEngine *, qreal, qreal, qreal, qreal, const QPixmap &,
+ qreal, qreal);
+
+void QX11PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &p)
+{
+ int x = qRound(r.x());
+ int y = qRound(r.y());
+ int w = qRound(r.width());
+ int h = qRound(r.height());
+ int sx = qRound(p.x());
+ int sy = qRound(p.y());
+
+ bool mono_src = pixmap.depth() == 1;
+ Q_D(QX11PaintEngine);
+
+ if ((d->xinfo && d->xinfo->screen() != qt_x11Info(pixmap).screen())
+ || (qt_x11Info(pixmap).screen() != DefaultScreen(QXcbX11Info::display()))) {
+ QPixmap* p = const_cast<QPixmap *>(&pixmap);
+ qt_x11SetScreen(*p, d->xinfo ? d->xinfo->screen() : DefaultScreen(QXcbX11Info::display()));
+ }
+
+ qt_x11SetDefaultScreen(qt_x11Info(pixmap).screen());
+
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender && d->picture && qt_x11PictureHandle(pixmap)) {
+#if 0
+ // ### Qt 5: enable this
+ XRenderPictureAttributes attrs;
+ attrs.repeat = true;
+ XRenderChangePicture(d->dpy, pixmap.x11PictureHandle(), CPRepeat, &attrs);
+
+ if (mono_src) {
+ qt_render_bitmap(d->dpy, d->scrn, pixmap.x11PictureHandle(), d->picture,
+ sx, sy, x, y, w, h, d->cpen);
+ } else {
+ XRenderComposite(d->dpy, d->composition_mode,
+ pixmap.x11PictureHandle(), XNone, d->picture,
+ sx, sy, 0, 0, x, y, w, h);
+ }
+#else
+ const int numTiles = (w / pixmap.width()) * (h / pixmap.height());
+ if (numTiles < 100) {
+ // this is essentially qt_draw_tile(), inlined for
+ // the XRenderComposite call
+ int yPos, xPos, drawH, drawW, yOff, xOff;
+ yPos = y;
+ yOff = sy;
+ while (yPos < y + h) {
+ drawH = pixmap.height() - yOff; // Cropping first row
+ if (yPos + drawH > y + h) // Cropping last row
+ drawH = y + h - yPos;
+ xPos = x;
+ xOff = sx;
+ while (xPos < x + w) {
+ drawW = pixmap.width() - xOff; // Cropping first column
+ if (xPos + drawW > x + w) // Cropping last column
+ drawW = x + w - xPos;
+ if (mono_src) {
+ qt_render_bitmap(d->dpy, d->scrn, qt_x11PictureHandle(pixmap), d->picture,
+ xOff, yOff, xPos, yPos, drawW, drawH, d->cpen);
+ } else {
+ XRenderComposite(d->dpy, d->composition_mode,
+ qt_x11PictureHandle(pixmap), XNone, d->picture,
+ xOff, yOff, 0, 0, xPos, yPos, drawW, drawH);
+ }
+ xPos += drawW;
+ xOff = 0;
+ }
+ yPos += drawH;
+ yOff = 0;
+ }
+ } else {
+ w = qMin(w, d->pdev->width() - x);
+ h = qMin(h, d->pdev->height() - y);
+ if (w <= 0 || h <= 0)
+ return;
+
+ const int pw = w + sx;
+ const int ph = h + sy;
+ QPixmap pm(pw, ph);
+ if (pixmap.hasAlpha() || mono_src)
+ pm.fill(Qt::transparent);
+
+ const int mode = pixmap.hasAlpha() ? PictOpOver : PictOpSrc;
+ const ::Picture pmPicture = qt_x11PictureHandle(pm);
+
+ // first tile
+ XRenderComposite(d->dpy, mode,
+ qt_x11PictureHandle(pixmap), XNone, pmPicture,
+ 0, 0, 0, 0, 0, 0, qMin(pw, pixmap.width()), qMin(ph, pixmap.height()));
+
+ // first row of tiles
+ int xPos = pixmap.width();
+ const int sh = qMin(ph, pixmap.height());
+ while (xPos < pw) {
+ const int sw = qMin(xPos, pw - xPos);
+ XRenderComposite(d->dpy, mode,
+ pmPicture, XNone, pmPicture,
+ 0, 0, 0, 0, xPos, 0, sw, sh);
+ xPos *= 2;
+ }
+
+ // remaining rows
+ int yPos = pixmap.height();
+ const int sw = pw;
+ while (yPos < ph) {
+ const int sh = qMin(yPos, ph - yPos);
+ XRenderComposite(d->dpy, mode,
+ pmPicture, XNone, pmPicture,
+ 0, 0, 0, 0, 0, yPos, sw, sh);
+ yPos *= 2;
+ }
+
+ // composite
+ if (mono_src)
+ qt_render_bitmap(d->dpy, d->scrn, pmPicture, d->picture,
+ sx, sy, x, y, w, h, d->cpen);
+ else
+ XRenderComposite(d->dpy, d->composition_mode,
+ pmPicture, XNone, d->picture,
+ sx, sy, 0, 0, x, y, w, h);
+ }
+#endif
+ } else
+#endif // QT_CONFIG(xrender)
+ if (pixmap.depth() > 1 && !static_cast<QX11PlatformPixmap*>(pixmap.handle())->x11_mask) {
+ XSetTile(d->dpy, d->gc, qt_x11PixmapHandle(pixmap));
+ XSetFillStyle(d->dpy, d->gc, FillTiled);
+ XSetTSOrigin(d->dpy, d->gc, x-sx, y-sy);
+ XFillRectangle(d->dpy, d->hd, d->gc, x, y, w, h);
+ XSetTSOrigin(d->dpy, d->gc, 0, 0);
+ XSetFillStyle(d->dpy, d->gc, FillSolid);
+ } else {
+ qt_draw_tile(this, x, y, w, h, pixmap, sx, sy);
+ }
+}
+
+bool QX11PaintEngine::drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti)
+{
+#if QT_CONFIG(xrender)
+ Q_D(QX11PaintEngine);
+ Q_ASSERT(ti.fontEngine->type() == QFontEngine::Freetype);
+
+ if (!X11->use_xrender)
+ return false;
+
+ QFontEngineFT *ft = static_cast<QFontEngineFT *>(ti.fontEngine);
+ QFontEngineFT::QGlyphSet *set = ft->loadGlyphSet(transform);
+
+ if (!set || set->outline_drawing)
+ return false;
+
+ QFontEngine::GlyphFormat glyphFormat = QXRenderGlyphCache::glyphFormatForDepth(ft, d->pdev_depth);
+
+ QXRenderGlyphCache *cache = static_cast<QXRenderGlyphCache *>(ft->glyphCache(set, glyphFormat, transform));
+ if (!cache) {
+ cache = new QXRenderGlyphCache(QXcbX11Info(), glyphFormat, transform);
+ ft->setGlyphCache(set, cache);
+ }
+
+ return cache->draw(X11->getSolidFill(d->scrn, d->cpen.color()), d->picture, transform, ti);
+#else // !QT_CONFIG(xrender)
+ return false;
+#endif // QT_CONFIG(xrender)
+}
+
+void QX11PaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
+{
+ Q_D(QX11PaintEngine);
+ const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
+
+ switch (ti.fontEngine->type()) {
+ case QFontEngine::TestFontEngine:
+ case QFontEngine::Box:
+ d->drawBoxTextItem(p, ti);
+ break;
+#if QT_CONFIG(fontconfig)
+ case QFontEngine::Freetype:
+ drawFreetype(p, ti);
+ break;
+#endif
+ default:
+ Q_ASSERT(false);
+ }
+}
+
+#if QT_CONFIG(fontconfig)
+static bool path_for_glyphs(QPainterPath *path,
+ const QVarLengthArray<glyph_t> &glyphs,
+ const QVarLengthArray<QFixedPoint> &positions,
+ const QFontEngineFT *ft)
+{
+ bool result = true;
+ *path = QPainterPath();
+ path->setFillRule(Qt::WindingFill);
+ ft->lockFace();
+ int i = 0;
+ while (i < glyphs.size()) {
+ QFontEngineFT::Glyph *glyph = ft->loadGlyph(glyphs[i], 0, QFontEngineFT::Format_Mono);
+ // #### fix case where we don't get a glyph
+ if (!glyph || glyph->format != QFontEngineFT::Format_Mono) {
+ result = false;
+ break;
+ }
+
+ int n = 0;
+ int h = glyph->height;
+ int xp = qRound(positions[i].x);
+ int yp = qRound(positions[i].y);
+
+ xp += glyph->x;
+ yp += -glyph->y + glyph->height;
+ int pitch = ((glyph->width + 31) & ~31) >> 3;
+
+ uchar *src = glyph->data;
+ while (h--) {
+ for (int x = 0; x < glyph->width; ++x) {
+ bool set = src[x >> 3] & (0x80 >> (x & 7));
+ if (set) {
+ QRect r(xp + x, yp - h, 1, 1);
+ while (x+1 < glyph->width && src[(x+1) >> 3] & (0x80 >> ((x+1) & 7))) {
+ ++x;
+ r.setRight(r.right()+1);
+ }
+
+ path->addRect(r);
+ ++n;
+ }
+ }
+ src += pitch;
+ }
+ ++i;
+ }
+ ft->unlockFace();
+ return result;
+}
+
+void QX11PaintEngine::drawFreetype(const QPointF &p, const QTextItemInt &ti)
+{
+ Q_D(QX11PaintEngine);
+
+ if (!ti.glyphs.numGlyphs)
+ return;
+
+ if (!d->cpen.isSolid()) {
+ QPaintEngine::drawTextItem(p, ti);
+ return;
+ }
+
+ const bool xrenderPath = (X11->use_xrender
+ && !(d->pdev->devType() == QInternal::Pixmap
+ && static_cast<const QPixmap *>(d->pdev)->handle()->pixelType() == QPlatformPixmap::BitmapType));
+
+ if (xrenderPath) {
+ QTransform transform = d->matrix;
+ transform.translate(p.x(), p.y());
+
+ if (drawCachedGlyphs(transform, ti))
+ return;
+ }
+
+ QTransform transform;
+ transform.translate(p.x(), p.y());
+
+ QVarLengthArray<QFixedPoint> positions;
+ QVarLengthArray<glyph_t> glyphs;
+ ti.fontEngine->getGlyphPositions(ti.glyphs, transform, ti.flags, glyphs, positions);
+
+ if (glyphs.count() == 0)
+ return;
+
+ QFontEngineFT *ft = static_cast<QFontEngineFT *>(ti.fontEngine);
+ QFontEngineFT::QGlyphSet *set = ft->loadGlyphSet(transform);
+ QPainterPath path;
+
+ if (!set || set->outline_drawing || !path_for_glyphs(&path, glyphs, positions, ft)) {
+ QPaintEngine::drawTextItem(p, ti);
+ return;
+ }
+
+ if (path.elementCount() <= 1)
+ return;
+
+ Q_ASSERT((path.elementCount() % 5) == 0);
+ if (d->txop >= QTransform::TxScale) {
+ painter()->save();
+ painter()->setBrush(d->cpen.brush());
+ painter()->setPen(Qt::NoPen);
+ painter()->drawPath(path);
+ painter()->restore();
+ return;
+ }
+
+ const int rectcount = 256;
+ XRectangle rects[rectcount];
+ int num_rects = 0;
+
+ QPoint delta(qRound(d->matrix.dx()), qRound(d->matrix.dy()));
+ QRect clip(d->polygonClipper.boundingRect());
+ for (int i=0; i < path.elementCount(); i+=5) {
+ int x = qRound(path.elementAt(i).x);
+ int y = qRound(path.elementAt(i).y);
+ int w = qRound(path.elementAt(i+1).x) - x;
+ int h = qRound(path.elementAt(i+2).y) - y;
+
+ QRect rect = QRect(x + delta.x(), y + delta.y(), w, h);
+ rect = rect.intersected(clip);
+ if (rect.isEmpty())
+ continue;
+
+ rects[num_rects].x = short(rect.x());
+ rects[num_rects].y = short(rect.y());
+ rects[num_rects].width = ushort(rect.width());
+ rects[num_rects].height = ushort(rect.height());
+ ++num_rects;
+ if (num_rects == rectcount) {
+ XFillRectangles(d->dpy, d->hd, d->gc, rects, num_rects);
+ num_rects = 0;
+ }
+ }
+ if (num_rects > 0)
+ XFillRectangles(d->dpy, d->hd, d->gc, rects, num_rects);
+}
+#endif // QT_CONFIG(fontconfig)
+
+#if QT_CONFIG(xrender)
+QXRenderGlyphCache::QXRenderGlyphCache(QXcbX11Info x, QFontEngine::GlyphFormat format, const QTransform &matrix)
+ : QFontEngineGlyphCache(format, matrix)
+ , xinfo(x)
+ , gset(XNone)
+{}
+
+QXRenderGlyphCache::~QXRenderGlyphCache()
+{
+ if (gset != XNone)
+ XRenderFreeGlyphSet(xinfo.display(), gset);
+}
+
+bool QXRenderGlyphCache::addGlyphs(const QTextItemInt &ti, QVarLengthArray<glyph_t> glyphs, QVarLengthArray<QFixedPoint> positions)
+{
+ Q_ASSERT(ti.fontEngine->type() == QFontEngine::Freetype);
+
+ QFontEngineFT *ft = static_cast<QFontEngineFT *>(ti.fontEngine);
+ QFontEngineFT::QGlyphSet *set = ft->loadGlyphSet(transform());
+
+ XGlyphInfo xglyphinfo;
+
+ for (int i = 0; i < glyphs.size(); ++i) {
+ const QFixed spp = ft->subPixelPositionForX(positions[i].x);
+ QFontEngineFT::Glyph *glyph = set->getGlyph(glyphs[i], spp);
+ Glyph xglyphid = qHash(QFontEngineFT::GlyphAndSubPixelPosition(glyphs[i], spp));
+
+ if (glyph && glyph->format == glyphFormat()) {
+ if (cachedGlyphs.contains(xglyphid)) {
+ continue;
+ } else {
+ set->setGlyph(glyphs[i], spp, nullptr);
+ delete glyph;
+ glyph = 0;
+ }
+ }
+
+ glyph = ft->loadGlyphFor(glyphs[i], spp, glyphFormat(), transform());
+
+ if (glyph == 0 || glyph->format != glyphFormat())
+ return false;
+
+ set->setGlyph(glyphs[i], spp, glyph);
+ Q_ASSERT(glyph->data || glyph->width == 0 || glyph->height == 0);
+
+ xglyphinfo.width = glyph->width;
+ xglyphinfo.height = glyph->height;
+ xglyphinfo.x = -glyph->x;
+ xglyphinfo.y = glyph->y;
+ xglyphinfo.xOff = glyph->advance;
+ xglyphinfo.yOff = 0;
+
+ XRenderAddGlyphs(xinfo.display(), glyphSet(), &xglyphid, &xglyphinfo, 1, (const char *) glyph->data, glyphBufferSize(*glyph));
+ cachedGlyphs.insert(xglyphid);
+ }
+
+ return true;
+}
+
+bool QXRenderGlyphCache::draw(Drawable src, Drawable dst, const QTransform &matrix, const QTextItemInt &ti)
+{
+ Q_ASSERT(ti.fontEngine->type() == QFontEngine::Freetype);
+
+ if (ti.glyphs.numGlyphs == 0)
+ return true;
+
+ QFontEngineFT *ft = static_cast<QFontEngineFT *>(ti.fontEngine);
+ QFontEngineFT::QGlyphSet *set = ft->loadGlyphSet(matrix);
+
+ QVarLengthArray<glyph_t> glyphs;
+ QVarLengthArray<QFixedPoint> positions;
+ ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
+
+ if (glyphs.isEmpty())
+ return true;
+
+ if (!addGlyphs(ti, glyphs, positions))
+ return false;
+
+ QVarLengthArray<unsigned int> chars(glyphs.size());
+
+ for (int i = 0; i < glyphs.size(); ++i)
+ chars[i] = glyphId(glyphs[i], ft->subPixelPositionForX(positions[i].x));
+
+ int i = 0;
+ while (i < glyphs.size() && !isValidCoordinate(positions[i]))
+ ++i;
+
+ if (i >= glyphs.size())
+ return true;
+
+ QFixed xp = positions[i].x;
+ QFixed yp = positions[i].y;
+ QFixed offs = QFixed::fromReal(aliasedCoordinateDelta);
+
+ XGlyphElt32 elt;
+ elt.glyphset = gset;
+ elt.chars = &chars[i];
+ elt.nchars = 1;
+ elt.xOff = qRound(xp + offs);
+ elt.yOff = qRound(yp + offs);
+
+ ++i;
+
+ for (; i < glyphs.size(); ++i) {
+ if (!isValidCoordinate(positions[i]))
+ break;
+
+ const QFixed spp = ft->subPixelPositionForX(positions[i].x);
+ QFontEngineFT::Glyph *g = set->getGlyph(glyphs[i], spp);
+
+ if (g
+ && positions[i].x == xp + g->advance
+ && positions[i].y == yp
+ && elt.nchars < 253 // don't draw more than 253 characters as some X servers
+ // hang with it
+ ) {
+ elt.nchars++;
+ xp += g->advance;
+ } else {
+ xp = positions[i].x;
+ yp = positions[i].y;
+
+ XRenderCompositeText32(xinfo.display(), PictOpOver, src, dst,
+ renderPictFormat(), 0, 0, 0, 0,
+ &elt, 1);
+ elt.chars = &chars[i];
+ elt.nchars = 1;
+ elt.xOff = qRound(xp + offs);
+ elt.yOff = qRound(yp + offs);
+ }
+ }
+
+ XRenderCompositeText32(xinfo.display(), PictOpOver, src, dst,
+ renderPictFormat(), 0, 0, 0, 0, &elt, 1);
+
+ return true;
+}
+
+GlyphSet QXRenderGlyphCache::glyphSet()
+{
+ if (gset == XNone)
+ gset = XRenderCreateGlyphSet(xinfo.display(), renderPictFormat());
+
+ Q_ASSERT(gset != XNone);
+ return gset;
+}
+
+int QXRenderGlyphCache::glyphBufferSize(const QFontEngineFT::Glyph &glyph) const
+{
+ int pitch = 0;
+
+ switch (glyphFormat()) {
+ case QFontEngine::Format_Mono:
+ pitch = ((glyph.width + 31) & ~31) >> 3;
+ break;
+ case QFontEngine::Format_A8:
+ pitch = (glyph.width + 3) & ~3;
+ break;
+ default:
+ pitch = glyph.width * 4;
+ break;
+ }
+
+ return pitch * glyph.height;
+}
+
+QImage::Format QXRenderGlyphCache::imageFormat() const
+{
+ switch (glyphFormat()) {
+ case QFontEngine::Format_None:
+ Q_UNREACHABLE();
+ break;
+ case QFontEngine::Format_Mono:
+ return QImage::Format_Mono;
+ break;
+ case QFontEngine::Format_A8:
+ return QImage::Format_Alpha8;
+ break;
+ case QFontEngine::Format_A32:
+ case QFontEngine::Format_ARGB:
+ return QImage::Format_ARGB32_Premultiplied;
+ break;
+ }
+
+ Q_UNREACHABLE();
+}
+
+const XRenderPictFormat *QXRenderGlyphCache::renderPictFormat() const
+{
+ switch (glyphFormat()) {
+ case QFontEngine::Format_None:
+ Q_UNREACHABLE();
+ break;
+ case QFontEngine::Format_Mono:
+ return XRenderFindStandardFormat(xinfo.display(), PictStandardA1);
+ break;
+ case QFontEngine::Format_A8:
+ return XRenderFindStandardFormat(xinfo.display(), PictStandardA8);
+ break;
+ case QFontEngine::Format_A32:
+ case QFontEngine::Format_ARGB:
+ return XRenderFindStandardFormat(xinfo.display(), PictStandardARGB32);
+ break;
+ }
+
+ Q_UNREACHABLE();
+}
+
+QFontEngine::GlyphFormat QXRenderGlyphCache::glyphFormatForDepth(QFontEngine *fontEngine, int depth)
+{
+ QFontEngine::GlyphFormat glyphFormat = fontEngine->glyphFormat;
+
+ if (glyphFormat == QFontEngine::Format_None) {
+ switch (depth) {
+ case 32:
+ glyphFormat = QFontEngine::Format_ARGB;
+ break;
+ case 24:
+ glyphFormat = QFontEngine::Format_A32;
+ break;
+ case 1:
+ glyphFormat = QFontEngine::Format_Mono;
+ break;
+ default:
+ glyphFormat = QFontEngine::Format_A8;
+ break;
+ }
+ }
+
+ return glyphFormat;
+}
+
+Glyph QXRenderGlyphCache::glyphId(glyph_t glyph, QFixed subPixelPosition)
+{
+ return qHash(QFontEngineFT::GlyphAndSubPixelPosition(glyph, subPixelPosition));
+}
+
+bool QXRenderGlyphCache::isValidCoordinate(const QFixedPoint &fp)
+{
+ enum { t_min = SHRT_MIN, t_max = SHRT_MAX };
+ return (fp.x < t_min || fp.x > t_max || fp.y < t_min || fp.y > t_max) ? false : true;
+}
+#endif // QT_CONFIG(xrender)
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h
new file mode 100644
index 0000000000..34b5d929d5
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPAINTENGINE_X11_H
+#define QPAINTENGINE_X11_H
+
+#include <QtGui/QPaintEngine>
+
+typedef unsigned long XID;
+typedef XID Drawable;
+typedef struct _XGC *GC;
+
+QT_BEGIN_NAMESPACE
+
+extern "C" {
+Drawable qt_x11Handle(const QPaintDevice *pd);
+GC qt_x11_get_pen_gc(QPainter *);
+GC qt_x11_get_brush_gc(QPainter *);
+}
+
+class QX11PaintEnginePrivate;
+class QX11PaintEngine : public QPaintEngine
+{
+ Q_DECLARE_PRIVATE(QX11PaintEngine)
+public:
+ QX11PaintEngine();
+ ~QX11PaintEngine();
+
+ bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
+ bool end() Q_DECL_OVERRIDE;
+
+ void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;
+
+ void updatePen(const QPen &pen);
+ void updateBrush(const QBrush &brush, const QPointF &pt);
+ void updateRenderHints(QPainter::RenderHints hints);
+ void updateFont(const QFont &font);
+ void updateMatrix(const QTransform &matrix);
+ void updateClipRegion_dev(const QRegion &region, Qt::ClipOperation op);
+
+ void drawLines(const QLine *lines, int lineCount) Q_DECL_OVERRIDE;
+ void drawLines(const QLineF *lines, int lineCount) Q_DECL_OVERRIDE;
+
+ void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
+ void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
+
+ void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
+ void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
+
+ void drawEllipse(const QRect &r) Q_DECL_OVERRIDE;
+ void drawEllipse(const QRectF &r) Q_DECL_OVERRIDE;
+
+ virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
+ inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE
+ { QPaintEngine::drawPolygon(points, pointCount, mode); }
+
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
+ void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) Q_DECL_OVERRIDE;
+ void drawPath(const QPainterPath &path) Q_DECL_OVERRIDE;
+ void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
+ void drawImage(const QRectF &r, const QImage &img, const QRectF &sr,
+ Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
+
+ virtual Drawable handle() const;
+ inline Type type() const Q_DECL_OVERRIDE { return QPaintEngine::X11; }
+
+ QPainter::RenderHints supportedRenderHints() const;
+
+protected:
+ QX11PaintEngine(QX11PaintEnginePrivate &dptr);
+
+#if QT_CONFIG(fontconfig)
+ void drawFreetype(const QPointF &p, const QTextItemInt &ti);
+ bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti);
+#endif // QT_CONFIG(fontconfig)
+
+ friend class QPixmap;
+ friend class QFontEngineBox;
+ friend GC qt_x11_get_pen_gc(QPainter *);
+ friend GC qt_x11_get_brush_gc(QPainter *);
+
+private:
+ Q_DISABLE_COPY(QX11PaintEngine)
+};
+
+QT_END_NAMESPACE
+
+#endif // QPAINTENGINE_X11_H
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
new file mode 100644
index 0000000000..f791c90346
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
@@ -0,0 +1,2108 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+
+#include <private/qdrawhelper_p.h>
+#include <private/qimage_p.h>
+#include <private/qimagepixmapcleanuphooks_p.h>
+
+#include "qxcbnativepainting.h"
+#include "qpixmap_x11_p.h"
+#include "qcolormap_x11_p.h"
+#include "qpaintengine_x11_p.h"
+
+QT_BEGIN_NAMESPACE
+
+#if QT_POINTER_SIZE == 8 // 64-bit versions
+
+Q_ALWAYS_INLINE uint PREMUL(uint x) {
+ uint a = x >> 24;
+ quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a;
+ t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8;
+ t &= 0x000000ff00ff00ff;
+ return (uint(t)) | (uint(t >> 24)) | (a << 24);
+}
+
+#else // 32-bit versions
+
+Q_ALWAYS_INLINE uint PREMUL(uint x) {
+ uint a = x >> 24;
+ uint t = (x & 0xff00ff) * a;
+ t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
+ t &= 0xff00ff;
+
+ x = ((x >> 8) & 0xff) * a;
+ x = (x + ((x >> 8) & 0xff) + 0x80);
+ x &= 0xff00;
+ x |= t | (a << 24);
+ return x;
+}
+#endif
+
+
+
+struct QXImageWrapper
+{
+ XImage *xi;
+};
+
+QPixmap qt_toX11Pixmap(const QImage &image)
+{
+ QPlatformPixmap *data =
+ new QX11PlatformPixmap(image.depth() == 1
+ ? QPlatformPixmap::BitmapType
+ : QPlatformPixmap::PixmapType);
+
+ data->fromImage(image, Qt::AutoColor);
+
+ return QPixmap(data);
+}
+
+QPixmap qt_toX11Pixmap(const QPixmap &pixmap)
+{
+ if (pixmap.isNull())
+ return QPixmap();
+
+ if (QPixmap(pixmap).data_ptr()->classId() == QPlatformPixmap::X11Class)
+ return pixmap;
+
+ return qt_toX11Pixmap(pixmap.toImage());
+}
+
+// For thread-safety:
+// image->data does not belong to X11, so we must free it ourselves.
+
+inline static void qSafeXDestroyImage(XImage *x)
+{
+ if (x->data) {
+ free(x->data);
+ x->data = 0;
+ }
+ XDestroyImage(x);
+}
+
+QBitmap QX11PlatformPixmap::mask_to_bitmap(int screen) const
+{
+ if (!x11_mask)
+ return QBitmap();
+ qt_x11SetDefaultScreen(screen);
+ QBitmap bm(w, h);
+ QX11PlatformPixmap *that = qt_x11Pixmap(bm);
+ const QXcbX11Info *x = that->x11_info();
+ GC gc = XCreateGC(x->display(), that->handle(), 0, 0);
+ XCopyArea(x->display(), x11_mask, that->handle(), gc, 0, 0,
+ that->width(), that->height(), 0, 0);
+ XFreeGC(x->display(), gc);
+ return bm;
+}
+
+void QX11PlatformPixmap::bitmapFromImage(const QImage &image)
+{
+ w = image.width();
+ h = image.height();
+ d = 1;
+ is_null = (w <= 0 || h <= 0);
+ hd = createBitmapFromImage(image);
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender)
+ picture = XRenderCreatePicture(xinfo.display(), hd,
+ XRenderFindStandardFormat(xinfo.display(), PictStandardA1), 0, 0);
+#endif // QT_CONFIG(xrender)
+}
+
+bool QX11PlatformPixmap::canTakeQImageFromXImage(const QXImageWrapper &xiWrapper) const
+{
+ XImage *xi = xiWrapper.xi;
+
+ if (xi->format != ZPixmap)
+ return false;
+
+ // ARGB32_Premultiplied
+ if (picture && depth() == 32)
+ return true;
+
+ // RGB32
+ if (depth() == 24 && xi->bits_per_pixel == 32 && xi->red_mask == 0xff0000
+ && xi->green_mask == 0xff00 && xi->blue_mask == 0xff)
+ return true;
+
+ // RGB16
+ if (depth() == 16 && xi->bits_per_pixel == 16 && xi->red_mask == 0xf800
+ && xi->green_mask == 0x7e0 && xi->blue_mask == 0x1f)
+ return true;
+
+ return false;
+}
+
+QImage QX11PlatformPixmap::takeQImageFromXImage(const QXImageWrapper &xiWrapper) const
+{
+ XImage *xi = xiWrapper.xi;
+
+ QImage::Format format = QImage::Format_ARGB32_Premultiplied;
+ if (depth() == 24)
+ format = QImage::Format_RGB32;
+ else if (depth() == 16)
+ format = QImage::Format_RGB16;
+
+ QImage image((uchar *)xi->data, xi->width, xi->height, xi->bytes_per_line, format);
+ image.setDevicePixelRatio(devicePixelRatio());
+ // take ownership
+ image.data_ptr()->own_data = true;
+ xi->data = 0;
+
+ // we may have to swap the byte order
+ if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && xi->byte_order == MSBFirst)
+ || (QSysInfo::ByteOrder == QSysInfo::BigEndian && xi->byte_order == LSBFirst))
+ {
+ for (int i=0; i < image.height(); i++) {
+ if (depth() == 16) {
+ ushort *p = (ushort*)image.scanLine(i);
+ ushort *end = p + image.width();
+ while (p < end) {
+ *p = ((*p << 8) & 0xff00) | ((*p >> 8) & 0x00ff);
+ p++;
+ }
+ } else {
+ uint *p = (uint*)image.scanLine(i);
+ uint *end = p + image.width();
+ while (p < end) {
+ *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000)
+ | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff);
+ p++;
+ }
+ }
+ }
+ }
+
+ // fix-up alpha channel
+ if (format == QImage::Format_RGB32) {
+ QRgb *p = (QRgb *)image.bits();
+ for (int y = 0; y < xi->height; ++y) {
+ for (int x = 0; x < xi->width; ++x)
+ p[x] |= 0xff000000;
+ p += xi->bytes_per_line / 4;
+ }
+ }
+
+ XDestroyImage(xi);
+ return image;
+}
+
+XID QX11PlatformPixmap::bitmap_to_mask(const QBitmap &bitmap, int screen)
+{
+ if (bitmap.isNull())
+ return 0;
+ QBitmap bm = bitmap;
+ qt_x11SetScreen(bm, screen);
+
+ QX11PlatformPixmap *that = qt_x11Pixmap(bm);
+ const QXcbX11Info *x = that->x11_info();
+ Pixmap mask = XCreatePixmap(x->display(), RootWindow(x->display(), screen),
+ that->width(), that->height(), 1);
+ GC gc = XCreateGC(x->display(), mask, 0, 0);
+ XCopyArea(x->display(), that->handle(), mask, gc, 0, 0,
+ that->width(), that->height(), 0, 0);
+ XFreeGC(x->display(), gc);
+ return mask;
+}
+
+Drawable qt_x11Handle(const QPixmap &pixmap)
+{
+ if (pixmap.isNull())
+ return XNone;
+
+ if (pixmap.handle()->classId() != QPlatformPixmap::X11Class)
+ return XNone;
+
+ return static_cast<const QX11PlatformPixmap *>(pixmap.handle())->handle();
+}
+
+
+/*****************************************************************************
+ Internal functions
+ *****************************************************************************/
+
+//extern const uchar *qt_get_bitflip_array(); // defined in qimage.cpp
+
+// Returns position of highest bit set or -1 if none
+static int highest_bit(uint v)
+{
+ int i;
+ uint b = (uint)1 << 31;
+ for (i=31; ((b & v) == 0) && i>=0; i--)
+ b >>= 1;
+ return i;
+}
+
+// Counts the number of bits set in 'v'
+static uint n_bits(uint v)
+{
+ int i = 0;
+ while (v) {
+ v = v & (v - 1);
+ i++;
+ }
+ return i;
+}
+
+static uint *red_scale_table = 0;
+static uint *green_scale_table = 0;
+static uint *blue_scale_table = 0;
+
+static void cleanup_scale_tables()
+{
+ delete[] red_scale_table;
+ delete[] green_scale_table;
+ delete[] blue_scale_table;
+}
+
+/*
+ Could do smart bitshifting, but the "obvious" algorithm only works for
+ nBits >= 4. This is more robust.
+*/
+static void build_scale_table(uint **table, uint nBits)
+{
+ if (nBits > 7) {
+ qWarning("build_scale_table: internal error, nBits = %i", nBits);
+ return;
+ }
+ if (!*table) {
+ static bool firstTable = true;
+ if (firstTable) {
+ qAddPostRoutine(cleanup_scale_tables);
+ firstTable = false;
+ }
+ *table = new uint[256];
+ }
+ int maxVal = (1 << nBits) - 1;
+ int valShift = 8 - nBits;
+ int i;
+ for (i = 0 ; i < maxVal + 1 ; i++)
+ (*table)[i << valShift] = i*255/maxVal;
+}
+
+static int defaultScreen = -1;
+
+int qt_x11SetDefaultScreen(int screen)
+{
+ int old = defaultScreen;
+ defaultScreen = screen;
+ return old;
+}
+
+void qt_x11SetScreen(QPixmap &pixmap, int screen)
+{
+ if (pixmap.paintingActive()) {
+ qWarning("qt_x11SetScreen(): Cannot change screens during painting");
+ return;
+ }
+
+ if (pixmap.isNull())
+ return;
+
+ if (pixmap.handle()->classId() != QPlatformPixmap::X11Class)
+ return;
+
+ if (screen < 0)
+ screen = QXcbX11Info::appScreen();
+
+ QX11PlatformPixmap *pm = static_cast<QX11PlatformPixmap *>(pixmap.handle());
+ if (screen == pm->xinfo.screen())
+ return; // nothing to do
+
+ if (pixmap.isNull()) {
+ pm->xinfo = QXcbX11Info::fromScreen(screen);
+ return;
+ }
+
+#if 0
+ qDebug("qt_x11SetScreen for %p from %d to %d. Size is %d/%d", pm, pm->xinfo.screen(), screen, pm->width(), pm->height());
+#endif
+
+ qt_x11SetDefaultScreen(screen);
+ pixmap = qt_toX11Pixmap(pixmap.toImage());
+}
+
+/*****************************************************************************
+ QPixmap member functions
+ *****************************************************************************/
+
+QBasicAtomicInt qt_pixmap_serial = Q_BASIC_ATOMIC_INITIALIZER(0);
+int Q_GUI_EXPORT qt_x11_preferred_pixmap_depth = 0;
+
+QX11PlatformPixmap::QX11PlatformPixmap(PixelType pixelType)
+ : QPlatformPixmap(pixelType, X11Class), hd(0),
+ flags(Uninitialized), x11_mask(0), picture(0), mask_picture(0), hd2(0),
+ dpr(1.0), pengine(0)
+{}
+
+QX11PlatformPixmap::~QX11PlatformPixmap()
+{
+ // Cleanup hooks have to be called before the handles are freed
+ if (is_cached) {
+ QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks(this);
+ is_cached = false;
+ }
+
+ release();
+}
+
+QPlatformPixmap *QX11PlatformPixmap::createCompatiblePlatformPixmap() const
+{
+ QX11PlatformPixmap *p = new QX11PlatformPixmap(pixelType());
+ p->setDevicePixelRatio(devicePixelRatio());
+ return p;
+}
+
+void QX11PlatformPixmap::resize(int width, int height)
+{
+ setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
+
+ w = width;
+ h = height;
+ is_null = (w <= 0 || h <= 0);
+
+ if (defaultScreen >= 0 && defaultScreen != xinfo.screen()) {
+ xinfo = QXcbX11Info::fromScreen(defaultScreen);
+ }
+
+ int dd = xinfo.depth();
+
+ if (qt_x11_preferred_pixmap_depth)
+ dd = qt_x11_preferred_pixmap_depth;
+
+ bool make_null = w <= 0 || h <= 0; // create null pixmap
+ d = (pixelType() == BitmapType ? 1 : dd);
+ if (make_null || d == 0) {
+ w = 0;
+ h = 0;
+ is_null = true;
+ hd = 0;
+ picture = 0;
+ d = 0;
+ if (!make_null)
+ qWarning("QPixmap: Invalid pixmap parameters");
+ return;
+ }
+ hd = XCreatePixmap(xinfo.display(),
+ RootWindow(xinfo.display(), xinfo.screen()),
+ w, h, d);
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ XRenderPictFormat *format = d == 1
+ ? XRenderFindStandardFormat(xinfo.display(), PictStandardA1)
+ : XRenderFindVisualFormat(xinfo.display(), (Visual *) xinfo.visual());
+ picture = XRenderCreatePicture(xinfo.display(), hd, format, 0, 0);
+ }
+#endif // QT_CONFIG(xrender)
+}
+
+struct QX11AlphaDetector
+{
+ bool hasAlpha() const {
+ if (checked)
+ return has;
+ // Will implicitly also check format and return quickly for opaque types...
+ checked = true;
+ has = image->isNull() ? false : const_cast<QImage *>(image)->data_ptr()->checkForAlphaPixels();
+ return has;
+ }
+
+ bool hasXRenderAndAlpha() const {
+ if (!X11->use_xrender)
+ return false;
+ return hasAlpha();
+ }
+
+ QX11AlphaDetector(const QImage *i, Qt::ImageConversionFlags flags)
+ : image(i), checked(false), has(false)
+ {
+ if (flags & Qt::NoOpaqueDetection) {
+ checked = true;
+ has = image->hasAlphaChannel();
+ }
+ }
+
+ const QImage *image;
+ mutable bool checked;
+ mutable bool has;
+};
+
+void QX11PlatformPixmap::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
+{
+ setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
+
+ w = img.width();
+ h = img.height();
+ d = img.depth();
+ is_null = (w <= 0 || h <= 0);
+ setDevicePixelRatio(img.devicePixelRatio());
+
+ if (is_null) {
+ w = h = 0;
+ return;
+ }
+
+ if (defaultScreen >= 0 && defaultScreen != xinfo.screen()) {
+ xinfo = QXcbX11Info::fromScreen(defaultScreen);
+ }
+
+ if (pixelType() == BitmapType) {
+ bitmapFromImage(img);
+ return;
+ }
+
+ if (uint(w) >= 32768 || uint(h) >= 32768) {
+ w = h = 0;
+ is_null = true;
+ return;
+ }
+
+ QX11AlphaDetector alphaCheck(&img, flags);
+ int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
+
+ if (qt_x11_preferred_pixmap_depth)
+ dd = qt_x11_preferred_pixmap_depth;
+
+ QImage image = img;
+
+ // must be monochrome
+ if (dd == 1 || (flags & Qt::ColorMode_Mask) == Qt::MonoOnly) {
+ if (d != 1) {
+ // dither
+ image = image.convertToFormat(QImage::Format_MonoLSB, flags);
+ d = 1;
+ }
+ } else { // can be both
+ bool conv8 = false;
+ if (d > 8 && dd <= 8) { // convert to 8 bit
+ if ((flags & Qt::DitherMode_Mask) == Qt::AutoDither)
+ flags = (flags & ~Qt::DitherMode_Mask)
+ | Qt::PreferDither;
+ conv8 = true;
+ } else if ((flags & Qt::ColorMode_Mask) == Qt::ColorOnly) {
+ conv8 = (d == 1); // native depth wanted
+ } else if (d == 1) {
+ if (image.colorCount() == 2) {
+ QRgb c0 = image.color(0); // Auto: convert to best
+ QRgb c1 = image.color(1);
+ conv8 = qMin(c0,c1) != qRgb(0,0,0) || qMax(c0,c1) != qRgb(255,255,255);
+ } else {
+ // eg. 1-color monochrome images (they do exist).
+ conv8 = true;
+ }
+ }
+ if (conv8) {
+ image = image.convertToFormat(QImage::Format_Indexed8, flags);
+ d = 8;
+ }
+ }
+
+ if (d == 1 || image.format() > QImage::Format_ARGB32_Premultiplied) {
+ QImage::Format fmt = QImage::Format_RGB32;
+ if (alphaCheck.hasXRenderAndAlpha() && d > 1)
+ fmt = QImage::Format_ARGB32_Premultiplied;
+ image = image.convertToFormat(fmt, flags);
+ fromImage(image, Qt::AutoColor);
+ return;
+ }
+
+ Display *dpy = xinfo.display();
+ Visual *visual = (Visual *)xinfo.visual();
+ XImage *xi = 0;
+ bool trucol = (visual->c_class >= TrueColor);
+ size_t nbytes = image.sizeInBytes();
+ uchar *newbits= 0;
+
+#if QT_CONFIG(xrender)
+ if (alphaCheck.hasXRenderAndAlpha()) {
+ const QImage &cimage = image;
+
+ d = 32;
+
+ if (QXcbX11Info::appDepth() != d) {
+ xinfo.setDepth(d);
+ }
+
+ hd = XCreatePixmap(dpy, RootWindow(dpy, xinfo.screen()), w, h, d);
+ picture = XRenderCreatePicture(dpy, hd,
+ XRenderFindStandardFormat(dpy, PictStandardARGB32), 0, 0);
+
+ xi = XCreateImage(dpy, visual, d, ZPixmap, 0, 0, w, h, 32, 0);
+ Q_CHECK_PTR(xi);
+ newbits = (uchar *)malloc(xi->bytes_per_line*h);
+ Q_CHECK_PTR(newbits);
+ xi->data = (char *)newbits;
+
+ switch (cimage.format()) {
+ case QImage::Format_Indexed8: {
+ QVector<QRgb> colorTable = cimage.colorTable();
+ uint *xidata = (uint *)xi->data;
+ for (int y = 0; y < h; ++y) {
+ const uchar *p = cimage.scanLine(y);
+ for (int x = 0; x < w; ++x) {
+ const QRgb rgb = colorTable[p[x]];
+ const int a = qAlpha(rgb);
+ if (a == 0xff)
+ *xidata = rgb;
+ else
+ // RENDER expects premultiplied alpha
+ *xidata = qRgba(qt_div_255(qRed(rgb) * a),
+ qt_div_255(qGreen(rgb) * a),
+ qt_div_255(qBlue(rgb) * a),
+ a);
+ ++xidata;
+ }
+ }
+ }
+ break;
+ case QImage::Format_RGB32: {
+ uint *xidata = (uint *)xi->data;
+ for (int y = 0; y < h; ++y) {
+ const QRgb *p = (const QRgb *) cimage.scanLine(y);
+ for (int x = 0; x < w; ++x)
+ *xidata++ = p[x] | 0xff000000;
+ }
+ }
+ break;
+ case QImage::Format_ARGB32: {
+ uint *xidata = (uint *)xi->data;
+ for (int y = 0; y < h; ++y) {
+ const QRgb *p = (const QRgb *) cimage.scanLine(y);
+ for (int x = 0; x < w; ++x) {
+ const QRgb rgb = p[x];
+ const int a = qAlpha(rgb);
+ if (a == 0xff)
+ *xidata = rgb;
+ else
+ // RENDER expects premultiplied alpha
+ *xidata = qRgba(qt_div_255(qRed(rgb) * a),
+ qt_div_255(qGreen(rgb) * a),
+ qt_div_255(qBlue(rgb) * a),
+ a);
+ ++xidata;
+ }
+ }
+
+ }
+ break;
+ case QImage::Format_ARGB32_Premultiplied: {
+ uint *xidata = (uint *)xi->data;
+ for (int y = 0; y < h; ++y) {
+ const QRgb *p = (const QRgb *) cimage.scanLine(y);
+ memcpy(xidata, p, w*sizeof(QRgb));
+ xidata += w;
+ }
+ }
+ break;
+ default:
+ Q_ASSERT(false);
+ }
+
+ if ((xi->byte_order == MSBFirst) != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
+ uint *xidata = (uint *)xi->data;
+ uint *xiend = xidata + w*h;
+ while (xidata < xiend) {
+ *xidata = (*xidata >> 24)
+ | ((*xidata >> 8) & 0xff00)
+ | ((*xidata << 8) & 0xff0000)
+ | (*xidata << 24);
+ ++xidata;
+ }
+ }
+
+ GC gc = XCreateGC(dpy, hd, 0, 0);
+ XPutImage(dpy, hd, gc, xi, 0, 0, 0, 0, w, h);
+ XFreeGC(dpy, gc);
+
+ qSafeXDestroyImage(xi);
+
+ return;
+ }
+#endif // QT_CONFIG(xrender)
+
+ if (trucol) { // truecolor display
+ if (image.format() == QImage::Format_ARGB32_Premultiplied)
+ image = image.convertToFormat(QImage::Format_ARGB32);
+
+ const QImage &cimage = image;
+ QRgb pix[256]; // pixel translation table
+ const bool d8 = (d == 8);
+ const uint red_mask = (uint)visual->red_mask;
+ const uint green_mask = (uint)visual->green_mask;
+ const uint blue_mask = (uint)visual->blue_mask;
+ const int red_shift = highest_bit(red_mask) - 7;
+ const int green_shift = highest_bit(green_mask) - 7;
+ const int blue_shift = highest_bit(blue_mask) - 7;
+ const uint rbits = highest_bit(red_mask) - lowest_bit(red_mask) + 1;
+ const uint gbits = highest_bit(green_mask) - lowest_bit(green_mask) + 1;
+ const uint bbits = highest_bit(blue_mask) - lowest_bit(blue_mask) + 1;
+
+ if (d8) { // setup pixel translation
+ QVector<QRgb> ctable = cimage.colorTable();
+ for (int i=0; i < cimage.colorCount(); i++) {
+ int r = qRed (ctable[i]);
+ int g = qGreen(ctable[i]);
+ int b = qBlue (ctable[i]);
+ r = red_shift > 0 ? r << red_shift : r >> -red_shift;
+ g = green_shift > 0 ? g << green_shift : g >> -green_shift;
+ b = blue_shift > 0 ? b << blue_shift : b >> -blue_shift;
+ pix[i] = (b & blue_mask) | (g & green_mask) | (r & red_mask)
+ | ~(blue_mask | green_mask | red_mask);
+ }
+ }
+
+ xi = XCreateImage(dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0);
+ Q_CHECK_PTR(xi);
+ newbits = (uchar *)malloc(xi->bytes_per_line*h);
+ Q_CHECK_PTR(newbits);
+ if (!newbits) // no memory
+ return;
+ int bppc = xi->bits_per_pixel;
+
+ bool contig_bits = n_bits(red_mask) == rbits &&
+ n_bits(green_mask) == gbits &&
+ n_bits(blue_mask) == bbits;
+ bool dither_tc =
+ // Want it?
+ (flags & Qt::Dither_Mask) != Qt::ThresholdDither &&
+ (flags & Qt::DitherMode_Mask) != Qt::AvoidDither &&
+ // Need it?
+ bppc < 24 && !d8 &&
+ // Can do it? (Contiguous bits?)
+ contig_bits;
+
+ static bool init=false;
+ static int D[16][16];
+ if (dither_tc && !init) {
+ // I also contributed this code to XV - WWA.
+ /*
+ The dither matrix, D, is obtained with this formula:
+
+ D2 = [0 2]
+ [3 1]
+
+
+ D2*n = [4*Dn 4*Dn+2*Un]
+ [4*Dn+3*Un 4*Dn+1*Un]
+ */
+ int n,i,j;
+ init=1;
+
+ /* Set D2 */
+ D[0][0]=0;
+ D[1][0]=2;
+ D[0][1]=3;
+ D[1][1]=1;
+
+ /* Expand using recursive definition given above */
+ for (n=2; n<16; n*=2) {
+ for (i=0; i<n; i++) {
+ for (j=0; j<n; j++) {
+ D[i][j]*=4;
+ D[i+n][j]=D[i][j]+2;
+ D[i][j+n]=D[i][j]+3;
+ D[i+n][j+n]=D[i][j]+1;
+ }
+ }
+ }
+ init=true;
+ }
+
+ enum { BPP8,
+ BPP16_565, BPP16_555,
+ BPP16_MSB, BPP16_LSB,
+ BPP24_888,
+ BPP24_MSB, BPP24_LSB,
+ BPP32_8888,
+ BPP32_MSB, BPP32_LSB
+ } mode = BPP8;
+
+ bool same_msb_lsb = (xi->byte_order == MSBFirst) == (QSysInfo::ByteOrder == QSysInfo::BigEndian);
+
+ if (bppc == 8) // 8 bit
+ mode = BPP8;
+ else if (bppc == 16) { // 16 bit MSB/LSB
+ if (red_shift == 8 && green_shift == 3 && blue_shift == -3 && !d8 && same_msb_lsb)
+ mode = BPP16_565;
+ else if (red_shift == 7 && green_shift == 2 && blue_shift == -3 && !d8 && same_msb_lsb)
+ mode = BPP16_555;
+ else
+ mode = (xi->byte_order == LSBFirst) ? BPP16_LSB : BPP16_MSB;
+ } else if (bppc == 24) { // 24 bit MSB/LSB
+ if (red_shift == 16 && green_shift == 8 && blue_shift == 0 && !d8 && same_msb_lsb)
+ mode = BPP24_888;
+ else
+ mode = (xi->byte_order == LSBFirst) ? BPP24_LSB : BPP24_MSB;
+ } else if (bppc == 32) { // 32 bit MSB/LSB
+ if (red_shift == 16 && green_shift == 8 && blue_shift == 0 && !d8 && same_msb_lsb)
+ mode = BPP32_8888;
+ else
+ mode = (xi->byte_order == LSBFirst) ? BPP32_LSB : BPP32_MSB;
+ } else
+ qFatal("Logic error 3");
+
+#define GET_PIXEL \
+ uint pixel; \
+ if (d8) pixel = pix[*src++]; \
+ else { \
+ int r = qRed (*p); \
+ int g = qGreen(*p); \
+ int b = qBlue (*p++); \
+ r = red_shift > 0 \
+ ? r << red_shift : r >> -red_shift; \
+ g = green_shift > 0 \
+ ? g << green_shift : g >> -green_shift; \
+ b = blue_shift > 0 \
+ ? b << blue_shift : b >> -blue_shift; \
+ pixel = (r & red_mask)|(g & green_mask) | (b & blue_mask) \
+ | ~(blue_mask | green_mask | red_mask); \
+ }
+
+#define GET_PIXEL_DITHER_TC \
+ int r = qRed (*p); \
+ int g = qGreen(*p); \
+ int b = qBlue (*p++); \
+ const int thres = D[x%16][y%16]; \
+ if (r <= (255-(1<<(8-rbits))) && ((r<<rbits) & 255) \
+ > thres) \
+ r += (1<<(8-rbits)); \
+ if (g <= (255-(1<<(8-gbits))) && ((g<<gbits) & 255) \
+ > thres) \
+ g += (1<<(8-gbits)); \
+ if (b <= (255-(1<<(8-bbits))) && ((b<<bbits) & 255) \
+ > thres) \
+ b += (1<<(8-bbits)); \
+ r = red_shift > 0 \
+ ? r << red_shift : r >> -red_shift; \
+ g = green_shift > 0 \
+ ? g << green_shift : g >> -green_shift; \
+ b = blue_shift > 0 \
+ ? b << blue_shift : b >> -blue_shift; \
+ uint pixel = (r & red_mask)|(g & green_mask) | (b & blue_mask);
+
+// again, optimized case
+// can't be optimized that much :(
+#define GET_PIXEL_DITHER_TC_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask, \
+ rbits,gbits,bbits) \
+ const int thres = D[x%16][y%16]; \
+ int r = qRed (*p); \
+ if (r <= (255-(1<<(8-rbits))) && ((r<<rbits) & 255) \
+ > thres) \
+ r += (1<<(8-rbits)); \
+ int g = qGreen(*p); \
+ if (g <= (255-(1<<(8-gbits))) && ((g<<gbits) & 255) \
+ > thres) \
+ g += (1<<(8-gbits)); \
+ int b = qBlue (*p++); \
+ if (b <= (255-(1<<(8-bbits))) && ((b<<bbits) & 255) \
+ > thres) \
+ b += (1<<(8-bbits)); \
+ uint pixel = ((r red_shift) & red_mask) \
+ | ((g green_shift) & green_mask) \
+ | ((b blue_shift) & blue_mask);
+
+#define CYCLE(body) \
+ for (int y=0; y<h; y++) { \
+ const uchar* src = cimage.scanLine(y); \
+ uchar* dst = newbits + xi->bytes_per_line*y; \
+ const QRgb* p = (const QRgb *)src; \
+ body \
+ }
+
+ if (dither_tc) {
+ switch (mode) {
+ case BPP16_565:
+ CYCLE(
+ quint16* dst16 = (quint16*)dst;
+ for (int x=0; x<w; x++) {
+ GET_PIXEL_DITHER_TC_OPT(<<8,<<3,>>3,0xf800,0x7e0,0x1f,5,6,5)
+ *dst16++ = pixel;
+ }
+ )
+ break;
+ case BPP16_555:
+ CYCLE(
+ quint16* dst16 = (quint16*)dst;
+ for (int x=0; x<w; x++) {
+ GET_PIXEL_DITHER_TC_OPT(<<7,<<2,>>3,0x7c00,0x3e0,0x1f,5,5,5)
+ *dst16++ = pixel;
+ }
+ )
+ break;
+ case BPP16_MSB: // 16 bit MSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL_DITHER_TC
+ *dst++ = (pixel >> 8);
+ *dst++ = pixel;
+ }
+ )
+ break;
+ case BPP16_LSB: // 16 bit LSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL_DITHER_TC
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ }
+ )
+ break;
+ default:
+ qFatal("Logic error");
+ }
+ } else {
+ switch (mode) {
+ case BPP8: // 8 bit
+ CYCLE(
+ Q_UNUSED(p);
+ for (int x=0; x<w; x++)
+ *dst++ = pix[*src++];
+ )
+ break;
+ case BPP16_565:
+ CYCLE(
+ quint16* dst16 = (quint16*)dst;
+ for (int x = 0; x < w; x++) {
+ *dst16++ = ((*p >> 8) & 0xf800)
+ | ((*p >> 5) & 0x7e0)
+ | ((*p >> 3) & 0x1f);
+ ++p;
+ }
+ )
+ break;
+ case BPP16_555:
+ CYCLE(
+ quint16* dst16 = (quint16*)dst;
+ for (int x=0; x<w; x++) {
+ *dst16++ = ((*p >> 9) & 0x7c00)
+ | ((*p >> 6) & 0x3e0)
+ | ((*p >> 3) & 0x1f);
+ ++p;
+ }
+ )
+ break;
+ case BPP16_MSB: // 16 bit MSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL
+ *dst++ = (pixel >> 8);
+ *dst++ = pixel;
+ }
+ )
+ break;
+ case BPP16_LSB: // 16 bit LSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ }
+ )
+ break;
+ case BPP24_888:
+ CYCLE(
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ for (int x=0; x<w; x++) {
+ *dst++ = qRed (*p);
+ *dst++ = qGreen(*p);
+ *dst++ = qBlue (*p++);
+ }
+ } else {
+ for (int x=0; x<w; x++) {
+ *dst++ = qBlue (*p);
+ *dst++ = qGreen(*p);
+ *dst++ = qRed (*p++);
+ }
+ }
+ )
+ break;
+ case BPP24_MSB: // 24 bit MSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL
+ *dst++ = pixel >> 16;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel;
+ }
+ )
+ break;
+ case BPP24_LSB: // 24 bit LSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel >> 16;
+ }
+ )
+ break;
+ case BPP32_8888:
+ CYCLE(
+ memcpy(dst, p, w * 4);
+ )
+ break;
+ case BPP32_MSB: // 32 bit MSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL
+ *dst++ = pixel >> 24;
+ *dst++ = pixel >> 16;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel;
+ }
+ )
+ break;
+ case BPP32_LSB: // 32 bit LSB
+ CYCLE(
+ for (int x=0; x<w; x++) {
+ GET_PIXEL
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel >> 16;
+ *dst++ = pixel >> 24;
+ }
+ )
+ break;
+ default:
+ qFatal("Logic error 2");
+ }
+ }
+ xi->data = (char *)newbits;
+ }
+
+ if (d == 8 && !trucol) { // 8 bit pixmap
+ int pop[256]; // pixel popularity
+
+ if (image.colorCount() == 0)
+ image.setColorCount(1);
+
+ const QImage &cimage = image;
+ memset(pop, 0, sizeof(int)*256); // reset popularity array
+ for (int i = 0; i < h; i++) { // for each scanline...
+ const uchar* p = cimage.scanLine(i);
+ const uchar *end = p + w;
+ while (p < end) // compute popularity
+ pop[*p++]++;
+ }
+
+ newbits = (uchar *)malloc(nbytes); // copy image into newbits
+ Q_CHECK_PTR(newbits);
+ if (!newbits) // no memory
+ return;
+ uchar* p = newbits;
+ memcpy(p, cimage.bits(), nbytes); // copy image data into newbits
+
+ /*
+ * The code below picks the most important colors. It is based on the
+ * diversity algorithm, implemented in XV 3.10. XV is (C) by John Bradley.
+ */
+
+ struct PIX { // pixel sort element
+ uchar r,g,b,n; // color + pad
+ int use; // popularity
+ int index; // index in colormap
+ int mindist;
+ };
+ int ncols = 0;
+ for (int i=0; i< cimage.colorCount(); i++) { // compute number of colors
+ if (pop[i] > 0)
+ ncols++;
+ }
+ for (int i = cimage.colorCount(); i < 256; i++) // ignore out-of-range pixels
+ pop[i] = 0;
+
+ // works since we make sure above to have at least
+ // one color in the image
+ if (ncols == 0)
+ ncols = 1;
+
+ PIX pixarr[256]; // pixel array
+ PIX pixarr_sorted[256]; // pixel array (sorted)
+ memset(pixarr, 0, ncols*sizeof(PIX));
+ PIX *px = &pixarr[0];
+ int maxpop = 0;
+ int maxpix = 0;
+ uint j = 0;
+ QVector<QRgb> ctable = cimage.colorTable();
+ for (int i = 0; i < 256; i++) { // init pixel array
+ if (pop[i] > 0) {
+ px->r = qRed (ctable[i]);
+ px->g = qGreen(ctable[i]);
+ px->b = qBlue (ctable[i]);
+ px->n = 0;
+ px->use = pop[i];
+ if (pop[i] > maxpop) { // select most popular entry
+ maxpop = pop[i];
+ maxpix = j;
+ }
+ px->index = i;
+ px->mindist = 1000000;
+ px++;
+ j++;
+ }
+ }
+ pixarr_sorted[0] = pixarr[maxpix];
+ pixarr[maxpix].use = 0;
+
+ for (int i = 1; i < ncols; i++) { // sort pixels
+ int minpix = -1, mindist = -1;
+ px = &pixarr_sorted[i-1];
+ int r = px->r;
+ int g = px->g;
+ int b = px->b;
+ int dist;
+ if ((i & 1) || i<10) { // sort on max distance
+ for (int j=0; j<ncols; j++) {
+ px = &pixarr[j];
+ if (px->use) {
+ dist = (px->r - r)*(px->r - r) +
+ (px->g - g)*(px->g - g) +
+ (px->b - b)*(px->b - b);
+ if (px->mindist > dist)
+ px->mindist = dist;
+ if (px->mindist > mindist) {
+ mindist = px->mindist;
+ minpix = j;
+ }
+ }
+ }
+ } else { // sort on max popularity
+ for (int j=0; j<ncols; j++) {
+ px = &pixarr[j];
+ if (px->use) {
+ dist = (px->r - r)*(px->r - r) +
+ (px->g - g)*(px->g - g) +
+ (px->b - b)*(px->b - b);
+ if (px->mindist > dist)
+ px->mindist = dist;
+ if (px->use > mindist) {
+ mindist = px->use;
+ minpix = j;
+ }
+ }
+ }
+ }
+ pixarr_sorted[i] = pixarr[minpix];
+ pixarr[minpix].use = 0;
+ }
+
+ QXcbColormap cmap = QXcbColormap::instance(xinfo.screen());
+ uint pix[256]; // pixel translation table
+ px = &pixarr_sorted[0];
+ for (int i = 0; i < ncols; i++) { // allocate colors
+ QColor c(px->r, px->g, px->b);
+ pix[px->index] = cmap.pixel(c);
+ px++;
+ }
+
+ p = newbits;
+ for (size_t i = 0; i < nbytes; i++) { // translate pixels
+ *p = pix[*p];
+ p++;
+ }
+ }
+
+ if (!xi) { // X image not created
+ xi = XCreateImage(dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0);
+ if (xi->bits_per_pixel == 16) { // convert 8 bpp ==> 16 bpp
+ ushort *p2;
+ int p2inc = xi->bytes_per_line/sizeof(ushort);
+ ushort *newerbits = (ushort *)malloc(xi->bytes_per_line * h);
+ Q_CHECK_PTR(newerbits);
+ if (!newerbits) // no memory
+ return;
+ uchar* p = newbits;
+ for (int y = 0; y < h; y++) { // OOPS: Do right byte order!!
+ p2 = newerbits + p2inc*y;
+ for (int x = 0; x < w; x++)
+ *p2++ = *p++;
+ }
+ free(newbits);
+ newbits = (uchar *)newerbits;
+ } else if (xi->bits_per_pixel != 8) {
+ qWarning("QPixmap::fromImage: Display not supported "
+ "(bpp=%d)", xi->bits_per_pixel);
+ }
+ xi->data = (char *)newbits;
+ }
+
+ hd = XCreatePixmap(dpy,
+ RootWindow(dpy, xinfo.screen()),
+ w, h, dd);
+
+ GC gc = XCreateGC(dpy, hd, 0, 0);
+ XPutImage(dpy, hd, gc, xi, 0, 0, 0, 0, w, h);
+ XFreeGC(dpy, gc);
+
+ qSafeXDestroyImage(xi);
+ d = dd;
+
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ XRenderPictFormat *format = d == 1
+ ? XRenderFindStandardFormat(dpy, PictStandardA1)
+ : XRenderFindVisualFormat(dpy, (Visual *)xinfo.visual());
+ picture = XRenderCreatePicture(dpy, hd, format, 0, 0);
+ }
+#endif
+
+ if (alphaCheck.hasAlpha()) {
+ QBitmap m = QBitmap::fromImage(image.createAlphaMask(flags));
+ setMask(m);
+ }
+}
+
+void QX11PlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect)
+{
+ if (data->pixelType() == BitmapType) {
+ fromImage(data->toImage().copy(rect), Qt::AutoColor);
+ return;
+ }
+
+ const QX11PlatformPixmap *x11Data = static_cast<const QX11PlatformPixmap*>(data);
+
+ setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
+
+ flags &= ~Uninitialized;
+ xinfo = x11Data->xinfo;
+ d = x11Data->d;
+ w = rect.width();
+ h = rect.height();
+ is_null = (w <= 0 || h <= 0);
+ hd = XCreatePixmap(xinfo.display(),
+ RootWindow(xinfo.display(), x11Data->xinfo.screen()),
+ w, h, d);
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ XRenderPictFormat *format = d == 32
+ ? XRenderFindStandardFormat(xinfo.display(), PictStandardARGB32)
+ : XRenderFindVisualFormat(xinfo.display(), (Visual *)xinfo.visual());
+ picture = XRenderCreatePicture(xinfo.display(), hd, format, 0, 0);
+ }
+#endif // QT_CONFIG(xrender)
+ if (x11Data->x11_mask) {
+ x11_mask = XCreatePixmap(xinfo.display(), hd, w, h, 1);
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ mask_picture = XRenderCreatePicture(xinfo.display(), x11_mask,
+ XRenderFindStandardFormat(xinfo.display(), PictStandardA1), 0, 0);
+ XRenderPictureAttributes attrs;
+ attrs.alpha_map = x11Data->mask_picture;
+ XRenderChangePicture(xinfo.display(), x11Data->picture, CPAlphaMap, &attrs);
+ }
+#endif
+ }
+
+#if QT_CONFIG(xrender)
+ if (x11Data->picture && x11Data->d == 32) {
+ XRenderComposite(xinfo.display(), PictOpSrc,
+ x11Data->picture, 0, picture,
+ rect.x(), rect.y(), 0, 0, 0, 0, w, h);
+ } else
+#endif
+ {
+ GC gc = XCreateGC(xinfo.display(), hd, 0, 0);
+ XCopyArea(xinfo.display(), x11Data->hd, hd, gc,
+ rect.x(), rect.y(), w, h, 0, 0);
+ if (x11Data->x11_mask) {
+ GC monogc = XCreateGC(xinfo.display(), x11_mask, 0, 0);
+ XCopyArea(xinfo.display(), x11Data->x11_mask, x11_mask, monogc,
+ rect.x(), rect.y(), w, h, 0, 0);
+ XFreeGC(xinfo.display(), monogc);
+ }
+ XFreeGC(xinfo.display(), gc);
+ }
+}
+
+bool QX11PlatformPixmap::scroll(int dx, int dy, const QRect &rect)
+{
+ GC gc = XCreateGC(xinfo.display(), hd, 0, 0);
+ XCopyArea(xinfo.display(), hd, hd, gc,
+ rect.left(), rect.top(), rect.width(), rect.height(),
+ rect.left() + dx, rect.top() + dy);
+ XFreeGC(xinfo.display(), gc);
+ return true;
+}
+
+int QX11PlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
+{
+ switch (metric) {
+ case QPaintDevice::PdmDevicePixelRatio:
+ return devicePixelRatio();
+ break;
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ return devicePixelRatio() * QPaintDevice::devicePixelRatioFScale();
+ break;
+ case QPaintDevice::PdmWidth:
+ return w;
+ case QPaintDevice::PdmHeight:
+ return h;
+ case QPaintDevice::PdmNumColors:
+ return 1 << d;
+ case QPaintDevice::PdmDepth:
+ return d;
+ case QPaintDevice::PdmWidthMM: {
+ const int screen = xinfo.screen();
+ const int mm = DisplayWidthMM(xinfo.display(), screen) * w
+ / DisplayWidth(xinfo.display(), screen);
+ return mm;
+ }
+ case QPaintDevice::PdmHeightMM: {
+ const int screen = xinfo.screen();
+ const int mm = (DisplayHeightMM(xinfo.display(), screen) * h)
+ / DisplayHeight(xinfo.display(), screen);
+ return mm;
+ }
+ case QPaintDevice::PdmDpiX:
+ case QPaintDevice::PdmPhysicalDpiX:
+ return QXcbX11Info::appDpiX(xinfo.screen());
+ case QPaintDevice::PdmDpiY:
+ case QPaintDevice::PdmPhysicalDpiY:
+ return QXcbX11Info::appDpiY(xinfo.screen());
+ default:
+ qWarning("QX11PlatformPixmap::metric(): Invalid metric");
+ return 0;
+ }
+}
+
+void QX11PlatformPixmap::fill(const QColor &fillColor)
+{
+ if (fillColor.alpha() != 255) {
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ if (!picture || d != 32)
+ convertToARGB32(/*preserveContents = */false);
+
+ ::Picture src = X11->getSolidFill(xinfo.screen(), fillColor);
+ XRenderComposite(xinfo.display(), PictOpSrc, src, 0, picture,
+ 0, 0, width(), height(),
+ 0, 0, width(), height());
+ } else
+#endif
+ {
+ QImage im(width(), height(), QImage::Format_ARGB32_Premultiplied);
+ im.fill(PREMUL(fillColor.rgba()));
+ release();
+ fromImage(im, Qt::AutoColor | Qt::OrderedAlphaDither);
+ }
+ return;
+ }
+
+ GC gc = XCreateGC(xinfo.display(), hd, 0, 0);
+ if (depth() == 1) {
+ XSetForeground(xinfo.display(), gc, qGray(fillColor.rgb()) > 127 ? 0 : 1);
+ } else if (X11->use_xrender && d >= 24) {
+ XSetForeground(xinfo.display(), gc, fillColor.rgba());
+ } else {
+ XSetForeground(xinfo.display(), gc,
+ QXcbColormap::instance(xinfo.screen()).pixel(fillColor));
+ }
+ XFillRectangle(xinfo.display(), hd, gc, 0, 0, width(), height());
+ XFreeGC(xinfo.display(), gc);
+}
+
+QBitmap QX11PlatformPixmap::mask() const
+{
+ QBitmap mask;
+#if QT_CONFIG(xrender)
+ if (picture && d == 32) {
+ // #### slow - there must be a better way..
+ mask = QBitmap::fromImage(toImage().createAlphaMask());
+ } else
+#endif
+ if (d == 1) {
+ QX11PlatformPixmap *that = const_cast<QX11PlatformPixmap*>(this);
+ mask = QPixmap(that);
+ } else {
+ mask = mask_to_bitmap(xinfo.screen());
+ }
+ return mask;
+}
+
+void QX11PlatformPixmap::setMask(const QBitmap &newmask)
+{
+ if (newmask.isNull()) { // clear mask
+#if QT_CONFIG(xrender)
+ if (picture && d == 32) {
+ QX11PlatformPixmap newData(pixelType());
+ newData.resize(w, h);
+ newData.fill(Qt::black);
+ XRenderComposite(xinfo.display(), PictOpOver,
+ picture, 0, newData.picture,
+ 0, 0, 0, 0, 0, 0, w, h);
+ release();
+ *this = newData;
+ // the new QX11PlatformPixmap object isn't referenced yet, so
+ // ref it
+ ref.ref();
+
+ // the below is to make sure the QX11PlatformPixmap destructor
+ // doesn't delete our newly created render picture
+ newData.hd = 0;
+ newData.x11_mask = 0;
+ newData.picture = 0;
+ newData.mask_picture = 0;
+ newData.hd2 = 0;
+ } else
+#endif
+ if (x11_mask) {
+#if QT_CONFIG(xrender)
+ if (picture) {
+ XRenderPictureAttributes attrs;
+ attrs.alpha_map = 0;
+ XRenderChangePicture(xinfo.display(), picture, CPAlphaMap,
+ &attrs);
+ }
+ if (mask_picture)
+ XRenderFreePicture(xinfo.display(), mask_picture);
+ mask_picture = 0;
+#endif
+ XFreePixmap(xinfo.display(), x11_mask);
+ x11_mask = 0;
+ }
+ return;
+ }
+
+#if QT_CONFIG(xrender)
+ if (picture && d == 32) {
+ XRenderComposite(xinfo.display(), PictOpSrc,
+ picture, qt_x11Pixmap(newmask)->x11PictureHandle(),
+ picture, 0, 0, 0, 0, 0, 0, w, h);
+ } else
+#endif
+ if (depth() == 1) {
+ XGCValues vals;
+ vals.function = GXand;
+ GC gc = XCreateGC(xinfo.display(), hd, GCFunction, &vals);
+ XCopyArea(xinfo.display(), qt_x11Pixmap(newmask)->handle(), hd, gc, 0, 0,
+ width(), height(), 0, 0);
+ XFreeGC(xinfo.display(), gc);
+ } else {
+ // ##### should or the masks together
+ if (x11_mask) {
+ XFreePixmap(xinfo.display(), x11_mask);
+#if QT_CONFIG(xrender)
+ if (mask_picture)
+ XRenderFreePicture(xinfo.display(), mask_picture);
+#endif
+ }
+ x11_mask = QX11PlatformPixmap::bitmap_to_mask(newmask, xinfo.screen());
+#if QT_CONFIG(xrender)
+ if (picture) {
+ mask_picture = XRenderCreatePicture(xinfo.display(), x11_mask,
+ XRenderFindStandardFormat(xinfo.display(), PictStandardA1), 0, 0);
+ XRenderPictureAttributes attrs;
+ attrs.alpha_map = mask_picture;
+ XRenderChangePicture(xinfo.display(), picture, CPAlphaMap, &attrs);
+ }
+#endif
+ }
+}
+
+bool QX11PlatformPixmap::hasAlphaChannel() const
+{
+ if (picture && d == 32)
+ return true;
+
+ if (x11_mask && d == 1)
+ return true;
+
+ return false;
+}
+
+QPixmap QX11PlatformPixmap::transformed(const QTransform &transform, Qt::TransformationMode mode) const
+{
+ if (mode == Qt::SmoothTransformation || transform.type() >= QTransform::TxProject) {
+ QImage image = toImage();
+ return QPixmap::fromImage(image.transformed(transform, mode));
+ }
+
+ uint w = 0;
+ uint h = 0; // size of target pixmap
+ uint ws, hs; // size of source pixmap
+ uchar *dptr; // data in target pixmap
+ uint dbpl, dbytes; // bytes per line/bytes total
+ uchar *sptr; // data in original pixmap
+ int sbpl; // bytes per line in original
+ int bpp; // bits per pixel
+ bool depth1 = depth() == 1;
+ Display *dpy = xinfo.display();
+
+ ws = width();
+ hs = height();
+
+ QTransform mat(transform.m11(), transform.m12(), transform.m13(),
+ transform.m21(), transform.m22(), transform.m23(),
+ 0., 0., 1);
+ bool complex_xform = false;
+ qreal scaledWidth;
+ qreal scaledHeight;
+
+ if (mat.type() <= QTransform::TxScale) {
+ scaledHeight = qAbs(mat.m22()) * hs + 0.9999;
+ scaledWidth = qAbs(mat.m11()) * ws + 0.9999;
+ h = qAbs(int(scaledHeight));
+ w = qAbs(int(scaledWidth));
+ } else { // rotation or shearing
+ QPolygonF a(QRectF(0, 0, ws, hs));
+ a = mat.map(a);
+ QRect r = a.boundingRect().toAlignedRect();
+ w = r.width();
+ h = r.height();
+ scaledWidth = w;
+ scaledHeight = h;
+ complex_xform = true;
+ }
+ mat = QPixmap::trueMatrix(mat, ws, hs); // true matrix
+
+ bool invertible;
+ mat = mat.inverted(&invertible); // invert matrix
+
+ if (h == 0 || w == 0 || !invertible
+ || qAbs(scaledWidth) >= 32768 || qAbs(scaledHeight) >= 32768 )
+ // error, return null pixmap
+ return QPixmap();
+
+ XImage *xi = XGetImage(xinfo.display(), handle(), 0, 0, ws, hs, AllPlanes,
+ depth1 ? XYPixmap : ZPixmap);
+
+ if (!xi)
+ return QPixmap();
+
+ sbpl = xi->bytes_per_line;
+ sptr = (uchar *)xi->data;
+ bpp = xi->bits_per_pixel;
+
+ if (depth1)
+ dbpl = (w+7)/8;
+ else
+ dbpl = ((w*bpp+31)/32)*4;
+ dbytes = dbpl*h;
+
+ dptr = (uchar *)malloc(dbytes); // create buffer for bits
+ Q_CHECK_PTR(dptr);
+ if (depth1) // fill with zeros
+ memset(dptr, 0, dbytes);
+ else if (bpp == 8) // fill with background color
+ memset(dptr, WhitePixel(xinfo.display(), xinfo.screen()), dbytes);
+ else
+ memset(dptr, 0, dbytes);
+
+ // #define QT_DEBUG_XIMAGE
+#if defined(QT_DEBUG_XIMAGE)
+ qDebug("----IMAGE--INFO--------------");
+ qDebug("width............. %d", xi->width);
+ qDebug("height............ %d", xi->height);
+ qDebug("xoffset........... %d", xi->xoffset);
+ qDebug("format............ %d", xi->format);
+ qDebug("byte order........ %d", xi->byte_order);
+ qDebug("bitmap unit....... %d", xi->bitmap_unit);
+ qDebug("bitmap bit order.. %d", xi->bitmap_bit_order);
+ qDebug("depth............. %d", xi->depth);
+ qDebug("bytes per line.... %d", xi->bytes_per_line);
+ qDebug("bits per pixel.... %d", xi->bits_per_pixel);
+#endif
+
+ int type;
+ if (xi->bitmap_bit_order == MSBFirst)
+ type = QT_XFORM_TYPE_MSBFIRST;
+ else
+ type = QT_XFORM_TYPE_LSBFIRST;
+ int xbpl, p_inc;
+ if (depth1) {
+ xbpl = (w+7)/8;
+ p_inc = dbpl - xbpl;
+ } else {
+ xbpl = (w*bpp)/8;
+ p_inc = dbpl - xbpl;
+ }
+
+ if (!qt_xForm_helper(mat, xi->xoffset, type, bpp, dptr, xbpl, p_inc, h, sptr, sbpl, ws, hs)){
+ qWarning("QPixmap::transform: display not supported (bpp=%d)",bpp);
+ QPixmap pm;
+ free(dptr);
+ return pm;
+ }
+
+ qSafeXDestroyImage(xi);
+
+ if (depth1) { // mono bitmap
+ QBitmap bm = QBitmap::fromData(QSize(w, h), dptr,
+ BitmapBitOrder(xinfo.display()) == MSBFirst
+ ? QImage::Format_Mono
+ : QImage::Format_MonoLSB);
+ free(dptr);
+ return bm;
+ } else { // color pixmap
+ QX11PlatformPixmap *x11Data = new QX11PlatformPixmap(QPlatformPixmap::PixmapType);
+ QPixmap pm(x11Data);
+ x11Data->flags &= ~QX11PlatformPixmap::Uninitialized;
+ x11Data->xinfo = xinfo;
+ x11Data->d = d;
+ x11Data->w = w;
+ x11Data->h = h;
+ x11Data->is_null = (w <= 0 || h <= 0);
+ x11Data->hd = XCreatePixmap(xinfo.display(),
+ RootWindow(xinfo.display(), xinfo.screen()),
+ w, h, d);
+ x11Data->setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
+
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ XRenderPictFormat *format = x11Data->d == 32
+ ? XRenderFindStandardFormat(xinfo.display(), PictStandardARGB32)
+ : XRenderFindVisualFormat(xinfo.display(), (Visual *) x11Data->xinfo.visual());
+ x11Data->picture = XRenderCreatePicture(xinfo.display(), x11Data->hd, format, 0, 0);
+ }
+#endif // QT_CONFIG(xrender)
+
+ GC gc = XCreateGC(xinfo.display(), x11Data->hd, 0, 0);
+ xi = XCreateImage(dpy, (Visual*)x11Data->xinfo.visual(),
+ x11Data->d,
+ ZPixmap, 0, (char *)dptr, w, h, 32, 0);
+ XPutImage(dpy, qt_x11Pixmap(pm)->handle(), gc, xi, 0, 0, 0, 0, w, h);
+ qSafeXDestroyImage(xi);
+ XFreeGC(xinfo.display(), gc);
+
+ if (x11_mask) { // xform mask, too
+ pm.setMask(mask_to_bitmap(xinfo.screen()).transformed(transform));
+ } else if (d != 32 && complex_xform) { // need a mask!
+ QBitmap mask(ws, hs);
+ mask.fill(Qt::color1);
+ pm.setMask(mask.transformed(transform));
+ }
+ return pm;
+ }
+}
+
+QImage QX11PlatformPixmap::toImage() const
+{
+ return toImage(QRect(0, 0, w, h));
+}
+
+QImage QX11PlatformPixmap::toImage(const QRect &rect) const
+{
+ Window root_return;
+ int x_return;
+ int y_return;
+ unsigned int width_return;
+ unsigned int height_return;
+ unsigned int border_width_return;
+ unsigned int depth_return;
+
+ XGetGeometry(xinfo.display(), hd, &root_return, &x_return, &y_return, &width_return, &height_return, &border_width_return, &depth_return);
+
+ QXImageWrapper xiWrapper;
+ xiWrapper.xi = XGetImage(xinfo.display(), hd, rect.x(), rect.y(), rect.width(), rect.height(),
+ AllPlanes, (depth() == 1) ? XYPixmap : ZPixmap);
+
+ Q_CHECK_PTR(xiWrapper.xi);
+ if (!xiWrapper.xi)
+ return QImage();
+
+ if (!x11_mask && canTakeQImageFromXImage(xiWrapper))
+ return takeQImageFromXImage(xiWrapper);
+
+ QImage image = toImage(xiWrapper, rect);
+ qSafeXDestroyImage(xiWrapper.xi);
+ return image;
+}
+
+#if QT_CONFIG(xrender)
+static XRenderPictFormat *qt_renderformat_for_depth(const QXcbX11Info &xinfo, int depth)
+{
+ if (depth == 1)
+ return XRenderFindStandardFormat(xinfo.display(), PictStandardA1);
+ else if (depth == 32)
+ return XRenderFindStandardFormat(xinfo.display(), PictStandardARGB32);
+ else
+ return XRenderFindVisualFormat(xinfo.display(), (Visual *)xinfo.visual());
+}
+#endif
+
+Q_GLOBAL_STATIC(QX11PaintEngine, qt_x11_paintengine)
+
+QPaintEngine *QX11PlatformPixmap::paintEngine() const
+{
+ QX11PlatformPixmap *that = const_cast<QX11PlatformPixmap*>(this);
+
+ if ((flags & Readonly)/* && share_mode == QPixmap::ImplicitlyShared*/) {
+ // if someone wants to draw onto us, copy the shared contents
+ // and turn it into a fully fledged QPixmap
+ ::Pixmap hd_copy = XCreatePixmap(xinfo.display(), RootWindow(xinfo.display(), xinfo.screen()),
+ w, h, d);
+#if QT_CONFIG(xrender)
+ if (picture && d == 32) {
+ XRenderPictFormat *format = qt_renderformat_for_depth(xinfo, d);
+ ::Picture picture_copy = XRenderCreatePicture(xinfo.display(),
+ hd_copy, format,
+ 0, 0);
+
+ XRenderComposite(xinfo.display(), PictOpSrc, picture, 0, picture_copy,
+ 0, 0, 0, 0, 0, 0, w, h);
+ XRenderFreePicture(xinfo.display(), picture);
+ that->picture = picture_copy;
+ } else
+#endif
+ {
+ GC gc = XCreateGC(xinfo.display(), hd_copy, 0, 0);
+ XCopyArea(xinfo.display(), hd, hd_copy, gc, 0, 0, w, h, 0, 0);
+ XFreeGC(xinfo.display(), gc);
+ }
+ that->hd = hd_copy;
+ that->flags &= ~QX11PlatformPixmap::Readonly;
+ }
+
+ if (qt_x11_paintengine->isActive()) {
+ if (!that->pengine)
+ that->pengine = new QX11PaintEngine;
+
+ return that->pengine;
+ }
+
+ return qt_x11_paintengine();
+}
+
+qreal QX11PlatformPixmap::devicePixelRatio() const
+{
+ return dpr;
+}
+
+void QX11PlatformPixmap::setDevicePixelRatio(qreal scaleFactor)
+{
+ dpr = scaleFactor;
+}
+
+Pixmap QX11PlatformPixmap::x11ConvertToDefaultDepth()
+{
+#if QT_CONFIG(xrender)
+ if (d == xinfo.appDepth() || !X11->use_xrender)
+ return hd;
+ if (!hd2) {
+ hd2 = XCreatePixmap(xinfo.display(), hd, w, h, xinfo.appDepth());
+ XRenderPictFormat *format = XRenderFindVisualFormat(xinfo.display(),
+ (Visual*) xinfo.visual());
+ Picture pic = XRenderCreatePicture(xinfo.display(), hd2, format, 0, 0);
+ XRenderComposite(xinfo.display(), PictOpSrc, picture,
+ XNone, pic, 0, 0, 0, 0, 0, 0, w, h);
+ XRenderFreePicture(xinfo.display(), pic);
+ }
+ return hd2;
+#else
+ return hd;
+#endif
+}
+
+XID QX11PlatformPixmap::createBitmapFromImage(const QImage &image)
+{
+ QImage img = image.convertToFormat(QImage::Format_MonoLSB);
+ const QRgb c0 = QColor(Qt::black).rgb();
+ const QRgb c1 = QColor(Qt::white).rgb();
+ if (img.color(0) == c0 && img.color(1) == c1) {
+ img.invertPixels();
+ img.setColor(0, c1);
+ img.setColor(1, c0);
+ }
+
+ char *bits;
+ uchar *tmp_bits;
+ int w = img.width();
+ int h = img.height();
+ int bpl = (w + 7) / 8;
+ int ibpl = img.bytesPerLine();
+ if (bpl != ibpl) {
+ tmp_bits = new uchar[bpl*h];
+ bits = (char *)tmp_bits;
+ uchar *p, *b;
+ int y;
+ b = tmp_bits;
+ p = img.scanLine(0);
+ for (y = 0; y < h; y++) {
+ memcpy(b, p, bpl);
+ b += bpl;
+ p += ibpl;
+ }
+ } else {
+ bits = (char *)img.bits();
+ tmp_bits = 0;
+ }
+ XID hd = XCreateBitmapFromData(QXcbX11Info::display(),
+ QXcbX11Info::appRootWindow(),
+ bits, w, h);
+ if (tmp_bits) // Avoid purify complaint
+ delete [] tmp_bits;
+ return hd;
+}
+
+#if QT_CONFIG(xrender)
+void QX11PlatformPixmap::convertToARGB32(bool preserveContents)
+{
+ if (!X11->use_xrender)
+ return;
+
+ // Q_ASSERT(count == 1);
+ if ((flags & Readonly)/* && share_mode == QPixmap::ExplicitlyShared*/)
+ return;
+
+ Pixmap pm = XCreatePixmap(xinfo.display(), RootWindow(xinfo.display(), xinfo.screen()),
+ w, h, 32);
+ Picture p = XRenderCreatePicture(xinfo.display(), pm,
+ XRenderFindStandardFormat(xinfo.display(), PictStandardARGB32), 0, 0);
+ if (picture) {
+ if (preserveContents)
+ XRenderComposite(xinfo.display(), PictOpSrc, picture, 0, p, 0, 0, 0, 0, 0, 0, w, h);
+ if (!(flags & Readonly))
+ XRenderFreePicture(xinfo.display(), picture);
+ }
+ if (hd && !(flags & Readonly))
+ XFreePixmap(xinfo.display(), hd);
+ if (x11_mask) {
+ XFreePixmap(xinfo.display(), x11_mask);
+ if (mask_picture)
+ XRenderFreePicture(xinfo.display(), mask_picture);
+ x11_mask = 0;
+ mask_picture = 0;
+ }
+ hd = pm;
+ picture = p;
+
+ d = 32;
+ xinfo.setDepth(32);
+
+ XVisualInfo visinfo;
+ if (XMatchVisualInfo(xinfo.display(), xinfo.screen(), 32, TrueColor, &visinfo))
+ xinfo.setVisual(visinfo.visual);
+}
+#endif
+
+void QX11PlatformPixmap::release()
+{
+ delete pengine;
+ pengine = 0;
+
+ if (/*!X11*/ QCoreApplication::closingDown()) {
+ // At this point, the X server will already have freed our resources,
+ // so there is nothing to do.
+ return;
+ }
+
+ if (x11_mask) {
+#if QT_CONFIG(xrender)
+ if (mask_picture)
+ XRenderFreePicture(xinfo.display(), mask_picture);
+ mask_picture = 0;
+#endif
+ XFreePixmap(xinfo.display(), x11_mask);
+ x11_mask = 0;
+ }
+
+ if (hd) {
+#if QT_CONFIG(xrender)
+ if (picture) {
+ XRenderFreePicture(xinfo.display(), picture);
+ picture = 0;
+ }
+#endif // QT_CONFIG(xrender)
+
+ if (hd2) {
+ XFreePixmap(xinfo.display(), hd2);
+ hd2 = 0;
+ }
+ if (!(flags & Readonly))
+ XFreePixmap(xinfo.display(), hd);
+ hd = 0;
+ }
+}
+
+QImage QX11PlatformPixmap::toImage(const QXImageWrapper &xiWrapper, const QRect &rect) const
+{
+ XImage *xi = xiWrapper.xi;
+
+ int d = depth();
+ Visual *visual = (Visual *)xinfo.visual();
+ bool trucol = (visual->c_class >= TrueColor) && d > 1;
+
+ QImage::Format format = QImage::Format_Mono;
+ if (d > 1 && d <= 8) {
+ d = 8;
+ format = QImage::Format_Indexed8;
+ }
+ // we could run into the situation where d == 8 AND trucol is true, which can
+ // cause problems when converting to and from images. in this case, always treat
+ // the depth as 32...
+ if (d > 8 || trucol) {
+ d = 32;
+ format = QImage::Format_RGB32;
+ }
+
+ if (d == 1 && xi->bitmap_bit_order == LSBFirst)
+ format = QImage::Format_MonoLSB;
+ if (x11_mask && format == QImage::Format_RGB32)
+ format = QImage::Format_ARGB32;
+
+ QImage image(xi->width, xi->height, format);
+ image.setDevicePixelRatio(devicePixelRatio());
+ if (image.isNull()) // could not create image
+ return image;
+
+ QImage alpha;
+ if (x11_mask) {
+ if (rect.contains(QRect(0, 0, w, h)))
+ alpha = mask().toImage();
+ else
+ alpha = mask().toImage().copy(rect);
+ }
+ bool ale = alpha.format() == QImage::Format_MonoLSB;
+
+ if (trucol) { // truecolor
+ const uint red_mask = (uint)visual->red_mask;
+ const uint green_mask = (uint)visual->green_mask;
+ const uint blue_mask = (uint)visual->blue_mask;
+ const int red_shift = highest_bit(red_mask) - 7;
+ const int green_shift = highest_bit(green_mask) - 7;
+ const int blue_shift = highest_bit(blue_mask) - 7;
+
+ const uint red_bits = n_bits(red_mask);
+ const uint green_bits = n_bits(green_mask);
+ const uint blue_bits = n_bits(blue_mask);
+
+ static uint red_table_bits = 0;
+ static uint green_table_bits = 0;
+ static uint blue_table_bits = 0;
+
+ if (red_bits < 8 && red_table_bits != red_bits) {
+ build_scale_table(&red_scale_table, red_bits);
+ red_table_bits = red_bits;
+ }
+ if (blue_bits < 8 && blue_table_bits != blue_bits) {
+ build_scale_table(&blue_scale_table, blue_bits);
+ blue_table_bits = blue_bits;
+ }
+ if (green_bits < 8 && green_table_bits != green_bits) {
+ build_scale_table(&green_scale_table, green_bits);
+ green_table_bits = green_bits;
+ }
+
+ int r, g, b;
+
+ QRgb *dst;
+ uchar *src;
+ uint pixel;
+ int bppc = xi->bits_per_pixel;
+
+ if (bppc > 8 && xi->byte_order == LSBFirst)
+ bppc++;
+
+ for (int y = 0; y < xi->height; ++y) {
+ uchar* asrc = x11_mask ? alpha.scanLine(y) : 0;
+ dst = (QRgb *)image.scanLine(y);
+ src = (uchar *)xi->data + xi->bytes_per_line*y;
+ for (int x = 0; x < xi->width; x++) {
+ switch (bppc) {
+ case 8:
+ pixel = *src++;
+ break;
+ case 16: // 16 bit MSB
+ pixel = src[1] | (uint)src[0] << 8;
+ src += 2;
+ break;
+ case 17: // 16 bit LSB
+ pixel = src[0] | (uint)src[1] << 8;
+ src += 2;
+ break;
+ case 24: // 24 bit MSB
+ pixel = src[2] | (uint)src[1] << 8 | (uint)src[0] << 16;
+ src += 3;
+ break;
+ case 25: // 24 bit LSB
+ pixel = src[0] | (uint)src[1] << 8 | (uint)src[2] << 16;
+ src += 3;
+ break;
+ case 32: // 32 bit MSB
+ pixel = src[3] | (uint)src[2] << 8 | (uint)src[1] << 16 | (uint)src[0] << 24;
+ src += 4;
+ break;
+ case 33: // 32 bit LSB
+ pixel = src[0] | (uint)src[1] << 8 | (uint)src[2] << 16 | (uint)src[3] << 24;
+ src += 4;
+ break;
+ default: // should not really happen
+ x = xi->width; // leave loop
+ y = xi->height;
+ pixel = 0; // eliminate compiler warning
+ qWarning("QPixmap::convertToImage: Invalid depth %d", bppc);
+ }
+ if (red_shift > 0)
+ r = (pixel & red_mask) >> red_shift;
+ else
+ r = (pixel & red_mask) << -red_shift;
+ if (green_shift > 0)
+ g = (pixel & green_mask) >> green_shift;
+ else
+ g = (pixel & green_mask) << -green_shift;
+ if (blue_shift > 0)
+ b = (pixel & blue_mask) >> blue_shift;
+ else
+ b = (pixel & blue_mask) << -blue_shift;
+
+ if (red_bits < 8)
+ r = red_scale_table[r];
+ if (green_bits < 8)
+ g = green_scale_table[g];
+ if (blue_bits < 8)
+ b = blue_scale_table[b];
+
+ if (x11_mask) {
+ if (ale) {
+ *dst++ = (asrc[x >> 3] & (1 << (x & 7))) ? qRgba(r, g, b, 0xff) : 0;
+ } else {
+ *dst++ = (asrc[x >> 3] & (0x80 >> (x & 7))) ? qRgba(r, g, b, 0xff) : 0;
+ }
+ } else {
+ *dst++ = qRgb(r, g, b);
+ }
+ }
+ }
+ } 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);
+ for (int y=0; y<xi->height; y++) {
+ memcpy(image.scanLine(y), xidata, bpl);
+ xidata += xi->bytes_per_line;
+ }
+ } else {
+ /* Typically 2 or 4 bits display depth */
+ qWarning("QPixmap::convertToImage: Display not supported (bpp=%d)",
+ xi->bits_per_pixel);
+ return QImage();
+ }
+
+ if (d == 1) { // bitmap
+ image.setColorCount(2);
+ image.setColor(0, qRgb(255,255,255));
+ image.setColor(1, qRgb(0,0,0));
+ } else if (!trucol) { // pixmap with colormap
+ uchar *p;
+ uchar *end;
+ uchar use[256]; // pixel-in-use table
+ uchar pix[256]; // pixel translation table
+ int ncols, bpl;
+ memset(use, 0, 256);
+ memset(pix, 0, 256);
+ bpl = image.bytesPerLine();
+
+ if (x11_mask) { // which pixels are used?
+ for (int i = 0; i < xi->height; i++) {
+ uchar* asrc = alpha.scanLine(i);
+ p = image.scanLine(i);
+ if (ale) {
+ for (int x = 0; x < xi->width; x++) {
+ if (asrc[x >> 3] & (1 << (x & 7)))
+ use[*p] = 1;
+ ++p;
+ }
+ } else {
+ for (int x = 0; x < xi->width; x++) {
+ if (asrc[x >> 3] & (0x80 >> (x & 7)))
+ use[*p] = 1;
+ ++p;
+ }
+ }
+ }
+ } else {
+ for (int i = 0; i < xi->height; i++) {
+ p = image.scanLine(i);
+ end = p + bpl;
+ while (p < end)
+ use[*p++] = 1;
+ }
+ }
+ ncols = 0;
+ for (int i = 0; i < 256; i++) { // build translation table
+ if (use[i])
+ pix[i] = ncols++;
+ }
+ for (int i = 0; i < xi->height; i++) { // translate pixels
+ p = image.scanLine(i);
+ end = p + bpl;
+ while (p < end) {
+ *p = pix[*p];
+ p++;
+ }
+ }
+ if (x11_mask) {
+ int trans;
+ if (ncols < 256) {
+ trans = ncols++;
+ image.setColorCount(ncols); // create color table
+ image.setColor(trans, 0x00000000);
+ } else {
+ image.setColorCount(ncols); // create color table
+ // oh dear... no spare "transparent" pixel.
+ // use first pixel in image (as good as any).
+ trans = image.scanLine(0)[0];
+ }
+ for (int i = 0; i < xi->height; i++) {
+ uchar* asrc = alpha.scanLine(i);
+ p = image.scanLine(i);
+ if (ale) {
+ for (int x = 0; x < xi->width; x++) {
+ if (!(asrc[x >> 3] & (1 << (x & 7))))
+ *p = trans;
+ ++p;
+ }
+ } else {
+ for (int x = 0; x < xi->width; x++) {
+ if (!(asrc[x >> 3] & (1 << (7 -(x & 7)))))
+ *p = trans;
+ ++p;
+ }
+ }
+ }
+ } else {
+ image.setColorCount(ncols); // create color table
+ }
+ QVector<QColor> colors = QXcbColormap::instance(xinfo.screen()).colormap();
+ int j = 0;
+ for (int i=0; i<colors.size(); i++) { // translate pixels
+ if (use[i])
+ image.setColor(j++, 0xff000000 | colors.at(i).rgb());
+ }
+ }
+
+ return image;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
new file mode 100644
index 0000000000..2cbd1fe3d0
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QX11PLATFORMPIXMAP_H
+#define QX11PLATFORMPIXMAP_H
+
+#include <QBitmap>
+#include <QPixmap>
+
+#include <qpa/qplatformpixmap.h>
+#include "qxcbnativepainting.h"
+
+typedef unsigned long XID;
+typedef XID Drawable;
+typedef XID Picture;
+typedef XID Pixmap;
+
+QT_BEGIN_NAMESPACE
+
+class QX11PaintEngine;
+struct QXImageWrapper;
+
+class QX11PlatformPixmap : public QPlatformPixmap
+{
+public:
+ QX11PlatformPixmap(PixelType pixelType);
+ ~QX11PlatformPixmap();
+
+ QPlatformPixmap *createCompatiblePlatformPixmap() const Q_DECL_OVERRIDE;
+ void resize(int width, int height) Q_DECL_OVERRIDE;
+ void fromImage(const QImage &img, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
+ void copy(const QPlatformPixmap *data, const QRect &rect) Q_DECL_OVERRIDE;
+ bool scroll(int dx, int dy, const QRect &rect) Q_DECL_OVERRIDE;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
+ void fill(const QColor &fillColor) Q_DECL_OVERRIDE;
+ QBitmap mask() const Q_DECL_OVERRIDE;
+ void setMask(const QBitmap &mask) Q_DECL_OVERRIDE;
+ bool hasAlphaChannel() const Q_DECL_OVERRIDE;
+ QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const Q_DECL_OVERRIDE;
+ QImage toImage() const Q_DECL_OVERRIDE;
+ QImage toImage(const QRect &rect) const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ qreal devicePixelRatio() const Q_DECL_OVERRIDE;
+ void setDevicePixelRatio(qreal scaleFactor) Q_DECL_OVERRIDE;
+
+ inline Drawable handle() const { return hd; }
+ inline Picture x11PictureHandle() const { return picture; }
+ inline const QXcbX11Info *x11_info() const { return &xinfo; }
+
+ Pixmap x11ConvertToDefaultDepth();
+ static XID createBitmapFromImage(const QImage &image);
+
+#if QT_CONFIG(xrender)
+ void convertToARGB32(bool preserveContents = true);
+#endif
+
+private:
+ friend class QX11PaintEngine;
+ friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap);
+ friend void qt_x11SetScreen(QPixmap &pixmap, int screen);
+
+ void release();
+ QImage toImage(const QXImageWrapper &xi, const QRect &rect) const;
+ QBitmap mask_to_bitmap(int screen) const;
+ static Pixmap bitmap_to_mask(const QBitmap &, int screen);
+ void bitmapFromImage(const QImage &image);
+ bool canTakeQImageFromXImage(const QXImageWrapper &xi) const;
+ QImage takeQImageFromXImage(const QXImageWrapper &xi) const;
+
+ Pixmap hd = 0;
+
+ enum Flag {
+ NoFlags = 0x0,
+ Uninitialized = 0x1,
+ Readonly = 0x2,
+ InvertedWhenBoundToTexture = 0x4,
+ GlSurfaceCreatedWithAlpha = 0x8
+ };
+ uint flags;
+
+ QXcbX11Info xinfo;
+ Pixmap x11_mask;
+ Picture picture;
+ Picture mask_picture;
+ Pixmap hd2; // sorted in the default display depth
+ //QPixmap::ShareMode share_mode;
+ qreal dpr;
+
+ QX11PaintEngine *pengine;
+};
+
+inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap)
+{
+ return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class)
+ ? static_cast<QX11PlatformPixmap *>(pixmap.handle())
+ : Q_NULLPTR;
+}
+
+inline Picture qt_x11PictureHandle(const QPixmap &pixmap)
+{
+ if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap))
+ return pm->x11PictureHandle();
+
+ return 0;
+}
+
+inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap)
+{
+ if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap))
+ return pm->handle();
+
+ return 0;
+}
+
+inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap)
+{
+ if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) {
+ return pm->xinfo;
+ } else {
+ static QXcbX11Info nullX11Info;
+ return nullX11Info;
+ }
+}
+
+int qt_x11SetDefaultScreen(int screen);
+void qt_x11SetScreen(QPixmap &pixmap, int screen);
+
+QT_END_NAMESPACE
+
+#endif // QX11PLATFORMPIXMAP_H
diff --git a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h
new file mode 100644
index 0000000000..a0e5131ea7
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_X11_P_H
+#define QT_X11_P_H
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#if QT_CONFIG(xrender)
+# include "qtessellator_p.h"
+# include <X11/extensions/Xrender.h>
+#endif
+
+#if QT_CONFIG(fontconfig)
+#include <fontconfig/fontconfig.h>
+#endif
+
+#if defined(FT_LCD_FILTER_H)
+#include FT_LCD_FILTER_H
+#endif
+
+#if defined(FC_LCD_FILTER)
+
+#ifndef FC_LCD_FILTER_NONE
+#define FC_LCD_FILTER_NONE FC_LCD_NONE
+#endif
+
+#ifndef FC_LCD_FILTER_DEFAULT
+#define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT
+#endif
+
+#ifndef FC_LCD_FILTER_LIGHT
+#define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT
+#endif
+
+#ifndef FC_LCD_FILTER_LEGACY
+#define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY
+#endif
+
+#endif
+
+QT_BEGIN_NAMESPACE
+
+// rename a couple of X defines to get rid of name clashes
+// resolve the conflict between X11's FocusIn and QEvent::FocusIn
+enum {
+ XFocusOut = FocusOut,
+ XFocusIn = FocusIn,
+ XKeyPress = KeyPress,
+ XKeyRelease = KeyRelease,
+ XNone = None,
+ XRevertToParent = RevertToParent,
+ XGrayScale = GrayScale,
+ XCursorShape = CursorShape,
+};
+#undef FocusOut
+#undef FocusIn
+#undef KeyPress
+#undef KeyRelease
+#undef None
+#undef RevertToParent
+#undef GrayScale
+#undef CursorShape
+
+#ifdef FontChange
+#undef FontChange
+#endif
+
+Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE);
+#if QT_CONFIG(xrender)
+Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE);
+#endif
+
+struct QX11InfoData;
+
+enum DesktopEnvironment {
+ DE_UNKNOWN,
+ DE_KDE,
+ DE_GNOME,
+ DE_CDE,
+ DE_MEEGO_COMPOSITOR,
+ DE_4DWM
+};
+
+struct QXcbX11Data {
+ Display *display = nullptr;
+
+ // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display
+ bool use_xrender = false;
+ int xrender_major = 0;
+ int xrender_version = 0;
+
+ QX11InfoData *screens = nullptr;
+ Visual **argbVisuals = nullptr;
+ Colormap *argbColormaps = nullptr;
+ int screenCount = 0;
+ int defaultScreen = 0;
+
+ // options
+ int visual_class = 0;
+ int visual_id = 0;
+ int color_count = 0;
+ bool custom_cmap = false;
+
+ // outside visual/colormap
+ Visual *visual = nullptr;
+ Colormap colormap = 0;
+
+#if QT_CONFIG(xrender)
+ enum { solid_fill_count = 16 };
+ struct SolidFills {
+ XRenderColor color;
+ int screen;
+ Picture picture;
+ } solid_fills[solid_fill_count];
+ enum { pattern_fill_count = 16 };
+ struct PatternFills {
+ XRenderColor color;
+ XRenderColor bg_color;
+ int screen;
+ int style;
+ bool opaque;
+ Picture picture;
+ } pattern_fills[pattern_fill_count];
+ Picture getSolidFill(int screen, const QColor &c);
+ XRenderColor preMultiply(const QColor &c);
+#endif
+
+ bool fc_antialias = true;
+ int fc_hint_style = 0;
+
+ DesktopEnvironment desktopEnvironment = DE_GNOME;
+};
+
+extern QXcbX11Data *qt_x11Data;
+#define X11 qt_x11Data
+
+struct QX11InfoData {
+ int screen;
+ int dpiX;
+ int dpiY;
+ int depth;
+ int cells;
+ Colormap colormap;
+ Visual *visual;
+ bool defaultColormap;
+ bool defaultVisual;
+ int subpixel = 0;
+};
+
+template <class T>
+Q_DECL_RELAXED_CONSTEXPR inline int lowest_bit(T v) Q_DECL_NOTHROW
+{
+ int result = qCountTrailingZeroBits(v);
+ return ((result >> 3) == sizeof(T)) ? -1 : result;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_X11_P_H
diff --git a/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp b/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp
new file mode 100644
index 0000000000..9acb21f95f
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qtessellator.cpp
@@ -0,0 +1,1494 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtessellator_p.h"
+
+#include <QRect>
+#include <QList>
+#include <QDebug>
+
+#include <qmath.h>
+#include <limits.h>
+#include <algorithm>
+
+QT_BEGIN_NAMESPACE
+
+//#define DEBUG
+#ifdef DEBUG
+#define QDEBUG qDebug
+#else
+#define QDEBUG if (1){} else qDebug
+#endif
+
+static const bool emit_clever = true;
+static const bool mark_clever = false;
+
+enum VertexFlags {
+ LineBeforeStarts = 0x1,
+ LineBeforeEnds = 0x2,
+ LineBeforeHorizontal = 0x4,
+ LineAfterStarts = 0x8,
+ LineAfterEnds = 0x10,
+ LineAfterHorizontal = 0x20
+};
+
+
+
+class QTessellatorPrivate {
+public:
+ struct Vertices;
+
+ QTessellatorPrivate() {}
+
+ QRectF collectAndSortVertices(const QPointF *points, int *maxActiveEdges);
+ void cancelCoincidingEdges();
+
+ void emitEdges(QTessellator *tessellator);
+ void processIntersections();
+ void removeEdges();
+ void addEdges();
+ void addIntersections();
+
+ struct Vertex : public QTessellator::Vertex
+ {
+ int flags;
+ };
+
+ struct Intersection
+ {
+ Q27Dot5 y;
+ int edge;
+ bool operator <(const Intersection &other) const {
+ if (y != other.y)
+ return y < other.y;
+ return edge < other.edge;
+ }
+ };
+ struct IntersectionLink
+ {
+ int next;
+ int prev;
+ };
+ typedef QMap<Intersection, IntersectionLink> Intersections;
+
+ struct Edge {
+ Edge(const Vertices &v, int _edge);
+ int edge;
+ const Vertex *v0;
+ const Vertex *v1;
+ Q27Dot5 y_left;
+ Q27Dot5 y_right;
+ signed int winding : 8;
+ bool mark;
+ bool free;
+ bool intersect_left;
+ bool intersect_right;
+ bool isLeftOf(const Edge &other, Q27Dot5 y) const;
+ Q27Dot5 positionAt(Q27Dot5 y) const;
+ bool intersect(const Edge &other, Q27Dot5 *y, bool *det_positive) const;
+
+ };
+
+ class EdgeSorter
+ {
+ public:
+ EdgeSorter(int _y) : y(_y) {}
+ bool operator() (const Edge *e1, const Edge *e2);
+ int y;
+ };
+
+ class Scanline {
+ public:
+ Scanline();
+ ~Scanline();
+
+ void init(int maxActiveEdges);
+ void done();
+
+ int findEdgePosition(Q27Dot5 x, Q27Dot5 y) const;
+ int findEdgePosition(const Edge &e) const;
+ int findEdge(int edge) const;
+ void clearMarks();
+
+ void swap(int p1, int p2) {
+ Edge *tmp = edges[p1];
+ edges[p1] = edges[p2];
+ edges[p2] = tmp;
+ }
+ void insert(int pos, const Edge &e);
+ void removeAt(int pos);
+ void markEdges(int pos1, int pos2);
+
+ void prepareLine();
+ void lineDone();
+
+ Edge **old;
+ int old_size;
+
+ Edge **edges;
+ int size;
+
+ private:
+ Edge *edge_table;
+ int first_unused;
+ int max_edges;
+ enum { default_alloc = 32 };
+ };
+
+ struct Vertices {
+ enum { default_alloc = 128 };
+ Vertices();
+ ~Vertices();
+ void init(int maxVertices);
+ void done();
+ Vertex *storage;
+ Vertex **sorted;
+
+ Vertex *operator[] (int i) { return storage + i; }
+ const Vertex *operator[] (int i) const { return storage + i; }
+ int position(const Vertex *v) const {
+ return v - storage;
+ }
+ Vertex *next(Vertex *v) {
+ ++v;
+ if (v == storage + nPoints)
+ v = storage;
+ return v;
+ }
+ const Vertex *next(const Vertex *v) const {
+ ++v;
+ if (v == storage + nPoints)
+ v = storage;
+ return v;
+ }
+ int nextPos(const Vertex *v) const {
+ ++v;
+ if (v == storage + nPoints)
+ return 0;
+ return v - storage;
+ }
+ Vertex *prev(Vertex *v) {
+ if (v == storage)
+ v = storage + nPoints;
+ --v;
+ return v;
+ }
+ const Vertex *prev(const Vertex *v) const {
+ if (v == storage)
+ v = storage + nPoints;
+ --v;
+ return v;
+ }
+ int prevPos(const Vertex *v) const {
+ if (v == storage)
+ v = storage + nPoints;
+ --v;
+ return v - storage;
+ }
+ int nPoints;
+ int allocated;
+ };
+ Vertices vertices;
+ Intersections intersections;
+ Scanline scanline;
+ bool winding;
+ Q27Dot5 y;
+ int currentVertex;
+
+private:
+ void addIntersection(const Edge *e1, const Edge *e2);
+ bool edgeInChain(Intersection i, int edge);
+};
+
+
+QTessellatorPrivate::Edge::Edge(const QTessellatorPrivate::Vertices &vertices, int edge)
+{
+ this->edge = edge;
+ intersect_left = intersect_right = true;
+ mark = false;
+ free = false;
+
+ v0 = vertices[edge];
+ v1 = vertices.next(v0);
+
+ Q_ASSERT(v0->y != v1->y);
+
+ if (v0->y > v1->y) {
+ qSwap(v0, v1);
+ winding = -1;
+ } else {
+ winding = 1;
+ }
+ y_left = y_right = v0->y;
+}
+
+// This is basically the algorithm from graphics gems. The algorithm
+// is cubic in the coordinates at one place. Since we use 64bit
+// integers, this implies, that the allowed range for our coordinates
+// is limited to 21 bits. With 5 bits behind the decimal, this
+// implies that differences in coordaintes can range from 2*SHORT_MIN
+// to 2*SHORT_MAX, giving us efficiently a coordinate system from
+// SHORT_MIN to SHORT_MAX.
+//
+
+// WARNING: It's absolutely critical that the intersect() and isLeftOf() methods use
+// exactly the same algorithm to calulate yi. It's also important to be sure the algorithms
+// are transitive (ie. the conditions below are true for all input data):
+//
+// a.intersect(b) == b.intersect(a)
+// a.isLeftOf(b) != b.isLeftOf(a)
+//
+// This is tricky to get right, so be very careful when changing anything in here!
+
+static inline bool sameSign(qint64 a, qint64 b) {
+ return (((qint64) ((quint64) a ^ (quint64) b)) >= 0 );
+}
+
+bool QTessellatorPrivate::Edge::intersect(const Edge &other, Q27Dot5 *y, bool *det_positive) const
+{
+ qint64 a1 = v1->y - v0->y;
+ qint64 b1 = v0->x - v1->x;
+
+ qint64 a2 = other.v1->y - other.v0->y;
+ qint64 b2 = other.v0->x - other.v1->x;
+
+ qint64 det = a1 * b2 - a2 * b1;
+ if (det == 0)
+ return false;
+
+ qint64 c1 = qint64(v1->x) * v0->y - qint64(v0->x) * v1->y;
+
+ qint64 r3 = a1 * other.v0->x + b1 * other.v0->y + c1;
+ qint64 r4 = a1 * other.v1->x + b1 * other.v1->y + c1;
+
+ // Check signs of r3 and r4. If both point 3 and point 4 lie on
+ // same side of line 1, the line segments do not intersect.
+ QDEBUG() << " " << r3 << r4;
+ if (r3 != 0 && r4 != 0 && sameSign( r3, r4 ))
+ return false;
+
+ qint64 c2 = qint64(other.v1->x) * other.v0->y - qint64(other.v0->x) * other.v1->y;
+
+ qint64 r1 = a2 * v0->x + b2 * v0->y + c2;
+ qint64 r2 = a2 * v1->x + b2 * v1->y + c2;
+
+ // Check signs of r1 and r2. If both point 1 and point 2 lie
+ // on same side of second line segment, the line segments do not intersect.
+ QDEBUG() << " " << r1 << r2;
+ if (r1 != 0 && r2 != 0 && sameSign( r1, r2 ))
+ return false;
+
+ // The det/2 is to get rounding instead of truncating. It
+ // is added or subtracted to the numerator, depending upon the
+ // sign of the numerator.
+ qint64 offset = det < 0 ? -det : det;
+ offset >>= 1;
+
+ qint64 num = a2 * c1 - a1 * c2;
+ *y = ( num < 0 ? num - offset : num + offset ) / det;
+
+ *det_positive = (det > 0);
+
+ return true;
+}
+
+#undef SAME_SIGNS
+
+bool QTessellatorPrivate::Edge::isLeftOf(const Edge &other, Q27Dot5 y) const
+{
+// QDEBUG() << "isLeftOf" << edge << other.edge << y;
+ qint64 a1 = v1->y - v0->y;
+ qint64 b1 = v0->x - v1->x;
+ qint64 a2 = other.v1->y - other.v0->y;
+ qint64 b2 = other.v0->x - other.v1->x;
+
+ qint64 c2 = qint64(other.v1->x) * other.v0->y - qint64(other.v0->x) * other.v1->y;
+
+ qint64 det = a1 * b2 - a2 * b1;
+ if (det == 0) {
+ // lines are parallel. Only need to check side of one point
+ // fixed ordering for coincident edges
+ qint64 r1 = a2 * v0->x + b2 * v0->y + c2;
+// QDEBUG() << "det = 0" << r1;
+ if (r1 == 0)
+ return edge < other.edge;
+ return (r1 < 0);
+ }
+
+ // not parallel, need to find the y coordinate of the intersection point
+ qint64 c1 = qint64(v1->x) * v0->y - qint64(v0->x) * v1->y;
+
+ qint64 offset = det < 0 ? -det : det;
+ offset >>= 1;
+
+ qint64 num = a2 * c1 - a1 * c2;
+ qint64 yi = ( num < 0 ? num - offset : num + offset ) / det;
+// QDEBUG() << " num=" << num << "offset=" << offset << "det=" << det;
+
+ return ((yi > y) ^ (det < 0));
+}
+
+static inline bool compareVertex(const QTessellatorPrivate::Vertex *p1,
+ const QTessellatorPrivate::Vertex *p2)
+{
+ if (p1->y == p2->y) {
+ if (p1->x == p2->x)
+ return p1 < p2;
+ return p1->x < p2->x;
+ }
+ return p1->y < p2->y;
+}
+
+Q27Dot5 QTessellatorPrivate::Edge::positionAt(Q27Dot5 y) const
+{
+ if (y == v0->y)
+ return v0->x;
+ else if (y == v1->y)
+ return v1->x;
+
+ qint64 d = v1->x - v0->x;
+ return (v0->x + d*(y - v0->y)/(v1->y-v0->y));
+}
+
+bool QTessellatorPrivate::EdgeSorter::operator() (const Edge *e1, const Edge *e2)
+{
+ return e1->isLeftOf(*e2, y);
+}
+
+
+QTessellatorPrivate::Scanline::Scanline()
+{
+ edges = 0;
+ edge_table = 0;
+ old = 0;
+}
+
+void QTessellatorPrivate::Scanline::init(int maxActiveEdges)
+{
+ maxActiveEdges *= 2;
+ if (!edges || maxActiveEdges > default_alloc) {
+ max_edges = maxActiveEdges;
+ int s = qMax(maxActiveEdges + 1, default_alloc + 1);
+ edges = q_check_ptr((Edge **)realloc(edges, s*sizeof(Edge *)));
+ edge_table = q_check_ptr((Edge *)realloc(edge_table, s*sizeof(Edge)));
+ old = q_check_ptr((Edge **)realloc(old, s*sizeof(Edge *)));
+ }
+ size = 0;
+ old_size = 0;
+ first_unused = 0;
+ for (int i = 0; i < maxActiveEdges; ++i)
+ edge_table[i].edge = i+1;
+ edge_table[maxActiveEdges].edge = -1;
+}
+
+void QTessellatorPrivate::Scanline::done()
+{
+ if (max_edges > default_alloc) {
+ free(edges);
+ free(old);
+ free(edge_table);
+ edges = 0;
+ old = 0;
+ edge_table = 0;
+ }
+}
+
+QTessellatorPrivate::Scanline::~Scanline()
+{
+ free(edges);
+ free(old);
+ free(edge_table);
+}
+
+int QTessellatorPrivate::Scanline::findEdgePosition(Q27Dot5 x, Q27Dot5 y) const
+{
+ int min = 0;
+ int max = size - 1;
+ while (min < max) {
+ int pos = min + ((max - min + 1) >> 1);
+ Q27Dot5 ax = edges[pos]->positionAt(y);
+ if (ax > x) {
+ max = pos - 1;
+ } else {
+ min = pos;
+ }
+ }
+ return min;
+}
+
+int QTessellatorPrivate::Scanline::findEdgePosition(const Edge &e) const
+{
+// qDebug() << ">> findEdgePosition";
+ int min = 0;
+ int max = size;
+ while (min < max) {
+ int pos = min + ((max - min) >> 1);
+// qDebug() << " " << min << max << pos << edges[pos]->isLeftOf(e, e.y0);
+ if (edges[pos]->isLeftOf(e, e.v0->y)) {
+ min = pos + 1;
+ } else {
+ max = pos;
+ }
+ }
+// qDebug() << "<< findEdgePosition got" << min;
+ return min;
+}
+
+int QTessellatorPrivate::Scanline::findEdge(int edge) const
+{
+ for (int i = 0; i < size; ++i) {
+ int item_edge = edges[i]->edge;
+ if (item_edge == edge)
+ return i;
+ }
+ //Q_ASSERT(false);
+ return -1;
+}
+
+void QTessellatorPrivate::Scanline::clearMarks()
+{
+ for (int i = 0; i < size; ++i) {
+ edges[i]->mark = false;
+ edges[i]->intersect_left = false;
+ edges[i]->intersect_right = false;
+ }
+}
+
+void QTessellatorPrivate::Scanline::prepareLine()
+{
+ Edge **end = edges + size;
+ Edge **e = edges;
+ Edge **o = old;
+ while (e < end) {
+ *o = *e;
+ ++o;
+ ++e;
+ }
+ old_size = size;
+}
+
+void QTessellatorPrivate::Scanline::lineDone()
+{
+ Edge **end = old + old_size;
+ Edge **e = old;
+ while (e < end) {
+ if ((*e)->free) {
+ (*e)->edge = first_unused;
+ first_unused = (*e - edge_table);
+ }
+ ++e;
+ }
+}
+
+void QTessellatorPrivate::Scanline::insert(int pos, const Edge &e)
+{
+ Edge *edge = edge_table + first_unused;
+ first_unused = edge->edge;
+ Q_ASSERT(first_unused != -1);
+ *edge = e;
+ memmove(edges + pos + 1, edges + pos, (size - pos)*sizeof(Edge *));
+ edges[pos] = edge;
+ ++size;
+}
+
+void QTessellatorPrivate::Scanline::removeAt(int pos)
+{
+ Edge *e = edges[pos];
+ e->free = true;
+ --size;
+ memmove(edges + pos, edges + pos + 1, (size - pos)*sizeof(Edge *));
+}
+
+void QTessellatorPrivate::Scanline::markEdges(int pos1, int pos2)
+{
+ if (pos2 < pos1)
+ return;
+
+ for (int i = pos1; i <= pos2; ++i)
+ edges[i]->mark = true;
+}
+
+
+QTessellatorPrivate::Vertices::Vertices()
+{
+ storage = 0;
+ sorted = 0;
+ allocated = 0;
+ nPoints = 0;
+}
+
+QTessellatorPrivate::Vertices::~Vertices()
+{
+ if (storage) {
+ free(storage);
+ free(sorted);
+ }
+}
+
+void QTessellatorPrivate::Vertices::init(int maxVertices)
+{
+ if (!storage || maxVertices > allocated) {
+ int size = qMax((int)default_alloc, maxVertices);
+ storage = q_check_ptr((Vertex *)realloc(storage, size*sizeof(Vertex)));
+ sorted = q_check_ptr((Vertex **)realloc(sorted, size*sizeof(Vertex *)));
+ allocated = maxVertices;
+ }
+}
+
+void QTessellatorPrivate::Vertices::done()
+{
+ if (allocated > default_alloc) {
+ free(storage);
+ free(sorted);
+ storage = 0;
+ sorted = 0;
+ allocated = 0;
+ }
+}
+
+
+
+static inline void fillTrapezoid(Q27Dot5 y1, Q27Dot5 y2, int left, int right,
+ const QTessellatorPrivate::Vertices &vertices,
+ QTessellator::Trapezoid *trap)
+{
+ trap->top = y1;
+ trap->bottom = y2;
+ const QTessellatorPrivate::Vertex *v = vertices[left];
+ trap->topLeft = v;
+ trap->bottomLeft = vertices.next(v);
+ if (trap->topLeft->y > trap->bottomLeft->y)
+ qSwap(trap->topLeft,trap->bottomLeft);
+ v = vertices[right];
+ trap->topRight = v;
+ trap->bottomRight = vertices.next(v);
+ if (trap->topRight->y > trap->bottomRight->y)
+ qSwap(trap->topRight, trap->bottomRight);
+}
+
+QRectF QTessellatorPrivate::collectAndSortVertices(const QPointF *points, int *maxActiveEdges)
+{
+ *maxActiveEdges = 0;
+ Vertex *v = vertices.storage;
+ Vertex **vv = vertices.sorted;
+
+ qreal xmin(points[0].x());
+ qreal xmax(points[0].x());
+ qreal ymin(points[0].y());
+ qreal ymax(points[0].y());
+
+ // collect vertex data
+ Q27Dot5 y_prev = FloatToQ27Dot5(points[vertices.nPoints-1].y());
+ Q27Dot5 x_next = FloatToQ27Dot5(points[0].x());
+ Q27Dot5 y_next = FloatToQ27Dot5(points[0].y());
+ int j = 0;
+ int i = 0;
+ while (i < vertices.nPoints) {
+ Q27Dot5 y_curr = y_next;
+
+ *vv = v;
+
+ v->x = x_next;
+ v->y = y_next;
+ v->flags = 0;
+
+ next_point:
+
+ xmin = qMin(xmin, points[i+1].x());
+ xmax = qMax(xmax, points[i+1].x());
+ ymin = qMin(ymin, points[i+1].y());
+ ymax = qMax(ymax, points[i+1].y());
+
+ y_next = FloatToQ27Dot5(points[i+1].y());
+ x_next = FloatToQ27Dot5(points[i+1].x());
+
+ // skip vertices on top of each other
+ if (v->x == x_next && v->y == y_next) {
+ ++i;
+ if (i < vertices.nPoints)
+ goto next_point;
+ Vertex *v0 = vertices.storage;
+ v0->flags &= ~(LineBeforeStarts|LineBeforeEnds|LineBeforeHorizontal);
+ if (y_prev < y_curr)
+ v0->flags |= LineBeforeEnds;
+ else if (y_prev > y_curr)
+ v0->flags |= LineBeforeStarts;
+ else
+ v0->flags |= LineBeforeHorizontal;
+ if ((v0->flags & (LineBeforeStarts|LineAfterStarts))
+ && !(v0->flags & (LineAfterEnds|LineBeforeEnds)))
+ *maxActiveEdges += 2;
+ break;
+ }
+
+ if (y_prev < y_curr)
+ v->flags |= LineBeforeEnds;
+ else if (y_prev > y_curr)
+ v->flags |= LineBeforeStarts;
+ else
+ v->flags |= LineBeforeHorizontal;
+
+
+ if (y_curr < y_next)
+ v->flags |= LineAfterStarts;
+ else if (y_curr > y_next)
+ v->flags |= LineAfterEnds;
+ else
+ v->flags |= LineAfterHorizontal;
+ // ### could probably get better limit by looping over sorted list and counting down on ending edges
+ if ((v->flags & (LineBeforeStarts|LineAfterStarts))
+ && !(v->flags & (LineAfterEnds|LineBeforeEnds)))
+ *maxActiveEdges += 2;
+ y_prev = y_curr;
+ ++v;
+ ++vv;
+ ++j;
+ ++i;
+ }
+ vertices.nPoints = j;
+
+ QDEBUG() << "maxActiveEdges=" << *maxActiveEdges;
+ vv = vertices.sorted;
+ std::sort(vv, vv + vertices.nPoints, compareVertex);
+
+ return QRectF(xmin, ymin, xmax-xmin, ymax-ymin);
+}
+
+struct QCoincidingEdge {
+ QTessellatorPrivate::Vertex *start;
+ QTessellatorPrivate::Vertex *end;
+ bool used;
+ bool before;
+
+ inline bool operator<(const QCoincidingEdge &e2) const
+ {
+ return end->y == e2.end->y ? end->x < e2.end->x : end->y < e2.end->y;
+ }
+};
+
+static void cancelEdges(QCoincidingEdge &e1, QCoincidingEdge &e2)
+{
+ if (e1.before) {
+ e1.start->flags &= ~(LineBeforeStarts|LineBeforeHorizontal);
+ e1.end->flags &= ~(LineAfterEnds|LineAfterHorizontal);
+ } else {
+ e1.start->flags &= ~(LineAfterStarts|LineAfterHorizontal);
+ e1.end->flags &= ~(LineBeforeEnds|LineBeforeHorizontal);
+ }
+ if (e2.before) {
+ e2.start->flags &= ~(LineBeforeStarts|LineBeforeHorizontal);
+ e2.end->flags &= ~(LineAfterEnds|LineAfterHorizontal);
+ } else {
+ e2.start->flags &= ~(LineAfterStarts|LineAfterHorizontal);
+ e2.end->flags &= ~(LineBeforeEnds|LineBeforeHorizontal);
+ }
+ e1.used = e2.used = true;
+}
+
+void QTessellatorPrivate::cancelCoincidingEdges()
+{
+ Vertex **vv = vertices.sorted;
+
+ QCoincidingEdge *tl = 0;
+ int tlSize = 0;
+
+ for (int i = 0; i < vertices.nPoints - 1; ++i) {
+ Vertex *v = vv[i];
+ int testListSize = 0;
+ while (i < vertices.nPoints - 1) {
+ Vertex *n = vv[i];
+ if (v->x != n->x || v->y != n->y)
+ break;
+
+ if (testListSize > tlSize - 2) {
+ tlSize = qMax(tlSize*2, 16);
+ tl = q_check_ptr((QCoincidingEdge *)realloc(tl, tlSize*sizeof(QCoincidingEdge)));
+ }
+ if (n->flags & (LineBeforeStarts|LineBeforeHorizontal)) {
+ tl[testListSize].start = n;
+ tl[testListSize].end = vertices.prev(n);
+ tl[testListSize].used = false;
+ tl[testListSize].before = true;
+ ++testListSize;
+ }
+ if (n->flags & (LineAfterStarts|LineAfterHorizontal)) {
+ tl[testListSize].start = n;
+ tl[testListSize].end = vertices.next(n);
+ tl[testListSize].used = false;
+ tl[testListSize].before = false;
+ ++testListSize;
+ }
+ ++i;
+ }
+ if (!testListSize)
+ continue;
+
+ std::sort(tl, tl + testListSize);
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_CLANG("-Wfor-loop-analysis")
+ for (int j = 0; j < testListSize; ++j) {
+ if (tl[j].used)
+ continue;
+
+ for (int k = j + 1; k < testListSize; ++k) {
+ if (tl[j].end->x != tl[k].end->x
+ || tl[j].end->y != tl[k].end->y
+ || tl[k].used)
+ break;
+
+ if (!winding || tl[j].before != tl[k].before) {
+ cancelEdges(tl[j], tl[k]);
+ break;
+ }
+ ++k;
+ }
+ ++j;
+ }
+QT_WARNING_POP
+ }
+ free(tl);
+}
+
+
+void QTessellatorPrivate::emitEdges(QTessellator *tessellator)
+{
+ //QDEBUG() << "TRAPS:";
+ if (!scanline.old_size)
+ return;
+
+ // emit edges
+ if (winding) {
+ // winding fill rule
+ int w = 0;
+
+ scanline.old[0]->y_left = y;
+
+ for (int i = 0; i < scanline.old_size - 1; ++i) {
+ Edge *left = scanline.old[i];
+ Edge *right = scanline.old[i+1];
+ w += left->winding;
+// qDebug() << "i=" << i << "edge->winding=" << left->winding << "winding=" << winding;
+ if (w == 0) {
+ left->y_right = y;
+ right->y_left = y;
+ } else if (!emit_clever || left->mark || right->mark) {
+ Q27Dot5 top = qMax(left->y_right, right->y_left);
+ if (top != y) {
+ QTessellator::Trapezoid trap;
+ fillTrapezoid(top, y, left->edge, right->edge, vertices, &trap);
+ tessellator->addTrap(trap);
+// QDEBUG() << " top=" << Q27Dot5ToDouble(top) << "left=" << left->edge << "right=" << right->edge;
+ }
+ right->y_left = y;
+ left->y_right = y;
+ }
+ left->mark = false;
+ }
+ if (scanline.old[scanline.old_size - 1]->mark) {
+ scanline.old[scanline.old_size - 1]->y_right = y;
+ scanline.old[scanline.old_size - 1]->mark = false;
+ }
+ } else {
+ // odd-even fill rule
+ for (int i = 0; i < scanline.old_size; i += 2) {
+ Edge *left = scanline.old[i];
+ Edge *right = scanline.old[i+1];
+ if (!emit_clever || left->mark || right->mark) {
+ Q27Dot5 top = qMax(left->y_right, right->y_left);
+ if (top != y) {
+ QTessellator::Trapezoid trap;
+ fillTrapezoid(top, y, left->edge, right->edge, vertices, &trap);
+ tessellator->addTrap(trap);
+ }
+// QDEBUG() << " top=" << Q27Dot5ToDouble(top) << "left=" << left->edge << "right=" << right->edge;
+ left->y_left = y;
+ left->y_right = y;
+ right->y_left = y;
+ right->y_right = y;
+ left->mark = right->mark = false;
+ }
+ }
+ }
+}
+
+
+void QTessellatorPrivate::processIntersections()
+{
+ QDEBUG() << "PROCESS INTERSECTIONS";
+ // process intersections
+ while (!intersections.isEmpty()) {
+ Intersections::iterator it = intersections.begin();
+ if (it.key().y != y)
+ break;
+
+ // swap edges
+ QDEBUG() << " swapping intersecting edges ";
+ int min = scanline.size;
+ int max = 0;
+ Q27Dot5 xmin = INT_MAX;
+ Q27Dot5 xmax = INT_MIN;
+ int num = 0;
+ while (1) {
+ const Intersection i = it.key();
+ int next = it->next;
+
+ int edgePos = scanline.findEdge(i.edge);
+ if (edgePos >= 0) {
+ ++num;
+ min = qMin(edgePos, min);
+ max = qMax(edgePos, max);
+ Edge *edge = scanline.edges[edgePos];
+ xmin = qMin(xmin, edge->positionAt(y));
+ xmax = qMax(xmax, edge->positionAt(y));
+ }
+ Intersection key;
+ key.y = y;
+ key.edge = next;
+ it = intersections.find(key);
+ intersections.remove(i);
+ if (it == intersections.end())
+ break;
+ }
+ if (num < 2)
+ continue;
+
+ Q_ASSERT(min != max);
+ QDEBUG() << "sorting between" << min << "and" << max << "xpos=" << xmin << xmax;
+ while (min > 0 && scanline.edges[min - 1]->positionAt(y) >= xmin) {
+ QDEBUG() << " adding edge on left";
+ --min;
+ }
+ while (max < scanline.size - 1 && scanline.edges[max + 1]->positionAt(y) <= xmax) {
+ QDEBUG() << " adding edge on right";
+ ++max;
+ }
+
+ std::sort(scanline.edges + min, scanline.edges + max + 1, EdgeSorter(y));
+#ifdef DEBUG
+ for (int i = min; i <= max; ++i)
+ QDEBUG() << " " << scanline.edges[i]->edge << "at pos" << i;
+#endif
+ for (int i = min; i <= max; ++i) {
+ Edge *edge = scanline.edges[i];
+ edge->intersect_left = true;
+ edge->intersect_right = true;
+ edge->mark = true;
+ }
+ }
+}
+
+void QTessellatorPrivate::removeEdges()
+{
+ int cv = currentVertex;
+ while (cv < vertices.nPoints) {
+ const Vertex *v = vertices.sorted[cv];
+ if (v->y > y)
+ break;
+ if (v->flags & LineBeforeEnds) {
+ QDEBUG() << " removing edge" << vertices.prevPos(v);
+ int pos = scanline.findEdge(vertices.prevPos(v));
+ if (pos == -1)
+ continue;
+ scanline.edges[pos]->mark = true;
+ if (pos > 0)
+ scanline.edges[pos - 1]->intersect_right = true;
+ if (pos < scanline.size - 1)
+ scanline.edges[pos + 1]->intersect_left = true;
+ scanline.removeAt(pos);
+ }
+ if (v->flags & LineAfterEnds) {
+ QDEBUG() << " removing edge" << vertices.position(v);
+ int pos = scanline.findEdge(vertices.position(v));
+ if (pos == -1)
+ continue;
+ scanline.edges[pos]->mark = true;
+ if (pos > 0)
+ scanline.edges[pos - 1]->intersect_right = true;
+ if (pos < scanline.size - 1)
+ scanline.edges[pos + 1]->intersect_left = true;
+ scanline.removeAt(pos);
+ }
+ ++cv;
+ }
+}
+
+void QTessellatorPrivate::addEdges()
+{
+ while (currentVertex < vertices.nPoints) {
+ const Vertex *v = vertices.sorted[currentVertex];
+ if (v->y > y)
+ break;
+ if (v->flags & LineBeforeStarts) {
+ // add new edge
+ int start = vertices.prevPos(v);
+ Edge e(vertices, start);
+ int pos = scanline.findEdgePosition(e);
+ QDEBUG() << " adding edge" << start << "at position" << pos;
+ scanline.insert(pos, e);
+ if (!mark_clever || !(v->flags & LineAfterEnds)) {
+ if (pos > 0)
+ scanline.edges[pos - 1]->mark = true;
+ if (pos < scanline.size - 1)
+ scanline.edges[pos + 1]->mark = true;
+ }
+ }
+ if (v->flags & LineAfterStarts) {
+ Edge e(vertices, vertices.position(v));
+ int pos = scanline.findEdgePosition(e);
+ QDEBUG() << " adding edge" << vertices.position(v) << "at position" << pos;
+ scanline.insert(pos, e);
+ if (!mark_clever || !(v->flags & LineBeforeEnds)) {
+ if (pos > 0)
+ scanline.edges[pos - 1]->mark = true;
+ if (pos < scanline.size - 1)
+ scanline.edges[pos + 1]->mark = true;
+ }
+ }
+ if (v->flags & LineAfterHorizontal) {
+ int pos1 = scanline.findEdgePosition(v->x, v->y);
+ const Vertex *next = vertices.next(v);
+ Q_ASSERT(v->y == next->y);
+ int pos2 = scanline.findEdgePosition(next->x, next->y);
+ if (pos2 < pos1)
+ qSwap(pos1, pos2);
+ if (pos1 > 0)
+ --pos1;
+ if (pos2 == scanline.size)
+ --pos2;
+ //QDEBUG() << "marking horizontal edge from " << pos1 << "to" << pos2;
+ scanline.markEdges(pos1, pos2);
+ }
+ ++currentVertex;
+ }
+}
+
+#ifdef DEBUG
+static void checkLinkChain(const QTessellatorPrivate::Intersections &intersections,
+ QTessellatorPrivate::Intersection i)
+{
+// qDebug() << " Link chain: ";
+ int end = i.edge;
+ while (1) {
+ QTessellatorPrivate::IntersectionLink l = intersections.value(i);
+// qDebug() << " " << i.edge << "next=" << l.next << "prev=" << l.prev;
+ if (l.next == end)
+ break;
+ Q_ASSERT(l.next != -1);
+ Q_ASSERT(l.prev != -1);
+
+ QTessellatorPrivate::Intersection i2 = i;
+ i2.edge = l.next;
+ QTessellatorPrivate::IntersectionLink l2 = intersections.value(i2);
+
+ Q_ASSERT(l2.next != -1);
+ Q_ASSERT(l2.prev != -1);
+ Q_ASSERT(l.next == i2.edge);
+ Q_ASSERT(l2.prev == i.edge);
+ i = i2;
+ }
+}
+#endif
+
+bool QTessellatorPrivate::edgeInChain(Intersection i, int edge)
+{
+ int end = i.edge;
+ while (1) {
+ if (i.edge == edge)
+ return true;
+ IntersectionLink l = intersections.value(i);
+ if (l.next == end)
+ break;
+ Q_ASSERT(l.next != -1);
+ Q_ASSERT(l.prev != -1);
+
+ Intersection i2 = i;
+ i2.edge = l.next;
+
+#ifndef QT_NO_DEBUG
+ IntersectionLink l2 = intersections.value(i2);
+ Q_ASSERT(l2.next != -1);
+ Q_ASSERT(l2.prev != -1);
+ Q_ASSERT(l.next == i2.edge);
+ Q_ASSERT(l2.prev == i.edge);
+#endif
+ i = i2;
+ }
+ return false;
+}
+
+
+void QTessellatorPrivate::addIntersection(const Edge *e1, const Edge *e2)
+{
+ const IntersectionLink emptyLink = {-1, -1};
+
+ int next = vertices.nextPos(vertices[e1->edge]);
+ if (e2->edge == next)
+ return;
+ int prev = vertices.prevPos(vertices[e1->edge]);
+ if (e2->edge == prev)
+ return;
+
+ Q27Dot5 yi;
+ bool det_positive;
+ bool isect = e1->intersect(*e2, &yi, &det_positive);
+ QDEBUG("checking edges %d and %d", e1->edge, e2->edge);
+ if (!isect) {
+ QDEBUG() << " no intersection";
+ return;
+ }
+
+ // don't emit an intersection if it's at the start of a line segment or above us
+ if (yi <= y) {
+ if (!det_positive)
+ return;
+ QDEBUG() << " ----->>>>>> WRONG ORDER!";
+ yi = y;
+ }
+ QDEBUG() << " between edges " << e1->edge << "and" << e2->edge << "at point ("
+ << Q27Dot5ToDouble(yi) << ')';
+
+ Intersection i1;
+ i1.y = yi;
+ i1.edge = e1->edge;
+ IntersectionLink link1 = intersections.value(i1, emptyLink);
+ Intersection i2;
+ i2.y = yi;
+ i2.edge = e2->edge;
+ IntersectionLink link2 = intersections.value(i2, emptyLink);
+
+ // new pair of edges
+ if (link1.next == -1 && link2.next == -1) {
+ link1.next = link1.prev = i2.edge;
+ link2.next = link2.prev = i1.edge;
+ } else if (link1.next == i2.edge || link1.prev == i2.edge
+ || link2.next == i1.edge || link2.prev == i1.edge) {
+#ifdef DEBUG
+ checkLinkChain(intersections, i1);
+ checkLinkChain(intersections, i2);
+ Q_ASSERT(edgeInChain(i1, i2.edge));
+#endif
+ return;
+ } else if (link1.next == -1 || link2.next == -1) {
+ if (link2.next == -1) {
+ qSwap(i1, i2);
+ qSwap(link1, link2);
+ }
+ Q_ASSERT(link1.next == -1);
+#ifdef DEBUG
+ checkLinkChain(intersections, i2);
+#endif
+ // only i2 in list
+ link1.next = i2.edge;
+ link1.prev = link2.prev;
+ link2.prev = i1.edge;
+ Intersection other;
+ other.y = yi;
+ other.edge = link1.prev;
+ IntersectionLink link = intersections.value(other, emptyLink);
+ Q_ASSERT(link.next == i2.edge);
+ Q_ASSERT(link.prev != -1);
+ link.next = i1.edge;
+ intersections.insert(other, link);
+ } else {
+ bool connected = edgeInChain(i1, i2.edge);
+ if (connected)
+ return;
+#ifdef DEBUG
+ checkLinkChain(intersections, i1);
+ checkLinkChain(intersections, i2);
+#endif
+ // both already in some list. Have to make sure they are connected
+ // this can be done by cutting open the ring(s) after the two eges and
+ // connecting them again
+ Intersection other1;
+ other1.y = yi;
+ other1.edge = link1.next;
+ IntersectionLink linko1 = intersections.value(other1, emptyLink);
+ Intersection other2;
+ other2.y = yi;
+ other2.edge = link2.next;
+ IntersectionLink linko2 = intersections.value(other2, emptyLink);
+
+ linko1.prev = i2.edge;
+ link2.next = other1.edge;
+
+ linko2.prev = i1.edge;
+ link1.next = other2.edge;
+ intersections.insert(other1, linko1);
+ intersections.insert(other2, linko2);
+ }
+ intersections.insert(i1, link1);
+ intersections.insert(i2, link2);
+#ifdef DEBUG
+ checkLinkChain(intersections, i1);
+ checkLinkChain(intersections, i2);
+ Q_ASSERT(edgeInChain(i1, i2.edge));
+#endif
+ return;
+
+}
+
+
+void QTessellatorPrivate::addIntersections()
+{
+ if (scanline.size) {
+ QDEBUG() << "INTERSECTIONS";
+ // check marked edges for intersections
+#ifdef DEBUG
+ for (int i = 0; i < scanline.size; ++i) {
+ Edge *e = scanline.edges[i];
+ QDEBUG() << " " << i << e->edge << "isect=(" << e->intersect_left << e->intersect_right
+ << ')';
+ }
+#endif
+
+ for (int i = 0; i < scanline.size - 1; ++i) {
+ Edge *e1 = scanline.edges[i];
+ Edge *e2 = scanline.edges[i + 1];
+ // check for intersection
+ if (e1->intersect_right || e2->intersect_left)
+ addIntersection(e1, e2);
+ }
+ }
+#if 0
+ if (intersections.constBegin().key().y == y) {
+ QDEBUG() << "----------------> intersection on same line";
+ scanline.clearMarks();
+ scanline.processIntersections(y, &intersections);
+ goto redo;
+ }
+#endif
+}
+
+
+QTessellator::QTessellator()
+{
+ d = new QTessellatorPrivate;
+}
+
+QTessellator::~QTessellator()
+{
+ delete d;
+}
+
+void QTessellator::setWinding(bool w)
+{
+ d->winding = w;
+}
+
+
+QRectF QTessellator::tessellate(const QPointF *points, int nPoints)
+{
+ Q_ASSERT(points[0] == points[nPoints-1]);
+ --nPoints;
+
+#ifdef DEBUG
+ QDEBUG()<< "POINTS:";
+ for (int i = 0; i < nPoints; ++i) {
+ QDEBUG() << points[i];
+ }
+#endif
+
+ // collect edges and calculate bounds
+ d->vertices.nPoints = nPoints;
+ d->vertices.init(nPoints);
+
+ int maxActiveEdges = 0;
+ QRectF br = d->collectAndSortVertices(points, &maxActiveEdges);
+ d->cancelCoincidingEdges();
+
+#ifdef DEBUG
+ QDEBUG() << "nPoints = " << nPoints << "using " << d->vertices.nPoints;
+ QDEBUG()<< "VERTICES:";
+ for (int i = 0; i < d->vertices.nPoints; ++i) {
+ QDEBUG() << " " << i << ": "
+ << "point=" << d->vertices.position(d->vertices.sorted[i])
+ << "flags=" << d->vertices.sorted[i]->flags
+ << "pos=(" << Q27Dot5ToDouble(d->vertices.sorted[i]->x) << '/'
+ << Q27Dot5ToDouble(d->vertices.sorted[i]->y) << ')';
+ }
+#endif
+
+ d->scanline.init(maxActiveEdges);
+ d->y = INT_MIN/256;
+ d->currentVertex = 0;
+
+ while (d->currentVertex < d->vertices.nPoints) {
+ d->scanline.clearMarks();
+
+ d->y = d->vertices.sorted[d->currentVertex]->y;
+ if (!d->intersections.isEmpty())
+ d->y = qMin(d->y, d->intersections.constBegin().key().y);
+
+ QDEBUG()<< "===== SCANLINE: y =" << Q27Dot5ToDouble(d->y) << " =====";
+
+ d->scanline.prepareLine();
+ d->processIntersections();
+ d->removeEdges();
+ d->addEdges();
+ d->addIntersections();
+ d->emitEdges(this);
+ d->scanline.lineDone();
+
+#ifdef DEBUG
+ QDEBUG()<< "===== edges:";
+ for (int i = 0; i < d->scanline.size; ++i) {
+ QDEBUG() << " " << d->scanline.edges[i]->edge
+ << "p0= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v0->x)
+ << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v0->y)
+ << ") p1= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v1->x)
+ << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ')'
+ << "x=" << Q27Dot5ToDouble(d->scanline.edges[i]->positionAt(d->y))
+ << "isLeftOfNext="
+ << ((i < d->scanline.size - 1)
+ ? d->scanline.edges[i]->isLeftOf(*d->scanline.edges[i+1], d->y)
+ : true);
+ }
+#endif
+}
+
+ d->scanline.done();
+ d->intersections.clear();
+ return br;
+}
+
+// tessellates the given convex polygon
+void QTessellator::tessellateConvex(const QPointF *points, int nPoints)
+{
+ Q_ASSERT(points[0] == points[nPoints-1]);
+ --nPoints;
+
+ d->vertices.nPoints = nPoints;
+ d->vertices.init(nPoints);
+
+ for (int i = 0; i < nPoints; ++i) {
+ d->vertices[i]->x = FloatToQ27Dot5(points[i].x());
+ d->vertices[i]->y = FloatToQ27Dot5(points[i].y());
+ }
+
+ int left = 0, right = 0;
+
+ int top = 0;
+ for (int i = 1; i < nPoints; ++i) {
+ if (d->vertices[i]->y < d->vertices[top]->y)
+ top = i;
+ }
+
+ left = (top + nPoints - 1) % nPoints;
+ right = (top + 1) % nPoints;
+
+ while (d->vertices[left]->x == d->vertices[top]->x && d->vertices[left]->y == d->vertices[top]->y && left != right)
+ left = (left + nPoints - 1) % nPoints;
+
+ while (d->vertices[right]->x == d->vertices[top]->x && d->vertices[right]->y == d->vertices[top]->y && left != right)
+ right = (right + 1) % nPoints;
+
+ if (left == right)
+ return;
+
+ int dir = 1;
+
+ Vertex dLeft = { d->vertices[top]->x - d->vertices[left]->x,
+ d->vertices[top]->y - d->vertices[left]->y };
+
+ Vertex dRight = { d->vertices[right]->x - d->vertices[top]->x,
+ d->vertices[right]->y - d->vertices[top]->y };
+
+ Q27Dot5 cross = dLeft.x * dRight.y - dLeft.y * dRight.x;
+
+ // flip direction if polygon is clockwise
+ if (cross < 0 || (cross == 0 && dLeft.x > 0)) {
+ qSwap(left, right);
+ dir = -1;
+ }
+
+ Vertex *lastLeft = d->vertices[top];
+ Vertex *lastRight = d->vertices[top];
+
+ QTessellator::Trapezoid trap;
+
+ while (lastLeft->y == d->vertices[left]->y && left != right) {
+ lastLeft = d->vertices[left];
+ left = (left + nPoints - dir) % nPoints;
+ }
+
+ while (lastRight->y == d->vertices[right]->y && left != right) {
+ lastRight = d->vertices[right];
+ right = (right + nPoints + dir) % nPoints;
+ }
+
+ while (true) {
+ trap.top = qMax(lastRight->y, lastLeft->y);
+ trap.bottom = qMin(d->vertices[left]->y, d->vertices[right]->y);
+ trap.topLeft = lastLeft;
+ trap.topRight = lastRight;
+ trap.bottomLeft = d->vertices[left];
+ trap.bottomRight = d->vertices[right];
+
+ if (trap.bottom > trap.top)
+ addTrap(trap);
+
+ if (left == right)
+ break;
+
+ if (d->vertices[right]->y < d->vertices[left]->y) {
+ do {
+ lastRight = d->vertices[right];
+ right = (right + nPoints + dir) % nPoints;
+ }
+ while (lastRight->y == d->vertices[right]->y && left != right);
+ } else {
+ do {
+ lastLeft = d->vertices[left];
+ left = (left + nPoints - dir) % nPoints;
+ }
+ while (lastLeft->y == d->vertices[left]->y && left != right);
+ }
+ }
+}
+
+// tessellates the stroke of the line from a_ to b_ with the given width and a flat cap
+void QTessellator::tessellateRect(const QPointF &a_, const QPointF &b_, qreal width)
+{
+ Vertex a = { FloatToQ27Dot5(a_.x()), FloatToQ27Dot5(a_.y()) };
+ Vertex b = { FloatToQ27Dot5(b_.x()), FloatToQ27Dot5(b_.y()) };
+
+ QPointF pa = a_, pb = b_;
+
+ if (a.y > b.y) {
+ qSwap(a, b);
+ qSwap(pa, pb);
+ }
+
+ Vertex delta = { b.x - a.x, b.y - a.y };
+
+ if (delta.x == 0 && delta.y == 0)
+ return;
+
+ qreal hw = 0.5 * width;
+
+ if (delta.x == 0) {
+ Q27Dot5 halfWidth = FloatToQ27Dot5(hw);
+
+ if (halfWidth == 0)
+ return;
+
+ Vertex topLeft = { a.x - halfWidth, a.y };
+ Vertex topRight = { a.x + halfWidth, a.y };
+ Vertex bottomLeft = { a.x - halfWidth, b.y };
+ Vertex bottomRight = { a.x + halfWidth, b.y };
+
+ QTessellator::Trapezoid trap = { topLeft.y, bottomLeft.y, &topLeft, &bottomLeft, &topRight, &bottomRight };
+ addTrap(trap);
+ } else if (delta.y == 0) {
+ Q27Dot5 halfWidth = FloatToQ27Dot5(hw);
+
+ if (halfWidth == 0)
+ return;
+
+ if (a.x > b.x)
+ qSwap(a.x, b.x);
+
+ Vertex topLeft = { a.x, a.y - halfWidth };
+ Vertex topRight = { b.x, a.y - halfWidth };
+ Vertex bottomLeft = { a.x, a.y + halfWidth };
+ Vertex bottomRight = { b.x, a.y + halfWidth };
+
+ QTessellator::Trapezoid trap = { topLeft.y, bottomLeft.y, &topLeft, &bottomLeft, &topRight, &bottomRight };
+ addTrap(trap);
+ } else {
+ QPointF perp(pb.y() - pa.y(), pa.x() - pb.x());
+ qreal length = qSqrt(perp.x() * perp.x() + perp.y() * perp.y());
+
+ if (qFuzzyIsNull(length))
+ return;
+
+ // need the half of the width
+ perp *= hw / length;
+
+ QPointF pta = pa + perp;
+ QPointF ptb = pa - perp;
+ QPointF ptc = pb - perp;
+ QPointF ptd = pb + perp;
+
+ Vertex ta = { FloatToQ27Dot5(pta.x()), FloatToQ27Dot5(pta.y()) };
+ Vertex tb = { FloatToQ27Dot5(ptb.x()), FloatToQ27Dot5(ptb.y()) };
+ Vertex tc = { FloatToQ27Dot5(ptc.x()), FloatToQ27Dot5(ptc.y()) };
+ Vertex td = { FloatToQ27Dot5(ptd.x()), FloatToQ27Dot5(ptd.y()) };
+
+ if (ta.y < tb.y) {
+ if (tb.y < td.y) {
+ QTessellator::Trapezoid top = { ta.y, tb.y, &ta, &tb, &ta, &td };
+ QTessellator::Trapezoid bottom = { td.y, tc.y, &tb, &tc, &td, &tc };
+ addTrap(top);
+ addTrap(bottom);
+
+ QTessellator::Trapezoid middle = { tb.y, td.y, &tb, &tc, &ta, &td };
+ addTrap(middle);
+ } else {
+ QTessellator::Trapezoid top = { ta.y, td.y, &ta, &tb, &ta, &td };
+ QTessellator::Trapezoid bottom = { tb.y, tc.y, &tb, &tc, &td, &tc };
+ addTrap(top);
+ addTrap(bottom);
+
+ if (tb.y != td.y) {
+ QTessellator::Trapezoid middle = { td.y, tb.y, &ta, &tb, &td, &tc };
+ addTrap(middle);
+ }
+ }
+ } else {
+ if (ta.y < tc.y) {
+ QTessellator::Trapezoid top = { tb.y, ta.y, &tb, &tc, &tb, &ta };
+ QTessellator::Trapezoid bottom = { tc.y, td.y, &tc, &td, &ta, &td };
+ addTrap(top);
+ addTrap(bottom);
+
+ QTessellator::Trapezoid middle = { ta.y, tc.y, &tb, &tc, &ta, &td };
+ addTrap(middle);
+ } else {
+ QTessellator::Trapezoid top = { tb.y, tc.y, &tb, &tc, &tb, &ta };
+ QTessellator::Trapezoid bottom = { ta.y, td.y, &tc, &td, &ta, &td };
+ addTrap(top);
+ addTrap(bottom);
+
+ if (ta.y != tc.y) {
+ QTessellator::Trapezoid middle = { tc.y, ta.y, &tc, &td, &tb, &ta };
+ addTrap(middle);
+ }
+ }
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h b/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h
new file mode 100644
index 0000000000..65ae6bdc41
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qtessellator_p.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTESSELATOR_P_H
+#define QTESSELATOR_P_H
+
+#include <QPoint>
+#include <QRect>
+
+QT_BEGIN_NAMESPACE
+
+class QTessellatorPrivate;
+
+typedef int Q27Dot5;
+#define Q27Dot5ToDouble(i) ((i)/32.)
+#define FloatToQ27Dot5(i) (int)((i) * 32)
+#define IntToQ27Dot5(i) ((i) << 5)
+#define Q27Dot5ToXFixed(i) ((i) << 11)
+#define Q27Dot5Factor 32
+
+class QTessellator {
+public:
+ QTessellator();
+ virtual ~QTessellator();
+
+ QRectF tessellate(const QPointF *points, int nPoints);
+ void tessellateConvex(const QPointF *points, int nPoints);
+ void tessellateRect(const QPointF &a, const QPointF &b, qreal width);
+
+ void setWinding(bool w);
+
+ struct Vertex {
+ Q27Dot5 x;
+ Q27Dot5 y;
+ };
+ struct Trapezoid {
+ Q27Dot5 top;
+ Q27Dot5 bottom;
+ const Vertex *topLeft;
+ const Vertex *bottomLeft;
+ const Vertex *topRight;
+ const Vertex *bottomRight;
+ };
+ virtual void addTrap(const Trapezoid &trap) = 0;
+
+private:
+ friend class QTessellatorPrivate;
+ QTessellatorPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
new file mode 100644
index 0000000000..ccb421d868
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
@@ -0,0 +1,315 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qxcbconnection.h"
+#include "qcolormap_x11_p.h"
+#include "qxcbnativepainting.h"
+#include "qt_x11_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QXcbX11Data *qt_x11Data = Q_NULLPTR;
+
+void qt_xcb_native_x11_info_init(QXcbConnection *conn)
+{
+ qt_x11Data = new QXcbX11Data;
+ X11->display = static_cast<Display *>(conn->xlib_display());
+ X11->defaultScreen = DefaultScreen(X11->display);
+ X11->screenCount = ScreenCount(X11->display);
+
+ X11->screens = new QX11InfoData[X11->screenCount];
+ X11->argbVisuals = new Visual *[X11->screenCount];
+ X11->argbColormaps = new Colormap[X11->screenCount];
+
+ for (int s = 0; s < X11->screenCount; s++) {
+ QX11InfoData *screen = X11->screens + s;
+ //screen->ref = 1; // ensures it doesn't get deleted
+ screen->screen = s;
+
+ int widthMM = DisplayWidthMM(X11->display, s);
+ if (widthMM != 0) {
+ screen->dpiX = (DisplayWidth(X11->display, s) * 254 + widthMM * 5) / (widthMM * 10);
+ } else {
+ screen->dpiX = 72;
+ }
+
+ int heightMM = DisplayHeightMM(X11->display, s);
+ if (heightMM != 0) {
+ screen->dpiY = (DisplayHeight(X11->display, s) * 254 + heightMM * 5) / (heightMM * 10);
+ } else {
+ screen->dpiY = 72;
+ }
+
+ X11->argbVisuals[s] = 0;
+ X11->argbColormaps[s] = 0;
+ }
+
+ X11->use_xrender = conn->hasXRender() && !qEnvironmentVariableIsSet("QT_XCB_NATIVE_PAINTING_NO_XRENDER");
+
+#if QT_CONFIG(xrender)
+ memset(X11->solid_fills, 0, sizeof(X11->solid_fills));
+ for (int i = 0; i < X11->solid_fill_count; ++i)
+ X11->solid_fills[i].screen = -1;
+ memset(X11->pattern_fills, 0, sizeof(X11->pattern_fills));
+ for (int i = 0; i < X11->pattern_fill_count; ++i)
+ X11->pattern_fills[i].screen = -1;
+#endif
+
+ QXcbColormap::initialize();
+
+#if QT_CONFIG(xrender)
+ if (X11->use_xrender) {
+ // XRender is supported, let's see if we have a PictFormat for the
+ // default visual
+ XRenderPictFormat *format =
+ XRenderFindVisualFormat(X11->display,
+ (Visual *) QXcbX11Info::appVisual(X11->defaultScreen));
+
+ if (!format) {
+ X11->use_xrender = false;
+ }
+ }
+#endif // QT_CONFIG(xrender)
+}
+
+QVector<XRectangle> qt_region_to_xrectangles(const QRegion &r)
+{
+ const int numRects = r.rectCount();
+ const QVector<QRect> input = r.rects();
+ QVector<XRectangle> output(numRects);
+ for (int i = 0; i < numRects; ++i) {
+ const QRect &in = input[i];
+ XRectangle &out = output[i];
+ out.x = qMax(SHRT_MIN, in.x());
+ out.y = qMax(SHRT_MIN, in.y());
+ out.width = qMin((int)USHRT_MAX, in.width());
+ out.height = qMin((int)USHRT_MAX, in.height());
+ }
+ return output;
+}
+
+class QXcbX11InfoData : public QSharedData, public QX11InfoData
+{};
+
+QXcbX11Info::QXcbX11Info()
+ : d(Q_NULLPTR)
+{}
+
+QXcbX11Info::~QXcbX11Info()
+{}
+
+QXcbX11Info::QXcbX11Info(const QXcbX11Info &other)
+ : d(other.d)
+{}
+
+QXcbX11Info &QXcbX11Info::operator=(const QXcbX11Info &other)
+{
+ d = other.d;
+ return *this;
+}
+
+QXcbX11Info QXcbX11Info::fromScreen(int screen)
+{
+ QXcbX11InfoData *xd = new QXcbX11InfoData;
+ xd->screen = screen;
+ xd->depth = QXcbX11Info::appDepth(screen);
+ xd->cells = QXcbX11Info::appCells(screen);
+ xd->colormap = QXcbX11Info::appColormap(screen);
+ xd->defaultColormap = QXcbX11Info::appDefaultColormap(screen);
+ xd->visual = (Visual *)QXcbX11Info::appVisual(screen);
+ xd->defaultVisual = QXcbX11Info::appDefaultVisual(screen);
+
+ QXcbX11Info info;
+ info.d = xd;
+ return info;
+}
+
+void QXcbX11Info::setDepth(int depth)
+{
+ if (!d)
+ *this = fromScreen(appScreen());
+
+ d->depth = depth;
+}
+
+Display *QXcbX11Info::display()
+{
+ return X11 ? X11->display : 0;
+}
+
+int QXcbX11Info::screen() const
+{
+ return d ? d->screen : QXcbX11Info::appScreen();
+}
+
+int QXcbX11Info::depth() const
+{
+ return d ? d->depth : QXcbX11Info::appDepth();
+}
+
+Colormap QXcbX11Info::colormap() const
+{
+ return d ? d->colormap : QXcbX11Info::appColormap();
+}
+
+void *QXcbX11Info::visual() const
+{
+ return d ? d->visual : QXcbX11Info::appVisual();
+}
+
+void QXcbX11Info::setVisual(void *visual)
+{
+ if (!d)
+ *this = fromScreen(appScreen());
+
+ d->visual = (Visual *) visual;
+}
+
+int QXcbX11Info::appScreen()
+{
+ return X11 ? X11->defaultScreen : 0;
+}
+
+int QXcbX11Info::appDepth(int screen)
+{
+ return X11 ? X11->screens[screen == -1 ? X11->defaultScreen : screen].depth : 32;
+}
+
+int QXcbX11Info::appCells(int screen)
+{
+ return X11 ? X11->screens[screen == -1 ? X11->defaultScreen : screen].cells : 0;
+}
+
+Colormap QXcbX11Info::appColormap(int screen)
+{
+ return X11 ? X11->screens[screen == -1 ? X11->defaultScreen : screen].colormap : 0;
+}
+
+void *QXcbX11Info::appVisual(int screen)
+{
+ return X11 ? X11->screens[screen == -1 ? X11->defaultScreen : screen].visual : 0;
+}
+
+Window QXcbX11Info::appRootWindow(int screen)
+{
+ return X11 ? RootWindow(X11->display, screen == -1 ? X11->defaultScreen : screen) : 0;
+}
+
+bool QXcbX11Info::appDefaultColormap(int screen)
+{
+ return X11 ? X11->screens[screen == -1 ? X11->defaultScreen : screen].defaultColormap : true;
+}
+
+bool QXcbX11Info::appDefaultVisual(int screen)
+{
+ return X11 ? X11->screens[screen == -1 ? X11->defaultScreen : screen].defaultVisual : true;
+}
+
+int QXcbX11Info::appDpiX(int screen)
+{
+ if (!X11)
+ return 75;
+ if (screen < 0)
+ screen = X11->defaultScreen;
+ if (screen > X11->screenCount)
+ return 0;
+ return X11->screens[screen].dpiX;
+}
+
+int QXcbX11Info::appDpiY(int screen)
+{
+ if (!X11)
+ return 75;
+ if (screen < 0)
+ screen = X11->defaultScreen;
+ if (screen > X11->screenCount)
+ return 0;
+ return X11->screens[screen].dpiY;
+}
+
+#if QT_CONFIG(xrender)
+Picture QXcbX11Data::getSolidFill(int screen, const QColor &c)
+{
+ if (!X11->use_xrender)
+ return XNone;
+
+ XRenderColor color = preMultiply(c);
+ for (int i = 0; i < X11->solid_fill_count; ++i) {
+ if (X11->solid_fills[i].screen == screen
+ && X11->solid_fills[i].color.alpha == color.alpha
+ && X11->solid_fills[i].color.red == color.red
+ && X11->solid_fills[i].color.green == color.green
+ && X11->solid_fills[i].color.blue == color.blue)
+ return X11->solid_fills[i].picture;
+ }
+ // none found, replace one
+ int i = qrand() % 16;
+
+ if (X11->solid_fills[i].screen != screen && X11->solid_fills[i].picture) {
+ XRenderFreePicture (X11->display, X11->solid_fills[i].picture);
+ X11->solid_fills[i].picture = 0;
+ }
+
+ if (!X11->solid_fills[i].picture) {
+ Pixmap pixmap = XCreatePixmap (X11->display, RootWindow (X11->display, screen), 1, 1, 32);
+ XRenderPictureAttributes attrs;
+ attrs.repeat = True;
+ X11->solid_fills[i].picture = XRenderCreatePicture (X11->display, pixmap,
+ XRenderFindStandardFormat(X11->display, PictStandardARGB32),
+ CPRepeat, &attrs);
+ XFreePixmap (X11->display, pixmap);
+ }
+
+ X11->solid_fills[i].color = color;
+ X11->solid_fills[i].screen = screen;
+ XRenderFillRectangle (X11->display, PictOpSrc, X11->solid_fills[i].picture, &color, 0, 0, 1, 1);
+ return X11->solid_fills[i].picture;
+}
+
+XRenderColor QXcbX11Data::preMultiply(const QColor &c)
+{
+ XRenderColor color;
+ const uint A = c.alpha(),
+ R = c.red(),
+ G = c.green(),
+ B = c.blue();
+ color.alpha = (A | A << 8);
+ color.red = (R | R << 8) * color.alpha / 0x10000;
+ color.green = (G | G << 8) * color.alpha / 0x10000;
+ color.blue = (B | B << 8) * color.alpha / 0x10000;
+ return color;
+}
+#endif // QT_CONFIG(xrender)
+
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h
new file mode 100644
index 0000000000..f3011286c9
--- /dev/null
+++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QXCBNATIVEPAINTING_H
+#define QXCBNATIVEPAINTING_H
+
+#include <QSharedDataPointer>
+#include "qt_x11_p.h"
+
+typedef struct _FcPattern FcPattern;
+typedef unsigned long XID;
+typedef XID Colormap;
+typedef XID Window;
+typedef struct _XDisplay Display;
+
+QT_BEGIN_NAMESPACE
+
+class QXcbConnection;
+class QPixmap;
+
+void qt_xcb_native_x11_info_init(QXcbConnection *conn);
+QVector<XRectangle> qt_region_to_xrectangles(const QRegion &r);
+
+class QXcbX11InfoData;
+class QXcbX11Info
+{
+public:
+ QXcbX11Info();
+ ~QXcbX11Info();
+ QXcbX11Info(const QXcbX11Info &other);
+ QXcbX11Info &operator=(const QXcbX11Info &other);
+
+ static QXcbX11Info fromScreen(int screen);
+ static Display *display();
+
+ int depth() const;
+ void setDepth(int depth);
+
+ int screen() const;
+ Colormap colormap() const;
+
+ void *visual() const;
+ void setVisual(void *visual);
+
+ static int appScreen();
+ static int appDepth(int screen = -1);
+ static int appCells(int screen = -1);
+ static Colormap appColormap(int screen = -1);
+ static void *appVisual(int screen = -1);
+ static Window appRootWindow(int screen = -1);
+ static bool appDefaultColormap(int screen = -1);
+ static bool appDefaultVisual(int screen = -1);
+ static int appDpiX(int screen = -1);
+ static int appDpiY(int screen = -1);
+
+private:
+ QSharedDataPointer<QXcbX11InfoData> d;
+
+ friend class QX11PaintEngine;
+ friend class QX11PlatformPixmap;
+ friend void qt_x11SetScreen(QPixmap &pixmap, int screen);
+};
+
+QT_END_NAMESPACE
+
+#endif // QXCBNATIVEPAINTING_H
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index a419caf0fc..17927af3e3 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -150,8 +150,6 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
, m_gc_drawable(0)
, m_xcb_pixmap(0)
{
- Q_XCB_NOOP(connection());
-
const xcb_format_t *fmt = connection()->formatForDepth(depth);
Q_ASSERT(fmt);
@@ -206,11 +204,11 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
if (!hasShm()) {
m_xcb_pixmap = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_pixmap(xcb_connection(),
- m_xcb_image->depth,
- m_xcb_pixmap,
- screen->screen()->root,
- m_xcb_image->width, m_xcb_image->height));
+ xcb_create_pixmap(xcb_connection(),
+ m_xcb_image->depth,
+ m_xcb_pixmap,
+ screen->screen()->root,
+ m_xcb_image->width, m_xcb_image->height);
}
}
@@ -234,13 +232,13 @@ bool QXcbShmImage::scroll(const QRegion &area, int dx, int dy)
const QRect bounds(QPoint(0, 0), size());
for (const QRect &src : area) {
const QRect dst = src.translated(delta).intersected(bounds);
- Q_XCB_CALL(xcb_copy_area(xcb_connection(),
- m_xcb_pixmap,
- m_xcb_pixmap,
- m_gc,
- src.x(), src.y(),
- dst.x(), dst.y(),
- dst.width(), dst.height()));
+ xcb_copy_area(xcb_connection(),
+ m_xcb_pixmap,
+ m_xcb_pixmap,
+ m_gc,
+ src.x(), src.y(),
+ dst.x(), dst.y(),
+ dst.width(), dst.height());
}
}
@@ -251,7 +249,7 @@ void QXcbShmImage::destroy()
{
const int segmentSize = m_xcb_image ? (m_xcb_image->stride * m_xcb_image->height) : 0;
if (segmentSize && m_shm_info.shmaddr)
- Q_XCB_CALL(xcb_shm_detach(xcb_connection(), m_shm_info.shmseg));
+ xcb_shm_detach(xcb_connection(), m_shm_info.shmseg);
if (segmentSize) {
if (m_shm_info.shmaddr) {
@@ -265,12 +263,12 @@ void QXcbShmImage::destroy()
xcb_image_destroy(m_xcb_image);
if (m_gc)
- Q_XCB_CALL(xcb_free_gc(xcb_connection(), m_gc));
+ xcb_free_gc(xcb_connection(), m_gc);
delete m_graphics_buffer;
m_graphics_buffer = Q_NULLPTR;
if (m_xcb_pixmap) {
- Q_XCB_CALL(xcb_free_pixmap(xcb_connection(), m_xcb_pixmap));
+ xcb_free_pixmap(xcb_connection(), m_xcb_pixmap);
m_xcb_pixmap = 0;
}
}
@@ -279,13 +277,13 @@ void QXcbShmImage::ensureGC(xcb_drawable_t dst)
{
if (m_gc_drawable != dst) {
if (m_gc)
- Q_XCB_CALL(xcb_free_gc(xcb_connection(), m_gc));
+ xcb_free_gc(xcb_connection(), m_gc);
static const uint32_t mask = XCB_GC_GRAPHICS_EXPOSURES;
static const uint32_t values[] = { 0 };
m_gc = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_gc(xcb_connection(), m_gc, dst, mask, values));
+ xcb_create_gc(xcb_connection(), m_gc, dst, mask, values);
m_gc_drawable = dst;
}
@@ -425,10 +423,7 @@ void QXcbShmImage::setClip(const QRegion &region)
if (region.isEmpty()) {
static const uint32_t mask = XCB_GC_CLIP_MASK;
static const uint32_t values[] = { XCB_NONE };
- Q_XCB_CALL(xcb_change_gc(xcb_connection(),
- m_gc,
- mask,
- values));
+ xcb_change_gc(xcb_connection(), m_gc, mask, values);
} else {
const QVector<QRect> qrects = region.rects();
QVector<xcb_rectangle_t> xcb_rects(qrects.size());
@@ -440,18 +435,16 @@ void QXcbShmImage::setClip(const QRegion &region)
xcb_rects[i].height = qrects[i].height();
}
- Q_XCB_CALL(xcb_set_clip_rectangles(xcb_connection(),
- XCB_CLIP_ORDERING_YX_BANDED,
- m_gc,
- 0, 0,
- xcb_rects.size(), xcb_rects.constData()));
+ xcb_set_clip_rectangles(xcb_connection(),
+ XCB_CLIP_ORDERING_YX_BANDED,
+ m_gc,
+ 0, 0,
+ xcb_rects.size(), xcb_rects.constData());
}
}
void QXcbShmImage::put(xcb_drawable_t dst, const QRegion &region, const QPoint &offset)
{
- Q_XCB_NOOP(connection());
-
ensureGC(dst);
setClip(region);
@@ -460,33 +453,32 @@ void QXcbShmImage::put(xcb_drawable_t dst, const QRegion &region, const QPoint &
const QRect source = bounds.translated(offset);
if (hasShm()) {
- Q_XCB_CALL(xcb_shm_put_image(xcb_connection(),
- dst,
- m_gc,
- m_xcb_image->width,
- m_xcb_image->height,
- source.x(), source.y(),
- source.width(), source.height(),
- target.x(), target.y(),
- m_xcb_image->depth,
- m_xcb_image->format,
- 0, // send event?
- m_shm_info.shmseg,
- m_xcb_image->data - m_shm_info.shmaddr));
+ xcb_shm_put_image(xcb_connection(),
+ dst,
+ m_gc,
+ m_xcb_image->width,
+ m_xcb_image->height,
+ source.x(), source.y(),
+ source.width(), source.height(),
+ target.x(), target.y(),
+ m_xcb_image->depth,
+ m_xcb_image->format,
+ 0, // send event?
+ m_shm_info.shmseg,
+ m_xcb_image->data - m_shm_info.shmaddr);
m_dirtyShm |= region.translated(offset);
} else {
flushPixmap(region);
- Q_XCB_CALL(xcb_copy_area(xcb_connection(),
- m_xcb_pixmap,
- dst,
- m_gc,
- source.x(), source.y(),
- target.x(), target.y(),
- source.width(), source.height()));
+ xcb_copy_area(xcb_connection(),
+ m_xcb_pixmap,
+ dst,
+ m_gc,
+ source.x(), source.y(),
+ target.x(), target.y(),
+ source.width(), source.height());
}
setClip(QRegion());
- Q_XCB_NOOP(connection());
}
void QXcbShmImage::preparePaint(const QRegion &region)
@@ -592,8 +584,6 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
if (bounds.isNull())
return;
- Q_XCB_NOOP(connection());
-
QXcbWindow *platformWindow = static_cast<QXcbWindow *>(window->handle());
if (!platformWindow) {
qWarning("QXcbBackingStore::flush: QWindow has no platform window (QTBUG-32681)");
@@ -602,8 +592,6 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
m_image->put(platformWindow->xcb_window(), clipped, offset);
- Q_XCB_NOOP(connection());
-
if (platformWindow->needsSync())
platformWindow->updateSyncRequestCounter();
else
@@ -617,8 +605,6 @@ void QXcbBackingStore::composeAndFlush(QWindow *window, const QRegion &region, c
{
QPlatformBackingStore::composeAndFlush(window, region, offset, textures, context, translucentBackground);
- Q_XCB_NOOP(connection());
-
QXcbWindow *platformWindow = static_cast<QXcbWindow *>(window->handle());
if (platformWindow->needsSync()) {
platformWindow->updateSyncRequestCounter();
@@ -632,7 +618,6 @@ void QXcbBackingStore::resize(const QSize &size, const QRegion &)
{
if (m_image && size == m_image->size())
return;
- Q_XCB_NOOP(connection());
QXcbScreen *screen = static_cast<QXcbScreen *>(window()->screen()->handle());
QPlatformWindow *pw = window()->handle();
@@ -649,7 +634,6 @@ void QXcbBackingStore::resize(const QSize &size, const QRegion &)
if (win->imageNeedsRgbSwap()) {
m_rgbImage = QImage(size, win->imageFormat());
}
- Q_XCB_NOOP(connection());
}
bool QXcbBackingStore::scroll(const QRegion &area, int dx, int dy)
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp
index 01b3bca0d2..30ab669432 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
@@ -278,22 +278,22 @@ QXcbClipboard::QXcbClipboard(QXcbConnection *c)
#ifndef QT_NO_DEBUG
QByteArray ba("Qt clipboard window");
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_owner,
- atom(QXcbAtom::_NET_WM_NAME),
- atom(QXcbAtom::UTF8_STRING),
- 8,
- ba.length(),
- ba.constData()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_owner,
+ atom(QXcbAtom::_NET_WM_NAME),
+ atom(QXcbAtom::UTF8_STRING),
+ 8,
+ ba.length(),
+ ba.constData());
#endif
if (connection()->hasXFixes()) {
const uint32_t mask = XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER |
XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY |
XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE;
- Q_XCB_CALL(xcb_xfixes_select_selection_input_checked(xcb_connection(), m_owner, XCB_ATOM_PRIMARY, mask));
- Q_XCB_CALL(xcb_xfixes_select_selection_input_checked(xcb_connection(), m_owner, atom(QXcbAtom::CLIPBOARD), mask));
+ xcb_xfixes_select_selection_input_checked(xcb_connection(), m_owner, XCB_ATOM_PRIMARY, mask);
+ xcb_xfixes_select_selection_input_checked(xcb_connection(), m_owner, atom(QXcbAtom::CLIPBOARD), mask);
}
}
@@ -305,8 +305,7 @@ QXcbClipboard::~QXcbClipboard()
m_timestamp[QClipboard::Selection] != XCB_CURRENT_TIME) {
// First we check if there is a clipboard manager.
- xcb_get_selection_owner_cookie_t cookie = xcb_get_selection_owner(xcb_connection(), atom(QXcbAtom::CLIPBOARD_MANAGER));
- xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_selection_owner, xcb_connection(), atom(QXcbAtom::CLIPBOARD_MANAGER));
if (reply && reply->owner != XCB_NONE) {
// we delete the property so the manager saves all TARGETS.
xcb_delete_property(xcb_connection(), m_owner, atom(QXcbAtom::_QT_SELECTION));
@@ -320,7 +319,6 @@ QXcbClipboard::~QXcbClipboard()
"clipboard manager in a reasonable time");
}
}
- free(reply);
}
if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
@@ -459,26 +457,26 @@ xcb_window_t QXcbClipboard::requestor() const
QXcbClipboard *that = const_cast<QXcbClipboard *>(this);
xcb_window_t window = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_window(xcb_connection(),
- XCB_COPY_FROM_PARENT, // depth -- same as root
- window, // window id
- platformScreen->screen()->root, // parent window id
- x, y, w, h,
- 0, // border width
- XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
- platformScreen->screen()->root_visual, // visual
- 0, // value mask
- 0)); // value list
+ xcb_create_window(xcb_connection(),
+ XCB_COPY_FROM_PARENT, // depth -- same as root
+ window, // window id
+ platformScreen->screen()->root, // parent window id
+ x, y, w, h,
+ 0, // border width
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
+ platformScreen->screen()->root_visual, // visual
+ 0, // value mask
+ 0); // value list
#ifndef QT_NO_DEBUG
QByteArray ba("Qt clipboard requestor window");
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- window,
- atom(QXcbAtom::_NET_WM_NAME),
- atom(QXcbAtom::UTF8_STRING),
- 8,
- ba.length(),
- ba.constData()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ window,
+ atom(QXcbAtom::_NET_WM_NAME),
+ atom(QXcbAtom::UTF8_STRING),
+ 8,
+ ba.length(),
+ ba.constData());
#endif
uint32_t mask = XCB_EVENT_MASK_PROPERTY_CHANGE;
@@ -759,17 +757,14 @@ bool QXcbClipboard::clipboardReadProperty(xcb_window_t win, xcb_atom_t property,
format = &dummy_format;
// Don't read anything, just get the size of the property data
- xcb_get_property_cookie_t cookie = Q_XCB_CALL(xcb_get_property(xcb_connection(), false, win, property, XCB_GET_PROPERTY_TYPE_ANY, 0, 0));
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, win, property, XCB_GET_PROPERTY_TYPE_ANY, 0, 0);
if (!reply || reply->type == XCB_NONE) {
- free(reply);
buffer->resize(0);
return false;
}
*type = reply->type;
*format = reply->format;
bytes_left = reply->bytes_after;
- free(reply);
int offset = 0, buffer_offset = 0;
@@ -784,17 +779,15 @@ bool QXcbClipboard::clipboardReadProperty(xcb_window_t win, xcb_atom_t property,
while (bytes_left) {
// more to read...
- xcb_get_property_cookie_t cookie = Q_XCB_CALL(xcb_get_property(xcb_connection(), false, win, property, XCB_GET_PROPERTY_TYPE_ANY, offset, maxsize/4));
- reply = xcb_get_property_reply(xcb_connection(), cookie, 0);
- if (!reply || reply->type == XCB_NONE) {
- free(reply);
+ reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, win, property, XCB_GET_PROPERTY_TYPE_ANY, offset, maxsize/4);
+ if (!reply || reply->type == XCB_NONE)
break;
- }
+
*type = reply->type;
*format = reply->format;
bytes_left = reply->bytes_after;
- char *data = (char *)xcb_get_property_value(reply);
- int length = xcb_get_property_value_length(reply);
+ char *data = (char *)xcb_get_property_value(reply.get());
+ int length = xcb_get_property_value_length(reply.get());
// Here we check if we get a buffer overflow and tries to
// recover -- this shouldn't normally happen, but it doesn't
@@ -814,7 +807,6 @@ bool QXcbClipboard::clipboardReadProperty(xcb_window_t win, xcb_atom_t property,
// offset is specified in 32-bit multiples
offset += length / 4;
}
- free(reply);
}
}
@@ -891,13 +883,9 @@ xcb_generic_event_t *QXcbClipboard::waitForClipboardEvent(xcb_window_t win, int
return e;
if (checkManager) {
- xcb_get_selection_owner_cookie_t cookie = xcb_get_selection_owner(xcb_connection(), atom(QXcbAtom::CLIPBOARD_MANAGER));
- xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(xcb_connection(), cookie, 0);
- if (!reply || reply->owner == XCB_NONE) {
- free(reply);
+ auto reply = Q_XCB_REPLY(xcb_get_selection_owner, xcb_connection(), atom(QXcbAtom::CLIPBOARD_MANAGER));
+ if (!reply || reply->owner == XCB_NONE)
return 0;
- }
- free(reply);
}
// process other clipboard events, since someone is probably requesting data from us
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index d36a14b920..536c709dbe 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -109,6 +109,9 @@ Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.input")
Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.input.devices")
Q_LOGGING_CATEGORY(lcQpaXInputEvents, "qt.qpa.input.events")
Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen")
+Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events")
+Q_LOGGING_CATEGORY(lcQpaXcb, "qt.qpa.xcb") // for general (uncategorized) XCB logging
+Q_LOGGING_CATEGORY(lcQpaPeeker, "qt.qpa.peeker")
// this event type was added in libxcb 1.10,
// but we support also older version
@@ -148,8 +151,18 @@ static const char * const xcbConnectionErrors[] = {
"Error during FD passing" /* XCB_CONN_CLOSED_FDPASSING_FAILED */
};
-static int nullErrorHandler(Display *, XErrorEvent *)
+static int nullErrorHandler(Display *dpy, XErrorEvent *err)
{
+#ifndef Q_XCB_DEBUG
+ Q_UNUSED(dpy);
+ Q_UNUSED(err);
+#else
+ const int buflen = 1024;
+ char buf[buflen];
+
+ XGetErrorText(dpy, err->error_code, buf, buflen);
+ fprintf(stderr, "X Error: serial %lu error %d %s\n", err->serial, (int) err->error_code, buf);
+#endif
return 0;
}
@@ -243,11 +256,8 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
} else if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED) {
// New XRandR output is available and it's enabled
if (output.crtc != XCB_NONE && output.mode != XCB_NONE) {
- xcb_randr_get_output_info_cookie_t outputInfoCookie =
- xcb_randr_get_output_info(xcb_connection(), output.output, output.config_timestamp);
- QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> outputInfo(
- xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL));
-
+ auto outputInfo = Q_XCB_REPLY(xcb_randr_get_output_info, xcb_connection(),
+ output.output, output.config_timestamp);
// Find a fake screen
const auto scrs = virtualDesktop->screens();
for (QPlatformScreen *scr : scrs) {
@@ -261,12 +271,12 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
if (screen) {
QString nameWas = screen->name();
// Transform the fake screen into a physical screen
- screen->setOutput(output.output, outputInfo.data());
+ screen->setOutput(output.output, outputInfo.get());
updateScreen(screen, output);
qCDebug(lcQpaScreen) << "output" << screen->name()
<< "is connected and enabled; was fake:" << nameWas;
} else {
- screen = createScreen(virtualDesktop, output, outputInfo.data());
+ screen = createScreen(virtualDesktop, output, outputInfo.get());
qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled";
}
QHighDpiScaling::updateHighDpiScaling();
@@ -274,10 +284,8 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
} else if (screen) {
if (output.crtc == XCB_NONE && output.mode == XCB_NONE) {
// Screen has been disabled
- xcb_randr_get_output_info_cookie_t outputInfoCookie =
- xcb_randr_get_output_info(xcb_connection(), output.output, output.config_timestamp);
- QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> outputInfo(
- xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL));
+ auto outputInfo = Q_XCB_REPLY(xcb_randr_get_output_info, xcb_connection(),
+ output.output, output.config_timestamp);
if (outputInfo->crtc == XCB_NONE) {
qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled";
destroyScreen(screen);
@@ -299,16 +307,10 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output)
{
- xcb_generic_error_t *error = 0;
- xcb_randr_get_output_primary_cookie_t primaryCookie =
- xcb_randr_get_output_primary(xcb_connection(), rootWindow);
- QScopedPointer<xcb_randr_get_output_primary_reply_t, QScopedPointerPodDeleter> primary (
- xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error));
- if (!primary || error) {
+ auto primary = Q_XCB_REPLY(xcb_randr_get_output_primary, xcb_connection(), rootWindow);
+ if (!primary)
qWarning("failed to get the primary output of the screen");
- free(error);
- error = NULL;
- }
+
const bool isPrimary = primary ? (primary->output == output) : false;
return isPrimary;
@@ -404,72 +406,59 @@ void QXcbConnection::initializeScreens()
m_virtualDesktops.append(virtualDesktop);
QList<QPlatformScreen *> siblings;
if (has_randr_extension) {
- xcb_generic_error_t *error = NULL;
// RRGetScreenResourcesCurrent is fast but it may return nothing if the
// configuration is not initialized wrt to the hardware. We should call
// RRGetScreenResources in this case.
- QScopedPointer<xcb_randr_get_screen_resources_reply_t, QScopedPointerPodDeleter> resources;
- xcb_randr_get_screen_resources_current_cookie_t resourcesCookie =
- xcb_randr_get_screen_resources_current(xcb_connection(), xcbScreen->root);
- QScopedPointer<xcb_randr_get_screen_resources_current_reply_t, QScopedPointerPodDeleter> resources_current(
- xcb_randr_get_screen_resources_current_reply(xcb_connection(), resourcesCookie, &error));
- if (!resources_current || error) {
+ auto resources_current = Q_XCB_REPLY(xcb_randr_get_screen_resources_current,
+ xcb_connection(), xcbScreen->root);
+ if (!resources_current) {
qWarning("failed to get the current screen resources");
- free(error);
} else {
xcb_timestamp_t timestamp = 0;
xcb_randr_output_t *outputs = Q_NULLPTR;
- int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data());
+ int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.get());
if (outputCount) {
timestamp = resources_current->config_timestamp;
- outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.data());
+ outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.get());
} else {
- xcb_randr_get_screen_resources_cookie_t resourcesCookie =
- xcb_randr_get_screen_resources(xcb_connection(), xcbScreen->root);
- resources.reset(xcb_randr_get_screen_resources_reply(xcb_connection(), resourcesCookie, &error));
- if (!resources || error) {
+ auto resources = Q_XCB_REPLY(xcb_randr_get_screen_resources,
+ xcb_connection(), xcbScreen->root);
+ if (!resources) {
qWarning("failed to get the screen resources");
- free(error);
} else {
timestamp = resources->config_timestamp;
- outputCount = xcb_randr_get_screen_resources_outputs_length(resources.data());
- outputs = xcb_randr_get_screen_resources_outputs(resources.data());
+ outputCount = xcb_randr_get_screen_resources_outputs_length(resources.get());
+ outputs = xcb_randr_get_screen_resources_outputs(resources.get());
}
}
if (outputCount) {
- xcb_randr_get_output_primary_cookie_t primaryCookie =
- xcb_randr_get_output_primary(xcb_connection(), xcbScreen->root);
- QScopedPointer<xcb_randr_get_output_primary_reply_t, QScopedPointerPodDeleter> primary(
- xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error));
- if (!primary || error) {
+ auto primary = Q_XCB_REPLY(xcb_randr_get_output_primary, xcb_connection(), xcbScreen->root);
+ if (!primary) {
qWarning("failed to get the primary output of the screen");
- free(error);
} else {
for (int i = 0; i < outputCount; i++) {
- QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> output(
- xcb_randr_get_output_info_reply(xcb_connection(),
- xcb_randr_get_output_info_unchecked(xcb_connection(), outputs[i], timestamp), NULL));
-
+ auto output = Q_XCB_REPLY_UNCHECKED(xcb_randr_get_output_info,
+ xcb_connection(), outputs[i], timestamp);
// Invalid, disconnected or disabled output
- if (output == NULL)
+ if (!output)
continue;
if (output->connection != XCB_RANDR_CONNECTION_CONNECTED) {
qCDebug(lcQpaScreen, "Output %s is not connected", qPrintable(
- QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output.data()),
- xcb_randr_get_output_info_name_length(output.data()))));
+ QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output.get()),
+ xcb_randr_get_output_info_name_length(output.get()))));
continue;
}
if (output->crtc == XCB_NONE) {
qCDebug(lcQpaScreen, "Output %s is not enabled", qPrintable(
- QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output.data()),
- xcb_randr_get_output_info_name_length(output.data()))));
+ QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output.get()),
+ xcb_randr_get_output_info_name_length(output.get()))));
continue;
}
- QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.data());
+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.get());
siblings << screen;
m_screens << screen;
@@ -492,12 +481,9 @@ void QXcbConnection::initializeScreens()
}
} else if (has_xinerama_extension) {
// Xinerama is available
- xcb_xinerama_query_screens_cookie_t cookie = xcb_xinerama_query_screens(m_connection);
- xcb_xinerama_query_screens_reply_t *screens = xcb_xinerama_query_screens_reply(m_connection,
- cookie,
- Q_NULLPTR);
+ auto screens = Q_XCB_REPLY(xcb_xinerama_query_screens, m_connection);
if (screens) {
- xcb_xinerama_screen_info_iterator_t it = xcb_xinerama_query_screens_screen_info_iterator(screens);
+ xcb_xinerama_screen_info_iterator_t it = xcb_xinerama_query_screens_screen_info_iterator(screens.get());
while (it.rem) {
xcb_xinerama_screen_info_t *screen_info = it.data;
QXcbScreen *screen = new QXcbScreen(this, virtualDesktop,
@@ -507,7 +493,6 @@ void QXcbConnection::initializeScreens()
m_screens << screen;
xcb_xinerama_screen_info_next(&it);
}
- free(screens);
}
}
if (siblings.isEmpty()) {
@@ -664,11 +649,6 @@ QXcbConnection::~QXcbConnection()
#ifndef QT_NO_DRAGANDDROP
delete m_drag;
#endif
-
-#if QT_CONFIG(xinput2)
- finalizeXInput2();
-#endif
-
if (m_reader && m_reader->isRunning()) {
sendConnectionEvent(QXcbAtom::_QT_CLOSE_CONNECTION);
m_reader->wait();
@@ -757,58 +737,73 @@ break;
} \
break;
-//#define XCB_EVENT_DEBUG
-
-void printXcbEvent(const char *message, xcb_generic_event_t *event)
-{
-#ifdef XCB_EVENT_DEBUG
-#define PRINT_XCB_EVENT(ev) \
- case ev: \
- qDebug("QXcbConnection: %s: %d - %s - sequence: %d", message, int(ev), #ev, event->sequence); \
- break;
-
- switch (event->response_type & ~0x80) {
- PRINT_XCB_EVENT(XCB_KEY_PRESS);
- PRINT_XCB_EVENT(XCB_KEY_RELEASE);
- PRINT_XCB_EVENT(XCB_BUTTON_PRESS);
- PRINT_XCB_EVENT(XCB_BUTTON_RELEASE);
- PRINT_XCB_EVENT(XCB_MOTION_NOTIFY);
- PRINT_XCB_EVENT(XCB_ENTER_NOTIFY);
- PRINT_XCB_EVENT(XCB_LEAVE_NOTIFY);
- PRINT_XCB_EVENT(XCB_FOCUS_IN);
- PRINT_XCB_EVENT(XCB_FOCUS_OUT);
- PRINT_XCB_EVENT(XCB_KEYMAP_NOTIFY);
- PRINT_XCB_EVENT(XCB_EXPOSE);
- PRINT_XCB_EVENT(XCB_GRAPHICS_EXPOSURE);
- PRINT_XCB_EVENT(XCB_NO_EXPOSURE);
- PRINT_XCB_EVENT(XCB_VISIBILITY_NOTIFY);
- PRINT_XCB_EVENT(XCB_CREATE_NOTIFY);
- PRINT_XCB_EVENT(XCB_DESTROY_NOTIFY);
- PRINT_XCB_EVENT(XCB_UNMAP_NOTIFY);
- PRINT_XCB_EVENT(XCB_MAP_NOTIFY);
- PRINT_XCB_EVENT(XCB_MAP_REQUEST);
- PRINT_XCB_EVENT(XCB_REPARENT_NOTIFY);
- PRINT_XCB_EVENT(XCB_CONFIGURE_NOTIFY);
- PRINT_XCB_EVENT(XCB_CONFIGURE_REQUEST);
- PRINT_XCB_EVENT(XCB_GRAVITY_NOTIFY);
- PRINT_XCB_EVENT(XCB_RESIZE_REQUEST);
- PRINT_XCB_EVENT(XCB_CIRCULATE_NOTIFY);
- PRINT_XCB_EVENT(XCB_CIRCULATE_REQUEST);
- PRINT_XCB_EVENT(XCB_PROPERTY_NOTIFY);
- PRINT_XCB_EVENT(XCB_SELECTION_CLEAR);
- PRINT_XCB_EVENT(XCB_SELECTION_REQUEST);
- PRINT_XCB_EVENT(XCB_SELECTION_NOTIFY);
- PRINT_XCB_EVENT(XCB_COLORMAP_NOTIFY);
- PRINT_XCB_EVENT(XCB_CLIENT_MESSAGE);
- PRINT_XCB_EVENT(XCB_MAPPING_NOTIFY);
- PRINT_XCB_EVENT(XCB_GE_GENERIC);
- default:
- qDebug("QXcbConnection: %s: unknown event - response_type: %d - sequence: %d", message, int(event->response_type & ~0x80), int(event->sequence));
+void QXcbConnection::printXcbEvent(const QLoggingCategory &log, const char *message,
+ xcb_generic_event_t *event) const
+{
+ quint8 response_type = event->response_type & ~0x80;
+ quint16 sequence = event->sequence;
+
+#define PRINT_AND_RETURN(name) { \
+ qCDebug(log, "%s | %s(%d) | sequence: %d", message, name, response_type, sequence); \
+ return; \
+}
+#define CASE_PRINT_AND_RETURN(name) case name : PRINT_AND_RETURN(#name);
+
+ switch (response_type) {
+ CASE_PRINT_AND_RETURN( XCB_KEY_PRESS );
+ CASE_PRINT_AND_RETURN( XCB_KEY_RELEASE );
+ CASE_PRINT_AND_RETURN( XCB_BUTTON_PRESS );
+ CASE_PRINT_AND_RETURN( XCB_BUTTON_RELEASE );
+ CASE_PRINT_AND_RETURN( XCB_MOTION_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_ENTER_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_LEAVE_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_FOCUS_IN );
+ CASE_PRINT_AND_RETURN( XCB_FOCUS_OUT );
+ CASE_PRINT_AND_RETURN( XCB_KEYMAP_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_EXPOSE );
+ CASE_PRINT_AND_RETURN( XCB_GRAPHICS_EXPOSURE );
+ CASE_PRINT_AND_RETURN( XCB_NO_EXPOSURE );
+ CASE_PRINT_AND_RETURN( XCB_VISIBILITY_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_CREATE_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_DESTROY_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_UNMAP_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_MAP_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_MAP_REQUEST );
+ CASE_PRINT_AND_RETURN( XCB_REPARENT_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_CONFIGURE_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_CONFIGURE_REQUEST );
+ CASE_PRINT_AND_RETURN( XCB_GRAVITY_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_RESIZE_REQUEST );
+ CASE_PRINT_AND_RETURN( XCB_CIRCULATE_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_CIRCULATE_REQUEST );
+ CASE_PRINT_AND_RETURN( XCB_PROPERTY_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_SELECTION_CLEAR );
+ CASE_PRINT_AND_RETURN( XCB_SELECTION_REQUEST );
+ CASE_PRINT_AND_RETURN( XCB_SELECTION_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_COLORMAP_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_CLIENT_MESSAGE );
+ CASE_PRINT_AND_RETURN( XCB_MAPPING_NOTIFY );
+ CASE_PRINT_AND_RETURN( XCB_GE_GENERIC );
}
-#else
- Q_UNUSED(message);
- Q_UNUSED(event);
-#endif
+ // XFixes
+ if (has_xfixes && response_type == xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY)
+ PRINT_AND_RETURN("XCB_XFIXES_SELECTION_NOTIFY");
+ // XRandR
+ if (has_randr_extension) {
+ if (response_type == xrandr_first_event + XCB_RANDR_NOTIFY)
+ PRINT_AND_RETURN("XCB_RANDR_NOTIFY");
+ if (response_type == xrandr_first_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY)
+ PRINT_AND_RETURN("XCB_RANDR_SCREEN_CHANGE_NOTIFY");
+ }
+ // XKB
+ if (response_type == xkb_first_event)
+ PRINT_AND_RETURN("XCB_XKB_* event");
+
+ // UNKNOWN
+ qCDebug(log, "%s | unknown(%d) | sequence: %d", message, response_type, sequence);
+
+#undef PRINT_AND_RETURN
+#undef CASE_PRINT_AND_RETURN
}
const char *xcb_errors[] =
@@ -959,18 +954,6 @@ const char *xcb_protocol_request_codes[] =
"Unknown"
};
-#ifdef Q_XCB_DEBUG
-void QXcbConnection::log(const char *file, int line, int sequence)
-{
- QMutexLocker locker(&m_callLogMutex);
- CallInfo info;
- info.sequence = sequence;
- info.file = file;
- info.line = line;
- m_callLog << info;
-}
-#endif
-
void QXcbConnection::handleXcbError(xcb_generic_error_t *error)
{
long result = 0;
@@ -986,26 +969,6 @@ void QXcbConnection::handleXcbError(xcb_generic_error_t *error)
int(error->sequence), int(error->resource_id),
int(error->major_code), xcb_protocol_request_codes[clamped_major_code],
int(error->minor_code));
-#ifdef Q_XCB_DEBUG
- QMutexLocker locker(&m_callLogMutex);
- int i = 0;
- for (; i < m_callLog.size(); ++i) {
- if (m_callLog.at(i).sequence == error->sequence) {
- qDebug("Caused by: %s:%d", m_callLog.at(i).file.constData(), m_callLog.at(i).line);
- break;
- } else if (m_callLog.at(i).sequence > error->sequence) {
- qDebug("Caused some time before: %s:%d", m_callLog.at(i).file.constData(),
- m_callLog.at(i).line);
- if (i > 0)
- qDebug("and after: %s:%d", m_callLog.at(i-1).file.constData(),
- m_callLog.at(i-1).line);
- break;
- }
- }
- if (i == m_callLog.size() && !m_callLog.isEmpty())
- qDebug("Caused some time after: %s:%d", qAsConst(m_callLog).first().file.constData(),
- qAsConst(m_callLog).first().line);
-#endif
}
static Qt::MouseButtons translateMouseButtons(int s)
@@ -1075,17 +1038,6 @@ namespace {
void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
{
-#ifdef Q_XCB_DEBUG
- {
- QMutexLocker locker(&m_callLogMutex);
- int i = 0;
- for (; i < m_callLog.size(); ++i)
- if (m_callLog.at(i).sequence >= event->sequence)
- break;
- m_callLog.remove(0, i);
- }
-#endif
-
long result = 0;
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
bool handled = dispatcher && dispatcher->filterNativeEvent(m_nativeInterface->genericEventFilterType(), event, &result);
@@ -1097,34 +1049,33 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_EXPOSE:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_expose_event_t, window, handleExposeEvent);
- // press/release/motion is only delivered here when XI 2.2+ is _not_ in use
case XCB_BUTTON_PRESS: {
xcb_button_press_event_t *ev = (xcb_button_press_event_t *)event;
m_keyboard->updateXKBStateFromCore(ev->state);
// the event explicitly contains the state of the three first buttons,
// the rest we need to manage ourselves
- m_buttons = (m_buttons & ~0x7) | translateMouseButtons(ev->state);
- m_buttons |= translateMouseButton(ev->detail);
+ m_buttonState = (m_buttonState & ~0x7) | translateMouseButtons(ev->state);
+ m_buttonState |= translateMouseButton(ev->detail);
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
- qCDebug(lcQpaXInputEvents, "legacy mouse press, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttons));
+ qCDebug(lcQpaXInputEvents, "legacy mouse press, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttonState));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_press_event_t, event, handleButtonPressEvent);
}
case XCB_BUTTON_RELEASE: {
xcb_button_release_event_t *ev = (xcb_button_release_event_t *)event;
m_keyboard->updateXKBStateFromCore(ev->state);
- m_buttons = (m_buttons & ~0x7) | translateMouseButtons(ev->state);
- m_buttons &= ~translateMouseButton(ev->detail);
+ m_buttonState = (m_buttonState & ~0x7) | translateMouseButtons(ev->state);
+ m_buttonState &= ~translateMouseButton(ev->detail);
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
- qCDebug(lcQpaXInputEvents, "legacy mouse release, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttons));
+ qCDebug(lcQpaXInputEvents, "legacy mouse release, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttonState));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent);
}
case XCB_MOTION_NOTIFY: {
xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)event;
m_keyboard->updateXKBStateFromCore(ev->state);
- m_buttons = (m_buttons & ~0x7) | translateMouseButtons(ev->state);
+ m_buttonState = (m_buttonState & ~0x7) | translateMouseButtons(ev->state);
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "legacy mouse move %d,%d button %d state %X", ev->event_x, ev->event_y,
- ev->detail, static_cast<unsigned int>(m_buttons));
+ ev->detail, static_cast<unsigned int>(m_buttonState));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_motion_notify_event_t, event, handleMotionNotifyEvent);
}
@@ -1140,14 +1091,14 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
handleClientMessageEvent((xcb_client_message_event_t *)event);
break;
case XCB_ENTER_NOTIFY:
-#ifdef XCB_USE_XINPUT22
- if (isAtLeastXI22() && xi2MouseEvents())
+#if QT_CONFIG(xinput2)
+ if (hasXInput2() && !xi2MouseEventsDisabled())
break;
#endif
HANDLE_PLATFORM_WINDOW_EVENT(xcb_enter_notify_event_t, event, handleEnterNotifyEvent);
case XCB_LEAVE_NOTIFY:
-#ifdef XCB_USE_XINPUT22
- if (isAtLeastXI22() && xi2MouseEvents())
+#if QT_CONFIG(xinput2)
+ if (hasXInput2() && !xi2MouseEventsDisabled())
break;
#endif
m_keyboard->updateXKBStateFromCore(((xcb_leave_notify_event_t *)event)->state);
@@ -1212,7 +1163,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
#if QT_CONFIG(xinput2)
case XCB_GE_GENERIC:
// Here the windowEventListener is invoked from xi2HandleEvent()
- if (m_xi2Enabled && isXIEvent(event, m_xiOpCode))
+ if (hasXInput2() && isXIEvent(event, m_xiOpCode))
xi2HandleEvent(reinterpret_cast<xcb_ge_event_t *>(event));
break;
#endif
@@ -1223,7 +1174,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
}
if (!handled) {
- if (response_type == xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY) {
+ if (has_xfixes && response_type == xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY) {
xcb_xfixes_selection_notify_event_t *notify_event = reinterpret_cast<xcb_xfixes_selection_notify_event_t *>(event);
setTime(notify_event->timestamp);
#ifndef QT_NO_CLIPBOARD
@@ -1275,10 +1226,10 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
if (!handled && m_glIntegration)
handled = m_glIntegration->handleXcbEvent(event, response_type);
- if (handled)
- printXcbEvent("Handled XCB event", event);
- else
- printXcbEvent("Unhandled XCB event", event);
+#if 0
+ if (Q_UNLIKELY(lcQpaEvents().isDebugEnabled()))
+ printXcbEvent(lcQpaEvents(), handled ? "Handled" : "Unhandled", event);
+#endif
}
void QXcbConnection::addPeekFunc(PeekFunc f)
@@ -1286,6 +1237,95 @@ void QXcbConnection::addPeekFunc(PeekFunc f)
m_peekFuncs.append(f);
}
+qint32 QXcbConnection::generatePeekerId()
+{
+ qint32 peekerId = m_peekerIdSource++;
+ m_peekerToCachedIndex.insert(peekerId, 0);
+ return peekerId;
+}
+
+bool QXcbConnection::removePeekerId(qint32 peekerId)
+{
+ if (!m_peekerToCachedIndex.contains(peekerId)) {
+ qCWarning(lcQpaXcb, "failed to remove unknown peeker id: %d", peekerId);
+ return false;
+ }
+ m_peekerToCachedIndex.remove(peekerId);
+ if (m_peekerToCachedIndex.isEmpty()) {
+ m_peekerIdSource = 0; // Once the hash becomes empty, we can start reusing IDs
+ m_peekerIndexCacheDirty = false;
+ }
+ return true;
+}
+
+bool QXcbConnection::peekEventQueue(PeekerCallback peeker, void *peekerData,
+ PeekOptions option, qint32 peekerId)
+{
+ bool peekerIdProvided = peekerId != -1;
+ if (peekerIdProvided && !m_peekerToCachedIndex.contains(peekerId)) {
+ qCWarning(lcQpaXcb, "failed to find index for unknown peeker id: %d", peekerId);
+ return false;
+ }
+
+ bool peekFromCachedIndex = option.testFlag(PeekOption::PeekFromCachedIndex);
+ if (peekFromCachedIndex && !peekerIdProvided) {
+ qCWarning(lcQpaXcb, "PeekOption::PeekFromCachedIndex requires peeker id");
+ return false;
+ }
+
+ if (peekerIdProvided && m_peekerIndexCacheDirty) {
+ // When the main event loop has flushed the buffered XCB events into the window
+ // system event queue, the cached indices are not valid anymore and need reset.
+ auto it = m_peekerToCachedIndex.begin();
+ while (it != m_peekerToCachedIndex.constEnd()) {
+ (*it) = 0;
+ ++it;
+ }
+ m_peekerIndexCacheDirty = false;
+ }
+
+ qint32 peekerIndex = peekFromCachedIndex ? m_peekerToCachedIndex.value(peekerId) : 0;
+ qint32 startingIndex = peekerIndex;
+ bool result = false;
+ m_mainEventLoopFlushedQueue = false;
+
+ QXcbEventArray *eventqueue = m_reader->lock();
+
+ if (Q_UNLIKELY(lcQpaPeeker().isDebugEnabled())) {
+ qCDebug(lcQpaPeeker, "[%d] peeker index: %d | mode: %s | queue size: %d", peekerId,
+ peekerIndex, peekFromCachedIndex ? "cache" : "start", eventqueue->size());
+ }
+ while (peekerIndex < eventqueue->size() && !result && !m_mainEventLoopFlushedQueue) {
+ xcb_generic_event_t *event = eventqueue->at(peekerIndex++);
+ if (!event)
+ continue;
+ if (Q_UNLIKELY(lcQpaPeeker().isDebugEnabled())) {
+ QString debug = QString((QLatin1String("[%1] peeking at index: %2")))
+ .arg(peekerId).arg(peekerIndex - 1);
+ printXcbEvent(lcQpaPeeker(), debug.toLatin1(), event);
+ }
+ // A peeker may call QCoreApplication::processEvents(), which has two implications:
+ // 1) We need to make the lock available for QXcbConnection::processXcbEvents(),
+ // otherwise we will deadlock;
+ // 2) QXcbConnection::processXcbEvents() will flush the queue we are currently
+ // looping through;
+ m_reader->unlock();
+ result = peeker(event, peekerData);
+ m_reader->lock();
+ }
+
+ m_reader->unlock();
+
+ if (peekerIdProvided && peekerIndex != startingIndex && !m_mainEventLoopFlushedQueue) {
+ auto it = m_peekerToCachedIndex.find(peekerId);
+ // Make sure that a peeker callback did not remove the peeker id
+ if (it != m_peekerToCachedIndex.constEnd())
+ (*it) = peekerIndex;
+ }
+
+ return result;
+}
+
QXcbEventReader::QXcbEventReader(QXcbConnection *connection)
: m_connection(connection)
{
@@ -1400,10 +1440,10 @@ void QXcbConnection::sendConnectionEvent(QXcbAtom::Atom a, uint id)
const xcb_window_t eventListener = xcb_generate_id(m_connection);
xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup);
xcb_screen_t *screen = it.data;
- Q_XCB_CALL(xcb_create_window(m_connection, XCB_COPY_FROM_PARENT,
- eventListener, screen->root,
- 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
- screen->root_visual, 0, 0));
+ xcb_create_window(m_connection, XCB_COPY_FROM_PARENT,
+ eventListener, screen->root,
+ 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
+ screen->root_visual, 0, 0);
event.response_type = XCB_CLIENT_MESSAGE;
event.format = 32;
@@ -1412,8 +1452,8 @@ void QXcbConnection::sendConnectionEvent(QXcbAtom::Atom a, uint id)
event.type = atom(a);
event.data.data32[0] = id;
- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, eventListener, XCB_EVENT_MASK_NO_EVENT, reinterpret_cast<const char *>(&event)));
- Q_XCB_CALL(xcb_destroy_window(m_connection, eventListener));
+ xcb_send_event(xcb_connection(), false, eventListener, XCB_EVENT_MASK_NO_EVENT, reinterpret_cast<const char *>(&event));
+ xcb_destroy_window(m_connection, eventListener);
xcb_flush(xcb_connection());
}
@@ -1471,13 +1511,7 @@ xcb_timestamp_t QXcbConnection::getTimestamp()
xcb_window_t QXcbConnection::getSelectionOwner(xcb_atom_t atom) const
{
- xcb_connection_t *c = xcb_connection();
- xcb_get_selection_owner_cookie_t cookie = xcb_get_selection_owner(c, atom);
- xcb_get_selection_owner_reply_t *reply;
- reply = xcb_get_selection_owner_reply(c, cookie, 0);
- xcb_window_t win = reply->owner;
- free(reply);
- return win;
+ return Q_XCB_REPLY(xcb_get_selection_owner, xcb_connection(), atom)->owner;
}
xcb_window_t QXcbConnection::getQtSelectionOwner()
@@ -1487,16 +1521,16 @@ xcb_window_t QXcbConnection::getQtSelectionOwner()
int16_t x = 0, y = 0;
uint16_t w = 3, h = 3;
m_qtSelectionOwner = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_window(xcb_connection(),
- XCB_COPY_FROM_PARENT, // depth -- same as root
- m_qtSelectionOwner, // window id
- xcbScreen->root, // parent window id
- x, y, w, h,
- 0, // border width
- XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
- xcbScreen->root_visual, // visual
- 0, // value mask
- 0)); // value list
+ xcb_create_window(xcb_connection(),
+ XCB_COPY_FROM_PARENT, // depth -- same as root
+ m_qtSelectionOwner, // window id
+ xcbScreen->root, // parent window id
+ x, y, w, h,
+ 0, // border width
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
+ xcbScreen->root_visual, // visual
+ 0, // value mask
+ 0); // value list
}
return m_qtSelectionOwner;
}
@@ -1512,47 +1546,47 @@ xcb_window_t QXcbConnection::clientLeader()
if (m_clientLeader == 0) {
m_clientLeader = xcb_generate_id(xcb_connection());
QXcbScreen *screen = primaryScreen();
- Q_XCB_CALL(xcb_create_window(xcb_connection(),
- XCB_COPY_FROM_PARENT,
- m_clientLeader,
- screen->root(),
- 0, 0, 1, 1,
- 0,
- XCB_WINDOW_CLASS_INPUT_OUTPUT,
- screen->screen()->root_visual,
- 0, 0));
+ xcb_create_window(xcb_connection(),
+ XCB_COPY_FROM_PARENT,
+ m_clientLeader,
+ screen->root(),
+ 0, 0, 1, 1,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ screen->screen()->root_visual,
+ 0, 0);
#ifndef QT_NO_DEBUG
QByteArray ba("Qt client leader window");
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_clientLeader,
- atom(QXcbAtom::_NET_WM_NAME),
- atom(QXcbAtom::UTF8_STRING),
- 8,
- ba.length(),
- ba.constData()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_clientLeader,
+ atom(QXcbAtom::_NET_WM_NAME),
+ atom(QXcbAtom::UTF8_STRING),
+ 8,
+ ba.length(),
+ ba.constData());
#endif
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_clientLeader,
- atom(QXcbAtom::WM_CLIENT_LEADER),
- XCB_ATOM_WINDOW,
- 32,
- 1,
- &m_clientLeader));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_clientLeader,
+ atom(QXcbAtom::WM_CLIENT_LEADER),
+ XCB_ATOM_WINDOW,
+ 32,
+ 1,
+ &m_clientLeader);
#if QT_CONFIG(xcb_sm)
// If we are session managed, inform the window manager about it
QByteArray session = qGuiApp->sessionId().toLatin1();
if (!session.isEmpty()) {
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_clientLeader,
- atom(QXcbAtom::SM_CLIENT_ID),
- XCB_ATOM_STRING,
- 8,
- session.length(),
- session.constData()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_clientLeader,
+ atom(QXcbAtom::SM_CLIENT_ID),
+ XCB_ATOM_STRING,
+ 8,
+ session.length(),
+ session.constData());
}
#endif
}
@@ -1574,7 +1608,8 @@ void *QXcbConnection::createVisualInfoForDefaultVisualId() const
info.visualid = m_defaultVisualId;
int count = 0;
- XVisualInfo *retVisual = XGetVisualInfo(DISPLAY_FROM_XCB(this), VisualIDMask, &info, &count);
+ Display *dpy = static_cast<Display *>(connection()->xlib_display());
+ XVisualInfo *retVisual = XGetVisualInfo(dpy, VisualIDMask, &info, &count);
Q_ASSERT(count < 2);
return retVisual;
}
@@ -1629,14 +1664,15 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event, int currentIndex,
#if QT_CONFIG(xinput2)
// compress XI_* events
if (responseType == XCB_GE_GENERIC) {
- if (!m_xi2Enabled)
+ if (!hasXInput2())
return false;
// compress XI_Motion, but not from tablet devices
if (isXIType(event, m_xiOpCode, XI_Motion)) {
#if QT_CONFIG(tabletevent)
xXIDeviceEvent *xdev = reinterpret_cast<xXIDeviceEvent *>(event);
- if (const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid))
+ if (!QCoreApplication::testAttribute(Qt::AA_CompressTabletEvents) &&
+ const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid))
return false;
#endif // QT_CONFIG(tabletevent)
for (int j = nextIndex; j < eventqueue->size(); ++j) {
@@ -1736,6 +1772,8 @@ void QXcbConnection::processXcbEvents()
m_reader->unlock();
+ m_peekerIndexCacheDirty = m_mainEventLoopFlushedQueue = true;
+
// Indicate with a null event that the event the callbacks are waiting for
// is not in the queue currently.
for (PeekFunc f : qAsConst(m_peekFuncs))
@@ -2003,11 +2041,7 @@ xcb_atom_t QXcbConnection::internAtom(const char *name)
if (!name || *name == 0)
return XCB_NONE;
- xcb_intern_atom_cookie_t cookie = xcb_intern_atom(xcb_connection(), false, strlen(name), name);
- xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(xcb_connection(), cookie, 0);
- int atom = reply->atom;
- free(reply);
- return atom;
+ return Q_XCB_REPLY(xcb_intern_atom, xcb_connection(), false, strlen(name), name)->atom;
}
QByteArray QXcbConnection::atomName(xcb_atom_t atom)
@@ -2015,18 +2049,12 @@ QByteArray QXcbConnection::atomName(xcb_atom_t atom)
if (!atom)
return QByteArray();
- xcb_generic_error_t *error = 0;
- xcb_get_atom_name_cookie_t cookie = Q_XCB_CALL(xcb_get_atom_name(xcb_connection(), atom));
- xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(xcb_connection(), cookie, &error);
- if (error) {
+ auto reply = Q_XCB_REPLY(xcb_get_atom_name, xcb_connection(), atom);
+ if (!reply)
qWarning() << "QXcbConnection::atomName: bad Atom" << atom;
- free(error);
- }
- if (reply) {
- QByteArray result(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply));
- free(reply);
- return result;
- }
+ else
+ return QByteArray(xcb_get_atom_name_name(reply.get()), xcb_get_atom_name_name_length(reply.get()));
+
return QByteArray();
}
@@ -2048,29 +2076,25 @@ const xcb_format_t *QXcbConnection::formatForDepth(uint8_t depth) const
void QXcbConnection::sync()
{
// from xcb_aux_sync
- xcb_get_input_focus_cookie_t cookie = Q_XCB_CALL(xcb_get_input_focus(xcb_connection()));
+ xcb_get_input_focus_cookie_t cookie = xcb_get_input_focus(xcb_connection());
free(xcb_get_input_focus_reply(xcb_connection(), cookie, 0));
}
void QXcbConnection::initializeXFixes()
{
- xcb_generic_error_t *error = 0;
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xfixes_id);
if (!reply || !reply->present)
return;
- xfixes_first_event = reply->first_event;
- xcb_xfixes_query_version_cookie_t xfixes_query_cookie = xcb_xfixes_query_version(m_connection,
- XCB_XFIXES_MAJOR_VERSION,
- XCB_XFIXES_MINOR_VERSION);
- xcb_xfixes_query_version_reply_t *xfixes_query = xcb_xfixes_query_version_reply (m_connection,
- xfixes_query_cookie, &error);
- if (!xfixes_query || error || xfixes_query->major_version < 2) {
+ auto xfixes_query = Q_XCB_REPLY(xcb_xfixes_query_version, m_connection,
+ XCB_XFIXES_MAJOR_VERSION,
+ XCB_XFIXES_MINOR_VERSION);
+ if (!xfixes_query || xfixes_query->major_version < 2) {
qWarning("QXcbConnection: Failed to initialize XFixes");
- free(error);
- xfixes_first_event = 0;
+ return;
}
- free(xfixes_query);
+ xfixes_first_event = reply->first_event;
+ has_xfixes = true;
}
void QXcbConnection::initializeXRender()
@@ -2080,17 +2104,14 @@ void QXcbConnection::initializeXRender()
if (!reply || !reply->present)
return;
- xcb_generic_error_t *error = 0;
- xcb_render_query_version_cookie_t xrender_query_cookie = xcb_render_query_version(m_connection,
- XCB_RENDER_MAJOR_VERSION,
- XCB_RENDER_MINOR_VERSION);
- xcb_render_query_version_reply_t *xrender_query = xcb_render_query_version_reply(m_connection,
- xrender_query_cookie, &error);
- if (!xrender_query || error || (xrender_query->major_version == 0 && xrender_query->minor_version < 5)) {
+ auto xrender_query = Q_XCB_REPLY(xcb_render_query_version, m_connection,
+ XCB_RENDER_MAJOR_VERSION,
+ XCB_RENDER_MINOR_VERSION);
+ if (!xrender_query || (xrender_query->major_version == 0 && xrender_query->minor_version < 5)) {
qWarning("QXcbConnection: Failed to initialize XRender");
- free(error);
+ return;
}
- free(xrender_query);
+ has_render_extension = true;
#endif
}
@@ -2102,21 +2123,16 @@ void QXcbConnection::initializeXRandr()
xrandr_first_event = reply->first_event;
- xcb_generic_error_t *error = 0;
- xcb_randr_query_version_cookie_t xrandr_query_cookie = xcb_randr_query_version(m_connection,
- XCB_RANDR_MAJOR_VERSION,
- XCB_RANDR_MINOR_VERSION);
+ auto xrandr_query = Q_XCB_REPLY(xcb_randr_query_version, m_connection,
+ XCB_RANDR_MAJOR_VERSION,
+ XCB_RANDR_MINOR_VERSION);
has_randr_extension = true;
- xcb_randr_query_version_reply_t *xrandr_query = xcb_randr_query_version_reply(m_connection,
- xrandr_query_cookie, &error);
- if (!xrandr_query || error || (xrandr_query->major_version < 1 || (xrandr_query->major_version == 1 && xrandr_query->minor_version < 2))) {
+ if (!xrandr_query || (xrandr_query->major_version < 1 || (xrandr_query->major_version == 1 && xrandr_query->minor_version < 2))) {
qWarning("QXcbConnection: Failed to initialize XRandr");
- free(error);
has_randr_extension = false;
}
- free(xrandr_query);
xcb_screen_iterator_t rootIter = xcb_setup_roots_iterator(m_setup);
for (; rootIter.rem; xcb_screen_next(&rootIter)) {
@@ -2136,14 +2152,8 @@ void QXcbConnection::initializeXinerama()
if (!reply || !reply->present)
return;
- xcb_generic_error_t *error = Q_NULLPTR;
- xcb_xinerama_is_active_cookie_t xinerama_query_cookie = xcb_xinerama_is_active(m_connection);
- xcb_xinerama_is_active_reply_t *xinerama_is_active = xcb_xinerama_is_active_reply(m_connection,
- xinerama_query_cookie,
- &error);
- has_xinerama_extension = xinerama_is_active && !error && xinerama_is_active->state;
- free(error);
- free(xinerama_is_active);
+ auto xinerama_is_active = Q_XCB_REPLY(xcb_xinerama_is_active, m_connection);
+ has_xinerama_extension = xinerama_is_active && xinerama_is_active->state;
}
void QXcbConnection::initializeXShape()
@@ -2153,16 +2163,13 @@ void QXcbConnection::initializeXShape()
return;
has_shape_extension = true;
- xcb_shape_query_version_cookie_t cookie = xcb_shape_query_version(m_connection);
- xcb_shape_query_version_reply_t *shape_query = xcb_shape_query_version_reply(m_connection,
- cookie, NULL);
+ auto shape_query = Q_XCB_REPLY(xcb_shape_query_version, m_connection);
if (!shape_query) {
qWarning("QXcbConnection: Failed to initialize SHAPE extension");
} else if (shape_query->major_version > 1 || (shape_query->major_version == 1 && shape_query->minor_version >= 1)) {
// The input shape is the only thing added in SHAPE 1.1
has_input_shape = true;
}
- free(shape_query);
}
void QXcbConnection::initializeXKB()
@@ -2177,11 +2184,10 @@ void QXcbConnection::initializeXKB()
xkb_first_event = reply->first_event;
xcb_connection_t *c = connection()->xcb_connection();
- xcb_xkb_use_extension_cookie_t xkb_query_cookie;
- xcb_xkb_use_extension_reply_t *xkb_query;
- xkb_query_cookie = xcb_xkb_use_extension(c, XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION);
- xkb_query = xcb_xkb_use_extension_reply(c, xkb_query_cookie, 0);
+ auto xkb_query = Q_XCB_REPLY(xcb_xkb_use_extension, c,
+ XKB_X11_MIN_MAJOR_XKB_VERSION,
+ XKB_X11_MIN_MINOR_XKB_VERSION);
if (!xkb_query) {
qWarning("Qt: Failed to initialize XKB extension");
@@ -2190,12 +2196,10 @@ void QXcbConnection::initializeXKB()
qWarning("Qt: Unsupported XKB version (We want %d %d, but X server has %d %d)",
XCB_XKB_MAJOR_VERSION, XCB_XKB_MINOR_VERSION,
xkb_query->serverMajor, xkb_query->serverMinor);
- free(xkb_query);
return;
}
has_xkb = true;
- free(xkb_query);
const uint16_t required_map_parts = (XCB_XKB_MAP_PART_KEY_TYPES |
XCB_XKB_MAP_PART_KEY_SYMS |
@@ -2230,62 +2234,6 @@ void QXcbConnection::initializeXKB()
#endif
}
-#if defined(XCB_USE_XINPUT22)
-bool QXcbConnection::xi2MouseEvents() const
-{
- static bool mouseViaXI2 = !qEnvironmentVariableIsSet("QT_XCB_NO_XI2_MOUSE");
- // FIXME: Don't use XInput2 mouse events when Xinerama extension
- // is enabled, because it causes problems with multi-monitor setup.
- return mouseViaXI2 && !has_xinerama_extension;
-}
-#endif
-
-#if QT_CONFIG(xinput2)
-static int xi2ValuatorOffset(const unsigned char *maskPtr, int maskLen, int number)
-{
- int offset = 0;
- for (int i = 0; i < maskLen; i++) {
- if (number < 8) {
- if ((maskPtr[i] & (1 << number)) == 0)
- return -1;
- }
- for (int j = 0; j < 8; j++) {
- if (j == number)
- return offset;
- if (maskPtr[i] & (1 << j))
- offset++;
- }
- number -= 8;
- }
- return -1;
-}
-
-bool QXcbConnection::xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value)
-{
- const xXIDeviceEvent *xideviceevent = static_cast<const xXIDeviceEvent *>(event);
- const unsigned char *buttonsMaskAddr = (const unsigned char*)&xideviceevent[1];
- const unsigned char *valuatorsMaskAddr = buttonsMaskAddr + xideviceevent->buttons_len * 4;
- FP3232 *valuatorsValuesAddr = (FP3232*)(valuatorsMaskAddr + xideviceevent->valuators_len * 4);
-
- int valuatorOffset = xi2ValuatorOffset(valuatorsMaskAddr, xideviceevent->valuators_len, valuatorNum);
- if (valuatorOffset < 0)
- return false;
-
- *value = valuatorsValuesAddr[valuatorOffset].integral;
- *value += ((double)valuatorsValuesAddr[valuatorOffset].frac / (1 << 16) / (1 << 16));
- return true;
-}
-
-void QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event)
-{
- // xcb event structs contain stuff that wasn't on the wire, the full_sequence field
- // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes.
- // Move this data back to have the same layout in memory as it was on the wire
- // and allow casting, overwriting the full_sequence field.
- memmove((char*) event + 32, (char*) event + 36, event->length * 4);
-}
-#endif // QT_CONFIG(xinput2)
-
QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker() const
{
if (!m_systemTrayTracker) {
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index edbc8d846e..999dc0630c 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -56,6 +56,9 @@
#include <QtCore/QLoggingCategory>
#include <QtCore/private/qglobal_p.h>
+#include <cstdlib>
+#include <memory>
+
// This is needed to make Qt compile together with XKB. xkb.h is using a variable
// which is called 'explicit', this is a reserved keyword in c++
#if QT_CONFIG(xkb)
@@ -76,19 +79,19 @@
#define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support
#endif
#endif
-struct XInput2TouchDeviceData;
#endif // QT_CONFIG(xinput2)
struct xcb_randr_get_output_info_reply_t;
-//#define Q_XCB_DEBUG
-
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput)
Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices)
Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents)
Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker)
class QXcbVirtualDesktop;
class QXcbScreen;
@@ -358,7 +361,7 @@ public:
virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {}
virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {}
virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {}
-#ifdef XCB_USE_XINPUT22
+#if QT_CONFIG(xinput2)
virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {}
virtual void handleXIEnterLeave(xcb_ge_event_t *) {}
#endif
@@ -426,26 +429,12 @@ public:
void *xlib_display() const;
void *createVisualInfoForDefaultVisualId() const;
#endif
-
-#if QT_CONFIG(xinput2)
- void xi2Select(xcb_window_t window);
- void xi2SelectStateEvents();
-#endif
-#ifdef XCB_USE_XINPUT21
- bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; }
-#else
- bool isAtLeastXI21() const { return false; }
-#endif
-#ifdef XCB_USE_XINPUT22
- bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; }
-#else
- bool isAtLeastXI22() const { return false; }
-#endif
-
void sync();
void handleXcbError(xcb_generic_error_t *error);
void handleXcbEvent(xcb_generic_event_t *event);
+ void printXcbEvent(const QLoggingCategory &log, const char *message,
+ xcb_generic_event_t *event) const;
void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener);
void removeWindowEventListener(xcb_window_t id);
@@ -458,27 +447,37 @@ public:
typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *);
void addPeekFunc(PeekFunc f);
+ // Peek at all queued events
+ qint32 generatePeekerId();
+ bool removePeekerId(qint32 peekerId);
+ enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h
+ Q_DECLARE_FLAGS(PeekOptions, PeekOption)
+ typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData);
+ bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr,
+ PeekOptions option = PeekDefault, qint32 peekerId = -1);
+
inline xcb_timestamp_t time() const { return m_time; }
inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; }
inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; }
inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; }
- bool hasXFixes() const { return xfixes_first_event > 0; }
+ bool hasXFixes() const { return has_xfixes; }
bool hasXShape() const { return has_shape_extension; }
bool hasXRandr() const { return has_randr_extension; }
bool hasInputShape() const { return has_input_shape; }
bool hasXKB() const { return has_xkb; }
+ bool hasXRender() const { return has_render_extension; }
+ bool hasXInput2() const { return m_xi2Enabled; }
- bool supportsThreadedRendering() const { return m_reader->isRunning(); }
bool threadedEventHandling() const { return m_reader->isRunning(); }
xcb_timestamp_t getTimestamp();
xcb_window_t getSelectionOwner(xcb_atom_t atom) const;
xcb_window_t getQtSelectionOwner();
- void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); }
- Qt::MouseButtons buttons() const { return m_buttons; }
+ void setButtonState(Qt::MouseButton button, bool down) { m_buttonState.setFlag(button, down); }
+ Qt::MouseButtons buttonState() const { return m_buttonState; }
Qt::MouseButton translateMouseButton(xcb_button_t s);
QXcbWindow *focusWindow() const { return m_focusWindow; }
@@ -501,27 +500,29 @@ public:
static bool xEmbedSystemTrayAvailable();
static bool xEmbedSystemTrayVisualHasAlphaChannel();
+#if QT_CONFIG(xinput2)
+ void xi2SelectStateEvents();
+ void xi2SelectDeviceEvents(xcb_window_t window);
+ void xi2SelectDeviceEventsCompatibility(xcb_window_t window);
+ bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab);
+ bool xi2MouseEventsDisabled() const;
+ bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; }
+ bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; }
+ Qt::MouseButton xiToQtMouseButton(uint32_t b);
#ifdef XCB_USE_XINPUT21
- void handleEnterEvent();
+ void xi2UpdateScrollingDevices();
#endif
-
#ifdef XCB_USE_XINPUT22
bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner);
- bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab);
+ bool isTouchScreen(int id);
+#endif
#endif
- Qt::MouseButton xiToQtMouseButton(uint32_t b);
-
QXcbEventReader *eventReader() const { return m_reader; }
bool canGrab() const { return m_canGrabServer; }
QXcbGlIntegration *glIntegration() const { return m_glIntegration; }
-#ifdef XCB_USE_XINPUT22
- bool xi2MouseEvents() const;
- bool isTouchScreen(int id) const;
-#endif
-
protected:
bool event(QEvent *e) override;
@@ -553,15 +554,35 @@ private:
void destroyScreen(QXcbScreen *screen);
void initializeScreens();
bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const;
-#if QT_CONFIG(xinput2)
+
bool m_xi2Enabled = false;
- int m_xi2Minor = 2;
+#if QT_CONFIG(xinput2)
+ int m_xi2Minor = -1;
void initializeXInput2();
- void finalizeXInput2();
+ void xi2SetupDevice(void *info, bool removeExisting = true);
void xi2SetupDevices();
- XInput2TouchDeviceData *touchDeviceForId(int id);
+ struct TouchDeviceData {
+ QTouchDevice *qtTouchDevice = nullptr;
+ QHash<int, QWindowSystemInterface::TouchPoint> touchPoints;
+ QHash<int, QPointF> pointPressedPosition; // in screen coordinates where each point was pressed
+ struct ValuatorClassInfo {
+ double min = 0;
+ double max = 0;
+ int number = -1;
+ QXcbAtom::Atom label;
+ };
+ QVector<ValuatorClassInfo> valuatorInfo;
+
+ // Stuff that is relevant only for touchpads
+ QPointF firstPressedPosition; // in screen coordinates where the first point was pressed
+ QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed
+ QSizeF size; // device size in mm
+ bool providesTouchOrientation = false;
+ };
+ TouchDeviceData *populateTouchDevices(void *info);
+ TouchDeviceData *touchDeviceForId(int id);
void xi2HandleEvent(xcb_ge_event_t *event);
- void xi2HandleHierachyEvent(void *event);
+ void xi2HandleHierarchyEvent(void *event);
void xi2HandleDeviceChangedEvent(void *event);
int m_xiOpCode, m_xiEventBase, m_xiErrorBase;
#ifdef XCB_USE_XINPUT22
@@ -600,9 +621,12 @@ private:
Qt::Orientations legacyOrientations = 0;
QPointF lastScrollPosition;
};
- void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes);
- void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice);
QHash<int, ScrollingDevice> m_scrollingDevices;
+#ifdef XCB_USE_XINPUT21
+ void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice);
+ void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice);
+ ScrollingDevice *scrollingDeviceForId(int id);
+#endif
static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value);
static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event);
@@ -638,34 +662,18 @@ private:
void *m_xlib_display = nullptr;
#endif
QXcbEventReader *m_reader = nullptr;
+
#if QT_CONFIG(xinput2)
- QHash<int, XInput2TouchDeviceData*> m_touchDevices;
+ QHash<int, TouchDeviceData> m_touchDevices;
#ifdef XCB_USE_XINPUT22
struct StartSystemResizeInfo {
- xcb_window_t window;
+ xcb_window_t window = XCB_NONE;
uint16_t deviceid;
uint32_t pointid;
Qt::Corner corner;
} m_startSystemResizeInfo;
#endif
#endif
-#ifdef Q_XCB_DEBUG
- struct CallInfo {
- int sequence;
- QByteArray file;
- int line;
- };
- QVector<CallInfo> m_callLog;
- QMutex m_callLogMutex;
- void log(const char *file, int line, int sequence);
- template <typename cookie_t>
- friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection,
- const char *file, int line);
- template <typename reply_t>
- friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection,
- const char *file, int line);
-#endif
-
WindowMapper m_mapper;
QVector<PeekFunc> m_peekFuncs;
@@ -674,13 +682,15 @@ private:
uint32_t xrandr_first_event = 0;
uint32_t xkb_first_event = 0;
+ bool has_xfixes = false;
bool has_xinerama_extension = false;
bool has_shape_extension = false;
bool has_randr_extension = false;
bool has_input_shape;
bool has_xkb = false;
+ bool has_render_extension = false;
- Qt::MouseButtons m_buttons = 0;
+ Qt::MouseButtons m_buttonState = 0;
QXcbWindow *m_focusWindow = nullptr;
QXcbWindow *m_mouseGrabber = nullptr;
@@ -694,6 +704,10 @@ private:
xcb_window_t m_qtSelectionOwner = 0;
+ bool m_mainEventLoopFlushedQueue = false;
+ qint32 m_peekerIdSource = 0;
+ bool m_peekerIndexCacheDirty = false;
+ QHash<qint32, qint32> m_peekerToCachedIndex;
friend class QXcbEventReader;
};
#if QT_CONFIG(xinput2)
@@ -703,9 +717,6 @@ Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE);
#endif
#endif
-#define DISPLAY_FROM_XCB(object) (reinterpret_cast<Display *>(object->connection()->xlib_display()))
-#define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId()))
-
template<typename T>
xcb_generic_event_t *QXcbConnection::checkEvent(T &checker)
{
@@ -733,6 +744,20 @@ private:
QXcbConnection *m_connection;
};
+#define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection
+
+#define Q_XCB_REPLY(call, ...) \
+ std::unique_ptr<call##_reply_t, decltype(std::free) *>( \
+ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr), \
+ std::free \
+ )
+
+#define Q_XCB_REPLY_UNCHECKED(call, ...) \
+ std::unique_ptr<call##_reply_t, decltype(std::free) *>( \
+ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr), \
+ std::free \
+ )
+
template <typename T>
union q_padded_xcb_event {
T event;
@@ -746,30 +771,6 @@ union q_padded_xcb_event {
q_padded_xcb_event<event_type> store = {}; \
auto &event_var = store.event;
-#ifdef Q_XCB_DEBUG
-template <typename cookie_t>
-cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file,
- int line)
-{
- connection->log(file, line, cookie.sequence);
- return cookie;
-}
-
-template <typename reply_t>
-reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line)
-{
- connection->log(file, line, reply->sequence);
- return reply;
-}
-#define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__)
-#define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__)
-#define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__);
-#else
-#define Q_XCB_CALL(x) x
-#define Q_XCB_CALL2(x, connection) x
-#define Q_XCB_NOOP(c) (void)c;
-#endif
-
QT_END_NAMESPACE
#endif
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 6f20ec25e3..58e99ef3de 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -50,19 +50,6 @@
#include <X11/extensions/XInput2.h>
#include <X11/extensions/XI2proto.h>
-struct XInput2TouchDeviceData {
- XIDeviceInfo *xiDeviceInfo = nullptr;
- QTouchDevice *qtTouchDevice = nullptr;
- QHash<int, QWindowSystemInterface::TouchPoint> touchPoints;
- QHash<int, QPointF> pointPressedPosition; // in screen coordinates where each point was pressed
-
- // Stuff that is relevant only for touchpads
- QPointF firstPressedPosition; // in screen coordinates where the first point was pressed
- QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed
- QSizeF size; // device size in mm
- bool providesTouchOrientation = false;
-};
-
void QXcbConnection::initializeXInput2()
{
// TODO Qt 6 (or perhaps earlier): remove these redundant env variables
@@ -70,30 +57,37 @@ void QXcbConnection::initializeXInput2()
const_cast<QLoggingCategory&>(lcQpaXInput()).setEnabled(QtDebugMsg, true);
if (qEnvironmentVariableIsSet("QT_XCB_DEBUG_XINPUT_DEVICES"))
const_cast<QLoggingCategory&>(lcQpaXInputDevices()).setEnabled(QtDebugMsg, true);
+
Display *xDisplay = static_cast<Display *>(m_xlib_display);
if (XQueryExtension(xDisplay, "XInputExtension", &m_xiOpCode, &m_xiEventBase, &m_xiErrorBase)) {
int xiMajor = 2;
- // try 2.2 first, needed for TouchBegin/Update/End
- if (XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor) == BadRequest) {
- m_xi2Minor = 1; // for smooth scrolling 2.1 is enough
- if (XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor) == BadRequest) {
- m_xi2Minor = 0; // for tablet support 2.0 is enough
- m_xi2Enabled = XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor) != BadRequest;
- } else
- m_xi2Enabled = true;
- } else
- m_xi2Enabled = true;
- if (m_xi2Enabled) {
-#ifdef XCB_USE_XINPUT22
- qCDebug(lcQpaXInputDevices, "XInput version %d.%d is available and Qt supports 2.2 or greater", xiMajor, m_xi2Minor);
- m_startSystemResizeInfo.window = XCB_NONE;
+#if defined(XCB_USE_XINPUT22)
+ m_xi2Minor = 2; // for touch support 2.2 is enough
+#elif defined(XCB_USE_XINPUT21)
+ m_xi2Minor = 1; // for smooth scrolling 2.1 is enough
#else
- qCDebug(lcQpaXInputDevices, "XInput version %d.%d is available and Qt supports 2.0", xiMajor, m_xi2Minor);
+ m_xi2Minor = 0; // for tablet support 2.0 is enough
#endif
+ qCDebug(lcQpaXInput, "Plugin build with support for XInput 2 version up "
+ "to %d.%d", xiMajor, m_xi2Minor);
+
+ switch (XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor)) {
+ case Success:
+ // Server's supported version can be lower than the version we have
+ // announced to support. In this case Qt client will be limited by
+ // X server's supported version.
+ qCDebug(lcQpaXInput, "Using XInput version %d.%d", xiMajor, m_xi2Minor);
+ m_xi2Enabled = true;
+ xi2SetupDevices();
xi2SelectStateEvents();
+ break;
+ case BadRequest: // Must be an X server with XInput 1
+ qCDebug(lcQpaXInput, "X server does not support XInput 2");
+ break;
+ default: // BadValue
+ qCDebug(lcQpaXInput, "Internal error");
+ break;
}
-
- xi2SetupDevices();
}
}
@@ -113,377 +107,434 @@ void QXcbConnection::xi2SelectStateEvents()
XISelectEvents(dpy, DefaultRootWindow(dpy), &xiEventMask, 1);
}
-void QXcbConnection::xi2SetupDevices()
+void QXcbConnection::xi2SelectDeviceEvents(xcb_window_t window)
{
-#if QT_CONFIG(tabletevent)
- m_tabletData.clear();
+ if (window == rootWindow())
+ return;
+
+ unsigned int bitMask = 0;
+ unsigned char *xiBitMask = reinterpret_cast<unsigned char *>(&bitMask);
+ bitMask |= XI_ButtonPressMask;
+ bitMask |= XI_ButtonReleaseMask;
+ bitMask |= XI_MotionMask;
+ // There is a check for enter/leave events in plain xcb enter/leave event handler,
+ // core enter/leave events will be ignored in this case.
+ bitMask |= XI_EnterMask;
+ bitMask |= XI_LeaveMask;
+ bitMask |= XI_PropertyEventMask;
+#ifdef XCB_USE_XINPUT22
+ if (isAtLeastXI22()) {
+ bitMask |= XI_TouchBeginMask;
+ bitMask |= XI_TouchUpdateMask;
+ bitMask |= XI_TouchEndMask;
+ }
#endif
- m_scrollingDevices.clear();
- if (!m_xi2Enabled)
- return;
+ XIEventMask mask;
+ mask.mask_len = sizeof(bitMask);
+ mask.mask = xiBitMask;
+ mask.deviceid = XIAllMasterDevices;
+ Display *dpy = static_cast<Display *>(m_xlib_display);
+ Status result = XISelectEvents(dpy, window, &mask, 1);
+ if (result == Success)
+ QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
+ else
+ qCDebug(lcQpaXInput, "failed to select events, window %x, result %d", window, result);
+}
- Display *xDisplay = static_cast<Display *>(m_xlib_display);
- int deviceCount = 0;
- XIDeviceInfo *devices = XIQueryDevice(xDisplay, XIAllDevices, &deviceCount);
- for (int i = 0; i < deviceCount; ++i) {
- // Only non-master pointing devices are relevant here.
- if (devices[i].use != XISlavePointer)
- continue;
- qCDebug(lcQpaXInputDevices) << "input device " << devices[i].name << "ID" << devices[i].deviceid;
+void QXcbConnection::xi2SetupDevice(void *info, bool removeExisting)
+{
+ XIDeviceInfo *deviceInfo = reinterpret_cast<XIDeviceInfo *>(info);
+ if (removeExisting) {
#if QT_CONFIG(tabletevent)
- TabletData tabletData;
+ for (int i = 0; i < m_tabletData.count(); ++i) {
+ if (m_tabletData.at(i).deviceId == deviceInfo->deviceid) {
+ m_tabletData.remove(i);
+ break;
+ }
+ }
#endif
- ScrollingDevice scrollingDevice;
- for (int c = 0; c < devices[i].num_classes; ++c) {
- switch (devices[i].classes[c]->type) {
- case XIValuatorClass: {
- XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(devices[i].classes[c]);
- const int valuatorAtom = qatom(vci->label);
- qCDebug(lcQpaXInputDevices) << " has valuator" << atomName(vci->label) << "recognized?" << (valuatorAtom < QXcbAtom::NAtoms);
+ m_scrollingDevices.remove(deviceInfo->deviceid);
+ m_touchDevices.remove(deviceInfo->deviceid);
+ }
+
+ qCDebug(lcQpaXInputDevices) << "input device " << deviceInfo->name << "ID" << deviceInfo->deviceid;
#if QT_CONFIG(tabletevent)
- if (valuatorAtom < QXcbAtom::NAtoms) {
- TabletData::ValuatorClassInfo info;
- info.minVal = vci->min;
- info.maxVal = vci->max;
- info.number = vci->number;
- tabletData.valuatorInfo[valuatorAtom] = info;
- }
-#endif // QT_CONFIG(tabletevent)
- if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
- scrollingDevice.lastScrollPosition.setX(vci->value);
- else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel)
- scrollingDevice.lastScrollPosition.setY(vci->value);
- break;
+ TabletData tabletData;
+#endif
+ ScrollingDevice scrollingDevice;
+ for (int c = 0; c < deviceInfo->num_classes; ++c) {
+ XIAnyClassInfo *classinfo = deviceInfo->classes[c];
+ switch (classinfo->type) {
+ case XIValuatorClass: {
+ XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classinfo);
+ const int valuatorAtom = qatom(vci->label);
+ qCDebug(lcQpaXInputDevices) << " has valuator" << atomName(vci->label) << "recognized?" << (valuatorAtom < QXcbAtom::NAtoms);
+#if QT_CONFIG(tabletevent)
+ if (valuatorAtom < QXcbAtom::NAtoms) {
+ TabletData::ValuatorClassInfo info;
+ info.minVal = vci->min;
+ info.maxVal = vci->max;
+ info.number = vci->number;
+ tabletData.valuatorInfo[valuatorAtom] = info;
}
+#endif // QT_CONFIG(tabletevent)
+ if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
+ scrollingDevice.lastScrollPosition.setX(vci->value);
+ else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel)
+ scrollingDevice.lastScrollPosition.setY(vci->value);
+ break;
+ }
#ifdef XCB_USE_XINPUT21
- case XIScrollClass: {
- XIScrollClassInfo *sci = reinterpret_cast<XIScrollClassInfo *>(devices[i].classes[c]);
- if (sci->scroll_type == XIScrollTypeVertical) {
- scrollingDevice.orientations |= Qt::Vertical;
- scrollingDevice.verticalIndex = sci->number;
- scrollingDevice.verticalIncrement = sci->increment;
- }
- else if (sci->scroll_type == XIScrollTypeHorizontal) {
- scrollingDevice.orientations |= Qt::Horizontal;
- scrollingDevice.horizontalIndex = sci->number;
- scrollingDevice.horizontalIncrement = sci->increment;
- }
- break;
+ case XIScrollClass: {
+ XIScrollClassInfo *sci = reinterpret_cast<XIScrollClassInfo *>(classinfo);
+ if (sci->scroll_type == XIScrollTypeVertical) {
+ scrollingDevice.orientations |= Qt::Vertical;
+ scrollingDevice.verticalIndex = sci->number;
+ scrollingDevice.verticalIncrement = sci->increment;
}
- case XIButtonClass: {
- XIButtonClassInfo *bci = reinterpret_cast<XIButtonClassInfo *>(devices[i].classes[c]);
- if (bci->num_buttons >= 5) {
- Atom label4 = bci->labels[3];
- Atom label5 = bci->labels[4];
- // Some drivers have no labels on the wheel buttons, some have no label on just one and some have no label on
- // button 4 and the wrong one on button 5. So we just check that they are not labelled with unrelated buttons.
- if ((!label4 || qatom(label4) == QXcbAtom::ButtonWheelUp || qatom(label4) == QXcbAtom::ButtonWheelDown) &&
- (!label5 || qatom(label5) == QXcbAtom::ButtonWheelUp || qatom(label5) == QXcbAtom::ButtonWheelDown))
- scrollingDevice.legacyOrientations |= Qt::Vertical;
- }
- if (bci->num_buttons >= 7) {
- Atom label6 = bci->labels[5];
- Atom label7 = bci->labels[6];
- if ((!label6 || qatom(label6) == QXcbAtom::ButtonHorizWheelLeft) && (!label7 || qatom(label7) == QXcbAtom::ButtonHorizWheelRight))
- scrollingDevice.legacyOrientations |= Qt::Horizontal;
- }
- qCDebug(lcQpaXInputDevices, " has %d buttons", bci->num_buttons);
- break;
+ else if (sci->scroll_type == XIScrollTypeHorizontal) {
+ scrollingDevice.orientations |= Qt::Horizontal;
+ scrollingDevice.horizontalIndex = sci->number;
+ scrollingDevice.horizontalIncrement = sci->increment;
+ }
+ break;
+ }
+ case XIButtonClass: {
+ XIButtonClassInfo *bci = reinterpret_cast<XIButtonClassInfo *>(classinfo);
+ if (bci->num_buttons >= 5) {
+ Atom label4 = bci->labels[3];
+ Atom label5 = bci->labels[4];
+ // Some drivers have no labels on the wheel buttons, some have no label on just one and some have no label on
+ // button 4 and the wrong one on button 5. So we just check that they are not labelled with unrelated buttons.
+ if ((!label4 || qatom(label4) == QXcbAtom::ButtonWheelUp || qatom(label4) == QXcbAtom::ButtonWheelDown) &&
+ (!label5 || qatom(label5) == QXcbAtom::ButtonWheelUp || qatom(label5) == QXcbAtom::ButtonWheelDown))
+ scrollingDevice.legacyOrientations |= Qt::Vertical;
}
+ if (bci->num_buttons >= 7) {
+ Atom label6 = bci->labels[5];
+ Atom label7 = bci->labels[6];
+ if ((!label6 || qatom(label6) == QXcbAtom::ButtonHorizWheelLeft) && (!label7 || qatom(label7) == QXcbAtom::ButtonHorizWheelRight))
+ scrollingDevice.legacyOrientations |= Qt::Horizontal;
+ }
+ qCDebug(lcQpaXInputDevices, " has %d buttons", bci->num_buttons);
+ break;
+ }
#endif
- case XIKeyClass:
- qCDebug(lcQpaXInputDevices) << " it's a keyboard";
- break;
+ case XIKeyClass:
+ qCDebug(lcQpaXInputDevices) << " it's a keyboard";
+ break;
#ifdef XCB_USE_XINPUT22
- case XITouchClass:
- // will be handled in deviceForId()
- break;
+ case XITouchClass:
+ // will be handled in populateTouchDevices()
+ break;
#endif
- default:
- qCDebug(lcQpaXInputDevices) << " has class" << devices[i].classes[c]->type;
- break;
- }
+ default:
+ qCDebug(lcQpaXInputDevices) << " has class" << classinfo->type;
+ break;
}
- bool isTablet = false;
+ }
+ bool isTablet = false;
#if QT_CONFIG(tabletevent)
- // If we have found the valuators which we expect a tablet to have, it might be a tablet.
- if (tabletData.valuatorInfo.contains(QXcbAtom::AbsX) &&
- tabletData.valuatorInfo.contains(QXcbAtom::AbsY) &&
- tabletData.valuatorInfo.contains(QXcbAtom::AbsPressure))
- isTablet = true;
-
- // But we need to be careful not to take the touch and tablet-button devices as tablets.
- QByteArray name = QByteArray(devices[i].name).toLower();
- QString dbgType = QLatin1String("UNKNOWN");
- if (name.contains("eraser")) {
- isTablet = true;
- tabletData.pointerType = QTabletEvent::Eraser;
- dbgType = QLatin1String("eraser");
- } else if (name.contains("cursor")) {
- isTablet = true;
- tabletData.pointerType = QTabletEvent::Cursor;
- dbgType = QLatin1String("cursor");
- } else if (name.contains("wacom") && name.contains("finger touch")) {
- isTablet = false;
- } else if ((name.contains("pen") || name.contains("stylus")) && isTablet) {
- tabletData.pointerType = QTabletEvent::Pen;
- dbgType = QLatin1String("pen");
- } else if (name.contains("wacom") && isTablet && !name.contains("touch")) {
- // combined device (evdev) rather than separate pen/eraser (wacom driver)
- tabletData.pointerType = QTabletEvent::Pen;
- dbgType = QLatin1String("pen");
- } else if (name.contains("aiptek") /* && device == QXcbAtom::KEYBOARD */) {
- // some "Genius" tablets
- isTablet = true;
- tabletData.pointerType = QTabletEvent::Pen;
- dbgType = QLatin1String("pen");
- } else if (name.contains("waltop") && name.contains("tablet")) {
- // other "Genius" tablets
- // WALTOP International Corp. Slim Tablet
- isTablet = true;
- tabletData.pointerType = QTabletEvent::Pen;
- dbgType = QLatin1String("pen");
- } else if (name.contains("uc-logic") && isTablet) {
- tabletData.pointerType = QTabletEvent::Pen;
- dbgType = QLatin1String("pen");
- } else {
- isTablet = false;
- }
+ // If we have found the valuators which we expect a tablet to have, it might be a tablet.
+ if (tabletData.valuatorInfo.contains(QXcbAtom::AbsX) &&
+ tabletData.valuatorInfo.contains(QXcbAtom::AbsY) &&
+ tabletData.valuatorInfo.contains(QXcbAtom::AbsPressure))
+ isTablet = true;
+
+ // But we need to be careful not to take the touch and tablet-button devices as tablets.
+ QByteArray name = QByteArray(deviceInfo->name).toLower();
+ QString dbgType = QLatin1String("UNKNOWN");
+ if (name.contains("eraser")) {
+ isTablet = true;
+ tabletData.pointerType = QTabletEvent::Eraser;
+ dbgType = QLatin1String("eraser");
+ } else if (name.contains("cursor")) {
+ isTablet = true;
+ tabletData.pointerType = QTabletEvent::Cursor;
+ dbgType = QLatin1String("cursor");
+ } else if (name.contains("wacom") && name.contains("finger touch")) {
+ isTablet = false;
+ } else if ((name.contains("pen") || name.contains("stylus")) && isTablet) {
+ tabletData.pointerType = QTabletEvent::Pen;
+ dbgType = QLatin1String("pen");
+ } else if (name.contains("wacom") && isTablet && !name.contains("touch")) {
+ // combined device (evdev) rather than separate pen/eraser (wacom driver)
+ tabletData.pointerType = QTabletEvent::Pen;
+ dbgType = QLatin1String("pen");
+ } else if (name.contains("aiptek") /* && device == QXcbAtom::KEYBOARD */) {
+ // some "Genius" tablets
+ isTablet = true;
+ tabletData.pointerType = QTabletEvent::Pen;
+ dbgType = QLatin1String("pen");
+ } else if (name.contains("waltop") && name.contains("tablet")) {
+ // other "Genius" tablets
+ // WALTOP International Corp. Slim Tablet
+ isTablet = true;
+ tabletData.pointerType = QTabletEvent::Pen;
+ dbgType = QLatin1String("pen");
+ } else if (name.contains("uc-logic") && isTablet) {
+ tabletData.pointerType = QTabletEvent::Pen;
+ dbgType = QLatin1String("pen");
+ } else {
+ isTablet = false;
+ }
- if (isTablet) {
- tabletData.deviceId = devices[i].deviceid;
- m_tabletData.append(tabletData);
- qCDebug(lcQpaXInputDevices) << " it's a tablet with pointer type" << dbgType;
- }
+ if (isTablet) {
+ tabletData.deviceId = deviceInfo->deviceid;
+ m_tabletData.append(tabletData);
+ qCDebug(lcQpaXInputDevices) << " it's a tablet with pointer type" << dbgType;
+ }
#endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21
- if (scrollingDevice.orientations || scrollingDevice.legacyOrientations) {
- scrollingDevice.deviceId = devices[i].deviceid;
- // Only use legacy wheel button events when we don't have real scroll valuators.
- scrollingDevice.legacyOrientations &= ~scrollingDevice.orientations;
- m_scrollingDevices.insert(scrollingDevice.deviceId, scrollingDevice);
- qCDebug(lcQpaXInputDevices) << " it's a scrolling device";
- }
+ if (scrollingDevice.orientations || scrollingDevice.legacyOrientations) {
+ scrollingDevice.deviceId = deviceInfo->deviceid;
+ // Only use legacy wheel button events when we don't have real scroll valuators.
+ scrollingDevice.legacyOrientations &= ~scrollingDevice.orientations;
+ m_scrollingDevices.insert(scrollingDevice.deviceId, scrollingDevice);
+ qCDebug(lcQpaXInputDevices) << " it's a scrolling device";
+ }
#endif
- if (!isTablet) {
- // touchDeviceForId populates XInput2DeviceData the first time it is called
- // with a new deviceId. On subsequent calls it will return the cached object.
- XInput2TouchDeviceData *dev = touchDeviceForId(devices[i].deviceid);
- if (dev && lcQpaXInputDevices().isDebugEnabled()) {
- if (dev->qtTouchDevice->type() == QTouchDevice::TouchScreen)
- qCDebug(lcQpaXInputDevices, " it's a touchscreen with type %d capabilities 0x%X max touch points %d",
- dev->qtTouchDevice->type(), (unsigned int)dev->qtTouchDevice->capabilities(),
- dev->qtTouchDevice->maximumTouchPoints());
- else if (dev->qtTouchDevice->type() == QTouchDevice::TouchPad)
- qCDebug(lcQpaXInputDevices, " it's a touchpad with type %d capabilities 0x%X max touch points %d size %f x %f",
- dev->qtTouchDevice->type(), (unsigned int)dev->qtTouchDevice->capabilities(),
- dev->qtTouchDevice->maximumTouchPoints(),
- dev->size.width(), dev->size.height());
- }
+ if (!isTablet) {
+ TouchDeviceData *dev = populateTouchDevices(deviceInfo);
+ if (dev && lcQpaXInputDevices().isDebugEnabled()) {
+ if (dev->qtTouchDevice->type() == QTouchDevice::TouchScreen)
+ qCDebug(lcQpaXInputDevices, " it's a touchscreen with type %d capabilities 0x%X max touch points %d",
+ dev->qtTouchDevice->type(), (unsigned int)dev->qtTouchDevice->capabilities(),
+ dev->qtTouchDevice->maximumTouchPoints());
+ else if (dev->qtTouchDevice->type() == QTouchDevice::TouchPad)
+ qCDebug(lcQpaXInputDevices, " it's a touchpad with type %d capabilities 0x%X max touch points %d size %f x %f",
+ dev->qtTouchDevice->type(), (unsigned int)dev->qtTouchDevice->capabilities(),
+ dev->qtTouchDevice->maximumTouchPoints(),
+ dev->size.width(), dev->size.height());
}
}
- XIFreeDeviceInfo(devices);
+
}
-void QXcbConnection::finalizeXInput2()
+void QXcbConnection::xi2SetupDevices()
{
- for (XInput2TouchDeviceData *dev : qAsConst(m_touchDevices)) {
- if (dev->xiDeviceInfo)
- XIFreeDeviceInfo(dev->xiDeviceInfo);
- delete dev;
+#if QT_CONFIG(tabletevent)
+ m_tabletData.clear();
+#endif
+ m_scrollingDevices.clear();
+ m_touchDevices.clear();
+
+ Display *xDisplay = static_cast<Display *>(m_xlib_display);
+ int deviceCount = 0;
+ XIDeviceInfo *devices = XIQueryDevice(xDisplay, XIAllDevices, &deviceCount);
+ for (int i = 0; i < deviceCount; ++i) {
+ // Only non-master pointing devices are relevant here.
+ if (devices[i].use != XISlavePointer)
+ continue;
+ xi2SetupDevice(&devices[i], false);
}
+ XIFreeDeviceInfo(devices);
}
-void QXcbConnection::xi2Select(xcb_window_t window)
+/*! \internal
+
+ Notes on QT_XCB_NO_XI2_MOUSE Handling:
+
+ Here we don't select pointer button press/release and motion events on master devices, instead
+ we select these events directly on slave devices. This means that a master device will fallback
+ to sending core events for every XI_* event that is sent directly by a slave device. For more
+ details see "Event processing for attached slave devices" in XInput2 specification. To prevent
+ handling of the same event twice, we have checks for xi2MouseEventsDisabled() in XI2 event
+ handlers (but this is somewhat inconsistent in some situations). If the purpose for
+ QT_XCB_NO_XI2_MOUSE was so that an application using QAbstractNativeEventFilter would see core
+ mouse events before they are handled by Qt then QT_XCB_NO_XI2_MOUSE won't always work as
+ expected (e.g. we handle scroll event directly from a slave device event, before an application
+ has seen the fallback core event from a master device).
+
+ The commit introducing QT_XCB_NO_XI2_MOUSE also states that setting this envvar "restores the
+ old behavior with broken grabbing". It did not elaborate why grabbing was not fixed for this
+ code path. The issue that this envvar tries to solve seem to be less important than broken
+ grabbing (broken apparently only for touch events). Thus, if you really want core mouse events
+ in your application and do not care about broken touch, then use QT_XCB_NO_XI2 (more on this
+ below) to disable the extension all together. The reason why grabbing might have not been fixed
+ is that calling XIGrabDevice with this code path for some reason always returns AlreadyGrabbed
+ (by debugging X server's code it appears that when we call XIGrabDevice, an X server first grabs
+ pointer via core pointer and then fails to do XI2 grab with AlreadyGrabbed; disclaimer - I did
+ not debug this in great detail). When we try supporting odd setups like QT_XCB_NO_XI2_MOUSE, we
+ are asking for trouble anyways.
+
+ In conclusion, introduction of QT_XCB_NO_XI2_MOUSE causes more issues than solves - the above
+ mentioned inconsistencies, maintenance of this code path and that QT_XCB_NO_XI2_MOUSE replaces
+ less important issue with somewhat more important issue. It also makes us to use less optimal
+ code paths in certain situations (see xi2HandleHierarchyEvent). Using of QT_XCB_NO_XI2 has its
+ drawbacks too - no tablet and touch events. So the only real fix in this case is at an
+ application side (teach the application about xcb_ge_event_t events). Based on this,
+ QT_XCB_NO_XI2_MOUSE will be removed in ### Qt 6. It should not have existed in the first place,
+ native events seen by QAbstractNativeEventFilter is not really a public API, applications should
+ expect changes at this level and do ifdefs if something changes between Qt version.
+*/
+void QXcbConnection::xi2SelectDeviceEventsCompatibility(xcb_window_t window)
{
- if (!m_xi2Enabled || window == rootWindow())
+ if (window == rootWindow())
return;
- Display *xDisplay = static_cast<Display *>(m_xlib_display);
- unsigned int bitMask = 0;
- unsigned char *xiBitMask = reinterpret_cast<unsigned char *>(&bitMask);
-
+ unsigned int mask = 0;
+ unsigned char *bitMask = reinterpret_cast<unsigned char *>(&mask);
+ mask |= XI_PropertyEventMask;
#ifdef XCB_USE_XINPUT22
if (isAtLeastXI22()) {
- bitMask |= XI_TouchBeginMask;
- bitMask |= XI_TouchUpdateMask;
- bitMask |= XI_TouchEndMask;
- bitMask |= XI_PropertyEventMask; // for tablets
- if (xi2MouseEvents()) {
- // We want both mouse and touch through XI2 if touch is supported (>= 2.2).
- // The plain xcb press and motion events will not be delivered after this.
- bitMask |= XI_ButtonPressMask;
- bitMask |= XI_ButtonReleaseMask;
- bitMask |= XI_MotionMask;
-
- // There is a check for enter/leave events in plain xcb enter/leave event handler
- bitMask |= XI_EnterMask;
- bitMask |= XI_LeaveMask;
-
- qCDebug(lcQpaXInput, "XInput 2.2: Selecting press/release/motion events in addition to touch");
- }
- XIEventMask mask;
- mask.mask_len = sizeof(bitMask);
- mask.mask = xiBitMask;
- // When xi2MouseEvents() is true (the default), pointer emulation for touch and tablet
- // events will get disabled. This is preferable, as Qt Quick handles touch events
- // directly, while for other applications QtGui synthesizes mouse events.
- mask.deviceid = XIAllMasterDevices;
- Status result = XISelectEvents(xDisplay, window, &mask, 1);
- if (result == Success)
- QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
- else
- qCDebug(lcQpaXInput, "XInput 2.2: failed to select pointer/touch events, window %x, result %d", window, result);
+ mask |= XI_TouchBeginMask;
+ mask |= XI_TouchUpdateMask;
+ mask |= XI_TouchEndMask;
}
+#endif
+ XIEventMask xiMask;
+ xiMask.mask_len = sizeof(mask);
+ xiMask.mask = bitMask;
+ xiMask.deviceid = XIAllMasterDevices;
+ Display *dpy = static_cast<Display *>(m_xlib_display);
+ Status result = XISelectEvents(dpy, window, &xiMask, 1);
+ if (result == Success)
+ QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
+ else
+ qCDebug(lcQpaXInput, "failed to select events, window %x, result %d", window, result);
- const bool pointerSelected = isAtLeastXI22() && xi2MouseEvents();
-#else
- const bool pointerSelected = false;
-#endif // XCB_USE_XINPUT22
+ mask = XI_ButtonPressMask;
+ mask |= XI_ButtonReleaseMask;
+ mask |= XI_MotionMask;
- QSet<int> tabletDevices;
#if QT_CONFIG(tabletevent)
+ QSet<int> tabletDevices;
if (!m_tabletData.isEmpty()) {
- unsigned int tabletBitMask;
- unsigned char *xiTabletBitMask = reinterpret_cast<unsigned char *>(&tabletBitMask);
- QVector<XIEventMask> xiEventMask(m_tabletData.count());
- tabletBitMask = XI_PropertyEventMask;
- if (!pointerSelected)
- tabletBitMask |= XI_ButtonPressMask | XI_ButtonReleaseMask | XI_MotionMask;
- for (int i = 0; i < m_tabletData.count(); ++i) {
+ const int nrTablets = m_tabletData.count();
+ QVector<XIEventMask> xiEventMask(nrTablets);
+ for (int i = 0; i < nrTablets; ++i) {
int deviceId = m_tabletData.at(i).deviceId;
tabletDevices.insert(deviceId);
xiEventMask[i].deviceid = deviceId;
- xiEventMask[i].mask_len = sizeof(tabletBitMask);
- xiEventMask[i].mask = xiTabletBitMask;
+ xiEventMask[i].mask_len = sizeof(mask);
+ xiEventMask[i].mask = bitMask;
}
- XISelectEvents(xDisplay, window, xiEventMask.data(), m_tabletData.count());
+ XISelectEvents(dpy, window, xiEventMask.data(), nrTablets);
}
-#endif // QT_CONFIG(tabletevent)
+#endif
#ifdef XCB_USE_XINPUT21
- // Enable each scroll device
- if (!m_scrollingDevices.isEmpty() && !pointerSelected) {
- // Only when XI2 mouse events are not enabled, otherwise motion and release are selected already.
+ if (!m_scrollingDevices.isEmpty()) {
QVector<XIEventMask> xiEventMask(m_scrollingDevices.size());
- unsigned int scrollBitMask;
- unsigned char *xiScrollBitMask = reinterpret_cast<unsigned char *>(&scrollBitMask);
-
- scrollBitMask = XI_MotionMask;
- scrollBitMask |= XI_ButtonReleaseMask;
- int i=0;
+ int i = 0;
for (const ScrollingDevice& scrollingDevice : qAsConst(m_scrollingDevices)) {
+#if QT_CONFIG(tabletevent)
if (tabletDevices.contains(scrollingDevice.deviceId))
continue; // All necessary events are already captured.
+#endif
xiEventMask[i].deviceid = scrollingDevice.deviceId;
- xiEventMask[i].mask_len = sizeof(scrollBitMask);
- xiEventMask[i].mask = xiScrollBitMask;
+ xiEventMask[i].mask_len = sizeof(mask);
+ xiEventMask[i].mask = bitMask;
i++;
}
- XISelectEvents(xDisplay, window, xiEventMask.data(), i);
+ XISelectEvents(dpy, window, xiEventMask.data(), i);
}
-#else
- Q_UNUSED(xiBitMask);
#endif
}
-XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
+QXcbConnection::TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
{
- XInput2TouchDeviceData *dev = Q_NULLPTR;
- QHash<int, XInput2TouchDeviceData*>::const_iterator devIt = m_touchDevices.constFind(id);
- if (devIt != m_touchDevices.cend()) {
- dev = devIt.value();
- } else {
- int nrDevices = 0;
- QTouchDevice::Capabilities caps = 0;
- dev = new XInput2TouchDeviceData;
- dev->xiDeviceInfo = XIQueryDevice(static_cast<Display *>(m_xlib_display), id, &nrDevices);
- if (nrDevices <= 0) {
- delete dev;
- return 0;
- }
- int type = -1;
- int maxTouchPoints = 1;
- bool hasRelativeCoords = false;
- for (int i = 0; i < dev->xiDeviceInfo->num_classes; ++i) {
- XIAnyClassInfo *classinfo = dev->xiDeviceInfo->classes[i];
- switch (classinfo->type) {
+ TouchDeviceData *dev = nullptr;
+ if (m_touchDevices.contains(id))
+ dev = &m_touchDevices[id];
+ return dev;
+}
+
+QXcbConnection::TouchDeviceData *QXcbConnection::populateTouchDevices(void *info)
+{
+ XIDeviceInfo *deviceinfo = reinterpret_cast<XIDeviceInfo *>(info);
+ QTouchDevice::Capabilities caps = 0;
+ int type = -1;
+ int maxTouchPoints = 1;
+ bool isTouchDevice = false;
+ bool hasRelativeCoords = false;
+ TouchDeviceData dev;
+ for (int i = 0; i < deviceinfo->num_classes; ++i) {
+ XIAnyClassInfo *classinfo = deviceinfo->classes[i];
+ switch (classinfo->type) {
#ifdef XCB_USE_XINPUT22
- case XITouchClass: {
- XITouchClassInfo *tci = reinterpret_cast<XITouchClassInfo *>(classinfo);
- maxTouchPoints = tci->num_touches;
- qCDebug(lcQpaXInputDevices, " has touch class with mode %d", tci->mode);
- switch (tci->mode) {
- case XIDependentTouch:
- type = QTouchDevice::TouchPad;
- break;
- case XIDirectTouch:
- type = QTouchDevice::TouchScreen;
- break;
- }
+ case XITouchClass: {
+ XITouchClassInfo *tci = reinterpret_cast<XITouchClassInfo *>(classinfo);
+ maxTouchPoints = tci->num_touches;
+ qCDebug(lcQpaXInputDevices, " has touch class with mode %d", tci->mode);
+ switch (tci->mode) {
+ case XIDependentTouch:
+ type = QTouchDevice::TouchPad;
+ break;
+ case XIDirectTouch:
+ type = QTouchDevice::TouchScreen;
break;
}
+ break;
+ }
#endif // XCB_USE_XINPUT22
- case XIValuatorClass: {
- XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classinfo);
- // Some devices (mice) report a resolution of 0; they will be excluded later,
- // for now just prevent a division by zero
- const int vciResolution = vci->resolution ? vci->resolution : 1;
- if (vci->label == atom(QXcbAtom::AbsMTPositionX))
- caps |= QTouchDevice::Position | QTouchDevice::NormalizedPosition;
- else if (vci->label == atom(QXcbAtom::AbsMTTouchMajor))
- caps |= QTouchDevice::Area;
- else if (vci->label == atom(QXcbAtom::AbsMTOrientation))
- dev->providesTouchOrientation = true;
- else if (vci->label == atom(QXcbAtom::AbsMTPressure) || vci->label == atom(QXcbAtom::AbsPressure))
- caps |= QTouchDevice::Pressure;
- else if (vci->label == atom(QXcbAtom::RelX)) {
- hasRelativeCoords = true;
- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution);
- } else if (vci->label == atom(QXcbAtom::RelY)) {
- hasRelativeCoords = true;
- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution);
- } else if (vci->label == atom(QXcbAtom::AbsX)) {
- caps |= QTouchDevice::Position;
- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution);
- } else if (vci->label == atom(QXcbAtom::AbsY)) {
- caps |= QTouchDevice::Position;
- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution);
- }
- break;
+ case XIValuatorClass: {
+ XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classinfo);
+ const QXcbAtom::Atom valuatorAtom = qatom(vci->label);
+ if (valuatorAtom < QXcbAtom::NAtoms) {
+ TouchDeviceData::ValuatorClassInfo info;
+ info.min = vci->min;
+ info.max = vci->max;
+ info.number = vci->number;
+ info.label = valuatorAtom;
+ dev.valuatorInfo.append(info);
}
- default:
- break;
+ // Some devices (mice) report a resolution of 0; they will be excluded later,
+ // for now just prevent a division by zero
+ const int vciResolution = vci->resolution ? vci->resolution : 1;
+ if (valuatorAtom == QXcbAtom::AbsMTPositionX)
+ caps |= QTouchDevice::Position | QTouchDevice::NormalizedPosition;
+ else if (valuatorAtom == QXcbAtom::AbsMTTouchMajor)
+ caps |= QTouchDevice::Area;
+ else if (valuatorAtom == QXcbAtom::AbsMTOrientation)
+ dev.providesTouchOrientation = true;
+ else if (valuatorAtom == QXcbAtom::AbsMTPressure || valuatorAtom == QXcbAtom::AbsPressure)
+ caps |= QTouchDevice::Pressure;
+ else if (valuatorAtom == QXcbAtom::RelX) {
+ hasRelativeCoords = true;
+ dev.size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution);
+ } else if (valuatorAtom == QXcbAtom::RelY) {
+ hasRelativeCoords = true;
+ dev.size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution);
+ } else if (valuatorAtom == QXcbAtom::AbsX) {
+ caps |= QTouchDevice::Position;
+ dev.size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution);
+ } else if (valuatorAtom == QXcbAtom::AbsY) {
+ caps |= QTouchDevice::Position;
+ dev.size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution);
}
+ break;
}
- if (type < 0 && caps && hasRelativeCoords) {
- type = QTouchDevice::TouchPad;
- if (dev->size.width() < 10 || dev->size.height() < 10 ||
- dev->size.width() > 10000 || dev->size.height() > 10000)
- dev->size = QSizeF(130, 110);
- }
- if (!isAtLeastXI22() || type == QTouchDevice::TouchPad)
- caps |= QTouchDevice::MouseEmulation;
-
- if (type >= QTouchDevice::TouchScreen && type <= QTouchDevice::TouchPad) {
- dev->qtTouchDevice = new QTouchDevice;
- dev->qtTouchDevice->setName(QString::fromUtf8(dev->xiDeviceInfo->name));
- dev->qtTouchDevice->setType((QTouchDevice::DeviceType)type);
- dev->qtTouchDevice->setCapabilities(caps);
- dev->qtTouchDevice->setMaximumTouchPoints(maxTouchPoints);
- if (caps != 0)
- QWindowSystemInterface::registerTouchDevice(dev->qtTouchDevice);
- m_touchDevices[id] = dev;
- } else {
- XIFreeDeviceInfo(dev->xiDeviceInfo);
- delete dev;
- dev = 0;
+ default:
+ break;
}
}
- return dev;
+ if (type < 0 && caps && hasRelativeCoords) {
+ type = QTouchDevice::TouchPad;
+ if (dev.size.width() < 10 || dev.size.height() < 10 ||
+ dev.size.width() > 10000 || dev.size.height() > 10000)
+ dev.size = QSizeF(130, 110);
+ }
+ if (!isAtLeastXI22() || type == QTouchDevice::TouchPad)
+ caps |= QTouchDevice::MouseEmulation;
+
+ if (type >= QTouchDevice::TouchScreen && type <= QTouchDevice::TouchPad) {
+ dev.qtTouchDevice = new QTouchDevice;
+ dev.qtTouchDevice->setName(QString::fromUtf8(deviceinfo->name));
+ dev.qtTouchDevice->setType((QTouchDevice::DeviceType)type);
+ dev.qtTouchDevice->setCapabilities(caps);
+ dev.qtTouchDevice->setMaximumTouchPoints(maxTouchPoints);
+ if (caps != 0)
+ QWindowSystemInterface::registerTouchDevice(dev.qtTouchDevice);
+ m_touchDevices[deviceinfo->deviceid] = dev;
+ isTouchDevice = true;
+ }
+
+ return isTouchDevice ? &m_touchDevices[deviceinfo->deviceid] : nullptr;
}
#if defined(XCB_USE_XINPUT21) || QT_CONFIG(tabletevent)
@@ -525,7 +576,7 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
break;
}
case XI_HierarchyChanged:
- xi2HandleHierachyEvent(xiEvent);
+ xi2HandleHierarchyEvent(xiEvent);
return;
case XI_DeviceChanged:
xi2HandleDeviceChangedEvent(xiEvent);
@@ -549,9 +600,8 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
#endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21
- QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(sourceDeviceId);
- if (device != m_scrollingDevices.end())
- xi2HandleScrollEvent(xiEvent, device.value());
+ if (ScrollingDevice *device = scrollingDeviceForId(sourceDeviceId))
+ xi2HandleScrollEvent(xiEvent, *device);
#endif // XCB_USE_XINPUT21
#ifdef XCB_USE_XINPUT22
@@ -560,7 +610,7 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion:
- if (xi2MouseEvents() && eventListener && !(xiDeviceEvent->flags & XIPointerEmulated))
+ if (!xi2MouseEventsDisabled() && eventListener && !(xiDeviceEvent->flags & XIPointerEmulated))
eventListener->handleXIMouseEvent(event);
break;
@@ -576,7 +626,7 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
xi2ProcessTouch(xiDeviceEvent, platformWindow);
break;
}
- } else if (xiEnterEvent && xi2MouseEvents() && eventListener) {
+ } else if (xiEnterEvent && !xi2MouseEventsDisabled() && eventListener) {
switch (xiEnterEvent->evtype) {
case XI_Enter:
case XI_Leave:
@@ -587,20 +637,25 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
#endif // XCB_USE_XINPUT22
}
+bool QXcbConnection::xi2MouseEventsDisabled() const
+{
+ static bool xi2MouseDisabled = qEnvironmentVariableIsSet("QT_XCB_NO_XI2_MOUSE");
+ // FIXME: Don't use XInput2 mouse events when Xinerama extension
+ // is enabled, because it causes problems with multi-monitor setup.
+ return xi2MouseDisabled || has_xinerama_extension;
+}
+
#ifdef XCB_USE_XINPUT22
-static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci)
+bool QXcbConnection::isTouchScreen(int id)
{
- if (value > vci->max)
- value = vci->max;
- if (value < vci->min)
- value = vci->min;
- return (value - vci->min) / (vci->max - vci->min);
+ auto device = touchDeviceForId(id);
+ return device && device->qtTouchDevice->type() == QTouchDevice::TouchScreen;
}
void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow)
{
xXIDeviceEvent *xiDeviceEvent = static_cast<xXIDeviceEvent *>(xiDevEvent);
- XInput2TouchDeviceData *dev = touchDeviceForId(xiDeviceEvent->sourceid);
+ TouchDeviceData *dev = touchDeviceForId(xiDeviceEvent->sourceid);
Q_ASSERT(dev);
const bool firstTouch = dev->touchPoints.isEmpty();
if (xiDeviceEvent->evtype == XI_TouchBegin) {
@@ -617,53 +672,53 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo
qreal nx = -1.0, ny = -1.0;
qreal w = 0.0, h = 0.0;
bool majorAxisIsY = touchPoint.area.height() > touchPoint.area.width();
- for (int i = 0; i < dev->xiDeviceInfo->num_classes; ++i) {
- XIAnyClassInfo *classinfo = dev->xiDeviceInfo->classes[i];
- if (classinfo->type == XIValuatorClass) {
- XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classinfo);
- int n = vci->number;
- double value;
- if (!xi2GetValuatorValueIfSet(xiDeviceEvent, n, &value))
- continue;
- if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
- qCDebug(lcQpaXInputEvents, " valuator %20s value %lf from range %lf -> %lf",
- atomName(vci->label).constData(), value, vci->min, vci->max );
- if (vci->label == atom(QXcbAtom::RelX)) {
- nx = valuatorNormalized(value, vci);
- } else if (vci->label == atom(QXcbAtom::RelY)) {
- ny = valuatorNormalized(value, vci);
- } else if (vci->label == atom(QXcbAtom::AbsX)) {
- nx = valuatorNormalized(value, vci);
- } else if (vci->label == atom(QXcbAtom::AbsY)) {
- ny = valuatorNormalized(value, vci);
- } else if (vci->label == atom(QXcbAtom::AbsMTPositionX)) {
- nx = valuatorNormalized(value, vci);
- } else if (vci->label == atom(QXcbAtom::AbsMTPositionY)) {
- ny = valuatorNormalized(value, vci);
- } else if (vci->label == atom(QXcbAtom::AbsMTTouchMajor)) {
- const qreal sw = screen->geometry().width();
- const qreal sh = screen->geometry().height();
- w = valuatorNormalized(value, vci) * std::sqrt(sw * sw + sh * sh);
- } else if (vci->label == atom(QXcbAtom::AbsMTTouchMinor)) {
- const qreal sw = screen->geometry().width();
- const qreal sh = screen->geometry().height();
- h = valuatorNormalized(value, vci) * std::sqrt(sw * sw + sh * sh);
- } else if (vci->label == atom(QXcbAtom::AbsMTOrientation)) {
- // Find the closest axis.
- // 0 corresponds to the Y axis, vci->max to the X axis.
- // Flipping over the Y axis and rotating by 180 degrees
- // don't change the result, so normalize value to range
- // [0, vci->max] first.
- value = qAbs(value);
- while (value > vci->max)
- value -= 2 * vci->max;
- value = qAbs(value);
- majorAxisIsY = value < vci->max - value;
- } else if (vci->label == atom(QXcbAtom::AbsMTPressure) ||
- vci->label == atom(QXcbAtom::AbsPressure)) {
- touchPoint.pressure = valuatorNormalized(value, vci);
- }
+ for (const TouchDeviceData::ValuatorClassInfo vci : dev->valuatorInfo) {
+ double value;
+ if (!xi2GetValuatorValueIfSet(xiDeviceEvent, vci.number, &value))
+ continue;
+ if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
+ qCDebug(lcQpaXInputEvents, " valuator %20s value %lf from range %lf -> %lf",
+ atomName(vci.label).constData(), value, vci.min, vci.max);
+ if (value > vci.max)
+ value = vci.max;
+ if (value < vci.min)
+ value = vci.min;
+ qreal valuatorNormalized = (value - vci.min) / (vci.max - vci.min);
+ if (vci.label == QXcbAtom::RelX) {
+ nx = valuatorNormalized;
+ } else if (vci.label == QXcbAtom::RelY) {
+ ny = valuatorNormalized;
+ } else if (vci.label == QXcbAtom::AbsX) {
+ nx = valuatorNormalized;
+ } else if (vci.label == QXcbAtom::AbsY) {
+ ny = valuatorNormalized;
+ } else if (vci.label == QXcbAtom::AbsMTPositionX) {
+ nx = valuatorNormalized;
+ } else if (vci.label == QXcbAtom::AbsMTPositionY) {
+ ny = valuatorNormalized;
+ } else if (vci.label == QXcbAtom::AbsMTTouchMajor) {
+ const qreal sw = screen->geometry().width();
+ const qreal sh = screen->geometry().height();
+ w = valuatorNormalized * std::sqrt(sw * sw + sh * sh);
+ } else if (vci.label == QXcbAtom::AbsMTTouchMinor) {
+ const qreal sw = screen->geometry().width();
+ const qreal sh = screen->geometry().height();
+ h = valuatorNormalized * std::sqrt(sw * sw + sh * sh);
+ } else if (vci.label == QXcbAtom::AbsMTOrientation) {
+ // Find the closest axis.
+ // 0 corresponds to the Y axis, vci.max to the X axis.
+ // Flipping over the Y axis and rotating by 180 degrees
+ // don't change the result, so normalize value to range
+ // [0, vci.max] first.
+ value = qAbs(value);
+ while (value > vci.max)
+ value -= 2 * vci.max;
+ value = qAbs(value);
+ majorAxisIsY = value < vci.max - value;
+ } else if (vci.label == QXcbAtom::AbsMTPressure || vci.label == QXcbAtom::AbsPressure) {
+ touchPoint.pressure = valuatorNormalized;
}
+
}
// If any value was not updated, use the last-known value.
if (nx == -1.0) {
@@ -765,12 +820,12 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo
bool QXcbConnection::startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner)
{
- QHash<int, XInput2TouchDeviceData*>::const_iterator devIt = m_touchDevices.constBegin();
+ QHash<int, TouchDeviceData>::const_iterator devIt = m_touchDevices.constBegin();
for (; devIt != m_touchDevices.constEnd(); ++devIt) {
- XInput2TouchDeviceData *deviceData = devIt.value();
- if (deviceData->qtTouchDevice->type() == QTouchDevice::TouchScreen) {
- QHash<int, QPointF>::const_iterator pointIt = deviceData->pointPressedPosition.constBegin();
- for (; pointIt != deviceData->pointPressedPosition.constEnd(); ++pointIt) {
+ TouchDeviceData deviceData = devIt.value();
+ if (deviceData.qtTouchDevice->type() == QTouchDevice::TouchScreen) {
+ QHash<int, QPointF>::const_iterator pointIt = deviceData.pointPressedPosition.constBegin();
+ for (; pointIt != deviceData.pointPressedPosition.constEnd(); ++pointIt) {
if (pointIt.value().toPoint() == point) {
m_startSystemResizeInfo.window = window;
m_startSystemResizeInfo.deviceid = devIt.key();
@@ -783,6 +838,7 @@ bool QXcbConnection::startSystemResizeForTouchBegin(xcb_window_t window, const Q
}
return false;
}
+#endif // XCB_USE_XINPUT22
bool QXcbConnection::xi2SetMouseGrabEnabled(xcb_window_t w, bool grab)
{
@@ -843,59 +899,70 @@ bool QXcbConnection::xi2SetMouseGrabEnabled(xcb_window_t w, bool grab)
return grabbed;
}
-#endif // XCB_USE_XINPUT22
-void QXcbConnection::xi2HandleHierachyEvent(void *event)
+void QXcbConnection::xi2HandleHierarchyEvent(void *event)
{
xXIHierarchyEvent *xiEvent = reinterpret_cast<xXIHierarchyEvent *>(event);
// We only care about hotplugged devices
if (!(xiEvent->flags & (XISlaveRemoved | XISlaveAdded)))
return;
+
xi2SetupDevices();
- // Reselect events for all event-listening windows.
- for (auto it = m_mapper.cbegin(), end = m_mapper.cend(); it != end; ++it)
- xi2Select(it.key());
+
+ if (xi2MouseEventsDisabled()) {
+ // In compatibility mode (a.k.a xi2MouseEventsDisabled() mode) we select events for
+ // each device separately. When a new device appears, we have to select events from
+ // this device on all event-listening windows. This is not needed when events are
+ // selected via XIAllDevices/XIAllMasterDevices (as in xi2SelectDeviceEvents()).
+ for (auto it = m_mapper.cbegin(), end = m_mapper.cend(); it != end; ++it)
+ xi2SelectDeviceEventsCompatibility(it.key());
+ }
}
void QXcbConnection::xi2HandleDeviceChangedEvent(void *event)
{
xXIDeviceChangedEvent *xiEvent = reinterpret_cast<xXIDeviceChangedEvent *>(event);
-
- // ### If a slave device changes (XIDeviceChange), we should probably run setup on it again.
- if (xiEvent->reason != XISlaveSwitch)
- return;
-
+ switch (xiEvent->reason) {
+ case XIDeviceChange: {
+ int nrDevices = 0;
+ Display *dpy = static_cast<Display *>(m_xlib_display);
+ XIDeviceInfo* deviceInfo = XIQueryDevice(dpy, xiEvent->sourceid, &nrDevices);
+ if (nrDevices <= 0)
+ return;
+ xi2SetupDevice(deviceInfo);
+ XIFreeDeviceInfo(deviceInfo);
+ break;
+ }
+ case XISlaveSwitch: {
#ifdef XCB_USE_XINPUT21
- // This code handles broken scrolling device drivers that reset absolute positions
- // when they are made active. Whenever a new slave device is made active the
- // primary pointer sends a DeviceChanged event with XISlaveSwitch, and the new
- // active slave in sourceid.
-
- QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(xiEvent->sourceid);
- if (device == m_scrollingDevices.end())
- return;
+ if (ScrollingDevice *scrollingDevice = scrollingDeviceForId(xiEvent->sourceid))
+ xi2UpdateScrollingDevice(*scrollingDevice);
+#endif
+ break;
+ }
+ default:
+ qCDebug(lcQpaXInputEvents, "unknown device-changed-event (device %d)", xiEvent->sourceid);
+ break;
+ }
+}
+#ifdef XCB_USE_XINPUT21
+void QXcbConnection::xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice)
+{
int nrDevices = 0;
- XIDeviceInfo* xiDeviceInfo = XIQueryDevice(static_cast<Display *>(m_xlib_display), xiEvent->sourceid, &nrDevices);
+ Display *dpy = static_cast<Display *>(m_xlib_display);
+ XIDeviceInfo* deviceInfo = XIQueryDevice(dpy, scrollingDevice.deviceId, &nrDevices);
if (nrDevices <= 0) {
- qCDebug(lcQpaXInputDevices, "scrolling device %d no longer present", xiEvent->sourceid);
+ qCDebug(lcQpaXInputDevices, "scrolling device %d no longer present", scrollingDevice.deviceId);
return;
}
- updateScrollingDevice(*device, xiDeviceInfo->num_classes, xiDeviceInfo->classes);
- XIFreeDeviceInfo(xiDeviceInfo);
-#endif
-}
-
-void QXcbConnection::updateScrollingDevice(ScrollingDevice &scrollingDevice, int num_classes, void *classInfo)
-{
-#ifdef XCB_USE_XINPUT21
- XIAnyClassInfo **classes = reinterpret_cast<XIAnyClassInfo**>(classInfo);
QPointF lastScrollPosition;
if (lcQpaXInput().isDebugEnabled())
lastScrollPosition = scrollingDevice.lastScrollPosition;
- for (int c = 0; c < num_classes; ++c) {
- if (classes[c]->type == XIValuatorClass) {
- XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classes[c]);
+ for (int c = 0; c < deviceInfo->num_classes; ++c) {
+ XIAnyClassInfo *classInfo = deviceInfo->classes[c];
+ if (classInfo->type == XIValuatorClass) {
+ XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classInfo);
const int valuatorAtom = qatom(vci->label);
if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
scrollingDevice.lastScrollPosition.setX(vci->value);
@@ -908,37 +975,30 @@ void QXcbConnection::updateScrollingDevice(ScrollingDevice &scrollingDevice, int
lastScrollPosition.x(), lastScrollPosition.y(),
scrollingDevice.lastScrollPosition.x(),
scrollingDevice.lastScrollPosition.y());
-#else
- Q_UNUSED(scrollingDevice);
- Q_UNUSED(num_classes);
- Q_UNUSED(classInfo);
-#endif
+
+ XIFreeDeviceInfo(deviceInfo);
}
-#ifdef XCB_USE_XINPUT21
-void QXcbConnection::handleEnterEvent()
+void QXcbConnection::xi2UpdateScrollingDevices()
{
QHash<int, ScrollingDevice>::iterator it = m_scrollingDevices.begin();
const QHash<int, ScrollingDevice>::iterator end = m_scrollingDevices.end();
while (it != end) {
- ScrollingDevice& scrollingDevice = it.value();
- int nrDevices = 0;
- XIDeviceInfo* xiDeviceInfo = XIQueryDevice(static_cast<Display *>(m_xlib_display), scrollingDevice.deviceId, &nrDevices);
- if (nrDevices <= 0) {
- qCDebug(lcQpaXInputDevices, "scrolling device %d no longer present", scrollingDevice.deviceId);
- it = m_scrollingDevices.erase(it);
- continue;
- }
- updateScrollingDevice(scrollingDevice, xiDeviceInfo->num_classes, xiDeviceInfo->classes);
- XIFreeDeviceInfo(xiDeviceInfo);
+ xi2UpdateScrollingDevice(it.value());
++it;
}
}
-#endif
+
+QXcbConnection::ScrollingDevice *QXcbConnection::scrollingDeviceForId(int id)
+{
+ ScrollingDevice *dev = nullptr;
+ if (m_scrollingDevices.contains(id))
+ dev = &m_scrollingDevices[id];
+ return dev;
+}
void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice)
{
-#ifdef XCB_USE_XINPUT21
xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
if (xiEvent->evtype == XI_Motion && scrollingDevice.orientations) {
@@ -1008,10 +1068,51 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
}
}
}
-#else
- Q_UNUSED(event);
- Q_UNUSED(scrollingDevice);
+}
#endif // XCB_USE_XINPUT21
+
+static int xi2ValuatorOffset(const unsigned char *maskPtr, int maskLen, int number)
+{
+ int offset = 0;
+ for (int i = 0; i < maskLen; i++) {
+ if (number < 8) {
+ if ((maskPtr[i] & (1 << number)) == 0)
+ return -1;
+ }
+ for (int j = 0; j < 8; j++) {
+ if (j == number)
+ return offset;
+ if (maskPtr[i] & (1 << j))
+ offset++;
+ }
+ number -= 8;
+ }
+ return -1;
+}
+
+bool QXcbConnection::xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value)
+{
+ const xXIDeviceEvent *xideviceevent = static_cast<const xXIDeviceEvent *>(event);
+ const unsigned char *buttonsMaskAddr = (const unsigned char*)&xideviceevent[1];
+ const unsigned char *valuatorsMaskAddr = buttonsMaskAddr + xideviceevent->buttons_len * 4;
+ FP3232 *valuatorsValuesAddr = (FP3232*)(valuatorsMaskAddr + xideviceevent->valuators_len * 4);
+
+ int valuatorOffset = xi2ValuatorOffset(valuatorsMaskAddr, xideviceevent->valuators_len, valuatorNum);
+ if (valuatorOffset < 0)
+ return false;
+
+ *value = valuatorsValuesAddr[valuatorOffset].integral;
+ *value += ((double)valuatorsValuesAddr[valuatorOffset].frac / (1 << 16) / (1 << 16));
+ return true;
+}
+
+void QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event)
+{
+ // xcb event structs contain stuff that wasn't on the wire, the full_sequence field
+ // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes.
+ // Move this data back to have the same layout in memory as it was on the wire
+ // and allow casting, overwriting the full_sequence field.
+ memmove((char*) event + 32, (char*) event + 36, event->length * 4);
}
Qt::MouseButton QXcbConnection::xiToQtMouseButton(uint32_t b)
@@ -1028,15 +1129,6 @@ Qt::MouseButton QXcbConnection::xiToQtMouseButton(uint32_t b)
return Qt::NoButton;
}
-#ifdef XCB_USE_XINPUT22
-bool QXcbConnection::isTouchScreen(int id) const
-{
- auto device = m_touchDevices.value(id);
- return device && device->qtTouchDevice
- && device->qtTouchDevice->type() == QTouchDevice::TouchScreen;
-}
-#endif
-
#if QT_CONFIG(tabletevent)
static QTabletEvent::TabletDevice toolIdToTabletDevice(quint32 toolId) {
// keep in sync with wacom_intuos_inout() in Linux kernel driver wacom_wac.c
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 7c62c2e2b3..da63360333 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -579,7 +579,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
if (cursor)
return cursor;
if (!cursor && cursorId) {
- cursor = XCreateFontCursor(DISPLAY_FROM_XCB(this), cursorId);
+ cursor = XCreateFontCursor(static_cast<Display *>(connection()->xlib_display()), cursorId);
if (cursor)
return cursor;
}
@@ -631,10 +631,9 @@ void QXcbCursor::queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDes
*pos = QPoint();
xcb_window_t root = c->primaryVirtualDesktop()->root();
- xcb_query_pointer_cookie_t cookie = xcb_query_pointer(c->xcb_connection(), root);
- xcb_generic_error_t *err = 0;
- xcb_query_pointer_reply_t *reply = xcb_query_pointer_reply(c->xcb_connection(), cookie, &err);
- if (!err && reply) {
+
+ auto reply = Q_XCB_REPLY(xcb_query_pointer, c->xcb_connection(), root);
+ if (reply) {
if (virtualDesktop) {
const auto virtualDesktops = c->virtualDesktops();
for (QXcbVirtualDesktop *vd : virtualDesktops) {
@@ -648,11 +647,8 @@ void QXcbCursor::queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDes
*pos = QPoint(reply->root_x, reply->root_y);
if (keybMask)
*keybMask = reply->mask;
- free(reply);
return;
}
- free(err);
- free(reply);
}
QPoint QXcbCursor::pos() const
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index 60d142157f..d4521de8e0 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -94,32 +94,27 @@ static xcb_window_t xdndProxy(QXcbConnection *c, xcb_window_t w)
{
xcb_window_t proxy = XCB_NONE;
- xcb_get_property_cookie_t cookie = Q_XCB_CALL2(xcb_get_property(c->xcb_connection(), false, w, c->atom(QXcbAtom::XdndProxy),
- XCB_ATOM_WINDOW, 0, 1), c);
- xcb_get_property_reply_t *reply = xcb_get_property_reply(c->xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_property, c->xcb_connection(),
+ false, w, c->atom(QXcbAtom::XdndProxy), XCB_ATOM_WINDOW, 0, 1);
if (reply && reply->type == XCB_ATOM_WINDOW)
- proxy = *((xcb_window_t *)xcb_get_property_value(reply));
- free(reply);
+ proxy = *((xcb_window_t *)xcb_get_property_value(reply.get()));
if (proxy == XCB_NONE)
return proxy;
// exists and is real?
- cookie = Q_XCB_CALL2(xcb_get_property(c->xcb_connection(), false, proxy, c->atom(QXcbAtom::XdndProxy),
- XCB_ATOM_WINDOW, 0, 1), c);
- reply = xcb_get_property_reply(c->xcb_connection(), cookie, 0);
+ reply = Q_XCB_REPLY(xcb_get_property, c->xcb_connection(),
+ false, proxy, c->atom(QXcbAtom::XdndProxy), XCB_ATOM_WINDOW, 0, 1);
if (reply && reply->type == XCB_ATOM_WINDOW) {
- xcb_window_t p = *((xcb_window_t *)xcb_get_property_value(reply));
+ xcb_window_t p = *((xcb_window_t *)xcb_get_property_value(reply.get()));
if (proxy != p)
proxy = 0;
} else {
proxy = 0;
}
- free(reply);
-
return proxy;
}
@@ -142,7 +137,7 @@ protected:
QXcbDrag::QXcbDrag(QXcbConnection *c) : QXcbObject(c)
{
- dropData = new QXcbDropData(this);
+ m_dropData = new QXcbDropData(this);
init();
cleanup_timer = -1;
@@ -150,7 +145,7 @@ QXcbDrag::QXcbDrag(QXcbConnection *c) : QXcbObject(c)
QXcbDrag::~QXcbDrag()
{
- delete dropData;
+ delete m_dropData;
}
void QXcbDrag::init()
@@ -172,11 +167,6 @@ void QXcbDrag::init()
drag_types.clear();
}
-QMimeData *QXcbDrag::platformDropData()
-{
- return dropData;
-}
-
bool QXcbDrag::eventFilter(QObject *o, QEvent *e)
{
/* We are setting a mouse grab on the QShapedPixmapWindow in order not to
@@ -228,28 +218,19 @@ void QXcbDrag::endDrag()
initiatorWindow.clear();
}
-static xcb_translate_coordinates_reply_t *
-translateCoordinates(QXcbConnection *c, xcb_window_t from, xcb_window_t to, int x, int y)
-{
- xcb_translate_coordinates_cookie_t cookie =
- xcb_translate_coordinates(c->xcb_connection(), from, to, x, y);
- return xcb_translate_coordinates_reply(c->xcb_connection(), cookie, 0);
-}
-
static
bool windowInteractsWithPosition(xcb_connection_t *connection, const QPoint & pos, xcb_window_t w, xcb_shape_sk_t shapeType)
{
bool interacts = false;
- xcb_shape_get_rectangles_reply_t *reply = xcb_shape_get_rectangles_reply(connection, xcb_shape_get_rectangles(connection, w, shapeType), NULL);
+ auto reply = Q_XCB_REPLY(xcb_shape_get_rectangles, connection, w, shapeType);
if (reply) {
- xcb_rectangle_t *rectangles = xcb_shape_get_rectangles_rectangles(reply);
+ xcb_rectangle_t *rectangles = xcb_shape_get_rectangles_rectangles(reply.get());
if (rectangles) {
- const int nRectangles = xcb_shape_get_rectangles_rectangles_length(reply);
+ const int nRectangles = xcb_shape_get_rectangles_rectangles_length(reply.get());
for (int i = 0; !interacts && i < nRectangles; ++i) {
interacts = QRect(rectangles[i].x, rectangles[i].y, rectangles[i].width, rectangles[i].height).contains(pos);
}
}
- free(reply);
}
return interacts;
@@ -261,33 +242,25 @@ xcb_window_t QXcbDrag::findRealWindow(const QPoint & pos, xcb_window_t w, int md
return 0;
if (md) {
- xcb_get_window_attributes_cookie_t cookie = xcb_get_window_attributes(xcb_connection(), w);
- xcb_get_window_attributes_reply_t *reply = xcb_get_window_attributes_reply(xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_window_attributes, xcb_connection(), w);
if (!reply)
return 0;
if (reply->map_state != XCB_MAP_STATE_VIEWABLE)
return 0;
- free(reply);
-
- xcb_get_geometry_cookie_t gcookie = xcb_get_geometry(xcb_connection(), w);
- xcb_get_geometry_reply_t *greply = xcb_get_geometry_reply(xcb_connection(), gcookie, 0);
+ auto greply = Q_XCB_REPLY(xcb_get_geometry, xcb_connection(), w);
if (!greply)
return 0;
QRect windowRect(greply->x, greply->y, greply->width, greply->height);
- free(greply);
if (windowRect.contains(pos)) {
bool windowContainsMouse = !ignoreNonXdndAwareWindows;
{
- xcb_get_property_cookie_t cookie =
- Q_XCB_CALL(xcb_get_property(xcb_connection(), false, w, connection()->atom(QXcbAtom::XdndAware),
- XCB_GET_PROPERTY_TYPE_ANY, 0, 0));
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);
-
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(),
+ false, w, connection()->atom(QXcbAtom::XdndAware),
+ XCB_GET_PROPERTY_TYPE_ANY, 0, 0);
bool isAware = reply && reply->type != XCB_NONE;
- free(reply);
if (isAware) {
const QPoint relPos = pos - windowRect.topLeft();
// When ShapeInput and ShapeBounding are not set they return a single rectangle with the geometry of the window, this is why we
@@ -303,19 +276,16 @@ xcb_window_t QXcbDrag::findRealWindow(const QPoint & pos, xcb_window_t w, int md
}
}
- xcb_query_tree_cookie_t cookie = xcb_query_tree (xcb_connection(), w);
- xcb_query_tree_reply_t *reply = xcb_query_tree_reply(xcb_connection(), cookie, 0);
-
+ auto reply = Q_XCB_REPLY(xcb_query_tree, xcb_connection(), w);
if (!reply)
return 0;
- int nc = xcb_query_tree_children_length(reply);
- xcb_window_t *c = xcb_query_tree_children(reply);
+ int nc = xcb_query_tree_children_length(reply.get());
+ xcb_window_t *c = xcb_query_tree_children(reply.get());
xcb_window_t r = 0;
for (uint i = nc; !r && i--;)
r = findRealWindow(pos - windowRect.topLeft(), c[i], md-1, ignoreNonXdndAwareWindows);
- free(reply);
if (r)
return r;
@@ -356,15 +326,14 @@ void QXcbDrag::move(const QPoint &globalPos)
}
xcb_window_t rootwin = current_virtual_desktop->root();
- xcb_translate_coordinates_reply_t *translate =
- ::translateCoordinates(connection(), rootwin, rootwin, globalPos.x(), globalPos.y());
+ auto translate = Q_XCB_REPLY(xcb_translate_coordinates, connection()->xcb_connection(),
+ rootwin, rootwin, globalPos.x(), globalPos.y());
if (!translate)
return;
xcb_window_t target = translate->child;
int lx = translate->dst_x;
int ly = translate->dst_y;
- free (translate);
if (target && target != rootwin) {
xcb_window_t src = rootwin;
@@ -372,7 +341,8 @@ void QXcbDrag::move(const QPoint &globalPos)
DNDDEBUG << "checking target for XdndAware" << target << lx << ly;
// translate coordinates
- translate = ::translateCoordinates(connection(), src, target, lx, ly);
+ auto translate = Q_XCB_REPLY(xcb_translate_coordinates, connection()->xcb_connection(),
+ src, target, lx, ly);
if (!translate) {
target = 0;
break;
@@ -381,14 +351,11 @@ void QXcbDrag::move(const QPoint &globalPos)
ly = translate->dst_y;
src = target;
xcb_window_t child = translate->child;
- free(translate);
// check if it has XdndAware
- xcb_get_property_cookie_t cookie = Q_XCB_CALL(xcb_get_property(xcb_connection(), false, target,
- atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 0));
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, target,
+ atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 0);
bool aware = reply && reply->type != XCB_NONE;
- free(reply);
if (aware) {
DNDDEBUG << "Found XdndAware on " << target;
break;
@@ -422,16 +389,14 @@ void QXcbDrag::move(const QPoint &globalPos)
int target_version = 1;
if (proxy_target) {
- xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, proxy_target,
- atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 1);
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(),
+ false, proxy_target,
+ atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 1);
if (!reply || reply->type == XCB_NONE)
target = 0;
- target_version = *(uint32_t *)xcb_get_property_value(reply);
+ target_version = *(uint32_t *)xcb_get_property_value(reply.get());
target_version = qMin(xdnd_version, target_version ? target_version : 1);
-
- free(reply);
}
if (target != current_target) {
@@ -714,21 +679,19 @@ void QXcbDrag::handleEnter(QPlatformWindow *window, const xcb_client_message_eve
if (event->data.data32[1] & 1) {
// get the types from XdndTypeList
- xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, xdnd_dragsource,
- atom(QXcbAtom::XdndTypelist), XCB_ATOM_ATOM,
- 0, xdnd_max_type);
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, xdnd_dragsource,
+ atom(QXcbAtom::XdndTypelist), XCB_ATOM_ATOM,
+ 0, xdnd_max_type);
if (reply && reply->type != XCB_NONE && reply->format == 32) {
- int length = xcb_get_property_value_length(reply) / 4;
+ int length = xcb_get_property_value_length(reply.get()) / 4;
if (length > xdnd_max_type)
length = xdnd_max_type;
- xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply);
+ xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply.get());
xdnd_types.reserve(length);
for (int i = 0; i < length; ++i)
xdnd_types.append(atoms[i]);
}
- free(reply);
} else {
// get the types from the message
for(int i = 2; i < 5; i++) {
@@ -769,7 +732,7 @@ void QXcbDrag::handle_xdnd_position(QPlatformWindow *w, const xcb_client_message
dropData = currentDrag()->mimeData();
supported_actions = currentDrag()->supportedActions();
} else {
- dropData = platformDropData();
+ dropData = m_dropData;
supported_actions = Qt::DropActions(toDropAction(e->data.data32[4]));
}
@@ -812,8 +775,8 @@ void QXcbDrag::handle_xdnd_position(QPlatformWindow *w, const xcb_client_message
handle_xdnd_status(&response);
else
#endif
- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, current_proxy_target,
- XCB_EVENT_MASK_NO_EVENT, (const char *)&response));
+ xcb_send_event(xcb_connection(), false, current_proxy_target,
+ XCB_EVENT_MASK_NO_EVENT, (const char *)&response);
}
namespace
@@ -990,7 +953,7 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e
dropData = currentDrag()->mimeData();
supported_drop_actions = Qt::DropActions(l[4]);
} else {
- dropData = platformDropData();
+ dropData = m_dropData;
supported_drop_actions = accepted_drop_action;
// Drop coming from another app? Update keyboard modifiers.
@@ -1017,8 +980,8 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e
finished.data.data32[0] = currentWindow ? xcb_window(currentWindow.data()) : XCB_NONE;
finished.data.data32[1] = response.isAccepted(); // flags
finished.data.data32[2] = toXdndAction(response.acceptedAction());
- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, current_proxy_target,
- XCB_EVENT_MASK_NO_EVENT, (char *)&finished));
+ xcb_send_event(xcb_connection(), false, current_proxy_target,
+ XCB_EVENT_MASK_NO_EVENT, (char *)&finished);
xdnd_dragsource = 0;
currentWindow.clear();
@@ -1132,28 +1095,20 @@ static xcb_window_t findXdndAwareParent(QXcbConnection *c, xcb_window_t window)
xcb_window_t target = 0;
forever {
// check if window has XdndAware
- xcb_get_property_cookie_t gpCookie = Q_XCB_CALL(
- xcb_get_property(c->xcb_connection(), false, window,
- c->atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 0));
- xcb_get_property_reply_t *gpReply = xcb_get_property_reply(
- c->xcb_connection(), gpCookie, 0);
+ auto gpReply = Q_XCB_REPLY(xcb_get_property, c->xcb_connection(), false, window,
+ c->atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 0);
bool aware = gpReply && gpReply->type != XCB_NONE;
- free(gpReply);
if (aware) {
target = window;
break;
}
// try window's parent
- xcb_query_tree_cookie_t qtCookie = Q_XCB_CALL(
- xcb_query_tree_unchecked(c->xcb_connection(), window));
- xcb_query_tree_reply_t *qtReply = xcb_query_tree_reply(
- c->xcb_connection(), qtCookie, NULL);
+ auto qtReply = Q_XCB_REPLY_UNCHECKED(xcb_query_tree, c->xcb_connection(), window);
if (!qtReply)
break;
xcb_window_t root = qtReply->root;
xcb_window_t parent = qtReply->parent;
- free(qtReply);
if (window == root)
break;
window = parent;
diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h
index 2d152edf76..f261cc1322 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.h
+++ b/src/plugins/platforms/xcb/qxcbdrag.h
@@ -74,7 +74,6 @@ public:
QXcbDrag(QXcbConnection *c);
~QXcbDrag();
- QMimeData *platformDropData() override;
bool eventFilter(QObject *o, QEvent *e) override;
void startDrag() override;
@@ -117,7 +116,7 @@ private:
QPointer<QWindow> currentWindow;
QPoint currentPosition;
- QXcbDropData *dropData;
+ QXcbDropData *m_dropData;
Qt::DropAction accepted_drop_action;
QWindow *desktop_proxy;
diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp
index c0403d589d..8635a03dcb 100644
--- a/src/plugins/platforms/xcb/qxcbimage.cpp
+++ b/src/plugins/platforms/xcb/qxcbimage.cpp
@@ -91,19 +91,14 @@ QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap
{
xcb_connection_t *conn = connection->xcb_connection();
- xcb_get_image_cookie_t get_image_cookie =
- xcb_get_image_unchecked(conn, XCB_IMAGE_FORMAT_Z_PIXMAP, pixmap,
- 0, 0, width, height, 0xffffffff);
-
- xcb_get_image_reply_t *image_reply =
- xcb_get_image_reply(conn, get_image_cookie, NULL);
-
+ auto image_reply = Q_XCB_REPLY_UNCHECKED(xcb_get_image, conn, XCB_IMAGE_FORMAT_Z_PIXMAP, pixmap,
+ 0, 0, width, height, 0xffffffff);
if (!image_reply) {
return QPixmap();
}
- uint8_t *data = xcb_get_image_data(image_reply);
- uint32_t length = xcb_get_image_data_length(image_reply);
+ uint8_t *data = xcb_get_image_data(image_reply.get());
+ uint32_t length = xcb_get_image_data_length(image_reply.get());
QPixmap result;
@@ -165,7 +160,6 @@ QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap
result = QPixmap::fromImage(image.copy());
}
- free(image_reply);
return result;
}
@@ -203,22 +197,15 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
xcb_connection_t *conn = screen->xcb_connection();
const int w = image.width();
const int h = image.height();
- xcb_generic_error_t *error = 0;
- xcb_render_query_pict_formats_cookie_t formatsCookie = xcb_render_query_pict_formats(conn);
- xcb_render_query_pict_formats_reply_t *formatsReply = xcb_render_query_pict_formats_reply(conn,
- formatsCookie,
- &error);
- if (!formatsReply || error) {
+ auto formats = Q_XCB_REPLY(xcb_render_query_pict_formats, conn);
+ if (!formats) {
qWarning("qt_xcb_createCursorXRender: query_pict_formats failed");
- free(formatsReply);
- free(error);
return XCB_NONE;
}
- xcb_render_pictforminfo_t *fmt = xcb_render_util_find_standard_format(formatsReply,
+ xcb_render_pictforminfo_t *fmt = xcb_render_util_find_standard_format(formats.get(),
XCB_PICT_STANDARD_ARGB_32);
if (!fmt) {
qWarning("qt_xcb_createCursorXRender: Failed to find format PICT_STANDARD_ARGB_32");
- free(formatsReply);
return XCB_NONE;
}
@@ -230,17 +217,15 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
0, 0, 0);
if (!xi) {
qWarning("qt_xcb_createCursorXRender: xcb_image_create failed");
- free(formatsReply);
return XCB_NONE;
}
xi->data = (uint8_t *) malloc(xi->stride * h);
if (!xi->data) {
qWarning("qt_xcb_createCursorXRender: Failed to malloc() image data");
xcb_image_destroy(xi);
- free(formatsReply);
return XCB_NONE;
}
- memcpy(xi->data, img.constBits(), img.byteCount());
+ memcpy(xi->data, img.constBits(), img.sizeInBytes());
xcb_pixmap_t pix = xcb_generate_id(conn);
xcb_create_pixmap(conn, 32, pix, screen->root(), w, h);
@@ -260,7 +245,6 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
xcb_image_destroy(xi);
xcb_render_free_picture(conn, pic);
xcb_free_pixmap(conn, pix);
- free(formatsReply);
return cursor;
#else
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index c9ecdceb0d..72d31060db 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -65,6 +65,11 @@
#if QT_CONFIG(xcb_xlib)
#include <X11/Xlib.h>
+#if QT_CONFIG(xcb_native_painting)
+#include "qxcbnativepainting.h"
+#include "qpixmap_x11_p.h"
+#include "qbackingstore_x11_p.h"
+#endif
#endif
#include <qpa/qplatforminputcontextfactory_p.h>
@@ -83,6 +88,11 @@
#include <QtCore/QFileInfo>
+#if QT_CONFIG(vulkan)
+#include "qxcbvulkaninstance.h"
+#include "qxcbvulkanwindow.h"
+#endif
+
QT_BEGIN_NAMESPACE
// Find out if our parent process is gdb by looking at the 'exe' symlink under /proc,.
@@ -200,6 +210,13 @@ QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char
}
m_fontDatabase.reset(new QGenericUnixFontDatabase());
+
+#if QT_CONFIG(xcb_native_painting)
+ if (nativePaintingEnabled()) {
+ qDebug("QXCB USING NATIVE PAINTING");
+ qt_xcb_native_x11_info_init(defaultConnection());
+ }
+#endif
}
QXcbIntegration::~QXcbIntegration()
@@ -208,15 +225,33 @@ QXcbIntegration::~QXcbIntegration()
m_instance = Q_NULLPTR;
}
+QPlatformPixmap *QXcbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
+{
+#if QT_CONFIG(xcb_native_painting)
+ if (nativePaintingEnabled())
+ return new QX11PlatformPixmap(type);
+#endif
+
+ return QPlatformIntegration::createPlatformPixmap(type);
+}
+
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
{
QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
- if (window->type() != Qt::Desktop && window->supportsOpenGL()) {
- if (glIntegration) {
- QXcbWindow *xcbWindow = glIntegration->createWindow(window);
+ if (window->type() != Qt::Desktop) {
+ if (window->supportsOpenGL()) {
+ if (glIntegration) {
+ QXcbWindow *xcbWindow = glIntegration->createWindow(window);
+ xcbWindow->create();
+ return xcbWindow;
+ }
+#if QT_CONFIG(vulkan)
+ } else if (window->surfaceType() == QSurface::VulkanSurface) {
+ QXcbWindow *xcbWindow = new QXcbVulkanWindow(window);
xcbWindow->create();
return xcbWindow;
+#endif
}
}
@@ -247,6 +282,11 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont
QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const
{
+#if QT_CONFIG(xcb_native_painting)
+ if (nativePaintingEnabled())
+ return new QXcbNativeBackingStore(window);
+#endif
+
return new QXcbBackingStore(window);
}
@@ -498,4 +538,21 @@ void QXcbIntegration::beep() const
xcb_bell(connection, 0);
}
+bool QXcbIntegration::nativePaintingEnabled() const
+{
+#if QT_CONFIG(xcb_native_painting)
+ static bool enabled = qEnvironmentVariableIsSet("QT_XCB_NATIVE_PAINTING");
+ return enabled;
+#else
+ return false;
+#endif
+}
+
+#if QT_CONFIG(vulkan)
+QPlatformVulkanInstance *QXcbIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const
+{
+ return new QXcbVulkanInstance(instance);
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h
index b3d72c19d0..186b6c5ddd 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.h
+++ b/src/plugins/platforms/xcb/qxcbintegration.h
@@ -61,6 +61,7 @@ public:
QXcbIntegration(const QStringList &parameters, int &argc, char **argv);
~QXcbIntegration();
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override;
QPlatformWindow *createPlatformWindow(QWindow *window) const override;
QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
#ifndef QT_NO_OPENGL
@@ -114,6 +115,12 @@ public:
void beep() const override;
+ bool nativePaintingEnabled() const;
+
+#if QT_CONFIG(vulkan)
+ QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
+#endif
+
static QXcbIntegration *instance() { return m_instance; }
private:
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 2e29c208c7..e24bd07b6f 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -53,7 +53,7 @@
#include <stdio.h>
#include <X11/keysym.h>
-#ifdef XCB_USE_XINPUT22
+#if QT_CONFIG(xinput2)
#include <X11/extensions/XI2proto.h>
#undef KeyPress
#undef KeyRelease
@@ -612,23 +612,18 @@ Qt::KeyboardModifiers QXcbKeyboard::translateModifiers(int s) const
void QXcbKeyboard::readXKBConfig()
{
clearXKBConfig();
- xcb_generic_error_t *error;
- xcb_get_property_cookie_t cookie;
- xcb_get_property_reply_t *config_reply;
xcb_connection_t *c = xcb_connection();
xcb_window_t rootWindow = connection()->rootWindow();
- cookie = xcb_get_property(c, 0, rootWindow,
- atom(QXcbAtom::_XKB_RULES_NAMES), XCB_ATOM_STRING, 0, 1024);
-
- config_reply = xcb_get_property_reply(c, cookie, &error);
+ auto config_reply = Q_XCB_REPLY(xcb_get_property, c, 0, rootWindow,
+ atom(QXcbAtom::_XKB_RULES_NAMES), XCB_ATOM_STRING, 0, 1024);
if (!config_reply) {
qWarning("Qt: Couldn't interpret the _XKB_RULES_NAMES property");
return;
}
- char *xkb_config = (char *)xcb_get_property_value(config_reply);
- int length = xcb_get_property_value_length(config_reply);
+ char *xkb_config = (char *)xcb_get_property_value(config_reply.get());
+ int length = xcb_get_property_value_length(config_reply.get());
// on old X servers xkb_config can be 0 even if config_reply indicates a succesfull read
if (!xkb_config || length == 0)
@@ -653,8 +648,6 @@ void QXcbKeyboard::readXKBConfig()
xkb_names.layout = qstrdup(names[2]);
xkb_names.variant = qstrdup(names[3]);
xkb_names.options = qstrdup(names[4]);
-
- free(config_reply);
}
void QXcbKeyboard::clearXKBConfig()
@@ -807,7 +800,7 @@ void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
}
}
-#ifdef XCB_USE_XINPUT22
+#if QT_CONFIG(xinput2)
void QXcbKeyboard::updateXKBStateFromXI(void *modInfo, void *groupInfo)
{
if (m_config && !connection()->hasXKB()) {
@@ -1172,23 +1165,19 @@ QXcbKeyboard::~QXcbKeyboard()
void QXcbKeyboard::updateVModMapping()
{
#if QT_CONFIG(xkb)
- xcb_xkb_get_names_cookie_t names_cookie;
- xcb_xkb_get_names_reply_t *name_reply;
xcb_xkb_get_names_value_list_t names_list;
memset(&vmod_masks, 0, sizeof(vmod_masks));
- names_cookie = xcb_xkb_get_names(xcb_connection(),
- XCB_XKB_ID_USE_CORE_KBD,
- XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES);
-
- name_reply = xcb_xkb_get_names_reply(xcb_connection(), names_cookie, 0);
+ auto name_reply = Q_XCB_REPLY(xcb_xkb_get_names, xcb_connection(),
+ XCB_XKB_ID_USE_CORE_KBD,
+ XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES);
if (!name_reply) {
qWarning("Qt: failed to retrieve the virtual modifier names from XKB");
return;
}
- const void *buffer = xcb_xkb_get_names_value_list(name_reply);
+ const void *buffer = xcb_xkb_get_names_value_list(name_reply.get());
xcb_xkb_get_names_value_list_unpack(buffer,
name_reply->nTypes,
name_reply->indicators,
@@ -1233,32 +1222,27 @@ void QXcbKeyboard::updateVModMapping()
else if (qstrcmp(vmod_name, "Hyper") == 0)
vmod_masks.hyper = bit;
}
-
- free(name_reply);
#endif
}
void QXcbKeyboard::updateVModToRModMapping()
{
#if QT_CONFIG(xkb)
- xcb_xkb_get_map_cookie_t map_cookie;
- xcb_xkb_get_map_reply_t *map_reply;
xcb_xkb_get_map_map_t map;
memset(&rmod_masks, 0, sizeof(rmod_masks));
- map_cookie = xcb_xkb_get_map(xcb_connection(),
- XCB_XKB_ID_USE_CORE_KBD,
- XCB_XKB_MAP_PART_VIRTUAL_MODS,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
-
- map_reply = xcb_xkb_get_map_reply(xcb_connection(), map_cookie, 0);
+ auto map_reply = Q_XCB_REPLY(xcb_xkb_get_map,
+ xcb_connection(),
+ XCB_XKB_ID_USE_CORE_KBD,
+ XCB_XKB_MAP_PART_VIRTUAL_MODS,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
if (!map_reply) {
qWarning("Qt: failed to retrieve the virtual modifier map from XKB");
return;
}
- const void *buffer = xcb_xkb_get_map_map(map_reply);
+ const void *buffer = xcb_xkb_get_map_map(map_reply.get());
xcb_xkb_get_map_map_unpack(buffer,
map_reply->nTypes,
map_reply->nKeySyms,
@@ -1301,7 +1285,6 @@ void QXcbKeyboard::updateVModToRModMapping()
rmod_masks.hyper = modmap;
}
- free(map_reply);
resolveMaskConflicts();
#endif
}
@@ -1315,14 +1298,10 @@ void QXcbKeyboard::updateModifiers()
// process for all modifiers whenever any part of the modifier mapping is changed.
memset(&rmod_masks, 0, sizeof(rmod_masks));
- xcb_generic_error_t *error = 0;
xcb_connection_t *conn = xcb_connection();
- xcb_get_modifier_mapping_cookie_t modMapCookie = xcb_get_modifier_mapping(conn);
- xcb_get_modifier_mapping_reply_t *modMapReply =
- xcb_get_modifier_mapping_reply(conn, modMapCookie, &error);
- if (error) {
+ auto modMapReply = Q_XCB_REPLY(xcb_get_modifier_mapping, conn);
+ if (!modMapReply) {
qWarning("Qt: failed to get modifier mapping");
- free(error);
return;
}
@@ -1338,7 +1317,7 @@ void QXcbKeyboard::updateModifiers()
for (size_t i = 0; i < numSymbols; ++i)
modKeyCodes[i] = xcb_key_symbols_get_keycode(m_key_symbols, symbols[i]);
- xcb_keycode_t *modMap = xcb_get_modifier_mapping_keycodes(modMapReply);
+ xcb_keycode_t *modMap = xcb_get_modifier_mapping_keycodes(modMapReply.get());
const int w = modMapReply->keycodes_per_modifier;
for (size_t i = 0; i < numSymbols; ++i) {
for (int bit = 0; bit < 8; ++bit) {
@@ -1366,7 +1345,6 @@ void QXcbKeyboard::updateModifiers()
for (size_t i = 0; i < numSymbols; ++i)
free(modKeyCodes[i]);
- free(modMapReply);
resolveMaskConflicts();
}
@@ -1449,8 +1427,6 @@ private:
void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code,
quint16 state, xcb_timestamp_t time)
{
- Q_XCB_NOOP(connection());
-
if (!m_config)
return;
@@ -1471,30 +1447,6 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
updateXKBStateFromState(kb_state, state);
xcb_keysym_t sym = xkb_state_key_get_one_sym(kb_state, code);
-
- QPlatformInputContext *inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext();
- QMetaMethod method;
-
- if (inputContext) {
- int methodIndex = inputContext->metaObject()->indexOfMethod("x11FilterEvent(uint,uint,uint,bool)");
- if (methodIndex != -1)
- method = inputContext->metaObject()->method(methodIndex);
- }
-
- if (method.isValid()) {
- bool retval = false;
- method.invoke(inputContext, Qt::DirectConnection,
- Q_RETURN_ARG(bool, retval),
- Q_ARG(uint, sym),
- Q_ARG(uint, code),
- Q_ARG(uint, state),
- Q_ARG(bool, type == QEvent::KeyPress));
- if (retval) {
- xkb_state_unref(kb_state);
- return;
- }
- }
-
QString string = lookupString(kb_state, code);
// Ιf control modifier is set we should prefer latin character, this is
@@ -1526,6 +1478,7 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
}
bool filtered = false;
+ QPlatformInputContext *inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext();
if (inputContext) {
QKeyEvent event(type, qtcode, modifiers, code, sym, state, string, isAutoRepeat, string.length());
event.setTimestamp(time);
@@ -1548,16 +1501,7 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
if (isAutoRepeat && type == QEvent::KeyRelease) {
// since we removed it from the event queue using checkEvent we need to send the key press here
filtered = false;
- if (method.isValid()) {
- method.invoke(inputContext, Qt::DirectConnection,
- Q_RETURN_ARG(bool, filtered),
- Q_ARG(uint, sym),
- Q_ARG(uint, code),
- Q_ARG(uint, state),
- Q_ARG(bool, true));
- }
-
- if (!filtered && inputContext) {
+ if (inputContext) {
QKeyEvent event(QEvent::KeyPress, qtcode, modifiers, code, sym, state, string, isAutoRepeat, string.length());
event.setTimestamp(time);
filtered = inputContext->filterEvent(&event);
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 74f9da0353..7f1c51fab8 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -74,7 +74,7 @@ public:
void updateXKBMods();
quint32 xkbModMask(quint16 state);
void updateXKBStateFromCore(quint16 state);
-#ifdef XCB_USE_XINPUT22
+#if QT_CONFIG(xinput2)
void updateXKBStateFromXI(void *modInfo, void *groupInfo);
#endif
#if QT_CONFIG(xkb)
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 97dcb8f328..caa9499c45 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -63,6 +63,10 @@
#include "qxcbnativeinterfacehandler.h"
+#if QT_CONFIG(vulkan)
+#include "qxcbvulkanwindow.h"
+#endif
+
QT_BEGIN_NAMESPACE
// return QXcbNativeInterface::ResourceType for the key.
@@ -78,7 +82,11 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("rootwindow"),
QByteArrayLiteral("subpixeltype"), QByteArrayLiteral("antialiasingenabled"),
QByteArrayLiteral("atspibus"),
- QByteArrayLiteral("compositingenabled")
+ QByteArrayLiteral("compositingenabled"),
+ QByteArrayLiteral("vksurface"),
+ QByteArrayLiteral("generatepeekerid"),
+ QByteArrayLiteral("removepeekerid"),
+ QByteArrayLiteral("peekeventqueue")
};
const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
const QByteArray *result = std::find(names, end, key);
@@ -117,28 +125,19 @@ xcb_window_t QXcbNativeInterface::locateSystemTray(xcb_connection_t *conn, const
{
if (m_sysTraySelectionAtom == XCB_ATOM_NONE) {
const QByteArray net_sys_tray = QString::fromLatin1("_NET_SYSTEM_TRAY_S%1").arg(screen->screenNumber()).toLatin1();
- xcb_intern_atom_cookie_t intern_c =
- xcb_intern_atom_unchecked(conn, true, net_sys_tray.length(), net_sys_tray);
-
- xcb_intern_atom_reply_t *intern_r = xcb_intern_atom_reply(conn, intern_c, 0);
-
+ auto intern_r = Q_XCB_REPLY_UNCHECKED(xcb_intern_atom, conn,
+ true, net_sys_tray.length(), net_sys_tray);
if (!intern_r)
return XCB_WINDOW_NONE;
m_sysTraySelectionAtom = intern_r->atom;
- free(intern_r);
}
- xcb_get_selection_owner_cookie_t sel_owner_c = xcb_get_selection_owner_unchecked(conn, m_sysTraySelectionAtom);
- xcb_get_selection_owner_reply_t *sel_owner_r = xcb_get_selection_owner_reply(conn, sel_owner_c, 0);
-
+ auto sel_owner_r = Q_XCB_REPLY_UNCHECKED(xcb_get_selection_owner, conn, m_sysTraySelectionAtom);
if (!sel_owner_r)
return XCB_WINDOW_NONE;
- xcb_window_t selection_window = sel_owner_r->owner;
- free(sel_owner_r);
-
- return selection_window;
+ return sel_owner_r->owner;
}
bool QXcbNativeInterface::systrayVisualHasAlphaChannel()
@@ -262,6 +261,14 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr
case Screen:
result = screenForWindow(window);
break;
+#if QT_CONFIG(vulkan)
+ case VkSurface:
+ if (window->surfaceType() == QSurface::VulkanSurface && window->handle()) {
+ // return a pointer to the VkSurfaceKHR value, not the value itself
+ result = static_cast<QXcbVulkanWindow *>(window->handle())->surface();
+ }
+ break;
+#endif
default:
break;
}
@@ -300,6 +307,13 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa
if (lowerCaseResource == "setstartupid")
return NativeResourceForIntegrationFunction(setStartupId);
+ if (lowerCaseResource == "generatepeekerid")
+ return NativeResourceForIntegrationFunction(generatePeekerId);
+ if (lowerCaseResource == "removepeekerid")
+ return NativeResourceForIntegrationFunction(removePeekerId);
+ if (lowerCaseResource == "peekeventqueue")
+ return NativeResourceForIntegrationFunction(peekEventQueue);
+
return 0;
}
@@ -453,21 +467,13 @@ void *QXcbNativeInterface::atspiBus()
QXcbConnection *defaultConnection = integration->defaultConnection();
if (defaultConnection) {
xcb_atom_t atspiBusAtom = defaultConnection->internAtom("AT_SPI_BUS");
- xcb_get_property_cookie_t cookie = Q_XCB_CALL2(xcb_get_property(
- defaultConnection->xcb_connection(),
- false, defaultConnection->rootWindow(),
- atspiBusAtom, XCB_ATOM_STRING, 0, 128),
- defaultConnection);
- xcb_get_property_reply_t *reply = Q_XCB_CALL2(xcb_get_property_reply(
- defaultConnection->xcb_connection(),
- cookie, 0),
- defaultConnection);
+ auto reply = Q_XCB_REPLY(xcb_get_property, defaultConnection->xcb_connection(),
+ false, defaultConnection->rootWindow(),
+ atspiBusAtom, XCB_ATOM_STRING, 0, 128);
Q_ASSERT(!reply->bytes_after);
- char *data = (char *)xcb_get_property_value(reply);
- int length = xcb_get_property_value_length(reply);
- QByteArray *busAddress = new QByteArray(data, length);
- free(reply);
- return busAddress;
+ char *data = (char *)xcb_get_property_value(reply.get());
+ int length = xcb_get_property_value_length(reply.get());
+ return new QByteArray(data, length);
}
return 0;
}
@@ -486,6 +492,25 @@ void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time)
}
}
+qint32 QXcbNativeInterface::generatePeekerId()
+{
+ QXcbIntegration *integration = QXcbIntegration::instance();
+ return integration->defaultConnection()->generatePeekerId();
+}
+
+bool QXcbNativeInterface::removePeekerId(qint32 peekerId)
+{
+ QXcbIntegration *integration = QXcbIntegration::instance();
+ return integration->defaultConnection()->removePeekerId(peekerId);
+}
+
+bool QXcbNativeInterface::peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData,
+ QXcbConnection::PeekOptions option, qint32 peekerId)
+{
+ QXcbIntegration *integration = QXcbIntegration::instance();
+ return integration->defaultConnection()->peekEventQueue(peeker, peekerData, option, peekerId);
+}
+
void QXcbNativeInterface::setStartupId(const char *data)
{
QByteArray startupId(data);
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 4186d77f4d..fb0db727aa 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -46,12 +46,11 @@
#include <QtCore/QRect>
#include "qxcbexport.h"
+#include "qxcbconnection.h"
QT_BEGIN_NAMESPACE
-class QWidget;
class QXcbScreen;
-class QXcbConnection;
class QXcbNativeInterfaceHandler;
class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface
@@ -73,7 +72,11 @@ public:
ScreenSubpixelType,
ScreenAntialiasingEnabled,
AtspiBus,
- CompositingEnabled
+ CompositingEnabled,
+ VkSurface,
+ GeneratePeekerId,
+ RemovePeekerId,
+ PeekEventQueue
};
QXcbNativeInterface();
@@ -113,6 +116,12 @@ public:
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
+ static qint32 generatePeekerId();
+ static bool removePeekerId(qint32 peekerId);
+ static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr,
+ QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault,
+ qint32 peekerId = -1);
+
Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const;
Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window);
Q_INVOKABLE bool systrayVisualHasAlphaChannel();
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 5e136b5d7e..ec0f9ba561 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -65,6 +65,67 @@ QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t
m_compositingActive = connection->getSelectionOwner(m_net_wm_cm_atom);
m_workArea = getWorkArea();
+
+ readXResources();
+
+ auto rootAttribs = Q_XCB_REPLY_UNCHECKED(xcb_get_window_attributes, xcb_connection(),
+ screen->root);
+ const quint32 existingEventMask = !rootAttribs ? 0 : rootAttribs->your_event_mask;
+
+ const quint32 mask = XCB_CW_EVENT_MASK;
+ const quint32 values[] = {
+ // XCB_CW_EVENT_MASK
+ XCB_EVENT_MASK_ENTER_WINDOW
+ | XCB_EVENT_MASK_LEAVE_WINDOW
+ | XCB_EVENT_MASK_PROPERTY_CHANGE
+ | XCB_EVENT_MASK_STRUCTURE_NOTIFY // for the "MANAGER" atom (system tray notification).
+ | existingEventMask // don't overwrite the event mask on the root window
+ };
+
+ xcb_change_window_attributes(xcb_connection(), screen->root, mask, values);
+
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
+ false, screen->root,
+ atom(QXcbAtom::_NET_SUPPORTING_WM_CHECK),
+ XCB_ATOM_WINDOW, 0, 1024);
+ if (reply && reply->format == 32 && reply->type == XCB_ATOM_WINDOW) {
+ xcb_window_t windowManager = *((xcb_window_t *)xcb_get_property_value(reply.get()));
+
+ if (windowManager != XCB_WINDOW_NONE) {
+ auto windowManagerReply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
+ false, windowManager,
+ atom(QXcbAtom::_NET_WM_NAME),
+ atom(QXcbAtom::UTF8_STRING), 0, 1024);
+ if (windowManagerReply && windowManagerReply->format == 8 && windowManagerReply->type == atom(QXcbAtom::UTF8_STRING)) {
+ m_windowManagerName = QString::fromUtf8((const char *)xcb_get_property_value(windowManagerReply.get()),
+ xcb_get_property_value_length(windowManagerReply.get()));
+ }
+ }
+ }
+
+ const xcb_query_extension_reply_t *sync_reply = xcb_get_extension_data(xcb_connection(), &xcb_sync_id);
+ if (!sync_reply || !sync_reply->present)
+ m_syncRequestSupported = false;
+ else
+ m_syncRequestSupported = true;
+
+ xcb_depth_iterator_t depth_iterator =
+ xcb_screen_allowed_depths_iterator(screen);
+
+ while (depth_iterator.rem) {
+ xcb_depth_t *depth = depth_iterator.data;
+ xcb_visualtype_iterator_t visualtype_iterator =
+ xcb_depth_visuals_iterator(depth);
+
+ while (visualtype_iterator.rem) {
+ xcb_visualtype_t *visualtype = visualtype_iterator.data;
+ m_visuals.insert(visualtype->visual_id, *visualtype);
+ m_visualDepths.insert(visualtype->visual_id, depth->depth);
+ xcb_visualtype_next(&visualtype_iterator);
+ }
+
+ xcb_depth_next(&depth_iterator);
+ }
}
QXcbVirtualDesktop::~QXcbVirtualDesktop()
@@ -123,18 +184,33 @@ void QXcbVirtualDesktop::subscribeToXFixesSelectionNotify()
const uint32_t mask = XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER |
XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY |
XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE;
- Q_XCB_CALL(xcb_xfixes_select_selection_input_checked(xcb_connection(), connection()->getQtSelectionOwner(), m_net_wm_cm_atom, mask));
+ xcb_xfixes_select_selection_input_checked(xcb_connection(), connection()->getQtSelectionOwner(), m_net_wm_cm_atom, mask);
}
}
+/*! \internal
+
+ Using _NET_WORKAREA to calculate the available desktop geometry on multi-head systems (systems
+ with more than one monitor) is unreliable. Different WMs have different interpretations of what
+ _NET_WORKAREA means with multiple attached monitors. This gets worse when monitors have
+ different dimensions and/or screens are not virtually aligned. In Qt we want the available
+ geometry per monitor (QScreen), not desktop (represented by _NET_WORKAREA). WM specification
+ does not have an atom for this. Thus, QScreen is limted by the lack of support from the
+ underlying system.
+
+ One option could be that Qt does WM's job of calculating this by subtracting geometries of
+ _NET_WM_STRUT_PARTIAL and windows where _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK.
+ But this won't work on Gnome 3 shell as it seems that on this desktop environment the tool panel
+ is painted directly on the root window. Maybe there is some Gnome/GTK API that could be used
+ to get height of the panel, but I did not find one. Maybe other WMs have their own tricks, so
+ the reliability of this approach is questionable.
+ */
QRect QXcbVirtualDesktop::getWorkArea() const
{
QRect r;
- xcb_get_property_reply_t * workArea =
- xcb_get_property_reply(xcb_connection(),
- xcb_get_property_unchecked(xcb_connection(), false, screen()->root,
- atom(QXcbAtom::_NET_WORKAREA),
- XCB_ATOM_CARDINAL, 0, 1024), NULL);
+ auto workArea = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(), false, screen()->root,
+ atom(QXcbAtom::_NET_WORKAREA),
+ XCB_ATOM_CARDINAL, 0, 1024);
if (workArea && workArea->type == XCB_ATOM_CARDINAL && workArea->format == 32 && workArea->value_len >= 4) {
// If workArea->value_len > 4, the remaining ones seem to be for WM's virtual desktops
// (don't mess with QXcbVirtualDesktop which represents an X screen).
@@ -142,12 +218,11 @@ QRect QXcbVirtualDesktop::getWorkArea() const
// "docked" panel (with _NET_WM_STRUT_PARTIAL atom set) on just one desktop.
// But for now just assume the first 4 values give us the geometry of the
// "work area", AKA "available geometry"
- uint32_t *geom = (uint32_t*)xcb_get_property_value(workArea);
+ uint32_t *geom = (uint32_t*)xcb_get_property_value(workArea.get());
r = QRect(geom[0], geom[1], geom[2], geom[3]);
} else {
r = QRect(QPoint(), size());
}
- free(workArea);
return r;
}
@@ -167,6 +242,170 @@ static inline QSizeF sizeInMillimeters(const QSize &size, const QDpi &dpi)
Q_MM_PER_INCH * size.height() / dpi.second);
}
+bool QXcbVirtualDesktop::xResource(const QByteArray &identifier,
+ const QByteArray &expectedIdentifier,
+ QByteArray& stringValue)
+{
+ if (identifier.startsWith(expectedIdentifier)) {
+ stringValue = identifier.mid(expectedIdentifier.size());
+ return true;
+ }
+ return false;
+}
+
+static bool parseXftInt(const QByteArray& stringValue, int *value)
+{
+ Q_ASSERT(value != 0);
+ bool ok;
+ *value = stringValue.toInt(&ok);
+ return ok;
+}
+
+static QFontEngine::HintStyle parseXftHintStyle(const QByteArray& stringValue)
+{
+ if (stringValue == "hintfull")
+ return QFontEngine::HintFull;
+ else if (stringValue == "hintnone")
+ return QFontEngine::HintNone;
+ else if (stringValue == "hintmedium")
+ return QFontEngine::HintMedium;
+ else if (stringValue == "hintslight")
+ return QFontEngine::HintLight;
+
+ return QFontEngine::HintStyle(-1);
+}
+
+static QFontEngine::SubpixelAntialiasingType parseXftRgba(const QByteArray& stringValue)
+{
+ if (stringValue == "none")
+ return QFontEngine::Subpixel_None;
+ else if (stringValue == "rgb")
+ return QFontEngine::Subpixel_RGB;
+ else if (stringValue == "bgr")
+ return QFontEngine::Subpixel_BGR;
+ else if (stringValue == "vrgb")
+ return QFontEngine::Subpixel_VRGB;
+ else if (stringValue == "vbgr")
+ return QFontEngine::Subpixel_VBGR;
+
+ return QFontEngine::SubpixelAntialiasingType(-1);
+}
+
+void QXcbVirtualDesktop::readXResources()
+{
+ int offset = 0;
+ QByteArray resources;
+ while (true) {
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
+ false, screen()->root,
+ XCB_ATOM_RESOURCE_MANAGER,
+ XCB_ATOM_STRING, offset/4, 8192);
+ bool more = false;
+ if (reply && reply->format == 8 && reply->type == XCB_ATOM_STRING) {
+ resources += QByteArray((const char *)xcb_get_property_value(reply.get()), xcb_get_property_value_length(reply.get()));
+ offset += xcb_get_property_value_length(reply.get());
+ more = reply->bytes_after != 0;
+ }
+
+ if (!more)
+ break;
+ }
+
+ QList<QByteArray> split = resources.split('\n');
+ for (int i = 0; i < split.size(); ++i) {
+ const QByteArray &r = split.at(i);
+ int value;
+ QByteArray stringValue;
+ if (xResource(r, "Xft.dpi:\t", stringValue)) {
+ if (parseXftInt(stringValue, &value))
+ m_forcedDpi = value;
+ } else if (xResource(r, "Xft.hintstyle:\t", stringValue)) {
+ m_hintStyle = parseXftHintStyle(stringValue);
+ } else if (xResource(r, "Xft.antialias:\t", stringValue)) {
+ if (parseXftInt(stringValue, &value))
+ m_antialiasingEnabled = value;
+ } else if (xResource(r, "Xft.rgba:\t", stringValue)) {
+ m_subpixelType = parseXftRgba(stringValue);
+ }
+ }
+}
+
+QSurfaceFormat QXcbVirtualDesktop::surfaceFormatFor(const QSurfaceFormat &format) const
+{
+ const xcb_visualid_t xcb_visualid = connection()->hasDefaultVisualId() ? connection()->defaultVisualId()
+ : screen()->root_visual;
+ const xcb_visualtype_t *xcb_visualtype = visualForId(xcb_visualid);
+
+ const int redSize = qPopulationCount(xcb_visualtype->red_mask);
+ const int greenSize = qPopulationCount(xcb_visualtype->green_mask);
+ const int blueSize = qPopulationCount(xcb_visualtype->blue_mask);
+
+ QSurfaceFormat result = format;
+
+ if (result.redBufferSize() < 0)
+ result.setRedBufferSize(redSize);
+
+ if (result.greenBufferSize() < 0)
+ result.setGreenBufferSize(greenSize);
+
+ if (result.blueBufferSize() < 0)
+ result.setBlueBufferSize(blueSize);
+
+ return result;
+}
+
+const xcb_visualtype_t *QXcbVirtualDesktop::visualForFormat(const QSurfaceFormat &format) const
+{
+ const xcb_visualtype_t *candidate = nullptr;
+
+ for (const xcb_visualtype_t &xcb_visualtype : m_visuals) {
+
+ const int redSize = qPopulationCount(xcb_visualtype.red_mask);
+ const int greenSize = qPopulationCount(xcb_visualtype.green_mask);
+ const int blueSize = qPopulationCount(xcb_visualtype.blue_mask);
+ const int alphaSize = depthOfVisual(xcb_visualtype.visual_id) - redSize - greenSize - blueSize;
+
+ if (format.redBufferSize() != -1 && redSize != format.redBufferSize())
+ continue;
+
+ if (format.greenBufferSize() != -1 && greenSize != format.greenBufferSize())
+ continue;
+
+ if (format.blueBufferSize() != -1 && blueSize != format.blueBufferSize())
+ continue;
+
+ if (format.alphaBufferSize() != -1 && alphaSize != format.alphaBufferSize())
+ continue;
+
+ // Try to find a RGB visual rather than e.g. BGR or GBR
+ if (qCountTrailingZeroBits(xcb_visualtype.blue_mask) == 0)
+ return &xcb_visualtype;
+
+ // In case we do not find anything we like, just remember the first one
+ // and hope for the best:
+ if (!candidate)
+ candidate = &xcb_visualtype;
+ }
+
+ return candidate;
+}
+
+const xcb_visualtype_t *QXcbVirtualDesktop::visualForId(xcb_visualid_t visualid) const
+{
+ QMap<xcb_visualid_t, xcb_visualtype_t>::const_iterator it = m_visuals.find(visualid);
+ if (it == m_visuals.constEnd())
+ return 0;
+ return &*it;
+}
+
+quint8 QXcbVirtualDesktop::depthOfVisual(xcb_visualid_t visualid) const
+{
+ QMap<xcb_visualid_t, quint8>::const_iterator it = m_visualDepths.find(visualid);
+ if (it == m_visualDepths.constEnd())
+ return 0;
+ return *it;
+}
+
QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output,
const xcb_xinerama_screen_info_t *xineramaScreenInfo, int xineramaScreenIdx)
@@ -181,14 +420,11 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
{
if (connection->hasXRandr()) {
xcb_randr_select_input(xcb_connection(), screen()->root, true);
- xcb_randr_get_crtc_info_cookie_t crtcCookie =
- xcb_randr_get_crtc_info_unchecked(xcb_connection(), m_crtc, output ? output->timestamp : 0);
- xcb_randr_get_crtc_info_reply_t *crtc =
- xcb_randr_get_crtc_info_reply(xcb_connection(), crtcCookie, NULL);
+ auto crtc = Q_XCB_REPLY_UNCHECKED(xcb_randr_get_crtc_info, xcb_connection(),
+ m_crtc, output ? output->timestamp : 0);
if (crtc) {
updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation);
updateRefreshRate(crtc->mode);
- free(crtc);
}
} else if (xineramaScreenInfo) {
m_geometry = QRect(xineramaScreenInfo->x_org, xineramaScreenInfo->y_org,
@@ -208,74 +444,19 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
if (m_sizeMillimeters.isEmpty())
m_sizeMillimeters = m_virtualSizeMillimeters;
- readXResources();
-
- QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> rootAttribs(
- xcb_get_window_attributes_reply(xcb_connection(),
- xcb_get_window_attributes_unchecked(xcb_connection(), screen()->root), NULL));
- const quint32 existingEventMask = rootAttribs.isNull() ? 0 : rootAttribs->your_event_mask;
-
- const quint32 mask = XCB_CW_EVENT_MASK;
- const quint32 values[] = {
- // XCB_CW_EVENT_MASK
- XCB_EVENT_MASK_ENTER_WINDOW
- | XCB_EVENT_MASK_LEAVE_WINDOW
- | XCB_EVENT_MASK_PROPERTY_CHANGE
- | XCB_EVENT_MASK_STRUCTURE_NOTIFY // for the "MANAGER" atom (system tray notification).
- | existingEventMask // don't overwrite the event mask on the root window
- };
-
- xcb_change_window_attributes(xcb_connection(), screen()->root, mask, values);
-
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(xcb_connection(),
- xcb_get_property_unchecked(xcb_connection(), false, screen()->root,
- atom(QXcbAtom::_NET_SUPPORTING_WM_CHECK),
- XCB_ATOM_WINDOW, 0, 1024), NULL);
-
- if (reply && reply->format == 32 && reply->type == XCB_ATOM_WINDOW) {
- xcb_window_t windowManager = *((xcb_window_t *)xcb_get_property_value(reply));
-
- if (windowManager != XCB_WINDOW_NONE) {
- xcb_get_property_reply_t *windowManagerReply =
- xcb_get_property_reply(xcb_connection(),
- xcb_get_property_unchecked(xcb_connection(), false, windowManager,
- atom(QXcbAtom::_NET_WM_NAME),
- atom(QXcbAtom::UTF8_STRING), 0, 1024), NULL);
- if (windowManagerReply && windowManagerReply->format == 8 && windowManagerReply->type == atom(QXcbAtom::UTF8_STRING)) {
- m_windowManagerName = QString::fromUtf8((const char *)xcb_get_property_value(windowManagerReply), xcb_get_property_value_length(windowManagerReply));
- }
-
- free(windowManagerReply);
- }
- }
- free(reply);
+ m_cursor = new QXcbCursor(connection, this);
- const xcb_query_extension_reply_t *sync_reply = xcb_get_extension_data(xcb_connection(), &xcb_sync_id);
- if (!sync_reply || !sync_reply->present)
- m_syncRequestSupported = false;
+ // Parse EDID
+ if (m_edid.parse(getEdid()))
+ qCDebug(lcQpaScreen, "EDID data for output \"%s\": identifier '%s', manufacturer '%s', model '%s', serial '%s', physical size: %.2fx%.2f",
+ name().toLatin1().constData(),
+ m_edid.identifier.toLatin1().constData(),
+ m_edid.manufacturer.toLatin1().constData(),
+ m_edid.model.toLatin1().constData(),
+ m_edid.serialNumber.toLatin1().constData(),
+ m_edid.physicalSize.width(), m_edid.physicalSize.height());
else
- m_syncRequestSupported = true;
-
- xcb_depth_iterator_t depth_iterator =
- xcb_screen_allowed_depths_iterator(screen());
-
- while (depth_iterator.rem) {
- xcb_depth_t *depth = depth_iterator.data;
- xcb_visualtype_iterator_t visualtype_iterator =
- xcb_depth_visuals_iterator(depth);
-
- while (visualtype_iterator.rem) {
- xcb_visualtype_t *visualtype = visualtype_iterator.data;
- m_visuals.insert(visualtype->visual_id, *visualtype);
- m_visualDepths.insert(visualtype->visual_id, depth->depth);
- xcb_visualtype_next(&visualtype_iterator);
- }
-
- xcb_depth_next(&depth_iterator);
- }
-
- m_cursor = new QXcbCursor(connection, this);
+ qCDebug(lcQpaScreen) << "Failed to parse EDID data for output" << name(); // keep this debug, not warning
}
QXcbScreen::~QXcbScreen()
@@ -300,6 +481,21 @@ QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo)
return name;
}
+QString QXcbScreen::manufacturer() const
+{
+ return m_edid.manufacturer;
+}
+
+QString QXcbScreen::model() const
+{
+ return m_edid.model;
+}
+
+QString QXcbScreen::serialNumber() const
+{
+ return m_edid.serialNumber;
+}
+
QWindow *QXcbScreen::topLevelAt(const QPoint &p) const
{
xcb_window_t root = screen()->root;
@@ -311,12 +507,7 @@ QWindow *QXcbScreen::topLevelAt(const QPoint &p) const
xcb_window_t child = root;
do {
- xcb_translate_coordinates_cookie_t translate_cookie =
- xcb_translate_coordinates_unchecked(xcb_connection(), parent, child, x, y);
-
- xcb_translate_coordinates_reply_t *translate_reply =
- xcb_translate_coordinates_reply(xcb_connection(), translate_cookie, NULL);
-
+ auto translate_reply = Q_XCB_REPLY_UNCHECKED(xcb_translate_coordinates, xcb_connection(), parent, child, x, y);
if (!translate_reply) {
return 0;
}
@@ -326,8 +517,6 @@ QWindow *QXcbScreen::topLevelAt(const QPoint &p) const
x = translate_reply->dst_x;
y = translate_reply->dst_y;
- free(translate_reply);
-
if (!child || child == root)
return 0;
@@ -350,62 +539,12 @@ void QXcbScreen::windowShown(QXcbWindow *window)
QSurfaceFormat QXcbScreen::surfaceFormatFor(const QSurfaceFormat &format) const
{
- const xcb_visualid_t xcb_visualid = connection()->hasDefaultVisualId() ? connection()->defaultVisualId()
- : screen()->root_visual;
- const xcb_visualtype_t *xcb_visualtype = visualForId(xcb_visualid);
-
- const int redSize = qPopulationCount(xcb_visualtype->red_mask);
- const int greenSize = qPopulationCount(xcb_visualtype->green_mask);
- const int blueSize = qPopulationCount(xcb_visualtype->blue_mask);
-
- QSurfaceFormat result = format;
-
- if (result.redBufferSize() < 0)
- result.setRedBufferSize(redSize);
-
- if (result.greenBufferSize() < 0)
- result.setGreenBufferSize(greenSize);
-
- if (result.blueBufferSize() < 0)
- result.setBlueBufferSize(blueSize);
-
- return result;
+ return m_virtualDesktop->surfaceFormatFor(format);
}
-const xcb_visualtype_t *QXcbScreen::visualForFormat(const QSurfaceFormat &format) const
+const xcb_visualtype_t *QXcbScreen::visualForId(xcb_visualid_t visualid) const
{
- const xcb_visualtype_t *candidate = nullptr;
-
- for (const xcb_visualtype_t &xcb_visualtype : m_visuals) {
-
- const int redSize = qPopulationCount(xcb_visualtype.red_mask);
- const int greenSize = qPopulationCount(xcb_visualtype.green_mask);
- const int blueSize = qPopulationCount(xcb_visualtype.blue_mask);
- const int alphaSize = depthOfVisual(xcb_visualtype.visual_id) - redSize - greenSize - blueSize;
-
- if (format.redBufferSize() != -1 && redSize != format.redBufferSize())
- continue;
-
- if (format.greenBufferSize() != -1 && greenSize != format.greenBufferSize())
- continue;
-
- if (format.blueBufferSize() != -1 && blueSize != format.blueBufferSize())
- continue;
-
- if (format.alphaBufferSize() != -1 && alphaSize != format.alphaBufferSize())
- continue;
-
- // Try to find a RGB visual rather than e.g. BGR or GBR
- if (qCountTrailingZeroBits(xcb_visualtype.blue_mask) == 0)
- return &xcb_visualtype;
-
- // In case we do not find anything we like, just remember the first one
- // and hope for the best:
- if (!candidate)
- candidate = &xcb_visualtype;
- }
-
- return candidate;
+ return m_virtualDesktop->visualForId(visualid);
}
void QXcbScreen::sendStartupMessage(const QByteArray &message) const
@@ -434,20 +573,12 @@ void QXcbScreen::sendStartupMessage(const QByteArray &message) const
} while (sent < length);
}
-const xcb_visualtype_t *QXcbScreen::visualForId(xcb_visualid_t visualid) const
+QRect QXcbScreen::availableGeometry() const
{
- QMap<xcb_visualid_t, xcb_visualtype_t>::const_iterator it = m_visuals.find(visualid);
- if (it == m_visuals.constEnd())
- return 0;
- return &*it;
-}
-
-quint8 QXcbScreen::depthOfVisual(xcb_visualid_t visualid) const
-{
- QMap<xcb_visualid_t, quint8>::const_iterator it = m_visualDepths.find(visualid);
- if (it == m_visualDepths.constEnd())
- return 0;
- return *it;
+ static bool enforceNetWorkarea = !qEnvironmentVariableIsEmpty("QT_RELY_ON_NET_WORKAREA_ATOM");
+ bool isMultiHeadSystem = virtualSiblings().length() > 1;
+ bool useScreenGeometry = isMultiHeadSystem && !enforceNetWorkarea;
+ return useScreenGeometry ? m_geometry : m_availableGeometry;
}
QImage::Format QXcbScreen::format() const
@@ -468,8 +599,9 @@ QDpi QXcbScreen::logicalDpi() const
if (overrideDpi)
return QDpi(overrideDpi, overrideDpi);
- if (m_forcedDpi > 0) {
- return QDpi(m_forcedDpi, m_forcedDpi);
+ const int forcedDpi = m_virtualDesktop->forcedDpi();
+ if (forcedDpi > 0) {
+ return QDpi(forcedDpi, forcedDpi);
}
return virtualDpi();
}
@@ -581,19 +713,14 @@ void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp)
if (!connection()->hasXRandr())
return;
- xcb_randr_get_crtc_info_cookie_t crtcCookie =
- xcb_randr_get_crtc_info_unchecked(xcb_connection(), m_crtc, timestamp);
- xcb_randr_get_crtc_info_reply_t *crtc =
- xcb_randr_get_crtc_info_reply(xcb_connection(), crtcCookie, NULL);
- if (crtc) {
+ auto crtc = Q_XCB_REPLY_UNCHECKED(xcb_randr_get_crtc_info, xcb_connection(),
+ m_crtc, timestamp);
+ if (crtc)
updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation);
- free(crtc);
- }
}
-void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
+void QXcbScreen::updateGeometry(const QRect &geometry, uint8_t rotation)
{
- QRect xGeometry = geom;
switch (rotation) {
case XCB_RANDR_ROTATION_ROTATE_0: // xrandr --rotate normal
m_orientation = Qt::LandscapeOrientation;
@@ -617,12 +744,12 @@ void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
// is known (probably back-calculated from DPI and resolution),
// e.g. on VNC or with some hardware.
if (m_sizeMillimeters.isEmpty())
- m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
+ m_sizeMillimeters = sizeInMillimeters(geometry.size(), virtualDpi());
- qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
+ qreal dpi = geometry.width() / physicalSize().width() * qreal(25.4);
m_pixelDensity = qMax(1, qRound(dpi/96));
- m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
- m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
+ m_geometry = geometry;
+ m_availableGeometry = geometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
}
@@ -645,13 +772,11 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode)
// we can safely use get_screen_resources_current here, because in order to
// get here, we must have called get_screen_resources before
- xcb_randr_get_screen_resources_current_cookie_t resourcesCookie =
- xcb_randr_get_screen_resources_current_unchecked(xcb_connection(), screen()->root);
- xcb_randr_get_screen_resources_current_reply_t *resources =
- xcb_randr_get_screen_resources_current_reply(xcb_connection(), resourcesCookie, NULL);
+ auto resources = Q_XCB_REPLY_UNCHECKED(xcb_randr_get_screen_resources_current,
+ xcb_connection(), screen()->root);
if (resources) {
xcb_randr_mode_info_iterator_t modesIter =
- xcb_randr_get_screen_resources_current_modes_iterator(resources);
+ xcb_randr_get_screen_resources_current_modes_iterator(resources.get());
for (; modesIter.rem; xcb_randr_mode_info_next(&modesIter)) {
xcb_randr_mode_info_t *modeInfo = modesIter.data;
if (modeInfo->id == mode) {
@@ -662,29 +787,19 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode)
}
}
- free(resources);
QWindowSystemInterface::handleScreenRefreshRateChange(QPlatformScreen::screen(), m_refreshRate);
}
}
-static xcb_get_geometry_reply_t *getGeometryUnchecked(xcb_connection_t *connection, xcb_window_t window)
-{
- const xcb_get_geometry_cookie_t geometry_cookie = xcb_get_geometry_unchecked(connection, window);
- return xcb_get_geometry_reply(connection, geometry_cookie, NULL);
-}
-
static inline bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent,
int *x, int *y)
{
- const xcb_translate_coordinates_cookie_t translate_cookie =
- xcb_translate_coordinates_unchecked(connection, child, parent, *x, *y);
- xcb_translate_coordinates_reply_t *translate_reply =
- xcb_translate_coordinates_reply(connection, translate_cookie, NULL);
+ auto translate_reply = Q_XCB_REPLY_UNCHECKED(xcb_translate_coordinates,
+ connection, child, parent, *x, *y);
if (!translate_reply)
return false;
*x = translate_reply->dst_x;
*y = translate_reply->dst_y;
- free(translate_reply);
return true;
}
@@ -698,22 +813,20 @@ QPixmap QXcbScreen::grabWindow(WId window, int xIn, int yIn, int width, int heig
QXcbScreen *screen = const_cast<QXcbScreen *>(this);
xcb_window_t root = screen->root();
- xcb_get_geometry_reply_t *rootReply = getGeometryUnchecked(xcb_connection(), root);
+ auto rootReply = Q_XCB_REPLY_UNCHECKED(xcb_get_geometry, xcb_connection(), root);
if (!rootReply)
return QPixmap();
const quint8 rootDepth = rootReply->depth;
- free(rootReply);
QSize windowSize;
quint8 effectiveDepth = 0;
if (window) {
- xcb_get_geometry_reply_t *windowReply = getGeometryUnchecked(xcb_connection(), window);
+ auto windowReply = Q_XCB_REPLY_UNCHECKED(xcb_get_geometry, xcb_connection(), window);
if (!windowReply)
return QPixmap();
windowSize = QSize(windowReply->width, windowReply->height);
effectiveDepth = windowReply->depth;
- free(windowReply);
if (effectiveDepth == rootDepth) {
// if the depth of the specified window and the root window are the
// same, grab pixels from the root window (so that we get the any
@@ -738,14 +851,12 @@ QPixmap QXcbScreen::grabWindow(WId window, int xIn, int yIn, int width, int heig
if (height < 0)
height = windowSize.height() - yIn;
- xcb_get_window_attributes_reply_t *attributes_reply =
- xcb_get_window_attributes_reply(xcb_connection(), xcb_get_window_attributes_unchecked(xcb_connection(), window), NULL);
+ auto attributes_reply = Q_XCB_REPLY_UNCHECKED(xcb_get_window_attributes, xcb_connection(), window);
if (!attributes_reply)
return QPixmap();
const xcb_visualtype_t *visual = screen->visualForId(attributes_reply->visual);
- free(attributes_reply);
xcb_pixmap_t pixmap = xcb_generate_id(xcb_connection());
xcb_create_pixmap(xcb_connection(), effectiveDepth, pixmap, window, width, height);
@@ -765,101 +876,41 @@ QPixmap QXcbScreen::grabWindow(WId window, int xIn, int yIn, int width, int heig
return result;
}
-static bool parseXftInt(const QByteArray& stringValue, int *value)
+QXcbXSettings *QXcbScreen::xSettings() const
{
- Q_ASSERT(value != 0);
- bool ok;
- *value = stringValue.toInt(&ok);
- return ok;
+ return m_virtualDesktop->xSettings();
}
-static QFontEngine::HintStyle parseXftHintStyle(const QByteArray& stringValue)
+QByteArray QXcbScreen::getOutputProperty(xcb_atom_t atom) const
{
- if (stringValue == "hintfull")
- return QFontEngine::HintFull;
- else if (stringValue == "hintnone")
- return QFontEngine::HintNone;
- else if (stringValue == "hintmedium")
- return QFontEngine::HintMedium;
- else if (stringValue == "hintslight")
- return QFontEngine::HintLight;
-
- return QFontEngine::HintStyle(-1);
-}
+ QByteArray result;
-static QFontEngine::SubpixelAntialiasingType parseXftRgba(const QByteArray& stringValue)
-{
- if (stringValue == "none")
- return QFontEngine::Subpixel_None;
- else if (stringValue == "rgb")
- return QFontEngine::Subpixel_RGB;
- else if (stringValue == "bgr")
- return QFontEngine::Subpixel_BGR;
- else if (stringValue == "vrgb")
- return QFontEngine::Subpixel_VRGB;
- else if (stringValue == "vbgr")
- return QFontEngine::Subpixel_VBGR;
+ auto reply = Q_XCB_REPLY(xcb_randr_get_output_property, xcb_connection(),
+ m_output, atom, XCB_ATOM_ANY, 0, 100, false, false);
+ if (reply && reply->type == XCB_ATOM_INTEGER && reply->format == 8) {
+ quint8 *data = new quint8[reply->num_items];
+ memcpy(data, xcb_randr_get_output_property_data(reply.get()), reply->num_items);
+ result = QByteArray(reinterpret_cast<const char *>(data), reply->num_items);
+ delete[] data;
+ }
- return QFontEngine::SubpixelAntialiasingType(-1);
+ return result;
}
-bool QXcbScreen::xResource(const QByteArray &identifier,
- const QByteArray &expectedIdentifier,
- QByteArray& stringValue)
+QByteArray QXcbScreen::getEdid() const
{
- if (identifier.startsWith(expectedIdentifier)) {
- stringValue = identifier.mid(expectedIdentifier.size());
- return true;
+ // Try a bunch of atoms
+ xcb_atom_t atom = connection()->internAtom("EDID");
+ QByteArray result = getOutputProperty(atom);
+ if (result.isEmpty()) {
+ atom = connection()->internAtom("EDID_DATA");
+ result = getOutputProperty(atom);
}
- return false;
-}
-
-void QXcbScreen::readXResources()
-{
- int offset = 0;
- QByteArray resources;
- while(1) {
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(xcb_connection(),
- xcb_get_property_unchecked(xcb_connection(), false, screen()->root,
- XCB_ATOM_RESOURCE_MANAGER,
- XCB_ATOM_STRING, offset/4, 8192), NULL);
- bool more = false;
- if (reply && reply->format == 8 && reply->type == XCB_ATOM_STRING) {
- resources += QByteArray((const char *)xcb_get_property_value(reply), xcb_get_property_value_length(reply));
- offset += xcb_get_property_value_length(reply);
- more = reply->bytes_after != 0;
- }
-
- if (reply)
- free(reply);
-
- if (!more)
- break;
+ if (result.isEmpty()) {
+ atom = connection()->internAtom("XFree86_DDC_EDID1_RAWDATA");
+ result = getOutputProperty(atom);
}
-
- QList<QByteArray> split = resources.split('\n');
- for (int i = 0; i < split.size(); ++i) {
- const QByteArray &r = split.at(i);
- int value;
- QByteArray stringValue;
- if (xResource(r, "Xft.dpi:\t", stringValue)) {
- if (parseXftInt(stringValue, &value))
- m_forcedDpi = value;
- } else if (xResource(r, "Xft.hintstyle:\t", stringValue)) {
- m_hintStyle = parseXftHintStyle(stringValue);
- } else if (xResource(r, "Xft.antialias:\t", stringValue)) {
- if (parseXftInt(stringValue, &value))
- m_antialiasingEnabled = value;
- } else if (xResource(r, "Xft.rgba:\t", stringValue)) {
- m_subpixelType = parseXftRgba(stringValue);
- }
- }
-}
-
-QXcbXSettings *QXcbScreen::xSettings() const
-{
- return m_virtualDesktop->xSettings();
+ return result;
}
static inline void formatRect(QDebug &debug, const QRect r)
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index 4163be2969..842738b622 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -53,6 +53,8 @@
#include <private/qfontengine_p.h>
+#include <QtEdidSupport/private/qedidparser_p.h>
+
QT_BEGIN_NAMESPACE
class QXcbConnection;
@@ -91,9 +93,28 @@ public:
void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event);
void subscribeToXFixesSelectionNotify();
+ int forcedDpi() const { return m_forcedDpi; }
+ QFontEngine::HintStyle hintStyle() const { return m_hintStyle; }
+ QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; }
+ int antialiasingEnabled() const { return m_antialiasingEnabled; }
+
+ QString windowManagerName() const { return m_windowManagerName; }
+ bool syncRequestSupported() const { return m_syncRequestSupported; }
+
+ QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const;
+
+ const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const;
+ const xcb_visualtype_t *visualForId(xcb_visualid_t) const;
+ quint8 depthOfVisual(xcb_visualid_t) const;
+
private:
QRect getWorkArea() const;
+ static bool xResource(const QByteArray &identifier,
+ const QByteArray &expectedIdentifier,
+ QByteArray &stringValue);
+ void readXResources();
+
xcb_screen_t *m_screen;
const int m_number;
QList<QPlatformScreen *> m_screens;
@@ -103,6 +124,15 @@ private:
bool m_compositingActive = false;
QRect m_workArea;
+
+ int m_forcedDpi = -1;
+ QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1);
+ QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1);
+ int m_antialiasingEnabled = -1;
+ QString m_windowManagerName;
+ bool m_syncRequestSupported = false;
+ QMap<xcb_visualid_t, xcb_visualtype_t> m_visuals;
+ QMap<xcb_visualid_t, quint8> m_visualDepths;
};
class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen
@@ -119,8 +149,12 @@ public:
QWindow *topLevelAt(const QPoint &point) const override;
+ QString manufacturer() const override;
+ QString model() const override;
+ QString serialNumber() const override;
+
QRect geometry() const override { return m_geometry; }
- QRect availableGeometry() const override {return m_availableGeometry;}
+ QRect availableGeometry() const override;
int depth() const override { return screen()->root_depth; }
QImage::Format format() const override;
QSizeF physicalSize() const override { return m_sizeMillimeters; }
@@ -152,37 +186,35 @@ public:
void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; }
void windowShown(QXcbWindow *window);
- QString windowManagerName() const { return m_windowManagerName; }
- bool syncRequestSupported() const { return m_syncRequestSupported; }
+ QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); }
+ bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); }
QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const;
- const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const;
- const xcb_visualtype_t *visualForId(xcb_visualid_t) const;
- quint8 depthOfVisual(xcb_visualid_t) const;
+ const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); }
+ const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const;
+ quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); }
QString name() const override { return m_outputName; }
void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event);
- void updateGeometry(const QRect &geom, uint8_t rotation);
+ void updateGeometry(const QRect &geometry, uint8_t rotation);
void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME);
void updateAvailableGeometry();
void updateRefreshRate(xcb_randr_mode_t mode);
- void readXResources();
-
- QFontEngine::HintStyle hintStyle() const { return m_hintStyle; }
- QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; }
- int antialiasingEnabled() const { return m_antialiasingEnabled; }
+ QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); }
+ QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); }
+ int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); }
QXcbXSettings *xSettings() const;
private:
- static bool xResource(const QByteArray &identifier,
- const QByteArray &expectedIdentifier,
- QByteArray &stringValue);
void sendStartupMessage(const QByteArray &message) const;
+ QByteArray getOutputProperty(xcb_atom_t atom) const;
+ QByteArray getEdid() const;
+
QXcbVirtualDesktop *m_virtualDesktop;
xcb_randr_output_t m_output;
xcb_randr_crtc_t m_crtc;
@@ -198,17 +230,10 @@ private:
QSize m_virtualSize;
QSizeF m_virtualSizeMillimeters;
Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation;
- QString m_windowManagerName;
- bool m_syncRequestSupported = false;
- QMap<xcb_visualid_t, xcb_visualtype_t> m_visuals;
- QMap<xcb_visualid_t, quint8> m_visualDepths;
QXcbCursor *m_cursor;
int m_refreshRate = 60;
- int m_forcedDpi = -1;
int m_pixelDensity = 1;
- QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1);
- QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1);
- int m_antialiasingEnabled = -1;
+ QEdidParser m_edid;
};
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp b/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp
index fb0a4a3939..c98879c7df 100644
--- a/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp
+++ b/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp
@@ -85,13 +85,10 @@ QXcbSystemTrayTracker::QXcbSystemTrayTracker(QXcbConnection *connection,
xcb_window_t QXcbSystemTrayTracker::locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection)
{
- xcb_get_selection_owner_cookie_t cookie = xcb_get_selection_owner(connection->xcb_connection(), selection);
- xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(connection->xcb_connection(), cookie, 0);
+ auto reply = Q_XCB_REPLY(xcb_get_selection_owner, connection->xcb_connection(), selection);
if (!reply)
return 0;
- const xcb_window_t result = reply->owner;
- free(reply);
- return result;
+ return reply->owner;
}
// API for QPlatformNativeInterface/QPlatformSystemTrayIcon: Request a window
@@ -119,7 +116,7 @@ xcb_window_t QXcbSystemTrayTracker::trayWindow()
m_connection->addWindowEventListener(m_trayWindow, this);
const quint32 mask = XCB_CW_EVENT_MASK;
const quint32 value = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
- Q_XCB_CALL2(xcb_change_window_attributes(m_connection->xcb_connection(), m_trayWindow, mask, &value), m_connection);
+ xcb_change_window_attributes(m_connection->xcb_connection(), m_trayWindow, mask, &value);
}
}
return m_trayWindow;
@@ -130,23 +127,16 @@ xcb_window_t QXcbSystemTrayTracker::trayWindow()
// does not work for the QWindow parented on the tray.
QRect QXcbSystemTrayTracker::systemTrayWindowGlobalGeometry(xcb_window_t window) const
{
-
xcb_connection_t *conn = m_connection->xcb_connection();
- xcb_get_geometry_reply_t *geomReply =
- xcb_get_geometry_reply(conn, xcb_get_geometry(conn, window), 0);
+ auto geomReply = Q_XCB_REPLY(xcb_get_geometry, conn, window);
if (!geomReply)
return QRect();
- xcb_translate_coordinates_reply_t *translateReply =
- xcb_translate_coordinates_reply(conn, xcb_translate_coordinates(conn, window, m_connection->rootWindow(), 0, 0), 0);
- if (!translateReply) {
- free(geomReply);
+ auto translateReply = Q_XCB_REPLY(xcb_translate_coordinates, conn, window, m_connection->rootWindow(), 0, 0);
+ if (!translateReply)
return QRect();
- }
- const QRect result(QPoint(translateReply->dst_x, translateReply->dst_y), QSize(geomReply->width, geomReply->height));
- free(translateReply);
- return result;
+ return QRect(QPoint(translateReply->dst_x, translateReply->dst_y), QSize(geomReply->width, geomReply->height));
}
inline void QXcbSystemTrayTracker::emitSystemTrayWindowChanged()
@@ -180,24 +170,18 @@ bool QXcbSystemTrayTracker::visualHasAlphaChannel()
xcb_atom_t tray_atom = m_connection->atom(QXcbAtom::_NET_SYSTEM_TRAY_VISUAL);
// Get the xcb property for the _NET_SYSTEM_TRAY_VISUAL atom
- xcb_get_property_cookie_t systray_atom_cookie;
- xcb_get_property_reply_t *systray_atom_reply;
-
- systray_atom_cookie = xcb_get_property_unchecked(m_connection->xcb_connection(), false, m_trayWindow,
+ auto systray_atom_reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, m_connection->xcb_connection(),
+ false, m_trayWindow,
tray_atom, XCB_ATOM_VISUALID, 0, 1);
- systray_atom_reply = xcb_get_property_reply(m_connection->xcb_connection(), systray_atom_cookie, 0);
-
if (!systray_atom_reply)
return false;
xcb_visualid_t systrayVisualId = XCB_NONE;
- if (systray_atom_reply->value_len > 0 && xcb_get_property_value_length(systray_atom_reply) > 0) {
- xcb_visualid_t * vids = (uint32_t *)xcb_get_property_value(systray_atom_reply);
+ if (systray_atom_reply->value_len > 0 && xcb_get_property_value_length(systray_atom_reply.get()) > 0) {
+ xcb_visualid_t * vids = (uint32_t *)xcb_get_property_value(systray_atom_reply.get());
systrayVisualId = vids[0];
}
- free(systray_atom_reply);
-
if (systrayVisualId != XCB_NONE) {
quint8 depth = m_connection->primaryScreen()->depthOfVisual(systrayVisualId);
return depth == 32;
diff --git a/src/plugins/platforms/xcb/qxcbvulkaninstance.cpp b/src/plugins/platforms/xcb/qxcbvulkaninstance.cpp
new file mode 100644
index 0000000000..4d540defa9
--- /dev/null
+++ b/src/plugins/platforms/xcb/qxcbvulkaninstance.cpp
@@ -0,0 +1,156 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 "qxcbvulkaninstance.h"
+#include "qxcbwindow.h"
+#include "qxcbscreen.h"
+
+QT_BEGIN_NAMESPACE
+
+QXcbVulkanInstance::QXcbVulkanInstance(QVulkanInstance *instance)
+ : m_instance(instance),
+ m_getPhysDevPresSupport(nullptr),
+ m_createSurface(nullptr),
+ m_destroySurface(nullptr)
+{
+ if (qEnvironmentVariableIsSet("QT_VULKAN_LIB"))
+ m_lib.setFileName(QString::fromUtf8(qgetenv("QT_VULKAN_LIB")));
+ else
+ m_lib.setFileName(QStringLiteral("vulkan"));
+
+ if (!m_lib.load()) {
+ qWarning("Failed to load %s: %s", qPrintable(m_lib.fileName()), qPrintable(m_lib.errorString()));
+ return;
+ }
+
+ init(&m_lib);
+}
+
+QXcbVulkanInstance::~QXcbVulkanInstance()
+{
+}
+
+void QXcbVulkanInstance::createOrAdoptInstance()
+{
+ initInstance(m_instance, QByteArrayList() << QByteArrayLiteral("VK_KHR_xcb_surface"));
+
+ if (!m_vkInst)
+ return;
+
+ m_getPhysDevPresSupport = reinterpret_cast<PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkGetPhysicalDeviceXcbPresentationSupportKHR"));
+ if (!m_getPhysDevPresSupport)
+ qWarning("Failed to find vkGetPhysicalDeviceXcbPresentationSupportKHR");
+}
+
+bool QXcbVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice,
+ uint32_t queueFamilyIndex,
+ QWindow *window)
+{
+ if (!m_getPhysDevPresSupport || !m_getPhysDevSurfaceSupport)
+ return true;
+
+ QXcbWindow *w = static_cast<QXcbWindow *>(window->handle());
+ if (!w) {
+ qWarning("Attempted to call supportsPresent() without a valid platform window");
+ return false;
+ }
+ xcb_connection_t *connection = w->xcbScreen()->xcb_connection();
+ bool ok = m_getPhysDevPresSupport(physicalDevice, queueFamilyIndex, connection, w->visualId());
+
+ VkSurfaceKHR surface = QVulkanInstance::surfaceForWindow(window);
+ VkBool32 supported = false;
+ m_getPhysDevSurfaceSupport(physicalDevice, queueFamilyIndex, surface, &supported);
+ ok &= bool(supported);
+
+ return ok;
+}
+
+VkSurfaceKHR QXcbVulkanInstance::createSurface(QXcbWindow *window)
+{
+ VkSurfaceKHR surface = 0;
+
+ if (!m_createSurface) {
+ m_createSurface = reinterpret_cast<PFN_vkCreateXcbSurfaceKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkCreateXcbSurfaceKHR"));
+ }
+ if (!m_createSurface) {
+ qWarning("Failed to find vkCreateXcbSurfaceKHR");
+ return surface;
+ }
+ if (!m_destroySurface) {
+ m_destroySurface = reinterpret_cast<PFN_vkDestroySurfaceKHR>(
+ m_vkGetInstanceProcAddr(m_vkInst, "vkDestroySurfaceKHR"));
+ }
+ if (!m_destroySurface) {
+ qWarning("Failed to find vkDestroySurfaceKHR");
+ return surface;
+ }
+
+ VkXcbSurfaceCreateInfoKHR surfaceInfo;
+ memset(&surfaceInfo, 0, sizeof(surfaceInfo));
+ surfaceInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
+ surfaceInfo.connection = window->xcbScreen()->xcb_connection();
+ surfaceInfo.window = window->xcb_window();
+ VkResult err = m_createSurface(m_vkInst, &surfaceInfo, nullptr, &surface);
+ if (err != VK_SUCCESS)
+ qWarning("Failed to create Vulkan surface: %d", err);
+
+ return surface;
+}
+
+void QXcbVulkanInstance::destroySurface(VkSurfaceKHR surface)
+{
+ if (m_destroySurface && surface)
+ m_destroySurface(m_vkInst, surface, nullptr);
+}
+
+void QXcbVulkanInstance::presentQueued(QWindow *window)
+{
+ QXcbWindow *w = static_cast<QXcbWindow *>(window->handle());
+ if (!w) {
+ qWarning("Attempted to call presentQueued() without a valid platform window");
+ return;
+ }
+
+ if (w->needsSync())
+ w->postSyncWindowRequest();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbvulkaninstance.h b/src/plugins/platforms/xcb/qxcbvulkaninstance.h
new file mode 100644
index 0000000000..dbe057d944
--- /dev/null
+++ b/src/plugins/platforms/xcb/qxcbvulkaninstance.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of 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 QXCBVULKANINSTANCE_H
+#define QXCBVULKANINSTANCE_H
+
+#if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR)
+#error "vulkan.h included without xcb WSI"
+#endif
+
+#define VK_USE_PLATFORM_XCB_KHR
+
+#include <QtVulkanSupport/private/qbasicvulkanplatforminstance_p.h>
+#include <QLibrary>
+
+QT_BEGIN_NAMESPACE
+
+class QXcbWindow;
+
+class QXcbVulkanInstance : public QBasicPlatformVulkanInstance
+{
+public:
+ QXcbVulkanInstance(QVulkanInstance *instance);
+ ~QXcbVulkanInstance();
+
+ void createOrAdoptInstance() override;
+ bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override;
+ void presentQueued(QWindow *window) override;
+
+ VkSurfaceKHR createSurface(QXcbWindow *window);
+ void destroySurface(VkSurfaceKHR surface);
+
+private:
+ QVulkanInstance *m_instance;
+ QLibrary m_lib;
+ PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport;
+ PFN_vkCreateXcbSurfaceKHR m_createSurface;
+ PFN_vkDestroySurfaceKHR m_destroySurface;
+};
+
+QT_END_NAMESPACE
+
+#endif // QXCBVULKANINSTANCE_H
diff --git a/src/plugins/platforms/xcb/qxcbvulkanwindow.cpp b/src/plugins/platforms/xcb/qxcbvulkanwindow.cpp
new file mode 100644
index 0000000000..25bc340f97
--- /dev/null
+++ b/src/plugins/platforms/xcb/qxcbvulkanwindow.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 "qxcbvulkanwindow.h"
+
+QT_BEGIN_NAMESPACE
+
+QXcbVulkanWindow::QXcbVulkanWindow(QWindow *window)
+ : QXcbWindow(window),
+ m_surface(0)
+{
+}
+
+QXcbVulkanWindow::~QXcbVulkanWindow()
+{
+ if (m_surface) {
+ QVulkanInstance *inst = window()->vulkanInstance();
+ if (inst)
+ static_cast<QXcbVulkanInstance *>(inst->handle())->destroySurface(m_surface);
+ }
+}
+
+void QXcbVulkanWindow::resolveFormat(const QSurfaceFormat &format)
+{
+ m_format = format;
+ if (m_format.redBufferSize() <= 0)
+ m_format.setRedBufferSize(8);
+ if (m_format.greenBufferSize() <= 0)
+ m_format.setGreenBufferSize(8);
+ if (m_format.blueBufferSize() <= 0)
+ m_format.setBlueBufferSize(8);
+}
+
+// No createVisual() needed, use the default that picks one based on the R/G/B/A size.
+
+VkSurfaceKHR *QXcbVulkanWindow::surface()
+{
+ if (m_surface)
+ return &m_surface;
+
+ QVulkanInstance *inst = window()->vulkanInstance();
+ if (!inst) {
+ qWarning("Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?");
+ return nullptr;
+ }
+ QXcbVulkanInstance *xcbinst = static_cast<QXcbVulkanInstance *>(inst->handle());
+ m_surface = xcbinst->createSurface(this);
+
+ return &m_surface;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbvulkanwindow.h b/src/plugins/platforms/xcb/qxcbvulkanwindow.h
new file mode 100644
index 0000000000..43c96820c5
--- /dev/null
+++ b/src/plugins/platforms/xcb/qxcbvulkanwindow.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 QXCBVULKANWINDOW_H
+#define QXCBVULKANWINDOW_H
+
+#include "qxcbwindow.h"
+#include "qxcbvulkaninstance.h"
+
+QT_BEGIN_NAMESPACE
+
+class QXcbVulkanWindow : public QXcbWindow
+{
+public:
+ QXcbVulkanWindow(QWindow *window);
+ ~QXcbVulkanWindow();
+
+ VkSurfaceKHR *surface();
+
+protected:
+ void resolveFormat(const QSurfaceFormat &format) override;
+
+private:
+ VkSurfaceKHR m_surface;
+};
+
+QT_END_NAMESPACE
+
+#endif // QXCBVULKANWINDOW_H
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 4acc827bf6..affc2a0dd6 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -227,6 +227,12 @@ static inline QImage::Format imageFormatForVisual(int depth, quint32 red_mask, q
return QImage::Format_RGB555;
}
break;
+#if QT_CONFIG(xcb_native_painting)
+ case 8:
+ if (QXcbIntegration::instance() && QXcbIntegration::instance()->nativePaintingEnabled())
+ return QImage::Format_Indexed8;
+ break;
+#endif
default:
break;
}
@@ -420,6 +426,19 @@ void QXcbWindow::create()
qWarning() << "Failed to use requested visual id.";
}
+ if (parent()) {
+ // When using a Vulkan QWindow via QWidget::createWindowContainer() we
+ // must make sure the visuals are compatible. Now, the parent will be
+ // of RasterGLSurface which typically chooses a GLX/EGL compatible
+ // visual which may not be what the Vulkan window would choose.
+ // Therefore, take the parent's visual.
+ if (window()->surfaceType() == QSurface::VulkanSurface
+ && parent()->window()->surfaceType() != QSurface::VulkanSurface)
+ {
+ visual = platformScreen->visualForId(static_cast<QXcbWindow *>(parent())->visualId());
+ }
+ }
+
if (!visual)
visual = createVisual();
@@ -445,11 +464,11 @@ void QXcbWindow::create()
if ((window()->supportsOpenGL() && haveOpenGL) || m_format.hasAlpha()) {
m_cmap = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_colormap(xcb_connection(),
- XCB_COLORMAP_ALLOC_NONE,
- m_cmap,
- xcb_parent_id,
- m_visualId));
+ xcb_create_colormap(xcb_connection(),
+ XCB_COLORMAP_ALLOC_NONE,
+ m_cmap,
+ xcb_parent_id,
+ m_visualId);
mask |= XCB_CW_COLORMAP;
}
@@ -465,23 +484,23 @@ void QXcbWindow::create()
};
m_window = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_window(xcb_connection(),
- m_depth,
- m_window, // window id
- xcb_parent_id, // parent window id
- rect.x(),
- rect.y(),
- rect.width(),
- rect.height(),
- 0, // border width
- XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
- m_visualId, // visual
- mask,
- values));
+ xcb_create_window(xcb_connection(),
+ m_depth,
+ m_window, // window id
+ xcb_parent_id, // parent window id
+ rect.x(),
+ rect.y(),
+ rect.width(),
+ rect.height(),
+ 0, // border width
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
+ m_visualId, // visual
+ mask,
+ values);
connection()->addWindowEventListener(m_window, this);
- Q_XCB_CALL(xcb_change_window_attributes(xcb_connection(), m_window, mask, values));
+ xcb_change_window_attributes(xcb_connection(), m_window, mask, values);
propagateSizeHints();
@@ -499,43 +518,43 @@ void QXcbWindow::create()
if (window()->flags() & Qt::WindowContextHelpButtonHint)
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_CONTEXT_HELP);
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_window,
- atom(QXcbAtom::WM_PROTOCOLS),
- XCB_ATOM_ATOM,
- 32,
- propertyCount,
- properties));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ atom(QXcbAtom::WM_PROTOCOLS),
+ XCB_ATOM_ATOM,
+ 32,
+ propertyCount,
+ properties);
m_syncValue.hi = 0;
m_syncValue.lo = 0;
const QByteArray wmClass = QXcbIntegration::instance()->wmClass();
if (!wmClass.isEmpty()) {
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE,
- m_window, atom(QXcbAtom::WM_CLASS),
- XCB_ATOM_STRING, 8, wmClass.size(), wmClass.constData()));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE,
+ m_window, atom(QXcbAtom::WM_CLASS),
+ XCB_ATOM_STRING, 8, wmClass.size(), wmClass.constData());
}
if (m_usingSyncProtocol) {
m_syncCounter = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_sync_create_counter(xcb_connection(), m_syncCounter, m_syncValue));
+ xcb_sync_create_counter(xcb_connection(), m_syncCounter, m_syncValue);
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_window,
- atom(QXcbAtom::_NET_WM_SYNC_REQUEST_COUNTER),
- XCB_ATOM_CARDINAL,
- 32,
- 1,
- &m_syncCounter));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ atom(QXcbAtom::_NET_WM_SYNC_REQUEST_COUNTER),
+ XCB_ATOM_CARDINAL,
+ 32,
+ 1,
+ &m_syncCounter);
}
// set the PID to let the WM kill the application if unresponsive
quint32 pid = getpid();
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- atom(QXcbAtom::_NET_WM_PID), XCB_ATOM_CARDINAL, 32,
- 1, &pid));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ atom(QXcbAtom::_NET_WM_PID), XCB_ATOM_CARDINAL, 32,
+ 1, &pid);
xcb_wm_hints_t hints;
memset(&hints, 0, sizeof(hints));
@@ -546,23 +565,27 @@ void QXcbWindow::create()
xcb_set_wm_hints(xcb_connection(), m_window, &hints);
xcb_window_t leader = connection()->clientLeader();
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- atom(QXcbAtom::WM_CLIENT_LEADER), XCB_ATOM_WINDOW, 32,
- 1, &leader));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ atom(QXcbAtom::WM_CLIENT_LEADER), XCB_ATOM_WINDOW, 32,
+ 1, &leader);
/* Add XEMBED info; this operation doesn't initiate the embedding. */
quint32 data[] = { XEMBED_VERSION, XEMBED_MAPPED };
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- atom(QXcbAtom::_XEMBED_INFO),
- atom(QXcbAtom::_XEMBED_INFO),
- 32, 2, (void *)data));
-
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ atom(QXcbAtom::_XEMBED_INFO),
+ atom(QXcbAtom::_XEMBED_INFO),
+ 32, 2, (void *)data);
#if QT_CONFIG(xinput2)
- connection()->xi2Select(m_window);
+ if (connection()->hasXInput2()) {
+ if (connection()->xi2MouseEventsDisabled())
+ connection()->xi2SelectDeviceEventsCompatibility(m_window);
+ else
+ connection()->xi2SelectDeviceEvents(m_window);
+ }
#endif
- setWindowState(window()->windowState());
+ setWindowState(window()->windowStates());
setWindowFlags(window()->flags());
setWindowTitle(window()->title());
@@ -571,7 +594,7 @@ void QXcbWindow::create()
#if QT_CONFIG(xcb_xlib)
// force sync to read outstanding requests - see QTBUG-29106
- XSync(DISPLAY_FROM_XCB(platformScreen), false);
+ XSync(static_cast<Display*>(platformScreen->connection()->xlib_display()), false);
#endif
#ifndef QT_NO_DRAGANDDROP
@@ -581,6 +604,9 @@ void QXcbWindow::create()
const qreal opacity = qt_window_private(window())->opacity;
if (!qFuzzyCompare(opacity, qreal(1.0)))
setOpacity(opacity);
+
+ setMask(QHighDpi::toNativeLocalRegion(window()->mask(), window()));
+
if (window()->isTopLevel())
setWindowIcon(window()->icon());
@@ -618,7 +644,7 @@ void QXcbWindow::destroy()
connection()->setMouseGrabber(Q_NULLPTR);
if (m_syncCounter && m_usingSyncProtocol)
- Q_XCB_CALL(xcb_sync_destroy_counter(xcb_connection(), m_syncCounter));
+ xcb_sync_destroy_counter(xcb_connection(), m_syncCounter);
if (m_window) {
if (m_netWmUserTimeWindow) {
xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_USER_TIME_WINDOW));
@@ -629,7 +655,7 @@ void QXcbWindow::destroy()
m_netWmUserTimeWindow = XCB_NONE;
}
connection()->removeWindowEventListener(m_window);
- Q_XCB_CALL(xcb_destroy_window(xcb_connection(), m_window));
+ xcb_destroy_window(xcb_connection(), m_window);
m_window = 0;
}
if (m_cmap) {
@@ -664,7 +690,7 @@ void QXcbWindow::setGeometry(const QRect &rect)
qBound<qint32>(1, wmGeometry.width(), XCOORD_MAX),
qBound<qint32>(1, wmGeometry.height(), XCOORD_MAX),
};
- Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values)));
+ xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values));
} else {
const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
const qint32 values[] = {
@@ -673,7 +699,7 @@ void QXcbWindow::setGeometry(const QRect &rect)
qBound<qint32>(1, wmGeometry.width(), XCOORD_MAX),
qBound<qint32>(1, wmGeometry.height(), XCOORD_MAX),
};
- Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values)));
+ xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values));
}
xcb_flush(xcb_connection());
@@ -683,12 +709,10 @@ QMargins QXcbWindow::frameMargins() const
{
if (m_dirtyFrameMargins) {
if (connection()->wmSupport()->isSupportedByWM(atom(QXcbAtom::_NET_FRAME_EXTENTS))) {
- xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, m_window,
- atom(QXcbAtom::_NET_FRAME_EXTENTS), XCB_ATOM_CARDINAL, 0, 4);
- QScopedPointer<xcb_get_property_reply_t, QScopedPointerPodDeleter> reply(
- xcb_get_property_reply(xcb_connection(), cookie, NULL));
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, m_window,
+ atom(QXcbAtom::_NET_FRAME_EXTENTS), XCB_ATOM_CARDINAL, 0, 4);
if (reply && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 4) {
- quint32 *data = (quint32 *)xcb_get_property_value(reply.data());
+ quint32 *data = (quint32 *)xcb_get_property_value(reply.get());
// _NET_FRAME_EXTENTS format is left, right, top, bottom
m_frameMargins = QMargins(data[0], data[2], data[1], data[3]);
m_dirtyFrameMargins = false;
@@ -707,9 +731,7 @@ QMargins QXcbWindow::frameMargins() const
connection()->wmSupport()->virtualRoots();
while (!foundRoot) {
- xcb_query_tree_cookie_t cookie = xcb_query_tree_unchecked(xcb_connection(), parent);
-
- xcb_query_tree_reply_t *reply = xcb_query_tree_reply(xcb_connection(), cookie, NULL);
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_query_tree, xcb_connection(), parent);
if (reply) {
if (reply->root == reply->parent || virtualRoots.indexOf(reply->parent) != -1 || reply->parent == XCB_WINDOW_NONE) {
foundRoot = true;
@@ -717,8 +739,6 @@ QMargins QXcbWindow::frameMargins() const
window = parent;
parent = reply->parent;
}
-
- free(reply);
} else {
m_dirtyFrameMargins = false;
m_frameMargins = QMargins();
@@ -728,23 +748,12 @@ QMargins QXcbWindow::frameMargins() const
QPoint offset;
- xcb_translate_coordinates_reply_t *reply =
- xcb_translate_coordinates_reply(
- xcb_connection(),
- xcb_translate_coordinates(xcb_connection(), window, parent, 0, 0),
- NULL);
-
+ auto reply = Q_XCB_REPLY(xcb_translate_coordinates, xcb_connection(), window, parent, 0, 0);
if (reply) {
offset = QPoint(reply->dst_x, reply->dst_y);
- free(reply);
}
- xcb_get_geometry_reply_t *geom =
- xcb_get_geometry_reply(
- xcb_connection(),
- xcb_get_geometry(xcb_connection(), parent),
- NULL);
-
+ auto geom = Q_XCB_REPLY(xcb_get_geometry, xcb_connection(), parent);
if (geom) {
// --
// add the border_width for the window managers frame... some window managers
@@ -761,8 +770,6 @@ QMargins QXcbWindow::frameMargins() const
int bottom = geom->height + geom->border_width - geometry().height() - offset.y();
m_frameMargins = QMargins(left, top, right, bottom);
-
- free(geom);
}
m_dirtyFrameMargins = false;
@@ -789,12 +796,13 @@ static inline bool testShowWithoutActivating(const QWindow *window)
void QXcbWindow::show()
{
if (window()->isTopLevel()) {
+
xcb_get_property_cookie_t cookie = xcb_get_wm_hints_unchecked(xcb_connection(), m_window);
xcb_wm_hints_t hints;
xcb_get_wm_hints_reply(xcb_connection(), cookie, &hints, NULL);
- if (window()->windowState() & Qt::WindowMinimized)
+ if (window()->windowStates() & Qt::WindowMinimized)
xcb_wm_hints_set_iconic(&hints);
else
xcb_wm_hints_set_normal(&hints);
@@ -820,13 +828,13 @@ void QXcbWindow::show()
if (!transientXcbParent)
transientXcbParent = connection()->clientLeader();
if (transientXcbParent) { // ICCCM 4.1.2.6
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32,
- 1, &transientXcbParent));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32,
+ 1, &transientXcbParent);
}
}
if (!transientXcbParent)
- Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, XCB_ATOM_WM_TRANSIENT_FOR));
+ xcb_delete_property(xcb_connection(), m_window, XCB_ATOM_WM_TRANSIENT_FOR);
// update _MOTIF_WM_HINTS
updateMotifWmHintsBeforeMap();
@@ -843,7 +851,7 @@ void QXcbWindow::show()
if (window()->objectName() == QLatin1String("QSystemTrayIconSysWindow"))
return; // defer showing until XEMBED_EMBEDDED_NOTIFY
- Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
+ xcb_map_window(xcb_connection(), m_window);
if (QGuiApplication::modalWindow() == window())
requestActivateWindow();
@@ -855,7 +863,7 @@ void QXcbWindow::show()
void QXcbWindow::hide()
{
- Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window));
+ xcb_unmap_window(xcb_connection(), m_window);
// send synthetic UnmapNotify event according to icccm 4.1.4
Q_DECLARE_XCB_EVENT(event, xcb_unmap_notify_event_t);
@@ -863,8 +871,8 @@ void QXcbWindow::hide()
event.event = xcbScreen()->root();
event.window = m_window;
event.from_configure = false;
- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(),
- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event));
+ xcb_send_event(xcb_connection(), false, xcbScreen()->root(),
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event);
xcb_flush(xcb_connection());
@@ -1012,15 +1020,11 @@ static QtMotifWmHints getMotifWmHints(QXcbConnection *c, xcb_window_t window)
{
QtMotifWmHints hints;
- xcb_get_property_cookie_t get_cookie =
- xcb_get_property_unchecked(c->xcb_connection(), 0, window, c->atom(QXcbAtom::_MOTIF_WM_HINTS),
- c->atom(QXcbAtom::_MOTIF_WM_HINTS), 0, 20);
-
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(c->xcb_connection(), get_cookie, NULL);
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, c->xcb_connection(), 0, window,
+ c->atom(QXcbAtom::_MOTIF_WM_HINTS), c->atom(QXcbAtom::_MOTIF_WM_HINTS), 0, 20);
if (reply && reply->format == 32 && reply->type == c->atom(QXcbAtom::_MOTIF_WM_HINTS)) {
- hints = *((QtMotifWmHints *)xcb_get_property_value(reply));
+ hints = *((QtMotifWmHints *)xcb_get_property_value(reply.get()));
} else {
hints.flags = 0L;
hints.functions = MWM_FUNC_ALL;
@@ -1029,24 +1033,22 @@ static QtMotifWmHints getMotifWmHints(QXcbConnection *c, xcb_window_t window)
hints.status = 0L;
}
- free(reply);
-
return hints;
}
static void setMotifWmHints(QXcbConnection *c, xcb_window_t window, const QtMotifWmHints &hints)
{
if (hints.flags != 0l) {
- Q_XCB_CALL2(xcb_change_property(c->xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- window,
- c->atom(QXcbAtom::_MOTIF_WM_HINTS),
- c->atom(QXcbAtom::_MOTIF_WM_HINTS),
- 32,
- 5,
- &hints), c);
+ xcb_change_property(c->xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ window,
+ c->atom(QXcbAtom::_MOTIF_WM_HINTS),
+ c->atom(QXcbAtom::_MOTIF_WM_HINTS),
+ 32,
+ 5,
+ &hints);
} else {
- Q_XCB_CALL2(xcb_delete_property(c->xcb_connection(), window, c->atom(QXcbAtom::_MOTIF_WM_HINTS)), c);
+ xcb_delete_property(c->xcb_connection(), window, c->atom(QXcbAtom::_MOTIF_WM_HINTS));
}
}
@@ -1054,15 +1056,12 @@ QXcbWindow::NetWmStates QXcbWindow::netWmStates()
{
NetWmStates result(0);
- xcb_get_property_cookie_t get_cookie =
- xcb_get_property_unchecked(xcb_connection(), 0, m_window, atom(QXcbAtom::_NET_WM_STATE),
- XCB_ATOM_ATOM, 0, 1024);
-
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(xcb_connection(), get_cookie, NULL);
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
+ 0, m_window, atom(QXcbAtom::_NET_WM_STATE),
+ XCB_ATOM_ATOM, 0, 1024);
if (reply && reply->format == 32 && reply->type == XCB_ATOM_ATOM) {
- const xcb_atom_t *states = static_cast<const xcb_atom_t *>(xcb_get_property_value(reply));
+ const xcb_atom_t *states = static_cast<const xcb_atom_t *>(xcb_get_property_value(reply.get()));
const xcb_atom_t *statesEnd = states + reply->length;
if (statesEnd != std::find(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_ABOVE)))
result |= NetWmStateAbove;
@@ -1080,7 +1079,6 @@ QXcbWindow::NetWmStates QXcbWindow::netWmStates()
result |= NetWmStateStaysOnTop;
if (statesEnd != std::find(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_DEMANDS_ATTENTION)))
result |= NetWmStateDemandsAttention;
- free(reply);
} else {
#ifdef NET_WM_STATE_DEBUG
printf("getting net wm state (%x), empty\n", m_window);
@@ -1094,21 +1092,15 @@ void QXcbWindow::setNetWmStates(NetWmStates states)
{
QVector<xcb_atom_t> atoms;
- xcb_get_property_cookie_t get_cookie =
- xcb_get_property_unchecked(xcb_connection(), 0, m_window, atom(QXcbAtom::_NET_WM_STATE),
- XCB_ATOM_ATOM, 0, 1024);
-
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(xcb_connection(), get_cookie, NULL);
-
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
+ 0, m_window, atom(QXcbAtom::_NET_WM_STATE),
+ XCB_ATOM_ATOM, 0, 1024);
if (reply && reply->format == 32 && reply->type == XCB_ATOM_ATOM && reply->value_len > 0) {
- const xcb_atom_t *data = static_cast<const xcb_atom_t *>(xcb_get_property_value(reply));
+ const xcb_atom_t *data = static_cast<const xcb_atom_t *>(xcb_get_property_value(reply.get()));
atoms.resize(reply->value_len);
memcpy((void *)&atoms.first(), (void *)data, reply->value_len * sizeof(xcb_atom_t));
}
- free(reply);
-
if (states & NetWmStateAbove && !atoms.contains(atom(QXcbAtom::_NET_WM_STATE_ABOVE)))
atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_ABOVE));
if (states & NetWmStateBelow && !atoms.contains(atom(QXcbAtom::_NET_WM_STATE_BELOW)))
@@ -1127,11 +1119,11 @@ void QXcbWindow::setNetWmStates(NetWmStates states)
atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_DEMANDS_ATTENTION));
if (atoms.isEmpty()) {
- Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_STATE)));
+ xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_STATE));
} else {
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- atom(QXcbAtom::_NET_WM_STATE), XCB_ATOM_ATOM, 32,
- atoms.count(), atoms.constData()));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ atom(QXcbAtom::_NET_WM_STATE), XCB_ATOM_ATOM, 32,
+ atoms.count(), atoms.constData());
}
xcb_flush(xcb_connection());
}
@@ -1254,67 +1246,48 @@ void QXcbWindow::changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two)
event.data.data32[3] = 0;
event.data.data32[4] = 0;
- Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event));
+ xcb_send_event(xcb_connection(), 0, xcbScreen()->root(),
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ (const char *)&event);
}
-void QXcbWindow::setWindowState(Qt::WindowState state)
+void QXcbWindow::setWindowState(Qt::WindowStates state)
{
if (state == m_windowState)
return;
- // unset old state
- switch (m_windowState) {
- case Qt::WindowMinimized:
- Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
- break;
- case Qt::WindowMaximized:
- changeNetWmState(false,
- atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ),
- atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT));
- break;
- case Qt::WindowFullScreen:
- changeNetWmState(false, atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN));
- break;
- default:
- break;
+ if ((m_windowState & Qt::WindowMinimized) && !(state & Qt::WindowMinimized)) {
+ xcb_map_window(xcb_connection(), m_window);
+ } else if (!(m_windowState & Qt::WindowMinimized) && (state & Qt::WindowMinimized)) {
+ xcb_client_message_event_t event;
+
+ event.response_type = XCB_CLIENT_MESSAGE;
+ event.format = 32;
+ event.sequence = 0;
+ event.window = m_window;
+ event.type = atom(QXcbAtom::WM_CHANGE_STATE);
+ event.data.data32[0] = XCB_WM_STATE_ICONIC;
+ event.data.data32[1] = 0;
+ event.data.data32[2] = 0;
+ event.data.data32[3] = 0;
+ event.data.data32[4] = 0;
+
+ xcb_send_event(xcb_connection(), 0, xcbScreen()->root(),
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ (const char *)&event);
+ m_minimized = true;
}
- // set new state
- switch (state) {
- case Qt::WindowMinimized:
- {
- xcb_client_message_event_t event;
-
- event.response_type = XCB_CLIENT_MESSAGE;
- event.format = 32;
- event.sequence = 0;
- event.window = m_window;
- event.type = atom(QXcbAtom::WM_CHANGE_STATE);
- event.data.data32[0] = XCB_WM_STATE_ICONIC;
- event.data.data32[1] = 0;
- event.data.data32[2] = 0;
- event.data.data32[3] = 0;
- event.data.data32[4] = 0;
-
- Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event));
- }
- break;
- case Qt::WindowMaximized:
- changeNetWmState(true,
- atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ),
+ if ((m_windowState ^ state) & Qt::WindowMaximized) {
+ changeNetWmState(state & Qt::WindowMaximized, atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ),
atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT));
- break;
- case Qt::WindowFullScreen:
- changeNetWmState(true, atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN));
- break;
- case Qt::WindowNoState:
- break;
- default:
- break;
}
- connection()->sync();
+ if ((m_windowState ^ state) & Qt::WindowFullScreen) {
+ changeNetWmState(state & Qt::WindowFullScreen, atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN));
+ }
+ connection()->sync();
m_windowState = state;
}
@@ -1386,10 +1359,10 @@ void QXcbWindow::updateNetWmStateBeforeMap()
states |= NetWmStateBelow;
}
- if (window()->windowState() & Qt::WindowFullScreen)
+ if (window()->windowStates() & Qt::WindowFullScreen)
states |= NetWmStateFullScreen;
- if (window()->windowState() & Qt::WindowMaximized) {
+ if (window()->windowStates() & Qt::WindowMaximized) {
states |= NetWmStateMaximizedHorz;
states |= NetWmStateMaximizedVert;
}
@@ -1422,30 +1395,30 @@ void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp)
if (m_netWmUserTimeWindow || isSupportedByWM) {
if (!m_netWmUserTimeWindow) {
m_netWmUserTimeWindow = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_window(xcb_connection(),
- XCB_COPY_FROM_PARENT, // depth -- same as root
- m_netWmUserTimeWindow, // window id
- m_window, // parent window id
- -1, -1, 1, 1,
- 0, // border width
- XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
- m_visualId, // visual
- 0, // value mask
- 0)); // value list
+ xcb_create_window(xcb_connection(),
+ XCB_COPY_FROM_PARENT, // depth -- same as root
+ m_netWmUserTimeWindow, // window id
+ m_window, // parent window id
+ -1, -1, 1, 1,
+ 0, // border width
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
+ m_visualId, // visual
+ 0, // value mask
+ 0); // value list
wid = m_netWmUserTimeWindow;
xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, atom(QXcbAtom::_NET_WM_USER_TIME_WINDOW),
XCB_ATOM_WINDOW, 32, 1, &m_netWmUserTimeWindow);
xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_USER_TIME));
#ifndef QT_NO_DEBUG
QByteArray ba("Qt NET_WM user time window");
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_netWmUserTimeWindow,
- atom(QXcbAtom::_NET_WM_NAME),
- atom(QXcbAtom::UTF8_STRING),
- 8,
- ba.length(),
- ba.constData()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_netWmUserTimeWindow,
+ atom(QXcbAtom::_NET_WM_NAME),
+ atom(QXcbAtom::UTF8_STRING),
+ 8,
+ ba.length(),
+ ba.constData());
#endif
} else if (!isSupportedByWM) {
// WM no longer supports it, then we should remove the
@@ -1519,26 +1492,27 @@ void QXcbWindow::setParent(const QPlatformWindow *parent)
xcb_parent_id = xcbScreen()->root();
m_embedded = false;
}
- Q_XCB_CALL(xcb_reparent_window(xcb_connection(), xcb_window(), xcb_parent_id, topLeft.x(), topLeft.y()));
+ xcb_reparent_window(xcb_connection(), xcb_window(), xcb_parent_id, topLeft.x(), topLeft.y());
}
void QXcbWindow::setWindowTitle(const QString &title)
{
QString fullTitle = formatWindowTitle(title, QString::fromUtf8(" \xe2\x80\x94 ")); // unicode character U+2014, EM DASH
const QByteArray ba = std::move(fullTitle).toUtf8();
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
+ xcb_change_property(xcb_connection(),
XCB_PROP_MODE_REPLACE,
m_window,
atom(QXcbAtom::_NET_WM_NAME),
atom(QXcbAtom::UTF8_STRING),
8,
ba.length(),
- ba.constData()));
+ ba.constData());
#if QT_CONFIG(xcb_xlib)
- XTextProperty *text = qstringToXTP(DISPLAY_FROM_XCB(this), title);
+ Display *dpy = static_cast<Display *>(connection()->xlib_display());
+ XTextProperty *text = qstringToXTP(dpy, title);
if (text)
- XSetWMName(DISPLAY_FROM_XCB(this), m_window, text);
+ XSetWMName(dpy, m_window, text);
#endif
xcb_flush(xcb_connection());
}
@@ -1546,14 +1520,14 @@ void QXcbWindow::setWindowTitle(const QString &title)
void QXcbWindow::setWindowIconText(const QString &title)
{
const QByteArray ba = title.toUtf8();
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_window,
- atom(QXcbAtom::_NET_WM_ICON_NAME),
- atom(QXcbAtom::UTF8_STRING),
- 8,
- ba.length(),
- ba.constData()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ atom(QXcbAtom::_NET_WM_ICON_NAME),
+ atom(QXcbAtom::UTF8_STRING),
+ 8,
+ ba.length(),
+ ba.constData());
}
void QXcbWindow::setWindowIcon(const QIcon &icon)
@@ -1583,18 +1557,18 @@ void QXcbWindow::setWindowIcon(const QIcon &icon)
}
if (!icon_data.isEmpty()) {
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_window,
- atom(QXcbAtom::_NET_WM_ICON),
- atom(QXcbAtom::CARDINAL),
- 32,
- icon_data.size(),
- (unsigned char *) icon_data.data()));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ atom(QXcbAtom::_NET_WM_ICON),
+ atom(QXcbAtom::CARDINAL),
+ 32,
+ icon_data.size(),
+ (unsigned char *) icon_data.data());
} else {
- Q_XCB_CALL(xcb_delete_property(xcb_connection(),
- m_window,
- atom(QXcbAtom::_NET_WM_ICON)));
+ xcb_delete_property(xcb_connection(),
+ m_window,
+ atom(QXcbAtom::_NET_WM_ICON));
}
}
@@ -1602,14 +1576,14 @@ void QXcbWindow::raise()
{
const quint32 mask = XCB_CONFIG_WINDOW_STACK_MODE;
const quint32 values[] = { XCB_STACK_MODE_ABOVE };
- Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, values));
+ xcb_configure_window(xcb_connection(), m_window, mask, values);
}
void QXcbWindow::lower()
{
const quint32 mask = XCB_CONFIG_WINDOW_STACK_MODE;
const quint32 values[] = { XCB_STACK_MODE_BELOW };
- Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, values));
+ xcb_configure_window(xcb_connection(), m_window, mask, values);
}
// Adapt the geometry to match the WM expection with regards
@@ -1703,9 +1677,11 @@ void QXcbWindow::requestActivateWindow()
event.data.data32[3] = 0;
event.data.data32[4] = 0;
- Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event));
+ xcb_send_event(xcb_connection(), 0, xcbScreen()->root(),
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ (const char *)&event);
} else {
- Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time()));
+ xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time());
}
connection()->sync();
@@ -1749,15 +1725,11 @@ QXcbWindowFunctions::WmWindowTypes QXcbWindow::wmWindowTypes() const
{
QXcbWindowFunctions::WmWindowTypes result(0);
- xcb_get_property_cookie_t get_cookie =
- xcb_get_property_unchecked(xcb_connection(), 0, m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE),
- XCB_ATOM_ATOM, 0, 1024);
-
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(xcb_connection(), get_cookie, NULL);
-
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
+ 0, m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE),
+ XCB_ATOM_ATOM, 0, 1024);
if (reply && reply->format == 32 && reply->type == XCB_ATOM_ATOM) {
- const xcb_atom_t *types = static_cast<const xcb_atom_t *>(xcb_get_property_value(reply));
+ const xcb_atom_t *types = static_cast<const xcb_atom_t *>(xcb_get_property_value(reply.get()));
const xcb_atom_t *types_end = types + reply->length;
for (; types != types_end; types++) {
QXcbAtom::Atom type = connection()->qatom(*types);
@@ -1811,7 +1783,6 @@ QXcbWindowFunctions::WmWindowTypes QXcbWindow::wmWindowTypes() const
break;
}
}
- free(reply);
}
return result;
}
@@ -1894,20 +1865,20 @@ void QXcbWindow::setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::W
atoms.append(atom(QXcbAtom::_NET_WM_WINDOW_TYPE_NORMAL));
if (atoms.isEmpty()) {
- Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE)));
+ xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE));
} else {
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- atom(QXcbAtom::_NET_WM_WINDOW_TYPE), XCB_ATOM_ATOM, 32,
- atoms.count(), atoms.constData()));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ atom(QXcbAtom::_NET_WM_WINDOW_TYPE), XCB_ATOM_ATOM, 32,
+ atoms.count(), atoms.constData());
}
xcb_flush(xcb_connection());
}
void QXcbWindow::setWmWindowRole(const QByteArray &role)
{
- Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
- atom(QXcbAtom::WM_WINDOW_ROLE), XCB_ATOM_STRING, 8,
- role.size(), role.constData()));
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ atom(QXcbAtom::WM_WINDOW_ROLE), XCB_ATOM_STRING, 8,
+ role.size(), role.constData());
}
void QXcbWindow::setParentRelativeBackPixmapStatic(QWindow *window)
@@ -1920,7 +1891,7 @@ void QXcbWindow::setParentRelativeBackPixmap()
{
const quint32 mask = XCB_CW_BACK_PIXMAP;
const quint32 values[] = { XCB_BACK_PIXMAP_PARENT_RELATIVE };
- Q_XCB_CALL(xcb_change_window_attributes(xcb_connection(), m_window, mask, values));
+ xcb_change_window_attributes(xcb_connection(), m_window, mask, values);
}
bool QXcbWindow::requestSystemTrayWindowDockStatic(const QWindow *window)
@@ -2011,11 +1982,7 @@ void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event)
{
QRect rect(event->x, event->y, event->width, event->height);
- if (m_exposeRegion.isEmpty())
- m_exposeRegion = rect;
- else
- m_exposeRegion |= rect;
-
+ m_exposeRegion |= rect;
bool pending = compressExposeEvent(m_exposeRegion);
// if count is non-zero there are more expose events pending
@@ -2097,13 +2064,11 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
QPoint pos(event->x, event->y);
if (!parent() && !fromSendEvent) {
// Do not trust the position, query it instead.
- xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(),
- xcbScreen()->root(), 0, 0);
- xcb_translate_coordinates_reply_t *reply = xcb_translate_coordinates_reply(xcb_connection(), cookie, NULL);
+ auto reply = Q_XCB_REPLY(xcb_translate_coordinates, xcb_connection(),
+ xcb_window(), xcbScreen()->root(), 0, 0);
if (reply) {
pos.setX(reply->dst_x);
pos.setY(reply->dst_y);
- free(reply);
}
}
@@ -2112,14 +2077,6 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
if (!newScreen)
return;
- // Persist the actual geometry so that QWindow::geometry() can
- // be queried in the resize event.
- QPlatformWindow::setGeometry(actualGeometry);
-
- // FIXME: In the case of the requestedGeometry not matching the actualGeometry due
- // to e.g. the window manager applying restrictions to the geometry, the application
- // will never see a move/resize event if the actualGeometry is the same as the current
- // geometry, and may think the requested geometry was fulfilled.
QWindowSystemInterface::handleGeometryChange(window(), actualGeometry);
// QPlatformScreen::screen() is updated asynchronously, so we can't compare it
@@ -2158,15 +2115,12 @@ QPoint QXcbWindow::mapToGlobal(const QPoint &pos) const
return pos;
QPoint ret;
- xcb_translate_coordinates_cookie_t cookie =
- xcb_translate_coordinates(xcb_connection(), xcb_window(), xcbScreen()->root(),
- pos.x(), pos.y());
- xcb_translate_coordinates_reply_t *reply =
- xcb_translate_coordinates_reply(xcb_connection(), cookie, NULL);
+ auto reply = Q_XCB_REPLY(xcb_translate_coordinates, xcb_connection(),
+ xcb_window(), xcbScreen()->root(),
+ pos.x(), pos.y());
if (reply) {
ret.setX(reply->dst_x);
ret.setY(reply->dst_y);
- free(reply);
}
return ret;
@@ -2178,15 +2132,12 @@ QPoint QXcbWindow::mapFromGlobal(const QPoint &pos) const
return pos;
QPoint ret;
- xcb_translate_coordinates_cookie_t cookie =
- xcb_translate_coordinates(xcb_connection(), xcbScreen()->root(), xcb_window(),
- pos.x(), pos.y());
- xcb_translate_coordinates_reply_t *reply =
- xcb_translate_coordinates_reply(xcb_connection(), cookie, NULL);
+ auto reply = Q_XCB_REPLY(xcb_translate_coordinates, xcb_connection(),
+ xcbScreen()->root(), xcb_window(),
+ pos.x(), pos.y());
if (reply) {
ret.setX(reply->dst_x);
ret.setY(reply->dst_y);
- free(reply);
}
return ret;
@@ -2238,16 +2189,24 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
QPoint global(root_x, root_y);
if (isWheel) {
+#if QT_CONFIG(xinput2)
if (!connection()->isAtLeastXI21()) {
- // Logic borrowed from qapplication_x11.cpp
- int delta = 120 * ((detail == 4 || detail == 6) ? 1 : -1);
- bool hor = (((detail == 4 || detail == 5)
- && (modifiers & Qt::AltModifier))
- || (detail == 6 || detail == 7));
-
- QWindowSystemInterface::handleWheelEvent(window(), timestamp,
- local, global, delta, hor ? Qt::Horizontal : Qt::Vertical, modifiers);
+#endif
+ QPoint angleDelta;
+ if (detail == 4)
+ angleDelta.setY(120);
+ else if (detail == 5)
+ angleDelta.setY(-120);
+ else if (detail == 6)
+ angleDelta.setX(120);
+ else if (detail == 7)
+ angleDelta.setX(-120);
+ if (modifiers & Qt::AltModifier)
+ std::swap(angleDelta.rx(), angleDelta.ry());
+ QWindowSystemInterface::handleWheelEvent(window(), timestamp, local, global, QPoint(), angleDelta, modifiers);
+#if QT_CONFIG(xinput2)
}
+#endif
return;
}
@@ -2267,7 +2226,7 @@ void QXcbWindow::handleButtonReleaseEvent(int event_x, int event_y, int root_x,
return;
}
- if (connection()->buttons() == Qt::NoButton)
+ if (connection()->buttonState() == Qt::NoButton)
connection()->setMousePressWindow(Q_NULLPTR);
handleMouseEvent(timestamp, local, global, modifiers, source);
@@ -2282,9 +2241,10 @@ static inline bool doCheckUnGrabAncestor(QXcbConnection *conn)
* not pressed, otherwise (e.g. on Alt+Tab) it can igonre important enter/leave events.
*/
if (conn) {
- const bool mouseButtonsPressed = (conn->buttons() != Qt::NoButton);
-#ifdef XCB_USE_XINPUT22
- return mouseButtonsPressed || (conn->isAtLeastXI22() && conn->xi2MouseEvents());
+
+ const bool mouseButtonsPressed = (conn->buttonState() != Qt::NoButton);
+#if QT_CONFIG(xinput2)
+ return mouseButtonsPressed || (conn->hasXInput2() && !conn->xi2MouseEventsDisabled());
#else
return mouseButtonsPressed;
#endif
@@ -2333,7 +2293,8 @@ void QXcbWindow::handleEnterNotifyEvent(int event_x, int event_y, int root_x, in
{
connection()->setTime(timestamp);
#ifdef XCB_USE_XINPUT21
- connection()->handleEnterEvent();
+ // Updates scroll valuators, as user might have done some scrolling outside our X client.
+ connection()->xi2UpdateScrollingDevices();
#endif
const QPoint global = QPoint(root_x, root_y);
@@ -2376,7 +2337,7 @@ void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, i
// "mousePressWindow" can be NULL i.e. if a window will be grabbed or unmapped, so set it again here.
// Unset "mousePressWindow" when mouse button isn't pressed - in some cases the release event won't arrive.
- const bool isMouseButtonPressed = (connection()->buttons() != Qt::NoButton);
+ const bool isMouseButtonPressed = (connection()->buttonState() != Qt::NoButton);
const bool hasMousePressWindow = (connection()->mousePressWindow() != Q_NULLPTR);
if (isMouseButtonPressed && !hasMousePressWindow)
connection()->setMousePressWindow(this);
@@ -2386,7 +2347,6 @@ void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, i
handleMouseEvent(timestamp, local, global, modifiers, source);
}
-// Handlers for plain xcb events. Used only when XI 2.2 or newer is not available.
void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
{
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
@@ -2407,13 +2367,12 @@ void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event)
handleMotionNotifyEvent(event->event_x, event->event_y, event->root_x, event->root_y, modifiers, event->time);
}
-#ifdef XCB_USE_XINPUT22
+#if QT_CONFIG(xinput2)
static inline int fixed1616ToInt(FP1616 val)
{
return int((qreal(val >> 16)) + (val & 0xFFFF) / (qreal)0xFFFF);
}
-// With XI 2.2+ press/release/motion comes here instead of the above handlers.
void QXcbWindow::handleXIMouseEvent(xcb_ge_event_t *event, Qt::MouseEventSource source)
{
QXcbConnection *conn = connection();
@@ -2431,7 +2390,7 @@ void QXcbWindow::handleXIMouseEvent(xcb_ge_event_t *event, Qt::MouseEventSource
return;
}
for (int i = 1; i <= 15; ++i)
- conn->setButton(conn->translateMouseButton(i), XIMaskIsSet(buttonMask, i));
+ conn->setButtonState(conn->translateMouseButton(i), XIMaskIsSet(buttonMask, i));
}
const Qt::KeyboardModifiers modifiers = conn->keyboard()->translateModifiers(ev->mods.effective_mods);
@@ -2455,13 +2414,13 @@ void QXcbWindow::handleXIMouseEvent(xcb_ge_event_t *event, Qt::MouseEventSource
case XI_ButtonPress:
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 mouse press, button %d, time %d, source %s", button, ev->time, sourceName);
- conn->setButton(button, true);
+ conn->setButtonState(button, true);
handleButtonPressEvent(event_x, event_y, root_x, root_y, ev->detail, modifiers, ev->time, source);
break;
case XI_ButtonRelease:
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 mouse release, button %d, time %d, source %s", button, ev->time, sourceName);
- conn->setButton(button, false);
+ conn->setButtonState(button, false);
handleButtonReleaseEvent(event_x, event_y, root_x, root_y, ev->detail, modifiers, ev->time, source);
break;
case XI_Motion:
@@ -2475,7 +2434,6 @@ void QXcbWindow::handleXIMouseEvent(xcb_ge_event_t *event, Qt::MouseEventSource
}
}
-// With XI 2.2+ enter/leave comes here and are blocked in plain xcb events
void QXcbWindow::handleXIEnterLeave(xcb_ge_event_t *event)
{
xXIEnterEvent *ev = reinterpret_cast<xXIEnterEvent *>(event);
@@ -2495,12 +2453,14 @@ void QXcbWindow::handleXIEnterLeave(xcb_ge_event_t *event)
case XI_Enter: {
const int event_x = fixed1616ToInt(ev->event_x);
const int event_y = fixed1616ToInt(ev->event_y);
- qCDebug(lcQpaXInput, "XI2 mouse enter %d,%d, mode %d, detail %d, time %d", event_x, event_y, ev->mode, ev->detail, ev->time);
+ qCDebug(lcQpaXInputEvents, "XI2 mouse enter %d,%d, mode %d, detail %d, time %d",
+ event_x, event_y, ev->mode, ev->detail, ev->time);
handleEnterNotifyEvent(event_x, event_y, root_x, root_y, ev->mode, ev->detail, ev->time);
break;
}
case XI_Leave:
- qCDebug(lcQpaXInput, "XI2 mouse leave, mode %d, detail %d, time %d", ev->mode, ev->detail, ev->time);
+ qCDebug(lcQpaXInputEvents, "XI2 mouse leave, mode %d, detail %d, time %d",
+ ev->mode, ev->detail, ev->time);
connection()->keyboard()->updateXKBStateFromXI(&ev->mods, &ev->group);
handleLeaveNotifyEvent(root_x, root_y, ev->mode, ev->detail, ev->time);
break;
@@ -2514,7 +2474,7 @@ void QXcbWindow::handleMouseEvent(xcb_timestamp_t time, const QPoint &local, con
Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source)
{
connection()->setTime(time);
- QWindowSystemInterface::handleMouseEvent(window(), time, local, global, connection()->buttons(), modifiers, source);
+ QWindowSystemInterface::handleMouseEvent(window(), time, local, global, connection()->buttonState(), modifiers, source);
}
void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event)
@@ -2537,44 +2497,33 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev
if (propertyDeleted)
return;
- Qt::WindowState newState = Qt::WindowNoState;
- if (event->atom == atom(QXcbAtom::WM_STATE)) { // WM_STATE: Quick check for 'Minimize'.
- const xcb_get_property_cookie_t get_cookie =
- xcb_get_property(xcb_connection(), 0, m_window, atom(QXcbAtom::WM_STATE),
- XCB_ATOM_ANY, 0, 1024);
-
- xcb_get_property_reply_t *reply =
- xcb_get_property_reply(xcb_connection(), get_cookie, NULL);
+ Qt::WindowStates newState = Qt::WindowNoState;
+ if (event->atom == atom(QXcbAtom::WM_STATE)) { // WM_STATE: Quick check for 'Minimize'.
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(),
+ 0, m_window, atom(QXcbAtom::WM_STATE),
+ XCB_ATOM_ANY, 0, 1024);
if (reply && reply->format == 32 && reply->type == atom(QXcbAtom::WM_STATE)) {
- const quint32 *data = (const quint32 *)xcb_get_property_value(reply);
- if (reply->length != 0) {
- if (data[0] == XCB_WM_STATE_ICONIC
- || (data[0] == XCB_WM_STATE_WITHDRAWN
- && m_lastWindowStateEvent == Qt::WindowMinimized)) {
- newState = Qt::WindowMinimized;
- }
- }
+ const quint32 *data = (const quint32 *)xcb_get_property_value(reply.get());
+ if (reply->length != 0)
+ m_minimized = (data[0] == XCB_WM_STATE_ICONIC
+ || (data[0] == XCB_WM_STATE_WITHDRAWN && m_minimized));
}
- free(reply);
- } else { // _NET_WM_STATE can't change minimized state
- if (m_lastWindowStateEvent == Qt::WindowMinimized)
- newState = Qt::WindowMinimized;
- }
-
- if (newState != Qt::WindowMinimized) { // Something else changed, get _NET_WM_STATE.
- const NetWmStates states = netWmStates();
- if (states & NetWmStateFullScreen)
- newState = Qt::WindowFullScreen;
- else if ((states & NetWmStateMaximizedHorz) && (states & NetWmStateMaximizedVert))
- newState = Qt::WindowMaximized;
}
+ if (m_minimized)
+ newState = Qt::WindowMinimized;
+
+ const NetWmStates states = netWmStates();
+ if (states & NetWmStateFullScreen)
+ newState |= Qt::WindowFullScreen;
+ if ((states & NetWmStateMaximizedHorz) && (states & NetWmStateMaximizedVert))
+ newState |= Qt::WindowMaximized;
// Send Window state, compress events in case other flags (modality, etc) are changed.
if (m_lastWindowStateEvent != newState) {
QWindowSystemInterface::handleWindowStateChanged(window(), newState);
m_lastWindowStateEvent = newState;
m_windowState = newState;
- if (m_windowState == Qt::WindowMinimized && connection()->mouseGrabber() == this)
+ if ((m_windowState & Qt::WindowMinimized) && connection()->mouseGrabber() == this)
connection()->setMouseGrabber(Q_NULLPTR);
}
return;
@@ -2609,7 +2558,7 @@ void QXcbWindow::updateSyncRequestCounter()
return;
}
if (m_usingSyncProtocol && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) {
- Q_XCB_CALL(xcb_sync_set_counter(xcb_connection(), m_syncCounter, m_syncValue));
+ xcb_sync_set_counter(xcb_connection(), m_syncCounter, m_syncValue);
xcb_flush(xcb_connection());
m_syncValue.lo = 0;
@@ -2633,21 +2582,20 @@ bool QXcbWindow::setKeyboardGrabEnabled(bool grab)
xcb_ungrab_keyboard(xcb_connection(), XCB_TIME_CURRENT_TIME);
return true;
}
- xcb_grab_keyboard_cookie_t cookie = xcb_grab_keyboard(xcb_connection(), false,
- m_window, XCB_TIME_CURRENT_TIME,
- XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
- xcb_grab_keyboard_reply_t *reply = xcb_grab_keyboard_reply(xcb_connection(), cookie, NULL);
- bool result = !(!reply || reply->status != XCB_GRAB_STATUS_SUCCESS);
- free(reply);
- return result;
+
+ auto reply = Q_XCB_REPLY(xcb_grab_keyboard, xcb_connection(), false,
+ m_window, XCB_TIME_CURRENT_TIME,
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
+ return reply && reply->status == XCB_GRAB_STATUS_SUCCESS;
}
bool QXcbWindow::setMouseGrabEnabled(bool grab)
{
if (!grab && connection()->mouseGrabber() == this)
connection()->setMouseGrabber(Q_NULLPTR);
-#ifdef XCB_USE_XINPUT22
- if (connection()->isAtLeastXI22() && connection()->xi2MouseEvents()) {
+
+#if QT_CONFIG(xinput2)
+ if (connection()->hasXInput2() && !connection()->xi2MouseEventsDisabled()) {
bool result = connection()->xi2SetMouseGrabEnabled(m_window, grab);
if (grab && result)
connection()->setMouseGrabber(this);
@@ -2661,16 +2609,16 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab)
xcb_ungrab_pointer(xcb_connection(), XCB_TIME_CURRENT_TIME);
return true;
}
- xcb_grab_pointer_cookie_t cookie = xcb_grab_pointer(xcb_connection(), false, m_window,
- (XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE
- | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_ENTER_WINDOW
- | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_POINTER_MOTION),
- XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
- XCB_WINDOW_NONE, XCB_CURSOR_NONE,
- XCB_TIME_CURRENT_TIME);
- xcb_grab_pointer_reply_t *reply = xcb_grab_pointer_reply(xcb_connection(), cookie, NULL);
- bool result = !(!reply || reply->status != XCB_GRAB_STATUS_SUCCESS);
- free(reply);
+
+ auto reply = Q_XCB_REPLY(xcb_grab_pointer, xcb_connection(),
+ false, m_window,
+ (XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE
+ | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_ENTER_WINDOW
+ | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_POINTER_MOTION),
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
+ XCB_WINDOW_NONE, XCB_CURSOR_NONE,
+ XCB_TIME_CURRENT_TIME);
+ bool result = reply && reply->status == XCB_GRAB_STATUS_SUCCESS;
if (result)
connection()->setMouseGrabber(this);
return result;
@@ -2778,8 +2726,7 @@ void QXcbWindow::sendXEmbedMessage(xcb_window_t window, quint32 message,
event.data.data32[2] = detail;
event.data.data32[3] = data1;
event.data.data32[4] = data2;
- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, window,
- XCB_EVENT_MASK_NO_EVENT, (const char *)&event));
+ xcb_send_event(xcb_connection(), false, window, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);
}
static bool activeWindowChangeQueued(const QWindow *window)
@@ -2801,12 +2748,12 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event)
case XEMBED_WINDOW_DEACTIVATE:
break;
case XEMBED_EMBEDDED_NOTIFY:
- Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
+ xcb_map_window(xcb_connection(), m_window);
xcbScreen()->windowShown(this);
// Without Qt::WA_TranslucentBackground, we use a ParentRelative BackPixmap.
// Clear the whole tray icon window to its background color as early as possible
// so that we can get a clean result from grabWindow() later.
- Q_XCB_CALL(xcb_clear_area(xcb_connection(), false, m_window, 0, 0, geometry().width(), geometry().height()));
+ xcb_clear_area(xcb_connection(), false, m_window, 0, 0, geometry().width(), geometry().height());
xcb_flush(xcb_connection());
break;
case XEMBED_FOCUS_IN:
@@ -2853,14 +2800,14 @@ void QXcbWindow::setOpacity(qreal level)
quint32 value = qRound64(qBound(qreal(0), level, qreal(1)) * 0xffffffff);
- Q_XCB_CALL(xcb_change_property(xcb_connection(),
- XCB_PROP_MODE_REPLACE,
- m_window,
- atom(QXcbAtom::_NET_WM_WINDOW_OPACITY),
- XCB_ATOM_CARDINAL,
- 32,
- 1,
- (uchar *)&value));
+ xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ atom(QXcbAtom::_NET_WM_WINDOW_OPACITY),
+ XCB_ATOM_CARDINAL,
+ 32,
+ 1,
+ (uchar *)&value);
}
void QXcbWindow::setMask(const QRegion &region)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index f38343b6c2..1ce9b0a42f 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -82,7 +82,7 @@ public:
void setVisible(bool visible) override;
void setWindowFlags(Qt::WindowFlags flags) override;
- void setWindowState(Qt::WindowState state) override;
+ void setWindowState(Qt::WindowStates state) override;
WId winId() const override;
void setParent(const QPlatformWindow *window) override;
@@ -138,7 +138,7 @@ public:
void handleFocusInEvent(const xcb_focus_in_event_t *event) override;
void handleFocusOutEvent(const xcb_focus_out_event_t *event) override;
void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override;
-#ifdef XCB_USE_XINPUT22
+#if QT_CONFIG(xinput2)
void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override;
void handleXIEnterLeave(xcb_ge_event_t *) override;
#endif
@@ -244,7 +244,7 @@ protected:
xcb_sync_int64_t m_syncValue;
xcb_sync_counter_t m_syncCounter = 0;
- Qt::WindowState m_windowState = Qt::WindowNoState;
+ Qt::WindowStates m_windowState = Qt::WindowNoState;
xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC;
@@ -254,6 +254,7 @@ protected:
bool m_deferredActivation = false;
bool m_embedded = false;
bool m_alertState = false;
+ bool m_minimized = false;
xcb_window_t m_netWmUserTimeWindow = XCB_NONE;
QSurfaceFormat m_format;
@@ -265,7 +266,8 @@ protected:
QSize m_oldWindowSize;
xcb_visualid_t m_visualId = 0;
- int m_lastWindowStateEvent = -1;
+ // Last sent state. Initialized to an invalid state, on purpose.
+ Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive;
enum SyncState {
NoSyncNeeded,
diff --git a/src/plugins/platforms/xcb/qxcbwmsupport.cpp b/src/plugins/platforms/xcb/qxcbwmsupport.cpp
index 470f021314..2619892b19 100644
--- a/src/plugins/platforms/xcb/qxcbwmsupport.cpp
+++ b/src/plugins/platforms/xcb/qxcbwmsupport.cpp
@@ -66,16 +66,15 @@ void QXcbWMSupport::updateNetWMAtoms()
int offset = 0;
int remaining = 0;
do {
- xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, root, atom(QXcbAtom::_NET_SUPPORTED), XCB_ATOM_ATOM, offset, 1024);
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, NULL);
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, root, atom(QXcbAtom::_NET_SUPPORTED), XCB_ATOM_ATOM, offset, 1024);
if (!reply)
break;
remaining = 0;
if (reply->type == XCB_ATOM_ATOM && reply->format == 32) {
- int len = xcb_get_property_value_length(reply)/sizeof(xcb_atom_t);
- xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply);
+ int len = xcb_get_property_value_length(reply.get())/sizeof(xcb_atom_t);
+ xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply.get());
int s = net_wm_atoms.size();
net_wm_atoms.resize(s + len);
memcpy(net_wm_atoms.data() + s, atoms, len*sizeof(xcb_atom_t));
@@ -83,8 +82,6 @@ void QXcbWMSupport::updateNetWMAtoms()
remaining = reply->bytes_after;
offset += len;
}
-
- free(reply);
} while (remaining > 0);
}
@@ -100,16 +97,16 @@ void QXcbWMSupport::updateVirtualRoots()
int offset = 0;
int remaining = 0;
do {
- xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, root, atom(QXcbAtom::_NET_VIRTUAL_ROOTS), XCB_ATOM_WINDOW, offset, 1024);
- xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, NULL);
+ auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(),
+ false, root, atom(QXcbAtom::_NET_VIRTUAL_ROOTS), XCB_ATOM_WINDOW, offset, 1024);
if (!reply)
break;
remaining = 0;
if (reply->type == XCB_ATOM_WINDOW && reply->format == 32) {
- int len = xcb_get_property_value_length(reply)/sizeof(xcb_window_t);
- xcb_window_t *roots = (xcb_window_t *)xcb_get_property_value(reply);
+ int len = xcb_get_property_value_length(reply.get())/sizeof(xcb_window_t);
+ xcb_window_t *roots = (xcb_window_t *)xcb_get_property_value(reply.get());
int s = net_virtual_roots.size();
net_virtual_roots.resize(s + len);
memcpy(net_virtual_roots.data() + s, roots, len*sizeof(xcb_window_t));
@@ -118,10 +115,10 @@ void QXcbWMSupport::updateVirtualRoots()
offset += len;
}
- free(reply);
} while (remaining > 0);
-#ifdef Q_XCB_DEBUG
+//#define VIRTUAL_ROOTS_DEBUG
+#ifdef VIRTUAL_ROOTS_DEBUG
qDebug("======== updateVirtualRoots");
for (int i = 0; i < net_virtual_roots.size(); ++i)
qDebug() << connection()->atomName(net_virtual_roots.at(i));
diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp
index 88933c6c22..bd398ea049 100644
--- a/src/plugins/platforms/xcb/qxcbxsettings.cpp
+++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp
@@ -106,26 +106,23 @@ public:
QByteArray settings;
xcb_atom_t _xsettings_atom = screen->connection()->atom(QXcbAtom::_XSETTINGS_SETTINGS);
while (1) {
- xcb_get_property_cookie_t get_prop_cookie =
- xcb_get_property_unchecked(screen->xcb_connection(),
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property,
+ screen->xcb_connection(),
false,
x_settings_window,
_xsettings_atom,
_xsettings_atom,
offset/4,
8192);
- xcb_get_property_reply_t *reply = xcb_get_property_reply(screen->xcb_connection(), get_prop_cookie, NULL);
bool more = false;
if (!reply)
return settings;
- const auto property_value_length = xcb_get_property_value_length(reply);
- settings.append(static_cast<const char *>(xcb_get_property_value(reply)), property_value_length);
+ const auto property_value_length = xcb_get_property_value_length(reply.get());
+ settings.append(static_cast<const char *>(xcb_get_property_value(reply.get())), property_value_length);
offset += property_value_length;
more = reply->bytes_after != 0;
- free(reply);
-
if (!more)
break;
}
@@ -228,34 +225,24 @@ QXcbXSettings::QXcbXSettings(QXcbVirtualDesktop *screen)
{
QByteArray settings_atom_for_screen("_XSETTINGS_S");
settings_atom_for_screen.append(QByteArray::number(screen->number()));
- xcb_intern_atom_cookie_t atom_cookie = xcb_intern_atom(screen->xcb_connection(),
- true,
- settings_atom_for_screen.length(),
- settings_atom_for_screen.constData());
- xcb_generic_error_t *error = 0;
- xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,&error);
- if (error) {
- free(error);
+ auto atom_reply = Q_XCB_REPLY(xcb_intern_atom,
+ screen->xcb_connection(),
+ true,
+ settings_atom_for_screen.length(),
+ settings_atom_for_screen.constData());
+ if (!atom_reply)
return;
- }
- xcb_atom_t selection_owner_atom = atom_reply->atom;
- free(atom_reply);
- xcb_get_selection_owner_cookie_t selection_cookie =
- xcb_get_selection_owner(screen->xcb_connection(), selection_owner_atom);
+ xcb_atom_t selection_owner_atom = atom_reply->atom;
- xcb_get_selection_owner_reply_t *selection_result =
- xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, &error);
- if (error) {
- free(error);
+ auto selection_result = Q_XCB_REPLY(xcb_get_selection_owner,
+ screen->xcb_connection(), selection_owner_atom);
+ if (!selection_result)
return;
- }
d_ptr->x_settings_window = selection_result->owner;
- free(selection_result);
- if (!d_ptr->x_settings_window) {
+ if (!d_ptr->x_settings_window)
return;
- }
const uint32_t event = XCB_CW_EVENT_MASK;
const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE };
diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
index 1c76b49650..6956d04083 100644
--- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro
+++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
@@ -5,11 +5,14 @@ DEFINES += QT_NO_FOREACH
QT += \
core-private gui-private \
service_support-private theme_support-private \
- eventdispatcher_support-private fontdatabase_support-private
+ eventdispatcher_support-private fontdatabase_support-private \
+ edid_support-private
qtHaveModule(linuxaccessibility_support-private): \
QT += linuxaccessibility_support-private
+qtConfig(vulkan): QT += vulkan_support-private
+
SOURCES = \
qxcbclipboard.cpp \
qxcbconnection.cpp \
@@ -65,6 +68,17 @@ qtConfig(xcb-sm) {
}
include(gl_integrations/gl_integrations.pri)
+include(nativepainting/nativepainting.pri)
+
+qtConfig(vulkan) {
+ SOURCES += \
+ qxcbvulkaninstance.cpp \
+ qxcbvulkanwindow.cpp
+
+ HEADERS += \
+ qxcbvulkaninstance.h \
+ qxcbvulkanwindow.h
+}
!qtConfig(system-xcb) {
QMAKE_USE += xcb-static xcb
diff --git a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
index f48e00ab8e..0b67739095 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
@@ -86,7 +86,6 @@ QGtk3MenuItem::QGtk3MenuItem()
m_enabled(true),
m_underline(false),
m_invalid(true),
- m_tag(reinterpret_cast<quintptr>(this)),
m_menu(nullptr),
m_item(nullptr)
{
@@ -149,16 +148,6 @@ GtkWidget *QGtk3MenuItem::handle() const
return m_item;
}
-quintptr QGtk3MenuItem::tag() const
-{
- return m_tag;
-}
-
-void QGtk3MenuItem::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
QString QGtk3MenuItem::text() const
{
return m_text;
@@ -347,7 +336,6 @@ void QGtk3MenuItem::onToggle(GtkCheckMenuItem *check, void *data)
}
QGtk3Menu::QGtk3Menu()
- : m_tag(reinterpret_cast<quintptr>(this))
{
m_menu = gtk_menu_new();
@@ -408,16 +396,6 @@ void QGtk3Menu::syncSeparatorsCollapsible(bool enable)
Q_UNUSED(enable);
}
-quintptr QGtk3Menu::tag() const
-{
- return m_tag;
-}
-
-void QGtk3Menu::setTag(quintptr tag)
-{
- m_tag = tag;
-}
-
void QGtk3Menu::setEnabled(bool enabled)
{
gtk_widget_set_sensitive(m_menu, enabled);
diff --git a/src/plugins/platformthemes/gtk3/qgtk3menu.h b/src/plugins/platformthemes/gtk3/qgtk3menu.h
index c4dd89cefc..cce800fbd8 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3menu.h
+++ b/src/plugins/platformthemes/gtk3/qgtk3menu.h
@@ -61,9 +61,6 @@ public:
GtkWidget *create();
GtkWidget *handle() const;
- quintptr tag() const override;
- void setTag(quintptr tag) override;
-
QString text() const;
void setText(const QString &text) override;
@@ -112,7 +109,6 @@ private:
bool m_exclusive;
bool m_underline;
bool m_invalid;
- quintptr m_tag;
QGtk3Menu *m_menu;
GtkWidget *m_item;
QString m_text;
@@ -136,9 +132,6 @@ public:
void syncMenuItem(QPlatformMenuItem *item) override;
void syncSeparatorsCollapsible(bool enable) override;
- quintptr tag() const override;
- void setTag(quintptr tag) override;
-
void setEnabled(bool enabled) override;
void setVisible(bool visible) override;
@@ -161,7 +154,6 @@ protected:
static void onHide(GtkWidget *menu, void *data);
private:
- quintptr m_tag;
GtkWidget *m_menu;
QPoint m_targetPos;
QVector<QGtk3MenuItem *> m_items;
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 6d62420bd6..cd4d301194 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -8,6 +8,7 @@ qtHaveModule(gui) {
qtConfig(imageformatplugin): SUBDIRS *= imageformats
!android:qtConfig(library): SUBDIRS *= generic
}
+qtHaveModule(widgets): SUBDIRS += styles
!winrt:qtHaveModule(printsupport): \
SUBDIRS += printsupport
diff --git a/src/plugins/sqldrivers/db2/qsql_db2.cpp b/src/plugins/sqldrivers/db2/qsql_db2.cpp
index 27d0e7001a..1a9631f1eb 100644
--- a/src/plugins/sqldrivers/db2/qsql_db2.cpp
+++ b/src/plugins/sqldrivers/db2/qsql_db2.cpp
@@ -66,6 +66,10 @@
QT_BEGIN_NAMESPACE
static const int COLNAMESIZE = 255;
+// Based on what is mentioned in the documentation here:
+// https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_limits.html
+// The limit is 128 bytes for table names
+static const SQLSMALLINT TABLENAMESIZE = 128;
static const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT };
class QDB2DriverPrivate : public QSqlDriverPrivate
@@ -297,6 +301,12 @@ static QSqlField qMakeFieldInfo(const QDB2ResultPrivate* d, int i)
f.setLength(colSize == 0 ? -1 : int(colSize));
f.setPrecision(colScale == 0 ? -1 : int(colScale));
f.setSqlType(int(colType));
+ SQLTCHAR tableName[TABLENAMESIZE];
+ SQLSMALLINT tableNameLen;
+ r = SQLColAttribute(d->hStmt, i + 1, SQL_DESC_BASE_TABLE_NAME, tableName,
+ TABLENAMESIZE, &tableNameLen, 0);
+ if (r == SQL_SUCCESS)
+ f.setTableName(qFromTChar(tableName));
return f;
}
@@ -1394,7 +1404,9 @@ QSqlRecord QDB2Driver::record(const QString& tableName) const
SQL_FETCH_NEXT,
0);
while (r == SQL_SUCCESS) {
- fil.append(qMakeFieldInfo(hStmt));
+ QSqlField fld = qMakeFieldInfo(hStmt);
+ fld.setTableName(tableName);
+ fil.append(fld);
r = SQLFetchScroll(hStmt,
SQL_FETCH_NEXT,
0);
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
index 2b75f3c964..c50fc7916a 100644
--- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
@@ -1383,7 +1383,8 @@ QSqlRecord QIBaseResult::record() const
for (int i = 0; i < d->sqlda->sqld; ++i) {
v = d->sqlda->sqlvar[i];
QSqlField f(QString::fromLatin1(v.aliasname, v.aliasname_length).simplified(),
- qIBaseTypeName2(v.sqltype, v.sqlscale < 0));
+ qIBaseTypeName2(v.sqltype, v.sqlscale < 0),
+ QString::fromLatin1(v.relname, v.relname_length));
f.setLength(v.sqllen);
f.setPrecision(qAbs(v.sqlscale));
f.setRequiredStatus((v.sqltype & 1) == 0 ? QSqlField::Required : QSqlField::Optional);
@@ -1686,7 +1687,7 @@ QSqlRecord QIBaseDriver::record(const QString& tablename) const
while (q.next()) {
int type = q.value(1).toInt();
bool hasScale = q.value(3).toInt() < 0;
- QSqlField f(q.value(0).toString().simplified(), qIBaseTypeName(type, hasScale));
+ QSqlField f(q.value(0).toString().simplified(), qIBaseTypeName(type, hasScale), tablename);
if(hasScale) {
f.setLength(q.value(4).toInt());
f.setPrecision(qAbs(q.value(3).toInt()));
@@ -1727,7 +1728,9 @@ QSqlIndex QIBaseDriver::primaryIndex(const QString &table) const
"ORDER BY b.RDB$FIELD_POSITION"));
while (q.next()) {
- QSqlField field(q.value(1).toString().simplified(), qIBaseTypeName(q.value(2).toInt(), q.value(3).toInt() < 0));
+ QSqlField field(q.value(1).toString().simplified(),
+ qIBaseTypeName(q.value(2).toInt(), q.value(3).toInt() < 0),
+ tablename);
index.append(field); //TODO: asc? desc?
index.setName(q.value(0).toString());
}
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
index ee439fa33e..3dc0e73af5 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -331,7 +331,8 @@ static QVariant::Type qDecodeMYSQLType(int mysqltype, uint flags)
static QSqlField qToField(MYSQL_FIELD *field, QTextCodec *tc)
{
QSqlField f(toUnicode(tc, field->name),
- qDecodeMYSQLType(int(field->type), field->flags));
+ qDecodeMYSQLType(int(field->type), field->flags),
+ toUnicode(tc, field->table));
f.setRequired(IS_NOT_NULL(field->flags));
f.setLength(field->length);
f.setPrecision(field->decimals);
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
index 59ef42d609..c32a29c5e7 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
@@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE
#define ODBC_CHECK_DRIVER
static const int COLNAMESIZE = 256;
+static const SQLSMALLINT TABLENAMESIZE = 128;
//Map Qt parameter types to ODBC types
static const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT };
@@ -730,6 +731,12 @@ static QSqlField qMakeFieldInfo(const SQLHANDLE hStmt, int i, QString *errorMess
f.setRequired(false);
// else we don't know
f.setAutoValue(isAutoValue(hStmt, i));
+ QVarLengthArray<SQLTCHAR> tableName(TABLENAMESIZE);
+ SQLSMALLINT tableNameLen;
+ r = SQLColAttribute(hStmt, i + 1, SQL_DESC_BASE_TABLE_NAME, tableName.data(),
+ TABLENAMESIZE, &tableNameLen, 0);
+ if (r == SQL_SUCCESS)
+ f.setTableName(fromSQLTCHAR(tableName, tableNameLen));
return f;
}
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index acadc830b2..a3aa0f6593 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -552,6 +552,11 @@ QSqlRecord QPSQLResult::record() const
f.setName(QString::fromUtf8(PQfname(d->result, i)));
else
f.setName(QString::fromLocal8Bit(PQfname(d->result, i)));
+ QSqlQuery qry(driver()->createResult());
+ if (qry.exec(QStringLiteral("SELECT relname FROM pg_class WHERE pg_class.oid = %1")
+ .arg(PQftable(d->result, i))) && qry.next()) {
+ f.setTableName(qry.value(0).toString());
+ }
int ptype = PQftype(d->result, i);
f.setType(qDecodePSQLType(ptype));
int len = PQfsize(d->result, i);
@@ -1132,7 +1137,7 @@ QSqlIndex QPSQLDriver::primaryIndex(const QString& tablename) const
i.exec(stmt.arg(tbl));
while (i.isActive() && i.next()) {
- QSqlField f(i.value(0).toString(), qDecodePSQLType(i.value(1).toInt()));
+ QSqlField f(i.value(0).toString(), qDecodePSQLType(i.value(1).toInt()), tablename);
idx.append(f);
idx.setName(i.value(2).toString());
}
@@ -1237,7 +1242,7 @@ QSqlRecord QPSQLDriver::record(const QString& tablename) const
QString defVal = query.value(5).toString();
if (!defVal.isEmpty() && defVal.at(0) == QLatin1Char('\''))
defVal = defVal.mid(1, defVal.length() - 2);
- QSqlField f(query.value(0).toString(), qDecodePSQLType(query.value(1).toInt()));
+ QSqlField f(query.value(0).toString(), qDecodePSQLType(query.value(1).toInt()), tablename);
f.setRequired(query.value(2).toBool());
f.setLength(len);
f.setPrecision(precision);
@@ -1264,7 +1269,7 @@ QSqlRecord QPSQLDriver::record(const QString& tablename) const
len = precision - 4;
precision = -1;
}
- QSqlField f(query.value(0).toString(), qDecodePSQLType(query.value(1).toInt()));
+ QSqlField f(query.value(0).toString(), qDecodePSQLType(query.value(1).toInt()), tablename);
f.setRequired(query.value(2).toBool());
f.setLength(len);
f.setPrecision(precision);
@@ -1419,6 +1424,7 @@ bool QPSQLDriver::subscribeToNotification(const QString &name)
QString query = QLatin1String("LISTEN ") + escapeIdentifier(name, QSqlDriver::TableName);
PGresult *result = d->exec(query);
if (PQresultStatus(result) != PGRES_COMMAND_OK) {
+ d->seid.removeLast();
setLastError(qMakeError(tr("Unable to subscribe"), QSqlError::StatementError, d, result));
PQclear(result);
return false;
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index 13ec024924..e9f5ee9508 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -51,6 +51,10 @@
#include <qstringlist.h>
#include <qvector.h>
#include <qdebug.h>
+#ifndef QT_NO_REGULAREXPRESSION
+#include <qcache.h>
+#include <qregularexpression.h>
+#endif
#include <QTimeZone>
#if defined Q_OS_WIN
@@ -209,7 +213,9 @@ void QSQLiteResultPrivate::initColumns(bool emptyResultset)
QString colName = QString(reinterpret_cast<const QChar *>(
sqlite3_column_name16(stmt, i))
).remove(QLatin1Char('"'));
-
+ const QString tableName = QString(reinterpret_cast<const QChar *>(
+ sqlite3_column_table_name16(stmt, i))
+ ).remove(QLatin1Char('"'));
// must use typeName for resolving the type to match QSqliteDriver::record
QString typeName = QString(reinterpret_cast<const QChar *>(
sqlite3_column_decltype16(stmt, i)));
@@ -242,7 +248,7 @@ void QSQLiteResultPrivate::initColumns(bool emptyResultset)
}
}
- QSqlField fld(colName, fieldType);
+ QSqlField fld(colName, fieldType, tableName);
fld.setSqlType(stp);
rInf.append(fld);
}
@@ -455,8 +461,27 @@ bool QSQLiteResult::exec()
d->finalize();
return false;
}
+
int paramCount = sqlite3_bind_parameter_count(d->stmt);
- if (paramCount == values.count()) {
+ bool paramCountIsValid = paramCount == values.count();
+
+#if (SQLITE_VERSION_NUMBER >= 3003011)
+ // In the case of the reuse of a named placeholder
+ if (!paramCountIsValid) {
+ const auto countIndexes = [](int counter, const QList<int>& indexList) {
+ return counter + indexList.length();
+ };
+
+ const int bindParamCount = std::accumulate(d->indexes.cbegin(),
+ d->indexes.cend(),
+ 0,
+ countIndexes);
+
+ paramCountIsValid = bindParamCount == values.count();
+ }
+#endif
+
+ if (paramCountIsValid) {
for (int i = 0; i < paramCount; ++i) {
res = SQLITE_OK;
const QVariant value = values.at(i);
@@ -483,14 +508,14 @@ bool QSQLiteResult::exec()
break;
case QVariant::DateTime: {
const QDateTime dateTime = value.toDateTime();
- const QString str = dateTime.toString(QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz") + timespecToString(dateTime));
+ const QString str = dateTime.toString(QLatin1String("yyyy-MM-ddThh:mm:ss.zzz") + timespecToString(dateTime));
res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
str.size() * sizeof(ushort), SQLITE_TRANSIENT);
break;
}
case QVariant::Time: {
const QTime time = value.toTime();
- const QString str = time.toString(QStringLiteral("hh:mm:ss.zzz"));
+ const QString str = time.toString(QStringViewLiteral("hh:mm:ss.zzz"));
res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
str.size() * sizeof(ushort), SQLITE_TRANSIENT);
break;
@@ -583,6 +608,40 @@ QVariant QSQLiteResult::handle() const
/////////////////////////////////////////////////////////
+#ifndef QT_NO_REGULAREXPRESSION
+static void _q_regexp(sqlite3_context* context, int argc, sqlite3_value** argv)
+{
+ if (Q_UNLIKELY(argc != 2)) {
+ sqlite3_result_int(context, 0);
+ return;
+ }
+
+ const QString pattern = QString::fromUtf8(
+ reinterpret_cast<const char*>(sqlite3_value_text(argv[0])));
+ const QString subject = QString::fromUtf8(
+ reinterpret_cast<const char*>(sqlite3_value_text(argv[1])));
+
+ auto cache = static_cast<QCache<QString, QRegularExpression>*>(sqlite3_user_data(context));
+ auto regexp = cache->object(pattern);
+ const bool wasCached = regexp;
+
+ if (!wasCached)
+ regexp = new QRegularExpression(pattern, QRegularExpression::DontCaptureOption | QRegularExpression::OptimizeOnFirstUsageOption);
+
+ const bool found = subject.contains(*regexp);
+
+ if (!wasCached)
+ cache->insert(pattern, regexp);
+
+ sqlite3_result_int(context, int(found));
+}
+
+static void _q_regexp_cleanup(void *cache)
+{
+ delete static_cast<QCache<QString, QRegularExpression>*>(cache);
+}
+#endif
+
QSQLiteDriver::QSQLiteDriver(QObject * parent)
: QSqlDriver(*new QSQLiteDriverPrivate, parent)
{
@@ -618,11 +677,17 @@ bool QSQLiteDriver::hasFeature(DriverFeature f) const
case EventNotifications:
return true;
case QuerySize:
- case NamedPlaceholders:
case BatchOperations:
case MultipleResultSets:
case CancelQuery:
return false;
+ case NamedPlaceholders:
+#if (SQLITE_VERSION_NUMBER < 3003011)
+ return false;
+#else
+ return true;
+#endif
+
}
return false;
}
@@ -642,6 +707,11 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
bool sharedCache = false;
bool openReadOnlyOption = false;
bool openUriOption = false;
+#ifndef QT_NO_REGULAREXPRESSION
+ static const QLatin1String regexpConnectOption = QLatin1String("QSQLITE_ENABLE_REGEXP");
+ bool defineRegexp = false;
+ int regexpCacheSize = 25;
+#endif
const auto opts = conOpts.splitRef(QLatin1Char(';'));
for (auto option : opts) {
@@ -661,18 +731,42 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
} else if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) {
sharedCache = true;
}
+#ifndef QT_NO_REGULAREXPRESSION
+ else if (option.startsWith(regexpConnectOption)) {
+ option = option.mid(regexpConnectOption.size()).trimmed();
+ if (option.isEmpty()) {
+ defineRegexp = true;
+ } else if (option.startsWith(QLatin1Char('='))) {
+ bool ok = false;
+ const int cacheSize = option.mid(1).trimmed().toInt(&ok);
+ if (ok) {
+ defineRegexp = true;
+ if (cacheSize > 0)
+ regexpCacheSize = cacheSize;
+ }
+ }
+ }
+#endif
}
int openMode = (openReadOnlyOption ? SQLITE_OPEN_READONLY : (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
+ openMode |= (sharedCache ? SQLITE_OPEN_SHAREDCACHE : SQLITE_OPEN_PRIVATECACHE);
if (openUriOption)
openMode |= SQLITE_OPEN_URI;
- sqlite3_enable_shared_cache(sharedCache);
+ openMode |= SQLITE_OPEN_NOMUTEX;
if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) {
sqlite3_busy_timeout(d->access, timeOut);
setOpen(true);
setOpenError(false);
+#ifndef QT_NO_REGULAREXPRESSION
+ if (defineRegexp) {
+ auto cache = new QCache<QString, QRegularExpression>(regexpCacheSize);
+ sqlite3_create_function_v2(d->access, "regexp", 2, SQLITE_UTF8, cache, &_q_regexp, NULL,
+ NULL, &_q_regexp_cleanup);
+ }
+#endif
return true;
} else {
if (d->access) {
@@ -807,7 +901,7 @@ static QSqlIndex qGetTableInfo(QSqlQuery &q, const QString &tableName, bool only
if (onlyPIndex && !isPk)
continue;
QString typeName = q.value(2).toString().toLower();
- QSqlField fld(q.value(1).toString(), qGetColumnType(typeName));
+ QSqlField fld(q.value(1).toString(), qGetColumnType(typeName), tableName);
if (isPk && (typeName == QLatin1String("integer")))
// INTEGER PRIMARY KEY fields are auto-generated in sqlite
// INT PRIMARY KEY is not the same as INTEGER PRIMARY KEY!
diff --git a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
index 67c24e4168..93f47e3f13 100644
--- a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
@@ -576,7 +576,7 @@ QSqlIndex QSQLite2Driver::primaryIndex(const QString &tblname) const
QVariant::Type type = QVariant::Invalid;
if (rec.contains(name))
type = rec.field(name).type();
- index.append(QSqlField(name, type));
+ index.append(QSqlField(name, type, tblname));
}
return index;
}
diff --git a/src/plugins/sqldrivers/tds/qsql_tds.cpp b/src/plugins/sqldrivers/tds/qsql_tds.cpp
index 6ebd09a572..670198af81 100644
--- a/src/plugins/sqldrivers/tds/qsql_tds.cpp
+++ b/src/plugins/sqldrivers/tds/qsql_tds.cpp
@@ -767,7 +767,7 @@ QSqlRecord QTDSDriver::record(const QString& tablename) const
"where id = (select id from sysobjects where name = '%1')"));
t.exec(stmt.arg(table));
while (t.next()) {
- QSqlField f(t.value(0).toString().simplified(), qDecodeTDSType(t.value(1).toInt()));
+ QSqlField f(t.value(0).toString().simplified(), qDecodeTDSType(t.value(1).toInt()), tablename);
f.setLength(t.value(2).toInt());
f.setPrecision(t.value(3).toInt());
f.setSqlType(t.value(1).toInt());
@@ -853,7 +853,7 @@ QSqlIndex QTDSDriver::primaryIndex(const QString& tablename) const
QRegExp regx(QLatin1String("\\s*(\\S+)(?:\\s+(DESC|desc))?\\s*"));
for(QStringList::Iterator it = fNames.begin(); it != fNames.end(); ++it) {
regx.indexIn(*it);
- QSqlField f(regx.cap(1), rec.field(regx.cap(1)).type());
+ QSqlField f(regx.cap(1), rec.field(regx.cap(1)).type(), tablename);
if (regx.cap(2).toLower() == QLatin1String("desc")) {
idx.append(f, true);
} else {
diff --git a/src/plugins/styles/android/android.pro b/src/plugins/styles/android/android.pro
new file mode 100644
index 0000000000..4ca35d8046
--- /dev/null
+++ b/src/plugins/styles/android/android.pro
@@ -0,0 +1,16 @@
+TARGET = qandroidstyle
+
+QT += widgets-private
+
+SOURCES += \
+ main.cpp \
+ qandroidstyle.cpp
+
+HEADERS += \
+ qandroidstyle_p.h
+
+DISTFILES += androidstyle.json
+
+PLUGIN_TYPE = styles
+PLUGIN_CLASS_NAME = QAndroidStylePlugin
+load(qt_plugin)
diff --git a/src/plugins/styles/android/androidstyle.json b/src/plugins/styles/android/androidstyle.json
new file mode 100644
index 0000000000..6843bd3301
--- /dev/null
+++ b/src/plugins/styles/android/androidstyle.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "android" ]
+}
diff --git a/src/plugins/styles/android/main.cpp b/src/plugins/styles/android/main.cpp
new file mode 100644
index 0000000000..2121538b0a
--- /dev/null
+++ b/src/plugins/styles/android/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 <QtWidgets/qstyleplugin.h>
+#include "qandroidstyle_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QAndroidStylePlugin : public QStylePlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "androidstyle.json")
+public:
+ QStyle *create(const QString &key);
+};
+
+QStyle *QAndroidStylePlugin::create(const QString &key)
+{
+ if (key.compare(QLatin1String("android"), Qt::CaseInsensitive) == 0)
+ return new QAndroidStyle();
+
+ return 0;
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
+
diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/plugins/styles/android/qandroidstyle.cpp
index 55f125c6b5..086df92322 100644
--- a/src/widgets/styles/qandroidstyle.cpp
+++ b/src/plugins/styles/android/qandroidstyle.cpp
@@ -39,8 +39,6 @@
#include "qandroidstyle_p.h"
-#if QT_CONFIG(style_android) || defined(QT_PLUGIN)
-
#include <QFile>
#include <QFont>
#include <QApplication>
@@ -1816,5 +1814,3 @@ QRect QAndroidStyle::AndroidSpinnerControl::subControlRect(const QStyleOptionCom
}
QT_END_NAMESPACE
-
-#endif // QT_CONFIG(style_android) || defined(QT_PLUGIN)
diff --git a/src/widgets/styles/qandroidstyle_p.h b/src/plugins/styles/android/qandroidstyle_p.h
index caff0afada..3faa08afb9 100644
--- a/src/widgets/styles/qandroidstyle_p.h
+++ b/src/plugins/styles/android/qandroidstyle_p.h
@@ -52,16 +52,14 @@
//
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtWidgets/private/qfusionstyle_p.h>
#include <QtCore/QList>
#include <QtCore/QMargins>
#include <QtCore/QHash>
#include <QtCore/QVariantMap>
-#include "qfusionstyle_p.h"
QT_BEGIN_NAMESPACE
-#if QT_CONFIG(style_android)
-
class Q_WIDGETS_EXPORT QAndroidStyle : public QFusionStyle
{
Q_OBJECT
@@ -388,8 +386,6 @@ private:
AndroidCompoundButtonControl *checkBoxControl;
};
-#endif // style_android
-
QT_END_NAMESPACE
#endif // QANDROIDSTYLE_P_H
diff --git a/src/plugins/styles/mac/mac.pro b/src/plugins/styles/mac/mac.pro
new file mode 100644
index 0000000000..f3c7c1c067
--- /dev/null
+++ b/src/plugins/styles/mac/mac.pro
@@ -0,0 +1,19 @@
+TARGET = qmacstyle
+
+QT += widgets-private
+
+SOURCES += \
+ main.mm \
+ qmacstyle_mac.mm
+
+HEADERS += \
+ qmacstyle_mac_p.h \
+ qmacstyle_mac_p_p.h
+
+LIBS_PRIVATE += -framework AppKit -framework ApplicationServices -framework Carbon
+
+DISTFILES += macstyle.json
+
+PLUGIN_TYPE = styles
+PLUGIN_CLASS_NAME = QMacStylePlugin
+load(qt_plugin)
diff --git a/src/plugins/styles/mac/macstyle.json b/src/plugins/styles/mac/macstyle.json
new file mode 100644
index 0000000000..5897815eec
--- /dev/null
+++ b/src/plugins/styles/mac/macstyle.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "macintosh" ]
+}
diff --git a/src/plugins/styles/mac/main.mm b/src/plugins/styles/mac/main.mm
new file mode 100644
index 0000000000..ae31bb95fb
--- /dev/null
+++ b/src/plugins/styles/mac/main.mm
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 <QtWidgets/qstyleplugin.h>
+#include "qmacstyle_mac_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QMacStylePlugin : public QStylePlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "macstyle.json")
+public:
+ QStyle *create(const QString &key);
+};
+
+QStyle *QMacStylePlugin::create(const QString &key)
+{
+ QMacAutoReleasePool pool;
+ if (key.compare(QLatin1String("macintosh"), Qt::CaseInsensitive) == 0)
+ return new QMacStyle();
+
+ return 0;
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
+
diff --git a/src/widgets/styles/qmacstyle.qdoc b/src/plugins/styles/mac/qmacstyle.qdoc
index a77843a4dd..fcbc813844 100644
--- a/src/widgets/styles/qmacstyle.qdoc
+++ b/src/plugins/styles/mac/qmacstyle.qdoc
@@ -82,7 +82,7 @@
documentation.
\image qmacstyle.png
- \sa QWindowsXPStyle, QWindowsStyle, QFusionStyle
+ \sa QWindowsVistaStyle, QWindowsStyle, QFusionStyle
*/
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index fcda61ef8c..a5bf14bde6 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -43,6 +43,7 @@
*/
#include <AppKit/AppKit.h>
+#include <ApplicationServices/ApplicationServices.h>
#include "qmacstyle_mac_p.h"
#include "qmacstyle_mac_p_p.h"
@@ -166,6 +167,68 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(NotificationReceiver);
}
@end
+@interface QT_MANGLE_NAMESPACE(QIndeterminateProgressIndicator) : NSProgressIndicator
+
+@property (readonly, nonatomic) NSInteger animators;
+
+- (instancetype)init;
+
+- (void)startAnimation;
+- (void)stopAnimation;
+
+- (void)drawWithFrame:(CGRect)rect inView:(NSView *)view;
+
+@end
+
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QIndeterminateProgressIndicator);
+
+@implementation QIndeterminateProgressIndicator
+
+- (instancetype)init
+{
+ if ((self = [super init])) {
+ _animators = 0;
+ self.indeterminate = YES;
+ self.usesThreadedAnimation = NO;
+ self.alphaValue = 0.0;
+ }
+
+ return self;
+}
+
+- (void)startAnimation
+{
+ if (_animators == 0) {
+ self.hidden = NO;
+ [super startAnimation:self];
+ }
+ ++_animators;
+}
+
+- (void)stopAnimation
+{
+ --_animators;
+ if (_animators == 0) {
+ [super stopAnimation:self];
+ self.hidden = YES;
+ [self removeFromSuperviewWithoutNeedingDisplay];
+ }
+}
+
+- (void)drawWithFrame:(CGRect)rect inView:(NSView *)view
+{
+ // The alphaValue change is not strictly necessary, but feels safer.
+ self.alphaValue = 1.0;
+ if (self.superview != view)
+ [view addSubview:self];
+ if (!CGRectEqualToRect(self.frame, rect))
+ self.frame = rect;
+ [self drawRect:rect];
+ self.alphaValue = 0.0;
+}
+
+@end
+
QT_BEGIN_NAMESPACE
// The following constants are used for adjusting the size
@@ -240,10 +303,6 @@ static const QColor tabBarCloseButtonCrossSelected(115, 115, 115);
static const int closeButtonSize = 14;
static const qreal closeButtonCornerRadius = 2.0;
-// Resolve these at run-time, since the functions was moved in Leopard.
-typedef HIRect * (*PtrHIShapeGetBounds)(HIShapeRef, HIRect *);
-static PtrHIShapeGetBounds ptrHIShapeGetBounds = 0;
-
#if QT_CONFIG(tabbar)
static bool isVerticalTabs(const QTabBar::Shape shape) {
return (shape == QTabBar::RoundedEast
@@ -253,6 +312,23 @@ static bool isVerticalTabs(const QTabBar::Shape shape) {
}
#endif
+static bool setupScroller(NSScroller *scroller, const QStyleOptionSlider *sb)
+{
+ const qreal length = sb->maximum - sb->minimum + sb->pageStep;
+ if (qFuzzyIsNull(length))
+ return false;
+ const qreal proportion = sb->pageStep / length;
+ const qreal range = qreal(sb->maximum - sb->minimum);
+ qreal value = range ? qreal(sb->sliderValue - sb->minimum) / range : 0;
+ if (sb->orientation == Qt::Horizontal && sb->direction == Qt::RightToLeft)
+ value = 1.0 - value;
+
+ scroller.frame = sb->rect.toCGRect();
+ scroller.floatValue = value;
+ scroller.knobProportion = proportion;
+ return true;
+}
+
static bool isInMacUnifiedToolbarArea(QWindow *window, int windowY)
{
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
@@ -424,19 +500,14 @@ void drawTabBase(QPainter *p, const QStyleOptionTabBarBase *tbb, const QWidget *
}
#endif
-static int getControlSize(const QStyleOption *option, const QWidget *widget)
+static QStyleHelper::WidgetSizePolicy getControlSize(const QStyleOption *option, const QWidget *widget)
{
- switch (QMacStyle::widgetSizePolicy(widget, option)) {
- case QMacStyle::SizeSmall:
- return QAquaSizeSmall;
- case QMacStyle::SizeMini:
- return QAquaSizeMini;
- default:
- break;
- }
- return QAquaSizeLarge;
-}
+ const auto wsp = QStyleHelper::widgetSizePolicy(widget, option);
+ if (wsp == QStyleHelper::SizeDefault)
+ return QStyleHelper::SizeLarge;
+ return wsp;
+}
#if QT_CONFIG(treeview)
static inline bool isTreeView(const QWidget *widget)
@@ -597,46 +668,103 @@ static inline int qt_mac_hitheme_tab_version()
return 1;
}
-static inline HIRect qt_hirectForQRect(const QRect &convertRect, const QRect &rect = QRect())
-{
- return CGRectMake(convertRect.x() + rect.x(), convertRect.y() + rect.y(),
- convertRect.width() - rect.width(), convertRect.height() - rect.height());
-}
-
-static inline const QRect qt_qrectForHIRect(const HIRect &hirect)
-{
- return QRect(QPoint(int(hirect.origin.x), int(hirect.origin.y)),
- QSize(int(hirect.size.width), int(hirect.size.height)));
-}
-
-inline bool qt_mac_is_metal(const QWidget *w)
-{
- for (; w; w = w->parentWidget()) {
- if (w->testAttribute(Qt::WA_MacBrushedMetal))
- return true;
- if (w->isWindow() && w->testAttribute(Qt::WA_WState_Created)) { // If not created will fall through to the opaque check and be fine anyway.
- return qt_macWindowIsTextured(w);
- }
-#ifndef QT_NO_ACCESSIBILITY
- if (w->d_func()->isOpaque)
- break;
-#endif
- }
- return false;
-}
-
-static int qt_mac_aqua_get_metric(ThemeMetric met)
+enum QAquaMetric {
+ // Prepend kThemeMetric to get the HIToolBox constant.
+ // Represents the values already used in QMacStyle.
+ CheckBoxHeight = 0,
+ CheckBoxWidth,
+ EditTextFrameOutset,
+ FocusRectOutset,
+ HSliderHeight,
+ HSliderTickHeight,
+ LargeProgressBarThickness,
+ ListHeaderHeight,
+ MenuSeparatorHeight, // GetThemeMenuSeparatorHeight
+ MiniCheckBoxHeight,
+ MiniCheckBoxWidth,
+ MiniHSliderHeight,
+ MiniHSliderTickHeight,
+ MiniPopupButtonHeight,
+ MiniPushButtonHeight,
+ MiniRadioButtonHeight,
+ MiniRadioButtonWidth,
+ MiniVSliderTickWidth,
+ MiniVSliderWidth,
+ NormalProgressBarThickness,
+ PopupButtonHeight,
+ ProgressBarShadowOutset,
+ PushButtonHeight,
+ RadioButtonHeight,
+ RadioButtonWidth,
+ SeparatorSize,
+ SmallCheckBoxHeight,
+ SmallCheckBoxWidth,
+ SmallHSliderHeight,
+ SmallHSliderTickHeight,
+ SmallPopupButtonHeight,
+ SmallProgressBarShadowOutset,
+ SmallPushButtonHeight,
+ SmallRadioButtonHeight,
+ SmallRadioButtonWidth,
+ SmallVSliderTickWidth,
+ SmallVSliderWidth,
+ VSliderTickWidth,
+ VSliderWidth
+};
+
+static const int qt_mac_aqua_metrics[] = {
+ // Values as of macOS 10.12.4 and Xcode 8.3.1
+ 18 /* CheckBoxHeight */,
+ 18 /* CheckBoxWidth */,
+ 1 /* EditTextFrameOutset */,
+ 4 /* FocusRectOutset */,
+ 22 /* HSliderHeight */,
+ 5 /* HSliderTickHeight */,
+ 16 /* LargeProgressBarThickness */,
+ 17 /* ListHeaderHeight */,
+ 12 /* MenuSeparatorHeight, aka GetThemeMenuSeparatorHeight */,
+ 11 /* MiniCheckBoxHeight */,
+ 10 /* MiniCheckBoxWidth */,
+ 12 /* MiniHSliderHeight */,
+ 4 /* MiniHSliderTickHeight */,
+ 15 /* MiniPopupButtonHeight */,
+ 16 /* MiniPushButtonHeight */,
+ 11 /* MiniRadioButtonHeight */,
+ 10 /* MiniRadioButtonWidth */,
+ 4 /* MiniVSliderTickWidth */,
+ 12 /* MiniVSliderWidth */,
+ 12 /* NormalProgressBarThickness */,
+ 20 /* PopupButtonHeight */,
+ 4 /* ProgressBarShadowOutset */,
+ 20 /* PushButtonHeight */,
+ 18 /* RadioButtonHeight */,
+ 18 /* RadioButtonWidth */,
+ 1 /* SeparatorSize */,
+ 16 /* SmallCheckBoxHeight */,
+ 14 /* SmallCheckBoxWidth */,
+ 15 /* SmallHSliderHeight */,
+ 4 /* SmallHSliderTickHeight */,
+ 17 /* SmallPopupButtonHeight */,
+ 2 /* SmallProgressBarShadowOutset */,
+ 17 /* SmallPushButtonHeight */,
+ 15 /* SmallRadioButtonHeight */,
+ 14 /* SmallRadioButtonWidth */,
+ 4 /* SmallVSliderTickWidth */,
+ 15 /* SmallVSliderWidth */,
+ 5 /* VSliderTickWidth */,
+ 22 /* VSliderWidth */
+};
+
+static inline int qt_mac_aqua_get_metric(QAquaMetric m)
{
- SInt32 ret;
- GetThemeMetric(met, &ret);
- return ret;
+ return qt_mac_aqua_metrics[m];
}
static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg, QSize szHint,
- QAquaWidgetSize sz)
+ QStyleHelper::WidgetSizePolicy sz)
{
QSize ret(-1, -1);
- if (sz != QAquaSizeSmall && sz != QAquaSizeLarge && sz != QAquaSizeMini) {
+ if (sz != QStyleHelper::SizeSmall && sz != QStyleHelper::SizeLarge && sz != QStyleHelper::SizeMini) {
qDebug("Not sure how to return this...");
return ret;
}
@@ -702,12 +830,12 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
QString buttonText = qt_mac_removeMnemonics(psh->text());
if (buttonText.contains(QLatin1Char('\n')))
ret = QSize(-1, -1);
- else if (sz == QAquaSizeLarge)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
- else if (sz == QAquaSizeSmall)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
- else if (sz == QAquaSizeMini)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
+ else if (sz == QStyleHelper::SizeLarge)
+ ret = QSize(-1, qt_mac_aqua_get_metric(PushButtonHeight));
+ else if (sz == QStyleHelper::SizeSmall)
+ ret = QSize(-1, qt_mac_aqua_get_metric(SmallPushButtonHeight));
+ else if (sz == QStyleHelper::SizeMini)
+ ret = QSize(-1, qt_mac_aqua_get_metric(MiniPushButtonHeight));
if (!psh->icon().isNull()){
// If the button got an icon, and the icon is larger than the
@@ -725,15 +853,15 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
}
} else {
// The only sensible thing to do is to return whatever the style suggests...
- if (sz == QAquaSizeLarge)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
- else if (sz == QAquaSizeSmall)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
- else if (sz == QAquaSizeMini)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
+ if (sz == QStyleHelper::SizeLarge)
+ ret = QSize(-1, qt_mac_aqua_get_metric(PushButtonHeight));
+ else if (sz == QStyleHelper::SizeSmall)
+ ret = QSize(-1, qt_mac_aqua_get_metric(SmallPushButtonHeight));
+ else if (sz == QStyleHelper::SizeMini)
+ ret = QSize(-1, qt_mac_aqua_get_metric(MiniPushButtonHeight));
else
// Since there's no default size we return the large size...
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
+ ret = QSize(-1, qt_mac_aqua_get_metric(PushButtonHeight));
}
#endif
#if 0 //Not sure we are applying the rules correctly for RadioButtons/CheckBoxes --Sam
@@ -742,33 +870,33 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
// Exception for case where multiline radio button text requires no size constrainment
if (rdo->text().find('\n') != -1)
return ret;
- if (sz == QAquaSizeLarge)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricRadioButtonHeight));
- else if (sz == QAquaSizeSmall)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallRadioButtonHeight));
- else if (sz == QAquaSizeMini)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniRadioButtonHeight));
+ if (sz == QStyleHelper::SizeLarge)
+ ret = QSize(-1, qt_mac_aqua_get_metric(RadioButtonHeight));
+ else if (sz == QStyleHelper::SizeSmall)
+ ret = QSize(-1, qt_mac_aqua_get_metric(SmallRadioButtonHeight));
+ else if (sz == QStyleHelper::SizeMini)
+ ret = QSize(-1, qt_mac_aqua_get_metric(MiniRadioButtonHeight));
} else if (ct == QStyle::CT_CheckBox) {
- if (sz == QAquaSizeLarge)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricCheckBoxHeight));
- else if (sz == QAquaSizeSmall)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallCheckBoxHeight));
- else if (sz == QAquaSizeMini)
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniCheckBoxHeight));
+ if (sz == QStyleHelper::SizeLarge)
+ ret = QSize(-1, qt_mac_aqua_get_metric(CheckBoxHeight));
+ else if (sz == QStyleHelper::SizeSmall)
+ ret = QSize(-1, qt_mac_aqua_get_metric(SmallCheckBoxHeight));
+ else if (sz == QStyleHelper::SizeMini)
+ ret = QSize(-1, qt_mac_aqua_get_metric(MiniCheckBoxHeight));
#endif
break;
}
case QStyle::CT_SizeGrip:
- if (sz == QAquaSizeLarge || sz == QAquaSizeSmall) {
- HIRect r;
- HIPoint p = { 0, 0 };
+ if (sz == QStyleHelper::SizeLarge || sz == QStyleHelper::SizeSmall) {
+ CGRect r;
+ CGPoint p = { 0, 0 };
HIThemeGrowBoxDrawInfo gbi;
gbi.version = 0;
gbi.state = kThemeStateActive;
gbi.kind = kHIThemeGrowBoxKindNormal;
gbi.direction = QApplication::isRightToLeft() ? kThemeGrowLeft | kThemeGrowDown
: kThemeGrowRight | kThemeGrowDown;
- gbi.size = sz == QAquaSizeSmall ? kHIThemeGrowBoxSizeSmall : kHIThemeGrowBoxSizeNormal;
+ gbi.size = sz == QStyleHelper::SizeSmall ? kHIThemeGrowBoxSizeSmall : kHIThemeGrowBoxSizeNormal;
if (HIThemeGetGrowBoxBounds(&p, &gbi, &r) == noErr) {
int width = 0;
#ifndef QT_NO_MDIAREA
@@ -781,21 +909,21 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
break;
case QStyle::CT_ComboBox:
switch (sz) {
- case QAquaSizeLarge:
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPopupButtonHeight));
+ case QStyleHelper::SizeLarge:
+ ret = QSize(-1, qt_mac_aqua_get_metric(PopupButtonHeight));
break;
- case QAquaSizeSmall:
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPopupButtonHeight));
+ case QStyleHelper::SizeSmall:
+ ret = QSize(-1, qt_mac_aqua_get_metric(SmallPopupButtonHeight));
break;
- case QAquaSizeMini:
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPopupButtonHeight));
+ case QStyleHelper::SizeMini:
+ ret = QSize(-1, qt_mac_aqua_get_metric(MiniPopupButtonHeight));
break;
default:
break;
}
break;
case QStyle::CT_ToolButton:
- if (sz == QAquaSizeSmall) {
+ if (sz == QStyleHelper::SizeSmall) {
int width = 0, height = 0;
if (szHint == QSize(-1, -1)) { //just 'guess'..
#if QT_CONFIG(toolbutton)
@@ -840,35 +968,35 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
const QSlider *sld = qobject_cast<const QSlider *>(widg);
// If this conversion fails then the widget was not what it claimed to be.
if(sld) {
- if (sz == QAquaSizeLarge) {
+ if (sz == QStyleHelper::SizeLarge) {
if (sld->orientation() == Qt::Horizontal) {
- w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
+ w = qt_mac_aqua_get_metric(HSliderHeight);
if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
+ w += qt_mac_aqua_get_metric(HSliderTickHeight);
} else {
- w = qt_mac_aqua_get_metric(kThemeMetricVSliderWidth);
+ w = qt_mac_aqua_get_metric(VSliderWidth);
if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricVSliderTickWidth);
+ w += qt_mac_aqua_get_metric(VSliderTickWidth);
}
- } else if (sz == QAquaSizeSmall) {
+ } else if (sz == QStyleHelper::SizeSmall) {
if (sld->orientation() == Qt::Horizontal) {
- w = qt_mac_aqua_get_metric(kThemeMetricSmallHSliderHeight);
+ w = qt_mac_aqua_get_metric(SmallHSliderHeight);
if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricSmallHSliderTickHeight);
+ w += qt_mac_aqua_get_metric(SmallHSliderTickHeight);
} else {
- w = qt_mac_aqua_get_metric(kThemeMetricSmallVSliderWidth);
+ w = qt_mac_aqua_get_metric(SmallVSliderWidth);
if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricSmallVSliderTickWidth);
+ w += qt_mac_aqua_get_metric(SmallVSliderTickWidth);
}
- } else if (sz == QAquaSizeMini) {
+ } else if (sz == QStyleHelper::SizeMini) {
if (sld->orientation() == Qt::Horizontal) {
- w = qt_mac_aqua_get_metric(kThemeMetricMiniHSliderHeight);
+ w = qt_mac_aqua_get_metric(MiniHSliderHeight);
if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricMiniHSliderTickHeight);
+ w += qt_mac_aqua_get_metric(MiniHSliderTickHeight);
} else {
- w = qt_mac_aqua_get_metric(kThemeMetricMiniVSliderWidth);
+ w = qt_mac_aqua_get_metric(MiniVSliderWidth);
if (sld->tickPosition() != QSlider::NoTicks)
- w += qt_mac_aqua_get_metric(kThemeMetricMiniVSliderTickWidth);
+ w += qt_mac_aqua_get_metric(MiniVSliderTickWidth);
}
}
} else {
@@ -876,8 +1004,8 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
// a slider. We don't know if this is vertical or horizontal or if we need to
// have tick marks or not.
// For this case we will return an horizontal slider without tick marks.
- w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
- w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
+ w = qt_mac_aqua_get_metric(HSliderHeight);
+ w += qt_mac_aqua_get_metric(HSliderTickHeight);
}
if (sld->orientation() == Qt::Horizontal)
ret.setHeight(w);
@@ -892,12 +1020,12 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
if (const QProgressBar *pb = qobject_cast<const QProgressBar *>(widg))
orient = pb->orientation();
- if (sz == QAquaSizeLarge)
- finalValue = qt_mac_aqua_get_metric(kThemeMetricLargeProgressBarThickness)
- + qt_mac_aqua_get_metric(kThemeMetricProgressBarShadowOutset);
+ if (sz == QStyleHelper::SizeLarge)
+ finalValue = qt_mac_aqua_get_metric(LargeProgressBarThickness)
+ + qt_mac_aqua_get_metric(ProgressBarShadowOutset);
else
- finalValue = qt_mac_aqua_get_metric(kThemeMetricNormalProgressBarThickness)
- + qt_mac_aqua_get_metric(kThemeMetricSmallProgressBarShadowOutset);
+ finalValue = qt_mac_aqua_get_metric(NormalProgressBarThickness)
+ + qt_mac_aqua_get_metric(SmallProgressBarShadowOutset);
if (orient == Qt::Horizontal)
ret.setHeight(finalValue);
else
@@ -909,7 +1037,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
case QStyle::CT_LineEdit:
if (!widg || !qobject_cast<QComboBox *>(widg->parentWidget())) {
//should I take into account the font dimentions of the lineedit? -Sam
- if (sz == QAquaSizeLarge)
+ if (sz == QStyleHelper::SizeLarge)
ret = QSize(-1, 21);
else
ret = QSize(-1, 19);
@@ -919,11 +1047,11 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
case QStyle::CT_HeaderSection:
#if QT_CONFIG(treeview)
if (isTreeView(widg))
- ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricListHeaderHeight));
+ ret = QSize(-1, qt_mac_aqua_get_metric(ListHeaderHeight));
#endif
break;
case QStyle::CT_MenuBar:
- if (sz == QAquaSizeLarge) {
+ if (sz == QStyleHelper::SizeLarge) {
ret = QSize(-1, [[NSApp mainMenu] menuBarHeight]);
// In the qt_mac_set_native_menubar(false) case,
// we come it here with a zero-height main menu,
@@ -941,30 +1069,30 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
#if defined(QMAC_QAQUASTYLE_SIZE_CONSTRAIN) || defined(DEBUG_SIZE_CONSTRAINT)
-static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSize small, QSize mini)
+static QStyleHelper::WidgetSizePolicy qt_aqua_guess_size(const QWidget *widg, QSize large, QSize small, QSize mini)
{
Q_UNUSED(widg);
if (large == QSize(-1, -1)) {
if (small != QSize(-1, -1))
- return QAquaSizeSmall;
+ return QStyleHelper::SizeSmall;
if (mini != QSize(-1, -1))
- return QAquaSizeMini;
- return QAquaSizeUnknown;
+ return QStyleHelper::SizeMini;
+ return QStyleHelper::SizeDefault;
} else if (small == QSize(-1, -1)) {
if (mini != QSize(-1, -1))
- return QAquaSizeMini;
- return QAquaSizeLarge;
+ return QStyleHelper::SizeMini;
+ return QStyleHelper::SizeLarge;
} else if (mini == QSize(-1, -1)) {
- return QAquaSizeLarge;
+ return QStyleHelper::SizeLarge;
}
#ifndef QT_NO_MAINWINDOW
if (qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) {
//if (small.width() != -1 || small.height() != -1)
- return QAquaSizeSmall;
+ return QStyleHelper::SizeSmall;
} else if (qEnvironmentVariableIsSet("QWIDGET_ALL_MINI")) {
- return QAquaSizeMini;
+ return QStyleHelper::SizeMini;
}
#endif
@@ -1000,11 +1128,11 @@ static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSiz
mini_delta += delta * delta;
}
if (mini_delta < small_delta && mini_delta < large_delta)
- return QAquaSizeMini;
+ return QStyleHelper::SizeMini;
else if (small_delta < large_delta)
- return QAquaSizeSmall;
+ return QStyleHelper::SizeSmall;
#endif
- return QAquaSizeLarge;
+ return QStyleHelper::SizeLarge;
}
#endif
@@ -1024,12 +1152,11 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h
const CGFloat focusRingWidth = radius > 0 ? 3.5 : 6;
QMacAutoReleasePool pool;
QMacCGContext ctx(&focusRingPixmap);
+ setupNSGraphicsContext(ctx, NO);
+
CGContextBeginTransparencyLayer(ctx, NULL);
CGContextSetAlpha(ctx, 0.5); // As applied to the stroke color below
- [NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithCGContext:ctx
- flipped:NO]];
CGRect focusRingRect = CGRectMake(hMargin, vMargin, size, size);
NSBezierPath *focusRingPath;
if (radius > 0) {
@@ -1053,7 +1180,7 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h
[focusRingPath stroke];
CGContextEndTransparencyLayer(ctx);
- [NSGraphicsContext restoreGraphicsState];
+ restoreNSGraphicsContext(ctx);
}
QPixmapCache::insert(key, focusRingPixmap);
}
@@ -1159,62 +1286,61 @@ void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widg
}
#endif // QT_CONFIG(tabbar)
-QAquaWidgetSize QMacStylePrivate::effectiveAquaSizeConstrain(const QStyleOption *option,
+QStyleHelper::WidgetSizePolicy QMacStylePrivate::effectiveAquaSizeConstrain(const QStyleOption *option,
const QWidget *widg,
QStyle::ContentsType ct,
QSize szHint, QSize *insz) const
{
- QAquaWidgetSize sz = aquaSizeConstrain(option, widg, ct, szHint, insz);
- if (sz == QAquaSizeUnknown)
- return QAquaSizeLarge;
+ QStyleHelper::WidgetSizePolicy sz = aquaSizeConstrain(option, widg, ct, szHint, insz);
+ if (sz == QStyleHelper::SizeDefault)
+ return QStyleHelper::SizeLarge;
return sz;
}
-QAquaWidgetSize QMacStylePrivate::aquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
+QStyleHelper::WidgetSizePolicy QMacStylePrivate::aquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
QStyle::ContentsType ct, QSize szHint, QSize *insz) const
{
#if defined(QMAC_QAQUASTYLE_SIZE_CONSTRAIN) || defined(DEBUG_SIZE_CONSTRAINT)
if (option) {
if (option->state & QStyle::State_Small)
- return QAquaSizeSmall;
+ return QStyleHelper::SizeSmall;
if (option->state & QStyle::State_Mini)
- return QAquaSizeMini;
+ return QStyleHelper::SizeMini;
}
if (!widg) {
if (insz)
*insz = QSize();
if (qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL"))
- return QAquaSizeSmall;
+ return QStyleHelper::SizeSmall;
if (qEnvironmentVariableIsSet("QWIDGET_ALL_MINI"))
- return QAquaSizeMini;
- return QAquaSizeUnknown;
+ return QStyleHelper::SizeMini;
+ return QStyleHelper::SizeDefault;
}
- Q_Q(const QMacStyle);
- QSize large = qt_aqua_get_known_size(ct, widg, szHint, QAquaSizeLarge),
- small = qt_aqua_get_known_size(ct, widg, szHint, QAquaSizeSmall),
- mini = qt_aqua_get_known_size(ct, widg, szHint, QAquaSizeMini);
+ QSize large = qt_aqua_get_known_size(ct, widg, szHint, QStyleHelper::SizeLarge),
+ small = qt_aqua_get_known_size(ct, widg, szHint, QStyleHelper::SizeSmall),
+ mini = qt_aqua_get_known_size(ct, widg, szHint, QStyleHelper::SizeMini);
bool guess_size = false;
- QAquaWidgetSize ret = QAquaSizeUnknown;
- QMacStyle::WidgetSizePolicy wsp = q->widgetSizePolicy(widg);
- if (wsp == QMacStyle::SizeDefault)
+ QStyleHelper::WidgetSizePolicy ret = QStyleHelper::SizeDefault;
+ QStyleHelper::WidgetSizePolicy wsp = QStyleHelper::widgetSizePolicy(widg);
+ if (wsp == QStyleHelper::SizeDefault)
guess_size = true;
- else if (wsp == QMacStyle::SizeMini)
- ret = QAquaSizeMini;
- else if (wsp == QMacStyle::SizeSmall)
- ret = QAquaSizeSmall;
- else if (wsp == QMacStyle::SizeLarge)
- ret = QAquaSizeLarge;
+ else if (wsp == QStyleHelper::SizeMini)
+ ret = QStyleHelper::SizeMini;
+ else if (wsp == QStyleHelper::SizeSmall)
+ ret = QStyleHelper::SizeSmall;
+ else if (wsp == QStyleHelper::SizeLarge)
+ ret = QStyleHelper::SizeLarge;
if (guess_size)
ret = qt_aqua_guess_size(widg, large, small, mini);
QSize *sz = 0;
- if (ret == QAquaSizeSmall)
+ if (ret == QStyleHelper::SizeSmall)
sz = &small;
- else if (ret == QAquaSizeLarge)
+ else if (ret == QStyleHelper::SizeLarge)
sz = &large;
- else if (ret == QAquaSizeMini)
+ else if (ret == QStyleHelper::SizeMini)
sz = &mini;
if (insz)
*insz = sz ? *sz : QSize(-1, -1);
@@ -1240,7 +1366,7 @@ QAquaWidgetSize QMacStylePrivate::aquaSizeConstrain(const QStyleOption *option,
Q_UNUSED(widg);
Q_UNUSED(ct);
Q_UNUSED(szHint);
- return QAquaSizeUnknown;
+ return QStyleHelper::SizeDefault;
#endif
}
@@ -1248,10 +1374,10 @@ QAquaWidgetSize QMacStylePrivate::aquaSizeConstrain(const QStyleOption *option,
Returns the free space awailable for contents inside the
button (and not the size of the contents itself)
*/
-HIRect QMacStylePrivate::pushButtonContentBounds(const QStyleOptionButton *btn,
+CGRect QMacStylePrivate::pushButtonContentBounds(const QStyleOptionButton *btn,
const HIThemeButtonDrawInfo *bdi) const
{
- HIRect outerBounds = qt_hirectForQRect(btn->rect);
+ CGRect outerBounds = btn->rect.toCGRect();
// Adjust the bounds to correct for
// carbon not calculating the content bounds fully correct
if (bdi->kind == kThemePushButton || bdi->kind == kThemePushButtonSmall){
@@ -1261,7 +1387,7 @@ HIRect QMacStylePrivate::pushButtonContentBounds(const QStyleOptionButton *btn,
outerBounds.origin.y += QMacStylePrivate::PushButtonTopOffset;
}
- HIRect contentBounds;
+ CGRect contentBounds;
HIThemeGetButtonContentBounds(&outerBounds, bdi, &contentBounds);
return contentBounds;
}
@@ -1297,7 +1423,7 @@ bool QMacStylePrivate::contentFitsInPushButton(const QStyleOptionButton *btn,
ThemeButtonKind tmp = bdi->kind;
bdi->kind = buttonKindToCheck;
QSize contentSize = pushButtonSizeFromContents(btn);
- QRect freeContentRect = qt_qrectForHIRect(pushButtonContentBounds(btn, bdi));
+ QRect freeContentRect = QRectF::fromCGRect(pushButtonContentBounds(btn, bdi)).toRect();
bdi->kind = tmp;
return freeContentRect.contains(QRect(freeContentRect.x(), freeContentRect.y(),
contentSize.width(), contentSize.height()));
@@ -1333,19 +1459,19 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn,
bdi->kind = kThemeBevelButton;
} else {
switch (aquaSizeConstrain(btn, widget)) {
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
bdi->kind = kThemePushButtonSmall;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
bdi->kind = kThemePushButtonMini;
break;
- case QAquaSizeLarge:
+ case QStyleHelper::SizeLarge:
// ... We should honor if the user is explicit about using the
// large button. But right now Qt will specify the large button
- // as default rather than QAquaSizeUnknown.
- // So we treat it like QAquaSizeUnknown
+ // as default rather than QStyleHelper::SizeDefault.
+ // So we treat it like QStyleHelper::SizeDefault
// to get the dynamic choosing of button kind.
- case QAquaSizeUnknown:
+ case QStyleHelper::SizeDefault:
// Choose the button kind that closest match the button rect, but at the
// same time displays the button contents without clipping.
bdi->kind = kThemeBevelButton;
@@ -1399,18 +1525,18 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
else
bdi->state = tds;
- QAquaWidgetSize aSize = aquaSizeConstrain(combo, widget);
+ QStyleHelper::WidgetSizePolicy aSize = aquaSizeConstrain(combo, widget);
switch (aSize) {
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
bdi->kind = combo->editable ? ThemeButtonKind(kThemeComboBoxMini)
: ThemeButtonKind(kThemePopupButtonMini);
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
bdi->kind = combo->editable ? ThemeButtonKind(kThemeComboBoxSmall)
: ThemeButtonKind(kThemePopupButtonSmall);
break;
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeLarge:
+ case QStyleHelper::SizeDefault:
// Unless the user explicitly specified large buttons, determine the
// kind by looking at the combox size.
// ... specifying small and mini-buttons it not a current feature of
@@ -1466,9 +1592,9 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
Carbon draws comboboxes (and other views) outside the rect given as argument. Use this function to obtain
the corresponding inner rect for drawing the same combobox so that it stays inside the given outerBounds.
*/
-HIRect QMacStylePrivate::comboboxInnerBounds(const HIRect &outerBounds, int buttonKind)
+CGRect QMacStylePrivate::comboboxInnerBounds(const CGRect &outerBounds, int buttonKind)
{
- HIRect innerBounds = outerBounds;
+ CGRect innerBounds = outerBounds;
// Carbon draw parts of the view outside the rect.
// So make the rect a bit smaller to compensate
// (I wish HIThemeGetButtonBackgroundBounds worked)
@@ -1512,6 +1638,7 @@ HIRect QMacStylePrivate::comboboxInnerBounds(const HIRect &outerBounds, int butt
default:
break;
}
+
return innerBounds;
}
@@ -1553,17 +1680,17 @@ QRect QMacStylePrivate::comboboxEditBounds(const QRect &outerBounds, const HIThe
create it manually by drawing a small Carbon combo onto a pixmap (use pixmap cache), chop
it up, and copy it back onto the widget. Othervise, draw the combobox supplied by Carbon directly.
*/
-void QMacStylePrivate::drawCombobox(const HIRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p)
+void QMacStylePrivate::drawCombobox(const CGRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p)
{
if (!(bdi.kind == kThemeComboBox && outerBounds.size.height > 28)){
// We have an unscaled combobox, or popup-button; use Carbon directly.
- HIRect innerBounds = QMacStylePrivate::comboboxInnerBounds(outerBounds, bdi.kind);
+ const CGRect innerBounds = QMacStylePrivate::comboboxInnerBounds(outerBounds, bdi.kind);
HIThemeDrawButton(&innerBounds, &bdi, QMacCGContext(p), kHIThemeOrientationNormal, 0);
} else {
QPixmap buffer;
QString key = QString(QLatin1String("$qt_cbox%1-%2")).arg(int(bdi.state)).arg(int(bdi.adornment));
if (!QPixmapCache::find(key, buffer)) {
- HIRect innerBoundsSmallCombo = {{3, 3}, {29, 25}};
+ CGRect innerBoundsSmallCombo = {{3, 3}, {29, 25}};
buffer = QPixmap(35, 28);
buffer.fill(Qt::transparent);
QPainter buffPainter(&buffer);
@@ -1604,17 +1731,15 @@ void QMacStylePrivate::drawCombobox(const HIRect &outerBounds, const HIThemeButt
Carbon tableheaders don't scale (sight). So create it manually by drawing a small Carbon header
onto a pixmap (use pixmap cache), chop it up, and copy it back onto the widget.
*/
-void QMacStylePrivate::drawTableHeader(const HIRect &outerBounds,
+void QMacStylePrivate::drawTableHeader(const CGRect &outerBounds,
bool drawTopBorder, bool drawLeftBorder, const HIThemeButtonDrawInfo &bdi, QPainter *p)
{
- static SInt32 headerHeight = 0;
- static OSStatus err = GetThemeMetric(kThemeMetricListHeaderHeight, &headerHeight);
- Q_UNUSED(err);
+ static SInt32 headerHeight = qt_mac_aqua_get_metric(ListHeaderHeight);
QPixmap buffer;
QString key = QString(QLatin1String("$qt_tableh%1-%2-%3")).arg(int(bdi.state)).arg(int(bdi.adornment)).arg(int(bdi.value));
if (!QPixmapCache::find(key, buffer)) {
- HIRect headerNormalRect = {{0., 0.}, {16., CGFloat(headerHeight)}};
+ CGRect headerNormalRect = {{0., 0.}, {16., CGFloat(headerHeight)}};
buffer = QPixmap(headerNormalRect.size.width, headerNormalRect.size.height);
buffer.fill(Qt::transparent);
QPainter buffPainter(&buffer);
@@ -1665,148 +1790,85 @@ void QMacStylePrivate::drawTableHeader(const HIRect &outerBounds,
p->translate(-outerBounds.origin.x, -outerBounds.origin.y);
}
-/*
- Returns cutoff sizes for scroll bars.
- thumbIndicatorCutoff is the smallest size where the thumb indicator is drawn.
- scrollButtonsCutoff is the smallest size where the up/down buttons is drawn.
-*/
-enum ScrollBarCutoffType { thumbIndicatorCutoff = 0, scrollButtonsCutoff = 1 };
-static int scrollButtonsCutoffSize(ScrollBarCutoffType cutoffType, QMacStyle::WidgetSizePolicy widgetSize)
-{
- // Mini scroll bars do not exist as of version 10.4.
- if (widgetSize == QMacStyle::SizeMini)
- return 0;
-
- const int sizeIndex = (widgetSize == QMacStyle::SizeSmall) ? 1 : 0;
- static const int sizeTable[2][2] = { { 61, 56 }, { 49, 44 } };
- return sizeTable[sizeIndex][cutoffType];
-}
-
void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOptionSlider *slider,
HIThemeTrackDrawInfo *tdi, const QWidget *needToRemoveMe) const
{
+ Q_UNUSED(cc);
memset(tdi, 0, sizeof(HIThemeTrackDrawInfo)); // We don't get it all for some reason or another...
tdi->version = qt_mac_hitheme_version;
tdi->reserved = 0;
tdi->filler1 = 0;
- bool isScrollbar = (cc == QStyle::CC_ScrollBar);
switch (aquaSizeConstrain(slider, needToRemoveMe)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- if (isScrollbar)
- tdi->kind = kThemeMediumScrollBar;
- else
- tdi->kind = kThemeMediumSlider;
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
+ tdi->kind = kThemeMediumSlider;
break;
- case QAquaSizeMini:
- if (isScrollbar)
- tdi->kind = kThemeSmallScrollBar; // should be kThemeMiniScrollBar, but not implemented
- else
- tdi->kind = kThemeMiniSlider;
+ case QStyleHelper::SizeMini:
+ tdi->kind = kThemeMiniSlider;
break;
- case QAquaSizeSmall:
- if (isScrollbar)
- tdi->kind = kThemeSmallScrollBar;
- else
- tdi->kind = kThemeSmallSlider;
+ case QStyleHelper::SizeSmall:
+ tdi->kind = kThemeSmallSlider;
break;
}
bool usePlainKnob = slider->tickPosition == QSlider::NoTicks
|| slider->tickPosition == QSlider::TicksBothSides;
- tdi->bounds = qt_hirectForQRect(slider->rect);
- if (isScrollbar) {
- tdi->min = slider->minimum;
- tdi->max = slider->maximum;
- tdi->value = slider->sliderPosition;
+ tdi->bounds = slider->rect.toCGRect();
+ // Fix min and max positions. HITheme seems confused when it comes to rendering
+ // a slider at those positions. We give it a hand by extending and offsetting
+ // the slider range accordingly. See also comment for CC_Slider in drawComplexControl()
+ tdi->min = 0;
+ if (slider->orientation == Qt::Horizontal)
+ tdi->max = 10 * slider->rect.width();
+ else
+ tdi->max = 10 * slider->rect.height();
+
+ int range = slider->maximum - slider->minimum;
+ if (range == 0) {
+ tdi->value = 0;
+ } else if (usePlainKnob || slider->orientation == Qt::Horizontal) {
+ int endsCorrection = usePlainKnob ? 25 : 10;
+ tdi->value = (tdi->max + 2 * endsCorrection) * (slider->sliderPosition - slider->minimum) / range - endsCorrection;
} else {
- // Fix min and max positions. HITheme seems confused when it comes to rendering
- // a slider at those positions. We give it a hand by extending and offsetting
- // the slider range accordingly. See also comment for CC_Slider in drawComplexControl()
- tdi->min = 0;
- if (slider->orientation == Qt::Horizontal)
- tdi->max = 10 * slider->rect.width();
- else
- tdi->max = 10 * slider->rect.height();
-
- int range = slider->maximum - slider->minimum;
- if (range == 0) {
- tdi->value = 0;
- } else if (usePlainKnob || slider->orientation == Qt::Horizontal) {
- int endsCorrection = usePlainKnob ? 25 : 10;
- tdi->value = (tdi->max + 2 * endsCorrection) * (slider->sliderPosition - slider->minimum) / range - endsCorrection;
- } else {
- tdi->value = (tdi->max + 30) * (slider->sliderPosition - slider->minimum) / range - 20;
- }
+ tdi->value = (tdi->max + 30) * (slider->sliderPosition - slider->minimum) / range - 20;
}
+
tdi->attributes = kThemeTrackShowThumb;
if (slider->upsideDown)
tdi->attributes |= kThemeTrackRightToLeft;
if (slider->orientation == Qt::Horizontal) {
tdi->attributes |= kThemeTrackHorizontal;
- if (isScrollbar && slider->direction == Qt::RightToLeft) {
- if (!slider->upsideDown)
- tdi->attributes |= kThemeTrackRightToLeft;
- else
- tdi->attributes &= ~kThemeTrackRightToLeft;
- }
- }
-
- // Tiger broke reverse scroll bars so put them back and "fake it"
- if (isScrollbar && (tdi->attributes & kThemeTrackRightToLeft)) {
- tdi->attributes &= ~kThemeTrackRightToLeft;
- tdi->value = tdi->max - tdi->value;
}
tdi->enableState = (slider->state & QStyle::State_Enabled) ? kThemeTrackActive
: kThemeTrackDisabled;
- if (!isScrollbar) {
- if (slider->state & QStyle::QStyle::State_HasFocus)
- tdi->attributes |= kThemeTrackHasFocus;
- if (usePlainKnob)
- tdi->trackInfo.slider.thumbDir = kThemeThumbPlain;
- else if (slider->tickPosition == QSlider::TicksAbove)
- tdi->trackInfo.slider.thumbDir = kThemeThumbUpward;
- else
- tdi->trackInfo.slider.thumbDir = kThemeThumbDownward;
- } else {
- tdi->trackInfo.scrollbar.viewsize = slider->pageStep;
- }
-}
-
-void QMacStylePrivate::setAutoDefaultButton(QObject *button) const
-{
- if (autoDefaultButton != button) {
- if (QStyleAnimation *anim = animation(autoDefaultButton)) {
- anim->updateTarget();
- stopAnimation(autoDefaultButton);
- }
- autoDefaultButton = button;
- }
- if (autoDefaultButton && !animation(autoDefaultButton))
- startAnimation(new QStyleAnimation(autoDefaultButton));
+ if (slider->state & QStyle::QStyle::State_HasFocus)
+ tdi->attributes |= kThemeTrackHasFocus;
+ if (usePlainKnob)
+ tdi->trackInfo.slider.thumbDir = kThemeThumbPlain;
+ else if (slider->tickPosition == QSlider::TicksAbove)
+ tdi->trackInfo.slider.thumbDir = kThemeThumbUpward;
+ else
+ tdi->trackInfo.slider.thumbDir = kThemeThumbDownward;
}
QMacStylePrivate::QMacStylePrivate()
- : mouseDown(false), backingStoreNSView(nil)
+ : backingStoreNSView(nil)
{
- defaultButtonStart = CFAbsoluteTimeGetCurrent();
- memset(&buttonState, 0, sizeof(ButtonState));
-
- if (ptrHIShapeGetBounds == 0) {
- QLibrary library(QLatin1String("/System/Library/Frameworks/Carbon.framework/Carbon"));
- library.setLoadHints(QLibrary::ExportExternalSymbolsHint);
- ptrHIShapeGetBounds = reinterpret_cast<PtrHIShapeGetBounds>(library.resolve("HIShapeGetBounds"));
- }
-
+ if (auto *ssf = QGuiApplicationPrivate::platformTheme()->font(QPlatformTheme::SmallFont))
+ smallSystemFont = *ssf;
+ if (auto *msf = QGuiApplicationPrivate::platformTheme()->font(QPlatformTheme::MiniFont))
+ miniSystemFont = *msf;
}
QMacStylePrivate::~QMacStylePrivate()
{
QMacAutoReleasePool pool;
- Q_FOREACH (NSView *b, cocoaControls)
+ for (NSView *b : cocoaControls)
[b release];
+ for (NSCell *cell : cocoaCells)
+ [cell release];
}
ThemeDrawState QMacStylePrivate::getDrawState(QStyle::State flags)
@@ -1840,7 +1902,7 @@ static QCocoaWidget cocoaWidgetFromHIThemeButtonKind(ThemeButtonKind kind)
w.first = QCocoaComboBox;
break;
case kThemeArrowButton:
- w.first = QCocoaArrowButton;
+ w.first = QCocoaDisclosureButton;
break;
case kThemeCheckBox:
case kThemeCheckBoxSmall:
@@ -1866,16 +1928,16 @@ static QCocoaWidget cocoaWidgetFromHIThemeButtonKind(ThemeButtonKind kind)
case kThemePopupButtonSmall:
case kThemeCheckBoxSmall:
case kThemeRadioButtonSmall:
- w.second = QAquaSizeSmall;
+ w.second = QStyleHelper::SizeSmall;
break;
case kThemePushButtonMini:
case kThemePopupButtonMini:
case kThemeCheckBoxMini:
case kThemeRadioButtonMini:
- w.second = QAquaSizeMini;
+ w.second = QStyleHelper::SizeMini;
break;
default:
- w.second = QAquaSizeLarge;
+ w.second = QStyleHelper::SizeLarge;
break;
}
@@ -1892,6 +1954,16 @@ NSView *QMacStylePrivate::cocoaControl(QCocoaWidget widget) const
bv = [[NSPopUpButton alloc] init];
else if (widget.first == QCocoaComboBox)
bv = [[NSComboBox alloc] init];
+ else if (widget.first == QCocoaProgressIndicator)
+ bv = [[NSProgressIndicator alloc] init];
+ else if (widget.first == QCocoaIndeterminateProgressIndicator)
+ bv = [[QIndeterminateProgressIndicator alloc] init];
+ else if (widget.first == QCocoaHorizontalScroller)
+ bv = [[NSScroller alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)];
+ else if (widget.first == QCocoaVerticalScroller)
+ // Cocoa sets the orientation from the view's frame
+ // at construction time, and it cannot be changed later.
+ bv = [[NSScroller alloc] initWithFrame:NSMakeRect(0, 0, 20, 200)];
else if (widget.first == QCocoaHorizontalSlider)
bv = [[NSSlider alloc] init];
else if (widget.first == QCocoaVerticalSlider)
@@ -1902,7 +1974,7 @@ NSView *QMacStylePrivate::cocoaControl(QCocoaWidget widget) const
bv = [[NSButton alloc] init];
switch (widget.first) {
- case QCocoaArrowButton: {
+ case QCocoaDisclosureButton: {
NSButton *bc = (NSButton *)bv;
bc.buttonType = NSOnOffButton;
bc.bezelStyle = NSDisclosureBezelStyle;
@@ -1941,15 +2013,28 @@ NSView *QMacStylePrivate::cocoaControl(QCocoaWidget widget) const
if ([bv isKindOfClass:[NSControl class]]) {
NSCell *bcell = [(NSControl *)bv cell];
switch (widget.second) {
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
bcell.controlSize = NSSmallControlSize;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
bcell.controlSize = NSMiniControlSize;
break;
default:
break;
}
+ } else if ([bv isKindOfClass:[NSProgressIndicator class]]) {
+ auto *pi = static_cast<NSProgressIndicator *>(bv);
+ pi.indeterminate = (widget.first == QCocoaIndeterminateProgressIndicator);
+ switch (widget.second) {
+ case QStyleHelper::SizeSmall:
+ pi.controlSize = NSSmallControlSize;
+ break;
+ case QStyleHelper::SizeMini:
+ pi.controlSize = NSMiniControlSize;
+ break;
+ default:
+ break;
+ }
}
const_cast<QMacStylePrivate *>(this)->cocoaControls.insert(widget, bv);
@@ -1958,53 +2043,85 @@ NSView *QMacStylePrivate::cocoaControl(QCocoaWidget widget) const
return bv;
}
+NSCell *QMacStylePrivate::cocoaCell(QCocoaWidget widget) const
+{
+ NSCell *cell = cocoaCells[widget];
+ if (!cell) {
+ switch (widget.first) {
+ case QCocoaStepper:
+ cell = [[NSStepperCell alloc] init];
+ break;
+ case QCocoaDisclosureButton: {
+ NSButtonCell *bc = [[NSButtonCell alloc] init];
+ bc.buttonType = NSOnOffButton;
+ bc.bezelStyle = NSDisclosureBezelStyle;
+ cell = bc;
+ break;
+ }
+ default:
+ break;
+ }
+
+ switch (widget.second) {
+ case QStyleHelper::SizeSmall:
+ cell.controlSize = NSSmallControlSize;
+ break;
+ case QStyleHelper::SizeMini:
+ cell.controlSize = NSMiniControlSize;
+ break;
+ default:
+ break;
+ }
+
+ const_cast<QMacStylePrivate *>(this)->cocoaCells.insert(widget, cell);
+ }
+
+ return cell;
+}
+
void QMacStylePrivate::drawNSViewInRect(QCocoaWidget widget, NSView *view, const QRect &qtRect, QPainter *p, bool isQWidget, QCocoaDrawRectBlock drawRectBlock) const
{
QPoint offset;
- if (widget == QCocoaWidget(QCocoaRadioButton, QAquaSizeLarge))
+ if (widget == QCocoaWidget(QCocoaRadioButton, QStyleHelper::SizeLarge))
offset.setY(2);
- else if (widget == QCocoaWidget(QCocoaRadioButton, QAquaSizeSmall))
+ else if (widget == QCocoaWidget(QCocoaRadioButton, QStyleHelper::SizeSmall))
offset = QPoint(-1, 2);
- else if (widget == QCocoaWidget(QCocoaRadioButton, QAquaSizeMini))
+ else if (widget == QCocoaWidget(QCocoaRadioButton, QStyleHelper::SizeMini))
offset.setY(2);
- else if (widget == QCocoaWidget(QCocoaPopupButton, QAquaSizeSmall)
- || widget == QCocoaWidget(QCocoaCheckBox, QAquaSizeLarge))
+ else if (widget == QCocoaWidget(QCocoaPopupButton, QStyleHelper::SizeSmall)
+ || widget == QCocoaWidget(QCocoaCheckBox, QStyleHelper::SizeLarge))
offset.setY(1);
- else if (widget == QCocoaWidget(QCocoaCheckBox, QAquaSizeSmall))
+ else if (widget == QCocoaWidget(QCocoaCheckBox, QStyleHelper::SizeSmall))
offset.setX(-1);
- else if (widget == QCocoaWidget(QCocoaCheckBox, QAquaSizeMini))
+ else if (widget == QCocoaWidget(QCocoaCheckBox, QStyleHelper::SizeMini))
offset = QPoint(7, 5);
- else if (widget == QCocoaWidget(QCocoaPopupButton, QAquaSizeMini))
+ else if (widget == QCocoaWidget(QCocoaPopupButton, QStyleHelper::SizeMini))
offset = QPoint(2, -1);
- else if (widget == QCocoaWidget(QCocoaPullDownButton, QAquaSizeLarge))
+ else if (widget == QCocoaWidget(QCocoaPullDownButton, QStyleHelper::SizeLarge))
offset = isQWidget ? QPoint(3, -1) : QPoint(-1, -3);
- else if (widget == QCocoaWidget(QCocoaPullDownButton, QAquaSizeSmall))
+ else if (widget == QCocoaWidget(QCocoaPullDownButton, QStyleHelper::SizeSmall))
offset = QPoint(2, 1);
- else if (widget == QCocoaWidget(QCocoaPullDownButton, QAquaSizeMini))
+ else if (widget == QCocoaWidget(QCocoaPullDownButton, QStyleHelper::SizeMini))
offset = QPoint(5, 0);
- else if (widget == QCocoaWidget(QCocoaComboBox, QAquaSizeLarge))
+ else if (widget == QCocoaWidget(QCocoaComboBox, QStyleHelper::SizeLarge))
offset = QPoint(3, 0);
QMacCGContext ctx(p);
- CGContextSaveGState(ctx);
- CGContextTranslateCTM(ctx, offset.x(), offset.y());
+ setupNSGraphicsContext(ctx, YES);
- [NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
- graphicsContextWithGraphicsPort:ctx flipped:YES]];
+ CGContextTranslateCTM(ctx, offset.x(), offset.y());
- NSRect rect = NSMakeRect(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
+ const CGRect rect = CGRectMake(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
[backingStoreNSView addSubview:view];
view.frame = rect;
if (drawRectBlock)
- drawRectBlock(rect, (CGContextRef)ctx);
+ drawRectBlock(ctx, rect);
else
[view drawRect:rect];
[view removeFromSuperviewWithoutNeedingDisplay];
- [NSGraphicsContext restoreGraphicsState];
- CGContextRestoreGState(ctx);
+ restoreNSGraphicsContext(ctx);
}
void QMacStylePrivate::resolveCurrentNSView(QWindow *window)
@@ -2012,7 +2129,7 @@ void QMacStylePrivate::resolveCurrentNSView(QWindow *window)
backingStoreNSView = window ? (NSView *)window->winId() : nil;
}
-void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi,
+void QMacStylePrivate::drawColorlessButton(const CGRect &macRect, HIThemeButtonDrawInfo *bdi,
QPainter *p, const QStyleOption *opt) const
{
int xoff = 0,
@@ -2063,7 +2180,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QMacStylePrivate::drawCombobox(macRect, *bdi, &tmpPainter);
} else {
QMacCGContext cg(&activePixmap);
- HIRect newRect = CGRectMake(xoff, yoff, macRect.size.width, macRect.size.height);
+ CGRect newRect = CGRectMake(xoff, yoff, macRect.size.width, macRect.size.height);
if (button && pressed)
bdi->state = kThemeStateActive;
else if (viewItem)
@@ -2121,7 +2238,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
colorlessPixmap.fill(Qt::transparent);
QMacCGContext cg(&colorlessPixmap);
- HIRect newRect = CGRectMake(xoff, yoff, macRect.size.width, macRect.size.height);
+ CGRect newRect = CGRectMake(xoff, yoff, macRect.size.width, macRect.size.height);
int oldValue = bdi->value;
bdi->value = kThemeButtonOff;
HIThemeDrawButton(&newRect, bdi, cg, kHIThemeOrientationNormal, 0);
@@ -2161,20 +2278,10 @@ QMacStyle::QMacStyle()
QMacAutoReleasePool pool;
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
- NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
-
- [[NSNotificationCenter defaultCenter] addObserver:receiver
- selector:@selector(scrollBarStyleDidChange:)
- name:NSPreferredScrollerStyleDidChangeNotification
- object:nil];
-
- // Create scroller objects. Scroller internal direction setup happens
- // on initWithFrame and cannot be changed later on. Create two scrollers
- // initialized with fake geometry. Correct geometry is set at draw time.
- d->horizontalScroller = [[NSScroller alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)];
- d->verticalScroller = [[NSScroller alloc] initWithFrame:NSMakeRect(0, 0, 20, 200)];
-
- d->indicatorBranchButtonCell = nil;
+ [[NSNotificationCenter defaultCenter] addObserver:d->receiver
+ selector:@selector(scrollBarStyleDidChange:)
+ name:NSPreferredScrollerStyleDidChangeNotification
+ object:nil];
}
QMacStyle::~QMacStyle()
@@ -2182,12 +2289,8 @@ QMacStyle::~QMacStyle()
Q_D(QMacStyle);
QMacAutoReleasePool pool;
- [d->horizontalScroller release];
- [d->verticalScroller release];
-
- NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
- [[NSNotificationCenter defaultCenter] removeObserver:receiver];
- [receiver release];
+ [[NSNotificationCenter defaultCenter] removeObserver:d->receiver];
+ [d->receiver release];
delete qt_mac_backgroundPattern;
qt_mac_backgroundPattern = 0;
@@ -2273,16 +2376,6 @@ void QMacStyle::unpolish(QApplication *)
void QMacStyle::polish(QWidget* w)
{
- if (qt_mac_is_metal(w) && !w->testAttribute(Qt::WA_SetPalette)) {
- // Set a clear brush so that the metal shines through.
- QPalette pal = w->palette();
- QBrush background(Qt::transparent);
- pal.setBrush(QPalette::All, QPalette::Window, background);
- pal.setBrush(QPalette::All, QPalette::Button, background);
- w->setPalette(pal);
- w->setAttribute(Qt::WA_SetPalette, false);
- }
-
#ifndef QT_NO_MENU
if (qobject_cast<QMenu*>(w)
#if QT_CONFIG(combobox)
@@ -2341,12 +2434,11 @@ void QMacStyle::polish(QWidget* w)
void QMacStyle::unpolish(QWidget* w)
{
- if ((
+ if (
#ifndef QT_NO_MENU
- qobject_cast<QMenu*>(w) ||
+ qobject_cast<QMenu*>(w) &&
#endif
- qt_mac_is_metal(w)
- ) && !w->testAttribute(Qt::WA_SetPalette)) {
+ !w->testAttribute(Qt::WA_SetPalette)) {
QPalette pal = qApp->palette(w);
w->setPalette(pal);
w->setAttribute(Qt::WA_SetPalette, false);
@@ -2392,7 +2484,7 @@ void QMacStyle::unpolish(QWidget* w)
int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const
{
Q_D(const QMacStyle);
- int controlSize = getControlSize(opt, widget);
+ const int controlSize = getControlSize(opt, widget);
SInt32 ret = 0;
switch (metric) {
@@ -2405,7 +2497,7 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
break;
case PM_FocusFrameVMargin:
case PM_FocusFrameHMargin:
- GetThemeMetric(kThemeMetricFocusRectOutset, &ret);
+ ret = qt_mac_aqua_get_metric(FocusRectOutset);
break;
case PM_DialogButtonsSeparator:
ret = -5;
@@ -2448,13 +2540,7 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 2;
break;
case PM_MenuScrollerHeight:
-#if 0
- SInt16 ash, asw;
- GetThemeMenuItemExtra(kThemeMenuItemScrollUpArrow, &ash, &asw);
- ret = ash;
-#else
ret = 15; // I hate having magic numbers in here...
-#endif
break;
case PM_DefaultFrameWidth:
#ifndef QT_NO_MAINWINDOW
@@ -2478,14 +2564,14 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 24;
break;
case PM_SpinBoxFrameWidth:
- GetThemeMetric(kThemeMetricEditTextFrameOutset, &ret);
+ ret = qt_mac_aqua_get_metric(EditTextFrameOutset);
switch (d->aquaSizeConstrain(opt, widget)) {
+ case QStyleHelper::SizeMini:
+ ret += 1;
+ break;
default:
ret += 2;
break;
- case QAquaSizeMini:
- ret += 1;
- break;
}
break;
case PM_ButtonShiftHorizontal:
@@ -2548,16 +2634,16 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
break; }
case QStyle::PM_TabBarTabHSpace:
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeLarge:
+ case QStyleHelper::SizeLarge:
ret = QCommonStyle::pixelMetric(metric, opt, widget);
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
ret = 20;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
ret = 16;
break;
- case QAquaSizeUnknown:
+ case QStyleHelper::SizeDefault:
const QStyleOptionTab *tb = qstyleoption_cast<const QStyleOptionTab *>(opt);
if (tb && tb->documentMode)
ret = 30;
@@ -2581,78 +2667,78 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
break;
case PM_TabBarBaseOverlap:
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
ret = 11;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
ret = 8;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
ret = 7;
break;
}
break;
case PM_ScrollBarExtent: {
- const QAquaWidgetSize size = d->effectiveAquaSizeConstrain(opt, widget);
+ const QStyleHelper::WidgetSizePolicy size = d->effectiveAquaSizeConstrain(opt, widget);
ret = static_cast<SInt32>([NSScroller
scrollerWidthForControlSize:static_cast<NSControlSize>(size)
scrollerStyle:[NSScroller preferredScrollerStyle]]);
break; }
case PM_IndicatorHeight: {
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- GetThemeMetric(kThemeMetricCheckBoxHeight, &ret);
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
+ ret = qt_mac_aqua_get_metric(CheckBoxHeight);
break;
- case QAquaSizeMini:
- GetThemeMetric(kThemeMetricMiniCheckBoxHeight, &ret);
+ case QStyleHelper::SizeMini:
+ ret = qt_mac_aqua_get_metric(MiniCheckBoxHeight);
break;
- case QAquaSizeSmall:
- GetThemeMetric(kThemeMetricSmallCheckBoxHeight, &ret);
+ case QStyleHelper::SizeSmall:
+ ret = qt_mac_aqua_get_metric(SmallCheckBoxHeight);
break;
}
break; }
case PM_IndicatorWidth: {
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- GetThemeMetric(kThemeMetricCheckBoxWidth, &ret);
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
+ ret = qt_mac_aqua_get_metric(CheckBoxWidth);
break;
- case QAquaSizeMini:
- GetThemeMetric(kThemeMetricMiniCheckBoxWidth, &ret);
+ case QStyleHelper::SizeMini:
+ ret = qt_mac_aqua_get_metric(MiniCheckBoxWidth);
break;
- case QAquaSizeSmall:
- GetThemeMetric(kThemeMetricSmallCheckBoxWidth, &ret);
+ case QStyleHelper::SizeSmall:
+ ret = qt_mac_aqua_get_metric(SmallCheckBoxWidth);
break;
}
++ret;
break; }
case PM_ExclusiveIndicatorHeight: {
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- GetThemeMetric(kThemeMetricRadioButtonHeight, &ret);
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
+ ret = qt_mac_aqua_get_metric(RadioButtonHeight);
break;
- case QAquaSizeMini:
- GetThemeMetric(kThemeMetricMiniRadioButtonHeight, &ret);
+ case QStyleHelper::SizeMini:
+ ret = qt_mac_aqua_get_metric(MiniRadioButtonHeight);
break;
- case QAquaSizeSmall:
- GetThemeMetric(kThemeMetricSmallRadioButtonHeight, &ret);
+ case QStyleHelper::SizeSmall:
+ ret = qt_mac_aqua_get_metric(SmallRadioButtonHeight);
break;
}
break; }
case PM_ExclusiveIndicatorWidth: {
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- GetThemeMetric(kThemeMetricRadioButtonWidth, &ret);
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
+ ret = qt_mac_aqua_get_metric(RadioButtonWidth);
break;
- case QAquaSizeMini:
- GetThemeMetric(kThemeMetricMiniRadioButtonWidth, &ret);
+ case QStyleHelper::SizeMini:
+ ret = qt_mac_aqua_get_metric(MiniRadioButtonWidth);
break;
- case QAquaSizeSmall:
- GetThemeMetric(kThemeMetricSmallRadioButtonWidth, &ret);
+ case QStyleHelper::SizeSmall:
+ ret = qt_mac_aqua_get_metric(SmallRadioButtonWidth);
break;
}
++ret;
@@ -2667,11 +2753,11 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 0;
break;
case PM_SizeGripSize: {
- QAquaWidgetSize aSize;
+ QStyleHelper::WidgetSizePolicy aSize;
if (widget && widget->window()->windowType() == Qt::Tool)
- aSize = QAquaSizeSmall;
+ aSize = QStyleHelper::SizeSmall;
else
- aSize = QAquaSizeLarge;
+ aSize = QStyleHelper::SizeLarge;
const QSize size = qt_aqua_get_known_size(CT_SizeGrip, widget, QSize(), aSize);
ret = size.width();
break; }
@@ -2712,24 +2798,13 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
}
if (isWindow) {
- bool isMetal = widget && widget->testAttribute(Qt::WA_MacBrushedMetal);
- if (isMetal) {
- if (metric == PM_LayoutTopMargin) {
- return_SIZE(9 /* AHIG */, 6 /* guess */, 6 /* guess */);
- } else if (metric == PM_LayoutBottomMargin) {
- return_SIZE(18 /* AHIG */, 15 /* guess */, 13 /* guess */);
- } else {
- return_SIZE(14 /* AHIG */, 11 /* guess */, 9 /* guess */);
- }
- } else {
- /*
- AHIG would have (20, 8, 10) here but that makes
- no sense. It would also have 14 for the top margin
- but this contradicts both Builder and most
- applications.
- */
- return_SIZE(20, 10, 10); // AHIG
- }
+ /*
+ AHIG would have (20, 8, 10) here but that makes
+ no sense. It would also have 14 for the top margin
+ but this contradicts both Builder and most
+ applications.
+ */
+ return_SIZE(20, 10, 10); // AHIG
} else {
// hack to detect QTabWidget
if (widget && widget->parentWidget()
@@ -3077,7 +3152,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
if (opt) {
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
ret = true;
- HIRect menuRect = CGRectMake(opt->rect.x(), opt->rect.y() + 4,
+ CGRect menuRect = CGRectMake(opt->rect.x(), opt->rect.y() + 4,
opt->rect.width(), opt->rect.height() - 8);
HIThemeMenuDrawInfo mdi;
mdi.version = 0;
@@ -3118,6 +3193,10 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_ItemView_ScrollMode:
ret = QAbstractItemView::ScrollPerPixel;
break;
+ case SH_TitleBar_ShowToolTipsOnButtons:
+ // min/max/close buttons on windows don't show tool tips
+ ret = false;
+ break;
default:
ret = QCommonStyle::styleHint(sh, opt, w, hret);
break;
@@ -3181,35 +3260,6 @@ QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOpt
return icon.pixmap(qt_getWindow(widget), QSize(size, size));
}
-void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy)
-{
- QWidget *wadget = const_cast<QWidget *>(widget);
- wadget->setAttribute(Qt::WA_MacNormalSize, policy == SizeLarge);
- wadget->setAttribute(Qt::WA_MacSmallSize, policy == SizeSmall);
- wadget->setAttribute(Qt::WA_MacMiniSize, policy == SizeMini);
-}
-
-QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget, const QStyleOption *opt)
-{
- while (widget) {
- if (widget->testAttribute(Qt::WA_MacMiniSize)) {
- return SizeMini;
- } else if (widget->testAttribute(Qt::WA_MacSmallSize)) {
- return SizeSmall;
- } else if (widget->testAttribute(Qt::WA_MacNormalSize)) {
- return SizeLarge;
- }
- widget = widget->parentWidget();
- }
-
- if (opt && opt->state & State_Mini)
- return SizeMini;
- else if (opt && opt->state & State_Small)
- return SizeSmall;
-
- return SizeDefault;
-}
-
void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
const QWidget *w) const
{
@@ -3307,8 +3357,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
else
#endif
gdi.kind = kHIThemeGroupBoxKindPrimary;
- HIRect hirect = qt_hirectForQRect(opt->rect);
- HIThemeDrawGroupBox(&hirect, &gdi, cg, kHIThemeOrientationNormal);
+ CGRect cgRect = opt->rect.toCGRect();
+ HIThemeDrawGroupBox(&cgRect, &gdi, cg, kHIThemeOrientationNormal);
}
}
break;
@@ -3450,20 +3500,20 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
bdi.adornment |= kThemeAdornmentFocus;
bool isRadioButton = (pe == PE_IndicatorRadioButton);
switch (d->aquaSizeConstrain(opt, w)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
if (isRadioButton)
bdi.kind = kThemeRadioButton;
else
bdi.kind = kThemeCheckBox;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
if (isRadioButton)
bdi.kind = kThemeMiniRadioButton;
else
bdi.kind = kThemeMiniCheckBox;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
if (isRadioButton)
bdi.kind = kThemeSmallRadioButton;
else
@@ -3476,7 +3526,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
bdi.value = kThemeButtonOn;
else
bdi.value = kThemeButtonOff;
- HIRect macRect = qt_hirectForQRect(opt->rect);
+ CGRect macRect = opt->rect.toCGRect();
if (!drawColorless)
HIThemeDrawButton(&macRect, &bdi, cg, kHIThemeOrientationNormal, 0);
else
@@ -3488,20 +3538,12 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_IndicatorBranch: {
if (!(opt->state & State_Children))
break;
- if (!d->indicatorBranchButtonCell)
- const_cast<QMacStylePrivate *>(d)->indicatorBranchButtonCell = (void *)[[NSButtonCell alloc] init];
- NSButtonCell *triangleCell = (NSButtonCell *)d->indicatorBranchButtonCell;
- [triangleCell setButtonType:NSOnOffButton];
+ NSButtonCell *triangleCell = static_cast<NSButtonCell *>(d->cocoaCell(QCocoaWidget(QCocoaDisclosureButton, QStyleHelper::SizeLarge)));
[triangleCell setState:(opt->state & State_Open) ? NSOnState : NSOffState];
- [triangleCell setBezelStyle:NSDisclosureBezelStyle];
bool viewHasFocus = (w && w->hasFocus()) || (opt->state & State_HasFocus);
[triangleCell setBackgroundStyle:((opt->state & State_Selected) && viewHasFocus) ? NSBackgroundStyleDark : NSBackgroundStyleLight];
- CGContextSaveGState(cg);
- [NSGraphicsContext saveGraphicsState];
-
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
- graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]];
+ d->setupNSGraphicsContext(cg, NO);
QRect qtRect = opt->rect.adjusted(DisclosureOffset, 0, -DisclosureOffset, 0);
CGRect rect = CGRectMake(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
@@ -3511,8 +3553,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
[triangleCell drawBezelWithFrame:NSRectFromCGRect(rect) inView:[triangleCell controlView]];
- [NSGraphicsContext restoreGraphicsState];
- CGContextRestoreGState(cg);
+ d->restoreNSGraphicsContext(cg);
break; }
case PE_Frame: {
@@ -3534,7 +3575,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
SInt32 frame_size;
fdi.kind = frame->features & QStyleOptionFrame::Rounded ? kHIThemeFrameTextFieldRound :
kHIThemeFrameTextFieldSquare;
- GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
+ frame_size = qt_mac_aqua_get_metric(EditTextFrameOutset);
if ((frame->state & State_ReadOnly) || !(frame->state & State_Enabled))
fdi.state = kThemeStateInactive;
else if (fdi.state == kThemeStatePressed)
@@ -3552,11 +3593,10 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
p->drawRect(frame->rect);
p->restore();
}
- HIRect hirect = qt_hirectForQRect(frame->rect,
- QRect(frame_size, frame_size,
- frame_size * 2, frame_size * 2));
+ const auto frameMargins = QMargins(frame_size, frame_size, frame_size, frame_size);
+ const CGRect cgRect = frame->rect.marginsRemoved(frameMargins).toCGRect();
- HIThemeDrawFrame(&hirect, &fdi, cg, kHIThemeOrientationNormal);
+ HIThemeDrawFrame(&cgRect, &fdi, cg, kHIThemeOrientationNormal);
} else {
QCommonStyle::drawPrimitive(pe, opt, p, w);
}
@@ -3583,7 +3623,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_FrameTabWidget:
if (const QStyleOptionTabWidgetFrame *twf
= qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
- HIRect hirect = qt_hirectForQRect(twf->rect);
+ CGRect cgRect = twf->rect.toCGRect();
HIThemeTabPaneDrawInfo tpdi;
tpdi.version = qt_mac_hitheme_tab_version();
tpdi.state = tds;
@@ -3591,7 +3631,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
tpdi.size = kHIThemeTabSizeNormal;
tpdi.kind = kHIThemeTabKindNormal;
tpdi.adornment = kHIThemeTabPaneAdornmentNormal;
- HIThemeDrawTabPane(&hirect, &tpdi, cg, kHIThemeOrientationNormal);
+ HIThemeDrawTabPane(&cgRect, &tpdi, cg, kHIThemeOrientationNormal);
}
break;
#endif
@@ -3674,6 +3714,18 @@ static inline QPixmap darkenPixmap(const QPixmap &pixmap)
+void QMacStylePrivate::setupVerticalInvertedXform(CGContextRef cg, bool reverse, bool vertical, const CGRect &rect) const
+{
+ if (vertical) {
+ CGContextTranslateCTM(cg, rect.size.height, 0);
+ CGContextRotateCTM(cg, M_PI_2);
+ }
+ if (vertical != reverse) {
+ CGContextTranslateCTM(cg, rect.size.width, 0);
+ CGContextScaleCTM(cg, -1, 1);
+ }
+}
+
void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p,
const QWidget *w) const
{
@@ -3744,7 +3796,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
bdi.adornment = kThemeAdornmentFocus;
ir = visualRect(header->direction, header->rect, ir);
- HIRect bounds = qt_hirectForQRect(ir);
+ CGRect bounds = ir.toCGRect();
bool noVerticalHeader = true;
#if QT_CONFIG(tableview)
@@ -3896,36 +3948,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
break;
}
- // No default button pulsating animation on Yosemite,
- // so we have to do few things differently.
-
// a focused auto-default button within an active window
// takes precedence over a normal default button
- if (btn->features & QStyleOptionButton::AutoDefaultButton
- && opt->state & State_Active && opt->state & State_HasFocus) {
+ if ((btn->features & QStyleOptionButton::AutoDefaultButton)
+ && (opt->state & State_Active)
+ && (opt->state & State_HasFocus))
d->autoDefaultButton = opt->styleObject;
- } else if (d->autoDefaultButton == opt->styleObject) {
- d->setAutoDefaultButton(0);
- }
-
- if (!d->autoDefaultButton) {
- if (btn->features & QStyleOptionButton::DefaultButton && opt->state & State_Active) {
- d->defaultButton = opt->styleObject;
- } else if (d->defaultButton == opt->styleObject) {
- if (QStyleAnimation *animation = d->animation(opt->styleObject)) {
- animation->updateTarget();
- d->stopAnimation(opt->styleObject);
- }
- d->defaultButton = 0;
- }
- }
-
- // TODO: find out the pressed button in a qwidget independent way
- extern QWidget *qt_button_down; // qwidgetwindow.cpp
- if (opt->styleObject == qt_button_down)
- d->pressedButton = opt->styleObject;
- else if (d->pressedButton == opt->styleObject)
- d->pressedButton = 0;
+ else if (d->autoDefaultButton == opt->styleObject)
+ d->autoDefaultButton = nullptr;
bool hasMenu = btn->features & QStyleOptionButton::HasMenu;
HIThemeButtonDrawInfo bdi;
@@ -3948,7 +3978,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// Unlike Carbon, we want the button to always be drawn inside its bounds.
// Therefore, make the button a bit smaller, so that even if it got focus,
// the focus 'shadow' will be inside.
- HIRect newRect = qt_hirectForQRect(btn->rect);
+ CGRect newRect = btn->rect.toCGRect();
if (bdi.kind == kThemePushButton || bdi.kind == kThemePushButtonSmall) {
newRect.origin.x += QMacStylePrivate::PushButtonLeftOffset;
newRect.origin.y += QMacStylePrivate::PushButtonTopOffset;
@@ -3967,7 +3997,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
[pdb highlight:(bdi.state == kThemeStatePressed)];
pdb.enabled = bdi.state != kThemeStateUnavailable && bdi.state != kThemeStateUnavailableInactive;
QRect rect = opt->rect;
- rect.adjust(0, 0, cw.second == QAquaSizeSmall ? -4 : cw.second == QAquaSizeMini ? -9 : -6, 0);
+ rect.adjust(0, 0, cw.second == QStyleHelper::SizeSmall ? -4 : cw.second == QStyleHelper::SizeMini ? -9 : -6, 0);
d->drawNSViewInRect(cw, pdb, rect, p, w != 0);
} else if (hasMenu && bdi.state == kThemeStatePressed)
d->drawColorlessButton(newRect, &bdi, p, opt);
@@ -4020,7 +4050,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QRect ar = QRect(ir.right() - mbi - QMacStylePrivate::PushButtonRightOffset,
ir.height() / 2 - arrowYOffset, mbi, ir.height() / 2);
ar = visualRect(btn->direction, ir, ar);
- HIRect arrowRect = CGRectMake(ar.x() + arrowXOffset, ar.y(), ar.width(), ar.height());
+ CGRect arrowRect = CGRectMake(ar.x() + arrowXOffset, ar.y(), ar.width(), ar.height());
HIThemePopupArrowDrawInfo pdi;
pdi.version = qt_mac_hitheme_version;
@@ -4041,9 +4071,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// windows style if it has an icon and text, then it should be more like a
// tab. So, cheat a little here. However, if it *is* only an icon
// the windows style works great, so just use that implementation.
- bool hasMenu = btn.features & QStyleOptionButton::HasMenu;
- bool hasIcon = !btn.icon.isNull();
- bool hasText = !btn.text.isEmpty();
+ const bool hasMenu = btn.features & QStyleOptionButton::HasMenu;
+ const bool hasIcon = !btn.icon.isNull();
+ const bool hasText = !btn.text.isEmpty();
if (!hasMenu) {
if (tds == kThemeStatePressed
@@ -4053,94 +4083,45 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
btn.palette.setColor(QPalette::ButtonText, Qt::white);
}
- if (!hasIcon && !hasMenu) {
- // ### this is really overly difficult, simplify.
- // It basically tries to get the right font for "small" and "mini" icons.
- QFont oldFont = p->font();
- QFont newFont = qt_app_fonts_hash()->value("QPushButton", QFont());
- ThemeFontID themeId = kThemePushButtonFont;
- if (oldFont == newFont) { // Yes, use HITheme to draw the text for small sizes.
- switch (d->aquaSizeConstrain(opt, w)) {
- default:
- break;
- case QAquaSizeSmall:
- themeId = kThemeSmallSystemFont;
- break;
- case QAquaSizeMini:
- themeId = kThemeMiniSystemFont;
- break;
- }
+ if ((!hasIcon && !hasMenu) || (hasIcon && !hasText)) {
+ QCommonStyle::drawControl(ce, &btn, p, w);
+ } else {
+ QRect freeContentRect = btn.rect;
+ QRect textRect = itemTextRect(
+ btn.fontMetrics, freeContentRect, Qt::AlignCenter, btn.state & State_Enabled, btn.text);
+ if (hasMenu) {
+ textRect.moveTo(w ? 15 : 11, textRect.top()); // Supports Qt Quick Controls
}
-
- if (themeId == kThemePushButtonFont) {
- QCommonStyle::drawControl(ce, &btn, p, w);
- } else {
- p->save();
- CGContextSetShouldAntialias(cg, true);
- CGContextSetShouldSmoothFonts(cg, true);
- HIThemeTextInfo tti;
- tti.version = qt_mac_hitheme_version;
- tti.state = tds;
- QColor textColor;
- textColor = btn.palette.buttonText().color();
- CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
- static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
- CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
- CGContextSetFillColor(cg, colorComp);
- tti.fontID = themeId;
- tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
- tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
- tti.options = kHIThemeTextBoxOptionNone;
- tti.truncationPosition = kHIThemeTextTruncationNone;
- tti.truncationMaxLines = 1 + btn.text.count(QLatin1Char('\n'));
- QCFString buttonText = qt_mac_removeMnemonics(btn.text);
- QRect r = btn.rect;
- HIRect bounds = qt_hirectForQRect(r);
- HIThemeDrawTextBox(buttonText, &bounds, &tti,
- cg, kHIThemeOrientationNormal);
- p->restore();
+ // Draw the icon:
+ if (hasIcon) {
+ int contentW = textRect.width();
+ if (hasMenu)
+ contentW += proxy()->pixelMetric(PM_MenuButtonIndicator) + 4;
+ QIcon::Mode mode = btn.state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
+ if (mode == QIcon::Normal && btn.state & State_HasFocus)
+ mode = QIcon::Active;
+ // Decide if the icon is should be on or off:
+ QIcon::State state = QIcon::Off;
+ if (btn.state & State_On)
+ state = QIcon::On;
+ QPixmap pixmap = btn.icon.pixmap(window, btn.iconSize, mode, state);
+ int pixmapWidth = pixmap.width() / pixmap.devicePixelRatio();
+ int pixmapHeight = pixmap.height() / pixmap.devicePixelRatio();
+ contentW += pixmapWidth + QMacStylePrivate::PushButtonContentPadding;
+ int iconLeftOffset = freeContentRect.x() + (freeContentRect.width() - contentW) / 2;
+ int iconTopOffset = freeContentRect.y() + (freeContentRect.height() - pixmapHeight) / 2;
+ QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmapWidth, pixmapHeight);
+ QRect visualIconDestRect = visualRect(btn.direction, freeContentRect, iconDestRect);
+ proxy()->drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap);
+ int newOffset = iconDestRect.x() + iconDestRect.width()
+ + QMacStylePrivate::PushButtonContentPadding - textRect.x();
+ textRect.adjust(newOffset, 0, newOffset, 0);
}
- } else {
- if (hasIcon && !hasText) {
- QCommonStyle::drawControl(ce, &btn, p, w);
- } else {
- QRect freeContentRect = btn.rect;
- QRect textRect = itemTextRect(
- btn.fontMetrics, freeContentRect, Qt::AlignCenter, btn.state & State_Enabled, btn.text);
- if (hasMenu) {
- textRect.moveTo(w ? 15 : 11, textRect.top()); // Supports Qt Quick Controls
- }
- // Draw the icon:
- if (hasIcon) {
- int contentW = textRect.width();
- if (hasMenu)
- contentW += proxy()->pixelMetric(PM_MenuButtonIndicator) + 4;
- QIcon::Mode mode = btn.state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
- if (mode == QIcon::Normal && btn.state & State_HasFocus)
- mode = QIcon::Active;
- // Decide if the icon is should be on or off:
- QIcon::State state = QIcon::Off;
- if (btn.state & State_On)
- state = QIcon::On;
- QPixmap pixmap = btn.icon.pixmap(window, btn.iconSize, mode, state);
- int pixmapWidth = pixmap.width() / pixmap.devicePixelRatio();
- int pixmapHeight = pixmap.height() / pixmap.devicePixelRatio();
- contentW += pixmapWidth + QMacStylePrivate::PushButtonContentPadding;
- int iconLeftOffset = freeContentRect.x() + (freeContentRect.width() - contentW) / 2;
- int iconTopOffset = freeContentRect.y() + (freeContentRect.height() - pixmapHeight) / 2;
- QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmapWidth, pixmapHeight);
- QRect visualIconDestRect = visualRect(btn.direction, freeContentRect, iconDestRect);
- proxy()->drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap);
- int newOffset = iconDestRect.x() + iconDestRect.width()
- + QMacStylePrivate::PushButtonContentPadding - textRect.x();
- textRect.adjust(newOffset, 0, newOffset, 0);
- }
- // Draw the text:
- if (hasText) {
- textRect = visualRect(btn.direction, freeContentRect, textRect);
- proxy()->drawItemText(p, textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, btn.palette,
- (btn.state & State_Enabled), btn.text, QPalette::ButtonText);
- }
+ // Draw the text:
+ if (hasText) {
+ textRect = visualRect(btn.direction, freeContentRect, textRect);
+ proxy()->drawItemText(p, textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, btn.palette,
+ (btn.state & State_Enabled), btn.text, QPalette::ButtonText);
}
}
}
@@ -4176,15 +4157,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tdi.style = kThemeTabNonFront;
tdi.direction = getTabDirection(tabOpt->shape);
switch (d->aquaSizeConstrain(opt, w)) {
- default:
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
tdi.size = kHIThemeTabSizeNormal;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
tdi.size = kHIThemeTabSizeSmall;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
tdi.size = kHIThemeTabSizeMini;
break;
}
@@ -4256,85 +4236,49 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
// HITheme doesn't stretch its tabs. Therefore we have to cheat and do the job ourselves.
if (stretchTabs) {
- HIRect hirect = CGRectMake(0, 0, 23, 23);
+ CGRect cgRect = CGRectMake(0, 0, 23, 23);
QPixmap pm(23, 23);
pm.fill(Qt::transparent);
{
QMacCGContext pmcg(&pm);
- HIThemeDrawTab(&hirect, &tdi, pmcg, kHIThemeOrientationNormal, 0);
+ HIThemeDrawTab(&cgRect, &tdi, pmcg, kHIThemeOrientationNormal, 0);
}
QStyleHelper::drawBorderPixmap(pm, p, tabRect, 7, 7, 7, 7);
} else {
- HIRect hirect = qt_hirectForQRect(tabRect);
- HIThemeDrawTab(&hirect, &tdi, cg, kHIThemeOrientationNormal, 0);
+ CGRect cgRect = tabRect.toCGRect();
+ HIThemeDrawTab(&cgRect, &tdi, cg, kHIThemeOrientationNormal, 0);
}
}
break;
case CE_TabBarTabLabel:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
QStyleOptionTab myTab = *tab;
- ThemeTabDirection ttd = getTabDirection(myTab.shape);
- bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
+ const bool verticalTabs = tab->shape == QTabBar::RoundedWest
+ || tab->shape == QTabBar::RoundedEast
+ || tab->shape == QTabBar::TriangularWest
+ || tab->shape == QTabBar::TriangularEast;
// Check to see if we use have the same as the system font
// (QComboMenuItem is internal and should never be seen by the
// outside world, unless they read the source, in which case, it's
// their own fault).
- bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
+ const bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
if (!myTab.documentMode && (myTab.state & State_Selected) && (myTab.state & State_Active))
if (const auto *tabBar = qobject_cast<const QTabBar *>(w))
if (!tabBar->tabTextColor(tabBar->currentIndex()).isValid())
myTab.palette.setColor(QPalette::WindowText, Qt::white);
- if (verticalTabs || nonDefaultFont || !tab->icon.isNull()
- || !myTab.leftButtonSize.isEmpty() || !myTab.rightButtonSize.isEmpty()) {
- int heightOffset = 0;
- if (verticalTabs) {
- heightOffset = -1;
- } else if (nonDefaultFont) {
- if (p->fontMetrics().height() == myTab.rect.height())
- heightOffset = 2;
- }
- myTab.rect.setHeight(myTab.rect.height() + heightOffset);
-
- QCommonStyle::drawControl(ce, &myTab, p, w);
- } else {
- p->save();
- CGContextSetShouldAntialias(cg, true);
- CGContextSetShouldSmoothFonts(cg, true);
- HIThemeTextInfo tti;
- tti.version = qt_mac_hitheme_version;
- tti.state = tds;
- QColor textColor = myTab.palette.windowText().color();
- CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
- static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
- CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
- CGContextSetFillColor(cg, colorComp);
- switch (d->aquaSizeConstrain(opt, w)) {
- default:
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- tti.fontID = kThemeSystemFont;
- break;
- case QAquaSizeSmall:
- tti.fontID = kThemeSmallSystemFont;
- break;
- case QAquaSizeMini:
- tti.fontID = kThemeMiniSystemFont;
- break;
- }
- tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
- tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
- tti.options = verticalTabs ? kHIThemeTextBoxOptionStronglyVertical : kHIThemeTextBoxOptionNone;
- tti.truncationPosition = kHIThemeTextTruncationNone;
- tti.truncationMaxLines = 1 + myTab.text.count(QLatin1Char('\n'));
- QCFString tabText = qt_mac_removeMnemonics(myTab.text);
- QRect r = myTab.rect.adjusted(0, 0, 0, -1);
- HIRect bounds = qt_hirectForQRect(r);
- HIThemeDrawTextBox(tabText, &bounds, &tti, cg, kHIThemeOrientationNormal);
- p->restore();
+ int heightOffset = 0;
+ if (verticalTabs) {
+ heightOffset = -1;
+ } else if (nonDefaultFont) {
+ if (p->fontMetrics().height() == myTab.rect.height())
+ heightOffset = 2;
}
+ myTab.rect.setHeight(myTab.rect.height() + heightOffset);
+
+ QCommonStyle::drawControl(ce, &myTab, p, w);
}
break;
#endif
@@ -4352,15 +4296,15 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
wdi.titleWidth = opt->rect.width();
wdi.attributes = 0;
- HIRect titleBarRect;
- HIRect tmpRect = qt_hirectForQRect(opt->rect);
+ CGRect titleBarRect;
+ CGRect tmpRect = opt->rect.toCGRect();
{
QCFType<HIShapeRef> titleRegion;
QRect newr = opt->rect.adjusted(0, 0, 2, 0);
HIThemeGetWindowShape(&tmpRect, &wdi, kWindowTitleBarRgn, &titleRegion);
- ptrHIShapeGetBounds(titleRegion, &tmpRect);
+ HIShapeGetBounds(titleRegion, &tmpRect);
newr.translate(newr.x() - int(tmpRect.origin.x), newr.y() - int(tmpRect.origin.y));
- titleBarRect = qt_hirectForQRect(newr);
+ titleBarRect = newr.toCGRect();
}
QMacCGContext cg(p);
HIThemeDrawWindowFrame(&titleBarRect, &wdi, cg, kHIThemeOrientationNormal, 0);
@@ -4421,53 +4365,65 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
d->drawFocusRing(p, opt->rect, hMargin, vMargin);
break; }
case CE_MenuItem:
+ case CE_MenuHMargin:
+ case CE_MenuVMargin:
case CE_MenuEmptyArea:
+ case CE_MenuTearoff:
+ case CE_MenuScroller:
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
- p->fillRect(mi->rect, opt->palette.background());
- QAquaWidgetSize widgetSize = d->aquaSizeConstrain(opt, w);
- int tabwidth = mi->tabWidth;
- int maxpmw = mi->maxIconWidth;
- bool active = mi->state & State_Selected;
- bool enabled = mi->state & State_Enabled;
- HIRect menuRect = qt_hirectForQRect(mi->menuRect);
- HIRect itemRect = qt_hirectForQRect(mi->rect);
- HIThemeMenuItemDrawInfo mdi;
- mdi.version = qt_mac_hitheme_version;
- mdi.itemType = kThemeMenuItemPlain;
- if (!mi->icon.isNull())
- mdi.itemType |= kThemeMenuItemHasIcon;
- if (mi->menuItemType == QStyleOptionMenuItem::SubMenu)
- mdi.itemType |= kThemeMenuItemHierarchical | kThemeMenuItemHierBackground;
- else
- mdi.itemType |= kThemeMenuItemPopUpBackground;
- if (enabled)
- mdi.state = kThemeMenuActive;
- else
- mdi.state = kThemeMenuDisabled;
- if (active)
- mdi.state |= kThemeMenuSelected;
- QRect contentRect;
+ const bool active = mi->state & State_Selected;
+ const QBrush bg = active ? mi->palette.highlight() : mi->palette.background();
+ p->fillRect(mi->rect, bg);
+
+ const QStyleHelper::WidgetSizePolicy widgetSize = d->aquaSizeConstrain(opt, w);
+
+ if (ce == CE_MenuTearoff) {
+ p->setPen(QPen(mi->palette.dark().color(), 1, Qt::DashLine));
+ p->drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2 - 1,
+ mi->rect.x() + mi->rect.width() - 4,
+ mi->rect.y() + mi->rect.height() / 2 - 1);
+ p->setPen(QPen(mi->palette.light().color(), 1, Qt::DashLine));
+ p->drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2,
+ mi->rect.x() + mi->rect.width() - 4,
+ mi->rect.y() + mi->rect.height() / 2);
+ } else if (ce == CE_MenuScroller) {
+ const QSize scrollerSize = QSize(10, 8);
+ const int scrollerVOffset = 5;
+ const int left = mi->rect.x() + (mi->rect.width() - scrollerSize.width()) / 2;
+ const int right = left + scrollerSize.width();
+ int top;
+ int bottom;
+ if (opt->state & State_DownArrow) {
+ bottom = mi->rect.y() + scrollerVOffset;
+ top = bottom + scrollerSize.height();
+ } else {
+ bottom = mi->rect.bottom() - scrollerVOffset;
+ top = bottom - scrollerSize.height();
+ }
+ p->save();
+ p->setRenderHint(QPainter::Antialiasing);
+ QPainterPath path;
+ path.moveTo(left, bottom);
+ path.lineTo(right, bottom);
+ path.lineTo((left + right) / 2, top);
+ p->fillPath(path, opt->palette.buttonText());
+ p->restore();
+ } else if (ce != CE_MenuItem) {
+ break;
+ }
+
if (mi->menuItemType == QStyleOptionMenuItem::Separator) {
- // First arg should be &menurect, but wacky stuff happens then.
- HIThemeDrawMenuSeparator(&itemRect, &itemRect, &mdi,
- cg, kHIThemeOrientationNormal);
+ CGColorRef separatorColor = [NSColor quaternaryLabelColor].CGColor;
+ const QRect separatorRect = QRect(mi->rect.left(), mi->rect.center().y(), mi->rect.width(), 2);
+ p->fillRect(separatorRect, qt_mac_toQColor(separatorColor));
break;
- } else {
- HIRect cr;
- bool needAlpha = mi->palette.color(QPalette::Button) == Qt::transparent;
- if (needAlpha) {
- CGContextSaveGState(cg);
- CGContextSetAlpha(cg, 0.0);
- }
- HIThemeDrawMenuItem(&menuRect, &itemRect, &mdi,
- cg, kHIThemeOrientationNormal, &cr);
- if (needAlpha)
- CGContextRestoreGState(cg);
- if (ce == CE_MenuEmptyArea)
- break;
- contentRect = qt_qrectForHIRect(cr);
}
- int xpos = contentRect.x() + 18;
+
+ const int tabwidth = mi->tabWidth;
+ const int maxpmw = mi->maxIconWidth;
+ const bool enabled = mi->state & State_Enabled;
+
+ int xpos = mi->rect.x() + 18;
int checkcol = maxpmw;
if (!enabled)
p->setPen(mi->palette.text().color());
@@ -4481,16 +4437,16 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
checkmarkOpt.initFrom(w);
const int mw = checkcol + macItemFrame;
- const int mh = contentRect.height() + macItemFrame;
- const int xp = contentRect.x() + macItemFrame;
- checkmarkOpt.rect = QRect(xp, contentRect.y() - checkmarkOpt.fontMetrics.descent(), mw, mh);
+ const int mh = mi->rect.height() + macItemFrame;
+ const int xp = mi->rect.x() + macItemFrame;
+ checkmarkOpt.rect = QRect(xp, mi->rect.y() - checkmarkOpt.fontMetrics.descent(), mw, mh);
checkmarkOpt.state |= State_On; // Always on. Never rendered when off.
checkmarkOpt.state.setFlag(State_Selected, active);
checkmarkOpt.state.setFlag(State_Enabled, enabled);
- if (widgetSize == QAquaSizeMini)
+ if (widgetSize == QStyleHelper::SizeMini)
checkmarkOpt.state |= State_Mini;
- else if (widgetSize == QAquaSizeSmall)
+ else if (widgetSize == QStyleHelper::SizeSmall)
checkmarkOpt.state |= State_Small;
// We let drawPrimitive(PE_IndicatorMenuCheckMark) pick the right color
@@ -4513,7 +4469,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QPixmap pixmap = mi->icon.pixmap(window, iconSize, mode);
int pixw = pixmap.width() / pixmap.devicePixelRatio();
int pixh = pixmap.height() / pixmap.devicePixelRatio();
- QRect cr(xpos, contentRect.y(), checkcol, contentRect.height());
+ QRect cr(xpos, mi->rect.y(), checkcol, mi->rect.height());
QRect pmr(0, 0, pixw, pixh);
pmr.moveCenter(cr.center());
p->drawPixmap(pmr.topLeft(), pixmap);
@@ -4525,16 +4481,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
int t = s.indexOf(QLatin1Char('\t'));
int text_flags = Qt::AlignRight | Qt::AlignVCenter | Qt::TextHideMnemonic
| Qt::TextSingleLine | Qt::AlignAbsolute;
- int yPos = contentRect.y();
- if (widgetSize == QAquaSizeMini)
+ int yPos = mi->rect.y();
+ if (widgetSize == QStyleHelper::SizeMini)
yPos += 1;
p->save();
if (t >= 0) {
p->setFont(qt_app_fonts_hash()->value("QMenuItem", p->font()));
- int xp = contentRect.right() - tabwidth - macRightBorder
- - macItemHMargin - macItemFrame + 1;
- p->drawText(xp, yPos, tabwidth, contentRect.height(), text_flags,
- s.mid(t + 1));
+ int xp = mi->rect.right() - tabwidth - macRightBorder - macItemHMargin - macItemFrame + 1;
+ p->drawText(xp, yPos, tabwidth, mi->rect.height(), text_flags, s.mid(t + 1));
s = s.left(t);
}
@@ -4547,73 +4501,21 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// is very, very weak. This makes it stonger.
myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF());
p->setFont(myFont);
- p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1,
- contentRect.height(), text_flags ^ Qt::AlignRight, s);
+ p->drawText(xpos, yPos, mi->rect.width() - xm - tabwidth + 1,
+ mi->rect.height(), text_flags ^ Qt::AlignRight, s);
p->restore();
}
}
break;
- case CE_MenuHMargin:
- case CE_MenuVMargin:
- case CE_MenuTearoff:
- case CE_MenuScroller:
- if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
- p->fillRect(mi->rect, opt->palette.background());
-
- HIRect menuRect = qt_hirectForQRect(mi->menuRect);
- HIRect itemRect = qt_hirectForQRect(mi->rect);
- HIThemeMenuItemDrawInfo mdi;
- mdi.version = qt_mac_hitheme_version;
- if (!(opt->state & State_Enabled))
- mdi.state = kThemeMenuDisabled;
- else if (opt->state & State_Selected)
- mdi.state = kThemeMenuSelected;
- else
- mdi.state = kThemeMenuActive;
- if (ce == CE_MenuScroller) {
- if (opt->state & State_DownArrow)
- mdi.itemType = kThemeMenuItemScrollDownArrow;
- else
- mdi.itemType = kThemeMenuItemScrollUpArrow;
- } else {
- mdi.itemType = kThemeMenuItemPlain;
- }
- HIThemeDrawMenuItem(&menuRect, &itemRect, &mdi,
- cg,
- kHIThemeOrientationNormal, 0);
- if (ce == CE_MenuTearoff) {
- p->setPen(QPen(mi->palette.dark().color(), 1, Qt::DashLine));
- p->drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2 - 1,
- mi->rect.x() + mi->rect.width() - 4,
- mi->rect.y() + mi->rect.height() / 2 - 1);
- p->setPen(QPen(mi->palette.light().color(), 1, Qt::DashLine));
- p->drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2,
- mi->rect.x() + mi->rect.width() - 4,
- mi->rect.y() + mi->rect.height() / 2);
- }
- }
- break;
case CE_MenuBarItem:
+ case CE_MenuBarEmptyArea:
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
- HIRect menuRect = qt_hirectForQRect(mi->menuRect);
- HIRect itemRect = qt_hirectForQRect(mi->rect);
-
const bool selected = (opt->state & State_Selected) && (opt->state & State_Enabled) && (opt->state & State_Sunken);
- if (selected) {
- // Draw a selected menu item background:
- HIThemeMenuItemDrawInfo mdi;
- mdi.version = qt_mac_hitheme_version;
- mdi.state = kThemeMenuSelected;
- mdi.itemType = kThemeMenuItemPlain;
- HIThemeDrawMenuItem(&menuRect, &itemRect, &mdi, cg, kHIThemeOrientationNormal, 0);
- } else {
- // Draw the toolbar background:
- HIThemeMenuBarDrawInfo bdi;
- bdi.version = qt_mac_hitheme_version;
- bdi.state = kThemeMenuBarNormal;
- bdi.attributes = 0;
- HIThemeDrawMenuBarBackground(&menuRect, &bdi, cg, kHIThemeOrientationNormal);
- }
+ const QBrush bg = selected ? mi->palette.highlight() : mi->palette.background();
+ p->fillRect(mi->rect, bg);
+
+ if (ce != CE_MenuBarItem)
+ break;
if (!mi->icon.isNull()) {
int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
@@ -4631,77 +4533,68 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
}
break;
- case CE_MenuBarEmptyArea:
- if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
- HIThemeMenuBarDrawInfo bdi;
- bdi.version = qt_mac_hitheme_version;
- bdi.state = kThemeMenuBarNormal;
- bdi.attributes = 0;
- HIRect hirect = qt_hirectForQRect(mi->rect);
- HIThemeDrawMenuBarBackground(&hirect, &bdi, cg,
- kHIThemeOrientationNormal);
- break;
- }
+ case CE_ProgressBarLabel:
+ case CE_ProgressBarGroove:
+ // Do nothing. All done in CE_ProgressBarContents. Only keep these for proxy style overrides.
+ break;
case CE_ProgressBarContents:
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
- HIThemeTrackDrawInfo tdi;
- tdi.version = qt_mac_hitheme_version;
- tdi.reserved = 0;
- bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
+ QMacAutoReleasePool pool;
+ const bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
const bool vertical = pb->orientation == Qt::Vertical;
const bool inverted = pb->invertedAppearance;
bool reverse = (!vertical && (pb->direction == Qt::RightToLeft));
if (inverted)
reverse = !reverse;
- switch (d->aquaSizeConstrain(opt, w)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- tdi.kind = !isIndeterminate ? kThemeLargeProgressBar
- : kThemeLargeIndeterminateBar;
- break;
- case QAquaSizeMini:
- case QAquaSizeSmall:
- tdi.kind = !isIndeterminate ? kThemeProgressBar : kThemeIndeterminateBar;
- break;
- }
- tdi.bounds = qt_hirectForQRect(pb->rect);
- tdi.max = pb->maximum;
- tdi.min = pb->minimum;
- tdi.value = pb->progress;
- tdi.attributes = vertical ? 0 : kThemeTrackHorizontal;
+ QRect rect = pb->rect;
+ if (vertical)
+ rect = rect.transposed();
+ const CGRect cgRect = rect.toCGRect();
+
+ const auto aquaSize = d->effectiveAquaSizeConstrain(opt, w);
+ const QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject));
+ QIndeterminateProgressIndicator *ipi = nil;
+ if (isIndeterminate || animation)
+ ipi = static_cast<QIndeterminateProgressIndicator *>(d->cocoaControl({ QCocoaIndeterminateProgressIndicator, aquaSize }));
if (isIndeterminate) {
- if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
- tdi.trackInfo.progress.phase = animation->animationStep();
- else if (opt->styleObject)
- d->startAnimation(new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject));
+ // QIndeterminateProgressIndicator derives from NSProgressIndicator. We use a single
+ // instance that we start animating as soon as one of the progress bars is indeterminate.
+ // Since they will be in sync (as it's the case in Cocoa), we just need to draw it with
+ // the right geometry when the animation triggers an update. However, we can't hide it
+ // entirely between frames since that would stop the animation, so we just set its alpha
+ // value to 0. Same if we remove it from its superview. See QIndeterminateProgressIndicator
+ // implementation for details.
+ if (!animation && opt->styleObject) {
+ auto *animation = new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject);
+ // NSProgressIndicator is heavier to draw than the HITheme API, so we reduce the frame rate a couple notches.
+ animation->setFrameRate(QStyleAnimation::FifteenFps);
+ d->startAnimation(animation);
+ [ipi startAnimation];
+ }
+
+ d->setupNSGraphicsContext(cg, NO);
+ d->setupVerticalInvertedXform(cg, reverse, vertical, cgRect);
+ [ipi drawWithFrame:cgRect inView:d->backingStoreNSView];
+ d->restoreNSGraphicsContext(cg);
} else {
- d->stopAnimation(opt->styleObject);
- }
- if (!(pb->state & State_Active))
- tdi.enableState = kThemeTrackInactive;
- else if (!(pb->state & State_Enabled))
- tdi.enableState = kThemeTrackDisabled;
- else
- tdi.enableState = kThemeTrackActive;
- HIThemeOrientation drawOrientation = kHIThemeOrientationNormal;
- if (reverse) {
- if (vertical) {
- drawOrientation = kHIThemeOrientationInverted;
- } else {
- CGContextSaveGState(cg);
- CGContextTranslateCTM(cg, pb->rect.width(), 0);
- CGContextScaleCTM(cg, -1, 1);
+ if (animation) {
+ d->stopAnimation(opt->styleObject);
+ [ipi stopAnimation];
}
+
+ const QCocoaWidget cw = { QCocoaProgressIndicator, aquaSize };
+ auto *pi = static_cast<NSProgressIndicator *>(d->cocoaControl(cw));
+ d->drawNSViewInRect(cw, pi, rect, p, w != nullptr, ^(CGContextRef ctx, const CGRect &rect) {
+ d->setupVerticalInvertedXform(ctx, reverse, vertical, rect);
+ pi.minValue = pb->minimum;
+ pi.maxValue = pb->maximum;
+ pi.doubleValue = pb->progress;
+ [pi drawRect:rect];
+ });
}
- HIThemeDrawTrack(&tdi, 0, cg, drawOrientation);
- if (reverse && !vertical)
- CGContextRestoreGState(cg);
}
break;
- case CE_ProgressBarLabel:
- case CE_ProgressBarGroove:
- break;
case CE_SizeGrip: {
if (w && w->testAttribute(Qt::WA_MacOpaqueSizeGrip)) {
HIThemeGrowBoxDrawInfo gdi;
@@ -4710,22 +4603,20 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
gdi.kind = kHIThemeGrowBoxKindNormal;
gdi.direction = kThemeGrowRight | kThemeGrowDown;
gdi.size = kHIThemeGrowBoxSizeNormal;
- HIPoint pt = CGPointMake(opt->rect.x(), opt->rect.y());
+ CGPoint pt = CGPointMake(opt->rect.x(), opt->rect.y());
HIThemeDrawGrowBox(&pt, &gdi, cg, kHIThemeOrientationNormal);
} else {
// It isn't possible to draw a transparent size grip with the
// native API, so we do it ourselves here.
- const bool metal = qt_mac_is_metal(w);
- QPen lineColor = metal ? QColor(236, 236, 236) : QColor(82, 82, 82, 192);
- QPen metalHighlight = QColor(5, 5, 5, 192);
+ QPen lineColor = QColor(82, 82, 82, 192);
lineColor.setWidth(1);
p->save();
p->setRenderHint(QPainter::Antialiasing);
p->setPen(lineColor);
const Qt::LayoutDirection layoutDirection = w ? w->layoutDirection() : qApp->layoutDirection();
- const int NumLines = metal ? 4 : 3;
+ const int NumLines = 3;
for (int l = 0; l < NumLines; ++l) {
- const int offset = (l * 4 + (metal ? 2 : 3));
+ const int offset = (l * 4 + 3);
QPoint start, end;
if (layoutDirection == Qt::LeftToRight) {
start = QPoint(opt->rect.width() - offset, opt->rect.height() - 1);
@@ -4735,13 +4626,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
end = QPoint(1, opt->rect.height() - offset);
}
p->drawLine(start, end);
- if (metal) {
- p->setPen(metalHighlight);
- p->setRenderHint(QPainter::Antialiasing, false);
- p->drawLine(start + QPoint(0, -1), end + QPoint(0, -1));
- p->setRenderHint(QPainter::Antialiasing, true);
- p->setPen(lineColor);
- }
}
p->restore();
}
@@ -4753,8 +4637,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
sdi.version = qt_mac_hitheme_version;
sdi.state = tds;
sdi.adornment = kHIThemeSplitterAdornmentMetal;
- HIRect hirect = qt_hirectForQRect(opt->rect);
- HIThemeDrawPaneSplitter(&hirect, &sdi, cg, kHIThemeOrientationNormal);
+ CGRect cgRect = opt->rect.toCGRect();
+ HIThemeDrawPaneSplitter(&cgRect, &sdi, cg, kHIThemeOrientationNormal);
} else {
QPen oldPen = p->pen();
p->setPen(opt->palette.dark().color());
@@ -4819,7 +4703,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
bool isEndOfUnifiedArea = !isInMacUnifiedToolbarArea(w->window()->windowHandle(), windowToolbarEnd.y() + 1);
if (isEndOfUnifiedArea) {
SInt32 margin;
- GetThemeMetric(kThemeMetricSeparatorSize, &margin);
+ margin = qt_mac_aqua_get_metric(SeparatorSize);
CGRect separatorRect = CGRectMake(opt->rect.left(), opt->rect.bottom(), opt->rect.width(), margin);
HIThemeSeparatorDrawInfo separatorDrawInfo;
separatorDrawInfo.version = 0;
@@ -4882,7 +4766,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
{
Q_D(const QMacStyle);
QRect rect;
- int controlSize = getControlSize(opt, widget);
+ const int controlSize = getControlSize(opt, widget);
switch (sr) {
case SE_ItemViewItemText:
@@ -4904,8 +4788,8 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
// the focus 'shadow' will be inside. Adjust the content rect likewise.
HIThemeButtonDrawInfo bdi;
d->initHIThemePushButton(btn, widget, d->getDrawState(opt->state), &bdi);
- HIRect contentRect = d->pushButtonContentBounds(btn, &bdi);
- rect = qt_qrectForHIRect(contentRect);
+ CGRect contentRect = d->pushButtonContentBounds(btn, &bdi);
+ rect = QRectF::fromCGRect(contentRect).toRect();
}
break;
case SE_HeaderLabel: {
@@ -4934,7 +4818,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
rect = opt->rect;
break;
case SE_TreeViewDisclosureItem: {
- HIRect inRect = CGRectMake(opt->rect.x(), opt->rect.y(),
+ CGRect inRect = CGRectMake(opt->rect.x(), opt->rect.y(),
opt->rect.width(), opt->rect.height());
HIThemeButtonDrawInfo bdi;
bdi.version = qt_mac_hitheme_version;
@@ -4942,12 +4826,12 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
bdi.kind = kThemeDisclosureButton;
bdi.value = kThemeDisclosureRight;
bdi.adornment = kThemeAdornmentNone;
- HIRect contentRect;
+ CGRect contentRect;
HIThemeGetButtonContentBounds(&inRect, &bdi, &contentRect);
QCFType<HIShapeRef> shape;
- HIRect outRect;
+ CGRect outRect;
HIThemeGetButtonShape(&inRect, &bdi, &shape);
- ptrHIShapeGetBounds(shape, &outRect);
+ HIShapeGetBounds(shape, &outRect);
rect = QRect(int(outRect.origin.x + DisclosureOffset), int(outRect.origin.y),
int(contentRect.origin.x - outRect.origin.x + DisclosureOffset),
int(outRect.size.height));
@@ -5095,9 +4979,9 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break;
case SE_CheckBoxLayoutItem:
rect = opt->rect;
- if (controlSize == QAquaSizeLarge) {
+ if (controlSize == QStyleHelper::SizeLarge) {
setLayoutItemMargins(+2, +3, -9, -4, &rect, opt->direction);
- } else if (controlSize == QAquaSizeSmall) {
+ } else if (controlSize == QStyleHelper::SizeSmall) {
setLayoutItemMargins(+1, +5, 0 /* fix */, -6, &rect, opt->direction);
} else {
setLayoutItemMargins(0, +7, 0 /* fix */, -6, &rect, opt->direction);
@@ -5114,9 +4998,9 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
#endif
{
rect = opt->rect;
- if (controlSize == QAquaSizeLarge) {
+ if (controlSize == QStyleHelper::SizeLarge) {
rect.adjust(+3, +2, -3, -4);
- } else if (controlSize == QAquaSizeSmall) {
+ } else if (controlSize == QStyleHelper::SizeSmall) {
setLayoutItemMargins(+2, +1, -3, -4, &rect, opt->direction);
} else {
setLayoutItemMargins(+1, 0, -2, 0, &rect, opt->direction);
@@ -5144,9 +5028,9 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break; // leave rect alone
}
rect = opt->rect;
- if (controlSize == QAquaSizeLarge) {
+ if (controlSize == QStyleHelper::SizeLarge) {
rect.adjust(+6, +4, -6, -8);
- } else if (controlSize == QAquaSizeSmall) {
+ } else if (controlSize == QStyleHelper::SizeSmall) {
rect.adjust(+5, +4, -5, -6);
} else {
rect.adjust(+1, 0, -1, -2);
@@ -5154,10 +5038,10 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break;
case SE_RadioButtonLayoutItem:
rect = opt->rect;
- if (controlSize == QAquaSizeLarge) {
+ if (controlSize == QStyleHelper::SizeLarge) {
setLayoutItemMargins(+2, +2 /* SHOULD BE +3, done for alignment */,
0, -4 /* SHOULD BE -3, done for alignment */, &rect, opt->direction);
- } else if (controlSize == QAquaSizeSmall) {
+ } else if (controlSize == QStyleHelper::SizeSmall) {
rect.adjust(0, +6, 0 /* fix */, -5);
} else {
rect.adjust(0, +6, 0 /* fix */, -7);
@@ -5357,8 +5241,23 @@ static inline void drawToolbarButtonArrow(const QRect &toolButtonRect, ThemeDraw
padi.state = tds;
padi.orientation = kThemeArrowDown;
padi.size = kThemeArrow7pt;
- HIRect hirect = qt_hirectForQRect(arrowRect);
- HIThemeDrawPopupArrow(&hirect, &padi, cg, kHIThemeOrientationNormal);
+ CGRect cgRect = arrowRect.toCGRect();
+ HIThemeDrawPopupArrow(&cgRect, &padi, cg, kHIThemeOrientationNormal);
+}
+
+void QMacStylePrivate::setupNSGraphicsContext(CGContextRef cg, bool flipped) const
+{
+ CGContextSaveGState(cg);
+ [NSGraphicsContext saveGraphicsState];
+
+ [NSGraphicsContext setCurrentContext:
+ [NSGraphicsContext graphicsContextWithCGContext:cg flipped:flipped]];
+}
+
+void QMacStylePrivate::restoreNSGraphicsContext(CGContextRef cg) const
+{
+ [NSGraphicsContext restoreGraphicsState];
+ CGContextRestoreGState(cg);
}
void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
@@ -5371,389 +5270,328 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
QStyleHelper::styleObjectWindow(opt->styleObject);
const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (cc) {
- case CC_Slider:
case CC_ScrollBar:
- if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- HIThemeTrackDrawInfo tdi;
- d->getSliderInfo(cc, slider, &tdi, widget);
- if (slider->state & State_Sunken) {
- if (cc == CC_Slider) {
- if (slider->activeSubControls == SC_SliderHandle)
- tdi.trackInfo.slider.pressState = kThemeThumbPressed;
- else if (slider->activeSubControls == SC_SliderGroove)
- tdi.trackInfo.slider.pressState = kThemeLeftTrackPressed;
- } else {
- if (slider->activeSubControls == SC_ScrollBarSubLine
- || slider->activeSubControls == SC_ScrollBarAddLine) {
- // This test looks complex but it basically boils down
- // to the following: The "RTL look" on the mac also
- // changed the directions of the controls, that's not
- // what people expect (an arrow is an arrow), so we
- // kind of fake and say the opposite button is hit.
- // This works great, up until 10.4 which broke the
- // scroll bars, so I also have actually do something
- // similar when I have an upside down scroll bar
- // because on Tiger I only "fake" the reverse stuff.
- bool reverseHorizontal = (slider->direction == Qt::RightToLeft
- && slider->orientation == Qt::Horizontal);
-
- if ((reverseHorizontal
- && slider->activeSubControls == SC_ScrollBarAddLine)
- || (!reverseHorizontal
- && slider->activeSubControls == SC_ScrollBarSubLine)) {
- tdi.trackInfo.scrollbar.pressState = kThemeRightInsideArrowPressed
- | kThemeLeftOutsideArrowPressed;
- } else {
- tdi.trackInfo.scrollbar.pressState = kThemeLeftInsideArrowPressed
- | kThemeRightOutsideArrowPressed;
- }
- } else if (slider->activeSubControls == SC_ScrollBarAddPage) {
- tdi.trackInfo.scrollbar.pressState = kThemeRightTrackPressed;
- } else if (slider->activeSubControls == SC_ScrollBarSubPage) {
- tdi.trackInfo.scrollbar.pressState = kThemeLeftTrackPressed;
- } else if (slider->activeSubControls == SC_ScrollBarSlider) {
- tdi.trackInfo.scrollbar.pressState = kThemeThumbPressed;
- }
- }
- }
- HIRect macRect;
- bool tracking = slider->sliderPosition == slider->sliderValue;
- if (!tracking) {
- // Small optimization, the same as q->subControlRect
- QCFType<HIShapeRef> shape;
- HIThemeGetTrackThumbShape(&tdi, &shape);
- ptrHIShapeGetBounds(shape, &macRect);
- tdi.value = slider->sliderValue;
- }
+ if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- // Remove controls from the scroll bar if it is to short to draw them correctly.
- // This is done in two stages: first the thumb indicator is removed when it is
- // no longer possible to move it, second the up/down buttons are removed when
- // there is not enough space for them.
- if (cc == CC_ScrollBar) {
- if (opt && opt->styleObject && !QMacStylePrivate::scrollBars.contains(opt->styleObject))
- QMacStylePrivate::scrollBars.append(QPointer<QObject>(opt->styleObject));
- const int scrollBarLength = (slider->orientation == Qt::Horizontal)
- ? slider->rect.width() : slider->rect.height();
- const QMacStyle::WidgetSizePolicy sizePolicy = widgetSizePolicy(widget, opt);
- if (scrollBarLength < scrollButtonsCutoffSize(thumbIndicatorCutoff, sizePolicy))
- tdi.attributes &= ~kThemeTrackShowThumb;
- if (scrollBarLength < scrollButtonsCutoffSize(scrollButtonsCutoff, sizePolicy))
- tdi.enableState = kThemeTrackNothingToScroll;
- } else {
- if (!(slider->subControls & SC_SliderHandle))
- tdi.attributes &= ~kThemeTrackShowThumb;
- if (!(slider->subControls & SC_SliderGroove))
- tdi.attributes |= kThemeTrackHideTrack;
- }
+ const bool isHorizontal = sb->orientation == Qt::Horizontal;
- const bool isHorizontal = slider->orientation == Qt::Horizontal;
+ if (opt && opt->styleObject && !QMacStylePrivate::scrollBars.contains(opt->styleObject))
+ QMacStylePrivate::scrollBars.append(QPointer<QObject>(opt->styleObject));
- if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient, opt, widget)) {
- bool wasActive = false;
- CGFloat opacity = 0.0;
- CGFloat expandScale = 1.0;
- CGFloat expandOffset = -1.0;
- bool shouldExpand = false;
- const CGFloat maxExpandScale = tdi.kind == kThemeSmallScrollBar ? 11.0 / 7.0 : 13.0 / 9.0;
-
- if (QObject *styleObject = opt->styleObject) {
- int oldPos = styleObject->property("_q_stylepos").toInt();
- int oldMin = styleObject->property("_q_stylemin").toInt();
- int oldMax = styleObject->property("_q_stylemax").toInt();
- QRect oldRect = styleObject->property("_q_stylerect").toRect();
- QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
- uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
-
- // a scrollbar is transient when the scrollbar itself and
- // its sibling are both inactive (ie. not pressed/hovered/moved)
- bool transient = !opt->activeSubControls && !(slider->state & State_On);
-
- if (!transient ||
- oldPos != slider->sliderPosition ||
- oldMin != slider->minimum ||
- oldMax != slider->maximum ||
- oldRect != slider->rect ||
- oldState != slider->state ||
- oldActiveControls != slider->activeSubControls) {
-
- // if the scrollbar is transient or its attributes, geometry or
- // state has changed, the opacity is reset back to 100% opaque
- opacity = 1.0;
-
- styleObject->setProperty("_q_stylepos", slider->sliderPosition);
- styleObject->setProperty("_q_stylemin", slider->minimum);
- styleObject->setProperty("_q_stylemax", slider->maximum);
- styleObject->setProperty("_q_stylerect", slider->rect);
- styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(slider->state));
- styleObject->setProperty("_q_stylecontrols", static_cast<uint>(slider->activeSubControls));
-
- QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
- if (transient) {
- if (!anim) {
- anim = new QScrollbarStyleAnimation(QScrollbarStyleAnimation::Deactivating, styleObject);
- d->startAnimation(anim);
- } else if (anim->mode() == QScrollbarStyleAnimation::Deactivating) {
- // the scrollbar was already fading out while the
- // state changed -> restart the fade out animation
- anim->setCurrentTime(0);
- }
- } else if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
- d->stopAnimation(styleObject);
+ static const CGFloat knobWidths[] = { 7.0, 5.0, 5.0 };
+ static const CGFloat expandedKnobWidths[] = { 11.0, 9.0, 9.0 };
+ const auto cocoaSize = d->effectiveAquaSizeConstrain(opt, widget);
+ const CGFloat maxExpandScale = expandedKnobWidths[cocoaSize] / knobWidths[cocoaSize];
+
+ const bool isTransient = proxy()->styleHint(SH_ScrollBar_Transient, opt, widget);
+ if (!isTransient)
+ d->stopAnimation(opt->styleObject);
+ bool wasActive = false;
+ CGFloat opacity = 0.0;
+ CGFloat expandScale = 1.0;
+ CGFloat expandOffset = 0.0;
+ bool shouldExpand = false;
+
+ if (QObject *styleObject = opt->styleObject) {
+ const int oldPos = styleObject->property("_q_stylepos").toInt();
+ const int oldMin = styleObject->property("_q_stylemin").toInt();
+ const int oldMax = styleObject->property("_q_stylemax").toInt();
+ const QRect oldRect = styleObject->property("_q_stylerect").toRect();
+ const QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
+ const uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
+
+ // a scrollbar is transient when the scrollbar itself and
+ // its sibling are both inactive (ie. not pressed/hovered/moved)
+ const bool transient = isTransient && !opt->activeSubControls && !(sb->state & State_On);
+
+ if (!transient ||
+ oldPos != sb->sliderPosition ||
+ oldMin != sb->minimum ||
+ oldMax != sb->maximum ||
+ oldRect != sb->rect ||
+ oldState != sb->state ||
+ oldActiveControls != sb->activeSubControls) {
+
+ // if the scrollbar is transient or its attributes, geometry or
+ // state has changed, the opacity is reset back to 100% opaque
+ opacity = 1.0;
+
+ styleObject->setProperty("_q_stylepos", sb->sliderPosition);
+ styleObject->setProperty("_q_stylemin", sb->minimum);
+ styleObject->setProperty("_q_stylemax", sb->maximum);
+ styleObject->setProperty("_q_stylerect", sb->rect);
+ styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(sb->state));
+ styleObject->setProperty("_q_stylecontrols", static_cast<uint>(sb->activeSubControls));
+
+ QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
+ if (transient) {
+ if (!anim) {
+ anim = new QScrollbarStyleAnimation(QScrollbarStyleAnimation::Deactivating, styleObject);
+ d->startAnimation(anim);
+ } else if (anim->mode() == QScrollbarStyleAnimation::Deactivating) {
+ // the scrollbar was already fading out while the
+ // state changed -> restart the fade out animation
+ anim->setCurrentTime(0);
}
+ } else if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
+ d->stopAnimation(styleObject);
}
+ }
- QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
- if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
- // once a scrollbar was active (hovered/pressed), it retains
- // the active look even if it's no longer active while fading out
- if (oldActiveControls)
- anim->setActive(true);
+ QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
+ if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
+ // once a scrollbar was active (hovered/pressed), it retains
+ // the active look even if it's no longer active while fading out
+ if (oldActiveControls)
+ anim->setActive(true);
- wasActive = anim->wasActive();
- opacity = anim->currentValue();
- }
+ wasActive = anim->wasActive();
+ opacity = anim->currentValue();
+ }
- shouldExpand = (opt->activeSubControls || wasActive);
- if (shouldExpand) {
- if (!anim && !oldActiveControls) {
- // Start expand animation only once and when entering
- anim = new QScrollbarStyleAnimation(QScrollbarStyleAnimation::Activating, styleObject);
- d->startAnimation(anim);
- }
- if (anim && anim->mode() == QScrollbarStyleAnimation::Activating) {
- expandScale = 1.0 + (maxExpandScale - 1.0) * anim->currentValue();
- expandOffset = 5.5 * anim->currentValue() - 1;
- } else {
- // Keep expanded state after the animation ends, and when fading out
- expandScale = maxExpandScale;
- expandOffset = 4.5;
- }
+ shouldExpand = isTransient && (opt->activeSubControls || wasActive);
+ if (shouldExpand) {
+ if (!anim && !oldActiveControls) {
+ // Start expand animation only once and when entering
+ anim = new QScrollbarStyleAnimation(QScrollbarStyleAnimation::Activating, styleObject);
+ d->startAnimation(anim);
+ }
+ if (anim && anim->mode() == QScrollbarStyleAnimation::Activating) {
+ expandScale = 1.0 + (maxExpandScale - 1.0) * anim->currentValue();
+ expandOffset = 5.5 * (1.0 - anim->currentValue());
+ } else {
+ // Keep expanded state after the animation ends, and when fading out
+ expandScale = maxExpandScale;
+ expandOffset = 0.0;
}
}
+ }
+
+ d->setupNSGraphicsContext(cg, NO /* flipped */);
- CGContextSaveGState(cg);
- [NSGraphicsContext saveGraphicsState];
+ const QCocoaWidget cw(isHorizontal ? QCocoaHorizontalScroller : QCocoaVerticalScroller, cocoaSize);
+ NSScroller *scroller = static_cast<NSScroller *>(d->cocoaControl(cw));
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
- graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]];
- NSScroller *scroller = isHorizontal ? d->horizontalScroller : d-> verticalScroller;
- // mac os behaviour: as soon as one color channel is >= 128,
- // the bg is considered bright, scroller is dark
+ if (isTransient) {
+ // macOS behavior: as soon as one color channel is >= 128,
+ // the background is considered bright, scroller is dark.
const QColor bgColor = QStyleHelper::backgroundColor(opt->palette, widget);
- const bool isDarkBg = bgColor.red() < 128 && bgColor.green() < 128 &&
- bgColor.blue() < 128;
- if (isDarkBg)
- [scroller setKnobStyle:NSScrollerKnobStyleLight];
- else
- [scroller setKnobStyle:NSScrollerKnobStyleDefault];
+ const bool hasDarkBg = bgColor.red() < 128 && bgColor.green() < 128 && bgColor.blue() < 128;
+ scroller.knobStyle = hasDarkBg? NSScrollerKnobStyleLight : NSScrollerKnobStyleDark;
+ } else {
+ scroller.knobStyle = NSScrollerKnobStyleDefault;
+ }
- [scroller setControlSize:(tdi.kind == kThemeSmallScrollBar ? NSMiniControlSize
- : NSRegularControlSize)];
- [scroller setBounds:NSMakeRect(0, 0, slider->rect.width(), slider->rect.height())];
- [scroller setScrollerStyle:NSScrollerStyleOverlay];
+ scroller.scrollerStyle = isTransient ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
+ if (!setupScroller(scroller, sb))
+ break;
+
+ if (isTransient) {
CGContextBeginTransparencyLayer(cg, NULL);
CGContextSetAlpha(cg, opacity);
+ }
- // Draw the track when hovering
- if (opt->activeSubControls || wasActive) {
- NSRect rect = [scroller bounds];
- if (shouldExpand) {
- if (isHorizontal)
- rect.origin.y += 4.5 - expandOffset;
- else
- rect.origin.x += 4.5 - expandOffset;
- }
- [scroller drawKnobSlotInRect:rect highlight:YES];
- }
-
- const qreal length = slider->maximum - slider->minimum + slider->pageStep;
- const qreal proportion = slider->pageStep / length;
- qreal value = (slider->sliderValue - slider->minimum) / length;
- if (isHorizontal && slider->direction == Qt::RightToLeft)
- value = 1.0 - value - proportion;
-
- [scroller setKnobProportion:1.0];
-
- const int minKnobWidth = 26;
+ // Draw the track when hovering. Expand by shifting the track rect.
+ if (!isTransient || opt->activeSubControls || wasActive) {
+ CGRect trackRect = scroller.bounds;
+ if (isHorizontal)
+ trackRect.origin.y += expandOffset;
+ else
+ trackRect.origin.x += expandOffset;
+ [scroller drawKnobSlotInRect:trackRect highlight:NO];
+ }
- if (isHorizontal) {
- const qreal plannedWidth = proportion * slider->rect.width();
- const qreal width = qMax<qreal>(minKnobWidth, plannedWidth);
- const qreal totalWidth = slider->rect.width() + plannedWidth - width;
- [scroller setFrame:NSMakeRect(0, 0, width, slider->rect.height())];
- if (shouldExpand) {
- CGContextScaleCTM(cg, 1, expandScale);
- CGContextTranslateCTM(cg, value * totalWidth, -expandOffset);
- } else {
- CGContextTranslateCTM(cg, value * totalWidth, 1);
- }
- } else {
- const qreal plannedHeight = proportion * slider->rect.height();
- const qreal height = qMax<qreal>(minKnobWidth, plannedHeight);
- const qreal totalHeight = slider->rect.height() + plannedHeight - height;
- [scroller setFrame:NSMakeRect(0, 0, slider->rect.width(), height)];
- if (shouldExpand) {
- CGContextScaleCTM(cg, expandScale, 1);
- CGContextTranslateCTM(cg, -expandOffset, value * totalHeight);
- } else {
- CGContextTranslateCTM(cg, 1, value * totalHeight);
- }
- }
- if (length > 0.0) {
- [scroller layout];
+ if (shouldExpand) {
+ // -[NSScroller drawKnob] is not useful here because any scaling applied
+ // will only be used to draw the hi-DPI artwork. And even if did scale,
+ // the stretched knob would look wrong, actually. So we need to draw the
+ // scroller manually when it's being hovered.
+ const CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:scroller.controlSize scrollerStyle:scroller.scrollerStyle];
+ const CGFloat knobWidth = knobWidths[cocoaSize] * expandScale;
+ // Cocoa can help get the exact knob length in the current orientation
+ const CGRect scrollerKnobRect = CGRectInset([scroller rectForPart:NSScrollerKnob], 1, 1);
+ const CGFloat knobLength = isHorizontal ? scrollerKnobRect.size.width : scrollerKnobRect.size.height;
+ const CGFloat knobPos = isHorizontal ? scrollerKnobRect.origin.x : scrollerKnobRect.origin.y;
+ const CGFloat knobOffset = qRound((scrollerWidth + expandOffset - knobWidth) / 2.0);
+ const CGFloat knobRadius = knobWidth / 2.0;
+ CGRect knobRect;
+ if (isHorizontal)
+ knobRect = CGRectMake(knobPos, knobOffset, knobLength, knobWidth);
+ else
+ knobRect = CGRectMake(knobOffset, knobPos, knobWidth, knobLength);
+ QCFType<CGPathRef> knobPath = CGPathCreateWithRoundedRect(knobRect, knobRadius, knobRadius, nullptr);
+ CGContextAddPath(cg, knobPath);
+ CGContextSetAlpha(cg, 0.5);
+ CGContextSetFillColorWithColor(cg, NSColor.blackColor.CGColor);
+ CGContextFillPath(cg);
+ } else {
+ [scroller drawKnob];
+
+ if (!isTransient && opt->activeSubControls) {
+ // The knob should appear darker (going from 0.76 down to 0.49).
+ // But no blending mode can help darken enough in a single pass,
+ // so we resort to drawing the knob twice with a small help from
+ // blending. This brings the gray level to a close enough 0.53.
+ CGContextSetBlendMode(cg, kCGBlendModePlusDarker);
[scroller drawKnob];
}
+ }
+ if (isTransient)
CGContextEndTransparencyLayer(cg);
- [NSGraphicsContext restoreGraphicsState];
- CGContextRestoreGState(cg);
- } else {
- d->stopAnimation(opt->styleObject);
-
- if (cc == CC_Slider) {
- // Fix min and max positions. (See also getSliderInfo()
- // for the slider values adjustments.)
- // HITheme seems to have forgotten how to render
- // a slide at those positions, leaving a gap between
- // the knob and the ends of the track.
- // We fix this by rendering the track first, and then
- // the knob on top. However, in order to not clip the
- // knob, we reduce the the drawing rect for the track.
- HIRect bounds = tdi.bounds;
- if (isHorizontal) {
- tdi.bounds.size.width -= 2;
- tdi.bounds.origin.x += 1;
- if (tdi.trackInfo.slider.thumbDir == kThemeThumbDownward)
- tdi.bounds.origin.y -= 2;
- else if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward)
- tdi.bounds.origin.y += 3;
- } else {
- tdi.bounds.size.height -= 2;
- tdi.bounds.origin.y += 1;
- if (tdi.trackInfo.slider.thumbDir == kThemeThumbDownward) // pointing right
- tdi.bounds.origin.x -= 4;
- else if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward) // pointing left
- tdi.bounds.origin.x += 2;
- }
+ d->restoreNSGraphicsContext(cg);
+ }
+ break;
+ case CC_Slider:
+ if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+ const bool isHorizontal = slider->orientation == Qt::Horizontal;
- // Yosemite demands its blue progress track when no tickmarks are present
- if (!(slider->subControls & SC_SliderTickmarks)) {
- QCocoaWidgetKind sliderKind = slider->orientation == Qt::Horizontal ? QCocoaHorizontalSlider : QCocoaVerticalSlider;
- QCocoaWidget cw = QCocoaWidget(sliderKind, QAquaSizeLarge);
- NSSlider *sl = (NSSlider *)d->cocoaControl(cw);
- sl.minValue = slider->minimum;
- sl.maxValue = slider->maximum;
- sl.intValue = slider->sliderValue;
- sl.enabled = slider->state & QStyle::State_Enabled;
- d->drawNSViewInRect(cw, sl, opt->rect, p, widget != 0, ^(NSRect rect, CGContextRef ctx) {
- const bool isSierraOrLater = QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra;
- if (slider->upsideDown) {
- if (isHorizontal) {
- CGContextTranslateCTM(ctx, rect.size.width, 0);
- CGContextScaleCTM(ctx, -1, 1);
- }
- } else if (!isHorizontal && !isSierraOrLater) {
- CGContextTranslateCTM(ctx, 0, rect.size.height);
- CGContextScaleCTM(ctx, 1, -1);
- }
- const bool shouldFlip = isHorizontal || (slider->upsideDown && isSierraOrLater);
- [sl.cell drawBarInside:NSRectFromCGRect(tdi.bounds) flipped:shouldFlip];
- // No need to restore the CTM later, the context has been saved
- // and will be restored at the end of drawNSViewInRect()
- });
- tdi.attributes |= kThemeTrackHideTrack;
- } else {
- tdi.attributes &= ~(kThemeTrackShowThumb | kThemeTrackHasFocus);
- HIThemeDrawTrack(&tdi, tracking ? 0 : &macRect, cg,
- kHIThemeOrientationNormal);
- tdi.attributes |= kThemeTrackHideTrack | kThemeTrackShowThumb;
- }
- tdi.bounds = bounds;
+ HIThemeTrackDrawInfo tdi;
+ d->getSliderInfo(cc, slider, &tdi, widget);
+ if (slider->state & State_Sunken) {
+ if (cc == CC_Slider) {
+ if (slider->activeSubControls == SC_SliderHandle)
+ tdi.trackInfo.slider.pressState = kThemeThumbPressed;
+ else if (slider->activeSubControls == SC_SliderGroove)
+ tdi.trackInfo.slider.pressState = kThemeLeftTrackPressed;
}
+ }
+ CGRect macRect;
+ bool tracking = slider->sliderPosition == slider->sliderValue;
+ if (!tracking) {
+ // Small optimization, the same as q->subControlRect
+ QCFType<HIShapeRef> shape;
+ HIThemeGetTrackThumbShape(&tdi, &shape);
+ HIShapeGetBounds(shape, &macRect);
+ tdi.value = slider->sliderValue;
+ }
- if (cc == CC_Slider && slider->subControls & SC_SliderTickmarks) {
-
- HIRect bounds;
- // As part of fixing the min and max positions,
- // we need to adjust the tickmarks as well
- bounds = tdi.bounds;
- if (slider->orientation == Qt::Horizontal) {
- tdi.bounds.size.width += 2;
- tdi.bounds.origin.x -= 1;
- if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward)
- tdi.bounds.origin.y -= 2;
- } else {
- tdi.bounds.size.height += 3;
- tdi.bounds.origin.y -= 3;
- tdi.bounds.origin.y += 1;
- if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward) // pointing left
- tdi.bounds.origin.x -= 2;
- }
+ if (!(slider->subControls & SC_SliderHandle))
+ tdi.attributes &= ~kThemeTrackShowThumb;
+ if (!(slider->subControls & SC_SliderGroove))
+ tdi.attributes |= kThemeTrackHideTrack;
+
+ // Fix min and max positions. (See also getSliderInfo()
+ // for the slider values adjustments.)
+ // HITheme seems to have forgotten how to render
+ // a slide at those positions, leaving a gap between
+ // the knob and the ends of the track.
+ // We fix this by rendering the track first, and then
+ // the knob on top. However, in order to not clip the
+ // knob, we reduce the the drawing rect for the track.
+ CGRect bounds = tdi.bounds;
+ if (isHorizontal) {
+ tdi.bounds.size.width -= 2;
+ tdi.bounds.origin.x += 1;
+ if (tdi.trackInfo.slider.thumbDir == kThemeThumbDownward)
+ tdi.bounds.origin.y -= 2;
+ else if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward)
+ tdi.bounds.origin.y += 3;
+ } else {
+ tdi.bounds.size.height -= 2;
+ tdi.bounds.origin.y += 1;
+ if (tdi.trackInfo.slider.thumbDir == kThemeThumbDownward) // pointing right
+ tdi.bounds.origin.x -= 4;
+ else if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward) // pointing left
+ tdi.bounds.origin.x += 2;
+ }
- if (qt_mac_is_metal(widget)) {
- if (tdi.enableState == kThemeTrackInactive)
- tdi.enableState = kThemeTrackActive; // Looks more Cocoa-like
- }
- int interval = slider->tickInterval;
- if (interval == 0) {
- interval = slider->pageStep;
- if (interval == 0)
- interval = slider->singleStep;
- if (interval == 0)
- interval = 1;
- }
- int numMarks = 1 + ((slider->maximum - slider->minimum) / interval);
-
- if (tdi.trackInfo.slider.thumbDir == kThemeThumbPlain) {
- // They asked for both, so we'll give it to them.
- tdi.trackInfo.slider.thumbDir = kThemeThumbDownward;
- HIThemeDrawTrackTickMarks(&tdi, numMarks,
- cg,
- kHIThemeOrientationNormal);
- tdi.trackInfo.slider.thumbDir = kThemeThumbUpward;
- // 10.10 and above need a slight shift
- if (slider->orientation == Qt::Vertical)
- tdi.bounds.origin.x -= 2;
- HIThemeDrawTrackTickMarks(&tdi, numMarks,
- cg,
- kHIThemeOrientationNormal);
- // Reset to plain thumb to be drawn further down
- tdi.trackInfo.slider.thumbDir = kThemeThumbPlain;
- } else {
- HIThemeDrawTrackTickMarks(&tdi, numMarks,
- cg,
- kHIThemeOrientationNormal);
- }
+ // Yosemite demands its blue progress track when no tickmarks are present
+ if (!(slider->subControls & SC_SliderTickmarks)) {
+ QCocoaWidgetKind sliderKind = slider->orientation == Qt::Horizontal ? QCocoaHorizontalSlider : QCocoaVerticalSlider;
+ QCocoaWidget cw = QCocoaWidget(sliderKind, QStyleHelper::SizeLarge);
+ NSSlider *sl = (NSSlider *)d->cocoaControl(cw);
+ sl.minValue = slider->minimum;
+ sl.maxValue = slider->maximum;
+ sl.intValue = slider->sliderValue;
+ sl.enabled = slider->state & QStyle::State_Enabled;
+ d->drawNSViewInRect(cw, sl, opt->rect, p, widget != 0, ^(CGContextRef ctx, const CGRect &rect) {
+ const bool isSierraOrLater = QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra;
+ if (slider->upsideDown) {
+ if (isHorizontal) {
+ CGContextTranslateCTM(ctx, rect.size.width, 0);
+ CGContextScaleCTM(ctx, -1, 1);
+ }
+ } else if (!isHorizontal && !isSierraOrLater) {
+ CGContextTranslateCTM(ctx, 0, rect.size.height);
+ CGContextScaleCTM(ctx, 1, -1);
+ }
+ const bool shouldFlip = isHorizontal || (slider->upsideDown && isSierraOrLater);
+ [sl.cell drawBarInside:NSRectFromCGRect(tdi.bounds) flipped:shouldFlip];
+ // No need to restore the CTM later, the context has been saved
+ // and will be restored at the end of drawNSViewInRect()
+ });
+ tdi.attributes |= kThemeTrackHideTrack;
+
+ tdi.bounds = bounds;
+ }
- tdi.bounds = bounds;
+ if (slider->subControls & SC_SliderTickmarks) {
+
+ CGRect bounds;
+ // As part of fixing the min and max positions,
+ // we need to adjust the tickmarks as well
+ bounds = tdi.bounds;
+ if (slider->orientation == Qt::Horizontal) {
+ tdi.bounds.size.width += 2;
+ tdi.bounds.origin.x -= 1;
+ if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward)
+ tdi.bounds.origin.y -= 2;
+ } else {
+ tdi.bounds.size.height += 3;
+ tdi.bounds.origin.y -= 3;
+ tdi.bounds.origin.y += 1;
+ if (tdi.trackInfo.slider.thumbDir == kThemeThumbUpward) // pointing left
+ tdi.bounds.origin.x -= 2;
}
- if (cc == CC_Slider) {
- // Still as part of fixing the min and max positions,
- // we also adjust the knob position. We can do this
- // because it's rendered separately from the track.
- if (slider->orientation == Qt::Vertical) {
- if (tdi.trackInfo.slider.thumbDir == kThemeThumbDownward) // pointing right
- tdi.bounds.origin.x -= 2;
- }
+ int interval = slider->tickInterval;
+ if (interval == 0) {
+ interval = slider->pageStep;
+ if (interval == 0)
+ interval = slider->singleStep;
+ if (interval == 0)
+ interval = 1;
+ }
+ int numMarks = 1 + ((slider->maximum - slider->minimum) / interval);
+
+ if (tdi.trackInfo.slider.thumbDir == kThemeThumbPlain) {
+ // They asked for both, so we'll give it to them.
+ tdi.trackInfo.slider.thumbDir = kThemeThumbDownward;
+ HIThemeDrawTrackTickMarks(&tdi, numMarks,
+ cg,
+ kHIThemeOrientationNormal);
+ tdi.trackInfo.slider.thumbDir = kThemeThumbUpward;
+ // 10.10 and above need a slight shift
+ if (slider->orientation == Qt::Vertical)
+ tdi.bounds.origin.x -= 2;
+ HIThemeDrawTrackTickMarks(&tdi, numMarks,
+ cg,
+ kHIThemeOrientationNormal);
+ // Reset to plain thumb to be drawn further down
+ tdi.trackInfo.slider.thumbDir = kThemeThumbPlain;
+ } else {
+ HIThemeDrawTrackTickMarks(&tdi, numMarks,
+ cg,
+ kHIThemeOrientationNormal);
}
- HIThemeDrawTrack(&tdi, tracking ? 0 : &macRect, cg,
- kHIThemeOrientationNormal);
+ tdi.bounds = bounds;
}
+
+ HIThemeDrawTrack(&tdi, tracking ? 0 : &macRect, cg,
+ kHIThemeOrientationNormal);
}
break;
#ifndef QT_NO_SPINBOX
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
- QStyleOptionSpinBox newSB = *sb;
if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) {
SInt32 frame_size;
- GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
+ frame_size = qt_mac_aqua_get_metric(EditTextFrameOutset);
QRect lineeditRect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxEditField, widget);
lineeditRect.adjust(-frame_size, -frame_size, +frame_size, +frame_size);
@@ -5763,58 +5601,36 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
fdi.state = tds == kThemeStateInactive ? kThemeStateActive : tds;
fdi.kind = kHIThemeFrameTextFieldSquare;
fdi.isFocused = false;
- HIRect hirect = qt_hirectForQRect(lineeditRect);
- HIThemeDrawFrame(&hirect, &fdi, cg, kHIThemeOrientationNormal);
+ CGRect cgRect = lineeditRect.toCGRect();
+ HIThemeDrawFrame(&cgRect, &fdi, cg, kHIThemeOrientationNormal);
}
if (sb->subControls & (SC_SpinBoxUp | SC_SpinBoxDown)) {
- HIThemeButtonDrawInfo bdi;
- bdi.version = qt_mac_hitheme_version;
- QAquaWidgetSize aquaSize = d->aquaSizeConstrain(opt, widget);
- switch (aquaSize) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- bdi.kind = kThemeIncDecButton;
- break;
- case QAquaSizeMini:
- bdi.kind = kThemeIncDecButtonMini;
- break;
- case QAquaSizeSmall:
- bdi.kind = kThemeIncDecButtonSmall;
- break;
- }
- if (!(sb->stepEnabled & (QAbstractSpinBox::StepUpEnabled
- | QAbstractSpinBox::StepDownEnabled)))
- tds = kThemeStateUnavailable;
- if (sb->activeSubControls == SC_SpinBoxDown
- && (sb->state & State_Sunken))
- tds = kThemeStatePressedDown;
- else if (sb->activeSubControls == SC_SpinBoxUp
- && (sb->state & State_Sunken))
- tds = kThemeStatePressedUp;
- if (tds == kThemeStateInactive)
- bdi.state = kThemeStateActive;
- else
- bdi.state = tds;
- bdi.value = kThemeButtonOff;
- bdi.adornment = kThemeAdornmentNone;
-
- QRect updown = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget);
-
- updown |= proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget);
- HIRect newRect = qt_hirectForQRect(updown);
- QRect off_rct;
- HIRect outRect;
- HIThemeGetButtonBackgroundBounds(&newRect, &bdi, &outRect);
- off_rct.setRect(int(newRect.origin.x - outRect.origin.x),
- int(newRect.origin.y - outRect.origin.y),
- int(outRect.size.width - newRect.size.width),
- int(outRect.size.height - newRect.size.height));
-
- newRect = qt_hirectForQRect(updown, off_rct);
- if (tds == kThemeStateInactive)
- d->drawColorlessButton(newRect, &bdi, p, sb);
- else
- HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
+ const QRect updown = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget)
+ | proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget);
+
+ d->setupNSGraphicsContext(cg, NO);
+
+ const auto aquaSize = d->effectiveAquaSizeConstrain(opt, widget);
+ NSStepperCell *cell = static_cast<NSStepperCell *>(d->cocoaCell(QCocoaWidget(QCocoaStepper, aquaSize)));
+ cell.enabled = (sb->state & State_Enabled);
+
+ const CGRect newRect = [cell drawingRectForBounds:updown.toCGRect()];
+
+ const bool upPressed = sb->activeSubControls == SC_SpinBoxUp && (sb->state & State_Sunken);
+ const bool downPressed = sb->activeSubControls == SC_SpinBoxDown && (sb->state & State_Sunken);
+ const CGFloat x = CGRectGetMidX(newRect);
+ const CGFloat y = upPressed ? -3 : 3; // FIXME Weird coordinate shift going on
+ // Pretend we're pressing the mouse on the right button. Unfortunately, NSStepperCell has no
+ // API to highlight a specific button. The highlighted property works only on the down button.
+ if (upPressed || downPressed)
+ [cell startTrackingAt:CGPointMake(x, y) inView:d->backingStoreNSView];
+
+ [cell drawWithFrame:newRect inView:d->backingStoreNSView];
+
+ if (upPressed || downPressed)
+ [cell stopTracking:CGPointMake(x, y) at:CGPointMake(x, y) inView:d->backingStoreNSView mouseIsUp:NO];
+
+ d->restoreNSGraphicsContext(cg);
}
}
break;
@@ -5823,7 +5639,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)){
HIThemeButtonDrawInfo bdi;
d->initComboboxBdi(combo, &bdi, widget, tds);
- HIRect rect = qt_hirectForQRect(combo->rect);
+ CGRect rect = combo->rect.toCGRect();
if (combo->editable)
rect.origin.y += tds == kThemeStateInactive ? 1 : 2;
if (tds != kThemeStateInactive)
@@ -5861,15 +5677,15 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (widget && widget->isWindowModified() && titlebar->subControls & SC_TitleBarCloseButton)
wdi.attributes |= kThemeWindowHasCloseBox | kThemeWindowHasDirty;
- HIRect titleBarRect;
- HIRect tmpRect = qt_hirectForQRect(titlebar->rect);
+ CGRect titleBarRect;
+ CGRect tmpRect = titlebar->rect.toCGRect();
{
QCFType<HIShapeRef> titleRegion;
QRect newr = titlebar->rect.adjusted(0, 0, 2, 0);
HIThemeGetWindowShape(&tmpRect, &wdi, kWindowTitleBarRgn, &titleRegion);
- ptrHIShapeGetBounds(titleRegion, &tmpRect);
+ HIShapeGetBounds(titleRegion, &tmpRect);
newr.translate(newr.x() - int(tmpRect.origin.x), newr.y() - int(tmpRect.origin.y));
- titleBarRect = qt_hirectForQRect(newr);
+ titleBarRect = newr.toCGRect();
}
HIThemeDrawWindowFrame(&titleBarRect, &wdi, cg, kHIThemeOrientationNormal, 0);
if (titlebar->subControls & (SC_TitleBarCloseButton
@@ -5919,7 +5735,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
QCFType<HIShapeRef> titleRegion2;
HIThemeGetWindowShape(&titleBarRect, &wdi, kWindowTitleProxyIconRgn,
&titleRegion2);
- ptrHIShapeGetBounds(titleRegion2, &tmpRect);
+ HIShapeGetBounds(titleRegion2, &tmpRect);
if (tmpRect.size.width != 1) {
int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
iw = titlebar->icon.actualSize(QSize(iconExtent, iconExtent)).width();
@@ -5929,8 +5745,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
p->save();
QCFType<HIShapeRef> titleRegion3;
HIThemeGetWindowShape(&titleBarRect, &wdi, kWindowTitleTextRgn, &titleRegion3);
- ptrHIShapeGetBounds(titleRegion3, &tmpRect);
- p->setClipRect(qt_qrectForHIRect(tmpRect));
+ HIShapeGetBounds(titleRegion3, &tmpRect);
+ p->setClipRect(QRectF::fromCGRect(tmpRect).toRect());
QRect br = p->clipRegion().boundingRect();
int x = br.x(),
y = br.y() + (titlebar->rect.height() / 2 - p->fontMetrics().height() / 2);
@@ -5961,36 +5777,21 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
else
groupBox.subControls = groupBox.subControls & ~SC_GroupBoxFrame; // We don't like frames and ugly lines
- bool didModifySubControls = false;
- if ((!widget || !widget->testAttribute(Qt::WA_SetFont))
- && QApplication::desktopSettingsAware()) {
+ const bool didSetFont = widget && widget->testAttribute(Qt::WA_SetFont);
+ const bool didModifySubControls = !didSetFont && QApplication::desktopSettingsAware();
+ if (didModifySubControls)
groupBox.subControls = groupBox.subControls & ~SC_GroupBoxLabel;
- didModifySubControls = true;
- }
QCommonStyle::drawComplexControl(cc, &groupBox, p, widget);
if (didModifySubControls) {
- p->save();
- CGContextSetShouldAntialias(cg, true);
- CGContextSetShouldSmoothFonts(cg, true);
- HIThemeTextInfo tti;
- tti.version = qt_mac_hitheme_version;
- tti.state = tds;
- QColor textColor = groupBox.palette.windowText().color();
- CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
- static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
- CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
- CGContextSetFillColor(cg, colorComp);
- tti.fontID = flat ? kThemeSystemFont : kThemeSmallSystemFont;
- tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
- tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
- tti.options = kHIThemeTextBoxOptionNone;
- tti.truncationPosition = kHIThemeTextTruncationNone;
- tti.truncationMaxLines = 1 + groupBox.text.count(QLatin1Char('\n'));
- QCFString groupText = qt_mac_removeMnemonics(groupBox.text);
- QRect r = proxy()->subControlRect(CC_GroupBox, &groupBox, SC_GroupBoxLabel, widget);
- HIRect bounds = qt_hirectForQRect(r);
- HIThemeDrawTextBox(groupText, &bounds, &tti, cg, kHIThemeOrientationNormal);
- p->restore();
+ const QRect rect = proxy()->subControlRect(CC_GroupBox, &groupBox, SC_GroupBoxLabel, widget);
+ const bool rtl = groupBox.direction == Qt::RightToLeft;
+ const int alignment = Qt::TextHideMnemonic | (rtl ? Qt::AlignRight : Qt::AlignLeft);
+ const QFont savedFont = p->font();
+ if (!flat)
+ p->setFont(d->smallSystemFont);
+ proxy()->drawItemText(p, rect, alignment, groupBox.palette, groupBox.state & State_Enabled, groupBox.text, QPalette::WindowText);
+ if (!flat)
+ p->setFont(savedFont);
}
}
break;
@@ -6032,12 +5833,12 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
} else {
ThemeButtonKind bkind = kThemeBevelButton;
switch (d->aquaSizeConstrain(opt, widget)) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
bkind = kThemeBevelButton;
break;
- case QAquaSizeMini:
- case QAquaSizeSmall:
+ case QStyleHelper::SizeMini:
+ case QStyleHelper::SizeSmall:
bkind = kThemeSmallBevelButton;
break;
}
@@ -6067,17 +5868,16 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (tb->state & State_On)
bdi.value = kThemeButtonOn;
- QRect off_rct(0, 0, 0, 0);
- HIRect myRect, macRect;
+ CGRect myRect, macRect;
myRect = CGRectMake(tb->rect.x(), tb->rect.y(),
tb->rect.width(), tb->rect.height());
HIThemeGetButtonBackgroundBounds(&myRect, &bdi, &macRect);
- off_rct.setRect(int(myRect.origin.x - macRect.origin.x),
- int(myRect.origin.y - macRect.origin.y),
- int(macRect.size.width - myRect.size.width),
- int(macRect.size.height - myRect.size.height));
- myRect = qt_hirectForQRect(button, off_rct);
+ const auto offMargins = QMargins(int(myRect.origin.x - macRect.origin.x),
+ int(myRect.origin.y - macRect.origin.y),
+ int(macRect.size.width - myRect.size.width),
+ int(macRect.size.height - myRect.size.height));
+ myRect = button.marginsRemoved(offMargins).toCGRect();
HIThemeDrawButton(&myRect, &bdi, cg, kHIThemeOrientationNormal, 0);
}
}
@@ -6094,16 +5894,16 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (tb->state & (State_On | State_Sunken)
|| (tb->activeSubControls & SC_ToolButtonMenu))
bdi.state = kThemeStatePressed;
- HIRect hirect = qt_hirectForQRect(menuarea);
- HIThemeDrawButton(&hirect, &bdi, cg, kHIThemeOrientationNormal, 0);
+ CGRect cgRect = menuarea.toCGRect();
+ HIThemeDrawButton(&cgRect, &bdi, cg, kHIThemeOrientationNormal, 0);
QRect r(menuarea.x() + ((menuarea.width() / 2) - 3), menuarea.height() - 8, 8, 8);
HIThemePopupArrowDrawInfo padi;
padi.version = qt_mac_hitheme_version;
padi.state = tds;
padi.orientation = kThemeArrowDown;
padi.size = kThemeArrow7pt;
- hirect = qt_hirectForQRect(r);
- HIThemeDrawPopupArrow(&hirect, &padi, cg, kHIThemeOrientationNormal);
+ cgRect = r.toCGRect();
+ HIThemeDrawPopupArrow(&cgRect, &padi, cg, kHIThemeOrientationNormal);
} else if (tb->features & QStyleOptionToolButton::HasMenu) {
drawToolbarButtonArrow(tb->rect, tds, cg);
}
@@ -6147,7 +5947,7 @@ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc,
HIThemeTrackDrawInfo tdi;
d->getSliderInfo(cc, slider, &tdi, widget);
ControlPartCode part;
- HIPoint pos = CGPointMake(pt.x(), pt.y());
+ CGPoint pos = CGPointMake(pt.x(), pt.y());
if (HIThemeHitTestTrack(&tdi, &pos, &part)) {
if (part == kControlPageUpPart || part == kControlPageDownPart)
sc = SC_SliderGroove;
@@ -6158,50 +5958,39 @@ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc,
break;
case CC_ScrollBar:
if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- HIScrollBarTrackInfo sbi;
- sbi.version = qt_mac_hitheme_version;
- if (!(sb->state & State_Active))
- sbi.enableState = kThemeTrackInactive;
- else if (sb->state & State_Enabled)
- sbi.enableState = kThemeTrackActive;
- else
- sbi.enableState = kThemeTrackDisabled;
-
- // The arrow buttons are not drawn if the scroll bar is to short,
- // exclude them from the hit test.
- const int scrollBarLength = (sb->orientation == Qt::Horizontal)
- ? sb->rect.width() : sb->rect.height();
- if (scrollBarLength < scrollButtonsCutoffSize(scrollButtonsCutoff, widgetSizePolicy(widget, opt)))
- sbi.enableState = kThemeTrackNothingToScroll;
+ if (!sb->rect.contains(pt)) {
+ sc = SC_None;
+ break;
+ }
- sbi.viewsize = sb->pageStep;
- HIPoint pos = CGPointMake(pt.x(), pt.y());
+ const auto controlSize = d->effectiveAquaSizeConstrain(opt, widget);
+ const bool isHorizontal = sb->orientation == Qt::Horizontal;
+ const auto cw = QCocoaWidget(isHorizontal ? QCocoaHorizontalScroller : QCocoaVerticalScroller, controlSize);
+ auto *scroller = static_cast<NSScroller *>(d->cocoaControl(cw));
+ if (!setupScroller(scroller, sb)) {
+ sc = SC_None;
+ break;
+ }
- HIRect macSBRect = qt_hirectForQRect(sb->rect);
- ControlPartCode part;
- bool reverseHorizontal = (sb->direction == Qt::RightToLeft
- && sb->orientation == Qt::Horizontal);
- if (HIThemeHitTestScrollBarArrows(&macSBRect, &sbi, sb->orientation == Qt::Horizontal,
- &pos, 0, &part)) {
- if (part == kControlUpButtonPart)
- sc = reverseHorizontal ? SC_ScrollBarAddLine : SC_ScrollBarSubLine;
- else if (part == kControlDownButtonPart)
- sc = reverseHorizontal ? SC_ScrollBarSubLine : SC_ScrollBarAddLine;
+ // Since -[NSScroller testPart:] doesn't want to cooperate, we do it the
+ // straightforward way. In any case, macOS doesn't return line-sized changes
+ // with NSScroller since 10.7, according to the aforementioned method's doc.
+ const auto knobRect = QRectF::fromCGRect([scroller rectForPart:NSScrollerKnob]);
+ if (isHorizontal) {
+ const bool isReverse = sb->direction == Qt::RightToLeft;
+ if (pt.x() < knobRect.left())
+ sc = isReverse ? SC_ScrollBarAddPage : SC_ScrollBarSubPage;
+ else if (pt.x() > knobRect.right())
+ sc = isReverse ? SC_ScrollBarSubPage : SC_ScrollBarAddPage;
+ else
+ sc = SC_ScrollBarSlider;
} else {
- HIThemeTrackDrawInfo tdi;
- d->getSliderInfo(cc, sb, &tdi, widget);
- if(tdi.enableState == kThemeTrackInactive)
- tdi.enableState = kThemeTrackActive;
- if (HIThemeHitTestTrack(&tdi, &pos, &part)) {
- if (part == kControlPageUpPart)
- sc = reverseHorizontal ? SC_ScrollBarAddPage
- : SC_ScrollBarSubPage;
- else if (part == kControlPageDownPart)
- sc = reverseHorizontal ? SC_ScrollBarSubPage
- : SC_ScrollBarAddPage;
- else
- sc = SC_ScrollBarSlider;
- }
+ if (pt.y() < knobRect.top())
+ sc = SC_ScrollBarSubPage;
+ else if (pt.y() > knobRect.bottom())
+ sc = SC_ScrollBarAddPage;
+ else
+ sc = SC_ScrollBarSlider;
}
}
break;
@@ -6224,10 +6013,10 @@ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc,
wdi.attributes |= kThemeWindowHasCloseBox;
QRect tmpRect = tbar->rect;
tmpRect.setHeight(tmpRect.height() + 100);
- HIRect hirect = qt_hirectForQRect(tmpRect);
+ CGRect cgRect = tmpRect.toCGRect();
WindowRegionCode hit;
- HIPoint hipt = CGPointMake(pt.x(), pt.y());
- if (HIThemeGetWindowRegionHit(&hirect, &wdi, &hipt, &hit)) {
+ CGPoint hipt = CGPointMake(pt.x(), pt.y());
+ if (HIThemeGetWindowRegionHit(&cgRect, &wdi, &hipt, &hit)) {
switch (hit) {
case kWindowCloseBoxRgn:
sc = QStyle::SC_TitleBarCloseButton;
@@ -6262,41 +6051,48 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
Q_D(const QMacStyle);
QRect ret;
switch (cc) {
- case CC_Slider:
case CC_ScrollBar:
+ if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+ const bool isHorizontal = sb->orientation == Qt::Horizontal;
+ const bool isReverseHorizontal = isHorizontal && (sb->direction == Qt::RightToLeft);
+
+ NSScrollerPart part = NSScrollerNoPart;
+ if (sc == SC_ScrollBarSlider) {
+ part = NSScrollerKnob;
+ } else if (sc == SC_ScrollBarGroove) {
+ part = NSScrollerKnobSlot;
+ } else if (sc == SC_ScrollBarSubPage || sc == SC_ScrollBarAddPage) {
+ if ((!isReverseHorizontal && sc == SC_ScrollBarSubPage)
+ || (isReverseHorizontal && sc == SC_ScrollBarAddPage))
+ part = NSScrollerDecrementPage;
+ else
+ part = NSScrollerIncrementPage;
+ }
+ // And nothing else since 10.7
+
+ if (part != NSScrollerNoPart) {
+ const auto controlSize = d->effectiveAquaSizeConstrain(opt, widget);
+ const auto cw = QCocoaWidget(isHorizontal ? QCocoaHorizontalScroller : QCocoaVerticalScroller, controlSize);
+ auto *scroller = static_cast<NSScroller *>(d->cocoaControl(cw));
+ if (setupScroller(scroller, sb))
+ ret = QRectF::fromCGRect([scroller rectForPart:part]).toRect();
+ }
+ }
+ break;
+ case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
HIThemeTrackDrawInfo tdi;
d->getSliderInfo(cc, slider, &tdi, widget);
- HIRect macRect;
+ CGRect macRect;
QCFType<HIShapeRef> shape;
- bool scrollBar = cc == CC_ScrollBar;
- if ((scrollBar && sc == SC_ScrollBarSlider)
- || (!scrollBar && sc == SC_SliderHandle)) {
+ if (sc == SC_SliderHandle) {
HIThemeGetTrackThumbShape(&tdi, &shape);
- ptrHIShapeGetBounds(shape, &macRect);
- } else if (!scrollBar && sc == SC_SliderGroove) {
+ HIShapeGetBounds(shape, &macRect);
+ } else if (sc == SC_SliderGroove) {
HIThemeGetTrackBounds(&tdi, &macRect);
- } else if (sc == SC_ScrollBarGroove) { // Only scroll bar parts available...
- HIThemeGetTrackDragRect(&tdi, &macRect);
- } else {
- ControlPartCode cpc;
- if (sc == SC_ScrollBarSubPage || sc == SC_ScrollBarAddPage) {
- cpc = sc == SC_ScrollBarSubPage ? kControlPageDownPart
- : kControlPageUpPart;
- } else {
- cpc = sc == SC_ScrollBarSubLine ? kControlUpButtonPart
- : kControlDownButtonPart;
- if (slider->direction == Qt::RightToLeft
- && slider->orientation == Qt::Horizontal) {
- if (cpc == kControlDownButtonPart)
- cpc = kControlUpButtonPart;
- else if (cpc == kControlUpButtonPart)
- cpc = kControlDownButtonPart;
- }
- }
- HIThemeGetTrackPartBounds(&tdi, cpc, &macRect);
}
- ret = qt_qrectForHIRect(macRect);
+ // FIXME No SC_SliderTickmarks?
+ ret = QRectF::fromCGRect(macRect).toRect();
// Tweak: the dark line between the sub/add line buttons belong to only one of the buttons
// when doing hit-testing, but both of them have to repaint it. Extend the rect to cover
@@ -6345,16 +6141,16 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
if (wrc != kWindowGlobalPortRgn) {
QCFType<HIShapeRef> region;
QRect tmpRect = titlebar->rect;
- HIRect titleRect = qt_hirectForQRect(tmpRect);
+ CGRect titleRect = tmpRect.toCGRect();
HIThemeGetWindowShape(&titleRect, &wdi, kWindowTitleBarRgn, &region);
- ptrHIShapeGetBounds(region, &titleRect);
+ HIShapeGetBounds(region, &titleRect);
CFRelease(region);
tmpRect.translate(tmpRect.x() - int(titleRect.origin.x),
tmpRect.y() - int(titleRect.origin.y));
- titleRect = qt_hirectForQRect(tmpRect);
+ titleRect = tmpRect.toCGRect();
HIThemeGetWindowShape(&titleRect, &wdi, wrc, &region);
- ptrHIShapeGetBounds(region, &titleRect);
- ret = qt_qrectForHIRect(titleRect);
+ HIShapeGetBounds(region, &titleRect);
+ ret = QRectF::fromCGRect(titleRect).toRect();
}
}
break;
@@ -6376,7 +6172,7 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
break; }
case SC_ComboBoxListBoxPopup:{
if (combo->editable) {
- HIRect inner = QMacStylePrivate::comboboxInnerBounds(qt_hirectForQRect(combo->rect), bdi.kind);
+ const CGRect inner = QMacStylePrivate::comboboxInnerBounds(combo->rect.toCGRect(), bdi.kind);
QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi);
const int comboTop = combo->rect.top();
ret = QRect(qRound(inner.origin.x),
@@ -6405,35 +6201,16 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
case SC_GroupBoxLabel:
case SC_GroupBoxCheckBox: {
// Cheat and use the smaller font if we need to
- bool checkable = groupBox->subControls & SC_GroupBoxCheckBox;
- bool fontIsSet = (widget && widget->testAttribute(Qt::WA_SetFont))
- || !QApplication::desktopSettingsAware();
- int tw;
- int h;
- int margin = flat || hasNoText ? 0 : 9;
+ const bool checkable = groupBox->subControls & SC_GroupBoxCheckBox;
+ const bool fontIsSet = (widget && widget->testAttribute(Qt::WA_SetFont))
+ || !QApplication::desktopSettingsAware();
+ const int margin = flat || hasNoText ? 0 : 9;
ret = groupBox->rect.adjusted(margin, 0, -margin, 0);
- if (!fontIsSet) {
- HIThemeTextInfo tti;
- tti.version = qt_mac_hitheme_version;
- tti.state = kThemeStateActive;
- tti.fontID = flat ? kThemeSystemFont : kThemeSmallSystemFont;
- tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
- tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
- tti.options = kHIThemeTextBoxOptionNone;
- tti.truncationPosition = kHIThemeTextTruncationNone;
- tti.truncationMaxLines = 1 + groupBox->text.count(QLatin1Char('\n'));
- CGFloat width;
- CGFloat height;
- QCFString groupText = qt_mac_removeMnemonics(groupBox->text);
- HIThemeGetTextDimensions(groupText, 0, &tti, &width, &height, 0);
- tw = qRound(width);
- h = qCeil(height);
- } else {
- QFontMetricsF fm = QFontMetricsF(groupBox->fontMetrics);
- h = qCeil(fm.height());
- tw = qCeil(fm.size(Qt::TextShowMnemonic, groupBox->text).width());
- }
+ const QFontMetricsF fm = flat || fontIsSet ? QFontMetricsF(groupBox->fontMetrics) : QFontMetricsF(d->smallSystemFont);
+ const QSizeF s = fm.size(Qt::AlignHCenter | Qt::AlignVCenter, qt_mac_removeMnemonics(groupBox->text), 0, nullptr);
+ const int tw = qCeil(s.width());
+ const int h = qCeil(fm.height());
ret.setHeight(h);
QRect labelRect = alignedRect(groupBox->direction, groupBox->textAlignment,
@@ -6502,25 +6279,25 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
#ifndef QT_NO_SPINBOX
case CC_SpinBox:
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
- QAquaWidgetSize aquaSize = d->aquaSizeConstrain(spin, widget);
+ QStyleHelper::WidgetSizePolicy aquaSize = d->effectiveAquaSizeConstrain(spin, widget);
int spinner_w;
int spinBoxSep;
int fw = proxy()->pixelMetric(PM_SpinBoxFrameWidth, spin, widget);
switch (aquaSize) {
- default:
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeLarge:
spinner_w = 14;
spinBoxSep = 2;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
spinner_w = 12;
spinBoxSep = 2;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
spinner_w = 10;
spinBoxSep = 1;
break;
+ default:
+ Q_UNREACHABLE();
}
switch (sc) {
@@ -6532,34 +6309,25 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
const int y = fw;
const int x = spin->rect.width() - spinner_w;
ret.setRect(x + spin->rect.x(), y + spin->rect.y(), spinner_w, spin->rect.height() - y * 2);
- HIThemeButtonDrawInfo bdi;
- bdi.version = qt_mac_hitheme_version;
- bdi.kind = kThemeIncDecButton;
int hackTranslateX;
switch (aquaSize) {
- default:
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
- bdi.kind = kThemeIncDecButton;
+ case QStyleHelper::SizeLarge:
hackTranslateX = 0;
break;
- case QAquaSizeSmall:
- bdi.kind = kThemeIncDecButtonSmall;
+ case QStyleHelper::SizeSmall:
hackTranslateX = -2;
break;
- case QAquaSizeMini:
- bdi.kind = kThemeIncDecButtonMini;
+ case QStyleHelper::SizeMini:
hackTranslateX = -1;
break;
+ default:
+ Q_UNREACHABLE();
}
- bdi.state = kThemeStateActive;
- bdi.value = kThemeButtonOff;
- bdi.adornment = kThemeAdornmentNone;
- HIRect hirect = qt_hirectForQRect(ret);
- HIRect outRect;
- HIThemeGetButtonBackgroundBounds(&hirect, &bdi, &outRect);
- ret = qt_qrectForHIRect(outRect);
+ NSStepperCell *cell = static_cast<NSStepperCell *>(d->cocoaCell(QCocoaWidget(QCocoaStepper, aquaSize)));
+ const CGRect outRect = [cell drawingRectForBounds:ret.toCGRect()];
+ ret = QRectF::fromCGRect(outRect).toRect();
+
switch (sc) {
case SC_SpinBoxUp:
ret.setHeight(ret.height() / 2);
@@ -6683,7 +6451,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
#if QT_CONFIG(tabbar)
case QStyle::CT_TabBarTab:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- const QAquaWidgetSize AquaSize = d->aquaSizeConstrain(opt, widget);
+ const QStyleHelper::WidgetSizePolicy AquaSize = d->aquaSizeConstrain(opt, widget);
const bool differentFont = (widget && widget->testAttribute(Qt::WA_SetFont))
|| !QApplication::desktopSettingsAware();
ThemeTabDirection ttd = getTabDirection(tab->shape);
@@ -6694,17 +6462,17 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
int extraHSpace = proxy()->pixelMetric(PM_TabBarTabHSpace, tab, widget);
QFontMetrics fm = opt->fontMetrics;
switch (AquaSize) {
- case QAquaSizeUnknown:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
if (tab->documentMode)
defaultTabHeight = 24;
else
defaultTabHeight = 21;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
defaultTabHeight = 18;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
defaultTabHeight = 16;
break;
}
@@ -6770,9 +6538,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
h = sz.height();
if (mi->menuItemType == QStyleOptionMenuItem::Separator) {
w = 10;
- SInt16 ash;
- GetThemeMenuSeparatorHeight(&ash);
- h = ash;
+ h = qt_mac_aqua_get_metric(MenuSeparatorHeight);
} else {
h = mi->fontMetrics.height() + 2;
if (!mi->icon.isNull()) {
@@ -6850,7 +6616,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case CT_ScrollBar :
// Make sure that the scroll bar is large enough to display the thumb indicator.
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- const int minimumSize = scrollButtonsCutoffSize(thumbIndicatorCutoff, widgetSizePolicy(widget, opt));
+ const int minimumSize = 24; // Smallest knob size, but Cocoa doesn't seem to care
if (slider->orientation == Qt::Horizontal)
sz = sz.expandedTo(QSize(minimumSize, sz.height()));
else
@@ -6870,7 +6636,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
if (useAquaGuideline){
QSize macsz;
- if (d->aquaSizeConstrain(opt, widget, ct, sz, &macsz) != QAquaSizeUnknown) {
+ if (d->aquaSizeConstrain(opt, widget, ct, sz, &macsz) != QStyleHelper::SizeDefault) {
if (macsz.width() != -1)
sz.setWidth(macsz.width());
if (macsz.height() != -1)
@@ -6881,27 +6647,26 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
// The sizes that Carbon and the guidelines gives us excludes the focus frame.
// We compensate for this by adding some extra space here to make room for the frame when drawing:
if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)){
- QAquaWidgetSize widgetSize = d->aquaSizeConstrain(opt, widget);
+ const auto widgetSize = d->aquaSizeConstrain(opt, widget);
int bkind = 0;
switch (widgetSize) {
default:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeLarge:
bkind = combo->editable ? kThemeComboBox : kThemePopupButton;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
bkind = combo->editable ? int(kThemeComboBoxSmall) : int(kThemePopupButtonSmall);
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
bkind = combo->editable ? kThemeComboBoxMini : kThemePopupButtonMini;
break;
}
- HIRect tmpRect = {{0, 0}, {0, 0}};
- HIRect diffRect = QMacStylePrivate::comboboxInnerBounds(tmpRect, bkind);
+ const CGRect diffRect = QMacStylePrivate::comboboxInnerBounds(CGRectZero, bkind);
sz.rwidth() -= qRound(diffRect.size.width);
sz.rheight() -= qRound(diffRect.size.height);
} else if (ct == CT_PushButton || ct == CT_ToolButton){
ThemeButtonKind bkind;
- QAquaWidgetSize widgetSize = d->aquaSizeConstrain(opt, widget);
+ QStyleHelper::WidgetSizePolicy widgetSize = d->aquaSizeConstrain(opt, widget);
switch (ct) {
default:
case CT_PushButton:
@@ -6912,26 +6677,26 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
switch (widgetSize) {
- default:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
bkind = kThemePushButton;
break;
- case QAquaSizeSmall:
+ case QStyleHelper::SizeSmall:
bkind = kThemePushButtonSmall;
break;
- case QAquaSizeMini:
+ case QStyleHelper::SizeMini:
bkind = kThemePushButtonMini;
break;
}
break;
case CT_ToolButton:
switch (widgetSize) {
- default:
- case QAquaSizeLarge:
+ case QStyleHelper::SizeDefault:
+ case QStyleHelper::SizeLarge:
bkind = kThemeLargeBevelButton;
break;
- case QAquaSizeMini:
- case QAquaSizeSmall:
+ case QStyleHelper::SizeMini:
+ case QStyleHelper::SizeSmall:
bkind = kThemeSmallBevelButton;
}
break;
@@ -6943,7 +6708,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
bdi.kind = bkind;
bdi.value = kThemeButtonOff;
bdi.adornment = kThemeAdornmentNone;
- HIRect macRect, myRect;
+ CGRect macRect, myRect;
myRect = CGRectMake(0, 0, sz.width(), sz.height());
HIThemeGetButtonBackgroundBounds(&myRect, &bdi, &macRect);
// Mini buttons only return their actual size in HIThemeGetButtonBackgroundBounds, so help them out a bit (guess),
@@ -7045,8 +6810,7 @@ int QMacStyle::layoutSpacing(QSizePolicy::ControlType control1,
const QWidget *widget) const
{
const int ButtonMask = QSizePolicy::ButtonBox | QSizePolicy::PushButton;
- bool isMetal = (widget && widget->testAttribute(Qt::WA_MacBrushedMetal));
- int controlSize = getControlSize(option, widget);
+ const int controlSize = getControlSize(option, widget);
if (control2 == QSizePolicy::ButtonBox) {
/*
@@ -7054,11 +6818,10 @@ int QMacStyle::layoutSpacing(QSizePolicy::ControlType control1,
boxes and the row of buttons. The 20 pixel comes from
Builder.
*/
- if (isMetal // (AHIG, guess, guess)
- || (control1 & (QSizePolicy::Frame // guess
- | QSizePolicy::GroupBox // (AHIG, guess, guess)
- | QSizePolicy::TabWidget // guess
- | ButtonMask))) { // AHIG
+ if (control1 & (QSizePolicy::Frame // guess
+ | QSizePolicy::GroupBox // (AHIG, guess, guess)
+ | QSizePolicy::TabWidget // guess
+ | ButtonMask)) { // AHIG
return_SIZE(14, 8, 8);
} else if (control1 == QSizePolicy::LineEdit) {
return_SIZE(8, 8, 8); // Interface Builder
diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/plugins/styles/mac/qmacstyle_mac_p.h
index 7296539356..6011baeea2 100644
--- a/src/widgets/styles/qmacstyle_mac_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p.h
@@ -56,9 +56,6 @@
QT_BEGIN_NAMESPACE
-
-#if QT_CONFIG(style_mac)
-
class QPalette;
class QPushButton;
@@ -100,12 +97,6 @@ public:
virtual int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
QStyleHintReturn *shret = 0) const;
- enum WidgetSizePolicy { SizeSmall, SizeLarge, SizeMini, SizeDefault
- };
-
- static void setWidgetSizePolicy(const QWidget *w, WidgetSizePolicy policy);
- static WidgetSizePolicy widgetSizePolicy(const QWidget *w, const QStyleOption *opt = 0);
-
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt,
const QWidget *widget = 0) const;
@@ -132,8 +123,6 @@ private:
#endif
};
-#endif
-
QT_END_NAMESPACE
#endif // QMACSTYLE_MAC_P_H
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 142966de40..b84137f9de 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -45,8 +45,8 @@
#undef check
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtWidgets/private/qcommonstyle_p.h>
#include "qmacstyle_mac_p.h"
-#include "qcommonstyle_p.h"
#include <private/qapplication_p.h>
#if QT_CONFIG(combobox)
#include <private/qcombobox_p.h>
@@ -138,8 +138,11 @@
// We mean it.
//
+Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(CGContext);
+
Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
-Q_FORWARD_DECLARE_OBJC_CLASS(NSScroller);
+Q_FORWARD_DECLARE_OBJC_CLASS(NSCell);
+Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(NotificationReceiver));
QT_BEGIN_NAMESPACE
@@ -156,27 +159,29 @@ QT_BEGIN_NAMESPACE
#define CT1(c) CT2(c, c)
#define CT2(c1, c2) ((uint(c1) << 16) | uint(c2))
-enum QAquaWidgetSize { QAquaSizeLarge = 0, QAquaSizeSmall = 1, QAquaSizeMini = 2,
- QAquaSizeUnknown = -1 };
-
enum QCocoaWidgetKind {
- QCocoaArrowButton, // Disclosure triangle, like in QTreeView
QCocoaCheckBox,
QCocoaComboBox, // Editable QComboBox
+ QCocoaDisclosureButton, // Disclosure triangle, like in QTreeView
QCocoaPopupButton, // Non-editable QComboBox
+ QCocoaProgressIndicator,
+ QCocoaIndeterminateProgressIndicator,
QCocoaPullDownButton, // QPushButton with menu
QCocoaPushButton,
QCocoaRadioButton,
+ QCocoaHorizontalScroller,
+ QCocoaVerticalScroller,
QCocoaHorizontalSlider,
- QCocoaVerticalSlider
+ QCocoaVerticalSlider,
+ QCocoaStepper // QSpinBox buttons
};
-typedef QPair<QCocoaWidgetKind, QAquaWidgetSize> QCocoaWidget;
+typedef QPair<QCocoaWidgetKind, QStyleHelper::WidgetSizePolicy> QCocoaWidget;
-typedef void (^QCocoaDrawRectBlock)(NSRect, CGContextRef);
+typedef void (^QCocoaDrawRectBlock)(CGContextRef, const CGRect &);
#define SIZE(large, small, mini) \
- (controlSize == QAquaSizeLarge ? (large) : controlSize == QAquaSizeSmall ? (small) : (mini))
+ (controlSize == QStyleHelper::SizeLarge ? (large) : controlSize == QStyleHelper::SizeSmall ? (small) : (mini))
// same as return SIZE(...) but optimized
#define return_SIZE(large, small, mini) \
@@ -209,10 +214,10 @@ public:
enum Animates { AquaPushButton, AquaProgressBar, AquaListViewItemOpen, AquaScrollBar };
static ThemeDrawState getDrawState(QStyle::State flags);
- QAquaWidgetSize aquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
+ QStyleHelper::WidgetSizePolicy aquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
QStyle::ContentsType ct = QStyle::CT_CustomBase,
QSize szHint=QSize(-1, -1), QSize *insz = 0) const;
- QAquaWidgetSize effectiveAquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
+ QStyleHelper::WidgetSizePolicy effectiveAquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
QStyle::ContentsType ct = QStyle::CT_CustomBase,
QSize szHint=QSize(-1, -1), QSize *insz = 0) const;
void getSliderInfo(QStyle::ComplexControl cc, const QStyleOptionSlider *slider,
@@ -220,23 +225,23 @@ public:
inline int animateSpeed(Animates) const { return 33; }
// Utility functions
- void drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi,
+ void drawColorlessButton(const CGRect &macRect, HIThemeButtonDrawInfo *bdi,
QPainter *p, const QStyleOption *opt) const;
QSize pushButtonSizeFromContents(const QStyleOptionButton *btn) const;
- HIRect pushButtonContentBounds(const QStyleOptionButton *btn,
+ CGRect pushButtonContentBounds(const QStyleOptionButton *btn,
const HIThemeButtonDrawInfo *bdi) const;
void initComboboxBdi(const QStyleOptionComboBox *combo, HIThemeButtonDrawInfo *bdi,
const QWidget *widget, const ThemeDrawState &tds) const;
- static HIRect comboboxInnerBounds(const HIRect &outerBounds, int buttonKind);
+ static CGRect comboboxInnerBounds(const CGRect &outerBounds, int buttonKind);
static QRect comboboxEditBounds(const QRect &outerBounds, const HIThemeButtonDrawInfo &bdi);
- static void drawCombobox(const HIRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p);
- static void drawTableHeader(const HIRect &outerBounds, bool drawTopBorder, bool drawLeftBorder,
+ static void drawCombobox(const CGRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p);
+ static void drawTableHeader(const CGRect &outerBounds, bool drawTopBorder, bool drawLeftBorder,
const HIThemeButtonDrawInfo &bdi, QPainter *p);
bool contentFitsInPushButton(const QStyleOptionButton *btn, HIThemeButtonDrawInfo *bdi,
ThemeButtonKind buttonKindToCheck) const;
@@ -248,6 +253,12 @@ public:
void setAutoDefaultButton(QObject *button) const;
NSView *cocoaControl(QCocoaWidget widget) const;
+ NSCell *cocoaCell(QCocoaWidget widget) const;
+
+ void setupNSGraphicsContext(CGContextRef cg, bool flipped) const;
+ void restoreNSGraphicsContext(CGContextRef cg) const;
+
+ void setupVerticalInvertedXform(CGContextRef cg, bool reverse, bool vertical, const CGRect &rect) const;
void drawNSViewInRect(QCocoaWidget widget, NSView *view, const QRect &rect, QPainter *p, bool isQWidget = true, QCocoaDrawRectBlock drawRectBlock = nil) const;
void resolveCurrentNSView(QWindow *window);
@@ -259,24 +270,17 @@ public:
#endif
public:
- mutable QPointer<QObject> pressedButton;
- mutable QPointer<QObject> defaultButton;
mutable QPointer<QObject> autoDefaultButton;
static QVector<QPointer<QObject> > scrollBars;
- struct ButtonState {
- int frame;
- enum { ButtonDark, ButtonLight } dir;
- } buttonState;
mutable QPointer<QFocusFrame> focusWidget;
- CFAbsoluteTime defaultButtonStart;
- bool mouseDown;
- void* receiver;
- NSScroller *horizontalScroller;
- NSScroller *verticalScroller;
- void *indicatorBranchButtonCell;
+ QT_MANGLE_NAMESPACE(NotificationReceiver) *receiver;
NSView *backingStoreNSView;
QHash<QCocoaWidget, NSView *> cocoaControls;
+ QHash<QCocoaWidget, NSCell *> cocoaCells;
+
+ QFont smallSystemFont;
+ QFont miniSystemFont;
};
QT_END_NAMESPACE
diff --git a/src/plugins/styles/styles.pro b/src/plugins/styles/styles.pro
new file mode 100644
index 0000000000..542ad1329a
--- /dev/null
+++ b/src/plugins/styles/styles.pro
@@ -0,0 +1,8 @@
+TEMPLATE = subdirs
+QT_FOR_CONFIG += widgets-private
+
+qtConfig(style-android): SUBDIRS += android
+
+qtConfig(style-mac): SUBDIRS += mac
+
+qtConfig(style-windowsvista): SUBDIRS += windowsvista
diff --git a/src/plugins/styles/windowsvista/main.cpp b/src/plugins/styles/windowsvista/main.cpp
new file mode 100644
index 0000000000..d5048e45b7
--- /dev/null
+++ b/src/plugins/styles/windowsvista/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company 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 <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtWidgets/qstyleplugin.h>
+#include "qwindowsvistastyle_p.h"
+
+QT_BEGIN_NAMESPACE
+
+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 *QWindowsVistaStylePlugin::create(const QString &key)
+{
+ if (key.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) == 0)
+ return new QWindowsVistaStyle();
+
+ return 0;
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index 91fc36959b..016a2f3ccc 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -47,8 +47,6 @@
#include <private/qapplication_p.h>
#include <qpa/qplatformnativeinterface.h>
-#if QT_CONFIG(style_windowsvista) || defined(QT_PLUGIN)
-
QT_BEGIN_NAMESPACE
static const int windowsItemFrame = 2; // menu item frame width
@@ -2488,5 +2486,3 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon,
}
QT_END_NAMESPACE
-
-#endif //QT_NO_WINDOWSVISTA
diff --git a/src/widgets/styles/qwindowsvistastyle_p.h b/src/plugins/styles/windowsvista/qwindowsvistastyle_p.h
index 8fbd1dc380..5ffcbc6aa9 100644
--- a/src/widgets/styles/qwindowsvistastyle_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle_p.h
@@ -52,13 +52,10 @@
//
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <private/qwindowsxpstyle_p.h>
+#include "qwindowsxpstyle_p.h"
QT_BEGIN_NAMESPACE
-
-#if QT_CONFIG(style_windowsvista)
-
class QWindowsVistaStylePrivate;
class QWindowsVistaStyle : public QWindowsXPStyle
{
@@ -103,7 +100,6 @@ private:
Q_DECLARE_PRIVATE(QWindowsVistaStyle)
friend class QStyleFactory;
};
-#endif // style_windowsvista
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
index fdc3297ea6..a6744ff915 100644
--- a/src/widgets/styles/qwindowsvistastyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
@@ -53,9 +53,7 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qwindowsvistastyle_p.h"
-
-#if QT_CONFIG(style_windowsvista)
-#include <private/qwindowsxpstyle_p_p.h>
+#include "qwindowsxpstyle_p_p.h"
#include <private/qstyleanimation_p.h>
#include <private/qpaintengine_raster_p.h>
#include <qpaintengine.h>
@@ -195,6 +193,4 @@ public:
QT_END_NAMESPACE
-#endif // style_windowsvista
-
#endif // QWINDOWSVISTASTYLE_P_P_H
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index 8b363b830a..347b0f28f9 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -39,8 +39,6 @@
#include "qwindowsxpstyle_p.h"
#include "qwindowsxpstyle_p_p.h"
-#if QT_CONFIG(style_windowsxp) || defined(QT_PLUGIN)
-
#include <private/qobject_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qapplication_p.h>
@@ -679,6 +677,13 @@ static inline TransformType transformType(const QTransform &transform, qreal dev
? HighDpiScalingTransform : ComplexTransform;
}
+// QTBUG-60571: Exclude known fully opaque theme parts which produce values
+// invalid in ARGB32_Premultiplied (for example, 0x00ffffff).
+static inline bool isFullyOpaque(const XPThemeData &themeData)
+{
+ return themeData.theme == QWindowsXPStylePrivate::TaskDialogTheme && themeData.partId == TDLG_PRIMARYPANEL;
+}
+
/*! \internal
Main theme drawing function.
Determines the correct lowlevel drawing method depending on several
@@ -717,6 +722,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData)
bool canDrawDirectly = false;
if (themeData.widget && painter->opacity() == 1.0 && !themeData.rotate
+ && !isFullyOpaque(themeData)
&& tt != ComplexTransform && !themeData.mirrorVertically
&& !translucentToplevel) {
// Draw on backing store DC only for real widgets or backing store images.
@@ -4234,5 +4240,3 @@ void QWindowsXPStylePrivate::showProperties(XPThemeData &themeData)
QT_END_NAMESPACE
-
-#endif //QT_NO_WINDOWSXP
diff --git a/src/widgets/styles/qwindowsxpstyle_p.h b/src/plugins/styles/windowsvista/qwindowsxpstyle_p.h
index 62e3af927c..d00620eefa 100644
--- a/src/widgets/styles/qwindowsxpstyle_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle_p.h
@@ -52,13 +52,10 @@
//
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <private/qwindowsstyle_p.h>
+#include <QtWidgets/private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
-
-#if QT_CONFIG(style_windowsxp)
-
class QWindowsXPStylePrivate;
class QWindowsXPStyle : public QWindowsStyle
{
@@ -102,8 +99,6 @@ private:
friend class QStyleFactory;
};
-#endif // style_windowsxp
-
QT_END_NAMESPACE
#endif // QWINDOWSXPSTYLE_P_H
diff --git a/src/widgets/styles/qwindowsxpstyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
index fb5210cb07..721a734829 100644
--- a/src/widgets/styles/qwindowsxpstyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
@@ -53,7 +53,7 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qwindowsxpstyle_p.h"
-#include "qwindowsstyle_p_p.h"
+#include <QtWidgets/private/qwindowsstyle_p_p.h>
#include <qmap.h>
#include <qt_windows.h>
@@ -94,8 +94,6 @@ QT_BEGIN_NAMESPACE
// Uncomment define below to build debug assisting code, and output
// #define DEBUG_XP_STYLE
-#if QT_CONFIG(style_windowsxp)
-
// Declarations -----------------------------------------------------------------------------------
class XPThemeData
{
@@ -338,8 +336,6 @@ inline QMarginsF XPThemeData::themeMargins(const QWidget *w, QPainter *p, int th
return theme.margins(propId);
}
-#endif // style_windows
-
QT_END_NAMESPACE
#endif //QWINDOWSXPSTYLE_P_P_H
diff --git a/src/plugins/styles/windowsvista/windowsvista.pro b/src/plugins/styles/windowsvista/windowsvista.pro
new file mode 100644
index 0000000000..f82bcfc91b
--- /dev/null
+++ b/src/plugins/styles/windowsvista/windowsvista.pro
@@ -0,0 +1,22 @@
+TARGET = qwindowsvistastyle
+
+QT += widgets-private
+
+SOURCES += main.cpp
+
+HEADERS += qwindowsvistastyle_p.h qwindowsvistastyle_p_p.h
+SOURCES += qwindowsvistastyle.cpp
+
+HEADERS += qwindowsxpstyle_p.h qwindowsxpstyle_p_p.h
+SOURCES += qwindowsxpstyle.cpp
+
+LIBS_PRIVATE += -lgdi32 -luser32
+
+# DEFINES/LIBS needed for qwizard_win.cpp and the styles
+include(../../../widgets/kernel/win.pri)
+
+DISTFILES += windowsvistastyle.json
+
+PLUGIN_TYPE = styles
+PLUGIN_CLASS_NAME = QWindowsVistaStylePlugin
+load(qt_plugin)
diff --git a/src/plugins/styles/windowsvista/windowsvistastyle.json b/src/plugins/styles/windowsvista/windowsvistastyle.json
new file mode 100644
index 0000000000..771aa0c600
--- /dev/null
+++ b/src/plugins/styles/windowsvista/windowsvistastyle.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "windowsvista" ]
+}
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index 48ab71eea4..1c9d522c1c 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -96,7 +96,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(QStringLiteral("HH:mm"));
+ return localDateTime.toUTC().time().toString(QStringViewLiteral("HH:mm"));
}
// else fall through:
Q_FALLTHROUGH();
diff --git a/src/printsupport/kernel/qprintengine_pdf.cpp b/src/printsupport/kernel/qprintengine_pdf.cpp
index 278bb044e1..080ff7ccf4 100644
--- a/src/printsupport/kernel/qprintengine_pdf.cpp
+++ b/src/printsupport/kernel/qprintengine_pdf.cpp
@@ -58,10 +58,12 @@
QT_BEGIN_NAMESPACE
-QPdfPrintEngine::QPdfPrintEngine(QPrinter::PrinterMode m)
+QPdfPrintEngine::QPdfPrintEngine(QPrinter::PrinterMode m, QPdfEngine::PdfVersion version)
: QPdfEngine(*new QPdfPrintEnginePrivate(m))
{
state = QPrinter::Idle;
+
+ setPdfVersion(version);
}
QPdfPrintEngine::QPdfPrintEngine(QPdfPrintEnginePrivate &p)
diff --git a/src/printsupport/kernel/qprintengine_pdf_p.h b/src/printsupport/kernel/qprintengine_pdf_p.h
index b964885bbf..e9e81bdf68 100644
--- a/src/printsupport/kernel/qprintengine_pdf_p.h
+++ b/src/printsupport/kernel/qprintengine_pdf_p.h
@@ -83,7 +83,7 @@ class Q_PRINTSUPPORT_EXPORT QPdfPrintEngine : public QPdfEngine, public QPrintEn
{
Q_DECLARE_PRIVATE(QPdfPrintEngine)
public:
- QPdfPrintEngine(QPrinter::PrinterMode m);
+ QPdfPrintEngine(QPrinter::PrinterMode m, QPdfEngine::PdfVersion version = QPdfEngine::Version_1_4);
virtual ~QPdfPrintEngine();
// reimplementations QPaintEngine
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index e2138512cc..3135836ce7 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -149,7 +149,8 @@ void QPrinterPrivate::initEngines(QPrinter::OutputFormat format, const QPrinterI
printEngine = ps->createNativePrintEngine(printerMode, printerName);
paintEngine = ps->createPaintEngine(printEngine, printerMode);
} else {
- QPdfPrintEngine *pdfEngine = new QPdfPrintEngine(printerMode);
+ const auto pdfEngineVersion = (pdfVersion == QPrinter::PdfVersion_1_4 ? QPdfEngine::Version_1_4 : QPdfEngine::Version_A1b);
+ QPdfPrintEngine *pdfEngine = new QPdfPrintEngine(printerMode, pdfEngineVersion);
paintEngine = pdfEngine;
printEngine = pdfEngine;
}
@@ -686,7 +687,37 @@ QPrinter::OutputFormat QPrinter::outputFormat() const
return d->outputFormat;
}
+/*!
+ \since 5.10
+
+ Sets the PDF version for this printer to \a version.
+
+ If \a version is the same value as currently set then no change will be made.
+*/
+void QPrinter::setPdfVersion(PdfVersion version)
+{
+ Q_D(QPrinter);
+
+ if (d->pdfVersion == version)
+ return;
+
+ d->pdfVersion = version;
+ if (d->outputFormat == QPrinter::PdfFormat) {
+ d->changeEngines(d->outputFormat, QPrinterInfo());
+ }
+}
+
+/*!
+ \since 5.10
+
+ Returns the PDF version for this printer. The default is \c PdfVersion_1_4.
+*/
+QPrinter::PdfVersion QPrinter::pdfVersion() const
+{
+ Q_D(const QPrinter);
+ return d->pdfVersion;
+}
/*! \internal
*/
diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h
index 33a2d4dbc8..bfe2d346ae 100644
--- a/src/printsupport/kernel/qprinter.h
+++ b/src/printsupport/kernel/qprinter.h
@@ -134,6 +134,9 @@ public:
void setOutputFormat(OutputFormat format);
OutputFormat outputFormat() const;
+ void setPdfVersion(PdfVersion version);
+ PdfVersion pdfVersion() const;
+
void setPrinterName(const QString &);
QString printerName() const;
diff --git a/src/printsupport/kernel/qprinter_p.h b/src/printsupport/kernel/qprinter_p.h
index 603eaf7409..6ced466236 100644
--- a/src/printsupport/kernel/qprinter_p.h
+++ b/src/printsupport/kernel/qprinter_p.h
@@ -75,7 +75,8 @@ class Q_PRINTSUPPORT_EXPORT QPrinterPrivate
Q_DECLARE_PUBLIC(QPrinter)
public:
QPrinterPrivate(QPrinter *printer)
- : printEngine(0),
+ : pdfVersion(QPrinter::PdfVersion_1_4),
+ printEngine(0),
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
@@ -107,6 +108,7 @@ public:
QPrinter::PrinterMode printerMode;
QPrinter::OutputFormat outputFormat;
+ QPrinter::PdfVersion pdfVersion;
QPrintEngine *printEngine;
QPaintEngine *paintEngine;
diff --git a/src/sql/doc/snippets/code/doc_src_sql-driver.cpp b/src/sql/doc/snippets/code/doc_src_sql-driver.cpp
index f25ad4f2b0..7983386642 100644
--- a/src/sql/doc/snippets/code/doc_src_sql-driver.cpp
+++ b/src/sql/doc/snippets/code/doc_src_sql-driver.cpp
@@ -90,3 +90,8 @@ qDebug() << q.value(0); // outputs the first RETURN/OUT value
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QMYSQL
//! [31]
+
+
+//! [34]
+column.contains(QRegularExpression("pattern"));
+//! [34]
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index 4f3f2ce007..2811230106 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -568,6 +568,22 @@
\snippet code/doc_src_sql-driver.qdoc 23
+ \section3 Enable REGEXP operator
+
+ SQLite comes with a REGEXP operation. However the needed implementation must
+ be provided by the user. For convenience a default implementation can be
+ enabled by \l{QSqlDatabase::setConnectOptions()} {setting the connect
+ option} \c{QSQLITE_ENABLE_REGEXP} before \l{QSqlDatabase::open()} {the
+ database connection is opened}. Then a SQL statement like "column REGEXP
+ 'pattern'" basically expands to the Qt code
+
+ \snippet code/doc_src_sql-driver.cpp 34
+
+ For better performance the regular expressions are cached internally. By
+ default the cache size is 25, but it can be changed through the option's
+ value. For example passing "\c{QSQLITE_ENABLE_REGEXP=10}" reduces the
+ cache size to 10.
+
\section3 QSQLITE File Format Compatibility
SQLite minor releases sometimes break file format forward compatibility.
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 412658e39c..bca981a865 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -1178,6 +1178,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\li QSQLITE_OPEN_READONLY
\li QSQLITE_OPEN_URI
\li QSQLITE_ENABLE_SHARED_CACHE
+ \li QSQLITE_ENABLE_REGEXP
\endlist
\li
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index d1fc5d4585..50b10aab40 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -98,6 +98,34 @@ public:
type \a type and the optional error number \a number.
*/
+/*! \fn QSqlError::QSqlError(QSqlError &&other)
+ Move-constructs a QSqlError instance, making it point at the same
+ object that \a other was pointing to.
+
+ \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.10
+*/
+
+/*! \fn QSqlError::operator=(QSqlError &&other)
+ Move-assigns \a other to this QSqlError instance.
+
+ \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.10
+*/
+
+/*! \fn QSqlError::swap(QSqlError &other)
+ Swaps error \a other with this error. This operation is very fast
+ and never fails.
+
+ \since 5.10
+*/
+
#if QT_DEPRECATED_SINCE(5, 3)
QSqlError::QSqlError(const QString& driverText, const QString& databaseText, ErrorType type,
int number)
@@ -117,7 +145,6 @@ QSqlError::QSqlError(const QString& driverText, const QString& databaseText, Err
driverText, the database-specific error text \a databaseText, the
type \a type and the error code \a code.
*/
-
QSqlError::QSqlError(const QString &driverText, const QString &databaseText,
ErrorType type, const QString &code)
{
@@ -146,7 +173,10 @@ QSqlError::QSqlError(const QSqlError& other)
QSqlError& QSqlError::operator=(const QSqlError& other)
{
- *d = *other.d;
+ if (d)
+ *d = *other.d;
+ else
+ d = new QSqlErrorPrivate(*other.d);
return *this;
}
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h
index 0ccd32159d..6dac47a7fe 100644
--- a/src/sql/kernel/qsqlerror.h
+++ b/src/sql/kernel/qsqlerror.h
@@ -66,11 +66,16 @@ 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& operator=(const QSqlError& other);
+ QSqlError &operator=(QSqlError &&other) Q_DECL_NOTHROW { 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); }
+
QString driverText() const;
QString databaseText() const;
ErrorType type() const;
@@ -102,6 +107,8 @@ private:
};
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QSqlError)
+
#ifndef QT_NO_DEBUG_STREAM
Q_SQL_EXPORT QDebug operator<<(QDebug, const QSqlError &);
#endif
diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp
index bb810b11df..59b992e803 100644
--- a/src/sql/kernel/qsqlfield.cpp
+++ b/src/sql/kernel/qsqlfield.cpp
@@ -47,9 +47,9 @@ class QSqlFieldPrivate
{
public:
QSqlFieldPrivate(const QString &name,
- QVariant::Type type) :
+ QVariant::Type type, const QString &tableName) :
ref(1), nm(name), ro(false), type(type), req(QSqlField::Unknown),
- len(-1), prec(-1), tp(-1), gen(true), autoval(false)
+ len(-1), prec(-1), tp(-1), gen(true), autoval(false), table(tableName)
{
}
@@ -64,7 +64,8 @@ public:
def(other.def),
tp(other.tp),
gen(other.gen),
- autoval(other.autoval)
+ autoval(other.autoval),
+ table(other.table)
{}
bool operator==(const QSqlFieldPrivate& other) const
@@ -77,7 +78,8 @@ public:
&& prec == other.prec
&& def == other.def
&& gen == other.gen
- && autoval == other.autoval);
+ && autoval == other.autoval
+ && table == other.table);
}
QAtomicInt ref;
@@ -91,6 +93,7 @@ public:
int tp;
uint gen: 1;
uint autoval: 1;
+ QString table;
};
@@ -153,14 +156,15 @@ public:
/*!
Constructs an empty field called \a fieldName of variant type \a
- type.
+ type in \a table.
\sa setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(),
setGenerated(), setReadOnly()
*/
-QSqlField::QSqlField(const QString& fieldName, QVariant::Type type)
+QSqlField::QSqlField(const QString &fieldName, QVariant::Type type,
+ const QString &table)
{
- d = new QSqlFieldPrivate(fieldName, type);
+ d = new QSqlFieldPrivate(fieldName, type, table);
val = QVariant(type);
}
@@ -518,6 +522,7 @@ QDebug operator<<(QDebug dbg, const QSqlField &f)
QDebugStateSaver saver(dbg);
dbg.nospace();
dbg << "QSqlField(" << f.name() << ", " << QMetaType::typeName(f.type());
+ dbg << ", tableName: " << (f.tableName().isEmpty() ? QStringLiteral("(not specified)") : f.tableName());
if (f.length() >= 0)
dbg << ", length: " << f.length();
if (f.precision() >= 0)
@@ -565,4 +570,27 @@ void QSqlField::setAutoValue(bool autoVal)
d->autoval = autoVal;
}
+/*!
+ Sets the tableName of the field to \a table.
+
+ \sa tableName()
+*/
+
+void QSqlField::setTableName(const QString &table)
+{
+ detach();
+ d->table = table;
+}
+
+/*!
+ Returns the tableName of the field.
+
+ \sa setTableName()
+*/
+
+QString QSqlField::tableName() const
+{
+ return d->table;
+}
+
QT_END_NAMESPACE
diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h
index 0d8c51f801..30474735f4 100644
--- a/src/sql/kernel/qsqlfield.h
+++ b/src/sql/kernel/qsqlfield.h
@@ -55,7 +55,8 @@ public:
enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 };
explicit QSqlField(const QString& fieldName = QString(),
- QVariant::Type type = QVariant::Invalid);
+ QVariant::Type type = QVariant::Invalid,
+ const QString &tableName = QString());
QSqlField(const QSqlField& other);
QSqlField& operator=(const QSqlField& other);
@@ -68,6 +69,8 @@ public:
{ return val; }
void setName(const QString& name);
QString name() const;
+ void setTableName(const QString &tableName);
+ QString tableName() const;
bool isNull() const;
void setReadOnly(bool readOnly);
bool isReadOnly() const;
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index d5adff67a4..1c9ad5ec63 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -232,10 +232,23 @@ QString QSqlRecord::fieldName(int index) const
int QSqlRecord::indexOf(const QString& name) const
{
- QString nm = name.toUpper();
+ QString tableName;
+ QString fieldName = name;
+ const int idx = name.indexOf(QLatin1Char('.'));
+ if (idx != -1) {
+ tableName = name.left(idx);
+ fieldName = name.mid(idx + 1);
+ }
for (int i = 0; i < count(); ++i) {
- if (d->fields.at(i).name().toUpper() == nm) // TODO: case-insensitive comparison
+ // Check the passed in name first in case it is an alias using a dot.
+ // Then check if both the table and field match when there is a table name specified.
+ const auto currentField = d->fields.at(i);
+ const auto currentFieldName = currentField.name();
+ if (currentFieldName.compare(name, Qt::CaseInsensitive) == 0
+ || (idx != -1 && currentFieldName.compare(fieldName, Qt::CaseInsensitive) == 0
+ && currentField.tableName().compare(tableName, Qt::CaseInsensitive) == 0)) {
return i;
+ }
}
return -1;
}
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp
index 864c5b9946..c0b1061c6b 100644
--- a/src/sql/models/qsqlquerymodel.cpp
+++ b/src/sql/models/qsqlquerymodel.cpp
@@ -212,6 +212,30 @@ bool QSqlQueryModel::canFetchMore(const QModelIndex &parent) const
return (!parent.isValid() && !d->atEnd);
}
+/*!
+ \since 5.10
+ \reimp
+
+ Returns the model's role names.
+
+ Qt defines only one role for the QSqlQueryModel:
+
+ \table
+ \header
+ \li Qt Role
+ \li QML Role Name
+ \row
+ \li Qt::DisplayRole
+ \li display
+ \endtable
+*/
+QHash<int, QByteArray> QSqlQueryModel::roleNames() const
+{
+ return QHash<int, QByteArray> {
+ { Qt::DisplayRole, QByteArrayLiteral("display") }
+ };
+}
+
/*! \internal
*/
void QSqlQueryModel::beginInsertRows(const QModelIndex &parent, int first, int last)
diff --git a/src/sql/models/qsqlquerymodel.h b/src/sql/models/qsqlquerymodel.h
index f786f71300..869a5f030c 100644
--- a/src/sql/models/qsqlquerymodel.h
+++ b/src/sql/models/qsqlquerymodel.h
@@ -58,22 +58,22 @@ class Q_SQL_EXPORT QSqlQueryModel: public QAbstractTableModel
Q_DECLARE_PRIVATE(QSqlQueryModel)
public:
- explicit QSqlQueryModel(QObject *parent = Q_NULLPTR);
+ explicit QSqlQueryModel(QObject *parent = nullptr);
virtual ~QSqlQueryModel();
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QSqlRecord record(int row) const;
QSqlRecord record() const;
- QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int role = Qt::DisplayRole) const override;
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
- int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ int role = Qt::EditRole) override;
- bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
void setQuery(const QSqlQuery &query);
void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase());
@@ -83,8 +83,10 @@ public:
QSqlError lastError() const;
- void fetchMore(const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool canFetchMore(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ void fetchMore(const QModelIndex &parent = QModelIndex()) override;
+ bool canFetchMore(const QModelIndex &parent = QModelIndex()) const override;
+
+ QHash<int, QByteArray> roleNames() const override;
protected:
void beginInsertRows(const QModelIndex &parent, int first, int last);
@@ -105,7 +107,7 @@ protected:
virtual QModelIndex indexInQuery(const QModelIndex &item) const;
void setLastError(const QSqlError &error);
- QSqlQueryModel(QSqlQueryModelPrivate &dd, QObject *parent = Q_NULLPTR);
+ QSqlQueryModel(QSqlQueryModelPrivate &dd, QObject *parent = nullptr);
};
QT_END_NAMESPACE
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index c0706ac22d..05feb87466 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -477,9 +477,9 @@ QVariant QSqlTableModel::data(const QModelIndex &index, int role) const
if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::EditRole))
return QVariant();
- const QSqlTableModelPrivate::ModifiedRow mrow = d->cache.value(index.row());
- if (mrow.op() != QSqlTableModelPrivate::None)
- return mrow.rec().value(index.column());
+ const auto it = d->cache.constFind(index.row());
+ if (it != d->cache.constEnd() && it->op() != QSqlTableModelPrivate::None)
+ return it->rec().value(index.column());
return QSqlQueryModel::data(index, role);
}
@@ -532,7 +532,10 @@ bool QSqlTableModel::isDirty(const QModelIndex &index) const
if (!index.isValid())
return false;
- const QSqlTableModelPrivate::ModifiedRow row = d->cache.value(index.row());
+ const auto it = d->cache.constFind(index.row());
+ if (it == d->cache.constEnd())
+ return false;
+ const QSqlTableModelPrivate::ModifiedRow &row = *it;
if (row.submitted())
return false;
@@ -1231,7 +1234,8 @@ int QSqlTableModel::rowCount(const QModelIndex &parent) const
QModelIndex QSqlTableModel::indexInQuery(const QModelIndex &item) const
{
Q_D(const QSqlTableModel);
- if (d->cache.value(item.row()).insert())
+ const auto it = d->cache.constFind(item.row());
+ if (it != d->cache.constEnd() && it->insert())
return QModelIndex();
const int rowOffset = d->insertCount(item.row());
diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h
index 3b64cdfa47..490bb48a24 100644
--- a/src/sql/models/qsqltablemodel_p.h
+++ b/src/sql/models/qsqltablemodel_p.h
@@ -117,7 +117,7 @@ public:
m_rec = m_db_values;
setGenerated(m_rec, m_op == Delete);
}
- inline QSqlRecord rec() const { return m_rec; }
+ inline const QSqlRecord &rec() const { return m_rec; }
inline QSqlRecord& recRef() { return m_rec; }
inline void setValue(int c, const QVariant &v)
{
diff --git a/src/src.pro b/src/src.pro
index 43fc06f2e5..a2064b1362 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -49,6 +49,11 @@ src_tools_qdbuscpp2xml.target = sub-qdbuscpp2xml
force_bootstrap: src_tools_qdbuscpp2xml.depends = src_tools_bootstrap_dbus
else: src_tools_qdbuscpp2xml.depends = src_dbus
+src_tools_qvkgen.subdir = tools/qvkgen
+src_tools_qvkgen.target = sub-qvkgen
+force_bootstrap: src_tools_qvkgen.depends = src_tools_bootstrap
+else: src_tools_qvkgen.depends = src_corelib
+
src_winmain.subdir = $$PWD/winmain
src_winmain.target = sub-winmain
src_winmain.depends = sub-corelib # just for the module .pri file
@@ -188,6 +193,9 @@ 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
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/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp
index 0ba55dbeb7..0f4f915ed3 100644
--- a/src/testlib/qbenchmarkmetric.cpp
+++ b/src/testlib/qbenchmarkmetric.cpp
@@ -40,6 +40,53 @@
#include <QtTest/private/qbenchmarkmetric_p.h>
+QT_BEGIN_NAMESPACE
+
+namespace QTest {
+
+struct QBenchmarkMetricKey {
+ int metric;
+ const char * name;
+ const char * unit;
+};
+
+static const QBenchmarkMetricKey entries[] = {
+ { FramesPerSecond, "FramesPerSecond", "fps" },
+ { BitsPerSecond, "BitsPerSecond", "bits/s" },
+ { BytesPerSecond, "BytesPerSecond", "bytes/s" },
+ { WalltimeMilliseconds, "WalltimeMilliseconds", "msecs" },
+ { CPUTicks, "CPUTicks", "CPU ticks" },
+ { InstructionReads, "InstructionReads", "instruction reads" },
+ { Events, "Events", "events" },
+ { WalltimeNanoseconds, "WalltimeNanoseconds", "nsecs" },
+ { BytesAllocated, "BytesAllocated", "bytes" },
+ { CPUMigrations, "CPUMigrations", "CPU migrations" },
+ { CPUCycles, "CPUCycles", "CPU cycles" },
+ { BusCycles, "BusCycles", "bus cycles" },
+ { StalledCycles, "StalledCycles", "stalled cycles" },
+ { Instructions, "Instructions", "instructions" },
+ { BranchInstructions, "BranchInstructions", "branch instructions" },
+ { BranchMisses, "BranchMisses", "branch misses" },
+ { CacheReferences, "CacheReferences", "cache references" },
+ { CacheReads, "CacheReads", "cache loads" },
+ { CacheWrites, "CacheWrites", "cache stores" },
+ { CachePrefetches, "CachePrefetches", "cache prefetches" },
+ { CacheMisses, "CacheMisses", "cache misses" },
+ { CacheReadMisses, "CacheReadMisses", "cache load misses" },
+ { CacheWriteMisses, "CacheWriteMisses", "cache store misses" },
+ { CachePrefetchMisses, "CachePrefetchMisses", "cache prefetch misses" },
+ { ContextSwitches, "ContextSwitches", "context switches" },
+ { PageFaults, "PageFaults", "page faults" },
+ { MinorPageFaults, "MinorPageFaults", "minor page faults" },
+ { MajorPageFaults, "MajorPageFaults", "major page faults" },
+ { AlignmentFaults, "AlignmentFaults", "alignment faults" },
+ { EmulationFaults, "EmulationFaults", "emulation faults" },
+ { RefCPUCycles, "RefCPUCycles", "Reference CPU cycles" },
+};
+static const int NumEntries = sizeof(entries) / sizeof(entries[0]);
+
+}
+
/*!
\enum QTest::QBenchmarkMetric
\since 4.7
@@ -92,73 +139,11 @@
*/
const char * QTest::benchmarkMetricName(QBenchmarkMetric metric)
{
- switch (metric) {
- case FramesPerSecond:
- return "FramesPerSecond";
- case BitsPerSecond:
- return "BitsPerSecond";
- case BytesPerSecond:
- return "BytesPerSecond";
- case WalltimeMilliseconds:
- return "WalltimeMilliseconds";
- case Events:
- return "Events";
- case CPUTicks:
- return "CPUTicks";
- case CPUMigrations:
- return "CPUMigrations";
- case CPUCycles:
- return "CPUCycles";
- case RefCPUCycles:
- return "RefCPUCycles";
- case BusCycles:
- return "BusCycles";
- case StalledCycles:
- return "StalledCycles";
- case InstructionReads:
- return "InstructionReads";
- case Instructions:
- return "Instructions";
- case WalltimeNanoseconds:
- return "WalltimeNanoseconds";
- case BytesAllocated:
- return "BytesAllocated";
- case BranchInstructions:
- return "BranchInstructions";
- case BranchMisses:
- return "BranchMisses";
- case CacheReferences:
- return "CacheReferences";
- case CacheReads:
- return "CacheReads";
- case CacheWrites:
- return "CacheWrites";
- case CachePrefetches:
- return "CachePrefetches";
- case CacheMisses:
- return "CacheMisses";
- case CacheReadMisses:
- return "CacheReadMisses";
- case CacheWriteMisses:
- return "CacheWriteMisses";
- case CachePrefetchMisses:
- return "CachePrefetchMisses";
- case ContextSwitches:
- return "ContextSwitches";
- case PageFaults:
- return "PageFaults";
- case MinorPageFaults:
- return "MinorPageFaults";
- case MajorPageFaults:
- return "MajorPageFaults";
- case AlignmentFaults:
- return "AlignmentFaults";
- case EmulationFaults:
- return "EmulationFaults";
- default:
- return "";
- }
-};
+ if (metric >= 0 && metric < QTest::NumEntries)
+ return entries[metric].name;
+
+ return "";
+}
/*!
\since 4.7
@@ -166,71 +151,10 @@ const char * QTest::benchmarkMetricName(QBenchmarkMetric metric)
*/
const char * QTest::benchmarkMetricUnit(QBenchmarkMetric metric)
{
- switch (metric) {
- case FramesPerSecond:
- return "fps";
- case BitsPerSecond:
- return "bits/s";
- case BytesPerSecond:
- return "bytes/s";
- case WalltimeMilliseconds:
- return "msecs";
- case Events:
- return "events";
- case CPUTicks:
- return "CPU ticks";
- case CPUMigrations:
- return "CPU migrations";
- case CPUCycles:
- return "CPU cycles";
- case RefCPUCycles:
- return "Reference CPU cycles";
- case BusCycles:
- return "bus cycles";
- case StalledCycles:
- return "stalled cycles";
- case InstructionReads:
- return "instruction reads";
- case Instructions:
- return "instructions";
- case WalltimeNanoseconds:
- return "nsecs";
- case BytesAllocated:
- return "bytes";
- case BranchInstructions:
- return "branch instructions";
- case BranchMisses:
- return "branch misses";
- case CacheReferences:
- return "cache references";
- case CacheReads:
- return "cache loads";
- case CacheWrites:
- return "cache stores";
- case CachePrefetches:
- return "cache prefetches";
- case CacheMisses:
- return "cache misses";
- case CacheReadMisses:
- return "cache load misses";
- case CacheWriteMisses:
- return "cache store misses";
- case CachePrefetchMisses:
- return "cache prefetch misses";
- case ContextSwitches:
- return "context switches";
- case PageFaults:
- return "page faults";
- case MinorPageFaults:
- return "minor page faults";
- case MajorPageFaults:
- return "major page faults";
- case AlignmentFaults:
- return "alignment faults";
- case EmulationFaults:
- return "emulation faults";
- default:
- return "";
- }
+ if (metric >= 0 && metric < QTest::NumEntries)
+ return entries[metric].unit;
+
+ return "";
}
+QT_END_NAMESPACE
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index ba63df5f36..ca045120d5 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -65,9 +65,14 @@ QT_BEGIN_NAMESPACE
namespace QTest
{
+template <> inline char *toString(const QStringView &str)
+{
+ return QTest::toPrettyUnicode(str);
+}
+
template<> inline char *toString(const QString &str)
{
- return QTest::toPrettyUnicode(reinterpret_cast<const ushort *>(str.constData()), str.length());
+ return toString(QStringView(str));
}
template<> inline char *toString(const QLatin1String &str)
@@ -84,21 +89,21 @@ template<> inline char *toString(const QByteArray &ba)
template<> inline char *toString(const QTime &time)
{
return time.isValid()
- ? qstrdup(qPrintable(time.toString(QLatin1String("hh:mm:ss.zzz"))))
+ ? qstrdup(qPrintable(time.toString(QStringViewLiteral("hh:mm:ss.zzz"))))
: qstrdup("Invalid QTime");
}
template<> inline char *toString(const QDate &date)
{
return date.isValid()
- ? qstrdup(qPrintable(date.toString(QLatin1String("yyyy/MM/dd"))))
+ ? qstrdup(qPrintable(date.toString(QStringViewLiteral("yyyy/MM/dd"))))
: qstrdup("Invalid QDate");
}
template<> inline char *toString(const QDateTime &dateTime)
{
return dateTime.isValid()
- ? qstrdup(qPrintable(dateTime.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz[t]"))))
+ ? qstrdup(qPrintable(dateTime.toString(QStringViewLiteral("yyyy/MM/dd hh:mm:ss.zzz[t]"))))
: qstrdup("Invalid QDateTime");
}
#endif // QT_NO_DATESTRING
@@ -194,6 +199,22 @@ template<> inline char *toString(const QVariant &v)
return qstrdup(vstring.constData());
}
+template <typename T1, typename T2>
+inline char *toString(const QPair<T1, T2> &pair)
+{
+ const QScopedArrayPointer<char> first(toString(pair.first));
+ const QScopedArrayPointer<char> second(toString(pair.second));
+ return toString(QString::asprintf("QPair(%s,%s)", first.data(), second.data()));
+}
+
+template <typename T1, typename T2>
+inline char *toString(const std::pair<T1, T2> &pair)
+{
+ const QScopedArrayPointer<char> first(toString(pair.first));
+ const QScopedArrayPointer<char> second(toString(pair.second));
+ return toString(QString::asprintf("std::pair(%s,%s)", first.data(), second.data()));
+}
+
inline char *toString(std::nullptr_t)
{
return toString(QLatin1String("nullptr"));
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index d0d56e7bd0..d848f08d55 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -59,6 +59,9 @@
#include <QtGui/qpixmap.h>
#include <QtGui/qimage.h>
#include <QtGui/qregion.h>
+#include <QtGui/qvector2d.h>
+#include <QtGui/qvector3d.h>
+#include <QtGui/qvector4d.h>
#ifdef QT_WIDGETS_LIB
#include <QtGui/qicon.h>
@@ -116,6 +119,32 @@ template<> inline char *toString(const QRegion &region)
return qstrdup(result.constData());
}
+#ifndef QT_NO_VECTOR2D
+template<> inline char *toString(const QVector2D &v)
+{
+ QByteArray result = "QVector2D(" + QByteArray::number(v.x()) + ", "
+ + QByteArray::number(v.y()) + ')';
+ return qstrdup(result.constData());
+}
+#endif // !QT_NO_VECTOR2D
+#ifndef QT_NO_VECTOR3D
+template<> inline char *toString(const QVector3D &v)
+{
+ QByteArray result = "QVector3D(" + QByteArray::number(v.x()) + ", "
+ + QByteArray::number(v.y()) + ", " + QByteArray::number(v.z()) + ')';
+ return qstrdup(result.constData());
+}
+#endif // !QT_NO_VECTOR3D
+#ifndef QT_NO_VECTOR4D
+template<> inline char *toString(const QVector4D &v)
+{
+ QByteArray result = "QVector4D(" + QByteArray::number(v.x()) + ", "
+ + QByteArray::number(v.y()) + ", " + QByteArray::number(v.z())
+ + ", " + QByteArray::number(v.w()) + ')';
+ return qstrdup(result.constData());
+}
+#endif // !QT_NO_VECTOR4D
+
inline bool qCompare(QIcon const &t1, QIcon const &t2, const char *actual, const char *expected,
const char *file, int line)
{
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp
index 57661bb389..b24ce0578e 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -58,9 +58,10 @@ QT_BEGIN_NAMESPACE
referring to this documentation is kind to readers. Comments can also be used
to indicate the reasons for ignoring particular cases.
- A key names a platform, O/S, distribution, tool-chain or architecture; a !
- prefix reverses what it checks. A version, joined to a key (at present, only
- for distributions and for msvc) with a hyphen, limits the key to the specific
+ The key "ci" applies only when run by COIN. Other keys name platforms,
+ operating systems, distributions, tool-chains or architectures; a ! prefix
+ reverses what it checks. A version, joined to a key (at present, only for
+ distributions and for msvc) with a hyphen, limits the key to the specific
version. A keyword line matches if every key on it applies to the present
run. Successive lines are alternate conditions for ignoring a test.
@@ -70,13 +71,18 @@ QT_BEGIN_NAMESPACE
Subsequent lines give conditions for ignoring this test.
# See qtbase/src/testlib/qtestblacklist.cpp for format
- osx
+ # Test doesn't work on QNX at all
+ qnx
# QTBUG-12345
[testFunction]
linux
windows 64bit
+ # Flaky in COIN on macOS, not reproducible by developers
+ [testSlowly]
+ ci osx
+
# Needs basic C++11 support
[testfunction2:testData]
msvc-2010
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 74a5d0ac19..fd68bbe461 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -275,6 +275,11 @@ namespace QTest
static QObject *currentTestObject = 0;
static QString mainSourcePath;
+#if defined(Q_OS_MACOS)
+ bool macNeedsActivate = false;
+ IOPMAssertionID powerID;
+#endif
+
class TestMethods {
Q_DISABLE_COPY(TestMethods)
public:
@@ -1271,6 +1276,16 @@ char *toPrettyCString(const char *p, int length)
return buffer.take();
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+// this used to be the signature up to and including Qt 5.9
+// keep it for BC reasons:
+Q_TESTLIB_EXPORT
+char *toPrettyUnicode(const ushort *p, int length)
+{
+ return toPrettyUnicode(QStringView(p, length));
+}
+#endif
+
/*!
\internal
Returns the same QString but with only the ASCII characters still shown;
@@ -1278,8 +1293,10 @@ char *toPrettyCString(const char *p, int length)
Similar to QDebug::putString().
*/
-char *toPrettyUnicode(const ushort *p, int length)
+char *toPrettyUnicode(QStringView string)
{
+ auto p = reinterpret_cast<const ushort *>(string.utf16());
+ auto length = string.size();
// keep it simple for the vast majority of cases
bool trimmed = false;
QScopedArrayPointer<char> buffer(new char[256]);
@@ -1345,9 +1362,7 @@ void TestMethods::invokeTests(QObject *testObject) const
{
const QMetaObject *metaObject = testObject->metaObject();
QTEST_ASSERT(metaObject);
- QTestLog::startLogging();
QTestResult::setCurrentTestFunction("initTestCase");
- QTestTable::globalTestTable();
if (m_initTestCaseDataMethod.isValid())
m_initTestCaseDataMethod.invoke(testObject, Qt::DirectConnection);
@@ -1392,9 +1407,6 @@ void TestMethods::invokeTests(QObject *testObject) const
}
QTestResult::finishedCurrentTestFunction();
QTestResult::setCurrentTestFunction(0);
- QTestTable::clearGlobalTestTable();
-
- QTestLog::stopLogging();
}
#if defined(Q_OS_UNIX)
@@ -1704,23 +1716,27 @@ static void initEnvironment()
int QTest::qExec(QObject *testObject, int argc, char **argv)
{
- initEnvironment();
- QBenchmarkGlobalData benchmarkData;
- QBenchmarkGlobalData::current = &benchmarkData;
+ qInit(testObject, argc, argv);
+ int ret = qRun();
+ qCleanup();
+ return ret;
+}
-#ifdef QTESTLIB_USE_VALGRIND
- int callgrindChildExitCode = 0;
-#endif
+/*! \internal
+ */
+void QTest::qInit(QObject *testObject, int argc, char **argv)
+{
+ initEnvironment();
+ QBenchmarkGlobalData::current = new QBenchmarkGlobalData;
#if defined(Q_OS_MACX)
- bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
- IOPMAssertionID powerID;
+ macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
// Don't restore saved window state for auto tests.
QTestPrivate::disableWindowRestore();
-#endif
-#ifndef QT_NO_EXCEPTIONS
- try {
+
+ // Disable App Nap which may cause tests to stall.
+ QTestPrivate::AppNapDisabler appNapDisabler;
#endif
#if defined(Q_OS_MACX)
@@ -1751,6 +1767,24 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
qtest_qParseArgs(argc, argv, false);
+ QTestTable::globalTestTable();
+ QTestLog::startLogging();
+}
+
+/*! \internal
+ */
+int QTest::qRun()
+{
+ QTEST_ASSERT(currentTestObject);
+
+#ifdef QTESTLIB_USE_VALGRIND
+ int callgrindChildExitCode = 0;
+#endif
+
+#ifndef QT_NO_EXCEPTIONS
+ try {
+#endif
+
#if defined(Q_OS_WIN)
if (!noCrashHandler) {
# ifndef Q_CC_MINGW
@@ -1786,17 +1820,17 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
for (const QString &tf : qAsConst(QTest::testFunctions)) {
const QByteArray tfB = tf.toLatin1();
const QByteArray signature = tfB + QByteArrayLiteral("()");
- QMetaMethod m = TestMethods::findMethod(testObject, signature.constData());
+ QMetaMethod m = TestMethods::findMethod(currentTestObject, signature.constData());
if (!m.isValid() || !isValidSlot(m)) {
fprintf(stderr, "Unknown test function: '%s'. Possible matches:\n", tfB.constData());
qPrintTestSlots(stderr, tfB.constData());
- fprintf(stderr, "\n%s -functions\nlists all available test functions.\n", argv[0]);
+ fprintf(stderr, "\n%s -functions\nlists all available test functions.\n", QTestResult::currentAppName());
exit(1);
}
commandLineMethods.push_back(m);
}
- TestMethods test(testObject, commandLineMethods);
- test.invokeTests(testObject);
+ TestMethods test(currentTestObject, commandLineMethods);
+ test.invokeTests(currentTestObject);
}
#ifndef QT_NO_EXCEPTIONS
@@ -1821,16 +1855,6 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
}
#endif
- currentTestObject = 0;
-
- QSignalDumper::endDump();
-
-#if defined(Q_OS_MACX)
- if (macNeedsActivate) {
- IOPMAssertionRelease(powerID);
- }
-#endif
-
#ifdef QTESTLIB_USE_VALGRIND
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess)
return callgrindChildExitCode;
@@ -1840,6 +1864,26 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
return qMin(QTestLog::failCount(), 127);
}
+/*! \internal
+ */
+void QTest::qCleanup()
+{
+ currentTestObject = 0;
+
+ QTestTable::clearGlobalTestTable();
+ QTestLog::stopLogging();
+
+ delete QBenchmarkGlobalData::current;
+ QBenchmarkGlobalData::current = 0;
+
+ QSignalDumper::endDump();
+
+#if defined(Q_OS_MACOS)
+ if (macNeedsActivate)
+ IOPMAssertionRelease(powerID);
+#endif
+}
+
/*!
\overload
\since 4.4
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index a59eb4ecb3..b738043cb7 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -259,12 +259,22 @@ namespace QTest
return Internal::toString(t);
}
+ template <typename T1, typename T2>
+ inline char *toString(const QPair<T1, T2> &pair);
+
+ template <typename T1, typename T2>
+ inline char *toString(const std::pair<T1, T2> &pair);
+
Q_TESTLIB_EXPORT char *toHexRepresentation(const char *ba, int length);
Q_TESTLIB_EXPORT char *toPrettyCString(const char *unicode, int length);
- Q_TESTLIB_EXPORT char *toPrettyUnicode(const ushort *unicode, int length);
+ Q_TESTLIB_EXPORT char *toPrettyUnicode(QStringView string);
Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const void *);
+ Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
+ Q_TESTLIB_EXPORT int qRun();
+ Q_TESTLIB_EXPORT void qCleanup();
+
Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
Q_TESTLIB_EXPORT int qExec(QObject *testObject, const QStringList &arguments);
@@ -319,6 +329,8 @@ namespace QTest
Q_TESTLIB_EXPORT QTestData &newRow(const char *dataTag);
Q_TESTLIB_EXPORT QTestData &addRow(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(1, 2);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ // kept after adding implementation of <T1, T2> out of paranoia:
template <typename T>
inline bool qCompare(T const &t1, T const &t2, const char *actual, const char *expected,
const char *file, int line)
@@ -326,6 +338,7 @@ namespace QTest
return compare_helper(t1 == t2, "Compared values are not the same",
toString(t1), toString(t2), actual, expected, file, line);
}
+#endif
Q_TESTLIB_EXPORT bool qCompare(float const &t1, float const &t2,
const char *actual, const char *expected, const char *file, int line);
@@ -376,7 +389,12 @@ namespace QTest
#endif
template <typename T1, typename T2>
- bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int);
+ inline bool qCompare(const T1 &t1, const T2 &t2, const char *actual, const char *expected,
+ const char *file, int line)
+ {
+ return compare_helper(t1 == t2, "Compared values are not the same",
+ toString(t1), toString(t2), actual, expected, file, line);
+ }
inline bool qCompare(double const &t1, float const &t2, const char *actual,
const char *expected, const char *file, int line)
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index 8f3d140add..2d1e27ec40 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -82,11 +82,6 @@
QCOMPARE tries to output the contents of the values if the comparison fails,
so it is visible from the test log why the comparison failed.
- QCOMPARE is very strict on the data types. Both \a actual and \a expected
- have to be of the same type, otherwise the test won't compile. This prohibits
- unspecified behavior from being introduced; that is behavior that usually
- occurs when the compiler implicitly casts the argument.
-
For your own classes, you can use \l QTest::toString() to format values for
outputting into the test log.
@@ -575,6 +570,15 @@
\sa QTest::keyClicks()
*/
+/*! \fn void QTest::keySequence(QWidget *widget, const QKeySequence &keySequence)
+ \overload
+ \since 5.10
+
+ Simulates typing of \a keySequence into a \a widget.
+
+ \sa QTest::keyClick(), QTest::keyClicks()
+*/
+
/*! \fn void QTest::keyClick(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
@@ -611,6 +615,15 @@
\sa QTest::keyClicks()
*/
+/*! \fn void QTest::keySequence(QWindow *window, const QKeySequence &keySequence)
+ \overload
+ \since 5.10
+
+ Simulates typing of \a keySequence into a \a window.
+
+ \sa QTest::keyClick(), QTest::keyClicks()
+*/
+
/*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
Sends a Qt key event to \a widget with the given \a key and an associated \a action.
@@ -1071,6 +1084,10 @@
This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some
time after being asked to show itself on the screen.
+ Note that a window that is mapped to screen may still not be considered exposed if the window client
+ area is completely covered by other windows, or if the window is otherwise not visible. This function
+ will then time out when waiting for such a window.
+
\sa QTest::qWaitForWindowActive(), QWindow::isExposed()
*/
@@ -1093,6 +1110,13 @@
This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some
time after being asked to show itself on the screen.
+ Note that a window that is mapped to screen may still not be considered exposed if the window client
+ area is completely covered by other windows, or if the window is otherwise not visible. This function
+ will then time out when waiting for such a window.
+
+ A specific configuration where this happens is when using QGLWidget as a viewport widget on macOS:
+ The viewport widget gets the expose event, not the parent widget.
+
\sa QTest::qWaitForWindowActive()
*/
diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h
index e750fdb5a9..a7cf78f25a 100644
--- a/src/testlib/qtestkeyboard.h
+++ b/src/testlib/qtestkeyboard.h
@@ -54,6 +54,7 @@
#include <QtGui/qguiapplication.h>
#include <QtGui/qwindow.h>
#include <QtGui/qevent.h>
+#include <QtGui/qkeysequence.h>
#ifdef QT_WIDGETS_LIB
#include <QtWidgets/qwidget.h>
@@ -165,6 +166,15 @@ namespace QTest
Q_DECL_UNUSED inline static void keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
{ keyEvent(Press, window, key, modifier, delay); }
+ Q_DECL_UNUSED inline static void keySequence(QWindow *window, const QKeySequence &keySequence)
+ {
+ for (int i = 0; i < keySequence.count(); ++i) {
+ const Qt::Key key = Qt::Key(keySequence[i] & ~Qt::KeyboardModifierMask);
+ const Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(keySequence[i] & Qt::KeyboardModifierMask);
+ keyClick(window, key, modifiers);
+ }
+ }
+
#ifdef QT_WIDGETS_LIB
static void simulateEvent(QWidget *widget, bool press, int code,
Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1)
@@ -294,6 +304,16 @@ namespace QTest
{ keyEvent(Release, widget, key, modifier, delay); }
inline static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
{ keyEvent(Click, widget, key, modifier, delay); }
+
+ inline static void keySequence(QWidget *widget, const QKeySequence &keySequence)
+ {
+ for (int i = 0; i < keySequence.count(); ++i) {
+ const Qt::Key key = Qt::Key(keySequence[i] & ~Qt::KeyboardModifierMask);
+ const Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(keySequence[i] & Qt::KeyboardModifierMask);
+ keyClick(widget, key, modifiers);
+ }
+ }
+
#endif // QT_WIDGETS_LIB
}
diff --git a/src/testlib/qtestutil_macos.mm b/src/testlib/qtestutil_macos.mm
index 70a7fb9f85..7579c3b164 100644
--- a/src/testlib/qtestutil_macos.mm
+++ b/src/testlib/qtestutil_macos.mm
@@ -54,6 +54,33 @@ namespace QTestPrivate {
void disableWindowRestore() {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"ApplePersistenceIgnoreState"];
}
+
+ /*! \internal
+ \class AppNapDisabler
+ \brief Disables App Nap by registereing a bacground activity.
+
+ App Nap remains disabled as long as the AppNapDisabler instance
+ exists.
+ */
+
+ /*! \internal
+ Creates an AppNapDisabler instance and starts a NSActivityBackground activity.
+ */
+ AppNapDisabler::AppNapDisabler()
+ {
+ m_activity = [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityBackground
+ reason:@"Qt Auto Test"];
+ [m_activity retain];
+ }
+
+ /*! \internal
+ Destroys the AppNapDisabler instance and ends the NSActivityBackground activity.
+ */
+ AppNapDisabler::~AppNapDisabler()
+ {
+ [[NSProcessInfo processInfo] endActivity:m_activity];
+ [m_activity release];
+ }
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestutil_macos_p.h b/src/testlib/qtestutil_macos_p.h
index d7cc5bc251..36f27167c0 100644
--- a/src/testlib/qtestutil_macos_p.h
+++ b/src/testlib/qtestutil_macos_p.h
@@ -58,6 +58,17 @@ QT_BEGIN_NAMESPACE
namespace QTestPrivate {
void disableWindowRestore();
+
+ class AppNapDisabler
+ {
+ public:
+ AppNapDisabler();
+ ~AppNapDisabler();
+ AppNapDisabler(const AppNapDisabler&) = delete;
+ AppNapDisabler& operator=(const AppNapDisabler&) = delete;
+ private:
+ id m_activity;
+ };
}
QT_END_NAMESPACE
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 521dd5f0f2..dedb4ff138 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -29,6 +29,7 @@ SOURCES += \
../../corelib/global/qmalloc.cpp \
../../corelib/global/qnumeric.cpp \
../../corelib/global/qoperatingsystemversion.cpp \
+ ../../corelib/global/qrandom.cpp \
../../corelib/io/qabstractfileengine.cpp \
../../corelib/io/qbuffer.cpp \
../../corelib/io/qdatastream.cpp \
@@ -93,7 +94,8 @@ SOURCES += \
../../xml/dom/qdom.cpp \
../../xml/sax/qxml.cpp
-unix:SOURCES += ../../corelib/io/qfilesystemengine_unix.cpp \
+unix:SOURCES += ../../corelib/kernel/qcore_unix.cpp \
+ ../../corelib/io/qfilesystemengine_unix.cpp \
../../corelib/io/qfilesystemiterator_unix.cpp \
../../corelib/io/qfsfileengine_unix.cpp
@@ -137,7 +139,7 @@ macx {
}
win32 {
- LIBS += -luser32 -lole32 -ladvapi32 -lshell32
+ LIBS += -luser32 -lole32 -ladvapi32 -lshell32 -lnetapi32
mingw: LIBS += -luuid
}
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index c4184929ef..0b45776b88 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -218,6 +218,7 @@ void Generator::generateCode()
registerFunctionStrings(cdef->slotList);
registerFunctionStrings(cdef->methodList);
registerFunctionStrings(cdef->constructorList);
+ registerByteArrayVector(cdef->nonClassSignalList);
registerPropertyStrings();
registerEnumStrings();
@@ -603,6 +604,19 @@ void Generator::generateCode()
// Generate plugin meta data
//
generatePluginMetaData();
+
+//
+// Generate function to make sure the non-class signals exist in the parent classes
+//
+ if (!cdef->nonClassSignalList.isEmpty()) {
+ fprintf(out, "// If you get a compile error in this function it can be because either\n");
+ fprintf(out, "// a) You are using a NOTIFY signal that does not exist. Fix it.\n");
+ fprintf(out, "// b) You are using a NOTIFY signal that does exist (in a parent class) but has a non-empty parameter list. This is a moc limitation.\n");
+ fprintf(out, "Q_DECL_UNUSED static void checkNotifySignalValidity_%s(%s *t) {\n", qualifiedClassNameIdentifier.constData(), cdef->qualified.constData());
+ for (const QByteArray &nonClassSignal : cdef->nonClassSignalList)
+ fprintf(out, " t->%s();\n", nonClassSignal.constData());
+ fprintf(out, "}\n");
+ }
}
@@ -648,6 +662,12 @@ void Generator::registerFunctionStrings(const QVector<FunctionDef>& list)
}
}
+void Generator::registerByteArrayVector(const QVector<QByteArray> &list)
+{
+ for (const QByteArray &ba : list)
+ strreg(ba);
+}
+
void Generator::generateFunctions(const QVector<FunctionDef>& list, const char *functype, int type, int &paramsIndex)
{
if (list.isEmpty())
@@ -841,12 +861,17 @@ void Generator::generateProperties()
fprintf(out, "\n // properties: notify_signal_id\n");
for (int i = 0; i < cdef->propertyList.count(); ++i) {
const PropertyDef &p = cdef->propertyList.at(i);
- if(p.notifyId == -1)
+ if (p.notifyId == -1) {
fprintf(out, " %4d,\n",
0);
- else
+ } else if (p.notifyId > -1) {
fprintf(out, " %4d,\n",
p.notifyId);
+ } else {
+ const int indexInStrings = strings.indexOf(p.notify);
+ fprintf(out, " %4d,\n",
+ indexInStrings | IsUnresolvedSignal);
+ }
}
}
if (cdef->revisionedProperties) {
@@ -1401,13 +1426,15 @@ void Generator::generateStaticMetacall()
prefix.constData(), p.member.constData(), p.type.constData());
fprintf(out, " %s%s = *reinterpret_cast< %s*>(_v);\n",
prefix.constData(), p.member.constData(), p.type.constData());
- if (!p.notify.isEmpty() && p.notifyId != -1) {
+ if (!p.notify.isEmpty() && p.notifyId > -1) {
const FunctionDef &f = cdef->signalList.at(p.notifyId);
if (f.arguments.size() == 0)
fprintf(out, " Q_EMIT _t->%s();\n", p.notify.constData());
else if (f.arguments.size() == 1 && f.arguments.at(0).normalizedType == p.type)
fprintf(out, " Q_EMIT _t->%s(%s%s);\n",
p.notify.constData(), prefix.constData(), p.member.constData());
+ } else if (!p.notify.isEmpty() && p.notifyId < -1) {
+ fprintf(out, " Q_EMIT _t->%s();\n", p.notify.constData());
}
fprintf(out, " }\n");
fprintf(out, " break;\n");
diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h
index 3833148fb3..8b80138302 100644
--- a/src/tools/moc/generator.h
+++ b/src/tools/moc/generator.h
@@ -46,6 +46,7 @@ private:
void registerClassInfoStrings();
void generateClassInfos();
void registerFunctionStrings(const QVector<FunctionDef> &list);
+ void registerByteArrayVector(const QVector<QByteArray> &list);
void generateFunctions(const QVector<FunctionDef> &list, const char *functype, int type, int &paramsIndex);
void generateFunctionRevisions(const QVector<FunctionDef> &list, const char *functype);
void generateFunctionParameters(const QVector<FunctionDef> &list, const char *functype);
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index b30de66258..18945f1ce5 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -395,9 +395,9 @@ int runMoc(int argc, char **argv)
pp.macros.remove(macro);
}
const QStringList noNotesCompatValues = parser.values(noNotesWarningsCompatOption);
- if (parser.isSet(noNotesOption) || noNotesCompatValues.contains(QStringLiteral("n")))
+ if (parser.isSet(noNotesOption) || noNotesCompatValues.contains(QLatin1String("n")))
moc.displayNotes = false;
- if (parser.isSet(noWarningsOption) || noNotesCompatValues.contains(QStringLiteral("w")))
+ if (parser.isSet(noWarningsOption) || noNotesCompatValues.contains(QLatin1String("w")))
moc.displayWarnings = moc.displayNotes = false;
if (autoInclude) {
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 4d3ccb8680..b9f71ddb15 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1730,9 +1730,13 @@ void Moc::checkProperties(ClassDef *cdef)
}
p.notifyId = notifyId;
if (notifyId == -1) {
- QByteArray msg = "NOTIFY signal '" + p.notify + "' of property '" + p.name
- + "' does not exist in class " + cdef->classname + ".";
- error(msg.constData());
+ int index = cdef->nonClassSignalList.indexOf(p.notify);
+ if (index == -1) {
+ cdef->nonClassSignalList << p.notify;
+ p.notifyId = -1 - cdef->nonClassSignalList.count();
+ } else {
+ p.notifyId = -2 - index;
+ }
}
}
}
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index 6040f944f3..5f8cdfcf2c 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -121,7 +121,7 @@ struct PropertyDef
{
PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec), revision(0){}
QByteArray name, type, member, read, write, reset, designable, scriptable, editable, stored, user, notify, inPrivateClass;
- int notifyId;
+ int notifyId; // -1 means no notifyId, >= 0 means signal defined in this class, < -1 means signal not defined in this class
bool constant;
bool final;
enum Specification { ValueSpec, ReferenceSpec, PointerSpec };
@@ -179,6 +179,7 @@ struct ClassDef : BaseDef {
QVector<FunctionDef> constructorList;
QVector<FunctionDef> signalList, slotList, methodList, publicList;
+ QVector<QByteArray> nonClassSignalList;
int notifyableProperties = 0;
QVector<PropertyDef> propertyList;
int revisionedMethods = 0;
diff --git a/src/tools/moc/moc.pro b/src/tools/moc/moc.pro
index ccd29341d0..8f66a428c1 100644
--- a/src/tools/moc/moc.pro
+++ b/src/tools/moc/moc.pro
@@ -12,4 +12,5 @@ include(moc.pri)
HEADERS += qdatetime_p.h
SOURCES += main.cpp
+QMAKE_TARGET_DESCRIPTION = "Qt Meta Object Compiler"
load(qt_tool)
diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
index 5ac3159797..d0e8cfdf24 100644
--- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
+++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
@@ -9,4 +9,5 @@ include(../moc/moc.pri)
SOURCES += qdbuscpp2xml.cpp
+QMAKE_TARGET_DESCRIPTION = "Qt D-Bus C++ to XML Compiler"
load(qt_tool)
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
index 95fcbcbc50..8468d2ab44 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
@@ -12,4 +12,5 @@ QMAKE_CXXFLAGS += $$QT_HOST_CFLAGS_DBUS
SOURCES = qdbusxml2cpp.cpp
+QMAKE_TARGET_DESCRIPTION = "Qt D-Bus XML to C++ Compiler"
load(qt_tool)
diff --git a/src/tools/qlalr/qlalr.pro b/src/tools/qlalr/qlalr.pro
index bd5f337c64..ce0f4a4f59 100644
--- a/src/tools/qlalr/qlalr.pro
+++ b/src/tools/qlalr/qlalr.pro
@@ -25,4 +25,5 @@ OTHER_FILES += \
DEFINES += \
QT_NO_FOREACH
+QMAKE_TARGET_DESCRIPTION = "Qt Look Ahead LR Parser"
load(qt_tool)
diff --git a/src/tools/qvkgen/qvkgen.cpp b/src/tools/qvkgen/qvkgen.cpp
new file mode 100644
index 0000000000..059f9413cb
--- /dev/null
+++ b/src/tools/qvkgen/qvkgen.cpp
@@ -0,0 +1,530 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/qcoreapplication.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qxmlstream.h>
+
+class VkSpecParser
+{
+public:
+ bool parse();
+
+ struct TypedName {
+ QString name;
+ QString type;
+ QString typeSuffix;
+ };
+
+ struct Command {
+ TypedName cmd;
+ QVector<TypedName> args;
+ bool deviceLevel;
+ };
+
+ QVector<Command> commands() const { return m_commands; }
+
+ void setFileName(const QString &fn) { m_fn = fn; }
+
+private:
+ void skip();
+ void parseCommands();
+ Command parseCommand();
+ TypedName parseParamOrProto(const QString &tag);
+ QString parseName();
+
+ QFile m_file;
+ QXmlStreamReader m_reader;
+ QVector<Command> m_commands;
+ QString m_fn;
+};
+
+bool VkSpecParser::parse()
+{
+ m_file.setFileName(m_fn);
+ if (!m_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qWarning("Failed to open %s", qPrintable(m_file.fileName()));
+ return false;
+ }
+
+ m_reader.setDevice(&m_file);
+ while (!m_reader.atEnd()) {
+ m_reader.readNext();
+ if (m_reader.isStartElement()) {
+ if (m_reader.name() == QStringLiteral("commands"))
+ parseCommands();
+ }
+ }
+
+ return true;
+}
+
+void VkSpecParser::skip()
+{
+ QString tag = m_reader.name().toString();
+ while (!m_reader.atEnd()) {
+ m_reader.readNext();
+ if (m_reader.isEndElement() && m_reader.name() == tag)
+ break;
+ }
+}
+
+void VkSpecParser::parseCommands()
+{
+ m_commands.clear();
+
+ while (!m_reader.atEnd()) {
+ m_reader.readNext();
+ if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("commands"))
+ return;
+ if (m_reader.isStartElement() && m_reader.name() == "command")
+ m_commands.append(parseCommand());
+ }
+}
+
+VkSpecParser::Command VkSpecParser::parseCommand()
+{
+ Command c;
+
+ while (!m_reader.atEnd()) {
+ m_reader.readNext();
+ if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("command"))
+ break;
+ if (m_reader.isStartElement()) {
+ const QString protoStr = QStringLiteral("proto");
+ const QString paramStr = QStringLiteral("param");
+ if (m_reader.name() == protoStr) {
+ c.cmd = parseParamOrProto(protoStr);
+ } else if (m_reader.name() == paramStr) {
+ c.args.append(parseParamOrProto(paramStr));
+ } else {
+ skip();
+ }
+ }
+ }
+
+ c.deviceLevel = false;
+ if (!c.args.isEmpty()) {
+ QStringList dispatchableDeviceAndChildTypes {
+ QStringLiteral("VkDevice"),
+ QStringLiteral("VkQueue"),
+ QStringLiteral("VkCommandBuffer")
+ };
+ if (dispatchableDeviceAndChildTypes.contains(c.args[0].type)
+ && c.cmd.name != QStringLiteral("vkGetDeviceProcAddr"))
+ {
+ c.deviceLevel = true;
+ }
+ }
+
+ return c;
+}
+
+VkSpecParser::TypedName VkSpecParser::parseParamOrProto(const QString &tag)
+{
+ TypedName t;
+
+ while (!m_reader.atEnd()) {
+ m_reader.readNext();
+ if (m_reader.isEndElement() && m_reader.name() == tag)
+ break;
+ if (m_reader.isStartElement()) {
+ if (m_reader.name() == QStringLiteral("name")) {
+ t.name = parseName();
+ } else if (m_reader.name() != QStringLiteral("type")) {
+ skip();
+ }
+ } else {
+ QStringRef text = m_reader.text().trimmed();
+ if (!text.isEmpty()) {
+ if (text.startsWith(QLatin1Char('['))) {
+ t.typeSuffix += text;
+ } else {
+ if (!t.type.isEmpty())
+ t.type += QLatin1Char(' ');
+ t.type += text;
+ }
+ }
+ }
+ }
+
+ return t;
+}
+
+QString VkSpecParser::parseName()
+{
+ QString name;
+ while (!m_reader.atEnd()) {
+ m_reader.readNext();
+ if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("name"))
+ break;
+ name += m_reader.text();
+ }
+ return name.trimmed();
+}
+
+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));
+ 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 += QLatin1Char(')');
+ }
+ return s;
+}
+
+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);
+ if (!c.args.isEmpty()) {
+ s += QLatin1Char('(');
+ bool first = true;
+ for (const VkSpecParser::TypedName &a : c.args) {
+ if (!first)
+ s += QStringLiteral(", ");
+ else
+ first = false;
+ s += a.name;
+ }
+ s += QLatin1Char(')');
+ }
+ return s;
+}
+
+class Preamble
+{
+public:
+ QByteArray get(const QString &fn);
+
+private:
+ QByteArray m_str;
+} preamble;
+
+QByteArray Preamble::get(const QString &fn)
+{
+ if (!m_str.isEmpty())
+ return m_str;
+
+ QFile f(fn);
+ if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qWarning("Failed to open %s", qPrintable(fn));
+ return m_str;
+ }
+
+ m_str = f.readAll();
+ m_str.replace("FOO", "QtGui");
+ m_str += "\n// This file is automatically generated by qvkgen. Do not edit.\n";
+
+ return m_str;
+}
+
+bool genVulkanFunctionsH(const QVector<VkSpecParser::Command> &commands, const QString &licHeaderFn, const QString &outputBase)
+{
+ QFile f(outputBase + QStringLiteral(".h"));
+ if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ qWarning("Failed to write %s", qPrintable(f.fileName()));
+ return false;
+ }
+
+ static const char *s =
+"%s\n"
+"#ifndef QVULKANFUNCTIONS_H\n"
+"#define QVULKANFUNCTIONS_H\n"
+"\n"
+"#include <QtGui/qtguiglobal.h>\n"
+"\n"
+"#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)\n"
+"\n"
+"#ifndef VK_NO_PROTOTYPES\n"
+"#define VK_NO_PROTOTYPES\n"
+"#endif\n"
+"#include <vulkan/vulkan.h>\n"
+"\n"
+"#include <QtCore/qscopedpointer.h>\n"
+"\n"
+"QT_BEGIN_NAMESPACE\n"
+"\n"
+"class QVulkanInstance;\n"
+"class QVulkanFunctionsPrivate;\n"
+"class QVulkanDeviceFunctionsPrivate;\n"
+"\n"
+"class Q_GUI_EXPORT QVulkanFunctions\n"
+"{\n"
+"public:\n"
+" ~QVulkanFunctions();\n"
+"\n"
+"%s\n"
+"private:\n"
+" Q_DISABLE_COPY(QVulkanFunctions)\n"
+" QVulkanFunctions(QVulkanInstance *inst);\n"
+"\n"
+" QScopedPointer<QVulkanFunctionsPrivate> d_ptr;\n"
+" friend class QVulkanInstance;\n"
+"};\n"
+"\n"
+"class Q_GUI_EXPORT QVulkanDeviceFunctions\n"
+"{\n"
+"public:\n"
+" ~QVulkanDeviceFunctions();\n"
+"\n"
+"%s\n"
+"private:\n"
+" Q_DISABLE_COPY(QVulkanDeviceFunctions)\n"
+" QVulkanDeviceFunctions(QVulkanInstance *inst, VkDevice device);\n"
+"\n"
+" QScopedPointer<QVulkanDeviceFunctionsPrivate> d_ptr;\n"
+" friend class QVulkanInstance;\n"
+"};\n"
+"\n"
+"QT_END_NAMESPACE\n"
+"\n"
+"#endif // QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)\n"
+"\n"
+"#endif // QVULKANFUNCTIONS_H\n";
+
+ QString instCmdStr;
+ QString devCmdStr;
+ for (const VkSpecParser::Command &c : commands) {
+ QString *dst = c.deviceLevel ? &devCmdStr : &instCmdStr;
+ *dst += QStringLiteral(" ");
+ *dst += funcSig(c);
+ *dst += QStringLiteral(";\n");
+ }
+
+ QString str;
+ str.sprintf(s, preamble.get(licHeaderFn).constData(), instCmdStr.toUtf8().constData(), devCmdStr.toUtf8().constData());
+
+ f.write(str.toUtf8());
+
+ return true;
+}
+
+bool genVulkanFunctionsPH(const QVector<VkSpecParser::Command> &commands, const QString &licHeaderFn, const QString &outputBase)
+{
+ QFile f(outputBase + QStringLiteral("_p.h"));
+ if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ qWarning("Failed to write %s", qPrintable(f.fileName()));
+ return false;
+ }
+
+ static const char *s =
+"%s\n"
+"#ifndef QVULKANFUNCTIONS_P_H\n"
+"#define QVULKANFUNCTIONS_P_H\n"
+"\n"
+"//\n"
+"// W A R N I N G\n"
+"// -------------\n"
+"//\n"
+"// This file is not part of the Qt API. It exists purely as an\n"
+"// implementation detail. This header file may change from version to\n"
+"// version without notice, or even be removed.\n"
+"//\n"
+"// We mean it.\n"
+"//\n"
+"\n"
+"#include \"qvulkanfunctions.h\"\n"
+"\n"
+"QT_BEGIN_NAMESPACE\n"
+"\n"
+"class QVulkanInstance;\n"
+"\n"
+"class QVulkanFunctionsPrivate\n"
+"{\n"
+"public:\n"
+" QVulkanFunctionsPrivate(QVulkanInstance *inst);\n"
+"\n"
+" PFN_vkVoidFunction m_funcs[%d];\n"
+"};\n"
+"\n"
+"class QVulkanDeviceFunctionsPrivate\n"
+"{\n"
+"public:\n"
+" QVulkanDeviceFunctionsPrivate(QVulkanInstance *inst, VkDevice device);\n"
+"\n"
+" PFN_vkVoidFunction m_funcs[%d];\n"
+"};\n"
+"\n"
+"QT_END_NAMESPACE\n"
+"\n"
+"#endif // QVULKANFUNCTIONS_P_H\n";
+
+ const int devLevelCount = std::count_if(commands.cbegin(), commands.cend(),
+ [](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());
+
+ return true;
+}
+
+bool genVulkanFunctionsPC(const QVector<VkSpecParser::Command> &commands, const QString &licHeaderFn, const QString &outputBase)
+{
+ QFile f(outputBase + QStringLiteral("_p.cpp"));
+ if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ qWarning("Failed to write %s", qPrintable(f.fileName()));
+ return false;
+ }
+
+ static const char *s =
+"%s\n"
+"#include \"qvulkanfunctions_p.h\"\n"
+"#include \"qvulkaninstance.h\"\n"
+"\n"
+"QT_BEGIN_NAMESPACE\n"
+"\n%s"
+"QVulkanFunctionsPrivate::QVulkanFunctionsPrivate(QVulkanInstance *inst)\n"
+"{\n"
+" static const char *funcNames[] = {\n"
+"%s\n"
+" };\n"
+" for (int i = 0; i < %d; ++i) {\n"
+" m_funcs[i] = inst->getInstanceProcAddr(funcNames[i]);\n"
+" if (!m_funcs[i])\n"
+" qWarning(\"QVulkanFunctions: Failed to resolve %%s\", funcNames[i]);\n"
+" }\n"
+"}\n"
+"\n%s"
+"QVulkanDeviceFunctionsPrivate::QVulkanDeviceFunctionsPrivate(QVulkanInstance *inst, VkDevice device)\n"
+"{\n"
+" QVulkanFunctions *f = inst->functions();\n"
+" Q_ASSERT(f);\n\n"
+" static const char *funcNames[] = {\n"
+"%s\n"
+" };\n"
+" for (int i = 0; i < %d; ++i) {\n"
+" m_funcs[i] = f->vkGetDeviceProcAddr(device, funcNames[i]);\n"
+" if (!m_funcs[i])\n"
+" qWarning(\"QVulkanDeviceFunctions: Failed to resolve %%s\", funcNames[i]);\n"
+" }\n"
+"}\n"
+"\n"
+"QT_END_NAMESPACE\n";
+
+ QString devCmdWrapperStr;
+ QString instCmdWrapperStr;
+ int devIdx = 0;
+ int instIdx = 0;
+ QString devCmdNamesStr;
+ QString instCmdNamesStr;
+
+ for (int i = 0; i < commands.count(); ++i) {
+ QString *dst = commands[i].deviceLevel ? &devCmdWrapperStr : &instCmdWrapperStr;
+ int *idx = commands[i].deviceLevel ? &devIdx : &instIdx;
+ *dst += funcSig(commands[i], commands[i].deviceLevel ? "QVulkanDeviceFunctions" : "QVulkanFunctions");
+ *dst += QString(QStringLiteral("\n{\n Q_ASSERT(d_ptr->m_funcs[%1]);\n ")).arg(*idx);
+ *dst += funcCall(commands[i], *idx);
+ *dst += QStringLiteral(";\n}\n\n");
+ ++*idx;
+
+ dst = commands[i].deviceLevel ? &devCmdNamesStr : &instCmdNamesStr;
+ *dst += QStringLiteral(" \"");
+ *dst += commands[i].cmd.name;
+ *dst += QStringLiteral("\",\n");
+ }
+
+ if (devCmdNamesStr.count() > 2)
+ devCmdNamesStr = devCmdNamesStr.left(devCmdNamesStr.count() - 2);
+ 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);
+
+ f.write(str.toUtf8());
+
+ return true;
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+ VkSpecParser parser;
+
+ if (argc < 4) {
+ qWarning("Usage: qvkgen input_vk_xml input_license_header output_base\n"
+ " For example: qvkgen vulkan/vk.xml vulkan/qvulkanfunctions.header vulkan/qvulkanfunctions");
+ return 1;
+ }
+
+ parser.setFileName(QString::fromUtf8(argv[1]));
+
+ if (!parser.parse())
+ return 1;
+
+ QVector<VkSpecParser::Command> commands = parser.commands();
+ QStringList ignoredFuncs {
+ QStringLiteral("vkCreateInstance"),
+ QStringLiteral("vkDestroyInstance"),
+ QStringLiteral("vkGetInstanceProcAddr")
+ };
+
+ // Filter out extensions and unwanted functions.
+ // The check for the former is rather simplistic for now: skip if the last letter is uppercase...
+ for (int i = 0; i < commands.count(); ++i) {
+ QString name = commands[i].cmd.name;
+ QChar c = name[name.count() - 1];
+ if (c.isUpper() || ignoredFuncs.contains(name))
+ commands.remove(i--);
+ }
+
+ QString licenseHeaderFileName = QString::fromUtf8(argv[2]);
+ QString outputBase = QString::fromUtf8(argv[3]);
+ genVulkanFunctionsH(commands, licenseHeaderFileName, outputBase);
+ genVulkanFunctionsPH(commands, licenseHeaderFileName, outputBase);
+ genVulkanFunctionsPC(commands, licenseHeaderFileName, outputBase);
+
+ return 0;
+}
diff --git a/src/tools/qvkgen/qvkgen.pro b/src/tools/qvkgen/qvkgen.pro
new file mode 100644
index 0000000000..0428fdfe08
--- /dev/null
+++ b/src/tools/qvkgen/qvkgen.pro
@@ -0,0 +1,6 @@
+option(host_build)
+
+SOURCES += qvkgen.cpp
+
+QMAKE_TARGET_DESCRIPTION = "Qt Vulkan Header Generator"
+load(qt_tool)
diff --git a/src/tools/rcc/rcc.pro b/src/tools/rcc/rcc.pro
index 701f15ff22..208ec54a73 100644
--- a/src/tools/rcc/rcc.pro
+++ b/src/tools/rcc/rcc.pro
@@ -6,4 +6,5 @@ DEFINES += QT_RCC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
include(rcc.pri)
SOURCES += main.cpp
+QMAKE_TARGET_DESCRIPTION = "Qt Resource Compiler"
load(qt_tool)
diff --git a/src/tools/uic/cpp/cpp.pri b/src/tools/uic/cpp/cpp.pri
index 49c71a6dfa..a6b6188117 100644
--- a/src/tools/uic/cpp/cpp.pri
+++ b/src/tools/uic/cpp/cpp.pri
@@ -3,18 +3,10 @@ INCLUDEPATH += $$PWD $$QT_BUILD_TREE/src/tools/uic
DEFINES += QT_UIC_CPP_GENERATOR
# Input
-HEADERS += $$PWD/cppextractimages.h \
- $$PWD/cppwritedeclaration.h \
- $$PWD/cppwriteicondata.h \
- $$PWD/cppwriteicondeclaration.h \
- $$PWD/cppwriteiconinitialization.h \
+HEADERS += $$PWD/cppwritedeclaration.h \
$$PWD/cppwriteincludes.h \
$$PWD/cppwriteinitialization.h
-SOURCES += $$PWD/cppextractimages.cpp \
- $$PWD/cppwritedeclaration.cpp \
- $$PWD/cppwriteicondata.cpp \
- $$PWD/cppwriteicondeclaration.cpp \
- $$PWD/cppwriteiconinitialization.cpp \
+SOURCES += $$PWD/cppwritedeclaration.cpp \
$$PWD/cppwriteincludes.cpp \
$$PWD/cppwriteinitialization.cpp
diff --git a/src/tools/uic/cpp/cppextractimages.cpp b/src/tools/uic/cpp/cppextractimages.cpp
deleted file mode 100644
index 4d06d08dae..0000000000
--- a/src/tools/uic/cpp/cppextractimages.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** 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 "cppextractimages.h"
-#include "cppwriteicondata.h"
-#include "driver.h"
-#include "ui4.h"
-#include "utils.h"
-#include "uic.h"
-
-#include <qtextstream.h>
-#include <qtextcodec.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace CPP {
-
-ExtractImages::ExtractImages(const Option &opt)
- : m_output(0), m_option(opt)
-{
-}
-
-void ExtractImages::acceptUI(DomUI *node)
-{
- if (!m_option.extractImages)
- return;
-
- if (node->elementImages() == 0)
- return;
-
- QString className = node->elementClass() + m_option.postfix;
-
- QFile f;
- if (m_option.qrcOutputFile.size()) {
- f.setFileName(m_option.qrcOutputFile);
- if (!f.open(QIODevice::WriteOnly | QFile::Text)) {
- fprintf(stderr, "%s: Error: Could not create resource file\n", qPrintable(m_option.messagePrefix()));
- return;
- }
-
- QFileInfo fi(m_option.qrcOutputFile);
- QDir dir = fi.absoluteDir();
- if (!dir.exists(QLatin1String("images")) && !dir.mkdir(QLatin1String("images"))) {
- fprintf(stderr, "%s: Error: Could not create image dir\n", qPrintable(m_option.messagePrefix()));
- return;
- }
- dir.cd(QLatin1String("images"));
- m_imagesDir = dir;
-
- m_output = new QTextStream(&f);
-#ifndef QT_NO_TEXTCODEC
- m_output->setCodec(QTextCodec::codecForName("UTF-8"));
-#endif
-
- QTextStream &out = *m_output;
-
- out << "<RCC>\n";
- out << " <qresource prefix=\"/" << className << "\" >\n";
- TreeWalker::acceptUI(node);
- out << " </qresource>\n";
- out << "</RCC>\n";
-
- f.close();
- delete m_output;
- m_output = 0;
- }
-}
-
-void ExtractImages::acceptImages(DomImages *images)
-{
- TreeWalker::acceptImages(images);
-}
-
-void ExtractImages::acceptImage(DomImage *image)
-{
- QString format = image->elementData()->attributeFormat();
- QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower();
- QString fname = m_imagesDir.absoluteFilePath(image->attributeName() + QLatin1Char('.') + extension);
-
- *m_output << " <file>images/" << image->attributeName() << QLatin1Char('.') + extension << "</file>\n";
-
- QFile f;
- f.setFileName(fname);
- const bool isXPM_GZ = format == QLatin1String("XPM.GZ");
- QIODevice::OpenMode openMode = QIODevice::WriteOnly;
- if (isXPM_GZ)
- openMode |= QIODevice::Text;
- if (!f.open(openMode)) {
- fprintf(stderr, "%s: Error: Could not create image file %s: %s",
- qPrintable(m_option.messagePrefix()),
- qPrintable(fname), qPrintable(f.errorString()));
- return;
- }
-
- if (isXPM_GZ) {
- QTextStream *imageOut = new QTextStream(&f);
-#ifndef QT_NO_TEXTCODEC
- imageOut->setCodec(QTextCodec::codecForName("UTF-8"));
-#endif
-
- CPP::WriteIconData::writeImage(*imageOut, QString(), m_option.limitXPM_LineLength, image);
- delete imageOut;
- } else {
- CPP::WriteIconData::writeImage(f, image);
- }
-
- f.close();
-}
-
-} // namespace CPP
-
-QT_END_NAMESPACE
diff --git a/src/tools/uic/cpp/cppextractimages.h b/src/tools/uic/cpp/cppextractimages.h
deleted file mode 100644
index d012de8d0a..0000000000
--- a/src/tools/uic/cpp/cppextractimages.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef CPPEXTRACTIMAGES_H
-#define CPPEXTRACTIMAGES_H
-
-#include "treewalker.h"
-#include <qdir.h>
-
-QT_BEGIN_NAMESPACE
-
-class QTextStream;
-class Driver;
-class Uic;
-
-struct Option;
-
-namespace CPP {
-
-class ExtractImages : public TreeWalker
-{
-public:
- ExtractImages(const Option &opt);
-
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptImages(DomImages *images) Q_DECL_OVERRIDE;
- void acceptImage(DomImage *image) Q_DECL_OVERRIDE;
-
-private:
- QTextStream *m_output;
- const Option &m_option;
- QDir m_imagesDir;
-};
-
-} // namespace CPP
-
-QT_END_NAMESPACE
-
-#endif // CPPEXTRACTIMAGES_H
diff --git a/src/tools/uic/cpp/cppwritedeclaration.cpp b/src/tools/uic/cpp/cppwritedeclaration.cpp
index 3aadc878e3..e384a1e194 100644
--- a/src/tools/uic/cpp/cppwritedeclaration.cpp
+++ b/src/tools/uic/cpp/cppwritedeclaration.cpp
@@ -27,10 +27,7 @@
****************************************************************************/
#include "cppwritedeclaration.h"
-#include "cppwriteicondeclaration.h"
#include "cppwriteinitialization.h"
-#include "cppwriteiconinitialization.h"
-#include "cppextractimages.h"
#include "driver.h"
#include "ui4.h"
#include "uic.h"
@@ -56,47 +53,15 @@ namespace {
output << "} // namespace " << *it << "\n";
}
}
-
- void writeScriptContextClass(const QString &indent, QTextStream &str) {
- str << indent << "class ScriptContext\n"
- << indent << "{\n"
- << indent << "public:\n"
- << indent << " void run(const QString &script, QWidget *widget, const QWidgetList &childWidgets)\n"
- << indent << " {\n"
- << indent << " QScriptValue widgetObject = scriptEngine.newQObject(widget);\n"
- << indent << " QScriptValue childWidgetArray = scriptEngine.newArray (childWidgets.size());\n"
- << indent << " for (int i = 0; i < childWidgets.size(); i++)\n"
- << indent << " childWidgetArray.setProperty(i, scriptEngine.newQObject(childWidgets[i]));\n"
- << indent << " QScriptContext *ctx = scriptEngine.pushContext();\n"
- << indent << " ctx ->activationObject().setProperty(QLatin1String(\"widget\"), widgetObject);\n"
- << indent << " ctx ->activationObject().setProperty(QLatin1String(\"childWidgets\"), childWidgetArray);\n\n"
- << indent << " scriptEngine.evaluate(script);\n"
- << indent << " if (scriptEngine.hasUncaughtException ()) {\n"
- << indent << " qWarning() << \"An exception occurred at line \" << scriptEngine.uncaughtExceptionLineNumber()\n"
- << indent << " << \" of the script for \" << widget->objectName() << \": \" << engineError() << '\\n'\n"
- << indent << " << script;\n"
- << indent << " }\n\n"
- << indent << " scriptEngine.popContext();\n"
- << indent << " }\n\n"
- << indent << "private:\n"
- << indent << " QString engineError()\n"
- << indent << " {\n"
- << indent << " QScriptValue error = scriptEngine.evaluate(\"Error\");\n"
- << indent << " return error.toString();\n"
- << indent << " }\n\n"
- << indent << " QScriptEngine scriptEngine;\n"
- << indent << "};\n\n";
- }
}
namespace CPP {
-WriteDeclaration::WriteDeclaration(Uic *uic, bool activateScripts) :
+WriteDeclaration::WriteDeclaration(Uic *uic) :
m_uic(uic),
m_driver(uic->driver()),
m_output(uic->output()),
- m_option(uic->option()),
- m_activateScripts(activateScripts)
+ m_option(uic->option())
{
}
@@ -154,29 +119,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
m_output << "\n";
- WriteInitialization(m_uic, m_activateScripts).acceptUI(node);
-
- if (node->elementImages()) {
- if (m_option.extractImages) {
- ExtractImages(m_uic->option()).acceptUI(node);
- } else {
- m_output << "\n"
- << "protected:\n"
- << m_option.indent << "enum IconID\n"
- << m_option.indent << "{\n";
- WriteIconDeclaration(m_uic).acceptUI(node);
-
- m_output << m_option.indent << m_option.indent << "unknown_ID\n"
- << m_option.indent << "};\n";
-
- WriteIconInitialization(m_uic).acceptUI(node);
- }
- }
-
- if (m_activateScripts) {
- m_output << "\nprivate:\n\n";
- writeScriptContextClass(m_option.indent, m_output);
- }
+ WriteInitialization(m_uic).acceptUI(node);
m_output << "};\n\n";
diff --git a/src/tools/uic/cpp/cppwritedeclaration.h b/src/tools/uic/cpp/cppwritedeclaration.h
index baa57c5978..ca2122293c 100644
--- a/src/tools/uic/cpp/cppwritedeclaration.h
+++ b/src/tools/uic/cpp/cppwritedeclaration.h
@@ -43,7 +43,7 @@ namespace CPP {
struct WriteDeclaration : public TreeWalker
{
- WriteDeclaration(Uic *uic, bool activateScripts);
+ WriteDeclaration(Uic *uic);
void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
@@ -58,7 +58,6 @@ private:
Driver *m_driver;
QTextStream &m_output;
const Option &m_option;
- const bool m_activateScripts;
};
} // namespace CPP
diff --git a/src/tools/uic/cpp/cppwriteicondata.cpp b/src/tools/uic/cpp/cppwriteicondata.cpp
deleted file mode 100644
index 4601a4c5e9..0000000000
--- a/src/tools/uic/cpp/cppwriteicondata.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** 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 "cppwriteicondata.h"
-#include "driver.h"
-#include "ui4.h"
-#include "uic.h"
-
-#include <qtextstream.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace CPP {
-
-static QByteArray transformImageData(const QString &data)
-{
- int baSize = data.length() / 2;
- uchar *ba = new uchar[baSize];
- for (int i = 0; i < baSize; ++i) {
- char h = data[2 * (i)].toLatin1();
- char l = data[2 * (i) + 1].toLatin1();
- uchar r = 0;
- if (h <= '9')
- r += h - '0';
- else
- r += h - 'a' + 10;
- r = r << 4;
- if (l <= '9')
- r += l - '0';
- else
- r += l - 'a' + 10;
- ba[i] = r;
- }
- QByteArray ret(reinterpret_cast<const char *>(ba), baSize);
- delete [] ba;
- return ret;
-}
-
-static QByteArray unzipXPM(const QString &data, ulong &length)
-{
-#ifndef QT_NO_COMPRESS
- const int lengthOffset = 4;
- QByteArray ba(lengthOffset, ' ');
-
- // qUncompress() expects the first 4 bytes to be the expected length of the
- // uncompressed data
- ba[0] = (length & 0xff000000) >> 24;
- ba[1] = (length & 0x00ff0000) >> 16;
- ba[2] = (length & 0x0000ff00) >> 8;
- ba[3] = (length & 0x000000ff);
- ba.append(transformImageData(data));
- QByteArray baunzip = qUncompress(ba);
- return baunzip;
-#else
- Q_UNUSED(data);
- Q_UNUSED(length);
- return QByteArray();
-#endif
-}
-
-
-WriteIconData::WriteIconData(Uic *uic)
- : driver(uic->driver()), output(uic->output()), option(uic->option())
-{
-}
-
-void WriteIconData::acceptUI(DomUI *node)
-{
- TreeWalker::acceptUI(node);
-}
-
-void WriteIconData::acceptImages(DomImages *images)
-{
- TreeWalker::acceptImages(images);
-}
-
-void WriteIconData::acceptImage(DomImage *image)
-{
- // Limit line length when writing code.
- writeImage(output, option.indent, true, image);
-}
-
-void WriteIconData::writeImage(QTextStream &output, const QString &indent,
- bool limitXPM_LineLength, const DomImage *image)
-{
- QString img = image->attributeName() + QLatin1String("_data");
- QString data = image->elementData()->text();
- QString fmt = image->elementData()->attributeFormat();
- int size = image->elementData()->attributeLength();
-
- if (fmt == QLatin1String("XPM.GZ")) {
- ulong length = size;
- QByteArray baunzip = unzipXPM(data, length);
- length = baunzip.size();
- // shouldn't we test the initial 'length' against the
- // resulting 'length' to catch corrupt UIC files?
- int a = 0;
- int column = 0;
- bool inQuote = false;
- output << indent << "/* XPM */\n"
- << indent << "static const char* const " << img << "[] = { \n";
- while (baunzip[a] != '\"')
- a++;
- for (; a < (int) length; a++) {
- output << baunzip[a];
- if (baunzip[a] == '\n') {
- column = 0;
- } else if (baunzip[a] == '"') {
- inQuote = !inQuote;
- }
-
- column++;
- if (limitXPM_LineLength && column >= 512 && inQuote) {
- output << "\"\n\""; // be nice with MSVC & Co.
- column = 1;
- }
- }
-
- if (! baunzip.trimmed ().endsWith ("};"))
- output << "};";
-
- output << "\n\n";
- } else {
- output << indent << "static const unsigned char " << img << "[] = { \n";
- output << indent;
- int a ;
- for (a = 0; a < (int) (data.length()/2)-1; a++) {
- output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ',';
- if (a % 12 == 11)
- output << '\n' << indent;
- else
- output << ' ';
- }
- output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << '\n';
- output << "};\n\n";
- }
-}
-
-void WriteIconData::writeImage(QIODevice &output, DomImage *image)
-{
- const QByteArray array = transformImageData(image->elementData()->text());
- output.write(array.constData(), array.size());
-}
-
-} // namespace CPP
-
-QT_END_NAMESPACE
diff --git a/src/tools/uic/cpp/cppwriteicondata.h b/src/tools/uic/cpp/cppwriteicondata.h
deleted file mode 100644
index c496d5a85b..0000000000
--- a/src/tools/uic/cpp/cppwriteicondata.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef CPPWRITEICONDATA_H
-#define CPPWRITEICONDATA_H
-
-#include "treewalker.h"
-
-QT_BEGIN_NAMESPACE
-
-class QTextStream;
-class QIODevice;
-class Driver;
-class Uic;
-
-struct Option;
-
-namespace CPP {
-
-class WriteIconData : public TreeWalker
-{
-public:
- WriteIconData(Uic *uic);
-
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptImages(DomImages *images) Q_DECL_OVERRIDE;
- void acceptImage(DomImage *image) Q_DECL_OVERRIDE;
-
- static void writeImage(QTextStream &output, const QString &indent,
- bool limitXPM_LineLength, const DomImage *image);
- static void writeImage(QIODevice &output, DomImage *image);
-
-private:
- Driver *driver;
- QTextStream &output;
- const Option &option;
-};
-
-} // namespace CPP
-
-QT_END_NAMESPACE
-
-#endif // CPPWRITEICONDATA_H
diff --git a/src/tools/uic/cpp/cppwriteicondeclaration.cpp b/src/tools/uic/cpp/cppwriteicondeclaration.cpp
deleted file mode 100644
index 5264e3de54..0000000000
--- a/src/tools/uic/cpp/cppwriteicondeclaration.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** 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 "cppwriteicondeclaration.h"
-#include "driver.h"
-#include "ui4.h"
-#include "uic.h"
-
-#include <qtextstream.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace CPP {
-
-WriteIconDeclaration::WriteIconDeclaration(Uic *uic)
- : driver(uic->driver()), output(uic->output()), option(uic->option())
-{
-}
-
-void WriteIconDeclaration::acceptUI(DomUI *node)
-{
- TreeWalker::acceptUI(node);
-}
-
-void WriteIconDeclaration::acceptImages(DomImages *images)
-{
- TreeWalker::acceptImages(images);
-}
-
-void WriteIconDeclaration::acceptImage(DomImage *image)
-{
- QString name = image->attributeName();
- if (name.isEmpty())
- return;
-
- driver->insertPixmap(name);
- output << option.indent << option.indent << name << "_ID,\n";
-}
-
-} // namespace CPP
-
-QT_END_NAMESPACE
diff --git a/src/tools/uic/cpp/cppwriteicondeclaration.h b/src/tools/uic/cpp/cppwriteicondeclaration.h
deleted file mode 100644
index 6483b8bf4a..0000000000
--- a/src/tools/uic/cpp/cppwriteicondeclaration.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef CPPWRITEICONDECLARATION_H
-#define CPPWRITEICONDECLARATION_H
-
-#include "treewalker.h"
-
-QT_BEGIN_NAMESPACE
-
-class QTextStream;
-class Driver;
-class Uic;
-
-struct Option;
-
-namespace CPP {
-
-class WriteIconDeclaration : public TreeWalker
-{
-public:
- WriteIconDeclaration(Uic *uic);
-
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptImages(DomImages *images) Q_DECL_OVERRIDE;
- void acceptImage(DomImage *image) Q_DECL_OVERRIDE;
-
-private:
- Driver *driver;
- QTextStream &output;
- const Option &option;
-};
-
-} // namespace CPP
-
-QT_END_NAMESPACE
-
-#endif // CPPWRITEICONDECLARATION_H
diff --git a/src/tools/uic/cpp/cppwriteiconinitialization.cpp b/src/tools/uic/cpp/cppwriteiconinitialization.cpp
deleted file mode 100644
index 33d1c8402e..0000000000
--- a/src/tools/uic/cpp/cppwriteiconinitialization.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** 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 "cppwriteiconinitialization.h"
-#include "cppwriteicondata.h"
-#include "driver.h"
-#include "ui4.h"
-#include "utils.h"
-#include "uic.h"
-
-#include <qtextstream.h>
-#include <qstring.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace CPP {
-
-WriteIconInitialization::WriteIconInitialization(Uic *uic)
- : driver(uic->driver()), output(uic->output()), option(uic->option())
-{
- this->uic = uic;
-}
-
-void WriteIconInitialization::acceptUI(DomUI *node)
-{
- if (node->elementImages() == 0)
- return;
-
- QString className = node->elementClass() + option.postfix;
-
- output << option.indent << "static QPixmap " << iconFromDataFunction() << "(IconID id)\n"
- << option.indent << "{\n";
-
- WriteIconData(uic).acceptUI(node);
-
- output << option.indent << "switch (id) {\n";
-
- TreeWalker::acceptUI(node);
-
- output << option.indent << option.indent << "default: return QPixmap();\n";
-
- output << option.indent << "} // switch\n"
- << option.indent << "} // icon\n\n";
-}
-
-QString WriteIconInitialization::iconFromDataFunction()
-{
- return QLatin1String("qt_get_icon");
-}
-
-void WriteIconInitialization::acceptImages(DomImages *images)
-{
- TreeWalker::acceptImages(images);
-}
-
-void WriteIconInitialization::acceptImage(DomImage *image)
-{
- QString img = image->attributeName() + QLatin1String("_data");
- QString data = image->elementData()->text();
- QString fmt = image->elementData()->attributeFormat();
-
- QString imageId = image->attributeName() + QLatin1String("_ID");
- QString imageData = image->attributeName() + QLatin1String("_data");
- QString ind = option.indent + option.indent;
-
- output << ind << "case " << imageId << ": ";
-
- if (fmt == QLatin1String("XPM.GZ")) {
- output << "return " << "QPixmap((const char**)" << imageData << ");\n";
- } else {
- output << " { QImage img; img.loadFromData(" << imageData << ", sizeof(" << imageData << "), " << fixString(fmt, ind) << "); return QPixmap::fromImage(img); }\n";
- }
-}
-
-} // namespace CPP
-
-QT_END_NAMESPACE
diff --git a/src/tools/uic/cpp/cppwriteiconinitialization.h b/src/tools/uic/cpp/cppwriteiconinitialization.h
deleted file mode 100644
index 588cb1bc67..0000000000
--- a/src/tools/uic/cpp/cppwriteiconinitialization.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef CPPWRITEICONINITIALIZATION_H
-#define CPPWRITEICONINITIALIZATION_H
-
-#include "treewalker.h"
-
-class QString;
-
-QT_BEGIN_NAMESPACE
-
-class QTextStream;
-class Driver;
-class Uic;
-
-struct Option;
-
-namespace CPP {
-
-class WriteIconInitialization : public TreeWalker
-{
-public:
- WriteIconInitialization(Uic *uic);
-
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptImages(DomImages *images) Q_DECL_OVERRIDE;
- void acceptImage(DomImage *image) Q_DECL_OVERRIDE;
-
- static QString iconFromDataFunction();
-
-private:
- Uic *uic;
- Driver *driver;
- QTextStream &output;
- const Option &option;
-};
-
-} // namespace CPP
-
-QT_END_NAMESPACE
-
-#endif // CPPWRITEICONINITIALIZATION_H
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp
index dcbe400224..de64b85219 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_scriptsActivated(false), m_laidOut(false)
+ : m_uic(uic), m_output(uic->output()), m_laidOut(false)
{
// 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
@@ -92,7 +92,6 @@ WriteIncludes::WriteIncludes(Uic *uic)
void WriteIncludes::acceptUI(DomUI *node)
{
- m_scriptsActivated = false;
m_laidOut = false;
m_localIncludes.clear();
m_globalIncludes.clear();
@@ -231,10 +230,6 @@ void WriteIncludes::acceptCustomWidget(DomCustomWidget *node)
if (className.isEmpty())
return;
- if (const DomScript *domScript = node->elementScript())
- if (!domScript->text().isEmpty())
- activateScripts();
-
if (!node->elementHeader() || node->elementHeader()->text().isEmpty()) {
add(className, false); // no header specified
} else {
@@ -296,21 +291,6 @@ void WriteIncludes::writeHeaders(const OrderedSet &headers, bool global)
}
}
-void WriteIncludes::acceptWidgetScripts(const DomScripts &scripts, DomWidget *, const DomWidgets &)
-{
- if (!scripts.empty()) {
- activateScripts();
- }
-}
-
-void WriteIncludes::activateScripts()
-{
- if (!m_scriptsActivated) {
- add(QLatin1String("QScriptEngine"));
- add(QLatin1String("QDebug"));
- m_scriptsActivated = true;
- }
-}
} // namespace CPP
QT_END_NAMESPACE
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index 7a6a499536..0d9c293efc 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -54,7 +54,6 @@ struct WriteIncludes : public TreeWalker
void acceptLayout(DomLayout *node) Q_DECL_OVERRIDE;
void acceptSpacer(DomSpacer *node) Q_DECL_OVERRIDE;
void acceptProperty(DomProperty *node) Q_DECL_OVERRIDE;
- void acceptWidgetScripts(const DomScripts &, DomWidget *, const DomWidgets &) Q_DECL_OVERRIDE;
//
// custom widgets
@@ -68,8 +67,6 @@ struct WriteIncludes : public TreeWalker
void acceptIncludes(DomIncludes *node) Q_DECL_OVERRIDE;
void acceptInclude(DomInclude *node) Q_DECL_OVERRIDE;
- bool scriptsActivated() const { return m_scriptsActivated; }
-
private:
void add(const QString &className, bool determineHeader = true, const QString &header = QString(), bool global = false);
@@ -79,7 +76,6 @@ private:
void insertInclude(const QString &header, bool global);
void writeHeaders(const OrderedSet &headers, bool global);
QString headerForClassName(const QString &className) const;
- void activateScripts();
const Uic *m_uic;
QTextStream &m_output;
@@ -94,7 +90,6 @@ private:
StringMap m_classToHeader;
StringMap m_oldHeaderToNewHeader;
- bool m_scriptsActivated;
bool m_laidOut;
};
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index d208ec6718..f2cdf4393a 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -27,7 +27,6 @@
****************************************************************************/
#include "cppwriteinitialization.h"
-#include "cppwriteiconinitialization.h"
#include "driver.h"
#include "ui4.h"
#include "utils.h"
@@ -83,8 +82,8 @@ namespace {
int w = 0;
int h = 0;
- if (properties.contains(QLatin1String("sizeHint"))) {
- if (const DomSize *sizeHint = properties.value(QLatin1String("sizeHint"))->elementSize()) {
+ if (const DomProperty *sh = properties.value(QLatin1String("sizeHint"))) {
+ if (const DomSize *sizeHint = sh->elementSize()) {
w = sizeHint->elementWidth();
h = sizeHint->elementHeight();
}
@@ -92,17 +91,23 @@ namespace {
output << w << ", " << h << ", ";
// size type
- QString sizeType = properties.contains(QLatin1String("sizeType")) ?
- properties.value(QLatin1String("sizeType"))->elementEnum() :
- QString::fromLatin1("Expanding");
+ QString sizeType;
+ if (const DomProperty *st = properties.value(QLatin1String("sizeType"))) {
+ const QString value = st->elementEnum();
+ if (value.startsWith(QLatin1String("QSizePolicy::")))
+ sizeType = value;
+ else
+ sizeType = QLatin1String("QSizePolicy::") + value;
+ } else {
+ sizeType = QStringLiteral("QSizePolicy::Expanding");
+ }
- if (!sizeType.startsWith(QLatin1String("QSizePolicy::")))
- sizeType.prepend(QLatin1String("QSizePolicy::"));
// orientation
bool isVspacer = false;
- if (properties.contains(QLatin1String("orientation"))) {
- const QString orientation = properties.value(QLatin1String("orientation"))->elementEnum();
- if (orientation == QLatin1String("Qt::Vertical") || orientation == QLatin1String("Vertical")) isVspacer = true;
+ if (const DomProperty *o = properties.value(QLatin1String("orientation"))) {
+ const QString orientation = o->elementEnum();
+ if (orientation == QLatin1String("Qt::Vertical") || orientation == QLatin1String("Vertical"))
+ isVspacer = true;
}
if (isVspacer)
@@ -125,11 +130,6 @@ namespace {
str << indent << varName << "->" << setter << '(' << v << ");\n";
}
- void writeSetupUIScriptVariableDeclarations(const QString &indent, QTextStream &str) {
- str << indent << "ScriptContext scriptContext;\n"
- << indent << "QWidgetList childWidgets;\n";
- }
-
static inline bool iconHasStatePixmaps(const DomResourceIcon *i) {
return i->hasElementNormalOff() || i->hasElementNormalOn() ||
i->hasElementDisabledOff() || i->hasElementDisabledOn() ||
@@ -396,10 +396,8 @@ void WriteInitialization::LayoutDefaultHandler::writeProperty(int p, const QStri
int defaultStyleValue, bool suppressDefault, QTextStream &str) const
{
// User value
- const DomPropertyMap::const_iterator mit = properties.constFind(propertyName);
- const bool found = mit != properties.constEnd();
- if (found) {
- const int value = mit.value()->elementNumber();
+ if (const DomProperty *prop = properties.value(propertyName)) {
+ const int value = prop->elementNumber();
// Emulate the pre 4.3 behaviour: The value form default value was only used to determine
// the default value, layout properties were always written
const bool useLayoutFunctionPre43 = !suppressDefault && (m_state[p] == (HasDefaultFunction|HasDefaultValue)) && value == m_defaultValues[p];
@@ -461,7 +459,7 @@ static bool needsTranslation(const DomElement *element)
}
// --- WriteInitialization
-WriteInitialization::WriteInitialization(Uic *uic, bool activateScripts) :
+WriteInitialization::WriteInitialization(Uic *uic) :
m_uic(uic),
m_driver(uic->driver()), m_output(uic->output()), m_option(uic->option()),
m_indent(m_option.indent + m_option.indent),
@@ -472,14 +470,28 @@ WriteInitialization::WriteInitialization(Uic *uic, bool activateScripts) :
m_delayedOut(&m_delayedInitialization, QIODevice::WriteOnly),
m_refreshOut(&m_refreshInitialization, QIODevice::WriteOnly),
m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly),
- m_activateScripts(activateScripts), m_layoutWidget(false),
+ m_layoutWidget(false),
m_firstThemeIcon(true)
{
}
+QString WriteInitialization::writeString(const QString &s, const QString &indent) const
+{
+ unsigned flags = 0;
+ const QString ret = fixString(s, indent, &flags);
+ if (flags & Utf8String)
+ return QLatin1String("QString::fromUtf8(") + ret + QLatin1Char(')');
+ // MSVC cannot concat L"foo" "bar" (C2308: concatenating mismatched strings),
+ // use QLatin1String instead (all platforms to avoid cross-compiling issues).
+ if (flags & MultiLineString)
+ return QLatin1String("QLatin1String(") + ret + QLatin1Char(')');
+ const QLatin1String stringWrapper = m_uic->option().stringLiteral ?
+ QLatin1String("QStringLiteral(") : QLatin1String("QLatin1String(");
+ return stringWrapper + ret + QLatin1Char(')');
+}
+
void WriteInitialization::acceptUI(DomUI *node)
{
- m_registeredImages.clear();
m_actionGroupChain.push(0);
m_widgetChain.push(0);
m_layoutChain.push(0);
@@ -490,9 +502,6 @@ void WriteInitialization::acceptUI(DomUI *node)
if (node->elementCustomWidgets())
TreeWalker::acceptCustomWidgets(node->elementCustomWidgets());
- if (node->elementImages())
- TreeWalker::acceptImages(node->elementImages());
-
if (m_option.generateImplemetation)
m_output << "#include <" << m_driver->headerFileName() << ">\n\n";
@@ -512,9 +521,6 @@ void WriteInitialization::acceptUI(DomUI *node)
m_output << m_option.indent << "void " << "setupUi(" << widgetClassName << " *" << varName << ")\n"
<< m_option.indent << "{\n";
- if (m_activateScripts)
- writeSetupUIScriptVariableDeclarations(m_indent, m_output);
-
const QStringList connections = m_uic->databaseInfo()->connections();
for (int i=0; i<connections.size(); ++i) {
QString connection = connections.at(i);
@@ -591,15 +597,15 @@ void WriteInitialization::addWizardPage(const QString &pageVarName, const DomWid
/* If the node has a (free-format) string "pageId" attribute (which could
* an integer or an enumeration value), use setPage(), else addPage(). */
QString id;
- const DomPropertyList attributes = page->elementAttribute();
+ const auto &attributes = page->elementAttribute();
if (!attributes.empty()) {
- const DomPropertyList::const_iterator acend = attributes.constEnd();
- for (DomPropertyList::const_iterator it = attributes.constBegin(); it != acend; ++it)
- if ((*it)->attributeName() == QLatin1String("pageId")) {
- if (const DomString *ds = (*it)->elementString())
+ for (const DomProperty *p : attributes) {
+ if (p->attributeName() == QLatin1String("pageId")) {
+ if (const DomString *ds = p->elementString())
id = ds->text();
break;
}
+ }
}
if (id.isEmpty()) {
m_output << m_indent << parentWidget << "->addPage(" << pageVarName << ");\n";
@@ -884,7 +890,7 @@ void WriteInitialization::acceptLayout(DomLayout *node)
const QString varName = m_driver->findOrInsertLayout(node);
const DomPropertyMap properties = propertyMap(node->elementProperty());
- const bool oldLayoutProperties = properties.constFind(QLatin1String("margin")) != properties.constEnd();
+ const bool oldLayoutProperties = properties.value(QLatin1String("margin")) != nullptr;
bool isGroupBox = false;
@@ -1149,9 +1155,7 @@ void WriteInitialization::writeProperties(const QString &varName,
if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
DomPropertyMap properties = propertyMap(lst);
- if (properties.contains(QLatin1String("control"))) {
- DomProperty *p = properties.value(QLatin1String("control"));
- Q_ASSERT( p );
+ if (DomProperty *p = properties.value(QLatin1String("control"))) {
m_output << m_indent << varName << "->setControl("
<< writeString(toString(p->elementString()), m_dindent) << ");\n";
}
@@ -1612,10 +1616,10 @@ QString WriteInitialization::writeFontProperties(const DomFont *f)
}
// Post 4.4 write resource icon
-static void writeResourceIcon(QTextStream &output,
- const QString &iconName,
- const QString &indent,
- const DomResourceIcon *i)
+void WriteInitialization::writeResourceIcon(QTextStream &output,
+ const QString &iconName,
+ const QString &indent,
+ const DomResourceIcon *i) const
{
if (i->hasElementNormalOff())
output << indent << iconName << ".addFile(" << writeString(i->elementNormalOff()->text(), indent) << ", QSize(), QIcon::Normal, QIcon::Off);\n";
@@ -1708,7 +1712,7 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
return;
// old format
- const QList<DomColor*> colors = colorGroup->elementColor();
+ const auto &colors = colorGroup->elementColor();
for (int i=0; i<colors.size(); ++i) {
const DomColor *color = colors.at(i);
@@ -1719,7 +1723,7 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
}
// new format
- const QList<DomColorRole *> colorRoles = colorGroup->elementColorRole();
+ const auto &colorRoles = colorGroup->elementColorRole();
for (const DomColorRole *colorRole : colorRoles) {
if (colorRole->hasAttributeRole()) {
const QString brushName = writeBrushInitialization(colorRole->elementBrush());
@@ -1796,7 +1800,7 @@ void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brush
<< gradient->attributeCoordinateMode() << ");\n";
}
- const QList<DomGradientStop *> stops = gradient->elementGradientStop();
+ const auto &stops = gradient->elementGradientStop();
for (const DomGradientStop *stop : stops) {
const DomColor *color = stop->elementColor();
m_output << m_indent << gradientName << ".setColorAt("
@@ -1894,23 +1898,6 @@ QString WriteInitialization::pixCall(const QString &t, const QString &text) cons
type += QLatin1String("()");
return type;
}
- if (const DomImage *image = findImage(text)) {
- if (m_option.extractImages) {
- const QString format = image->elementData()->attributeFormat();
- const QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower();
- return QLatin1String("QPixmap(QString::fromUtf8(\":/")
- + m_generatedClass
- + QLatin1String("/images/")
- + text
- + QLatin1Char('.')
- + extension
- + QLatin1String("\"))");
- }
- return WriteIconInitialization::iconFromDataFunction()
- + QLatin1Char('(')
- + text
- + QLatin1String("_ID)");
- }
QString pixFunc = m_uic->pixmapFunction();
if (pixFunc.isEmpty())
@@ -1927,63 +1914,34 @@ QString WriteInitialization::pixCall(const QString &t, const QString &text) cons
void WriteInitialization::initializeComboBox(DomWidget *w)
{
const QString varName = m_driver->findOrInsertWidget(w);
- const QString className = w->attributeClass();
- const QList<DomItem*> items = w->elementItem();
+ const auto &items = w->elementItem();
if (items.isEmpty())
return;
- // If possible use qcombobox's addItems() which is much faster then a bunch of addItem() calls
- bool makeStringListCall = true;
- bool translatable = false;
- QStringList list;
- for (int i=0; i<items.size(); ++i) {
+ for (int i = 0; i < items.size(); ++i) {
const DomItem *item = items.at(i);
const DomPropertyMap properties = propertyMap(item->elementProperty());
const DomProperty *text = properties.value(QLatin1String("text"));
- const DomProperty *pixmap = properties.value(QLatin1String("icon"));
- bool needsTr = needsTranslation(text->elementString());
- if (pixmap != 0 || (i > 0 && translatable != needsTr)) {
- makeStringListCall = false;
- break;
- }
- translatable = needsTr;
- list.append(autoTrCall(text->elementString())); // fix me here
- }
+ const DomProperty *icon = properties.value(QLatin1String("icon"));
- if (makeStringListCall) {
- QTextStream &o = translatable ? m_refreshOut : m_output;
- if (translatable)
- o << m_indent << varName << "->clear();\n";
- o << m_indent << varName << "->insertItems(0, QStringList()" << '\n';
- for (int i = 0; i < list.size(); ++i)
- o << m_indent << " << " << list.at(i) << "\n";
- o << m_indent << ");\n";
- } else {
- for (int i = 0; i < items.size(); ++i) {
- const DomItem *item = items.at(i);
- const DomPropertyMap properties = propertyMap(item->elementProperty());
- const DomProperty *text = properties.value(QLatin1String("text"));
- const DomProperty *icon = properties.value(QLatin1String("icon"));
-
- QString iconValue;
- if (icon)
- iconValue = iconCall(icon);
-
- m_output << m_indent << varName << "->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";
- } else {
- m_output << noTrCall(text->elementString()) << ");\n";
- }
+ QString iconValue;
+ if (icon)
+ iconValue = iconCall(icon);
+
+ m_output << m_indent << varName << "->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";
+ } else {
+ m_output << noTrCall(text->elementString()) << ");\n";
}
- m_refreshOut << "\n";
}
+ m_refreshOut << "\n";
}
QString WriteInitialization::disableSorting(DomWidget *w, const QString &varName)
@@ -2118,9 +2076,8 @@ void WriteInitialization::addCommonInitializers(Item *item,
void WriteInitialization::initializeListWidget(DomWidget *w)
{
const QString varName = m_driver->findOrInsertWidget(w);
- const QString className = w->attributeClass();
- const QList<DomItem*> items = w->elementItem();
+ const auto &items = w->elementItem();
if (items.isEmpty())
return;
@@ -2150,7 +2107,7 @@ void WriteInitialization::initializeTreeWidget(DomWidget *w)
// columns
Item item(QLatin1String("QTreeWidgetItem"), m_indent, m_output, m_refreshOut, m_driver);
- const QList<DomColumn*> columns = w->elementColumn();
+ const auto &columns = w->elementColumn();
for (int i = 0; i < columns.size(); ++i) {
const DomColumn *column = columns.at(i);
@@ -2193,7 +2150,7 @@ void WriteInitialization::initializeTreeWidget(DomWidget *w)
conditions an item is needed needs to be done bottom-up, the whole process makes
two passes, storing the intermediate result in a recursive StringInitializerListMap.
*/
-QList<WriteInitialization::Item *> WriteInitialization::initializeTreeWidgetItems(const QList<DomItem *> &domItems)
+QList<WriteInitialization::Item *> WriteInitialization::initializeTreeWidgetItems(const QVector<DomItem *> &domItems)
{
// items
QList<Item *> items;
@@ -2237,7 +2194,7 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
const QString varName = m_driver->findOrInsertWidget(w);
// columns
- const QList<DomColumn *> columns = w->elementColumn();
+ const auto &columns = w->elementColumn();
if (columns.size() != 0) {
m_output << m_indent << "if (" << varName << "->columnCount() < " << columns.size() << ")\n"
@@ -2259,7 +2216,7 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
}
// rows
- const QList<DomRow *> rows = w->elementRow();
+ const auto &rows = w->elementRow();
if (rows.size() != 0) {
m_output << m_indent << "if (" << varName << "->rowCount() < " << rows.size() << ")\n"
@@ -2283,7 +2240,7 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
// items
QString tempName = disableSorting(w, varName);
- const QList<DomItem *> items = w->elementItem();
+ const auto &items = w->elementItem();
for (int i = 0; i < items.size(); ++i) {
const DomItem *cell = items.at(i);
@@ -2310,7 +2267,7 @@ QString WriteInitialization::trCall(const QString &str, const QString &commentHi
return QLatin1String("QString()");
QString result;
- const QString comment = commentHint.isEmpty() ? QString(QLatin1String("Q_NULLPTR")) : fixString(commentHint, m_dindent);
+ const QString comment = commentHint.isEmpty() ? QString(QLatin1String("nullptr")) : fixString(commentHint, m_dindent);
if (m_option.translateFunction.isEmpty()) {
if (m_option.idBased) {
@@ -2428,11 +2385,6 @@ void WriteInitialization::acceptConnection(DomConnection *connection)
<< ");\n";
}
-DomImage *WriteInitialization::findImage(const QString &name) const
-{
- return m_registeredImages.value(name);
-}
-
DomWidget *WriteInitialization::findWidget(QLatin1String widgetClass)
{
for (int i = m_widgetChain.count() - 1; i >= 0; --i) {
@@ -2445,49 +2397,6 @@ DomWidget *WriteInitialization::findWidget(QLatin1String widgetClass)
return 0;
}
-void WriteInitialization::acceptImage(DomImage *image)
-{
- if (!image->hasAttributeName())
- return;
-
- m_registeredImages.insert(image->attributeName(), image);
-}
-
-void WriteInitialization::acceptWidgetScripts(const DomScripts &widgetScripts, DomWidget *node, const DomWidgets &childWidgets)
-{
- // Add the per-class custom scripts to the per-widget ones.
- DomScripts scripts(widgetScripts);
-
- if (DomScript *customWidgetScript = m_uic->customWidgetsInfo()->customWidgetScript(node->attributeClass()))
- scripts.push_front(customWidgetScript);
-
- if (scripts.empty())
- return;
-
- // concatenate script snippets
- QString script;
- for (const DomScript *domScript : qAsConst(scripts)) {
- const QString snippet = domScript->text();
- if (!snippet.isEmpty())
- script += QStringRef(&snippet).trimmed() + QLatin1Char('\n');
- }
- if (script.isEmpty())
- return;
-
- // Build the list of children and insert call
- m_output << m_indent << "childWidgets.clear();\n";
- if (!childWidgets.empty()) {
- m_output << m_indent << "childWidgets";
- for (DomWidget *child : childWidgets)
- m_output << " << " << m_driver->findOrInsertWidget(child);
- m_output << ";\n";
- }
- m_output << m_indent << "scriptContext.run("
- << writeString(script, m_dindent) << ", "
- << m_driver->findOrInsertWidget(node) << ", childWidgets);\n";
-}
-
-
static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet<QString> &directives)
{
if (directives.isEmpty())
diff --git a/src/tools/uic/cpp/cppwriteinitialization.h b/src/tools/uic/cpp/cppwriteinitialization.h
index a9691e1de4..b26f51875d 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.h
+++ b/src/tools/uic/cpp/cppwriteinitialization.h
@@ -88,14 +88,13 @@ struct WriteInitialization : public TreeWalker
typedef QList<DomProperty*> DomPropertyList;
typedef QHash<QString, DomProperty*> DomPropertyMap;
- WriteInitialization(Uic *uic, bool activateScripts);
+ WriteInitialization(Uic *uic);
//
// widgets
//
void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
- void acceptWidgetScripts(const DomScripts &, DomWidget *node, const DomWidgets &childWidgets) Q_DECL_OVERRIDE;
void acceptLayout(DomLayout *node) Q_DECL_OVERRIDE;
void acceptSpacer(DomSpacer *node) Q_DECL_OVERRIDE;
@@ -130,11 +129,6 @@ struct WriteInitialization : public TreeWalker
//
void acceptConnection(DomConnection *connection) Q_DECL_OVERRIDE;
-//
-// images
-//
- void acceptImage(DomImage *image) Q_DECL_OVERRIDE;
-
enum {
Use43UiFile = 0,
TopLevelMargin,
@@ -145,6 +139,8 @@ struct WriteInitialization : public TreeWalker
private:
static QString domColor2QString(const DomColor *c);
+ QString writeString(const QString &s, const QString &indent) const;
+
QString iconCall(const DomProperty *prop);
QString pixCall(const DomProperty *prop) const;
QString pixCall(const QString &type, const QString &text) const;
@@ -221,7 +217,7 @@ private:
void initializeComboBox(DomWidget *w);
void initializeListWidget(DomWidget *w);
void initializeTreeWidget(DomWidget *w);
- QList<Item *> initializeTreeWidgetItems(const QList<DomItem *> &domItems);
+ QList<Item *> initializeTreeWidgetItems(const QVector<DomItem *> &domItems);
void initializeTableWidget(DomWidget *w);
QString disableSorting(DomWidget *w, const QString &varName);
@@ -229,12 +225,12 @@ private:
QString findDeclaration(const QString &name);
DomWidget *findWidget(QLatin1String widgetClass);
- DomImage *findImage(const QString &name) const;
bool isValidObject(const QString &name) const;
private:
QString writeFontProperties(const DomFont *f);
+ void writeResourceIcon(QTextStream &output, const QString &iconName, const QString &indent, const DomResourceIcon *i) const;
QString writeIconProperties(const DomResourceIcon *i);
QString writeSizePolicy(const DomSizePolicy *sp);
QString writeBrushInitialization(const DomBrush *brush);
@@ -263,7 +259,6 @@ private:
QSet<QString> m_buttonGroups;
QHash<QString, DomWidget*> m_registeredWidgets;
- QHash<QString, DomImage*> m_registeredImages;
QHash<QString, DomAction*> m_registeredActions;
typedef QHash<uint, QString> ColorBrushHash;
ColorBrushHash m_colorBrushHash;
@@ -314,7 +309,6 @@ private:
QString m_delayedActionInitialization;
QTextStream m_actionOut;
- const bool m_activateScripts;
bool m_layoutWidget;
bool m_firstThemeIcon;
diff --git a/src/tools/uic/customwidgetsinfo.cpp b/src/tools/uic/customwidgetsinfo.cpp
index 662a249d71..6883b715ae 100644
--- a/src/tools/uic/customwidgetsinfo.cpp
+++ b/src/tools/uic/customwidgetsinfo.cpp
@@ -91,18 +91,6 @@ QString CustomWidgetsInfo::realClassName(const QString &className) const
return className;
}
-DomScript *CustomWidgetsInfo::customWidgetScript(const QString &name) const
-{
- if (m_customWidgets.empty())
- return 0;
-
- const NameCustomWidgetMap::const_iterator it = m_customWidgets.constFind(name);
- if (it == m_customWidgets.constEnd())
- return 0;
-
- return it.value()->elementScript();
-}
-
QString CustomWidgetsInfo::customWidgetAddPageMethod(const QString &name) const
{
if (DomCustomWidget *dcw = m_customWidgets.value(name, 0))
diff --git a/src/tools/uic/customwidgetsinfo.h b/src/tools/uic/customwidgetsinfo.h
index 7bc2b62619..3ce27d546c 100644
--- a/src/tools/uic/customwidgetsinfo.h
+++ b/src/tools/uic/customwidgetsinfo.h
@@ -57,8 +57,6 @@ public:
inline DomCustomWidget *customWidget(const QString &name) const
{ return m_customWidgets.value(name); }
- DomScript *customWidgetScript(const QString &name) const;
-
QString customWidgetAddPageMethod(const QString &name) const;
QString realClassName(const QString &className) const;
diff --git a/src/tools/uic/databaseinfo.cpp b/src/tools/uic/databaseinfo.cpp
index 73fcf06c54..fa5d5f5df0 100644
--- a/src/tools/uic/databaseinfo.cpp
+++ b/src/tools/uic/databaseinfo.cpp
@@ -52,11 +52,11 @@ void DatabaseInfo::acceptWidget(DomWidget *node)
{
QHash<QString, DomProperty*> properties = propertyMap(node->elementProperty());
- DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
+ DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"));
if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
return;
- DomProperty *db = properties.value(QLatin1String("database"), 0);
+ DomProperty *db = properties.value(QLatin1String("database"));
if (db && db->elementStringList()) {
QStringList info = db->elementStringList()->elementString();
diff --git a/src/tools/uic/main.cpp b/src/tools/uic/main.cpp
index 3599470403..46a1e66bcc 100644
--- a/src/tools/uic/main.cpp
+++ b/src/tools/uic/main.cpp
@@ -75,6 +75,10 @@ int runUic(int argc, char *argv[])
noImplicitIncludesOption.setDescription(QStringLiteral("Disable generation of #include-directives."));
parser.addOption(noImplicitIncludesOption);
+ QCommandLineOption noStringLiteralOption(QStringList() << QStringLiteral("s") << QStringLiteral("no-stringliteral"));
+ noStringLiteralOption.setDescription(QStringLiteral("Use QLatin1String instead of QStringLiteral in generated code."));
+ parser.addOption(noStringLiteralOption);
+
QCommandLineOption postfixOption(QStringLiteral("postfix"));
postfixOption.setDescription(QStringLiteral("Postfix to add to all generated classnames."));
postfixOption.setValueName(QStringLiteral("postfix"));
@@ -107,6 +111,7 @@ int runUic(int argc, char *argv[])
driver.option().outputFile = parser.value(outputOption);
driver.option().headerProtection = !parser.isSet(noProtOption);
driver.option().implicitIncludes = !parser.isSet(noImplicitIncludesOption);
+ driver.option().stringLiteral = !parser.isSet(noStringLiteralOption);
driver.option().idBased = parser.isSet(idBasedOption);
driver.option().postfix = parser.value(postfixOption);
driver.option().translateFunction = parser.value(translateOption);
diff --git a/src/tools/uic/option.h b/src/tools/uic/option.h
index 1483d94c07..c7278393fb 100644
--- a/src/tools/uic/option.h
+++ b/src/tools/uic/option.h
@@ -48,10 +48,10 @@ struct Option
unsigned int generateNamespace : 1;
unsigned int autoConnection : 1;
unsigned int dependencies : 1;
- unsigned int extractImages : 1;
unsigned int limitXPM_LineLength : 1;
unsigned int implicitIncludes: 1;
unsigned int idBased: 1;
+ unsigned int stringLiteral: 1;
Generator generator;
QString inputFile;
@@ -74,10 +74,10 @@ struct Option
generateNamespace(1),
autoConnection(1),
dependencies(0),
- extractImages(0),
limitXPM_LineLength(0),
implicitIncludes(1),
idBased(0),
+ stringLiteral(1),
generator(CppGenerator),
prefix(QLatin1String("Ui_"))
{ indent.fill(QLatin1Char(' '), 4); }
diff --git a/src/tools/uic/treewalker.cpp b/src/tools/uic/treewalker.cpp
index eb9f1c02f8..4c9981580b 100644
--- a/src/tools/uic/treewalker.cpp
+++ b/src/tools/uic/treewalker.cpp
@@ -38,9 +38,6 @@ void TreeWalker::acceptUI(DomUI *ui)
acceptButtonGroups(domButtonGroups);
acceptTabStops(ui->elementTabStops());
-
- if (ui->elementImages())
- acceptImages(ui->elementImages());
}
void TreeWalker::acceptLayoutDefault(DomLayoutDefault *layoutDefault)
@@ -112,9 +109,6 @@ void TreeWalker::acceptWidget(DomWidget *widget)
if (!widget->elementLayout().isEmpty())
acceptLayout(widget->elementLayout().at(0));
-
- const DomScripts scripts(widget->elementScript());
- acceptWidgetScripts(scripts, widget, childWidgets);
}
void TreeWalker::acceptSpacer(DomSpacer *spacer)
@@ -251,17 +245,6 @@ void TreeWalker::acceptActionRef(DomActionRef *actionRef)
Q_UNUSED(actionRef);
}
-void TreeWalker::acceptImages(DomImages *images)
-{
- for (int i=0; i<images->elementImage().size(); ++i)
- acceptImage(images->elementImage().at(i));
-}
-
-void TreeWalker::acceptImage(DomImage *image)
-{
- Q_UNUSED(image);
-}
-
void TreeWalker::acceptIncludes(DomIncludes *includes)
{
for (int i=0; i<includes->elementInclude().size(); ++i)
@@ -295,17 +278,11 @@ void TreeWalker::acceptConnectionHint(DomConnectionHint *connectionHint)
Q_UNUSED(connectionHint);
}
-void TreeWalker::acceptWidgetScripts(const DomScripts &, DomWidget *, const DomWidgets &)
-{
-}
-
void TreeWalker::acceptButtonGroups(const DomButtonGroups *domButtonGroups)
{
- typedef QList<DomButtonGroup*> DomButtonGroupList;
- const DomButtonGroupList domGroups = domButtonGroups->elementButtonGroup();
- const DomButtonGroupList::const_iterator cend = domGroups.constEnd();
- for (DomButtonGroupList::const_iterator it = domGroups.constBegin(); it != cend; ++it)
- acceptButtonGroup(*it);
+ const auto &domGroups = domButtonGroups->elementButtonGroup();
+ for (const DomButtonGroup *g : domGroups)
+ acceptButtonGroup(g);
}
void TreeWalker::acceptButtonGroup(const DomButtonGroup *)
diff --git a/src/tools/uic/treewalker.h b/src/tools/uic/treewalker.h
index 0739f5138c..78da17d628 100644
--- a/src/tools/uic/treewalker.h
+++ b/src/tools/uic/treewalker.h
@@ -101,11 +101,8 @@ struct TreeWalker
virtual void acceptTime(DomTime *time);
virtual void acceptDateTime(DomDateTime *dateTime);
virtual void acceptProperty(DomProperty *property);
- typedef QList<DomScript *> DomScripts;
- typedef QList<DomWidget *> DomWidgets;
- virtual void acceptWidgetScripts(const DomScripts &, DomWidget *node, const DomWidgets &childWidgets);
- virtual void acceptImages(DomImages *images);
- virtual void acceptImage(DomImage *image);
+ typedef QVector<DomScript *> DomScripts;
+ typedef QVector<DomWidget *> DomWidgets;
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 5a609ef42b..bc1039871e 100644
--- a/src/tools/uic/ui4.cpp
+++ b/src/tools/uic/ui4.cpp
@@ -40,71 +40,6 @@ using namespace QFormInternal;
** Implementations
*/
-void DomUI::clear(bool clear_all)
-{
- delete m_widget;
- delete m_layoutDefault;
- delete m_layoutFunction;
- delete m_customWidgets;
- delete m_tabStops;
- delete m_images;
- delete m_includes;
- delete m_resources;
- delete m_connections;
- delete m_designerdata;
- delete m_slots;
- delete m_buttonGroups;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_version = false;
- m_has_attr_language = false;
- m_has_attr_displayname = false;
- m_has_attr_stdsetdef = false;
- m_attr_stdsetdef = 0;
- m_has_attr_stdSetDef = false;
- m_attr_stdSetDef = 0;
- }
-
- m_children = 0;
- m_widget = 0;
- m_layoutDefault = 0;
- m_layoutFunction = 0;
- m_customWidgets = 0;
- m_tabStops = 0;
- m_images = 0;
- m_includes = 0;
- m_resources = 0;
- m_connections = 0;
- m_designerdata = 0;
- m_slots = 0;
- m_buttonGroups = 0;
-}
-
-DomUI::DomUI()
-{
- m_children = 0;
- m_has_attr_version = false;
- m_has_attr_language = false;
- m_has_attr_displayname = false;
- m_has_attr_stdsetdef = false;
- m_attr_stdsetdef = 0;
- m_has_attr_stdSetDef = false;
- m_attr_stdSetDef = 0;
- m_widget = 0;
- m_layoutDefault = 0;
- m_layoutFunction = 0;
- m_customWidgets = 0;
- m_tabStops = 0;
- m_images = 0;
- m_includes = 0;
- m_resources = 0;
- m_connections = 0;
- m_designerdata = 0;
- m_slots = 0;
- m_buttonGroups = 0;
-}
-
DomUI::~DomUI()
{
delete m_widget;
@@ -112,7 +47,6 @@ DomUI::~DomUI()
delete m_layoutFunction;
delete m_customWidgets;
delete m_tabStops;
- delete m_images;
delete m_includes;
delete m_resources;
delete m_connections;
@@ -123,10 +57,9 @@ DomUI::~DomUI()
void DomUI::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("version")) {
setAttributeVersion(attribute.value().toString());
continue;
@@ -150,97 +83,96 @@ void DomUI::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("author")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("author"), Qt::CaseInsensitive)) {
setElementAuthor(reader.readElementText());
continue;
}
- if (tag == QLatin1String("comment")) {
+ if (!tag.compare(QLatin1String("comment"), Qt::CaseInsensitive)) {
setElementComment(reader.readElementText());
continue;
}
- if (tag == QLatin1String("exportmacro")) {
+ if (!tag.compare(QLatin1String("exportmacro"), Qt::CaseInsensitive)) {
setElementExportMacro(reader.readElementText());
continue;
}
- if (tag == QLatin1String("class")) {
+ if (!tag.compare(QLatin1String("class"), Qt::CaseInsensitive)) {
setElementClass(reader.readElementText());
continue;
}
- if (tag == QLatin1String("widget")) {
+ if (!tag.compare(QLatin1String("widget"), Qt::CaseInsensitive)) {
DomWidget *v = new DomWidget();
v->read(reader);
setElementWidget(v);
continue;
}
- if (tag == QLatin1String("layoutdefault")) {
+ if (!tag.compare(QLatin1String("layoutdefault"), Qt::CaseInsensitive)) {
DomLayoutDefault *v = new DomLayoutDefault();
v->read(reader);
setElementLayoutDefault(v);
continue;
}
- if (tag == QLatin1String("layoutfunction")) {
+ if (!tag.compare(QLatin1String("layoutfunction"), Qt::CaseInsensitive)) {
DomLayoutFunction *v = new DomLayoutFunction();
v->read(reader);
setElementLayoutFunction(v);
continue;
}
- if (tag == QLatin1String("pixmapfunction")) {
+ if (!tag.compare(QLatin1String("pixmapfunction"), Qt::CaseInsensitive)) {
setElementPixmapFunction(reader.readElementText());
continue;
}
- if (tag == QLatin1String("customwidgets")) {
+ if (!tag.compare(QLatin1String("customwidgets"), Qt::CaseInsensitive)) {
DomCustomWidgets *v = new DomCustomWidgets();
v->read(reader);
setElementCustomWidgets(v);
continue;
}
- if (tag == QLatin1String("tabstops")) {
+ if (!tag.compare(QLatin1String("tabstops"), Qt::CaseInsensitive)) {
DomTabStops *v = new DomTabStops();
v->read(reader);
setElementTabStops(v);
continue;
}
- if (tag == QLatin1String("images")) {
- DomImages *v = new DomImages();
- v->read(reader);
- setElementImages(v);
+ if (!tag.compare(QLatin1String("images"), Qt::CaseInsensitive)) {
+ qWarning("Omitting deprecated element <images>.");
+ reader.skipCurrentElement();
continue;
}
- if (tag == QLatin1String("includes")) {
+ if (!tag.compare(QLatin1String("includes"), Qt::CaseInsensitive)) {
DomIncludes *v = new DomIncludes();
v->read(reader);
setElementIncludes(v);
continue;
}
- if (tag == QLatin1String("resources")) {
+ if (!tag.compare(QLatin1String("resources"), Qt::CaseInsensitive)) {
DomResources *v = new DomResources();
v->read(reader);
setElementResources(v);
continue;
}
- if (tag == QLatin1String("connections")) {
+ if (!tag.compare(QLatin1String("connections"), Qt::CaseInsensitive)) {
DomConnections *v = new DomConnections();
v->read(reader);
setElementConnections(v);
continue;
}
- if (tag == QLatin1String("designerdata")) {
+ if (!tag.compare(QLatin1String("designerdata"), Qt::CaseInsensitive)) {
DomDesignerData *v = new DomDesignerData();
v->read(reader);
setElementDesignerdata(v);
continue;
}
- if (tag == QLatin1String("slots")) {
+ if (!tag.compare(QLatin1String("slots"), Qt::CaseInsensitive)) {
DomSlots *v = new DomSlots();
v->read(reader);
setElementSlots(v);
continue;
}
- if (tag == QLatin1String("buttongroups")) {
+ if (!tag.compare(QLatin1String("buttongroups"), Qt::CaseInsensitive)) {
DomButtonGroups *v = new DomButtonGroups();
v->read(reader);
setElementButtonGroups(v);
@@ -250,12 +182,7 @@ void DomUI::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -264,7 +191,7 @@ void DomUI::read(QXmlStreamReader &reader)
void DomUI::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("ui") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("ui") : tagName.toLower());
if (hasAttributeVersion())
writer.writeAttribute(QStringLiteral("version"), attributeVersion());
@@ -281,284 +208,246 @@ void DomUI::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeStdSetDef())
writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdSetDef()));
- if (m_children & Author) {
+ if (m_children & Author)
writer.writeTextElement(QStringLiteral("author"), m_author);
- }
- if (m_children & Comment) {
+ if (m_children & Comment)
writer.writeTextElement(QStringLiteral("comment"), m_comment);
- }
- if (m_children & ExportMacro) {
+ if (m_children & ExportMacro)
writer.writeTextElement(QStringLiteral("exportmacro"), m_exportMacro);
- }
- if (m_children & Class) {
+ if (m_children & Class)
writer.writeTextElement(QStringLiteral("class"), m_class);
- }
- if (m_children & Widget) {
+ if (m_children & Widget)
m_widget->write(writer, QStringLiteral("widget"));
- }
- if (m_children & LayoutDefault) {
+ if (m_children & LayoutDefault)
m_layoutDefault->write(writer, QStringLiteral("layoutdefault"));
- }
- if (m_children & LayoutFunction) {
+ if (m_children & LayoutFunction)
m_layoutFunction->write(writer, QStringLiteral("layoutfunction"));
- }
- if (m_children & PixmapFunction) {
+ if (m_children & PixmapFunction)
writer.writeTextElement(QStringLiteral("pixmapfunction"), m_pixmapFunction);
- }
- if (m_children & CustomWidgets) {
+ if (m_children & CustomWidgets)
m_customWidgets->write(writer, QStringLiteral("customwidgets"));
- }
- if (m_children & TabStops) {
+ if (m_children & TabStops)
m_tabStops->write(writer, QStringLiteral("tabstops"));
- }
- if (m_children & Images) {
- m_images->write(writer, QStringLiteral("images"));
- }
-
- if (m_children & Includes) {
+ if (m_children & Includes)
m_includes->write(writer, QStringLiteral("includes"));
- }
- if (m_children & Resources) {
+ if (m_children & Resources)
m_resources->write(writer, QStringLiteral("resources"));
- }
- if (m_children & Connections) {
+ if (m_children & Connections)
m_connections->write(writer, QStringLiteral("connections"));
- }
- if (m_children & Designerdata) {
+ if (m_children & Designerdata)
m_designerdata->write(writer, QStringLiteral("designerdata"));
- }
- if (m_children & Slots) {
+ if (m_children & Slots)
m_slots->write(writer, QStringLiteral("slots"));
- }
- if (m_children & ButtonGroups) {
+ if (m_children & ButtonGroups)
m_buttonGroups->write(writer, QStringLiteral("buttongroups"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomUI::setElementAuthor(const QString& a)
+void DomUI::setElementAuthor(const QString &a)
{
m_children |= Author;
m_author = a;
}
-void DomUI::setElementComment(const QString& a)
+void DomUI::setElementComment(const QString &a)
{
m_children |= Comment;
m_comment = a;
}
-void DomUI::setElementExportMacro(const QString& a)
+void DomUI::setElementExportMacro(const QString &a)
{
m_children |= ExportMacro;
m_exportMacro = a;
}
-void DomUI::setElementClass(const QString& a)
+void DomUI::setElementClass(const QString &a)
{
m_children |= Class;
m_class = a;
}
-DomWidget* DomUI::takeElementWidget()
+DomWidget *DomUI::takeElementWidget()
{
- DomWidget* a = m_widget;
+ DomWidget *a = m_widget;
m_widget = 0;
m_children ^= Widget;
return a;
}
-void DomUI::setElementWidget(DomWidget* a)
+void DomUI::setElementWidget(DomWidget *a)
{
delete m_widget;
m_children |= Widget;
m_widget = a;
}
-DomLayoutDefault* DomUI::takeElementLayoutDefault()
+DomLayoutDefault *DomUI::takeElementLayoutDefault()
{
- DomLayoutDefault* a = m_layoutDefault;
+ DomLayoutDefault *a = m_layoutDefault;
m_layoutDefault = 0;
m_children ^= LayoutDefault;
return a;
}
-void DomUI::setElementLayoutDefault(DomLayoutDefault* a)
+void DomUI::setElementLayoutDefault(DomLayoutDefault *a)
{
delete m_layoutDefault;
m_children |= LayoutDefault;
m_layoutDefault = a;
}
-DomLayoutFunction* DomUI::takeElementLayoutFunction()
+DomLayoutFunction *DomUI::takeElementLayoutFunction()
{
- DomLayoutFunction* a = m_layoutFunction;
+ DomLayoutFunction *a = m_layoutFunction;
m_layoutFunction = 0;
m_children ^= LayoutFunction;
return a;
}
-void DomUI::setElementLayoutFunction(DomLayoutFunction* a)
+void DomUI::setElementLayoutFunction(DomLayoutFunction *a)
{
delete m_layoutFunction;
m_children |= LayoutFunction;
m_layoutFunction = a;
}
-void DomUI::setElementPixmapFunction(const QString& a)
+void DomUI::setElementPixmapFunction(const QString &a)
{
m_children |= PixmapFunction;
m_pixmapFunction = a;
}
-DomCustomWidgets* DomUI::takeElementCustomWidgets()
+DomCustomWidgets *DomUI::takeElementCustomWidgets()
{
- DomCustomWidgets* a = m_customWidgets;
+ DomCustomWidgets *a = m_customWidgets;
m_customWidgets = 0;
m_children ^= CustomWidgets;
return a;
}
-void DomUI::setElementCustomWidgets(DomCustomWidgets* a)
+void DomUI::setElementCustomWidgets(DomCustomWidgets *a)
{
delete m_customWidgets;
m_children |= CustomWidgets;
m_customWidgets = a;
}
-DomTabStops* DomUI::takeElementTabStops()
+DomTabStops *DomUI::takeElementTabStops()
{
- DomTabStops* a = m_tabStops;
+ DomTabStops *a = m_tabStops;
m_tabStops = 0;
m_children ^= TabStops;
return a;
}
-void DomUI::setElementTabStops(DomTabStops* a)
+void DomUI::setElementTabStops(DomTabStops *a)
{
delete m_tabStops;
m_children |= TabStops;
m_tabStops = a;
}
-DomImages* DomUI::takeElementImages()
-{
- DomImages* a = m_images;
- m_images = 0;
- m_children ^= Images;
- return a;
-}
-
-void DomUI::setElementImages(DomImages* a)
-{
- delete m_images;
- m_children |= Images;
- m_images = a;
-}
-
-DomIncludes* DomUI::takeElementIncludes()
+DomIncludes *DomUI::takeElementIncludes()
{
- DomIncludes* a = m_includes;
+ DomIncludes *a = m_includes;
m_includes = 0;
m_children ^= Includes;
return a;
}
-void DomUI::setElementIncludes(DomIncludes* a)
+void DomUI::setElementIncludes(DomIncludes *a)
{
delete m_includes;
m_children |= Includes;
m_includes = a;
}
-DomResources* DomUI::takeElementResources()
+DomResources *DomUI::takeElementResources()
{
- DomResources* a = m_resources;
+ DomResources *a = m_resources;
m_resources = 0;
m_children ^= Resources;
return a;
}
-void DomUI::setElementResources(DomResources* a)
+void DomUI::setElementResources(DomResources *a)
{
delete m_resources;
m_children |= Resources;
m_resources = a;
}
-DomConnections* DomUI::takeElementConnections()
+DomConnections *DomUI::takeElementConnections()
{
- DomConnections* a = m_connections;
+ DomConnections *a = m_connections;
m_connections = 0;
m_children ^= Connections;
return a;
}
-void DomUI::setElementConnections(DomConnections* a)
+void DomUI::setElementConnections(DomConnections *a)
{
delete m_connections;
m_children |= Connections;
m_connections = a;
}
-DomDesignerData* DomUI::takeElementDesignerdata()
+DomDesignerData *DomUI::takeElementDesignerdata()
{
- DomDesignerData* a = m_designerdata;
+ DomDesignerData *a = m_designerdata;
m_designerdata = 0;
m_children ^= Designerdata;
return a;
}
-void DomUI::setElementDesignerdata(DomDesignerData* a)
+void DomUI::setElementDesignerdata(DomDesignerData *a)
{
delete m_designerdata;
m_children |= Designerdata;
m_designerdata = a;
}
-DomSlots* DomUI::takeElementSlots()
+DomSlots *DomUI::takeElementSlots()
{
- DomSlots* a = m_slots;
+ DomSlots *a = m_slots;
m_slots = 0;
m_children ^= Slots;
return a;
}
-void DomUI::setElementSlots(DomSlots* a)
+void DomUI::setElementSlots(DomSlots *a)
{
delete m_slots;
m_children |= Slots;
m_slots = a;
}
-DomButtonGroups* DomUI::takeElementButtonGroups()
+DomButtonGroups *DomUI::takeElementButtonGroups()
{
- DomButtonGroups* a = m_buttonGroups;
+ DomButtonGroups *a = m_buttonGroups;
m_buttonGroups = 0;
m_children ^= ButtonGroups;
return a;
}
-void DomUI::setElementButtonGroups(DomButtonGroups* a)
+void DomUI::setElementButtonGroups(DomButtonGroups *a)
{
delete m_buttonGroups;
m_children |= ButtonGroups;
@@ -625,13 +514,6 @@ void DomUI::clearElementTabStops()
m_children &= ~TabStops;
}
-void DomUI::clearElementImages()
-{
- delete m_images;
- m_images = 0;
- m_children &= ~Images;
-}
-
void DomUI::clearElementIncludes()
{
delete m_includes;
@@ -674,23 +556,6 @@ void DomUI::clearElementButtonGroups()
m_children &= ~ButtonGroups;
}
-void DomIncludes::clear(bool clear_all)
-{
- qDeleteAll(m_include);
- m_include.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomIncludes::DomIncludes()
-{
- m_children = 0;
-}
-
DomIncludes::~DomIncludes()
{
qDeleteAll(m_include);
@@ -699,12 +564,11 @@ DomIncludes::~DomIncludes()
void DomIncludes::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("include")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("include"), Qt::CaseInsensitive)) {
DomInclude *v = new DomInclude();
v->read(reader);
m_include.append(v);
@@ -714,12 +578,7 @@ void DomIncludes::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -728,54 +587,29 @@ void DomIncludes::read(QXmlStreamReader &reader)
void DomIncludes::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("includes") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("includes") : tagName.toLower());
- for (int i = 0; i < m_include.size(); ++i) {
- DomInclude* v = m_include[i];
+ for (DomInclude *v : m_include)
v->write(writer, QStringLiteral("include"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomIncludes::setElementInclude(const QList<DomInclude*>& a)
+void DomIncludes::setElementInclude(const QVector<DomInclude *> &a)
{
m_children |= Include;
m_include = a;
}
-void DomInclude::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_location = false;
- m_has_attr_impldecl = false;
- }
-
- m_children = 0;
-}
-
-DomInclude::DomInclude()
-{
- m_children = 0;
- m_has_attr_location = false;
- m_has_attr_impldecl = false;
- m_text.clear();
-}
-
DomInclude::~DomInclude()
{
}
void DomInclude::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
continue;
@@ -787,16 +621,15 @@ void DomInclude::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
+ return;
case QXmlStreamReader::Characters :
if (!reader.isWhitespace())
m_text.append(reader.text().toString());
@@ -809,7 +642,7 @@ void DomInclude::read(QXmlStreamReader &reader)
void DomInclude::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("include") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("include") : tagName.toLower());
if (hasAttributeLocation())
writer.writeAttribute(QStringLiteral("location"), attributeLocation());
@@ -823,25 +656,6 @@ void DomInclude::write(QXmlStreamWriter &writer, const QString &tagName) const
writer.writeEndElement();
}
-void DomResources::clear(bool clear_all)
-{
- qDeleteAll(m_include);
- m_include.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
-}
-
-DomResources::DomResources()
-{
- m_children = 0;
- m_has_attr_name = false;
-}
-
DomResources::~DomResources()
{
qDeleteAll(m_include);
@@ -850,10 +664,9 @@ DomResources::~DomResources()
void DomResources::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -861,11 +674,11 @@ void DomResources::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("include")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("include"), Qt::CaseInsensitive)) {
DomResource *v = new DomResource();
v->read(reader);
m_include.append(v);
@@ -875,12 +688,7 @@ void DomResources::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -889,54 +697,32 @@ void DomResources::read(QXmlStreamReader &reader)
void DomResources::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resources") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("resources") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
- for (int i = 0; i < m_include.size(); ++i) {
- DomResource* v = m_include[i];
+ for (DomResource *v : m_include)
v->write(writer, QStringLiteral("include"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomResources::setElementInclude(const QList<DomResource*>& a)
+void DomResources::setElementInclude(const QVector<DomResource *> &a)
{
m_children |= Include;
m_include = a;
}
-void DomResource::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_location = false;
- }
-
- m_children = 0;
-}
-
-DomResource::DomResource()
-{
- m_children = 0;
- m_has_attr_location = false;
-}
-
DomResource::~DomResource()
{
}
void DomResource::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
continue;
@@ -944,20 +730,15 @@ void DomResource::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -966,42 +747,14 @@ void DomResource::read(QXmlStreamReader &reader)
void DomResource::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resource") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("resource") : tagName.toLower());
if (hasAttributeLocation())
writer.writeAttribute(QStringLiteral("location"), attributeLocation());
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomActionGroup::clear(bool clear_all)
-{
- qDeleteAll(m_action);
- m_action.clear();
- qDeleteAll(m_actionGroup);
- m_actionGroup.clear();
- qDeleteAll(m_property);
- m_property.clear();
- qDeleteAll(m_attribute);
- m_attribute.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
-}
-
-DomActionGroup::DomActionGroup()
-{
- m_children = 0;
- m_has_attr_name = false;
-}
-
DomActionGroup::~DomActionGroup()
{
qDeleteAll(m_action);
@@ -1016,10 +769,9 @@ DomActionGroup::~DomActionGroup()
void DomActionGroup::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -1027,29 +779,29 @@ void DomActionGroup::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("action")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("action"), Qt::CaseInsensitive)) {
DomAction *v = new DomAction();
v->read(reader);
m_action.append(v);
continue;
}
- if (tag == QLatin1String("actiongroup")) {
+ if (!tag.compare(QLatin1String("actiongroup"), Qt::CaseInsensitive)) {
DomActionGroup *v = new DomActionGroup();
v->read(reader);
m_actionGroup.append(v);
continue;
}
- if (tag == QLatin1String("property")) {
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
continue;
}
- if (tag == QLatin1String("attribute")) {
+ if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_attribute.append(v);
@@ -1059,12 +811,7 @@ void DomActionGroup::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -1073,80 +820,50 @@ void DomActionGroup::read(QXmlStreamReader &reader)
void DomActionGroup::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("actiongroup") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("actiongroup") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
- for (int i = 0; i < m_action.size(); ++i) {
- DomAction* v = m_action[i];
+ for (DomAction *v : m_action)
v->write(writer, QStringLiteral("action"));
- }
- for (int i = 0; i < m_actionGroup.size(); ++i) {
- DomActionGroup* v = m_actionGroup[i];
+
+ for (DomActionGroup *v : m_actionGroup)
v->write(writer, QStringLiteral("actiongroup"));
- }
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- for (int i = 0; i < m_attribute.size(); ++i) {
- DomProperty* v = m_attribute[i];
+
+ for (DomProperty *v : m_attribute)
v->write(writer, QStringLiteral("attribute"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomActionGroup::setElementAction(const QList<DomAction*>& a)
+void DomActionGroup::setElementAction(const QVector<DomAction *> &a)
{
m_children |= Action;
m_action = a;
}
-void DomActionGroup::setElementActionGroup(const QList<DomActionGroup*>& a)
+void DomActionGroup::setElementActionGroup(const QVector<DomActionGroup *> &a)
{
m_children |= ActionGroup;
m_actionGroup = a;
}
-void DomActionGroup::setElementProperty(const QList<DomProperty*>& a)
+void DomActionGroup::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomActionGroup::setElementAttribute(const QList<DomProperty*>& a)
+void DomActionGroup::setElementAttribute(const QList<DomProperty *> &a)
{
m_children |= Attribute;
m_attribute = a;
}
-void DomAction::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
- qDeleteAll(m_attribute);
- m_attribute.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- m_has_attr_menu = false;
- }
-
- m_children = 0;
-}
-
-DomAction::DomAction()
-{
- m_children = 0;
- m_has_attr_name = false;
- m_has_attr_menu = false;
-}
-
DomAction::~DomAction()
{
qDeleteAll(m_property);
@@ -1157,10 +874,9 @@ DomAction::~DomAction()
void DomAction::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -1172,17 +888,17 @@ void DomAction::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
continue;
}
- if (tag == QLatin1String("attribute")) {
+ if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_attribute.append(v);
@@ -1192,12 +908,7 @@ void DomAction::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -1206,7 +917,7 @@ void DomAction::read(QXmlStreamReader &reader)
void DomAction::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("action") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("action") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
@@ -1214,59 +925,36 @@ void DomAction::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeMenu())
writer.writeAttribute(QStringLiteral("menu"), attributeMenu());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- for (int i = 0; i < m_attribute.size(); ++i) {
- DomProperty* v = m_attribute[i];
+
+ for (DomProperty *v : m_attribute)
v->write(writer, QStringLiteral("attribute"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomAction::setElementProperty(const QList<DomProperty*>& a)
+void DomAction::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomAction::setElementAttribute(const QList<DomProperty*>& a)
+void DomAction::setElementAttribute(const QList<DomProperty *> &a)
{
m_children |= Attribute;
m_attribute = a;
}
-void DomActionRef::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
-}
-
-DomActionRef::DomActionRef()
-{
- m_children = 0;
- m_has_attr_name = false;
-}
-
DomActionRef::~DomActionRef()
{
}
void DomActionRef::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -1274,20 +962,15 @@ void DomActionRef::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -1296,38 +979,14 @@ void DomActionRef::read(QXmlStreamReader &reader)
void DomActionRef::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("actionref") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("actionref") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomButtonGroup::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
- qDeleteAll(m_attribute);
- m_attribute.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
-}
-
-DomButtonGroup::DomButtonGroup()
-{
- m_children = 0;
- m_has_attr_name = false;
-}
-
DomButtonGroup::~DomButtonGroup()
{
qDeleteAll(m_property);
@@ -1338,10 +997,9 @@ DomButtonGroup::~DomButtonGroup()
void DomButtonGroup::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -1349,17 +1007,17 @@ void DomButtonGroup::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
continue;
}
- if (tag == QLatin1String("attribute")) {
+ if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_attribute.append(v);
@@ -1369,12 +1027,7 @@ void DomButtonGroup::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -1383,54 +1036,32 @@ void DomButtonGroup::read(QXmlStreamReader &reader)
void DomButtonGroup::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("buttongroup") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("buttongroup") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- for (int i = 0; i < m_attribute.size(); ++i) {
- DomProperty* v = m_attribute[i];
+
+ for (DomProperty *v : m_attribute)
v->write(writer, QStringLiteral("attribute"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomButtonGroup::setElementProperty(const QList<DomProperty*>& a)
+void DomButtonGroup::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomButtonGroup::setElementAttribute(const QList<DomProperty*>& a)
+void DomButtonGroup::setElementAttribute(const QList<DomProperty *> &a)
{
m_children |= Attribute;
m_attribute = a;
}
-void DomButtonGroups::clear(bool clear_all)
-{
- qDeleteAll(m_buttonGroup);
- m_buttonGroup.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomButtonGroups::DomButtonGroups()
-{
- m_children = 0;
-}
-
DomButtonGroups::~DomButtonGroups()
{
qDeleteAll(m_buttonGroup);
@@ -1439,12 +1070,11 @@ DomButtonGroups::~DomButtonGroups()
void DomButtonGroups::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("buttongroup")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("buttongroup"), Qt::CaseInsensitive)) {
DomButtonGroup *v = new DomButtonGroup();
v->read(reader);
m_buttonGroup.append(v);
@@ -1454,12 +1084,7 @@ void DomButtonGroups::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -1468,295 +1093,20 @@ void DomButtonGroups::read(QXmlStreamReader &reader)
void DomButtonGroups::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("buttongroups") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("buttongroups") : tagName.toLower());
- for (int i = 0; i < m_buttonGroup.size(); ++i) {
- DomButtonGroup* v = m_buttonGroup[i];
+ for (DomButtonGroup *v : m_buttonGroup)
v->write(writer, QStringLiteral("buttongroup"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomButtonGroups::setElementButtonGroup(const QList<DomButtonGroup*>& a)
+void DomButtonGroups::setElementButtonGroup(const QVector<DomButtonGroup *> &a)
{
m_children |= ButtonGroup;
m_buttonGroup = a;
}
-void DomImages::clear(bool clear_all)
-{
- qDeleteAll(m_image);
- m_image.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomImages::DomImages()
-{
- m_children = 0;
-}
-
-DomImages::~DomImages()
-{
- qDeleteAll(m_image);
- m_image.clear();
-}
-
-void DomImages::read(QXmlStreamReader &reader)
-{
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("image")) {
- DomImage *v = new DomImage();
- v->read(reader);
- m_image.append(v);
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomImages::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("images") : tagName.toLower());
-
- for (int i = 0; i < m_image.size(); ++i) {
- DomImage* v = m_image[i];
- v->write(writer, QStringLiteral("image"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomImages::setElementImage(const QList<DomImage*>& a)
-{
- m_children |= Image;
- m_image = a;
-}
-
-void DomImage::clear(bool clear_all)
-{
- delete m_data;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
- m_data = 0;
-}
-
-DomImage::DomImage()
-{
- m_children = 0;
- m_has_attr_name = false;
- m_data = 0;
-}
-
-DomImage::~DomImage()
-{
- delete m_data;
-}
-
-void DomImage::read(QXmlStreamReader &reader)
-{
-
- const QXmlStreamAttributes attributes = reader.attributes();
- for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
- if (name == QLatin1String("name")) {
- setAttributeName(attribute.value().toString());
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected attribute ") + name);
- }
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("data")) {
- DomImageData *v = new DomImageData();
- v->read(reader);
- setElementData(v);
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomImage::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("image") : tagName.toLower());
-
- if (hasAttributeName())
- writer.writeAttribute(QStringLiteral("name"), attributeName());
-
- if (m_children & Data) {
- m_data->write(writer, QStringLiteral("data"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-DomImageData* DomImage::takeElementData()
-{
- DomImageData* a = m_data;
- m_data = 0;
- m_children ^= Data;
- return a;
-}
-
-void DomImage::setElementData(DomImageData* a)
-{
- delete m_data;
- m_children |= Data;
- m_data = a;
-}
-
-void DomImage::clearElementData()
-{
- delete m_data;
- m_data = 0;
- m_children &= ~Data;
-}
-
-void DomImageData::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_format = false;
- m_has_attr_length = false;
- m_attr_length = 0;
- }
-
- m_children = 0;
-}
-
-DomImageData::DomImageData()
-{
- m_children = 0;
- m_has_attr_format = false;
- m_has_attr_length = false;
- m_attr_length = 0;
- m_text.clear();
-}
-
-DomImageData::~DomImageData()
-{
-}
-
-void DomImageData::read(QXmlStreamReader &reader)
-{
-
- const QXmlStreamAttributes attributes = reader.attributes();
- for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
- if (name == QLatin1String("format")) {
- setAttributeFormat(attribute.value().toString());
- continue;
- }
- if (name == QLatin1String("length")) {
- setAttributeLength(attribute.value().toInt());
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected attribute ") + name);
- }
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomImageData::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("imagedata") : tagName.toLower());
-
- if (hasAttributeFormat())
- writer.writeAttribute(QStringLiteral("format"), attributeFormat());
-
- if (hasAttributeLength())
- writer.writeAttribute(QStringLiteral("length"), QString::number(attributeLength()));
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomCustomWidgets::clear(bool clear_all)
-{
- qDeleteAll(m_customWidget);
- m_customWidget.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomCustomWidgets::DomCustomWidgets()
-{
- m_children = 0;
-}
-
DomCustomWidgets::~DomCustomWidgets()
{
qDeleteAll(m_customWidget);
@@ -1765,12 +1115,11 @@ DomCustomWidgets::~DomCustomWidgets()
void DomCustomWidgets::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("customwidget")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("customwidget"), Qt::CaseInsensitive)) {
DomCustomWidget *v = new DomCustomWidget();
v->read(reader);
m_customWidget.append(v);
@@ -1780,12 +1129,7 @@ void DomCustomWidgets::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -1794,52 +1138,29 @@ void DomCustomWidgets::read(QXmlStreamReader &reader)
void DomCustomWidgets::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("customwidgets") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("customwidgets") : tagName.toLower());
- for (int i = 0; i < m_customWidget.size(); ++i) {
- DomCustomWidget* v = m_customWidget[i];
+ for (DomCustomWidget *v : m_customWidget)
v->write(writer, QStringLiteral("customwidget"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomCustomWidgets::setElementCustomWidget(const QList<DomCustomWidget*>& a)
+void DomCustomWidgets::setElementCustomWidget(const QVector<DomCustomWidget *> &a)
{
m_children |= CustomWidget;
m_customWidget = a;
}
-void DomHeader::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_location = false;
- }
-
- m_children = 0;
-}
-
-DomHeader::DomHeader()
-{
- m_children = 0;
- m_has_attr_location = false;
- m_text.clear();
-}
-
DomHeader::~DomHeader()
{
}
void DomHeader::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
continue;
@@ -1847,16 +1168,15 @@ void DomHeader::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
+ return;
case QXmlStreamReader::Characters :
if (!reader.isWhitespace())
m_text.append(reader.text().toString());
@@ -1869,7 +1189,7 @@ void DomHeader::read(QXmlStreamReader &reader)
void DomHeader::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("header") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("header") : tagName.toLower());
if (hasAttributeLocation())
writer.writeAttribute(QStringLiteral("location"), attributeLocation());
@@ -1880,119 +1200,74 @@ void DomHeader::write(QXmlStreamWriter &writer, const QString &tagName) const
writer.writeEndElement();
}
-void DomCustomWidget::clear(bool clear_all)
-{
- delete m_header;
- delete m_sizeHint;
- delete m_sizePolicy;
- delete m_script;
- delete m_properties;
- delete m_slots;
- delete m_propertyspecifications;
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_header = 0;
- m_sizeHint = 0;
- m_container = 0;
- m_sizePolicy = 0;
- m_script = 0;
- m_properties = 0;
- m_slots = 0;
- m_propertyspecifications = 0;
-}
-
-DomCustomWidget::DomCustomWidget()
-{
- m_children = 0;
- m_header = 0;
- m_sizeHint = 0;
- m_container = 0;
- m_sizePolicy = 0;
- m_script = 0;
- m_properties = 0;
- m_slots = 0;
- m_propertyspecifications = 0;
-}
-
DomCustomWidget::~DomCustomWidget()
{
delete m_header;
delete m_sizeHint;
- delete m_sizePolicy;
- delete m_script;
- delete m_properties;
delete m_slots;
delete m_propertyspecifications;
}
void DomCustomWidget::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("class")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("class"), Qt::CaseInsensitive)) {
setElementClass(reader.readElementText());
continue;
}
- if (tag == QLatin1String("extends")) {
+ if (!tag.compare(QLatin1String("extends"), Qt::CaseInsensitive)) {
setElementExtends(reader.readElementText());
continue;
}
- if (tag == QLatin1String("header")) {
+ if (!tag.compare(QLatin1String("header"), Qt::CaseInsensitive)) {
DomHeader *v = new DomHeader();
v->read(reader);
setElementHeader(v);
continue;
}
- if (tag == QLatin1String("sizehint")) {
+ if (!tag.compare(QLatin1String("sizehint"), Qt::CaseInsensitive)) {
DomSize *v = new DomSize();
v->read(reader);
setElementSizeHint(v);
continue;
}
- if (tag == QLatin1String("addpagemethod")) {
+ if (!tag.compare(QLatin1String("addpagemethod"), Qt::CaseInsensitive)) {
setElementAddPageMethod(reader.readElementText());
continue;
}
- if (tag == QLatin1String("container")) {
+ if (!tag.compare(QLatin1String("container"), Qt::CaseInsensitive)) {
setElementContainer(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("sizepolicy")) {
- DomSizePolicyData *v = new DomSizePolicyData();
- v->read(reader);
- setElementSizePolicy(v);
+ if (!tag.compare(QLatin1String("sizepolicy"), Qt::CaseInsensitive)) {
+ qWarning("Omitting deprecated element <sizepolicy>.");
+ reader.skipCurrentElement();
continue;
}
- if (tag == QLatin1String("pixmap")) {
+ if (!tag.compare(QLatin1String("pixmap"), Qt::CaseInsensitive)) {
setElementPixmap(reader.readElementText());
continue;
}
- if (tag == QLatin1String("script")) {
- DomScript *v = new DomScript();
- v->read(reader);
- setElementScript(v);
+ if (!tag.compare(QLatin1String("script"), Qt::CaseInsensitive)) {
+ qWarning("Omitting deprecated element <script>.");
+ reader.skipCurrentElement();
continue;
}
- if (tag == QLatin1String("properties")) {
- DomProperties *v = new DomProperties();
- v->read(reader);
- setElementProperties(v);
+ if (!tag.compare(QLatin1String("properties"), Qt::CaseInsensitive)) {
+ qWarning("Omitting deprecated element <properties>.");
+ reader.skipCurrentElement();
continue;
}
- if (tag == QLatin1String("slots")) {
+ if (!tag.compare(QLatin1String("slots"), Qt::CaseInsensitive)) {
DomSlots *v = new DomSlots();
v->read(reader);
setElementSlots(v);
continue;
}
- if (tag == QLatin1String("propertyspecifications")) {
+ if (!tag.compare(QLatin1String("propertyspecifications"), Qt::CaseInsensitive)) {
DomPropertySpecifications *v = new DomPropertySpecifications();
v->read(reader);
setElementPropertyspecifications(v);
@@ -2002,12 +1277,7 @@ void DomCustomWidget::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -2016,105 +1286,81 @@ void DomCustomWidget::read(QXmlStreamReader &reader)
void DomCustomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("customwidget") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("customwidget") : tagName.toLower());
- if (m_children & Class) {
+ if (m_children & Class)
writer.writeTextElement(QStringLiteral("class"), m_class);
- }
- if (m_children & Extends) {
+ if (m_children & Extends)
writer.writeTextElement(QStringLiteral("extends"), m_extends);
- }
- if (m_children & Header) {
+ if (m_children & Header)
m_header->write(writer, QStringLiteral("header"));
- }
- if (m_children & SizeHint) {
+ if (m_children & SizeHint)
m_sizeHint->write(writer, QStringLiteral("sizehint"));
- }
- if (m_children & AddPageMethod) {
+ if (m_children & AddPageMethod)
writer.writeTextElement(QStringLiteral("addpagemethod"), m_addPageMethod);
- }
- if (m_children & Container) {
+ if (m_children & Container)
writer.writeTextElement(QStringLiteral("container"), QString::number(m_container));
- }
-
- if (m_children & SizePolicy) {
- m_sizePolicy->write(writer, QStringLiteral("sizepolicy"));
- }
- if (m_children & Pixmap) {
+ if (m_children & Pixmap)
writer.writeTextElement(QStringLiteral("pixmap"), m_pixmap);
- }
-
- if (m_children & Script) {
- m_script->write(writer, QStringLiteral("script"));
- }
- if (m_children & Properties) {
- m_properties->write(writer, QStringLiteral("properties"));
- }
-
- if (m_children & Slots) {
+ if (m_children & Slots)
m_slots->write(writer, QStringLiteral("slots"));
- }
- if (m_children & Propertyspecifications) {
+ if (m_children & Propertyspecifications)
m_propertyspecifications->write(writer, QStringLiteral("propertyspecifications"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomCustomWidget::setElementClass(const QString& a)
+void DomCustomWidget::setElementClass(const QString &a)
{
m_children |= Class;
m_class = a;
}
-void DomCustomWidget::setElementExtends(const QString& a)
+void DomCustomWidget::setElementExtends(const QString &a)
{
m_children |= Extends;
m_extends = a;
}
-DomHeader* DomCustomWidget::takeElementHeader()
+DomHeader *DomCustomWidget::takeElementHeader()
{
- DomHeader* a = m_header;
+ DomHeader *a = m_header;
m_header = 0;
m_children ^= Header;
return a;
}
-void DomCustomWidget::setElementHeader(DomHeader* a)
+void DomCustomWidget::setElementHeader(DomHeader *a)
{
delete m_header;
m_children |= Header;
m_header = a;
}
-DomSize* DomCustomWidget::takeElementSizeHint()
+DomSize *DomCustomWidget::takeElementSizeHint()
{
- DomSize* a = m_sizeHint;
+ DomSize *a = m_sizeHint;
m_sizeHint = 0;
m_children ^= SizeHint;
return a;
}
-void DomCustomWidget::setElementSizeHint(DomSize* a)
+void DomCustomWidget::setElementSizeHint(DomSize *a)
{
delete m_sizeHint;
m_children |= SizeHint;
m_sizeHint = a;
}
-void DomCustomWidget::setElementAddPageMethod(const QString& a)
+void DomCustomWidget::setElementAddPageMethod(const QString &a)
{
m_children |= AddPageMethod;
m_addPageMethod = a;
@@ -2126,81 +1372,36 @@ void DomCustomWidget::setElementContainer(int a)
m_container = a;
}
-DomSizePolicyData* DomCustomWidget::takeElementSizePolicy()
-{
- DomSizePolicyData* a = m_sizePolicy;
- m_sizePolicy = 0;
- m_children ^= SizePolicy;
- return a;
-}
-
-void DomCustomWidget::setElementSizePolicy(DomSizePolicyData* a)
-{
- delete m_sizePolicy;
- m_children |= SizePolicy;
- m_sizePolicy = a;
-}
-
-void DomCustomWidget::setElementPixmap(const QString& a)
+void DomCustomWidget::setElementPixmap(const QString &a)
{
m_children |= Pixmap;
m_pixmap = a;
}
-DomScript* DomCustomWidget::takeElementScript()
-{
- DomScript* a = m_script;
- m_script = 0;
- m_children ^= Script;
- return a;
-}
-
-void DomCustomWidget::setElementScript(DomScript* a)
-{
- delete m_script;
- m_children |= Script;
- m_script = a;
-}
-
-DomProperties* DomCustomWidget::takeElementProperties()
+DomSlots *DomCustomWidget::takeElementSlots()
{
- DomProperties* a = m_properties;
- m_properties = 0;
- m_children ^= Properties;
- return a;
-}
-
-void DomCustomWidget::setElementProperties(DomProperties* a)
-{
- delete m_properties;
- m_children |= Properties;
- m_properties = a;
-}
-
-DomSlots* DomCustomWidget::takeElementSlots()
-{
- DomSlots* a = m_slots;
+ DomSlots *a = m_slots;
m_slots = 0;
m_children ^= Slots;
return a;
}
-void DomCustomWidget::setElementSlots(DomSlots* a)
+void DomCustomWidget::setElementSlots(DomSlots *a)
{
delete m_slots;
m_children |= Slots;
m_slots = a;
}
-DomPropertySpecifications* DomCustomWidget::takeElementPropertyspecifications()
+DomPropertySpecifications *DomCustomWidget::takeElementPropertyspecifications()
{
- DomPropertySpecifications* a = m_propertyspecifications;
+ DomPropertySpecifications *a = m_propertyspecifications;
m_propertyspecifications = 0;
m_children ^= Propertyspecifications;
return a;
}
-void DomCustomWidget::setElementPropertyspecifications(DomPropertySpecifications* a)
+void DomCustomWidget::setElementPropertyspecifications(DomPropertySpecifications *a)
{
delete m_propertyspecifications;
m_children |= Propertyspecifications;
@@ -2241,32 +1442,11 @@ void DomCustomWidget::clearElementContainer()
m_children &= ~Container;
}
-void DomCustomWidget::clearElementSizePolicy()
-{
- delete m_sizePolicy;
- m_sizePolicy = 0;
- m_children &= ~SizePolicy;
-}
-
void DomCustomWidget::clearElementPixmap()
{
m_children &= ~Pixmap;
}
-void DomCustomWidget::clearElementScript()
-{
- delete m_script;
- m_script = 0;
- m_children &= ~Script;
-}
-
-void DomCustomWidget::clearElementProperties()
-{
- delete m_properties;
- m_properties = 0;
- m_children &= ~Properties;
-}
-
void DomCustomWidget::clearElementSlots()
{
delete m_slots;
@@ -2281,272 +1461,15 @@ void DomCustomWidget::clearElementPropertyspecifications()
m_children &= ~Propertyspecifications;
}
-void DomProperties::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomProperties::DomProperties()
-{
- m_children = 0;
-}
-
-DomProperties::~DomProperties()
-{
- qDeleteAll(m_property);
- m_property.clear();
-}
-
-void DomProperties::read(QXmlStreamReader &reader)
-{
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
- DomPropertyData *v = new DomPropertyData();
- v->read(reader);
- m_property.append(v);
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomProperties::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("properties") : tagName.toLower());
-
- for (int i = 0; i < m_property.size(); ++i) {
- DomPropertyData* v = m_property[i];
- v->write(writer, QStringLiteral("property"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomProperties::setElementProperty(const QList<DomPropertyData*>& a)
-{
- m_children |= Property;
- m_property = a;
-}
-
-void DomPropertyData::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_type = false;
- }
-
- m_children = 0;
-}
-
-DomPropertyData::DomPropertyData()
-{
- m_children = 0;
- m_has_attr_type = false;
-}
-
-DomPropertyData::~DomPropertyData()
-{
-}
-
-void DomPropertyData::read(QXmlStreamReader &reader)
-{
-
- const QXmlStreamAttributes attributes = reader.attributes();
- for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
- if (name == QLatin1String("type")) {
- setAttributeType(attribute.value().toString());
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected attribute ") + name);
- }
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomPropertyData::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertydata") : tagName.toLower());
-
- if (hasAttributeType())
- writer.writeAttribute(QStringLiteral("type"), attributeType());
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomSizePolicyData::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_horData = 0;
- m_verData = 0;
-}
-
-DomSizePolicyData::DomSizePolicyData()
-{
- m_children = 0;
- m_horData = 0;
- m_verData = 0;
-}
-
-DomSizePolicyData::~DomSizePolicyData()
-{
-}
-
-void DomSizePolicyData::read(QXmlStreamReader &reader)
-{
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("hordata")) {
- setElementHorData(reader.readElementText().toInt());
- continue;
- }
- if (tag == QLatin1String("verdata")) {
- setElementVerData(reader.readElementText().toInt());
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomSizePolicyData::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicydata") : tagName.toLower());
-
- if (m_children & HorData) {
- writer.writeTextElement(QStringLiteral("hordata"), QString::number(m_horData));
- }
-
- if (m_children & VerData) {
- writer.writeTextElement(QStringLiteral("verdata"), QString::number(m_verData));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomSizePolicyData::setElementHorData(int a)
-{
- m_children |= HorData;
- m_horData = a;
-}
-
-void DomSizePolicyData::setElementVerData(int a)
-{
- m_children |= VerData;
- m_verData = a;
-}
-
-void DomSizePolicyData::clearElementHorData()
-{
- m_children &= ~HorData;
-}
-
-void DomSizePolicyData::clearElementVerData()
-{
- m_children &= ~VerData;
-}
-
-void DomLayoutDefault::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_spacing = false;
- m_attr_spacing = 0;
- m_has_attr_margin = false;
- m_attr_margin = 0;
- }
-
- m_children = 0;
-}
-
-DomLayoutDefault::DomLayoutDefault()
-{
- m_children = 0;
- m_has_attr_spacing = false;
- m_attr_spacing = 0;
- m_has_attr_margin = false;
- m_attr_margin = 0;
-}
-
DomLayoutDefault::~DomLayoutDefault()
{
}
void DomLayoutDefault::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
setAttributeSpacing(attribute.value().toInt());
continue;
@@ -2558,20 +1481,15 @@ void DomLayoutDefault::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -2580,7 +1498,7 @@ void DomLayoutDefault::read(QXmlStreamReader &reader)
void DomLayoutDefault::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutdefault") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("layoutdefault") : tagName.toLower());
if (hasAttributeSpacing())
writer.writeAttribute(QStringLiteral("spacing"), QString::number(attributeSpacing()));
@@ -2588,41 +1506,18 @@ void DomLayoutDefault::write(QXmlStreamWriter &writer, const QString &tagName) c
if (hasAttributeMargin())
writer.writeAttribute(QStringLiteral("margin"), QString::number(attributeMargin()));
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomLayoutFunction::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_spacing = false;
- m_has_attr_margin = false;
- }
-
- m_children = 0;
-}
-
-DomLayoutFunction::DomLayoutFunction()
-{
- m_children = 0;
- m_has_attr_spacing = false;
- m_has_attr_margin = false;
-}
-
DomLayoutFunction::~DomLayoutFunction()
{
}
void DomLayoutFunction::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
setAttributeSpacing(attribute.value().toString());
continue;
@@ -2634,20 +1529,15 @@ void DomLayoutFunction::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -2656,7 +1546,7 @@ void DomLayoutFunction::read(QXmlStreamReader &reader)
void DomLayoutFunction::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutfunction") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("layoutfunction") : tagName.toLower());
if (hasAttributeSpacing())
writer.writeAttribute(QStringLiteral("spacing"), attributeSpacing());
@@ -2664,28 +1554,9 @@ void DomLayoutFunction::write(QXmlStreamWriter &writer, const QString &tagName)
if (hasAttributeMargin())
writer.writeAttribute(QStringLiteral("margin"), attributeMargin());
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomTabStops::clear(bool clear_all)
-{
- m_tabStop.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomTabStops::DomTabStops()
-{
- m_children = 0;
-}
-
DomTabStops::~DomTabStops()
{
m_tabStop.clear();
@@ -2693,12 +1564,11 @@ DomTabStops::~DomTabStops()
void DomTabStops::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("tabstop")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("tabstop"), Qt::CaseInsensitive)) {
m_tabStop.append(reader.readElementText());
continue;
}
@@ -2706,12 +1576,7 @@ void DomTabStops::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -2720,59 +1585,20 @@ void DomTabStops::read(QXmlStreamReader &reader)
void DomTabStops::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("tabstops") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("tabstops") : tagName.toLower());
- for (int i = 0; i < m_tabStop.size(); ++i) {
- QString v = m_tabStop[i];
+ for (const QString &v : m_tabStop)
writer.writeTextElement(QStringLiteral("tabstop"), v);
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomTabStops::setElementTabStop(const QStringList& a)
+void DomTabStops::setElementTabStop(const QStringList &a)
{
m_children |= TabStop;
m_tabStop = a;
}
-void DomLayout::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
- qDeleteAll(m_attribute);
- m_attribute.clear();
- qDeleteAll(m_item);
- m_item.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_class = false;
- m_has_attr_name = false;
- m_has_attr_stretch = false;
- m_has_attr_rowStretch = false;
- m_has_attr_columnStretch = false;
- m_has_attr_rowMinimumHeight = false;
- m_has_attr_columnMinimumWidth = false;
- }
-
- m_children = 0;
-}
-
-DomLayout::DomLayout()
-{
- m_children = 0;
- m_has_attr_class = false;
- m_has_attr_name = false;
- m_has_attr_stretch = false;
- m_has_attr_rowStretch = false;
- m_has_attr_columnStretch = false;
- m_has_attr_rowMinimumHeight = false;
- m_has_attr_columnMinimumWidth = false;
-}
-
DomLayout::~DomLayout()
{
qDeleteAll(m_property);
@@ -2785,10 +1611,9 @@ DomLayout::~DomLayout()
void DomLayout::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("class")) {
setAttributeClass(attribute.value().toString());
continue;
@@ -2820,23 +1645,23 @@ void DomLayout::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
continue;
}
- if (tag == QLatin1String("attribute")) {
+ if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_attribute.append(v);
continue;
}
- if (tag == QLatin1String("item")) {
+ if (!tag.compare(QLatin1String("item"), Qt::CaseInsensitive)) {
DomLayoutItem *v = new DomLayoutItem();
v->read(reader);
m_item.append(v);
@@ -2846,12 +1671,7 @@ void DomLayout::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -2860,7 +1680,7 @@ void DomLayout::read(QXmlStreamReader &reader)
void DomLayout::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layout") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("layout") : tagName.toLower());
if (hasAttributeClass())
writer.writeAttribute(QStringLiteral("class"), attributeClass());
@@ -2883,99 +1703,61 @@ void DomLayout::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeColumnMinimumWidth())
writer.writeAttribute(QStringLiteral("columnminimumwidth"), attributeColumnMinimumWidth());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- for (int i = 0; i < m_attribute.size(); ++i) {
- DomProperty* v = m_attribute[i];
+
+ for (DomProperty *v : m_attribute)
v->write(writer, QStringLiteral("attribute"));
- }
- for (int i = 0; i < m_item.size(); ++i) {
- DomLayoutItem* v = m_item[i];
+
+ for (DomLayoutItem *v : m_item)
v->write(writer, QStringLiteral("item"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomLayout::setElementProperty(const QList<DomProperty*>& a)
+void DomLayout::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomLayout::setElementAttribute(const QList<DomProperty*>& a)
+void DomLayout::setElementAttribute(const QList<DomProperty *> &a)
{
m_children |= Attribute;
m_attribute = a;
}
-void DomLayout::setElementItem(const QList<DomLayoutItem*>& a)
+void DomLayout::setElementItem(const QVector<DomLayoutItem *> &a)
{
m_children |= Item;
m_item = a;
}
-void DomLayoutItem::clear(bool clear_all)
+DomLayoutItem::~DomLayoutItem()
{
delete m_widget;
delete m_layout;
delete m_spacer;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_row = false;
- m_attr_row = 0;
- m_has_attr_column = false;
- m_attr_column = 0;
- m_has_attr_rowSpan = false;
- m_attr_rowSpan = 0;
- m_has_attr_colSpan = false;
- m_attr_colSpan = 0;
- m_has_attr_alignment = false;
- }
-
- m_kind = Unknown;
-
- m_widget = 0;
- m_layout = 0;
- m_spacer = 0;
}
-DomLayoutItem::DomLayoutItem()
-{
- m_kind = Unknown;
-
- m_has_attr_row = false;
- m_attr_row = 0;
- m_has_attr_column = false;
- m_attr_column = 0;
- m_has_attr_rowSpan = false;
- m_attr_rowSpan = 0;
- m_has_attr_colSpan = false;
- m_attr_colSpan = 0;
- m_has_attr_alignment = false;
- m_widget = 0;
- m_layout = 0;
- m_spacer = 0;
-}
-
-DomLayoutItem::~DomLayoutItem()
+void DomLayoutItem::clear()
{
delete m_widget;
delete m_layout;
delete m_spacer;
+
+ m_kind = Unknown;
+
+ m_widget = nullptr;
+ m_layout = nullptr;
+ m_spacer = nullptr;
}
void DomLayoutItem::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
setAttributeRow(attribute.value().toInt());
continue;
@@ -2999,23 +1781,23 @@ void DomLayoutItem::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("widget")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("widget"), Qt::CaseInsensitive)) {
DomWidget *v = new DomWidget();
v->read(reader);
setElementWidget(v);
continue;
}
- if (tag == QLatin1String("layout")) {
+ if (!tag.compare(QLatin1String("layout"), Qt::CaseInsensitive)) {
DomLayout *v = new DomLayout();
v->read(reader);
setElementLayout(v);
continue;
}
- if (tag == QLatin1String("spacer")) {
+ if (!tag.compare(QLatin1String("spacer"), Qt::CaseInsensitive)) {
DomSpacer *v = new DomSpacer();
v->read(reader);
setElementSpacer(v);
@@ -3025,12 +1807,7 @@ void DomLayoutItem::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3039,7 +1816,7 @@ void DomLayoutItem::read(QXmlStreamReader &reader)
void DomLayoutItem::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutitem") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("layoutitem") : tagName.toLower());
if (hasAttributeRow())
writer.writeAttribute(QStringLiteral("row"), QString::number(attributeRow()));
@@ -3057,95 +1834,72 @@ void DomLayoutItem::write(QXmlStreamWriter &writer, const QString &tagName) cons
writer.writeAttribute(QStringLiteral("alignment"), attributeAlignment());
switch (kind()) {
- case Widget: {
- DomWidget* v = elementWidget();
- if (v != 0) {
- v->write(writer, QStringLiteral("widget"));
- }
- break;
- }
- case Layout: {
- DomLayout* v = elementLayout();
- if (v != 0) {
- v->write(writer, QStringLiteral("layout"));
- }
- break;
- }
- case Spacer: {
- DomSpacer* v = elementSpacer();
- if (v != 0) {
- v->write(writer, QStringLiteral("spacer"));
- }
- break;
- }
- default:
- break;
+ case Widget: {
+ DomWidget *v = elementWidget();
+ if (v != 0)
+ v->write(writer, QStringLiteral("widget"));
+ break;
+ }
+ case Layout: {
+ DomLayout *v = elementLayout();
+ if (v != 0)
+ v->write(writer, QStringLiteral("layout"));
+ break;
+ }
+ case Spacer: {
+ DomSpacer *v = elementSpacer();
+ if (v != 0)
+ v->write(writer, QStringLiteral("spacer"));
+ break;
+ }
+ default:
+ break;
}
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-DomWidget* DomLayoutItem::takeElementWidget()
+DomWidget *DomLayoutItem::takeElementWidget()
{
- DomWidget* a = m_widget;
+ DomWidget *a = m_widget;
m_widget = 0;
return a;
}
-void DomLayoutItem::setElementWidget(DomWidget* a)
+void DomLayoutItem::setElementWidget(DomWidget *a)
{
- clear(false);
+ clear();
m_kind = Widget;
m_widget = a;
}
-DomLayout* DomLayoutItem::takeElementLayout()
+DomLayout *DomLayoutItem::takeElementLayout()
{
- DomLayout* a = m_layout;
+ DomLayout *a = m_layout;
m_layout = 0;
return a;
}
-void DomLayoutItem::setElementLayout(DomLayout* a)
+void DomLayoutItem::setElementLayout(DomLayout *a)
{
- clear(false);
+ clear();
m_kind = Layout;
m_layout = a;
}
-DomSpacer* DomLayoutItem::takeElementSpacer()
+DomSpacer *DomLayoutItem::takeElementSpacer()
{
- DomSpacer* a = m_spacer;
+ DomSpacer *a = m_spacer;
m_spacer = 0;
return a;
}
-void DomLayoutItem::setElementSpacer(DomSpacer* a)
+void DomLayoutItem::setElementSpacer(DomSpacer *a)
{
- clear(false);
+ clear();
m_kind = Spacer;
m_spacer = a;
}
-void DomRow::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomRow::DomRow()
-{
- m_children = 0;
-}
-
DomRow::~DomRow()
{
qDeleteAll(m_property);
@@ -3154,12 +1908,11 @@ DomRow::~DomRow()
void DomRow::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
@@ -3169,12 +1922,7 @@ void DomRow::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3183,41 +1931,20 @@ void DomRow::read(QXmlStreamReader &reader)
void DomRow::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("row") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("row") : tagName.toLower());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomRow::setElementProperty(const QList<DomProperty*>& a)
+void DomRow::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomColumn::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomColumn::DomColumn()
-{
- m_children = 0;
-}
-
DomColumn::~DomColumn()
{
qDeleteAll(m_property);
@@ -3226,12 +1953,11 @@ DomColumn::~DomColumn()
void DomColumn::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
@@ -3241,12 +1967,7 @@ void DomColumn::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3255,51 +1976,20 @@ void DomColumn::read(QXmlStreamReader &reader)
void DomColumn::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("column") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("column") : tagName.toLower());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomColumn::setElementProperty(const QList<DomProperty*>& a)
+void DomColumn::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomItem::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
- qDeleteAll(m_item);
- m_item.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_row = false;
- m_attr_row = 0;
- m_has_attr_column = false;
- m_attr_column = 0;
- }
-
- m_children = 0;
-}
-
-DomItem::DomItem()
-{
- m_children = 0;
- m_has_attr_row = false;
- m_attr_row = 0;
- m_has_attr_column = false;
- m_attr_column = 0;
-}
-
DomItem::~DomItem()
{
qDeleteAll(m_property);
@@ -3310,10 +2000,9 @@ DomItem::~DomItem()
void DomItem::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
setAttributeRow(attribute.value().toInt());
continue;
@@ -3325,17 +2014,17 @@ void DomItem::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
continue;
}
- if (tag == QLatin1String("item")) {
+ if (!tag.compare(QLatin1String("item"), Qt::CaseInsensitive)) {
DomItem *v = new DomItem();
v->read(reader);
m_item.append(v);
@@ -3345,12 +2034,7 @@ void DomItem::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3359,7 +2043,7 @@ void DomItem::read(QXmlStreamReader &reader)
void DomItem::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("item") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("item") : tagName.toLower());
if (hasAttributeRow())
writer.writeAttribute(QStringLiteral("row"), QString::number(attributeRow()));
@@ -3367,90 +2051,32 @@ void DomItem::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeColumn())
writer.writeAttribute(QStringLiteral("column"), QString::number(attributeColumn()));
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- for (int i = 0; i < m_item.size(); ++i) {
- DomItem* v = m_item[i];
+
+ for (DomItem *v : m_item)
v->write(writer, QStringLiteral("item"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomItem::setElementProperty(const QList<DomProperty*>& a)
+void DomItem::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomItem::setElementItem(const QList<DomItem*>& a)
+void DomItem::setElementItem(const QVector<DomItem *> &a)
{
m_children |= Item;
m_item = a;
}
-void DomWidget::clear(bool clear_all)
-{
- m_class.clear();
- qDeleteAll(m_property);
- m_property.clear();
- qDeleteAll(m_script);
- m_script.clear();
- qDeleteAll(m_widgetData);
- m_widgetData.clear();
- qDeleteAll(m_attribute);
- m_attribute.clear();
- qDeleteAll(m_row);
- m_row.clear();
- qDeleteAll(m_column);
- m_column.clear();
- qDeleteAll(m_item);
- m_item.clear();
- qDeleteAll(m_layout);
- m_layout.clear();
- qDeleteAll(m_widget);
- m_widget.clear();
- qDeleteAll(m_action);
- m_action.clear();
- qDeleteAll(m_actionGroup);
- m_actionGroup.clear();
- qDeleteAll(m_addAction);
- m_addAction.clear();
- m_zOrder.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_class = false;
- m_has_attr_name = false;
- m_has_attr_native = false;
- m_attr_native = false;
- }
-
- m_children = 0;
-}
-
-DomWidget::DomWidget()
-{
- m_children = 0;
- m_has_attr_class = false;
- m_has_attr_name = false;
- m_has_attr_native = false;
- m_attr_native = false;
-}
-
DomWidget::~DomWidget()
{
m_class.clear();
qDeleteAll(m_property);
m_property.clear();
- qDeleteAll(m_script);
- m_script.clear();
- qDeleteAll(m_widgetData);
- m_widgetData.clear();
qDeleteAll(m_attribute);
m_attribute.clear();
qDeleteAll(m_row);
@@ -3474,10 +2100,9 @@ DomWidget::~DomWidget()
void DomWidget::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("class")) {
setAttributeClass(attribute.value().toString());
continue;
@@ -3493,87 +2118,85 @@ void DomWidget::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("class")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("class"), Qt::CaseInsensitive)) {
m_class.append(reader.readElementText());
continue;
}
- if (tag == QLatin1String("property")) {
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
continue;
}
- if (tag == QLatin1String("script")) {
- DomScript *v = new DomScript();
- v->read(reader);
- m_script.append(v);
+ if (!tag.compare(QLatin1String("script"), Qt::CaseInsensitive)) {
+ qWarning("Omitting deprecated element <script>.");
+ reader.skipCurrentElement();
continue;
}
- if (tag == QLatin1String("widgetdata")) {
- DomWidgetData *v = new DomWidgetData();
- v->read(reader);
- m_widgetData.append(v);
+ if (!tag.compare(QLatin1String("widgetdata"), Qt::CaseInsensitive)) {
+ qWarning("Omitting deprecated element <widgetdata>.");
+ reader.skipCurrentElement();
continue;
}
- if (tag == QLatin1String("attribute")) {
+ if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_attribute.append(v);
continue;
}
- if (tag == QLatin1String("row")) {
+ if (!tag.compare(QLatin1String("row"), Qt::CaseInsensitive)) {
DomRow *v = new DomRow();
v->read(reader);
m_row.append(v);
continue;
}
- if (tag == QLatin1String("column")) {
+ if (!tag.compare(QLatin1String("column"), Qt::CaseInsensitive)) {
DomColumn *v = new DomColumn();
v->read(reader);
m_column.append(v);
continue;
}
- if (tag == QLatin1String("item")) {
+ if (!tag.compare(QLatin1String("item"), Qt::CaseInsensitive)) {
DomItem *v = new DomItem();
v->read(reader);
m_item.append(v);
continue;
}
- if (tag == QLatin1String("layout")) {
+ if (!tag.compare(QLatin1String("layout"), Qt::CaseInsensitive)) {
DomLayout *v = new DomLayout();
v->read(reader);
m_layout.append(v);
continue;
}
- if (tag == QLatin1String("widget")) {
+ if (!tag.compare(QLatin1String("widget"), Qt::CaseInsensitive)) {
DomWidget *v = new DomWidget();
v->read(reader);
m_widget.append(v);
continue;
}
- if (tag == QLatin1String("action")) {
+ if (!tag.compare(QLatin1String("action"), Qt::CaseInsensitive)) {
DomAction *v = new DomAction();
v->read(reader);
m_action.append(v);
continue;
}
- if (tag == QLatin1String("actiongroup")) {
+ if (!tag.compare(QLatin1String("actiongroup"), Qt::CaseInsensitive)) {
DomActionGroup *v = new DomActionGroup();
v->read(reader);
m_actionGroup.append(v);
continue;
}
- if (tag == QLatin1String("addaction")) {
+ if (!tag.compare(QLatin1String("addaction"), Qt::CaseInsensitive)) {
DomActionRef *v = new DomActionRef();
v->read(reader);
m_addAction.append(v);
continue;
}
- if (tag == QLatin1String("zorder")) {
+ if (!tag.compare(QLatin1String("zorder"), Qt::CaseInsensitive)) {
m_zOrder.append(reader.readElementText());
continue;
}
@@ -3581,12 +2204,7 @@ void DomWidget::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3595,7 +2213,7 @@ void DomWidget::read(QXmlStreamReader &reader)
void DomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("widget") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("widget") : tagName.toLower());
if (hasAttributeClass())
writer.writeAttribute(QStringLiteral("class"), attributeClass());
@@ -3606,171 +2224,117 @@ void DomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeNative())
writer.writeAttribute(QStringLiteral("native"), (attributeNative() ? QLatin1String("true") : QLatin1String("false")));
- for (int i = 0; i < m_class.size(); ++i) {
- QString v = m_class[i];
+ for (const QString &v : m_class)
writer.writeTextElement(QStringLiteral("class"), v);
- }
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- for (int i = 0; i < m_script.size(); ++i) {
- DomScript* v = m_script[i];
- v->write(writer, QStringLiteral("script"));
- }
- for (int i = 0; i < m_widgetData.size(); ++i) {
- DomWidgetData* v = m_widgetData[i];
- v->write(writer, QStringLiteral("widgetdata"));
- }
- for (int i = 0; i < m_attribute.size(); ++i) {
- DomProperty* v = m_attribute[i];
+
+ for (DomProperty *v : m_attribute)
v->write(writer, QStringLiteral("attribute"));
- }
- for (int i = 0; i < m_row.size(); ++i) {
- DomRow* v = m_row[i];
+
+ for (DomRow *v : m_row)
v->write(writer, QStringLiteral("row"));
- }
- for (int i = 0; i < m_column.size(); ++i) {
- DomColumn* v = m_column[i];
+
+ for (DomColumn *v : m_column)
v->write(writer, QStringLiteral("column"));
- }
- for (int i = 0; i < m_item.size(); ++i) {
- DomItem* v = m_item[i];
+
+ for (DomItem *v : m_item)
v->write(writer, QStringLiteral("item"));
- }
- for (int i = 0; i < m_layout.size(); ++i) {
- DomLayout* v = m_layout[i];
+
+ for (DomLayout *v : m_layout)
v->write(writer, QStringLiteral("layout"));
- }
- for (int i = 0; i < m_widget.size(); ++i) {
- DomWidget* v = m_widget[i];
+
+ for (DomWidget *v : m_widget)
v->write(writer, QStringLiteral("widget"));
- }
- for (int i = 0; i < m_action.size(); ++i) {
- DomAction* v = m_action[i];
+
+ for (DomAction *v : m_action)
v->write(writer, QStringLiteral("action"));
- }
- for (int i = 0; i < m_actionGroup.size(); ++i) {
- DomActionGroup* v = m_actionGroup[i];
+
+ for (DomActionGroup *v : m_actionGroup)
v->write(writer, QStringLiteral("actiongroup"));
- }
- for (int i = 0; i < m_addAction.size(); ++i) {
- DomActionRef* v = m_addAction[i];
+
+ for (DomActionRef *v : m_addAction)
v->write(writer, QStringLiteral("addaction"));
- }
- for (int i = 0; i < m_zOrder.size(); ++i) {
- QString v = m_zOrder[i];
+
+ for (const QString &v : m_zOrder)
writer.writeTextElement(QStringLiteral("zorder"), v);
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomWidget::setElementClass(const QStringList& a)
+void DomWidget::setElementClass(const QStringList &a)
{
m_children |= Class;
m_class = a;
}
-void DomWidget::setElementProperty(const QList<DomProperty*>& a)
+void DomWidget::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomWidget::setElementScript(const QList<DomScript*>& a)
-{
- m_children |= Script;
- m_script = a;
-}
-
-void DomWidget::setElementWidgetData(const QList<DomWidgetData*>& a)
-{
- m_children |= WidgetData;
- m_widgetData = a;
-}
-
-void DomWidget::setElementAttribute(const QList<DomProperty*>& a)
+void DomWidget::setElementAttribute(const QList<DomProperty *> &a)
{
m_children |= Attribute;
m_attribute = a;
}
-void DomWidget::setElementRow(const QList<DomRow*>& a)
+void DomWidget::setElementRow(const QVector<DomRow *> &a)
{
m_children |= Row;
m_row = a;
}
-void DomWidget::setElementColumn(const QList<DomColumn*>& a)
+void DomWidget::setElementColumn(const QVector<DomColumn *> &a)
{
m_children |= Column;
m_column = a;
}
-void DomWidget::setElementItem(const QList<DomItem*>& a)
+void DomWidget::setElementItem(const QVector<DomItem *> &a)
{
m_children |= Item;
m_item = a;
}
-void DomWidget::setElementLayout(const QList<DomLayout*>& a)
+void DomWidget::setElementLayout(const QVector<DomLayout *> &a)
{
m_children |= Layout;
m_layout = a;
}
-void DomWidget::setElementWidget(const QList<DomWidget*>& a)
+void DomWidget::setElementWidget(const QVector<DomWidget *> &a)
{
m_children |= Widget;
m_widget = a;
}
-void DomWidget::setElementAction(const QList<DomAction*>& a)
+void DomWidget::setElementAction(const QVector<DomAction *> &a)
{
m_children |= Action;
m_action = a;
}
-void DomWidget::setElementActionGroup(const QList<DomActionGroup*>& a)
+void DomWidget::setElementActionGroup(const QVector<DomActionGroup *> &a)
{
m_children |= ActionGroup;
m_actionGroup = a;
}
-void DomWidget::setElementAddAction(const QList<DomActionRef*>& a)
+void DomWidget::setElementAddAction(const QVector<DomActionRef *> &a)
{
m_children |= AddAction;
m_addAction = a;
}
-void DomWidget::setElementZOrder(const QStringList& a)
+void DomWidget::setElementZOrder(const QStringList &a)
{
m_children |= ZOrder;
m_zOrder = a;
}
-void DomSpacer::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
-}
-
-DomSpacer::DomSpacer()
-{
- m_children = 0;
- m_has_attr_name = false;
-}
-
DomSpacer::~DomSpacer()
{
qDeleteAll(m_property);
@@ -3779,10 +2343,9 @@ DomSpacer::~DomSpacer()
void DomSpacer::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -3790,11 +2353,11 @@ void DomSpacer::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
@@ -3804,12 +2367,7 @@ void DomSpacer::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3818,62 +2376,32 @@ void DomSpacer::read(QXmlStreamReader &reader)
void DomSpacer::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("spacer") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("spacer") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomSpacer::setElementProperty(const QList<DomProperty*>& a)
+void DomSpacer::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomColor::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_alpha = false;
- m_attr_alpha = 0;
- }
-
- m_children = 0;
- m_red = 0;
- m_green = 0;
- m_blue = 0;
-}
-
-DomColor::DomColor()
-{
- m_children = 0;
- m_has_attr_alpha = false;
- m_attr_alpha = 0;
- m_red = 0;
- m_green = 0;
- m_blue = 0;
-}
-
DomColor::~DomColor()
{
}
void DomColor::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("alpha")) {
setAttributeAlpha(attribute.value().toInt());
continue;
@@ -3881,19 +2409,19 @@ void DomColor::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("red")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("red"), Qt::CaseInsensitive)) {
setElementRed(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("green")) {
+ if (!tag.compare(QLatin1String("green"), Qt::CaseInsensitive)) {
setElementGreen(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("blue")) {
+ if (!tag.compare(QLatin1String("blue"), Qt::CaseInsensitive)) {
setElementBlue(reader.readElementText().toInt());
continue;
}
@@ -3901,12 +2429,7 @@ void DomColor::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -3915,25 +2438,19 @@ void DomColor::read(QXmlStreamReader &reader)
void DomColor::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("color") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("color") : tagName.toLower());
if (hasAttributeAlpha())
writer.writeAttribute(QStringLiteral("alpha"), QString::number(attributeAlpha()));
- if (m_children & Red) {
+ if (m_children & Red)
writer.writeTextElement(QStringLiteral("red"), QString::number(m_red));
- }
- if (m_children & Green) {
+ if (m_children & Green)
writer.writeTextElement(QStringLiteral("green"), QString::number(m_green));
- }
- if (m_children & Blue) {
+ if (m_children & Blue)
writer.writeTextElement(QStringLiteral("blue"), QString::number(m_blue));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -3971,28 +2488,6 @@ void DomColor::clearElementBlue()
m_children &= ~Blue;
}
-void DomGradientStop::clear(bool clear_all)
-{
- delete m_color;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_position = false;
- m_attr_position = 0.0;
- }
-
- m_children = 0;
- m_color = 0;
-}
-
-DomGradientStop::DomGradientStop()
-{
- m_children = 0;
- m_has_attr_position = false;
- m_attr_position = 0.0;
- m_color = 0;
-}
-
DomGradientStop::~DomGradientStop()
{
delete m_color;
@@ -4000,10 +2495,9 @@ DomGradientStop::~DomGradientStop()
void DomGradientStop::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("position")) {
setAttributePosition(attribute.value().toDouble());
continue;
@@ -4011,11 +2505,11 @@ void DomGradientStop::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("color")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("color"), Qt::CaseInsensitive)) {
DomColor *v = new DomColor();
v->read(reader);
setElementColor(v);
@@ -4025,12 +2519,7 @@ void DomGradientStop::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4039,30 +2528,26 @@ void DomGradientStop::read(QXmlStreamReader &reader)
void DomGradientStop::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("gradientstop") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("gradientstop") : tagName.toLower());
if (hasAttributePosition())
writer.writeAttribute(QStringLiteral("position"), QString::number(attributePosition(), 'f', 15));
- if (m_children & Color) {
+ if (m_children & Color)
m_color->write(writer, QStringLiteral("color"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-DomColor* DomGradientStop::takeElementColor()
+DomColor *DomGradientStop::takeElementColor()
{
- DomColor* a = m_color;
+ DomColor *a = m_color;
m_color = 0;
m_children ^= Color;
return a;
}
-void DomGradientStop::setElementColor(DomColor* a)
+void DomGradientStop::setElementColor(DomColor *a)
{
delete m_color;
m_children |= Color;
@@ -4076,69 +2561,6 @@ void DomGradientStop::clearElementColor()
m_children &= ~Color;
}
-void DomGradient::clear(bool clear_all)
-{
- qDeleteAll(m_gradientStop);
- m_gradientStop.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_startX = false;
- m_attr_startX = 0.0;
- m_has_attr_startY = false;
- m_attr_startY = 0.0;
- m_has_attr_endX = false;
- m_attr_endX = 0.0;
- m_has_attr_endY = false;
- m_attr_endY = 0.0;
- m_has_attr_centralX = false;
- m_attr_centralX = 0.0;
- m_has_attr_centralY = false;
- m_attr_centralY = 0.0;
- m_has_attr_focalX = false;
- m_attr_focalX = 0.0;
- m_has_attr_focalY = false;
- m_attr_focalY = 0.0;
- m_has_attr_radius = false;
- m_attr_radius = 0.0;
- m_has_attr_angle = false;
- m_attr_angle = 0.0;
- m_has_attr_type = false;
- m_has_attr_spread = false;
- m_has_attr_coordinateMode = false;
- }
-
- m_children = 0;
-}
-
-DomGradient::DomGradient()
-{
- m_children = 0;
- m_has_attr_startX = false;
- m_attr_startX = 0.0;
- m_has_attr_startY = false;
- m_attr_startY = 0.0;
- m_has_attr_endX = false;
- m_attr_endX = 0.0;
- m_has_attr_endY = false;
- m_attr_endY = 0.0;
- m_has_attr_centralX = false;
- m_attr_centralX = 0.0;
- m_has_attr_centralY = false;
- m_attr_centralY = 0.0;
- m_has_attr_focalX = false;
- m_attr_focalX = 0.0;
- m_has_attr_focalY = false;
- m_attr_focalY = 0.0;
- m_has_attr_radius = false;
- m_attr_radius = 0.0;
- m_has_attr_angle = false;
- m_attr_angle = 0.0;
- m_has_attr_type = false;
- m_has_attr_spread = false;
- m_has_attr_coordinateMode = false;
-}
-
DomGradient::~DomGradient()
{
qDeleteAll(m_gradientStop);
@@ -4147,10 +2569,9 @@ DomGradient::~DomGradient()
void DomGradient::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("startx")) {
setAttributeStartX(attribute.value().toDouble());
continue;
@@ -4206,11 +2627,11 @@ void DomGradient::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("gradientstop")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("gradientstop"), Qt::CaseInsensitive)) {
DomGradientStop *v = new DomGradientStop();
v->read(reader);
m_gradientStop.append(v);
@@ -4220,12 +2641,7 @@ void DomGradient::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4234,7 +2650,7 @@ void DomGradient::read(QXmlStreamReader &reader)
void DomGradient::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("gradient") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("gradient") : tagName.toLower());
if (hasAttributeStartX())
writer.writeAttribute(QStringLiteral("startx"), QString::number(attributeStartX(), 'f', 15));
@@ -4275,63 +2691,43 @@ void DomGradient::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeCoordinateMode())
writer.writeAttribute(QStringLiteral("coordinatemode"), attributeCoordinateMode());
- for (int i = 0; i < m_gradientStop.size(); ++i) {
- DomGradientStop* v = m_gradientStop[i];
+ for (DomGradientStop *v : m_gradientStop)
v->write(writer, QStringLiteral("gradientstop"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomGradient::setElementGradientStop(const QList<DomGradientStop*>& a)
+void DomGradient::setElementGradientStop(const QVector<DomGradientStop *> &a)
{
m_children |= GradientStop;
m_gradientStop = a;
}
-void DomBrush::clear(bool clear_all)
+DomBrush::~DomBrush()
{
delete m_color;
delete m_texture;
delete m_gradient;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_brushStyle = false;
- }
-
- m_kind = Unknown;
-
- m_color = 0;
- m_texture = 0;
- m_gradient = 0;
}
-DomBrush::DomBrush()
-{
- m_kind = Unknown;
-
- m_has_attr_brushStyle = false;
- m_color = 0;
- m_texture = 0;
- m_gradient = 0;
-}
-
-DomBrush::~DomBrush()
+void DomBrush::clear()
{
delete m_color;
delete m_texture;
delete m_gradient;
+
+ m_kind = Unknown;
+
+ m_color = nullptr;
+ m_texture = nullptr;
+ m_gradient = nullptr;
}
void DomBrush::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("brushstyle")) {
setAttributeBrushStyle(attribute.value().toString());
continue;
@@ -4339,23 +2735,23 @@ void DomBrush::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("color")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("color"), Qt::CaseInsensitive)) {
DomColor *v = new DomColor();
v->read(reader);
setElementColor(v);
continue;
}
- if (tag == QLatin1String("texture")) {
+ if (!tag.compare(QLatin1String("texture"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
setElementTexture(v);
continue;
}
- if (tag == QLatin1String("gradient")) {
+ if (!tag.compare(QLatin1String("gradient"), Qt::CaseInsensitive)) {
DomGradient *v = new DomGradient();
v->read(reader);
setElementGradient(v);
@@ -4365,12 +2761,7 @@ void DomBrush::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4379,104 +2770,78 @@ void DomBrush::read(QXmlStreamReader &reader)
void DomBrush::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("brush") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("brush") : tagName.toLower());
if (hasAttributeBrushStyle())
writer.writeAttribute(QStringLiteral("brushstyle"), attributeBrushStyle());
switch (kind()) {
- case Color: {
- DomColor* v = elementColor();
- if (v != 0) {
- v->write(writer, QStringLiteral("color"));
- }
- break;
- }
- case Texture: {
- DomProperty* v = elementTexture();
- if (v != 0) {
- v->write(writer, QStringLiteral("texture"));
- }
- break;
- }
- case Gradient: {
- DomGradient* v = elementGradient();
- if (v != 0) {
- v->write(writer, QStringLiteral("gradient"));
- }
- break;
- }
- default:
- break;
+ case Color: {
+ DomColor *v = elementColor();
+ if (v != 0)
+ v->write(writer, QStringLiteral("color"));
+ break;
+ }
+ case Texture: {
+ DomProperty *v = elementTexture();
+ if (v != 0)
+ v->write(writer, QStringLiteral("texture"));
+ break;
+ }
+ case Gradient: {
+ DomGradient *v = elementGradient();
+ if (v != 0)
+ v->write(writer, QStringLiteral("gradient"));
+ break;
+ }
+ default:
+ break;
}
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-DomColor* DomBrush::takeElementColor()
+DomColor *DomBrush::takeElementColor()
{
- DomColor* a = m_color;
+ DomColor *a = m_color;
m_color = 0;
return a;
}
-void DomBrush::setElementColor(DomColor* a)
+void DomBrush::setElementColor(DomColor *a)
{
- clear(false);
+ clear();
m_kind = Color;
m_color = a;
}
-DomProperty* DomBrush::takeElementTexture()
+DomProperty *DomBrush::takeElementTexture()
{
- DomProperty* a = m_texture;
+ DomProperty *a = m_texture;
m_texture = 0;
return a;
}
-void DomBrush::setElementTexture(DomProperty* a)
+void DomBrush::setElementTexture(DomProperty *a)
{
- clear(false);
+ clear();
m_kind = Texture;
m_texture = a;
}
-DomGradient* DomBrush::takeElementGradient()
+DomGradient *DomBrush::takeElementGradient()
{
- DomGradient* a = m_gradient;
+ DomGradient *a = m_gradient;
m_gradient = 0;
return a;
}
-void DomBrush::setElementGradient(DomGradient* a)
+void DomBrush::setElementGradient(DomGradient *a)
{
- clear(false);
+ clear();
m_kind = Gradient;
m_gradient = a;
}
-void DomColorRole::clear(bool clear_all)
-{
- delete m_brush;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_role = false;
- }
-
- m_children = 0;
- m_brush = 0;
-}
-
-DomColorRole::DomColorRole()
-{
- m_children = 0;
- m_has_attr_role = false;
- m_brush = 0;
-}
-
DomColorRole::~DomColorRole()
{
delete m_brush;
@@ -4484,10 +2849,9 @@ DomColorRole::~DomColorRole()
void DomColorRole::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("role")) {
setAttributeRole(attribute.value().toString());
continue;
@@ -4495,11 +2859,11 @@ void DomColorRole::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("brush")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("brush"), Qt::CaseInsensitive)) {
DomBrush *v = new DomBrush();
v->read(reader);
setElementBrush(v);
@@ -4509,12 +2873,7 @@ void DomColorRole::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4523,30 +2882,26 @@ void DomColorRole::read(QXmlStreamReader &reader)
void DomColorRole::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("colorrole") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("colorrole") : tagName.toLower());
if (hasAttributeRole())
writer.writeAttribute(QStringLiteral("role"), attributeRole());
- if (m_children & Brush) {
+ if (m_children & Brush)
m_brush->write(writer, QStringLiteral("brush"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-DomBrush* DomColorRole::takeElementBrush()
+DomBrush *DomColorRole::takeElementBrush()
{
- DomBrush* a = m_brush;
+ DomBrush *a = m_brush;
m_brush = 0;
m_children ^= Brush;
return a;
}
-void DomColorRole::setElementBrush(DomBrush* a)
+void DomColorRole::setElementBrush(DomBrush *a)
{
delete m_brush;
m_children |= Brush;
@@ -4560,25 +2915,6 @@ void DomColorRole::clearElementBrush()
m_children &= ~Brush;
}
-void DomColorGroup::clear(bool clear_all)
-{
- qDeleteAll(m_colorRole);
- m_colorRole.clear();
- qDeleteAll(m_color);
- m_color.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomColorGroup::DomColorGroup()
-{
- m_children = 0;
-}
-
DomColorGroup::~DomColorGroup()
{
qDeleteAll(m_colorRole);
@@ -4589,18 +2925,17 @@ DomColorGroup::~DomColorGroup()
void DomColorGroup::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("colorrole")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("colorrole"), Qt::CaseInsensitive)) {
DomColorRole *v = new DomColorRole();
v->read(reader);
m_colorRole.append(v);
continue;
}
- if (tag == QLatin1String("color")) {
+ if (!tag.compare(QLatin1String("color"), Qt::CaseInsensitive)) {
DomColor *v = new DomColor();
v->read(reader);
m_color.append(v);
@@ -4610,12 +2945,7 @@ void DomColorGroup::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4624,58 +2954,29 @@ void DomColorGroup::read(QXmlStreamReader &reader)
void DomColorGroup::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("colorgroup") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("colorgroup") : tagName.toLower());
- for (int i = 0; i < m_colorRole.size(); ++i) {
- DomColorRole* v = m_colorRole[i];
+ for (DomColorRole *v : m_colorRole)
v->write(writer, QStringLiteral("colorrole"));
- }
- for (int i = 0; i < m_color.size(); ++i) {
- DomColor* v = m_color[i];
+
+ for (DomColor *v : m_color)
v->write(writer, QStringLiteral("color"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomColorGroup::setElementColorRole(const QList<DomColorRole*>& a)
+void DomColorGroup::setElementColorRole(const QVector<DomColorRole *> &a)
{
m_children |= ColorRole;
m_colorRole = a;
}
-void DomColorGroup::setElementColor(const QList<DomColor*>& a)
+void DomColorGroup::setElementColor(const QVector<DomColor *> &a)
{
m_children |= Color;
m_color = a;
}
-void DomPalette::clear(bool clear_all)
-{
- delete m_active;
- delete m_inactive;
- delete m_disabled;
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_active = 0;
- m_inactive = 0;
- m_disabled = 0;
-}
-
-DomPalette::DomPalette()
-{
- m_children = 0;
- m_active = 0;
- m_inactive = 0;
- m_disabled = 0;
-}
-
DomPalette::~DomPalette()
{
delete m_active;
@@ -4685,24 +2986,23 @@ DomPalette::~DomPalette()
void DomPalette::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("active")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("active"), Qt::CaseInsensitive)) {
DomColorGroup *v = new DomColorGroup();
v->read(reader);
setElementActive(v);
continue;
}
- if (tag == QLatin1String("inactive")) {
+ if (!tag.compare(QLatin1String("inactive"), Qt::CaseInsensitive)) {
DomColorGroup *v = new DomColorGroup();
v->read(reader);
setElementInactive(v);
continue;
}
- if (tag == QLatin1String("disabled")) {
+ if (!tag.compare(QLatin1String("disabled"), Qt::CaseInsensitive)) {
DomColorGroup *v = new DomColorGroup();
v->read(reader);
setElementDisabled(v);
@@ -4712,12 +3012,7 @@ void DomPalette::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4726,65 +3021,59 @@ void DomPalette::read(QXmlStreamReader &reader)
void DomPalette::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("palette") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("palette") : tagName.toLower());
- if (m_children & Active) {
+ if (m_children & Active)
m_active->write(writer, QStringLiteral("active"));
- }
- if (m_children & Inactive) {
+ if (m_children & Inactive)
m_inactive->write(writer, QStringLiteral("inactive"));
- }
- if (m_children & Disabled) {
+ if (m_children & Disabled)
m_disabled->write(writer, QStringLiteral("disabled"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-DomColorGroup* DomPalette::takeElementActive()
+DomColorGroup *DomPalette::takeElementActive()
{
- DomColorGroup* a = m_active;
+ DomColorGroup *a = m_active;
m_active = 0;
m_children ^= Active;
return a;
}
-void DomPalette::setElementActive(DomColorGroup* a)
+void DomPalette::setElementActive(DomColorGroup *a)
{
delete m_active;
m_children |= Active;
m_active = a;
}
-DomColorGroup* DomPalette::takeElementInactive()
+DomColorGroup *DomPalette::takeElementInactive()
{
- DomColorGroup* a = m_inactive;
+ DomColorGroup *a = m_inactive;
m_inactive = 0;
m_children ^= Inactive;
return a;
}
-void DomPalette::setElementInactive(DomColorGroup* a)
+void DomPalette::setElementInactive(DomColorGroup *a)
{
delete m_inactive;
m_children |= Inactive;
m_inactive = a;
}
-DomColorGroup* DomPalette::takeElementDisabled()
+DomColorGroup *DomPalette::takeElementDisabled()
{
- DomColorGroup* a = m_disabled;
+ DomColorGroup *a = m_disabled;
m_disabled = 0;
m_children ^= Disabled;
return a;
}
-void DomPalette::setElementDisabled(DomColorGroup* a)
+void DomPalette::setElementDisabled(DomColorGroup *a)
{
delete m_disabled;
m_children |= Disabled;
@@ -4812,85 +3101,53 @@ void DomPalette::clearElementDisabled()
m_children &= ~Disabled;
}
-void DomFont::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_pointSize = 0;
- m_weight = 0;
- m_italic = false;
- m_bold = false;
- m_underline = false;
- m_strikeOut = false;
- m_antialiasing = false;
- m_kerning = false;
-}
-
-DomFont::DomFont()
-{
- m_children = 0;
- m_pointSize = 0;
- m_weight = 0;
- m_italic = false;
- m_bold = false;
- m_underline = false;
- m_strikeOut = false;
- m_antialiasing = false;
- m_kerning = false;
-}
-
DomFont::~DomFont()
{
}
void DomFont::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("family")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("family"), Qt::CaseInsensitive)) {
setElementFamily(reader.readElementText());
continue;
}
- if (tag == QLatin1String("pointsize")) {
+ if (!tag.compare(QLatin1String("pointsize"), Qt::CaseInsensitive)) {
setElementPointSize(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("weight")) {
+ if (!tag.compare(QLatin1String("weight"), Qt::CaseInsensitive)) {
setElementWeight(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("italic")) {
+ if (!tag.compare(QLatin1String("italic"), Qt::CaseInsensitive)) {
setElementItalic(reader.readElementText() == QLatin1String("true"));
continue;
}
- if (tag == QLatin1String("bold")) {
+ if (!tag.compare(QLatin1String("bold"), Qt::CaseInsensitive)) {
setElementBold(reader.readElementText() == QLatin1String("true"));
continue;
}
- if (tag == QLatin1String("underline")) {
+ if (!tag.compare(QLatin1String("underline"), Qt::CaseInsensitive)) {
setElementUnderline(reader.readElementText() == QLatin1String("true"));
continue;
}
- if (tag == QLatin1String("strikeout")) {
+ if (!tag.compare(QLatin1String("strikeout"), Qt::CaseInsensitive)) {
setElementStrikeOut(reader.readElementText() == QLatin1String("true"));
continue;
}
- if (tag == QLatin1String("antialiasing")) {
+ if (!tag.compare(QLatin1String("antialiasing"), Qt::CaseInsensitive)) {
setElementAntialiasing(reader.readElementText() == QLatin1String("true"));
continue;
}
- if (tag == QLatin1String("stylestrategy")) {
+ if (!tag.compare(QLatin1String("stylestrategy"), Qt::CaseInsensitive)) {
setElementStyleStrategy(reader.readElementText());
continue;
}
- if (tag == QLatin1String("kerning")) {
+ if (!tag.compare(QLatin1String("kerning"), Qt::CaseInsensitive)) {
setElementKerning(reader.readElementText() == QLatin1String("true"));
continue;
}
@@ -4898,12 +3155,7 @@ void DomFont::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -4912,55 +3164,42 @@ void DomFont::read(QXmlStreamReader &reader)
void DomFont::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("font") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("font") : tagName.toLower());
- if (m_children & Family) {
+ if (m_children & Family)
writer.writeTextElement(QStringLiteral("family"), m_family);
- }
- if (m_children & PointSize) {
+ if (m_children & PointSize)
writer.writeTextElement(QStringLiteral("pointsize"), QString::number(m_pointSize));
- }
- if (m_children & Weight) {
+ if (m_children & Weight)
writer.writeTextElement(QStringLiteral("weight"), QString::number(m_weight));
- }
- if (m_children & Italic) {
+ if (m_children & Italic)
writer.writeTextElement(QStringLiteral("italic"), (m_italic ? QLatin1String("true") : QLatin1String("false")));
- }
- if (m_children & Bold) {
+ if (m_children & Bold)
writer.writeTextElement(QStringLiteral("bold"), (m_bold ? QLatin1String("true") : QLatin1String("false")));
- }
- if (m_children & Underline) {
+ if (m_children & Underline)
writer.writeTextElement(QStringLiteral("underline"), (m_underline ? QLatin1String("true") : QLatin1String("false")));
- }
- if (m_children & StrikeOut) {
+ if (m_children & StrikeOut)
writer.writeTextElement(QStringLiteral("strikeout"), (m_strikeOut ? QLatin1String("true") : QLatin1String("false")));
- }
- if (m_children & Antialiasing) {
+ if (m_children & Antialiasing)
writer.writeTextElement(QStringLiteral("antialiasing"), (m_antialiasing ? QLatin1String("true") : QLatin1String("false")));
- }
- if (m_children & StyleStrategy) {
+ if (m_children & StyleStrategy)
writer.writeTextElement(QStringLiteral("stylestrategy"), m_styleStrategy);
- }
- if (m_children & Kerning) {
+ if (m_children & Kerning)
writer.writeTextElement(QStringLiteral("kerning"), (m_kerning ? QLatin1String("true") : QLatin1String("false")));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomFont::setElementFamily(const QString& a)
+void DomFont::setElementFamily(const QString &a)
{
m_children |= Family;
m_family = a;
@@ -5008,7 +3247,7 @@ void DomFont::setElementAntialiasing(bool a)
m_antialiasing = a;
}
-void DomFont::setElementStyleStrategy(const QString& a)
+void DomFont::setElementStyleStrategy(const QString &a)
{
m_children |= StyleStrategy;
m_styleStrategy = a;
@@ -5070,41 +3309,21 @@ void DomFont::clearElementKerning()
m_children &= ~Kerning;
}
-void DomPoint::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_x = 0;
- m_y = 0;
-}
-
-DomPoint::DomPoint()
-{
- m_children = 0;
- m_x = 0;
- m_y = 0;
-}
-
DomPoint::~DomPoint()
{
}
void DomPoint::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("x")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("x"), Qt::CaseInsensitive)) {
setElementX(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("y")) {
+ if (!tag.compare(QLatin1String("y"), Qt::CaseInsensitive)) {
setElementY(reader.readElementText().toInt());
continue;
}
@@ -5112,12 +3331,7 @@ void DomPoint::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5126,18 +3340,13 @@ void DomPoint::read(QXmlStreamReader &reader)
void DomPoint::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("point") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("point") : tagName.toLower());
- if (m_children & X) {
+ if (m_children & X)
writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x));
- }
- if (m_children & Y) {
+ if (m_children & Y)
writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -5164,53 +3373,29 @@ void DomPoint::clearElementY()
m_children &= ~Y;
}
-void DomRect::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_x = 0;
- m_y = 0;
- m_width = 0;
- m_height = 0;
-}
-
-DomRect::DomRect()
-{
- m_children = 0;
- m_x = 0;
- m_y = 0;
- m_width = 0;
- m_height = 0;
-}
-
DomRect::~DomRect()
{
}
void DomRect::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("x")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("x"), Qt::CaseInsensitive)) {
setElementX(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("y")) {
+ if (!tag.compare(QLatin1String("y"), Qt::CaseInsensitive)) {
setElementY(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("width")) {
+ if (!tag.compare(QLatin1String("width"), Qt::CaseInsensitive)) {
setElementWidth(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("height")) {
+ if (!tag.compare(QLatin1String("height"), Qt::CaseInsensitive)) {
setElementHeight(reader.readElementText().toInt());
continue;
}
@@ -5218,12 +3403,7 @@ void DomRect::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5232,26 +3412,19 @@ void DomRect::read(QXmlStreamReader &reader)
void DomRect::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("rect") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("rect") : tagName.toLower());
- if (m_children & X) {
+ if (m_children & X)
writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x));
- }
- if (m_children & Y) {
+ if (m_children & Y)
writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y));
- }
- if (m_children & Width) {
+ if (m_children & Width)
writer.writeTextElement(QStringLiteral("width"), QString::number(m_width));
- }
- if (m_children & Height) {
+ if (m_children & Height)
writer.writeTextElement(QStringLiteral("height"), QString::number(m_height));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -5300,35 +3473,15 @@ void DomRect::clearElementHeight()
m_children &= ~Height;
}
-void DomLocale::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_language = false;
- m_has_attr_country = false;
- }
-
- m_children = 0;
-}
-
-DomLocale::DomLocale()
-{
- m_children = 0;
- m_has_attr_language = false;
- m_has_attr_country = false;
-}
-
DomLocale::~DomLocale()
{
}
void DomLocale::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("language")) {
setAttributeLanguage(attribute.value().toString());
continue;
@@ -5340,20 +3493,15 @@ void DomLocale::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5362,7 +3510,7 @@ void DomLocale::read(QXmlStreamReader &reader)
void DomLocale::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("locale") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("locale") : tagName.toLower());
if (hasAttributeLanguage())
writer.writeAttribute(QStringLiteral("language"), attributeLanguage());
@@ -5370,49 +3518,18 @@ void DomLocale::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeCountry())
writer.writeAttribute(QStringLiteral("country"), attributeCountry());
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomSizePolicy::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_hSizeType = false;
- m_has_attr_vSizeType = false;
- }
-
- m_children = 0;
- m_hSizeType = 0;
- m_vSizeType = 0;
- m_horStretch = 0;
- m_verStretch = 0;
-}
-
-DomSizePolicy::DomSizePolicy()
-{
- m_children = 0;
- m_has_attr_hSizeType = false;
- m_has_attr_vSizeType = false;
- m_hSizeType = 0;
- m_vSizeType = 0;
- m_horStretch = 0;
- m_verStretch = 0;
-}
-
DomSizePolicy::~DomSizePolicy()
{
}
void DomSizePolicy::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("hsizetype")) {
setAttributeHSizeType(attribute.value().toString());
continue;
@@ -5424,23 +3541,23 @@ void DomSizePolicy::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("hsizetype")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("hsizetype"), Qt::CaseInsensitive)) {
setElementHSizeType(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("vsizetype")) {
+ if (!tag.compare(QLatin1String("vsizetype"), Qt::CaseInsensitive)) {
setElementVSizeType(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("horstretch")) {
+ if (!tag.compare(QLatin1String("horstretch"), Qt::CaseInsensitive)) {
setElementHorStretch(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("verstretch")) {
+ if (!tag.compare(QLatin1String("verstretch"), Qt::CaseInsensitive)) {
setElementVerStretch(reader.readElementText().toInt());
continue;
}
@@ -5448,12 +3565,7 @@ void DomSizePolicy::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5462,7 +3574,7 @@ void DomSizePolicy::read(QXmlStreamReader &reader)
void DomSizePolicy::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicy") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("sizepolicy") : tagName.toLower());
if (hasAttributeHSizeType())
writer.writeAttribute(QStringLiteral("hsizetype"), attributeHSizeType());
@@ -5470,24 +3582,17 @@ void DomSizePolicy::write(QXmlStreamWriter &writer, const QString &tagName) cons
if (hasAttributeVSizeType())
writer.writeAttribute(QStringLiteral("vsizetype"), attributeVSizeType());
- if (m_children & HSizeType) {
+ if (m_children & HSizeType)
writer.writeTextElement(QStringLiteral("hsizetype"), QString::number(m_hSizeType));
- }
- if (m_children & VSizeType) {
+ if (m_children & VSizeType)
writer.writeTextElement(QStringLiteral("vsizetype"), QString::number(m_vSizeType));
- }
- if (m_children & HorStretch) {
+ if (m_children & HorStretch)
writer.writeTextElement(QStringLiteral("horstretch"), QString::number(m_horStretch));
- }
- if (m_children & VerStretch) {
+ if (m_children & VerStretch)
writer.writeTextElement(QStringLiteral("verstretch"), QString::number(m_verStretch));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -5536,41 +3641,21 @@ void DomSizePolicy::clearElementVerStretch()
m_children &= ~VerStretch;
}
-void DomSize::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_width = 0;
- m_height = 0;
-}
-
-DomSize::DomSize()
-{
- m_children = 0;
- m_width = 0;
- m_height = 0;
-}
-
DomSize::~DomSize()
{
}
void DomSize::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("width")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("width"), Qt::CaseInsensitive)) {
setElementWidth(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("height")) {
+ if (!tag.compare(QLatin1String("height"), Qt::CaseInsensitive)) {
setElementHeight(reader.readElementText().toInt());
continue;
}
@@ -5578,12 +3663,7 @@ void DomSize::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5592,18 +3672,13 @@ void DomSize::read(QXmlStreamReader &reader)
void DomSize::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("size") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("size") : tagName.toLower());
- if (m_children & Width) {
+ if (m_children & Width)
writer.writeTextElement(QStringLiteral("width"), QString::number(m_width));
- }
- if (m_children & Height) {
+ if (m_children & Height)
writer.writeTextElement(QStringLiteral("height"), QString::number(m_height));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -5630,47 +3705,25 @@ void DomSize::clearElementHeight()
m_children &= ~Height;
}
-void DomDate::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_year = 0;
- m_month = 0;
- m_day = 0;
-}
-
-DomDate::DomDate()
-{
- m_children = 0;
- m_year = 0;
- m_month = 0;
- m_day = 0;
-}
-
DomDate::~DomDate()
{
}
void DomDate::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("year")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("year"), Qt::CaseInsensitive)) {
setElementYear(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("month")) {
+ if (!tag.compare(QLatin1String("month"), Qt::CaseInsensitive)) {
setElementMonth(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("day")) {
+ if (!tag.compare(QLatin1String("day"), Qt::CaseInsensitive)) {
setElementDay(reader.readElementText().toInt());
continue;
}
@@ -5678,12 +3731,7 @@ void DomDate::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5692,22 +3740,16 @@ void DomDate::read(QXmlStreamReader &reader)
void DomDate::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("date") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("date") : tagName.toLower());
- if (m_children & Year) {
+ if (m_children & Year)
writer.writeTextElement(QStringLiteral("year"), QString::number(m_year));
- }
- if (m_children & Month) {
+ if (m_children & Month)
writer.writeTextElement(QStringLiteral("month"), QString::number(m_month));
- }
- if (m_children & Day) {
+ if (m_children & Day)
writer.writeTextElement(QStringLiteral("day"), QString::number(m_day));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -5745,47 +3787,25 @@ void DomDate::clearElementDay()
m_children &= ~Day;
}
-void DomTime::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_hour = 0;
- m_minute = 0;
- m_second = 0;
-}
-
-DomTime::DomTime()
-{
- m_children = 0;
- m_hour = 0;
- m_minute = 0;
- m_second = 0;
-}
-
DomTime::~DomTime()
{
}
void DomTime::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("hour")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("hour"), Qt::CaseInsensitive)) {
setElementHour(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("minute")) {
+ if (!tag.compare(QLatin1String("minute"), Qt::CaseInsensitive)) {
setElementMinute(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("second")) {
+ if (!tag.compare(QLatin1String("second"), Qt::CaseInsensitive)) {
setElementSecond(reader.readElementText().toInt());
continue;
}
@@ -5793,12 +3813,7 @@ void DomTime::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5807,22 +3822,16 @@ void DomTime::read(QXmlStreamReader &reader)
void DomTime::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("time") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("time") : tagName.toLower());
- if (m_children & Hour) {
+ if (m_children & Hour)
writer.writeTextElement(QStringLiteral("hour"), QString::number(m_hour));
- }
- if (m_children & Minute) {
+ if (m_children & Minute)
writer.writeTextElement(QStringLiteral("minute"), QString::number(m_minute));
- }
- if (m_children & Second) {
+ if (m_children & Second)
writer.writeTextElement(QStringLiteral("second"), QString::number(m_second));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -5860,65 +3869,37 @@ void DomTime::clearElementSecond()
m_children &= ~Second;
}
-void DomDateTime::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_hour = 0;
- m_minute = 0;
- m_second = 0;
- m_year = 0;
- m_month = 0;
- m_day = 0;
-}
-
-DomDateTime::DomDateTime()
-{
- m_children = 0;
- m_hour = 0;
- m_minute = 0;
- m_second = 0;
- m_year = 0;
- m_month = 0;
- m_day = 0;
-}
-
DomDateTime::~DomDateTime()
{
}
void DomDateTime::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("hour")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("hour"), Qt::CaseInsensitive)) {
setElementHour(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("minute")) {
+ if (!tag.compare(QLatin1String("minute"), Qt::CaseInsensitive)) {
setElementMinute(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("second")) {
+ if (!tag.compare(QLatin1String("second"), Qt::CaseInsensitive)) {
setElementSecond(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("year")) {
+ if (!tag.compare(QLatin1String("year"), Qt::CaseInsensitive)) {
setElementYear(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("month")) {
+ if (!tag.compare(QLatin1String("month"), Qt::CaseInsensitive)) {
setElementMonth(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("day")) {
+ if (!tag.compare(QLatin1String("day"), Qt::CaseInsensitive)) {
setElementDay(reader.readElementText().toInt());
continue;
}
@@ -5926,12 +3907,7 @@ void DomDateTime::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -5940,34 +3916,25 @@ void DomDateTime::read(QXmlStreamReader &reader)
void DomDateTime::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("datetime") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("datetime") : tagName.toLower());
- if (m_children & Hour) {
+ if (m_children & Hour)
writer.writeTextElement(QStringLiteral("hour"), QString::number(m_hour));
- }
- if (m_children & Minute) {
+ if (m_children & Minute)
writer.writeTextElement(QStringLiteral("minute"), QString::number(m_minute));
- }
- if (m_children & Second) {
+ if (m_children & Second)
writer.writeTextElement(QStringLiteral("second"), QString::number(m_second));
- }
- if (m_children & Year) {
+ if (m_children & Year)
writer.writeTextElement(QStringLiteral("year"), QString::number(m_year));
- }
- if (m_children & Month) {
+ if (m_children & Month)
writer.writeTextElement(QStringLiteral("month"), QString::number(m_month));
- }
- if (m_children & Day) {
+ if (m_children & Day)
writer.writeTextElement(QStringLiteral("day"), QString::number(m_day));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -6038,28 +4005,6 @@ void DomDateTime::clearElementDay()
m_children &= ~Day;
}
-void DomStringList::clear(bool clear_all)
-{
- m_string.clear();
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_notr = false;
- m_has_attr_comment = false;
- m_has_attr_extraComment = false;
- }
-
- m_children = 0;
-}
-
-DomStringList::DomStringList()
-{
- m_children = 0;
- m_has_attr_notr = false;
- m_has_attr_comment = false;
- m_has_attr_extraComment = false;
-}
-
DomStringList::~DomStringList()
{
m_string.clear();
@@ -6067,10 +4012,9 @@ DomStringList::~DomStringList()
void DomStringList::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("notr")) {
setAttributeNotr(attribute.value().toString());
continue;
@@ -6086,11 +4030,11 @@ void DomStringList::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("string")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("string"), Qt::CaseInsensitive)) {
m_string.append(reader.readElementText());
continue;
}
@@ -6098,12 +4042,7 @@ void DomStringList::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -6112,7 +4051,7 @@ void DomStringList::read(QXmlStreamReader &reader)
void DomStringList::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("stringlist") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("stringlist") : tagName.toLower());
if (hasAttributeNotr())
writer.writeAttribute(QStringLiteral("notr"), attributeNotr());
@@ -6123,52 +4062,27 @@ void DomStringList::write(QXmlStreamWriter &writer, const QString &tagName) cons
if (hasAttributeExtraComment())
writer.writeAttribute(QStringLiteral("extracomment"), attributeExtraComment());
- for (int i = 0; i < m_string.size(); ++i) {
- QString v = m_string[i];
+ for (const QString &v : m_string)
writer.writeTextElement(QStringLiteral("string"), v);
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomStringList::setElementString(const QStringList& a)
+void DomStringList::setElementString(const QStringList &a)
{
m_children |= String;
m_string = a;
}
-void DomResourcePixmap::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_resource = false;
- m_has_attr_alias = false;
- }
-
- m_children = 0;
-}
-
-DomResourcePixmap::DomResourcePixmap()
-{
- m_children = 0;
- m_has_attr_resource = false;
- m_has_attr_alias = false;
- m_text.clear();
-}
-
DomResourcePixmap::~DomResourcePixmap()
{
}
void DomResourcePixmap::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("resource")) {
setAttributeResource(attribute.value().toString());
continue;
@@ -6180,16 +4094,15 @@ void DomResourcePixmap::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
+ return;
case QXmlStreamReader::Characters :
if (!reader.isWhitespace())
m_text.append(reader.text().toString());
@@ -6202,7 +4115,7 @@ void DomResourcePixmap::read(QXmlStreamReader &reader)
void DomResourcePixmap::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourcepixmap") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("resourcepixmap") : tagName.toLower());
if (hasAttributeResource())
writer.writeAttribute(QStringLiteral("resource"), attributeResource());
@@ -6216,50 +4129,6 @@ void DomResourcePixmap::write(QXmlStreamWriter &writer, const QString &tagName)
writer.writeEndElement();
}
-void DomResourceIcon::clear(bool clear_all)
-{
- delete m_normalOff;
- delete m_normalOn;
- delete m_disabledOff;
- delete m_disabledOn;
- delete m_activeOff;
- delete m_activeOn;
- delete m_selectedOff;
- delete m_selectedOn;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_theme = false;
- m_has_attr_resource = false;
- }
-
- m_children = 0;
- m_normalOff = 0;
- m_normalOn = 0;
- m_disabledOff = 0;
- m_disabledOn = 0;
- m_activeOff = 0;
- m_activeOn = 0;
- m_selectedOff = 0;
- m_selectedOn = 0;
-}
-
-DomResourceIcon::DomResourceIcon()
-{
- m_children = 0;
- m_has_attr_theme = false;
- m_has_attr_resource = false;
- m_text.clear();
- m_normalOff = 0;
- m_normalOn = 0;
- m_disabledOff = 0;
- m_disabledOn = 0;
- m_activeOff = 0;
- m_activeOn = 0;
- m_selectedOff = 0;
- m_selectedOn = 0;
-}
-
DomResourceIcon::~DomResourceIcon()
{
delete m_normalOff;
@@ -6274,10 +4143,9 @@ DomResourceIcon::~DomResourceIcon()
void DomResourceIcon::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("theme")) {
setAttributeTheme(attribute.value().toString());
continue;
@@ -6289,53 +4157,53 @@ void DomResourceIcon::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("normaloff")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("normaloff"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementNormalOff(v);
continue;
}
- if (tag == QLatin1String("normalon")) {
+ if (!tag.compare(QLatin1String("normalon"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementNormalOn(v);
continue;
}
- if (tag == QLatin1String("disabledoff")) {
+ if (!tag.compare(QLatin1String("disabledoff"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementDisabledOff(v);
continue;
}
- if (tag == QLatin1String("disabledon")) {
+ if (!tag.compare(QLatin1String("disabledon"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementDisabledOn(v);
continue;
}
- if (tag == QLatin1String("activeoff")) {
+ if (!tag.compare(QLatin1String("activeoff"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementActiveOff(v);
continue;
}
- if (tag == QLatin1String("activeon")) {
+ if (!tag.compare(QLatin1String("activeon"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementActiveOn(v);
continue;
}
- if (tag == QLatin1String("selectedoff")) {
+ if (!tag.compare(QLatin1String("selectedoff"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementSelectedOff(v);
continue;
}
- if (tag == QLatin1String("selectedon")) {
+ if (!tag.compare(QLatin1String("selectedon"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementSelectedOn(v);
@@ -6345,8 +4213,7 @@ void DomResourceIcon::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
+ return;
case QXmlStreamReader::Characters :
if (!reader.isWhitespace())
m_text.append(reader.text().toString());
@@ -6359,7 +4226,7 @@ void DomResourceIcon::read(QXmlStreamReader &reader)
void DomResourceIcon::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourceicon") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("resourceicon") : tagName.toLower());
if (hasAttributeTheme())
writer.writeAttribute(QStringLiteral("theme"), attributeTheme());
@@ -6367,37 +4234,29 @@ void DomResourceIcon::write(QXmlStreamWriter &writer, const QString &tagName) co
if (hasAttributeResource())
writer.writeAttribute(QStringLiteral("resource"), attributeResource());
- if (m_children & NormalOff) {
+ if (m_children & NormalOff)
m_normalOff->write(writer, QStringLiteral("normaloff"));
- }
- if (m_children & NormalOn) {
+ if (m_children & NormalOn)
m_normalOn->write(writer, QStringLiteral("normalon"));
- }
- if (m_children & DisabledOff) {
+ if (m_children & DisabledOff)
m_disabledOff->write(writer, QStringLiteral("disabledoff"));
- }
- if (m_children & DisabledOn) {
+ if (m_children & DisabledOn)
m_disabledOn->write(writer, QStringLiteral("disabledon"));
- }
- if (m_children & ActiveOff) {
+ if (m_children & ActiveOff)
m_activeOff->write(writer, QStringLiteral("activeoff"));
- }
- if (m_children & ActiveOn) {
+ if (m_children & ActiveOn)
m_activeOn->write(writer, QStringLiteral("activeon"));
- }
- if (m_children & SelectedOff) {
+ if (m_children & SelectedOff)
m_selectedOff->write(writer, QStringLiteral("selectedoff"));
- }
- if (m_children & SelectedOn) {
+ if (m_children & SelectedOn)
m_selectedOn->write(writer, QStringLiteral("selectedon"));
- }
if (!m_text.isEmpty())
writer.writeCharacters(m_text);
@@ -6405,120 +4264,120 @@ void DomResourceIcon::write(QXmlStreamWriter &writer, const QString &tagName) co
writer.writeEndElement();
}
-DomResourcePixmap* DomResourceIcon::takeElementNormalOff()
+DomResourcePixmap *DomResourceIcon::takeElementNormalOff()
{
- DomResourcePixmap* a = m_normalOff;
+ DomResourcePixmap *a = m_normalOff;
m_normalOff = 0;
m_children ^= NormalOff;
return a;
}
-void DomResourceIcon::setElementNormalOff(DomResourcePixmap* a)
+void DomResourceIcon::setElementNormalOff(DomResourcePixmap *a)
{
delete m_normalOff;
m_children |= NormalOff;
m_normalOff = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementNormalOn()
+DomResourcePixmap *DomResourceIcon::takeElementNormalOn()
{
- DomResourcePixmap* a = m_normalOn;
+ DomResourcePixmap *a = m_normalOn;
m_normalOn = 0;
m_children ^= NormalOn;
return a;
}
-void DomResourceIcon::setElementNormalOn(DomResourcePixmap* a)
+void DomResourceIcon::setElementNormalOn(DomResourcePixmap *a)
{
delete m_normalOn;
m_children |= NormalOn;
m_normalOn = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementDisabledOff()
+DomResourcePixmap *DomResourceIcon::takeElementDisabledOff()
{
- DomResourcePixmap* a = m_disabledOff;
+ DomResourcePixmap *a = m_disabledOff;
m_disabledOff = 0;
m_children ^= DisabledOff;
return a;
}
-void DomResourceIcon::setElementDisabledOff(DomResourcePixmap* a)
+void DomResourceIcon::setElementDisabledOff(DomResourcePixmap *a)
{
delete m_disabledOff;
m_children |= DisabledOff;
m_disabledOff = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementDisabledOn()
+DomResourcePixmap *DomResourceIcon::takeElementDisabledOn()
{
- DomResourcePixmap* a = m_disabledOn;
+ DomResourcePixmap *a = m_disabledOn;
m_disabledOn = 0;
m_children ^= DisabledOn;
return a;
}
-void DomResourceIcon::setElementDisabledOn(DomResourcePixmap* a)
+void DomResourceIcon::setElementDisabledOn(DomResourcePixmap *a)
{
delete m_disabledOn;
m_children |= DisabledOn;
m_disabledOn = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementActiveOff()
+DomResourcePixmap *DomResourceIcon::takeElementActiveOff()
{
- DomResourcePixmap* a = m_activeOff;
+ DomResourcePixmap *a = m_activeOff;
m_activeOff = 0;
m_children ^= ActiveOff;
return a;
}
-void DomResourceIcon::setElementActiveOff(DomResourcePixmap* a)
+void DomResourceIcon::setElementActiveOff(DomResourcePixmap *a)
{
delete m_activeOff;
m_children |= ActiveOff;
m_activeOff = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementActiveOn()
+DomResourcePixmap *DomResourceIcon::takeElementActiveOn()
{
- DomResourcePixmap* a = m_activeOn;
+ DomResourcePixmap *a = m_activeOn;
m_activeOn = 0;
m_children ^= ActiveOn;
return a;
}
-void DomResourceIcon::setElementActiveOn(DomResourcePixmap* a)
+void DomResourceIcon::setElementActiveOn(DomResourcePixmap *a)
{
delete m_activeOn;
m_children |= ActiveOn;
m_activeOn = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementSelectedOff()
+DomResourcePixmap *DomResourceIcon::takeElementSelectedOff()
{
- DomResourcePixmap* a = m_selectedOff;
+ DomResourcePixmap *a = m_selectedOff;
m_selectedOff = 0;
m_children ^= SelectedOff;
return a;
}
-void DomResourceIcon::setElementSelectedOff(DomResourcePixmap* a)
+void DomResourceIcon::setElementSelectedOff(DomResourcePixmap *a)
{
delete m_selectedOff;
m_children |= SelectedOff;
m_selectedOff = a;
}
-DomResourcePixmap* DomResourceIcon::takeElementSelectedOn()
+DomResourcePixmap *DomResourceIcon::takeElementSelectedOn()
{
- DomResourcePixmap* a = m_selectedOn;
+ DomResourcePixmap *a = m_selectedOn;
m_selectedOn = 0;
m_children ^= SelectedOn;
return a;
}
-void DomResourceIcon::setElementSelectedOn(DomResourcePixmap* a)
+void DomResourceIcon::setElementSelectedOn(DomResourcePixmap *a)
{
delete m_selectedOn;
m_children |= SelectedOn;
@@ -6581,38 +4440,15 @@ void DomResourceIcon::clearElementSelectedOn()
m_children &= ~SelectedOn;
}
-void DomString::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_notr = false;
- m_has_attr_comment = false;
- m_has_attr_extraComment = false;
- }
-
- m_children = 0;
-}
-
-DomString::DomString()
-{
- m_children = 0;
- m_has_attr_notr = false;
- m_has_attr_comment = false;
- m_has_attr_extraComment = false;
- m_text.clear();
-}
-
DomString::~DomString()
{
}
void DomString::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("notr")) {
setAttributeNotr(attribute.value().toString());
continue;
@@ -6628,16 +4464,15 @@ void DomString::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
+ return;
case QXmlStreamReader::Characters :
if (!reader.isWhitespace())
m_text.append(reader.text().toString());
@@ -6650,7 +4485,7 @@ void DomString::read(QXmlStreamReader &reader)
void DomString::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("string") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("string") : tagName.toLower());
if (hasAttributeNotr())
writer.writeAttribute(QStringLiteral("notr"), attributeNotr());
@@ -6667,41 +4502,21 @@ void DomString::write(QXmlStreamWriter &writer, const QString &tagName) const
writer.writeEndElement();
}
-void DomPointF::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_x = 0;
- m_y = 0;
-}
-
-DomPointF::DomPointF()
-{
- m_children = 0;
- m_x = 0;
- m_y = 0;
-}
-
DomPointF::~DomPointF()
{
}
void DomPointF::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("x")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("x"), Qt::CaseInsensitive)) {
setElementX(reader.readElementText().toDouble());
continue;
}
- if (tag == QLatin1String("y")) {
+ if (!tag.compare(QLatin1String("y"), Qt::CaseInsensitive)) {
setElementY(reader.readElementText().toDouble());
continue;
}
@@ -6709,12 +4524,7 @@ void DomPointF::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -6723,18 +4533,13 @@ void DomPointF::read(QXmlStreamReader &reader)
void DomPointF::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("pointf") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("pointf") : tagName.toLower());
- if (m_children & X) {
+ if (m_children & X)
writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x, 'f', 15));
- }
- if (m_children & Y) {
+ if (m_children & Y)
writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y, 'f', 15));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -6761,53 +4566,29 @@ void DomPointF::clearElementY()
m_children &= ~Y;
}
-void DomRectF::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_x = 0;
- m_y = 0;
- m_width = 0;
- m_height = 0;
-}
-
-DomRectF::DomRectF()
-{
- m_children = 0;
- m_x = 0;
- m_y = 0;
- m_width = 0;
- m_height = 0;
-}
-
DomRectF::~DomRectF()
{
}
void DomRectF::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("x")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("x"), Qt::CaseInsensitive)) {
setElementX(reader.readElementText().toDouble());
continue;
}
- if (tag == QLatin1String("y")) {
+ if (!tag.compare(QLatin1String("y"), Qt::CaseInsensitive)) {
setElementY(reader.readElementText().toDouble());
continue;
}
- if (tag == QLatin1String("width")) {
+ if (!tag.compare(QLatin1String("width"), Qt::CaseInsensitive)) {
setElementWidth(reader.readElementText().toDouble());
continue;
}
- if (tag == QLatin1String("height")) {
+ if (!tag.compare(QLatin1String("height"), Qt::CaseInsensitive)) {
setElementHeight(reader.readElementText().toDouble());
continue;
}
@@ -6815,12 +4596,7 @@ void DomRectF::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -6829,26 +4605,19 @@ void DomRectF::read(QXmlStreamReader &reader)
void DomRectF::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("rectf") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("rectf") : tagName.toLower());
- if (m_children & X) {
+ if (m_children & X)
writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x, 'f', 15));
- }
- if (m_children & Y) {
+ if (m_children & Y)
writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y, 'f', 15));
- }
- if (m_children & Width) {
+ if (m_children & Width)
writer.writeTextElement(QStringLiteral("width"), QString::number(m_width, 'f', 15));
- }
- if (m_children & Height) {
+ if (m_children & Height)
writer.writeTextElement(QStringLiteral("height"), QString::number(m_height, 'f', 15));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -6897,41 +4666,21 @@ void DomRectF::clearElementHeight()
m_children &= ~Height;
}
-void DomSizeF::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_width = 0;
- m_height = 0;
-}
-
-DomSizeF::DomSizeF()
-{
- m_children = 0;
- m_width = 0;
- m_height = 0;
-}
-
DomSizeF::~DomSizeF()
{
}
void DomSizeF::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("width")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("width"), Qt::CaseInsensitive)) {
setElementWidth(reader.readElementText().toDouble());
continue;
}
- if (tag == QLatin1String("height")) {
+ if (!tag.compare(QLatin1String("height"), Qt::CaseInsensitive)) {
setElementHeight(reader.readElementText().toDouble());
continue;
}
@@ -6939,12 +4688,7 @@ void DomSizeF::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -6953,18 +4697,13 @@ void DomSizeF::read(QXmlStreamReader &reader)
void DomSizeF::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizef") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("sizef") : tagName.toLower());
- if (m_children & Width) {
+ if (m_children & Width)
writer.writeTextElement(QStringLiteral("width"), QString::number(m_width, 'f', 15));
- }
- if (m_children & Height) {
+ if (m_children & Height)
writer.writeTextElement(QStringLiteral("height"), QString::number(m_height, 'f', 15));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -6991,35 +4730,17 @@ void DomSizeF::clearElementHeight()
m_children &= ~Height;
}
-void DomChar::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_unicode = 0;
-}
-
-DomChar::DomChar()
-{
- m_children = 0;
- m_unicode = 0;
-}
-
DomChar::~DomChar()
{
}
void DomChar::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("unicode")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("unicode"), Qt::CaseInsensitive)) {
setElementUnicode(reader.readElementText().toInt());
continue;
}
@@ -7027,12 +4748,7 @@ void DomChar::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -7041,14 +4757,10 @@ void DomChar::read(QXmlStreamReader &reader)
void DomChar::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("char") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("char") : tagName.toLower());
- if (m_children & Unicode) {
+ if (m_children & Unicode)
writer.writeTextElement(QStringLiteral("unicode"), QString::number(m_unicode));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -7064,24 +4776,6 @@ void DomChar::clearElementUnicode()
m_children &= ~Unicode;
}
-void DomUrl::clear(bool clear_all)
-{
- delete m_string;
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_string = 0;
-}
-
-DomUrl::DomUrl()
-{
- m_children = 0;
- m_string = 0;
-}
-
DomUrl::~DomUrl()
{
delete m_string;
@@ -7089,12 +4783,11 @@ DomUrl::~DomUrl()
void DomUrl::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("string")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("string"), Qt::CaseInsensitive)) {
DomString *v = new DomString();
v->read(reader);
setElementString(v);
@@ -7104,12 +4797,7 @@ void DomUrl::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -7118,27 +4806,23 @@ void DomUrl::read(QXmlStreamReader &reader)
void DomUrl::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("url") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("url") : tagName.toLower());
- if (m_children & String) {
+ if (m_children & String)
m_string->write(writer, QStringLiteral("string"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-DomString* DomUrl::takeElementString()
+DomString *DomUrl::takeElementString()
{
- DomString* a = m_string;
+ DomString *a = m_string;
m_string = 0;
m_children ^= String;
return a;
}
-void DomUrl::setElementString(DomString* a)
+void DomUrl::setElementString(DomString *a)
{
delete m_string;
m_children |= String;
@@ -7152,7 +4836,7 @@ void DomUrl::clearElementString()
m_children &= ~String;
}
-void DomProperty::clear(bool clear_all)
+DomProperty::~DomProperty()
{
delete m_color;
delete m_font;
@@ -7175,84 +4859,9 @@ void DomProperty::clear(bool clear_all)
delete m_char;
delete m_url;
delete m_brush;
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- m_has_attr_stdset = false;
- m_attr_stdset = 0;
- }
-
- m_kind = Unknown;
-
- m_color = 0;
- m_cursor = 0;
- m_font = 0;
- m_iconSet = 0;
- m_pixmap = 0;
- m_palette = 0;
- m_point = 0;
- m_rect = 0;
- m_locale = 0;
- m_sizePolicy = 0;
- m_size = 0;
- m_string = 0;
- m_stringList = 0;
- m_number = 0;
- m_float = 0.0;
- m_double = 0;
- m_date = 0;
- m_time = 0;
- m_dateTime = 0;
- m_pointF = 0;
- m_rectF = 0;
- m_sizeF = 0;
- m_longLong = 0;
- m_char = 0;
- m_url = 0;
- m_UInt = 0;
- m_uLongLong = 0;
- m_brush = 0;
}
-DomProperty::DomProperty()
-{
- m_kind = Unknown;
-
- m_has_attr_name = false;
- m_has_attr_stdset = false;
- m_attr_stdset = 0;
- m_color = 0;
- m_cursor = 0;
- m_font = 0;
- m_iconSet = 0;
- m_pixmap = 0;
- m_palette = 0;
- m_point = 0;
- m_rect = 0;
- m_locale = 0;
- m_sizePolicy = 0;
- m_size = 0;
- m_string = 0;
- m_stringList = 0;
- m_number = 0;
- m_float = 0.0;
- m_double = 0;
- m_date = 0;
- m_time = 0;
- m_dateTime = 0;
- m_pointF = 0;
- m_rectF = 0;
- m_sizeF = 0;
- m_longLong = 0;
- m_char = 0;
- m_url = 0;
- m_UInt = 0;
- m_uLongLong = 0;
- m_brush = 0;
-}
-
-DomProperty::~DomProperty()
+void DomProperty::clear()
{
delete m_color;
delete m_font;
@@ -7275,14 +4884,44 @@ DomProperty::~DomProperty()
delete m_char;
delete m_url;
delete m_brush;
+
+ m_kind = Unknown;
+
+ m_color = nullptr;
+ m_cursor = 0;
+ m_font = nullptr;
+ m_iconSet = nullptr;
+ m_pixmap = nullptr;
+ m_palette = nullptr;
+ m_point = nullptr;
+ m_rect = nullptr;
+ m_locale = nullptr;
+ m_sizePolicy = nullptr;
+ m_size = nullptr;
+ m_string = nullptr;
+ m_stringList = nullptr;
+ m_number = 0;
+ m_float = 0.0;
+ m_double = 0.0;
+ m_date = nullptr;
+ m_time = nullptr;
+ m_dateTime = nullptr;
+ m_pointF = nullptr;
+ m_rectF = nullptr;
+ m_sizeF = nullptr;
+ m_longLong = 0;
+ m_char = nullptr;
+ m_url = nullptr;
+ m_UInt = 0;
+ m_uLongLong = 0;
+ m_brush = nullptr;
}
void DomProperty::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -7294,179 +4933,179 @@ void DomProperty::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("bool")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("bool"), Qt::CaseInsensitive)) {
setElementBool(reader.readElementText());
continue;
}
- if (tag == QLatin1String("color")) {
+ if (!tag.compare(QLatin1String("color"), Qt::CaseInsensitive)) {
DomColor *v = new DomColor();
v->read(reader);
setElementColor(v);
continue;
}
- if (tag == QLatin1String("cstring")) {
+ if (!tag.compare(QLatin1String("cstring"), Qt::CaseInsensitive)) {
setElementCstring(reader.readElementText());
continue;
}
- if (tag == QLatin1String("cursor")) {
+ if (!tag.compare(QLatin1String("cursor"), Qt::CaseInsensitive)) {
setElementCursor(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("cursorshape")) {
+ if (!tag.compare(QLatin1String("cursorshape"), Qt::CaseInsensitive)) {
setElementCursorShape(reader.readElementText());
continue;
}
- if (tag == QLatin1String("enum")) {
+ if (!tag.compare(QLatin1String("enum"), Qt::CaseInsensitive)) {
setElementEnum(reader.readElementText());
continue;
}
- if (tag == QLatin1String("font")) {
+ if (!tag.compare(QLatin1String("font"), Qt::CaseInsensitive)) {
DomFont *v = new DomFont();
v->read(reader);
setElementFont(v);
continue;
}
- if (tag == QLatin1String("iconset")) {
+ if (!tag.compare(QLatin1String("iconset"), Qt::CaseInsensitive)) {
DomResourceIcon *v = new DomResourceIcon();
v->read(reader);
setElementIconSet(v);
continue;
}
- if (tag == QLatin1String("pixmap")) {
+ if (!tag.compare(QLatin1String("pixmap"), Qt::CaseInsensitive)) {
DomResourcePixmap *v = new DomResourcePixmap();
v->read(reader);
setElementPixmap(v);
continue;
}
- if (tag == QLatin1String("palette")) {
+ if (!tag.compare(QLatin1String("palette"), Qt::CaseInsensitive)) {
DomPalette *v = new DomPalette();
v->read(reader);
setElementPalette(v);
continue;
}
- if (tag == QLatin1String("point")) {
+ if (!tag.compare(QLatin1String("point"), Qt::CaseInsensitive)) {
DomPoint *v = new DomPoint();
v->read(reader);
setElementPoint(v);
continue;
}
- if (tag == QLatin1String("rect")) {
+ if (!tag.compare(QLatin1String("rect"), Qt::CaseInsensitive)) {
DomRect *v = new DomRect();
v->read(reader);
setElementRect(v);
continue;
}
- if (tag == QLatin1String("set")) {
+ if (!tag.compare(QLatin1String("set"), Qt::CaseInsensitive)) {
setElementSet(reader.readElementText());
continue;
}
- if (tag == QLatin1String("locale")) {
+ if (!tag.compare(QLatin1String("locale"), Qt::CaseInsensitive)) {
DomLocale *v = new DomLocale();
v->read(reader);
setElementLocale(v);
continue;
}
- if (tag == QLatin1String("sizepolicy")) {
+ if (!tag.compare(QLatin1String("sizepolicy"), Qt::CaseInsensitive)) {
DomSizePolicy *v = new DomSizePolicy();
v->read(reader);
setElementSizePolicy(v);
continue;
}
- if (tag == QLatin1String("size")) {
+ if (!tag.compare(QLatin1String("size"), Qt::CaseInsensitive)) {
DomSize *v = new DomSize();
v->read(reader);
setElementSize(v);
continue;
}
- if (tag == QLatin1String("string")) {
+ if (!tag.compare(QLatin1String("string"), Qt::CaseInsensitive)) {
DomString *v = new DomString();
v->read(reader);
setElementString(v);
continue;
}
- if (tag == QLatin1String("stringlist")) {
+ if (!tag.compare(QLatin1String("stringlist"), Qt::CaseInsensitive)) {
DomStringList *v = new DomStringList();
v->read(reader);
setElementStringList(v);
continue;
}
- if (tag == QLatin1String("number")) {
+ if (!tag.compare(QLatin1String("number"), Qt::CaseInsensitive)) {
setElementNumber(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("float")) {
+ if (!tag.compare(QLatin1String("float"), Qt::CaseInsensitive)) {
setElementFloat(reader.readElementText().toFloat());
continue;
}
- if (tag == QLatin1String("double")) {
+ if (!tag.compare(QLatin1String("double"), Qt::CaseInsensitive)) {
setElementDouble(reader.readElementText().toDouble());
continue;
}
- if (tag == QLatin1String("date")) {
+ if (!tag.compare(QLatin1String("date"), Qt::CaseInsensitive)) {
DomDate *v = new DomDate();
v->read(reader);
setElementDate(v);
continue;
}
- if (tag == QLatin1String("time")) {
+ if (!tag.compare(QLatin1String("time"), Qt::CaseInsensitive)) {
DomTime *v = new DomTime();
v->read(reader);
setElementTime(v);
continue;
}
- if (tag == QLatin1String("datetime")) {
+ if (!tag.compare(QLatin1String("datetime"), Qt::CaseInsensitive)) {
DomDateTime *v = new DomDateTime();
v->read(reader);
setElementDateTime(v);
continue;
}
- if (tag == QLatin1String("pointf")) {
+ if (!tag.compare(QLatin1String("pointf"), Qt::CaseInsensitive)) {
DomPointF *v = new DomPointF();
v->read(reader);
setElementPointF(v);
continue;
}
- if (tag == QLatin1String("rectf")) {
+ if (!tag.compare(QLatin1String("rectf"), Qt::CaseInsensitive)) {
DomRectF *v = new DomRectF();
v->read(reader);
setElementRectF(v);
continue;
}
- if (tag == QLatin1String("sizef")) {
+ if (!tag.compare(QLatin1String("sizef"), Qt::CaseInsensitive)) {
DomSizeF *v = new DomSizeF();
v->read(reader);
setElementSizeF(v);
continue;
}
- if (tag == QLatin1String("longlong")) {
+ if (!tag.compare(QLatin1String("longlong"), Qt::CaseInsensitive)) {
setElementLongLong(reader.readElementText().toLongLong());
continue;
}
- if (tag == QLatin1String("char")) {
+ if (!tag.compare(QLatin1String("char"), Qt::CaseInsensitive)) {
DomChar *v = new DomChar();
v->read(reader);
setElementChar(v);
continue;
}
- if (tag == QLatin1String("url")) {
+ if (!tag.compare(QLatin1String("url"), Qt::CaseInsensitive)) {
DomUrl *v = new DomUrl();
v->read(reader);
setElementUrl(v);
continue;
}
- if (tag == QLatin1String("uint")) {
+ if (!tag.compare(QLatin1String("uint"), Qt::CaseInsensitive)) {
setElementUInt(reader.readElementText().toUInt());
continue;
}
- if (tag == QLatin1String("ulonglong")) {
+ if (!tag.compare(QLatin1String("ulonglong"), Qt::CaseInsensitive)) {
setElementULongLong(reader.readElementText().toULongLong());
continue;
}
- if (tag == QLatin1String("brush")) {
+ if (!tag.compare(QLatin1String("brush"), Qt::CaseInsensitive)) {
DomBrush *v = new DomBrush();
v->read(reader);
setElementBrush(v);
@@ -7476,12 +5115,7 @@ void DomProperty::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -7490,7 +5124,7 @@ void DomProperty::read(QXmlStreamReader &reader)
void DomProperty::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("property") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("property") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
@@ -7499,605 +5133,564 @@ void DomProperty::write(QXmlStreamWriter &writer, const QString &tagName) const
writer.writeAttribute(QStringLiteral("stdset"), QString::number(attributeStdset()));
switch (kind()) {
- case Bool: {
- writer.writeTextElement(QStringLiteral("bool"), elementBool());
- break;
- }
- case Color: {
- DomColor* v = elementColor();
- if (v != 0) {
- v->write(writer, QStringLiteral("color"));
- }
- break;
- }
- case Cstring: {
- writer.writeTextElement(QStringLiteral("cstring"), elementCstring());
- break;
- }
- case Cursor: {
- writer.writeTextElement(QStringLiteral("cursor"), QString::number(elementCursor()));
- break;
- }
- case CursorShape: {
- writer.writeTextElement(QStringLiteral("cursorShape"), elementCursorShape());
- break;
- }
- case Enum: {
- writer.writeTextElement(QStringLiteral("enum"), elementEnum());
- break;
- }
- case Font: {
- DomFont* v = elementFont();
- if (v != 0) {
- v->write(writer, QStringLiteral("font"));
- }
- break;
- }
- case IconSet: {
- DomResourceIcon* v = elementIconSet();
- if (v != 0) {
- v->write(writer, QStringLiteral("iconset"));
- }
- break;
- }
- case Pixmap: {
- DomResourcePixmap* v = elementPixmap();
- if (v != 0) {
- v->write(writer, QStringLiteral("pixmap"));
- }
- break;
- }
- case Palette: {
- DomPalette* v = elementPalette();
- if (v != 0) {
- v->write(writer, QStringLiteral("palette"));
- }
- break;
- }
- case Point: {
- DomPoint* v = elementPoint();
- if (v != 0) {
- v->write(writer, QStringLiteral("point"));
- }
- break;
- }
- case Rect: {
- DomRect* v = elementRect();
- if (v != 0) {
- v->write(writer, QStringLiteral("rect"));
- }
- break;
- }
- case Set: {
- writer.writeTextElement(QStringLiteral("set"), elementSet());
- break;
- }
- case Locale: {
- DomLocale* v = elementLocale();
- if (v != 0) {
- v->write(writer, QStringLiteral("locale"));
- }
- break;
- }
- case SizePolicy: {
- DomSizePolicy* v = elementSizePolicy();
- if (v != 0) {
- v->write(writer, QStringLiteral("sizepolicy"));
- }
- break;
- }
- case Size: {
- DomSize* v = elementSize();
- if (v != 0) {
- v->write(writer, QStringLiteral("size"));
- }
- break;
- }
- case String: {
- DomString* v = elementString();
- if (v != 0) {
- v->write(writer, QStringLiteral("string"));
- }
- break;
- }
- case StringList: {
- DomStringList* v = elementStringList();
- if (v != 0) {
- v->write(writer, QStringLiteral("stringlist"));
- }
- break;
- }
- case Number: {
- writer.writeTextElement(QStringLiteral("number"), QString::number(elementNumber()));
- break;
- }
- case Float: {
- writer.writeTextElement(QStringLiteral("float"), QString::number(elementFloat(), 'f', 8));
- break;
- }
- case Double: {
- writer.writeTextElement(QStringLiteral("double"), QString::number(elementDouble(), 'f', 15));
- break;
- }
- case Date: {
- DomDate* v = elementDate();
- if (v != 0) {
- v->write(writer, QStringLiteral("date"));
- }
- break;
- }
- case Time: {
- DomTime* v = elementTime();
- if (v != 0) {
- v->write(writer, QStringLiteral("time"));
- }
- break;
- }
- case DateTime: {
- DomDateTime* v = elementDateTime();
- if (v != 0) {
- v->write(writer, QStringLiteral("datetime"));
- }
- break;
- }
- case PointF: {
- DomPointF* v = elementPointF();
- if (v != 0) {
- v->write(writer, QStringLiteral("pointf"));
- }
- break;
- }
- case RectF: {
- DomRectF* v = elementRectF();
- if (v != 0) {
- v->write(writer, QStringLiteral("rectf"));
- }
- break;
- }
- case SizeF: {
- DomSizeF* v = elementSizeF();
- if (v != 0) {
- v->write(writer, QStringLiteral("sizef"));
- }
- break;
- }
- case LongLong: {
- writer.writeTextElement(QStringLiteral("longLong"), QString::number(elementLongLong()));
- break;
- }
- case Char: {
- DomChar* v = elementChar();
- if (v != 0) {
- v->write(writer, QStringLiteral("char"));
- }
- break;
- }
- case Url: {
- DomUrl* v = elementUrl();
- if (v != 0) {
- v->write(writer, QStringLiteral("url"));
- }
- break;
- }
- case UInt: {
- writer.writeTextElement(QStringLiteral("UInt"), QString::number(elementUInt()));
- break;
- }
- case ULongLong: {
- writer.writeTextElement(QStringLiteral("uLongLong"), QString::number(elementULongLong()));
- break;
- }
- case Brush: {
- DomBrush* v = elementBrush();
- if (v != 0) {
- v->write(writer, QStringLiteral("brush"));
- }
- break;
- }
- default:
- break;
+ case Bool: {
+ writer.writeTextElement(QStringLiteral("bool"), elementBool());
+ break;
+ }
+ case Color: {
+ DomColor *v = elementColor();
+ if (v != 0)
+ v->write(writer, QStringLiteral("color"));
+ break;
+ }
+ case Cstring: {
+ writer.writeTextElement(QStringLiteral("cstring"), elementCstring());
+ break;
+ }
+ case Cursor: {
+ writer.writeTextElement(QStringLiteral("cursor"), QString::number(elementCursor()));
+ break;
+ }
+ case CursorShape: {
+ writer.writeTextElement(QStringLiteral("cursorShape"), elementCursorShape());
+ break;
+ }
+ case Enum: {
+ writer.writeTextElement(QStringLiteral("enum"), elementEnum());
+ break;
+ }
+ case Font: {
+ DomFont *v = elementFont();
+ if (v != 0)
+ v->write(writer, QStringLiteral("font"));
+ break;
+ }
+ case IconSet: {
+ DomResourceIcon *v = elementIconSet();
+ if (v != 0)
+ v->write(writer, QStringLiteral("iconset"));
+ break;
+ }
+ case Pixmap: {
+ DomResourcePixmap *v = elementPixmap();
+ if (v != 0)
+ v->write(writer, QStringLiteral("pixmap"));
+ break;
+ }
+ case Palette: {
+ DomPalette *v = elementPalette();
+ if (v != 0)
+ v->write(writer, QStringLiteral("palette"));
+ break;
+ }
+ case Point: {
+ DomPoint *v = elementPoint();
+ if (v != 0)
+ v->write(writer, QStringLiteral("point"));
+ break;
+ }
+ case Rect: {
+ DomRect *v = elementRect();
+ if (v != 0)
+ v->write(writer, QStringLiteral("rect"));
+ break;
+ }
+ case Set: {
+ writer.writeTextElement(QStringLiteral("set"), elementSet());
+ break;
+ }
+ case Locale: {
+ DomLocale *v = elementLocale();
+ if (v != 0)
+ v->write(writer, QStringLiteral("locale"));
+ break;
+ }
+ case SizePolicy: {
+ DomSizePolicy *v = elementSizePolicy();
+ if (v != 0)
+ v->write(writer, QStringLiteral("sizepolicy"));
+ break;
+ }
+ case Size: {
+ DomSize *v = elementSize();
+ if (v != 0)
+ v->write(writer, QStringLiteral("size"));
+ break;
+ }
+ case String: {
+ DomString *v = elementString();
+ if (v != 0)
+ v->write(writer, QStringLiteral("string"));
+ break;
+ }
+ case StringList: {
+ DomStringList *v = elementStringList();
+ if (v != 0)
+ v->write(writer, QStringLiteral("stringlist"));
+ break;
+ }
+ case Number: {
+ writer.writeTextElement(QStringLiteral("number"), QString::number(elementNumber()));
+ break;
+ }
+ case Float: {
+ writer.writeTextElement(QStringLiteral("float"), QString::number(elementFloat(), 'f', 8));
+ break;
+ }
+ case Double: {
+ writer.writeTextElement(QStringLiteral("double"), QString::number(elementDouble(), 'f', 15));
+ break;
+ }
+ case Date: {
+ DomDate *v = elementDate();
+ if (v != 0)
+ v->write(writer, QStringLiteral("date"));
+ break;
+ }
+ case Time: {
+ DomTime *v = elementTime();
+ if (v != 0)
+ v->write(writer, QStringLiteral("time"));
+ break;
+ }
+ case DateTime: {
+ DomDateTime *v = elementDateTime();
+ if (v != 0)
+ v->write(writer, QStringLiteral("datetime"));
+ break;
+ }
+ case PointF: {
+ DomPointF *v = elementPointF();
+ if (v != 0)
+ v->write(writer, QStringLiteral("pointf"));
+ break;
+ }
+ case RectF: {
+ DomRectF *v = elementRectF();
+ if (v != 0)
+ v->write(writer, QStringLiteral("rectf"));
+ break;
+ }
+ case SizeF: {
+ DomSizeF *v = elementSizeF();
+ if (v != 0)
+ v->write(writer, QStringLiteral("sizef"));
+ break;
+ }
+ case LongLong: {
+ writer.writeTextElement(QStringLiteral("longLong"), QString::number(elementLongLong()));
+ break;
+ }
+ case Char: {
+ DomChar *v = elementChar();
+ if (v != 0)
+ v->write(writer, QStringLiteral("char"));
+ break;
+ }
+ case Url: {
+ DomUrl *v = elementUrl();
+ if (v != 0)
+ v->write(writer, QStringLiteral("url"));
+ break;
+ }
+ case UInt: {
+ writer.writeTextElement(QStringLiteral("UInt"), QString::number(elementUInt()));
+ break;
+ }
+ case ULongLong: {
+ writer.writeTextElement(QStringLiteral("uLongLong"), QString::number(elementULongLong()));
+ break;
+ }
+ case Brush: {
+ DomBrush *v = elementBrush();
+ if (v != 0)
+ v->write(writer, QStringLiteral("brush"));
+ break;
+ }
+ default:
+ break;
}
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomProperty::setElementBool(const QString& a)
+void DomProperty::setElementBool(const QString &a)
{
- clear(false);
+ clear();
m_kind = Bool;
m_bool = a;
}
-DomColor* DomProperty::takeElementColor()
+DomColor *DomProperty::takeElementColor()
{
- DomColor* a = m_color;
+ DomColor *a = m_color;
m_color = 0;
return a;
}
-void DomProperty::setElementColor(DomColor* a)
+void DomProperty::setElementColor(DomColor *a)
{
- clear(false);
+ clear();
m_kind = Color;
m_color = a;
}
-void DomProperty::setElementCstring(const QString& a)
+void DomProperty::setElementCstring(const QString &a)
{
- clear(false);
+ clear();
m_kind = Cstring;
m_cstring = a;
}
void DomProperty::setElementCursor(int a)
{
- clear(false);
+ clear();
m_kind = Cursor;
m_cursor = a;
}
-void DomProperty::setElementCursorShape(const QString& a)
+void DomProperty::setElementCursorShape(const QString &a)
{
- clear(false);
+ clear();
m_kind = CursorShape;
m_cursorShape = a;
}
-void DomProperty::setElementEnum(const QString& a)
+void DomProperty::setElementEnum(const QString &a)
{
- clear(false);
+ clear();
m_kind = Enum;
m_enum = a;
}
-DomFont* DomProperty::takeElementFont()
+DomFont *DomProperty::takeElementFont()
{
- DomFont* a = m_font;
+ DomFont *a = m_font;
m_font = 0;
return a;
}
-void DomProperty::setElementFont(DomFont* a)
+void DomProperty::setElementFont(DomFont *a)
{
- clear(false);
+ clear();
m_kind = Font;
m_font = a;
}
-DomResourceIcon* DomProperty::takeElementIconSet()
+DomResourceIcon *DomProperty::takeElementIconSet()
{
- DomResourceIcon* a = m_iconSet;
+ DomResourceIcon *a = m_iconSet;
m_iconSet = 0;
return a;
}
-void DomProperty::setElementIconSet(DomResourceIcon* a)
+void DomProperty::setElementIconSet(DomResourceIcon *a)
{
- clear(false);
+ clear();
m_kind = IconSet;
m_iconSet = a;
}
-DomResourcePixmap* DomProperty::takeElementPixmap()
+DomResourcePixmap *DomProperty::takeElementPixmap()
{
- DomResourcePixmap* a = m_pixmap;
+ DomResourcePixmap *a = m_pixmap;
m_pixmap = 0;
return a;
}
-void DomProperty::setElementPixmap(DomResourcePixmap* a)
+void DomProperty::setElementPixmap(DomResourcePixmap *a)
{
- clear(false);
+ clear();
m_kind = Pixmap;
m_pixmap = a;
}
-DomPalette* DomProperty::takeElementPalette()
+DomPalette *DomProperty::takeElementPalette()
{
- DomPalette* a = m_palette;
+ DomPalette *a = m_palette;
m_palette = 0;
return a;
}
-void DomProperty::setElementPalette(DomPalette* a)
+void DomProperty::setElementPalette(DomPalette *a)
{
- clear(false);
+ clear();
m_kind = Palette;
m_palette = a;
}
-DomPoint* DomProperty::takeElementPoint()
+DomPoint *DomProperty::takeElementPoint()
{
- DomPoint* a = m_point;
+ DomPoint *a = m_point;
m_point = 0;
return a;
}
-void DomProperty::setElementPoint(DomPoint* a)
+void DomProperty::setElementPoint(DomPoint *a)
{
- clear(false);
+ clear();
m_kind = Point;
m_point = a;
}
-DomRect* DomProperty::takeElementRect()
+DomRect *DomProperty::takeElementRect()
{
- DomRect* a = m_rect;
+ DomRect *a = m_rect;
m_rect = 0;
return a;
}
-void DomProperty::setElementRect(DomRect* a)
+void DomProperty::setElementRect(DomRect *a)
{
- clear(false);
+ clear();
m_kind = Rect;
m_rect = a;
}
-void DomProperty::setElementSet(const QString& a)
+void DomProperty::setElementSet(const QString &a)
{
- clear(false);
+ clear();
m_kind = Set;
m_set = a;
}
-DomLocale* DomProperty::takeElementLocale()
+DomLocale *DomProperty::takeElementLocale()
{
- DomLocale* a = m_locale;
+ DomLocale *a = m_locale;
m_locale = 0;
return a;
}
-void DomProperty::setElementLocale(DomLocale* a)
+void DomProperty::setElementLocale(DomLocale *a)
{
- clear(false);
+ clear();
m_kind = Locale;
m_locale = a;
}
-DomSizePolicy* DomProperty::takeElementSizePolicy()
+DomSizePolicy *DomProperty::takeElementSizePolicy()
{
- DomSizePolicy* a = m_sizePolicy;
+ DomSizePolicy *a = m_sizePolicy;
m_sizePolicy = 0;
return a;
}
-void DomProperty::setElementSizePolicy(DomSizePolicy* a)
+void DomProperty::setElementSizePolicy(DomSizePolicy *a)
{
- clear(false);
+ clear();
m_kind = SizePolicy;
m_sizePolicy = a;
}
-DomSize* DomProperty::takeElementSize()
+DomSize *DomProperty::takeElementSize()
{
- DomSize* a = m_size;
+ DomSize *a = m_size;
m_size = 0;
return a;
}
-void DomProperty::setElementSize(DomSize* a)
+void DomProperty::setElementSize(DomSize *a)
{
- clear(false);
+ clear();
m_kind = Size;
m_size = a;
}
-DomString* DomProperty::takeElementString()
+DomString *DomProperty::takeElementString()
{
- DomString* a = m_string;
+ DomString *a = m_string;
m_string = 0;
return a;
}
-void DomProperty::setElementString(DomString* a)
+void DomProperty::setElementString(DomString *a)
{
- clear(false);
+ clear();
m_kind = String;
m_string = a;
}
-DomStringList* DomProperty::takeElementStringList()
+DomStringList *DomProperty::takeElementStringList()
{
- DomStringList* a = m_stringList;
+ DomStringList *a = m_stringList;
m_stringList = 0;
return a;
}
-void DomProperty::setElementStringList(DomStringList* a)
+void DomProperty::setElementStringList(DomStringList *a)
{
- clear(false);
+ clear();
m_kind = StringList;
m_stringList = a;
}
void DomProperty::setElementNumber(int a)
{
- clear(false);
+ clear();
m_kind = Number;
m_number = a;
}
void DomProperty::setElementFloat(float a)
{
- clear(false);
+ clear();
m_kind = Float;
m_float = a;
}
void DomProperty::setElementDouble(double a)
{
- clear(false);
+ clear();
m_kind = Double;
m_double = a;
}
-DomDate* DomProperty::takeElementDate()
+DomDate *DomProperty::takeElementDate()
{
- DomDate* a = m_date;
+ DomDate *a = m_date;
m_date = 0;
return a;
}
-void DomProperty::setElementDate(DomDate* a)
+void DomProperty::setElementDate(DomDate *a)
{
- clear(false);
+ clear();
m_kind = Date;
m_date = a;
}
-DomTime* DomProperty::takeElementTime()
+DomTime *DomProperty::takeElementTime()
{
- DomTime* a = m_time;
+ DomTime *a = m_time;
m_time = 0;
return a;
}
-void DomProperty::setElementTime(DomTime* a)
+void DomProperty::setElementTime(DomTime *a)
{
- clear(false);
+ clear();
m_kind = Time;
m_time = a;
}
-DomDateTime* DomProperty::takeElementDateTime()
+DomDateTime *DomProperty::takeElementDateTime()
{
- DomDateTime* a = m_dateTime;
+ DomDateTime *a = m_dateTime;
m_dateTime = 0;
return a;
}
-void DomProperty::setElementDateTime(DomDateTime* a)
+void DomProperty::setElementDateTime(DomDateTime *a)
{
- clear(false);
+ clear();
m_kind = DateTime;
m_dateTime = a;
}
-DomPointF* DomProperty::takeElementPointF()
+DomPointF *DomProperty::takeElementPointF()
{
- DomPointF* a = m_pointF;
+ DomPointF *a = m_pointF;
m_pointF = 0;
return a;
}
-void DomProperty::setElementPointF(DomPointF* a)
+void DomProperty::setElementPointF(DomPointF *a)
{
- clear(false);
+ clear();
m_kind = PointF;
m_pointF = a;
}
-DomRectF* DomProperty::takeElementRectF()
+DomRectF *DomProperty::takeElementRectF()
{
- DomRectF* a = m_rectF;
+ DomRectF *a = m_rectF;
m_rectF = 0;
return a;
}
-void DomProperty::setElementRectF(DomRectF* a)
+void DomProperty::setElementRectF(DomRectF *a)
{
- clear(false);
+ clear();
m_kind = RectF;
m_rectF = a;
}
-DomSizeF* DomProperty::takeElementSizeF()
+DomSizeF *DomProperty::takeElementSizeF()
{
- DomSizeF* a = m_sizeF;
+ DomSizeF *a = m_sizeF;
m_sizeF = 0;
return a;
}
-void DomProperty::setElementSizeF(DomSizeF* a)
+void DomProperty::setElementSizeF(DomSizeF *a)
{
- clear(false);
+ clear();
m_kind = SizeF;
m_sizeF = a;
}
void DomProperty::setElementLongLong(qlonglong a)
{
- clear(false);
+ clear();
m_kind = LongLong;
m_longLong = a;
}
-DomChar* DomProperty::takeElementChar()
+DomChar *DomProperty::takeElementChar()
{
- DomChar* a = m_char;
+ DomChar *a = m_char;
m_char = 0;
return a;
}
-void DomProperty::setElementChar(DomChar* a)
+void DomProperty::setElementChar(DomChar *a)
{
- clear(false);
+ clear();
m_kind = Char;
m_char = a;
}
-DomUrl* DomProperty::takeElementUrl()
+DomUrl *DomProperty::takeElementUrl()
{
- DomUrl* a = m_url;
+ DomUrl *a = m_url;
m_url = 0;
return a;
}
-void DomProperty::setElementUrl(DomUrl* a)
+void DomProperty::setElementUrl(DomUrl *a)
{
- clear(false);
+ clear();
m_kind = Url;
m_url = a;
}
void DomProperty::setElementUInt(uint a)
{
- clear(false);
+ clear();
m_kind = UInt;
m_UInt = a;
}
void DomProperty::setElementULongLong(qulonglong a)
{
- clear(false);
+ clear();
m_kind = ULongLong;
m_uLongLong = a;
}
-DomBrush* DomProperty::takeElementBrush()
+DomBrush *DomProperty::takeElementBrush()
{
- DomBrush* a = m_brush;
+ DomBrush *a = m_brush;
m_brush = 0;
return a;
}
-void DomProperty::setElementBrush(DomBrush* a)
+void DomProperty::setElementBrush(DomBrush *a)
{
- clear(false);
+ clear();
m_kind = Brush;
m_brush = a;
}
-void DomConnections::clear(bool clear_all)
-{
- qDeleteAll(m_connection);
- m_connection.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomConnections::DomConnections()
-{
- m_children = 0;
-}
-
DomConnections::~DomConnections()
{
qDeleteAll(m_connection);
@@ -8106,12 +5699,11 @@ DomConnections::~DomConnections()
void DomConnections::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("connection")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("connection"), Qt::CaseInsensitive)) {
DomConnection *v = new DomConnection();
v->read(reader);
m_connection.append(v);
@@ -8121,12 +5713,7 @@ void DomConnections::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8135,42 +5722,20 @@ void DomConnections::read(QXmlStreamReader &reader)
void DomConnections::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connections") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("connections") : tagName.toLower());
- for (int i = 0; i < m_connection.size(); ++i) {
- DomConnection* v = m_connection[i];
+ for (DomConnection *v : m_connection)
v->write(writer, QStringLiteral("connection"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomConnections::setElementConnection(const QList<DomConnection*>& a)
+void DomConnections::setElementConnection(const QVector<DomConnection *> &a)
{
m_children |= Connection;
m_connection = a;
}
-void DomConnection::clear(bool clear_all)
-{
- delete m_hints;
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
- m_hints = 0;
-}
-
-DomConnection::DomConnection()
-{
- m_children = 0;
- m_hints = 0;
-}
-
DomConnection::~DomConnection()
{
delete m_hints;
@@ -8178,28 +5743,27 @@ DomConnection::~DomConnection()
void DomConnection::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("sender")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("sender"), Qt::CaseInsensitive)) {
setElementSender(reader.readElementText());
continue;
}
- if (tag == QLatin1String("signal")) {
+ if (!tag.compare(QLatin1String("signal"), Qt::CaseInsensitive)) {
setElementSignal(reader.readElementText());
continue;
}
- if (tag == QLatin1String("receiver")) {
+ if (!tag.compare(QLatin1String("receiver"), Qt::CaseInsensitive)) {
setElementReceiver(reader.readElementText());
continue;
}
- if (tag == QLatin1String("slot")) {
+ if (!tag.compare(QLatin1String("slot"), Qt::CaseInsensitive)) {
setElementSlot(reader.readElementText());
continue;
}
- if (tag == QLatin1String("hints")) {
+ if (!tag.compare(QLatin1String("hints"), Qt::CaseInsensitive)) {
DomConnectionHints *v = new DomConnectionHints();
v->read(reader);
setElementHints(v);
@@ -8209,12 +5773,7 @@ void DomConnection::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8223,67 +5782,59 @@ void DomConnection::read(QXmlStreamReader &reader)
void DomConnection::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connection") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("connection") : tagName.toLower());
- if (m_children & Sender) {
+ if (m_children & Sender)
writer.writeTextElement(QStringLiteral("sender"), m_sender);
- }
- if (m_children & Signal) {
+ if (m_children & Signal)
writer.writeTextElement(QStringLiteral("signal"), m_signal);
- }
- if (m_children & Receiver) {
+ if (m_children & Receiver)
writer.writeTextElement(QStringLiteral("receiver"), m_receiver);
- }
- if (m_children & Slot) {
+ if (m_children & Slot)
writer.writeTextElement(QStringLiteral("slot"), m_slot);
- }
- if (m_children & Hints) {
+ if (m_children & Hints)
m_hints->write(writer, QStringLiteral("hints"));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomConnection::setElementSender(const QString& a)
+void DomConnection::setElementSender(const QString &a)
{
m_children |= Sender;
m_sender = a;
}
-void DomConnection::setElementSignal(const QString& a)
+void DomConnection::setElementSignal(const QString &a)
{
m_children |= Signal;
m_signal = a;
}
-void DomConnection::setElementReceiver(const QString& a)
+void DomConnection::setElementReceiver(const QString &a)
{
m_children |= Receiver;
m_receiver = a;
}
-void DomConnection::setElementSlot(const QString& a)
+void DomConnection::setElementSlot(const QString &a)
{
m_children |= Slot;
m_slot = a;
}
-DomConnectionHints* DomConnection::takeElementHints()
+DomConnectionHints *DomConnection::takeElementHints()
{
- DomConnectionHints* a = m_hints;
+ DomConnectionHints *a = m_hints;
m_hints = 0;
m_children ^= Hints;
return a;
}
-void DomConnection::setElementHints(DomConnectionHints* a)
+void DomConnection::setElementHints(DomConnectionHints *a)
{
delete m_hints;
m_children |= Hints;
@@ -8317,23 +5868,6 @@ void DomConnection::clearElementHints()
m_children &= ~Hints;
}
-void DomConnectionHints::clear(bool clear_all)
-{
- qDeleteAll(m_hint);
- m_hint.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomConnectionHints::DomConnectionHints()
-{
- m_children = 0;
-}
-
DomConnectionHints::~DomConnectionHints()
{
qDeleteAll(m_hint);
@@ -8342,12 +5876,11 @@ DomConnectionHints::~DomConnectionHints()
void DomConnectionHints::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("hint")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("hint"), Qt::CaseInsensitive)) {
DomConnectionHint *v = new DomConnectionHint();
v->read(reader);
m_hint.append(v);
@@ -8357,12 +5890,7 @@ void DomConnectionHints::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8371,55 +5899,29 @@ void DomConnectionHints::read(QXmlStreamReader &reader)
void DomConnectionHints::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connectionhints") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("connectionhints") : tagName.toLower());
- for (int i = 0; i < m_hint.size(); ++i) {
- DomConnectionHint* v = m_hint[i];
+ for (DomConnectionHint *v : m_hint)
v->write(writer, QStringLiteral("hint"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomConnectionHints::setElementHint(const QList<DomConnectionHint*>& a)
+void DomConnectionHints::setElementHint(const QVector<DomConnectionHint *> &a)
{
m_children |= Hint;
m_hint = a;
}
-void DomConnectionHint::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_type = false;
- }
-
- m_children = 0;
- m_x = 0;
- m_y = 0;
-}
-
-DomConnectionHint::DomConnectionHint()
-{
- m_children = 0;
- m_has_attr_type = false;
- m_x = 0;
- m_y = 0;
-}
-
DomConnectionHint::~DomConnectionHint()
{
}
void DomConnectionHint::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("type")) {
setAttributeType(attribute.value().toString());
continue;
@@ -8427,15 +5929,15 @@ void DomConnectionHint::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("x")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("x"), Qt::CaseInsensitive)) {
setElementX(reader.readElementText().toInt());
continue;
}
- if (tag == QLatin1String("y")) {
+ if (!tag.compare(QLatin1String("y"), Qt::CaseInsensitive)) {
setElementY(reader.readElementText().toInt());
continue;
}
@@ -8443,12 +5945,7 @@ void DomConnectionHint::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8457,21 +5954,16 @@ void DomConnectionHint::read(QXmlStreamReader &reader)
void DomConnectionHint::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connectionhint") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("connectionhint") : tagName.toLower());
if (hasAttributeType())
writer.writeAttribute(QStringLiteral("type"), attributeType());
- if (m_children & X) {
+ if (m_children & X)
writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x));
- }
- if (m_children & Y) {
+ if (m_children & Y)
writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y));
- }
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
@@ -8498,171 +5990,6 @@ void DomConnectionHint::clearElementY()
m_children &= ~Y;
}
-void DomScript::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_source = false;
- m_has_attr_language = false;
- }
-
- m_children = 0;
-}
-
-DomScript::DomScript()
-{
- m_children = 0;
- m_has_attr_source = false;
- m_has_attr_language = false;
-}
-
-DomScript::~DomScript()
-{
-}
-
-void DomScript::read(QXmlStreamReader &reader)
-{
-
- const QXmlStreamAttributes attributes = reader.attributes();
- for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
- if (name == QLatin1String("source")) {
- setAttributeSource(attribute.value().toString());
- continue;
- }
- if (name == QLatin1String("language")) {
- setAttributeLanguage(attribute.value().toString());
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected attribute ") + name);
- }
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomScript::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("script") : tagName.toLower());
-
- if (hasAttributeSource())
- writer.writeAttribute(QStringLiteral("source"), attributeSource());
-
- if (hasAttributeLanguage())
- writer.writeAttribute(QStringLiteral("language"), attributeLanguage());
-
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomWidgetData::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomWidgetData::DomWidgetData()
-{
- m_children = 0;
-}
-
-DomWidgetData::~DomWidgetData()
-{
- qDeleteAll(m_property);
- m_property.clear();
-}
-
-void DomWidgetData::read(QXmlStreamReader &reader)
-{
-
- for (bool finished = false; !finished && !reader.hasError();) {
- switch (reader.readNext()) {
- case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
- DomProperty *v = new DomProperty();
- v->read(reader);
- m_property.append(v);
- continue;
- }
- reader.raiseError(QLatin1String("Unexpected element ") + tag);
- }
- break;
- case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
- default :
- break;
- }
- }
-}
-
-void DomWidgetData::write(QXmlStreamWriter &writer, const QString &tagName) const
-{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("widgetdata") : tagName.toLower());
-
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
- v->write(writer, QStringLiteral("property"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
- writer.writeEndElement();
-}
-
-void DomWidgetData::setElementProperty(const QList<DomProperty*>& a)
-{
- m_children |= Property;
- m_property = a;
-}
-
-void DomDesignerData::clear(bool clear_all)
-{
- qDeleteAll(m_property);
- m_property.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomDesignerData::DomDesignerData()
-{
- m_children = 0;
-}
-
DomDesignerData::~DomDesignerData()
{
qDeleteAll(m_property);
@@ -8671,12 +5998,11 @@ DomDesignerData::~DomDesignerData()
void DomDesignerData::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("property")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) {
DomProperty *v = new DomProperty();
v->read(reader);
m_property.append(v);
@@ -8686,12 +6012,7 @@ void DomDesignerData::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8700,41 +6021,20 @@ void DomDesignerData::read(QXmlStreamReader &reader)
void DomDesignerData::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("designerdata") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("designerdata") : tagName.toLower());
- for (int i = 0; i < m_property.size(); ++i) {
- DomProperty* v = m_property[i];
+ for (DomProperty *v : m_property)
v->write(writer, QStringLiteral("property"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomDesignerData::setElementProperty(const QList<DomProperty*>& a)
+void DomDesignerData::setElementProperty(const QList<DomProperty *> &a)
{
m_children |= Property;
m_property = a;
}
-void DomSlots::clear(bool clear_all)
-{
- m_signal.clear();
- m_slot.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomSlots::DomSlots()
-{
- m_children = 0;
-}
-
DomSlots::~DomSlots()
{
m_signal.clear();
@@ -8743,16 +6043,15 @@ DomSlots::~DomSlots()
void DomSlots::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("signal")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("signal"), Qt::CaseInsensitive)) {
m_signal.append(reader.readElementText());
continue;
}
- if (tag == QLatin1String("slot")) {
+ if (!tag.compare(QLatin1String("slot"), Qt::CaseInsensitive)) {
m_slot.append(reader.readElementText());
continue;
}
@@ -8760,12 +6059,7 @@ void DomSlots::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8774,53 +6068,29 @@ void DomSlots::read(QXmlStreamReader &reader)
void DomSlots::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("slots") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("slots") : tagName.toLower());
- for (int i = 0; i < m_signal.size(); ++i) {
- QString v = m_signal[i];
+ for (const QString &v : m_signal)
writer.writeTextElement(QStringLiteral("signal"), v);
- }
- for (int i = 0; i < m_slot.size(); ++i) {
- QString v = m_slot[i];
+
+ for (const QString &v : m_slot)
writer.writeTextElement(QStringLiteral("slot"), v);
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomSlots::setElementSignal(const QStringList& a)
+void DomSlots::setElementSignal(const QStringList &a)
{
m_children |= Signal;
m_signal = a;
}
-void DomSlots::setElementSlot(const QStringList& a)
+void DomSlots::setElementSlot(const QStringList &a)
{
m_children |= Slot;
m_slot = a;
}
-void DomPropertySpecifications::clear(bool clear_all)
-{
- qDeleteAll(m_tooltip);
- m_tooltip.clear();
- qDeleteAll(m_stringpropertyspecification);
- m_stringpropertyspecification.clear();
-
- if (clear_all) {
- m_text.clear();
- }
-
- m_children = 0;
-}
-
-DomPropertySpecifications::DomPropertySpecifications()
-{
- m_children = 0;
-}
-
DomPropertySpecifications::~DomPropertySpecifications()
{
qDeleteAll(m_tooltip);
@@ -8831,18 +6101,17 @@ DomPropertySpecifications::~DomPropertySpecifications()
void DomPropertySpecifications::read(QXmlStreamReader &reader)
{
-
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
- if (tag == QLatin1String("tooltip")) {
+ const QStringRef tag = reader.name();
+ if (!tag.compare(QLatin1String("tooltip"), Qt::CaseInsensitive)) {
DomPropertyToolTip *v = new DomPropertyToolTip();
v->read(reader);
m_tooltip.append(v);
continue;
}
- if (tag == QLatin1String("stringpropertyspecification")) {
+ if (!tag.compare(QLatin1String("stringpropertyspecification"), Qt::CaseInsensitive)) {
DomStringPropertySpecification *v = new DomStringPropertySpecification();
v->read(reader);
m_stringpropertyspecification.append(v);
@@ -8852,12 +6121,7 @@ void DomPropertySpecifications::read(QXmlStreamReader &reader)
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8866,61 +6130,38 @@ void DomPropertySpecifications::read(QXmlStreamReader &reader)
void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertyspecifications") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("propertyspecifications") : tagName.toLower());
- for (int i = 0; i < m_tooltip.size(); ++i) {
- DomPropertyToolTip* v = m_tooltip[i];
+ for (DomPropertyToolTip *v : m_tooltip)
v->write(writer, QStringLiteral("tooltip"));
- }
- for (int i = 0; i < m_stringpropertyspecification.size(); ++i) {
- DomStringPropertySpecification* v = m_stringpropertyspecification[i];
+
+ for (DomStringPropertySpecification *v : m_stringpropertyspecification)
v->write(writer, QStringLiteral("stringpropertyspecification"));
- }
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
writer.writeEndElement();
}
-void DomPropertySpecifications::setElementTooltip(const QList<DomPropertyToolTip*>& a)
+void DomPropertySpecifications::setElementTooltip(const QVector<DomPropertyToolTip *> &a)
{
m_children |= Tooltip;
m_tooltip = a;
}
-void DomPropertySpecifications::setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a)
+void DomPropertySpecifications::setElementStringpropertyspecification(const QVector<DomStringPropertySpecification *> &a)
{
m_children |= Stringpropertyspecification;
m_stringpropertyspecification = a;
}
-void DomPropertyToolTip::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- }
-
- m_children = 0;
-}
-
-DomPropertyToolTip::DomPropertyToolTip()
-{
- m_children = 0;
- m_has_attr_name = false;
-}
-
DomPropertyToolTip::~DomPropertyToolTip()
{
}
void DomPropertyToolTip::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -8928,20 +6169,15 @@ void DomPropertyToolTip::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -8950,48 +6186,23 @@ void DomPropertyToolTip::read(QXmlStreamReader &reader)
void DomPropertyToolTip::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertytooltip") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("propertytooltip") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
-void DomStringPropertySpecification::clear(bool clear_all)
-{
-
- if (clear_all) {
- m_text.clear();
- m_has_attr_name = false;
- m_has_attr_type = false;
- m_has_attr_notr = false;
- }
-
- m_children = 0;
-}
-
-DomStringPropertySpecification::DomStringPropertySpecification()
-{
- m_children = 0;
- m_has_attr_name = false;
- m_has_attr_type = false;
- m_has_attr_notr = false;
-}
-
DomStringPropertySpecification::~DomStringPropertySpecification()
{
}
void DomStringPropertySpecification::read(QXmlStreamReader &reader)
{
-
- const QXmlStreamAttributes attributes = reader.attributes();
+ const QXmlStreamAttributes &attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
- QStringRef name = attribute.name();
+ const QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
@@ -9007,20 +6218,15 @@ void DomStringPropertySpecification::read(QXmlStreamReader &reader)
reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
- for (bool finished = false; !finished && !reader.hasError();) {
+ while (!reader.hasError()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
- const QString tag = reader.name().toString().toLower();
+ const QStringRef tag = reader.name();
reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
- finished = true;
- break;
- case QXmlStreamReader::Characters :
- if (!reader.isWhitespace())
- m_text.append(reader.text().toString());
- break;
+ return;
default :
break;
}
@@ -9029,7 +6235,7 @@ void DomStringPropertySpecification::read(QXmlStreamReader &reader)
void DomStringPropertySpecification::write(QXmlStreamWriter &writer, const QString &tagName) const
{
- writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("stringpropertyspecification") : tagName.toLower());
+ writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("stringpropertyspecification") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
@@ -9040,9 +6246,6 @@ void DomStringPropertySpecification::write(QXmlStreamWriter &writer, const QStri
if (hasAttributeNotr())
writer.writeAttribute(QStringLiteral("notr"), attributeNotr());
- if (!m_text.isEmpty())
- writer.writeCharacters(m_text);
-
writer.writeEndElement();
}
diff --git a/src/tools/uic/ui4.h b/src/tools/uic/ui4.h
index 820d2c5f8c..08a5ed01d5 100644
--- a/src/tools/uic/ui4.h
+++ b/src/tools/uic/ui4.h
@@ -45,6 +45,7 @@
#include <qlist.h>
#include <qstring.h>
#include <qstringlist.h>
+#include <qvector.h>
#include <qxmlstream.h>
#include <qglobal.h>
@@ -85,15 +86,9 @@ class DomAction;
class DomActionRef;
class DomButtonGroup;
class DomButtonGroups;
-class DomImages;
-class DomImage;
-class DomImageData;
class DomCustomWidgets;
class DomHeader;
class DomCustomWidget;
-class DomProperties;
-class DomPropertyData;
-class DomSizePolicyData;
class DomLayoutDefault;
class DomLayoutFunction;
class DomTabStops;
@@ -134,8 +129,6 @@ class DomConnections;
class DomConnection;
class DomConnectionHints;
class DomConnectionHint;
-class DomScript;
-class DomWidgetData;
class DomDesignerData;
class DomSlots;
class DomPropertySpecifications;
@@ -147,29 +140,28 @@ class DomStringPropertySpecification;
*/
class QDESIGNER_UILIB_EXPORT DomUI {
+ Q_DISABLE_COPY(DomUI)
public:
- DomUI();
+ DomUI() = default;
~DomUI();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeVersion() const { return m_has_attr_version; }
inline QString attributeVersion() const { return m_attr_version; }
- inline void setAttributeVersion(const QString& a) { m_attr_version = a; m_has_attr_version = true; }
+ inline void setAttributeVersion(const QString &a) { m_attr_version = a; m_has_attr_version = true; }
inline void clearAttributeVersion() { m_has_attr_version = false; }
inline bool hasAttributeLanguage() const { return m_has_attr_language; }
inline QString attributeLanguage() const { return m_attr_language; }
- inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+ inline void setAttributeLanguage(const QString &a) { m_attr_language = a; m_has_attr_language = true; }
inline void clearAttributeLanguage() { m_has_attr_language = false; }
inline bool hasAttributeDisplayname() const { return m_has_attr_displayname; }
inline QString attributeDisplayname() const { return m_attr_displayname; }
- inline void setAttributeDisplayname(const QString& a) { m_attr_displayname = a; m_has_attr_displayname = true; }
+ inline void setAttributeDisplayname(const QString &a) { m_attr_displayname = a; m_has_attr_displayname = true; }
inline void clearAttributeDisplayname() { m_has_attr_displayname = false; }
inline bool hasAttributeStdsetdef() const { return m_has_attr_stdsetdef; }
@@ -184,141 +176,132 @@ public:
// child element accessors
inline QString elementAuthor() const { return m_author; }
- void setElementAuthor(const QString& a);
+ void setElementAuthor(const QString &a);
inline bool hasElementAuthor() const { return m_children & Author; }
void clearElementAuthor();
inline QString elementComment() const { return m_comment; }
- void setElementComment(const QString& a);
+ void setElementComment(const QString &a);
inline bool hasElementComment() const { return m_children & Comment; }
void clearElementComment();
inline QString elementExportMacro() const { return m_exportMacro; }
- void setElementExportMacro(const QString& a);
+ void setElementExportMacro(const QString &a);
inline bool hasElementExportMacro() const { return m_children & ExportMacro; }
void clearElementExportMacro();
inline QString elementClass() const { return m_class; }
- void setElementClass(const QString& a);
+ void setElementClass(const QString &a);
inline bool hasElementClass() const { return m_children & Class; }
void clearElementClass();
- inline DomWidget* elementWidget() const { return m_widget; }
- DomWidget* takeElementWidget();
- void setElementWidget(DomWidget* a);
+ inline DomWidget *elementWidget() const { return m_widget; }
+ DomWidget *takeElementWidget();
+ void setElementWidget(DomWidget *a);
inline bool hasElementWidget() const { return m_children & Widget; }
void clearElementWidget();
- inline DomLayoutDefault* elementLayoutDefault() const { return m_layoutDefault; }
- DomLayoutDefault* takeElementLayoutDefault();
- void setElementLayoutDefault(DomLayoutDefault* a);
+ inline DomLayoutDefault *elementLayoutDefault() const { return m_layoutDefault; }
+ DomLayoutDefault *takeElementLayoutDefault();
+ void setElementLayoutDefault(DomLayoutDefault *a);
inline bool hasElementLayoutDefault() const { return m_children & LayoutDefault; }
void clearElementLayoutDefault();
- inline DomLayoutFunction* elementLayoutFunction() const { return m_layoutFunction; }
- DomLayoutFunction* takeElementLayoutFunction();
- void setElementLayoutFunction(DomLayoutFunction* a);
+ inline DomLayoutFunction *elementLayoutFunction() const { return m_layoutFunction; }
+ DomLayoutFunction *takeElementLayoutFunction();
+ void setElementLayoutFunction(DomLayoutFunction *a);
inline bool hasElementLayoutFunction() const { return m_children & LayoutFunction; }
void clearElementLayoutFunction();
inline QString elementPixmapFunction() const { return m_pixmapFunction; }
- void setElementPixmapFunction(const QString& a);
+ void setElementPixmapFunction(const QString &a);
inline bool hasElementPixmapFunction() const { return m_children & PixmapFunction; }
void clearElementPixmapFunction();
- inline DomCustomWidgets* elementCustomWidgets() const { return m_customWidgets; }
- DomCustomWidgets* takeElementCustomWidgets();
- void setElementCustomWidgets(DomCustomWidgets* a);
+ inline DomCustomWidgets *elementCustomWidgets() const { return m_customWidgets; }
+ DomCustomWidgets *takeElementCustomWidgets();
+ void setElementCustomWidgets(DomCustomWidgets *a);
inline bool hasElementCustomWidgets() const { return m_children & CustomWidgets; }
void clearElementCustomWidgets();
- inline DomTabStops* elementTabStops() const { return m_tabStops; }
- DomTabStops* takeElementTabStops();
- void setElementTabStops(DomTabStops* a);
+ inline DomTabStops *elementTabStops() const { return m_tabStops; }
+ DomTabStops *takeElementTabStops();
+ void setElementTabStops(DomTabStops *a);
inline bool hasElementTabStops() const { return m_children & TabStops; }
void clearElementTabStops();
- inline DomImages* elementImages() const { return m_images; }
- DomImages* takeElementImages();
- void setElementImages(DomImages* a);
- inline bool hasElementImages() const { return m_children & Images; }
- void clearElementImages();
-
- inline DomIncludes* elementIncludes() const { return m_includes; }
- DomIncludes* takeElementIncludes();
- void setElementIncludes(DomIncludes* a);
+ inline DomIncludes *elementIncludes() const { return m_includes; }
+ DomIncludes *takeElementIncludes();
+ void setElementIncludes(DomIncludes *a);
inline bool hasElementIncludes() const { return m_children & Includes; }
void clearElementIncludes();
- inline DomResources* elementResources() const { return m_resources; }
- DomResources* takeElementResources();
- void setElementResources(DomResources* a);
+ inline DomResources *elementResources() const { return m_resources; }
+ DomResources *takeElementResources();
+ void setElementResources(DomResources *a);
inline bool hasElementResources() const { return m_children & Resources; }
void clearElementResources();
- inline DomConnections* elementConnections() const { return m_connections; }
- DomConnections* takeElementConnections();
- void setElementConnections(DomConnections* a);
+ inline DomConnections *elementConnections() const { return m_connections; }
+ DomConnections *takeElementConnections();
+ void setElementConnections(DomConnections *a);
inline bool hasElementConnections() const { return m_children & Connections; }
void clearElementConnections();
- inline DomDesignerData* elementDesignerdata() const { return m_designerdata; }
- DomDesignerData* takeElementDesignerdata();
- void setElementDesignerdata(DomDesignerData* a);
+ inline DomDesignerData *elementDesignerdata() const { return m_designerdata; }
+ DomDesignerData *takeElementDesignerdata();
+ void setElementDesignerdata(DomDesignerData *a);
inline bool hasElementDesignerdata() const { return m_children & Designerdata; }
void clearElementDesignerdata();
- inline DomSlots* elementSlots() const { return m_slots; }
- DomSlots* takeElementSlots();
- void setElementSlots(DomSlots* a);
+ inline DomSlots *elementSlots() const { return m_slots; }
+ DomSlots *takeElementSlots();
+ void setElementSlots(DomSlots *a);
inline bool hasElementSlots() const { return m_children & Slots; }
void clearElementSlots();
- inline DomButtonGroups* elementButtonGroups() const { return m_buttonGroups; }
- DomButtonGroups* takeElementButtonGroups();
- void setElementButtonGroups(DomButtonGroups* a);
+ inline DomButtonGroups *elementButtonGroups() const { return m_buttonGroups; }
+ DomButtonGroups *takeElementButtonGroups();
+ void setElementButtonGroups(DomButtonGroups *a);
inline bool hasElementButtonGroups() const { return m_children & ButtonGroups; }
void clearElementButtonGroups();
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_version;
- bool m_has_attr_version;
+ bool m_has_attr_version = false;
QString m_attr_language;
- bool m_has_attr_language;
+ bool m_has_attr_language = false;
QString m_attr_displayname;
- bool m_has_attr_displayname;
+ bool m_has_attr_displayname = false;
- int m_attr_stdsetdef;
- bool m_has_attr_stdsetdef;
+ int m_attr_stdsetdef = 0;
+ bool m_has_attr_stdsetdef = false;
- int m_attr_stdSetDef;
- bool m_has_attr_stdSetDef;
+ int m_attr_stdSetDef = 0;
+ bool m_has_attr_stdSetDef = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QString m_author;
QString m_comment;
QString m_exportMacro;
QString m_class;
- DomWidget* m_widget;
- DomLayoutDefault* m_layoutDefault;
- DomLayoutFunction* m_layoutFunction;
+ DomWidget *m_widget = nullptr;
+ DomLayoutDefault *m_layoutDefault = nullptr;
+ DomLayoutFunction *m_layoutFunction = nullptr;
QString m_pixmapFunction;
- DomCustomWidgets* m_customWidgets;
- DomTabStops* m_tabStops;
- DomImages* m_images;
- DomIncludes* m_includes;
- DomResources* m_resources;
- DomConnections* m_connections;
- DomDesignerData* m_designerdata;
- DomSlots* m_slots;
- DomButtonGroups* m_buttonGroups;
+ DomCustomWidgets *m_customWidgets = nullptr;
+ DomTabStops *m_tabStops = nullptr;
+ DomIncludes *m_includes = nullptr;
+ DomResources *m_resources = nullptr;
+ DomConnections *m_connections = nullptr;
+ DomDesignerData *m_designerdata = nullptr;
+ DomSlots *m_slots = nullptr;
+ DomButtonGroups *m_buttonGroups = nullptr;
+
enum Child {
Author = 1,
Comment = 2,
@@ -330,586 +313,388 @@ private:
PixmapFunction = 128,
CustomWidgets = 256,
TabStops = 512,
- Images = 1024,
- Includes = 2048,
- Resources = 4096,
- Connections = 8192,
- Designerdata = 16384,
- Slots = 32768,
- ButtonGroups = 65536
+ Includes = 1024,
+ Resources = 2048,
+ Connections = 4096,
+ Designerdata = 8192,
+ Slots = 16384,
+ ButtonGroups = 32768
};
-
- DomUI(const DomUI &other);
- void operator = (const DomUI&other);
};
class QDESIGNER_UILIB_EXPORT DomIncludes {
+ Q_DISABLE_COPY(DomIncludes)
public:
- DomIncludes();
+ DomIncludes() = default;
~DomIncludes();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomInclude*> elementInclude() const { return m_include; }
- void setElementInclude(const QList<DomInclude*>& a);
+ inline QVector<DomInclude *> elementInclude() const { return m_include; }
+ void setElementInclude(const QVector<DomInclude *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomInclude*> m_include;
+ uint m_children = 0;
+ QVector<DomInclude *> m_include;
+
enum Child {
Include = 1
};
-
- DomIncludes(const DomIncludes &other);
- void operator = (const DomIncludes&other);
};
class QDESIGNER_UILIB_EXPORT DomInclude {
+ Q_DISABLE_COPY(DomInclude)
public:
- DomInclude();
+ DomInclude() = default;
~DomInclude();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+
inline QString text() const { return m_text; }
inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeLocation() const { return m_has_attr_location; }
inline QString attributeLocation() const { return m_attr_location; }
- inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+ inline void setAttributeLocation(const QString &a) { m_attr_location = a; m_has_attr_location = true; }
inline void clearAttributeLocation() { m_has_attr_location = false; }
inline bool hasAttributeImpldecl() const { return m_has_attr_impldecl; }
inline QString attributeImpldecl() const { return m_attr_impldecl; }
- inline void setAttributeImpldecl(const QString& a) { m_attr_impldecl = a; m_has_attr_impldecl = true; }
+ inline void setAttributeImpldecl(const QString &a) { m_attr_impldecl = a; m_has_attr_impldecl = true; }
inline void clearAttributeImpldecl() { m_has_attr_impldecl = false; }
- // child element accessors
private:
QString m_text;
- void clear(bool clear_all = true);
// attribute data
QString m_attr_location;
- bool m_has_attr_location;
+ bool m_has_attr_location = false;
QString m_attr_impldecl;
- bool m_has_attr_impldecl;
-
- // child element data
- uint m_children;
-
- DomInclude(const DomInclude &other);
- void operator = (const DomInclude&other);
+ bool m_has_attr_impldecl = false;
};
class QDESIGNER_UILIB_EXPORT DomResources {
+ Q_DISABLE_COPY(DomResources)
public:
- DomResources();
+ DomResources() = default;
~DomResources();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
// child element accessors
- inline QList<DomResource*> elementInclude() const { return m_include; }
- void setElementInclude(const QList<DomResource*>& a);
+ inline QVector<DomResource *> elementInclude() const { return m_include; }
+ void setElementInclude(const QVector<DomResource *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
// child element data
- uint m_children;
- QList<DomResource*> m_include;
+ uint m_children = 0;
+ QVector<DomResource *> m_include;
+
enum Child {
Include = 1
};
-
- DomResources(const DomResources &other);
- void operator = (const DomResources&other);
};
class QDESIGNER_UILIB_EXPORT DomResource {
+ Q_DISABLE_COPY(DomResource)
public:
- DomResource();
+ DomResource() = default;
~DomResource();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeLocation() const { return m_has_attr_location; }
inline QString attributeLocation() const { return m_attr_location; }
- inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+ inline void setAttributeLocation(const QString &a) { m_attr_location = a; m_has_attr_location = true; }
inline void clearAttributeLocation() { m_has_attr_location = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_location;
- bool m_has_attr_location;
-
- // child element data
- uint m_children;
-
- DomResource(const DomResource &other);
- void operator = (const DomResource&other);
+ bool m_has_attr_location = false;
};
class QDESIGNER_UILIB_EXPORT DomActionGroup {
+ Q_DISABLE_COPY(DomActionGroup)
public:
- DomActionGroup();
+ DomActionGroup() = default;
~DomActionGroup();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
// child element accessors
- inline QList<DomAction*> elementAction() const { return m_action; }
- void setElementAction(const QList<DomAction*>& a);
+ inline QVector<DomAction *> elementAction() const { return m_action; }
+ void setElementAction(const QVector<DomAction *> &a);
- inline QList<DomActionGroup*> elementActionGroup() const { return m_actionGroup; }
- void setElementActionGroup(const QList<DomActionGroup*>& a);
+ inline QVector<DomActionGroup *> elementActionGroup() const { return m_actionGroup; }
+ void setElementActionGroup(const QVector<DomActionGroup *> &a);
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
- void setElementAttribute(const QList<DomProperty*>& a);
+ void setElementAttribute(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
// child element data
- uint m_children;
- QList<DomAction*> m_action;
- QList<DomActionGroup*> m_actionGroup;
+ uint m_children = 0;
+ QVector<DomAction *> m_action;
+ QVector<DomActionGroup *> m_actionGroup;
QList<DomProperty*> m_property;
QList<DomProperty*> m_attribute;
+
enum Child {
Action = 1,
ActionGroup = 2,
Property = 4,
Attribute = 8
};
-
- DomActionGroup(const DomActionGroup &other);
- void operator = (const DomActionGroup&other);
};
class QDESIGNER_UILIB_EXPORT DomAction {
+ Q_DISABLE_COPY(DomAction)
public:
- DomAction();
+ DomAction() = default;
~DomAction();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
inline bool hasAttributeMenu() const { return m_has_attr_menu; }
inline QString attributeMenu() const { return m_attr_menu; }
- inline void setAttributeMenu(const QString& a) { m_attr_menu = a; m_has_attr_menu = true; }
+ inline void setAttributeMenu(const QString &a) { m_attr_menu = a; m_has_attr_menu = true; }
inline void clearAttributeMenu() { m_has_attr_menu = false; }
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
- void setElementAttribute(const QList<DomProperty*>& a);
+ void setElementAttribute(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
QString m_attr_menu;
- bool m_has_attr_menu;
+ bool m_has_attr_menu = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
QList<DomProperty*> m_attribute;
+
enum Child {
Property = 1,
Attribute = 2
};
-
- DomAction(const DomAction &other);
- void operator = (const DomAction&other);
};
class QDESIGNER_UILIB_EXPORT DomActionRef {
+ Q_DISABLE_COPY(DomActionRef)
public:
- DomActionRef();
+ DomActionRef() = default;
~DomActionRef();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
-
- // child element data
- uint m_children;
-
- DomActionRef(const DomActionRef &other);
- void operator = (const DomActionRef&other);
+ bool m_has_attr_name = false;
};
class QDESIGNER_UILIB_EXPORT DomButtonGroup {
+ Q_DISABLE_COPY(DomButtonGroup)
public:
- DomButtonGroup();
+ DomButtonGroup() = default;
~DomButtonGroup();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
- void setElementAttribute(const QList<DomProperty*>& a);
+ void setElementAttribute(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
QList<DomProperty*> m_attribute;
+
enum Child {
Property = 1,
Attribute = 2
};
-
- DomButtonGroup(const DomButtonGroup &other);
- void operator = (const DomButtonGroup&other);
};
class QDESIGNER_UILIB_EXPORT DomButtonGroups {
+ Q_DISABLE_COPY(DomButtonGroups)
public:
- DomButtonGroups();
+ DomButtonGroups() = default;
~DomButtonGroups();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- // child element accessors
- inline QList<DomButtonGroup*> elementButtonGroup() const { return m_buttonGroup; }
- void setElementButtonGroup(const QList<DomButtonGroup*>& a);
-
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- // child element data
- uint m_children;
- QList<DomButtonGroup*> m_buttonGroup;
- enum Child {
- ButtonGroup = 1
- };
-
- DomButtonGroups(const DomButtonGroups &other);
- void operator = (const DomButtonGroups&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomImages {
-public:
- DomImages();
- ~DomImages();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomImage*> elementImage() const { return m_image; }
- void setElementImage(const QList<DomImage*>& a);
+ inline QVector<DomButtonGroup *> elementButtonGroup() const { return m_buttonGroup; }
+ void setElementButtonGroup(const QVector<DomButtonGroup *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomImage*> m_image;
- enum Child {
- Image = 1
- };
-
- DomImages(const DomImages &other);
- void operator = (const DomImages&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomImage {
-public:
- DomImage();
- ~DomImage();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- inline bool hasAttributeName() const { return m_has_attr_name; }
- inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
- inline void clearAttributeName() { m_has_attr_name = false; }
-
- // child element accessors
- inline DomImageData* elementData() const { return m_data; }
- DomImageData* takeElementData();
- void setElementData(DomImageData* a);
- inline bool hasElementData() const { return m_children & Data; }
- void clearElementData();
-
-private:
- QString m_text;
- void clear(bool clear_all = true);
+ uint m_children = 0;
+ QVector<DomButtonGroup *> m_buttonGroup;
- // attribute data
- QString m_attr_name;
- bool m_has_attr_name;
-
- // child element data
- uint m_children;
- DomImageData* m_data;
enum Child {
- Data = 1
+ ButtonGroup = 1
};
-
- DomImage(const DomImage &other);
- void operator = (const DomImage&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomImageData {
-public:
- DomImageData();
- ~DomImageData();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- inline bool hasAttributeFormat() const { return m_has_attr_format; }
- inline QString attributeFormat() const { return m_attr_format; }
- inline void setAttributeFormat(const QString& a) { m_attr_format = a; m_has_attr_format = true; }
- inline void clearAttributeFormat() { m_has_attr_format = false; }
-
- inline bool hasAttributeLength() const { return m_has_attr_length; }
- inline int attributeLength() const { return m_attr_length; }
- inline void setAttributeLength(int a) { m_attr_length = a; m_has_attr_length = true; }
- inline void clearAttributeLength() { m_has_attr_length = false; }
-
- // child element accessors
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- QString m_attr_format;
- bool m_has_attr_format;
-
- int m_attr_length;
- bool m_has_attr_length;
-
- // child element data
- uint m_children;
-
- DomImageData(const DomImageData &other);
- void operator = (const DomImageData&other);
};
class QDESIGNER_UILIB_EXPORT DomCustomWidgets {
+ Q_DISABLE_COPY(DomCustomWidgets)
public:
- DomCustomWidgets();
+ DomCustomWidgets() = default;
~DomCustomWidgets();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomCustomWidget*> elementCustomWidget() const { return m_customWidget; }
- void setElementCustomWidget(const QList<DomCustomWidget*>& a);
+ inline QVector<DomCustomWidget *> elementCustomWidget() const { return m_customWidget; }
+ void setElementCustomWidget(const QVector<DomCustomWidget *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomCustomWidget*> m_customWidget;
+ uint m_children = 0;
+ QVector<DomCustomWidget *> m_customWidget;
+
enum Child {
CustomWidget = 1
};
-
- DomCustomWidgets(const DomCustomWidgets &other);
- void operator = (const DomCustomWidgets&other);
};
class QDESIGNER_UILIB_EXPORT DomHeader {
+ Q_DISABLE_COPY(DomHeader)
public:
- DomHeader();
+ DomHeader() = default;
~DomHeader();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+
inline QString text() const { return m_text; }
inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeLocation() const { return m_has_attr_location; }
inline QString attributeLocation() const { return m_attr_location; }
- inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+ inline void setAttributeLocation(const QString &a) { m_attr_location = a; m_has_attr_location = true; }
inline void clearAttributeLocation() { m_has_attr_location = false; }
- // child element accessors
private:
QString m_text;
- void clear(bool clear_all = true);
// attribute data
QString m_attr_location;
- bool m_has_attr_location;
-
- // child element data
- uint m_children;
-
- DomHeader(const DomHeader &other);
- void operator = (const DomHeader&other);
+ bool m_has_attr_location = false;
};
class QDESIGNER_UILIB_EXPORT DomCustomWidget {
+ Q_DISABLE_COPY(DomCustomWidget)
public:
- DomCustomWidget();
+ DomCustomWidget() = default;
~DomCustomWidget();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QString elementClass() const { return m_class; }
- void setElementClass(const QString& a);
+ void setElementClass(const QString &a);
inline bool hasElementClass() const { return m_children & Class; }
void clearElementClass();
inline QString elementExtends() const { return m_extends; }
- void setElementExtends(const QString& a);
+ void setElementExtends(const QString &a);
inline bool hasElementExtends() const { return m_children & Extends; }
void clearElementExtends();
- inline DomHeader* elementHeader() const { return m_header; }
- DomHeader* takeElementHeader();
- void setElementHeader(DomHeader* a);
+ inline DomHeader *elementHeader() const { return m_header; }
+ DomHeader *takeElementHeader();
+ void setElementHeader(DomHeader *a);
inline bool hasElementHeader() const { return m_children & Header; }
void clearElementHeader();
- inline DomSize* elementSizeHint() const { return m_sizeHint; }
- DomSize* takeElementSizeHint();
- void setElementSizeHint(DomSize* a);
+ inline DomSize *elementSizeHint() const { return m_sizeHint; }
+ DomSize *takeElementSizeHint();
+ void setElementSizeHint(DomSize *a);
inline bool hasElementSizeHint() const { return m_children & SizeHint; }
void clearElementSizeHint();
inline QString elementAddPageMethod() const { return m_addPageMethod; }
- void setElementAddPageMethod(const QString& a);
+ void setElementAddPageMethod(const QString &a);
inline bool hasElementAddPageMethod() const { return m_children & AddPageMethod; }
void clearElementAddPageMethod();
@@ -918,60 +703,37 @@ public:
inline bool hasElementContainer() const { return m_children & Container; }
void clearElementContainer();
- inline DomSizePolicyData* elementSizePolicy() const { return m_sizePolicy; }
- DomSizePolicyData* takeElementSizePolicy();
- void setElementSizePolicy(DomSizePolicyData* a);
- inline bool hasElementSizePolicy() const { return m_children & SizePolicy; }
- void clearElementSizePolicy();
-
inline QString elementPixmap() const { return m_pixmap; }
- void setElementPixmap(const QString& a);
+ void setElementPixmap(const QString &a);
inline bool hasElementPixmap() const { return m_children & Pixmap; }
void clearElementPixmap();
- inline DomScript* elementScript() const { return m_script; }
- DomScript* takeElementScript();
- void setElementScript(DomScript* a);
- inline bool hasElementScript() const { return m_children & Script; }
- void clearElementScript();
-
- inline DomProperties* elementProperties() const { return m_properties; }
- DomProperties* takeElementProperties();
- void setElementProperties(DomProperties* a);
- inline bool hasElementProperties() const { return m_children & Properties; }
- void clearElementProperties();
-
- inline DomSlots* elementSlots() const { return m_slots; }
- DomSlots* takeElementSlots();
- void setElementSlots(DomSlots* a);
+ inline DomSlots *elementSlots() const { return m_slots; }
+ DomSlots *takeElementSlots();
+ void setElementSlots(DomSlots *a);
inline bool hasElementSlots() const { return m_children & Slots; }
void clearElementSlots();
- inline DomPropertySpecifications* elementPropertyspecifications() const { return m_propertyspecifications; }
- DomPropertySpecifications* takeElementPropertyspecifications();
- void setElementPropertyspecifications(DomPropertySpecifications* a);
+ inline DomPropertySpecifications *elementPropertyspecifications() const { return m_propertyspecifications; }
+ DomPropertySpecifications *takeElementPropertyspecifications();
+ void setElementPropertyspecifications(DomPropertySpecifications *a);
inline bool hasElementPropertyspecifications() const { return m_children & Propertyspecifications; }
void clearElementPropertyspecifications();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QString m_class;
QString m_extends;
- DomHeader* m_header;
- DomSize* m_sizeHint;
+ DomHeader *m_header = nullptr;
+ DomSize *m_sizeHint = nullptr;
QString m_addPageMethod;
- int m_container;
- DomSizePolicyData* m_sizePolicy;
+ int m_container = 0;
QString m_pixmap;
- DomScript* m_script;
- DomProperties* m_properties;
- DomSlots* m_slots;
- DomPropertySpecifications* m_propertyspecifications;
+ DomSlots *m_slots = nullptr;
+ DomPropertySpecifications *m_propertyspecifications = nullptr;
+
enum Child {
Class = 1,
Extends = 2,
@@ -979,130 +741,20 @@ private:
SizeHint = 8,
AddPageMethod = 16,
Container = 32,
- SizePolicy = 64,
- Pixmap = 128,
- Script = 256,
- Properties = 512,
- Slots = 1024,
- Propertyspecifications = 2048
- };
-
- DomCustomWidget(const DomCustomWidget &other);
- void operator = (const DomCustomWidget&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomProperties {
-public:
- DomProperties();
- ~DomProperties();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- // child element accessors
- inline QList<DomPropertyData*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomPropertyData*>& a);
-
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- // child element data
- uint m_children;
- QList<DomPropertyData*> m_property;
- enum Child {
- Property = 1
- };
-
- DomProperties(const DomProperties &other);
- void operator = (const DomProperties&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomPropertyData {
-public:
- DomPropertyData();
- ~DomPropertyData();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- inline bool hasAttributeType() const { return m_has_attr_type; }
- inline QString attributeType() const { return m_attr_type; }
- inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
- inline void clearAttributeType() { m_has_attr_type = false; }
-
- // child element accessors
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- QString m_attr_type;
- bool m_has_attr_type;
-
- // child element data
- uint m_children;
-
- DomPropertyData(const DomPropertyData &other);
- void operator = (const DomPropertyData&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomSizePolicyData {
-public:
- DomSizePolicyData();
- ~DomSizePolicyData();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- // child element accessors
- inline int elementHorData() const { return m_horData; }
- void setElementHorData(int a);
- inline bool hasElementHorData() const { return m_children & HorData; }
- void clearElementHorData();
-
- inline int elementVerData() const { return m_verData; }
- void setElementVerData(int a);
- inline bool hasElementVerData() const { return m_children & VerData; }
- void clearElementVerData();
-
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- // child element data
- uint m_children;
- int m_horData;
- int m_verData;
- enum Child {
- HorData = 1,
- VerData = 2
+ Pixmap = 64,
+ Slots = 128,
+ Propertyspecifications = 256
};
-
- DomSizePolicyData(const DomSizePolicyData &other);
- void operator = (const DomSizePolicyData&other);
};
class QDESIGNER_UILIB_EXPORT DomLayoutDefault {
+ Q_DISABLE_COPY(DomLayoutDefault)
public:
- DomLayoutDefault();
+ DomLayoutDefault() = default;
~DomLayoutDefault();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeSpacing() const { return m_has_attr_spacing; }
@@ -1115,202 +767,167 @@ public:
inline void setAttributeMargin(int a) { m_attr_margin = a; m_has_attr_margin = true; }
inline void clearAttributeMargin() { m_has_attr_margin = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
- int m_attr_spacing;
- bool m_has_attr_spacing;
-
- int m_attr_margin;
- bool m_has_attr_margin;
+ int m_attr_spacing = 0;
+ bool m_has_attr_spacing = false;
- // child element data
- uint m_children;
-
- DomLayoutDefault(const DomLayoutDefault &other);
- void operator = (const DomLayoutDefault&other);
+ int m_attr_margin = 0;
+ bool m_has_attr_margin = false;
};
class QDESIGNER_UILIB_EXPORT DomLayoutFunction {
+ Q_DISABLE_COPY(DomLayoutFunction)
public:
- DomLayoutFunction();
+ DomLayoutFunction() = default;
~DomLayoutFunction();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeSpacing() const { return m_has_attr_spacing; }
inline QString attributeSpacing() const { return m_attr_spacing; }
- inline void setAttributeSpacing(const QString& a) { m_attr_spacing = a; m_has_attr_spacing = true; }
+ inline void setAttributeSpacing(const QString &a) { m_attr_spacing = a; m_has_attr_spacing = true; }
inline void clearAttributeSpacing() { m_has_attr_spacing = false; }
inline bool hasAttributeMargin() const { return m_has_attr_margin; }
inline QString attributeMargin() const { return m_attr_margin; }
- inline void setAttributeMargin(const QString& a) { m_attr_margin = a; m_has_attr_margin = true; }
+ inline void setAttributeMargin(const QString &a) { m_attr_margin = a; m_has_attr_margin = true; }
inline void clearAttributeMargin() { m_has_attr_margin = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_spacing;
- bool m_has_attr_spacing;
+ bool m_has_attr_spacing = false;
QString m_attr_margin;
- bool m_has_attr_margin;
-
- // child element data
- uint m_children;
-
- DomLayoutFunction(const DomLayoutFunction &other);
- void operator = (const DomLayoutFunction&other);
+ bool m_has_attr_margin = false;
};
class QDESIGNER_UILIB_EXPORT DomTabStops {
+ Q_DISABLE_COPY(DomTabStops)
public:
- DomTabStops();
+ DomTabStops() = default;
~DomTabStops();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QStringList elementTabStop() const { return m_tabStop; }
- void setElementTabStop(const QStringList& a);
+ void setElementTabStop(const QStringList &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QStringList m_tabStop;
+
enum Child {
TabStop = 1
};
-
- DomTabStops(const DomTabStops &other);
- void operator = (const DomTabStops&other);
};
class QDESIGNER_UILIB_EXPORT DomLayout {
+ Q_DISABLE_COPY(DomLayout)
public:
- DomLayout();
+ DomLayout() = default;
~DomLayout();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeClass() const { return m_has_attr_class; }
inline QString attributeClass() const { return m_attr_class; }
- inline void setAttributeClass(const QString& a) { m_attr_class = a; m_has_attr_class = true; }
+ inline void setAttributeClass(const QString &a) { m_attr_class = a; m_has_attr_class = true; }
inline void clearAttributeClass() { m_has_attr_class = false; }
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
inline bool hasAttributeStretch() const { return m_has_attr_stretch; }
inline QString attributeStretch() const { return m_attr_stretch; }
- inline void setAttributeStretch(const QString& a) { m_attr_stretch = a; m_has_attr_stretch = true; }
+ inline void setAttributeStretch(const QString &a) { m_attr_stretch = a; m_has_attr_stretch = true; }
inline void clearAttributeStretch() { m_has_attr_stretch = false; }
inline bool hasAttributeRowStretch() const { return m_has_attr_rowStretch; }
inline QString attributeRowStretch() const { return m_attr_rowStretch; }
- inline void setAttributeRowStretch(const QString& a) { m_attr_rowStretch = a; m_has_attr_rowStretch = true; }
+ inline void setAttributeRowStretch(const QString &a) { m_attr_rowStretch = a; m_has_attr_rowStretch = true; }
inline void clearAttributeRowStretch() { m_has_attr_rowStretch = false; }
inline bool hasAttributeColumnStretch() const { return m_has_attr_columnStretch; }
inline QString attributeColumnStretch() const { return m_attr_columnStretch; }
- inline void setAttributeColumnStretch(const QString& a) { m_attr_columnStretch = a; m_has_attr_columnStretch = true; }
+ inline void setAttributeColumnStretch(const QString &a) { m_attr_columnStretch = a; m_has_attr_columnStretch = true; }
inline void clearAttributeColumnStretch() { m_has_attr_columnStretch = false; }
inline bool hasAttributeRowMinimumHeight() const { return m_has_attr_rowMinimumHeight; }
inline QString attributeRowMinimumHeight() const { return m_attr_rowMinimumHeight; }
- inline void setAttributeRowMinimumHeight(const QString& a) { m_attr_rowMinimumHeight = a; m_has_attr_rowMinimumHeight = true; }
+ inline void setAttributeRowMinimumHeight(const QString &a) { m_attr_rowMinimumHeight = a; m_has_attr_rowMinimumHeight = true; }
inline void clearAttributeRowMinimumHeight() { m_has_attr_rowMinimumHeight = false; }
inline bool hasAttributeColumnMinimumWidth() const { return m_has_attr_columnMinimumWidth; }
inline QString attributeColumnMinimumWidth() const { return m_attr_columnMinimumWidth; }
- inline void setAttributeColumnMinimumWidth(const QString& a) { m_attr_columnMinimumWidth = a; m_has_attr_columnMinimumWidth = true; }
+ inline void setAttributeColumnMinimumWidth(const QString &a) { m_attr_columnMinimumWidth = a; m_has_attr_columnMinimumWidth = true; }
inline void clearAttributeColumnMinimumWidth() { m_has_attr_columnMinimumWidth = false; }
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
- void setElementAttribute(const QList<DomProperty*>& a);
+ void setElementAttribute(const QList<DomProperty *> &a);
- inline QList<DomLayoutItem*> elementItem() const { return m_item; }
- void setElementItem(const QList<DomLayoutItem*>& a);
+ inline QVector<DomLayoutItem *> elementItem() const { return m_item; }
+ void setElementItem(const QVector<DomLayoutItem *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_class;
- bool m_has_attr_class;
+ bool m_has_attr_class = false;
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
QString m_attr_stretch;
- bool m_has_attr_stretch;
+ bool m_has_attr_stretch = false;
QString m_attr_rowStretch;
- bool m_has_attr_rowStretch;
+ bool m_has_attr_rowStretch = false;
QString m_attr_columnStretch;
- bool m_has_attr_columnStretch;
+ bool m_has_attr_columnStretch = false;
QString m_attr_rowMinimumHeight;
- bool m_has_attr_rowMinimumHeight;
+ bool m_has_attr_rowMinimumHeight = false;
QString m_attr_columnMinimumWidth;
- bool m_has_attr_columnMinimumWidth;
+ bool m_has_attr_columnMinimumWidth = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
QList<DomProperty*> m_attribute;
- QList<DomLayoutItem*> m_item;
+ QVector<DomLayoutItem *> m_item;
+
enum Child {
Property = 1,
Attribute = 2,
Item = 4
};
-
- DomLayout(const DomLayout &other);
- void operator = (const DomLayout&other);
};
class QDESIGNER_UILIB_EXPORT DomLayoutItem {
+ Q_DISABLE_COPY(DomLayoutItem)
public:
- DomLayoutItem();
+ DomLayoutItem() = default;
~DomLayoutItem();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeRow() const { return m_has_attr_row; }
@@ -1335,126 +952,107 @@ public:
inline bool hasAttributeAlignment() const { return m_has_attr_alignment; }
inline QString attributeAlignment() const { return m_attr_alignment; }
- inline void setAttributeAlignment(const QString& a) { m_attr_alignment = a; m_has_attr_alignment = true; }
+ inline void setAttributeAlignment(const QString &a) { m_attr_alignment = a; m_has_attr_alignment = true; }
inline void clearAttributeAlignment() { m_has_attr_alignment = false; }
// child element accessors
enum Kind { Unknown = 0, Widget, Layout, Spacer };
inline Kind kind() const { return m_kind; }
- inline DomWidget* elementWidget() const { return m_widget; }
- DomWidget* takeElementWidget();
- void setElementWidget(DomWidget* a);
+ inline DomWidget *elementWidget() const { return m_widget; }
+ DomWidget *takeElementWidget();
+ void setElementWidget(DomWidget *a);
- inline DomLayout* elementLayout() const { return m_layout; }
- DomLayout* takeElementLayout();
- void setElementLayout(DomLayout* a);
+ inline DomLayout *elementLayout() const { return m_layout; }
+ DomLayout *takeElementLayout();
+ void setElementLayout(DomLayout *a);
- inline DomSpacer* elementSpacer() const { return m_spacer; }
- DomSpacer* takeElementSpacer();
- void setElementSpacer(DomSpacer* a);
+ inline DomSpacer *elementSpacer() const { return m_spacer; }
+ DomSpacer *takeElementSpacer();
+ void setElementSpacer(DomSpacer *a);
private:
- QString m_text;
- void clear(bool clear_all = true);
+ void clear();
// attribute data
- int m_attr_row;
- bool m_has_attr_row;
+ int m_attr_row = 0;
+ bool m_has_attr_row = false;
- int m_attr_column;
- bool m_has_attr_column;
+ int m_attr_column = 0;
+ bool m_has_attr_column = false;
- int m_attr_rowSpan;
- bool m_has_attr_rowSpan;
+ int m_attr_rowSpan = 0;
+ bool m_has_attr_rowSpan = false;
- int m_attr_colSpan;
- bool m_has_attr_colSpan;
+ int m_attr_colSpan = 0;
+ bool m_has_attr_colSpan = false;
QString m_attr_alignment;
- bool m_has_attr_alignment;
+ bool m_has_attr_alignment = false;
// child element data
- Kind m_kind;
- DomWidget* m_widget;
- DomLayout* m_layout;
- DomSpacer* m_spacer;
-
- DomLayoutItem(const DomLayoutItem &other);
- void operator = (const DomLayoutItem&other);
+ Kind m_kind = Unknown;
+ DomWidget *m_widget = nullptr;
+ DomLayout *m_layout = nullptr;
+ DomSpacer *m_spacer = nullptr;
};
class QDESIGNER_UILIB_EXPORT DomRow {
+ Q_DISABLE_COPY(DomRow)
public:
- DomRow();
+ DomRow() = default;
~DomRow();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
+
enum Child {
Property = 1
};
-
- DomRow(const DomRow &other);
- void operator = (const DomRow&other);
};
class QDESIGNER_UILIB_EXPORT DomColumn {
+ Q_DISABLE_COPY(DomColumn)
public:
- DomColumn();
+ DomColumn() = default;
~DomColumn();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
+
enum Child {
Property = 1
};
-
- DomColumn(const DomColumn &other);
- void operator = (const DomColumn&other);
};
class QDESIGNER_UILIB_EXPORT DomItem {
+ Q_DISABLE_COPY(DomItem)
public:
- DomItem();
+ DomItem() = default;
~DomItem();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeRow() const { return m_has_attr_row; }
@@ -1469,54 +1067,48 @@ public:
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
- inline QList<DomItem*> elementItem() const { return m_item; }
- void setElementItem(const QList<DomItem*>& a);
+ inline QVector<DomItem *> elementItem() const { return m_item; }
+ void setElementItem(const QVector<DomItem *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
- int m_attr_row;
- bool m_has_attr_row;
+ int m_attr_row = 0;
+ bool m_has_attr_row = false;
- int m_attr_column;
- bool m_has_attr_column;
+ int m_attr_column = 0;
+ bool m_has_attr_column = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
- QList<DomItem*> m_item;
+ QVector<DomItem *> m_item;
+
enum Child {
Property = 1,
Item = 2
};
-
- DomItem(const DomItem &other);
- void operator = (const DomItem&other);
};
class QDESIGNER_UILIB_EXPORT DomWidget {
+ Q_DISABLE_COPY(DomWidget)
public:
- DomWidget();
+ DomWidget() = default;
~DomWidget();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeClass() const { return m_has_attr_class; }
inline QString attributeClass() const { return m_attr_class; }
- inline void setAttributeClass(const QString& a) { m_attr_class = a; m_has_attr_class = true; }
+ inline void setAttributeClass(const QString &a) { m_attr_class = a; m_has_attr_class = true; }
inline void clearAttributeClass() { m_has_attr_class = false; }
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
inline bool hasAttributeNative() const { return m_has_attr_native; }
@@ -1526,146 +1118,124 @@ public:
// child element accessors
inline QStringList elementClass() const { return m_class; }
- void setElementClass(const QStringList& a);
+ void setElementClass(const QStringList &a);
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
-
- inline QList<DomScript*> elementScript() const { return m_script; }
- void setElementScript(const QList<DomScript*>& a);
-
- inline QList<DomWidgetData*> elementWidgetData() const { return m_widgetData; }
- void setElementWidgetData(const QList<DomWidgetData*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
- void setElementAttribute(const QList<DomProperty*>& a);
+ void setElementAttribute(const QList<DomProperty *> &a);
- inline QList<DomRow*> elementRow() const { return m_row; }
- void setElementRow(const QList<DomRow*>& a);
+ inline QVector<DomRow *> elementRow() const { return m_row; }
+ void setElementRow(const QVector<DomRow *> &a);
- inline QList<DomColumn*> elementColumn() const { return m_column; }
- void setElementColumn(const QList<DomColumn*>& a);
+ inline QVector<DomColumn *> elementColumn() const { return m_column; }
+ void setElementColumn(const QVector<DomColumn *> &a);
- inline QList<DomItem*> elementItem() const { return m_item; }
- void setElementItem(const QList<DomItem*>& a);
+ inline QVector<DomItem *> elementItem() const { return m_item; }
+ void setElementItem(const QVector<DomItem *> &a);
- inline QList<DomLayout*> elementLayout() const { return m_layout; }
- void setElementLayout(const QList<DomLayout*>& a);
+ inline QVector<DomLayout *> elementLayout() const { return m_layout; }
+ void setElementLayout(const QVector<DomLayout *> &a);
- inline QList<DomWidget*> elementWidget() const { return m_widget; }
- void setElementWidget(const QList<DomWidget*>& a);
+ inline QVector<DomWidget *> elementWidget() const { return m_widget; }
+ void setElementWidget(const QVector<DomWidget *> &a);
- inline QList<DomAction*> elementAction() const { return m_action; }
- void setElementAction(const QList<DomAction*>& a);
+ inline QVector<DomAction *> elementAction() const { return m_action; }
+ void setElementAction(const QVector<DomAction *> &a);
- inline QList<DomActionGroup*> elementActionGroup() const { return m_actionGroup; }
- void setElementActionGroup(const QList<DomActionGroup*>& a);
+ inline QVector<DomActionGroup *> elementActionGroup() const { return m_actionGroup; }
+ void setElementActionGroup(const QVector<DomActionGroup *> &a);
- inline QList<DomActionRef*> elementAddAction() const { return m_addAction; }
- void setElementAddAction(const QList<DomActionRef*>& a);
+ inline QVector<DomActionRef *> elementAddAction() const { return m_addAction; }
+ void setElementAddAction(const QVector<DomActionRef *> &a);
inline QStringList elementZOrder() const { return m_zOrder; }
- void setElementZOrder(const QStringList& a);
+ void setElementZOrder(const QStringList &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_class;
- bool m_has_attr_class;
+ bool m_has_attr_class = false;
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
- bool m_attr_native;
- bool m_has_attr_native;
+ bool m_attr_native = false;
+ bool m_has_attr_native = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QStringList m_class;
QList<DomProperty*> m_property;
- QList<DomScript*> m_script;
- QList<DomWidgetData*> m_widgetData;
QList<DomProperty*> m_attribute;
- QList<DomRow*> m_row;
- QList<DomColumn*> m_column;
- QList<DomItem*> m_item;
- QList<DomLayout*> m_layout;
- QList<DomWidget*> m_widget;
- QList<DomAction*> m_action;
- QList<DomActionGroup*> m_actionGroup;
- QList<DomActionRef*> m_addAction;
+ QVector<DomRow *> m_row;
+ QVector<DomColumn *> m_column;
+ QVector<DomItem *> m_item;
+ QVector<DomLayout *> m_layout;
+ QVector<DomWidget *> m_widget;
+ QVector<DomAction *> m_action;
+ QVector<DomActionGroup *> m_actionGroup;
+ QVector<DomActionRef *> m_addAction;
QStringList m_zOrder;
+
enum Child {
Class = 1,
Property = 2,
- Script = 4,
- WidgetData = 8,
- Attribute = 16,
- Row = 32,
- Column = 64,
- Item = 128,
- Layout = 256,
- Widget = 512,
- Action = 1024,
- ActionGroup = 2048,
- AddAction = 4096,
- ZOrder = 8192
+ Attribute = 4,
+ Row = 8,
+ Column = 16,
+ Item = 32,
+ Layout = 64,
+ Widget = 128,
+ Action = 256,
+ ActionGroup = 512,
+ AddAction = 1024,
+ ZOrder = 2048
};
-
- DomWidget(const DomWidget &other);
- void operator = (const DomWidget&other);
};
class QDESIGNER_UILIB_EXPORT DomSpacer {
+ Q_DISABLE_COPY(DomSpacer)
public:
- DomSpacer();
+ DomSpacer() = default;
~DomSpacer();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
+
enum Child {
Property = 1
};
-
- DomSpacer(const DomSpacer &other);
- void operator = (const DomSpacer&other);
};
class QDESIGNER_UILIB_EXPORT DomColor {
+ Q_DISABLE_COPY(DomColor)
public:
- DomColor();
+ DomColor() = default;
~DomColor();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeAlpha() const { return m_has_attr_alpha; }
@@ -1690,37 +1260,31 @@ public:
void clearElementBlue();
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
- int m_attr_alpha;
- bool m_has_attr_alpha;
+ int m_attr_alpha = 0;
+ bool m_has_attr_alpha = false;
// child element data
- uint m_children;
- int m_red;
- int m_green;
- int m_blue;
+ uint m_children = 0;
+ int m_red = 0;
+ int m_green = 0;
+ int m_blue = 0;
+
enum Child {
Red = 1,
Green = 2,
Blue = 4
};
-
- DomColor(const DomColor &other);
- void operator = (const DomColor&other);
};
class QDESIGNER_UILIB_EXPORT DomGradientStop {
+ Q_DISABLE_COPY(DomGradientStop)
public:
- DomGradientStop();
+ DomGradientStop() = default;
~DomGradientStop();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributePosition() const { return m_has_attr_position; }
@@ -1729,40 +1293,34 @@ public:
inline void clearAttributePosition() { m_has_attr_position = false; }
// child element accessors
- inline DomColor* elementColor() const { return m_color; }
- DomColor* takeElementColor();
- void setElementColor(DomColor* a);
+ inline DomColor *elementColor() const { return m_color; }
+ DomColor *takeElementColor();
+ void setElementColor(DomColor *a);
inline bool hasElementColor() const { return m_children & Color; }
void clearElementColor();
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
- double m_attr_position;
- bool m_has_attr_position;
+ double m_attr_position = 0.0;
+ bool m_has_attr_position = false;
// child element data
- uint m_children;
- DomColor* m_color;
+ uint m_children = 0;
+ DomColor *m_color = nullptr;
+
enum Child {
Color = 1
};
-
- DomGradientStop(const DomGradientStop &other);
- void operator = (const DomGradientStop&other);
};
class QDESIGNER_UILIB_EXPORT DomGradient {
+ Q_DISABLE_COPY(DomGradient)
public:
- DomGradient();
+ DomGradient() = default;
~DomGradient();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeStartX() const { return m_has_attr_startX; }
@@ -1817,270 +1375,238 @@ public:
inline bool hasAttributeType() const { return m_has_attr_type; }
inline QString attributeType() const { return m_attr_type; }
- inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void setAttributeType(const QString &a) { m_attr_type = a; m_has_attr_type = true; }
inline void clearAttributeType() { m_has_attr_type = false; }
inline bool hasAttributeSpread() const { return m_has_attr_spread; }
inline QString attributeSpread() const { return m_attr_spread; }
- inline void setAttributeSpread(const QString& a) { m_attr_spread = a; m_has_attr_spread = true; }
+ inline void setAttributeSpread(const QString &a) { m_attr_spread = a; m_has_attr_spread = true; }
inline void clearAttributeSpread() { m_has_attr_spread = false; }
inline bool hasAttributeCoordinateMode() const { return m_has_attr_coordinateMode; }
inline QString attributeCoordinateMode() const { return m_attr_coordinateMode; }
- inline void setAttributeCoordinateMode(const QString& a) { m_attr_coordinateMode = a; m_has_attr_coordinateMode = true; }
+ inline void setAttributeCoordinateMode(const QString &a) { m_attr_coordinateMode = a; m_has_attr_coordinateMode = true; }
inline void clearAttributeCoordinateMode() { m_has_attr_coordinateMode = false; }
// child element accessors
- inline QList<DomGradientStop*> elementGradientStop() const { return m_gradientStop; }
- void setElementGradientStop(const QList<DomGradientStop*>& a);
+ inline QVector<DomGradientStop *> elementGradientStop() const { return m_gradientStop; }
+ void setElementGradientStop(const QVector<DomGradientStop *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
- double m_attr_startX;
- bool m_has_attr_startX;
+ double m_attr_startX = 0.0;
+ bool m_has_attr_startX = false;
- double m_attr_startY;
- bool m_has_attr_startY;
+ double m_attr_startY = 0.0;
+ bool m_has_attr_startY = false;
- double m_attr_endX;
- bool m_has_attr_endX;
+ double m_attr_endX = 0.0;
+ bool m_has_attr_endX = false;
- double m_attr_endY;
- bool m_has_attr_endY;
+ double m_attr_endY = 0.0;
+ bool m_has_attr_endY = false;
- double m_attr_centralX;
- bool m_has_attr_centralX;
+ double m_attr_centralX = 0.0;
+ bool m_has_attr_centralX = false;
- double m_attr_centralY;
- bool m_has_attr_centralY;
+ double m_attr_centralY = 0.0;
+ bool m_has_attr_centralY = false;
- double m_attr_focalX;
- bool m_has_attr_focalX;
+ double m_attr_focalX = 0.0;
+ bool m_has_attr_focalX = false;
- double m_attr_focalY;
- bool m_has_attr_focalY;
+ double m_attr_focalY = 0.0;
+ bool m_has_attr_focalY = false;
- double m_attr_radius;
- bool m_has_attr_radius;
+ double m_attr_radius = 0.0;
+ bool m_has_attr_radius = false;
- double m_attr_angle;
- bool m_has_attr_angle;
+ double m_attr_angle = 0.0;
+ bool m_has_attr_angle = false;
QString m_attr_type;
- bool m_has_attr_type;
+ bool m_has_attr_type = false;
QString m_attr_spread;
- bool m_has_attr_spread;
+ bool m_has_attr_spread = false;
QString m_attr_coordinateMode;
- bool m_has_attr_coordinateMode;
+ bool m_has_attr_coordinateMode = false;
// child element data
- uint m_children;
- QList<DomGradientStop*> m_gradientStop;
+ uint m_children = 0;
+ QVector<DomGradientStop *> m_gradientStop;
+
enum Child {
GradientStop = 1
};
-
- DomGradient(const DomGradient &other);
- void operator = (const DomGradient&other);
};
class QDESIGNER_UILIB_EXPORT DomBrush {
+ Q_DISABLE_COPY(DomBrush)
public:
- DomBrush();
+ DomBrush() = default;
~DomBrush();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeBrushStyle() const { return m_has_attr_brushStyle; }
inline QString attributeBrushStyle() const { return m_attr_brushStyle; }
- inline void setAttributeBrushStyle(const QString& a) { m_attr_brushStyle = a; m_has_attr_brushStyle = true; }
+ inline void setAttributeBrushStyle(const QString &a) { m_attr_brushStyle = a; m_has_attr_brushStyle = true; }
inline void clearAttributeBrushStyle() { m_has_attr_brushStyle = false; }
// child element accessors
enum Kind { Unknown = 0, Color, Texture, Gradient };
inline Kind kind() const { return m_kind; }
- inline DomColor* elementColor() const { return m_color; }
- DomColor* takeElementColor();
- void setElementColor(DomColor* a);
+ inline DomColor *elementColor() const { return m_color; }
+ DomColor *takeElementColor();
+ void setElementColor(DomColor *a);
- inline DomProperty* elementTexture() const { return m_texture; }
- DomProperty* takeElementTexture();
- void setElementTexture(DomProperty* a);
+ inline DomProperty *elementTexture() const { return m_texture; }
+ DomProperty *takeElementTexture();
+ void setElementTexture(DomProperty *a);
- inline DomGradient* elementGradient() const { return m_gradient; }
- DomGradient* takeElementGradient();
- void setElementGradient(DomGradient* a);
+ inline DomGradient *elementGradient() const { return m_gradient; }
+ DomGradient *takeElementGradient();
+ void setElementGradient(DomGradient *a);
private:
- QString m_text;
- void clear(bool clear_all = true);
+ void clear();
// attribute data
QString m_attr_brushStyle;
- bool m_has_attr_brushStyle;
+ bool m_has_attr_brushStyle = false;
// child element data
- Kind m_kind;
- DomColor* m_color;
- DomProperty* m_texture;
- DomGradient* m_gradient;
-
- DomBrush(const DomBrush &other);
- void operator = (const DomBrush&other);
+ Kind m_kind = Unknown;
+ DomColor *m_color = nullptr;
+ DomProperty *m_texture = nullptr;
+ DomGradient *m_gradient = nullptr;
};
class QDESIGNER_UILIB_EXPORT DomColorRole {
+ Q_DISABLE_COPY(DomColorRole)
public:
- DomColorRole();
+ DomColorRole() = default;
~DomColorRole();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeRole() const { return m_has_attr_role; }
inline QString attributeRole() const { return m_attr_role; }
- inline void setAttributeRole(const QString& a) { m_attr_role = a; m_has_attr_role = true; }
+ inline void setAttributeRole(const QString &a) { m_attr_role = a; m_has_attr_role = true; }
inline void clearAttributeRole() { m_has_attr_role = false; }
// child element accessors
- inline DomBrush* elementBrush() const { return m_brush; }
- DomBrush* takeElementBrush();
- void setElementBrush(DomBrush* a);
+ inline DomBrush *elementBrush() const { return m_brush; }
+ DomBrush *takeElementBrush();
+ void setElementBrush(DomBrush *a);
inline bool hasElementBrush() const { return m_children & Brush; }
void clearElementBrush();
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_role;
- bool m_has_attr_role;
+ bool m_has_attr_role = false;
// child element data
- uint m_children;
- DomBrush* m_brush;
+ uint m_children = 0;
+ DomBrush *m_brush = nullptr;
+
enum Child {
Brush = 1
};
-
- DomColorRole(const DomColorRole &other);
- void operator = (const DomColorRole&other);
};
class QDESIGNER_UILIB_EXPORT DomColorGroup {
+ Q_DISABLE_COPY(DomColorGroup)
public:
- DomColorGroup();
+ DomColorGroup() = default;
~DomColorGroup();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomColorRole*> elementColorRole() const { return m_colorRole; }
- void setElementColorRole(const QList<DomColorRole*>& a);
+ inline QVector<DomColorRole *> elementColorRole() const { return m_colorRole; }
+ void setElementColorRole(const QVector<DomColorRole *> &a);
- inline QList<DomColor*> elementColor() const { return m_color; }
- void setElementColor(const QList<DomColor*>& a);
+ inline QVector<DomColor *> elementColor() const { return m_color; }
+ void setElementColor(const QVector<DomColor *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomColorRole*> m_colorRole;
- QList<DomColor*> m_color;
+ uint m_children = 0;
+ QVector<DomColorRole *> m_colorRole;
+ QVector<DomColor *> m_color;
+
enum Child {
ColorRole = 1,
Color = 2
};
-
- DomColorGroup(const DomColorGroup &other);
- void operator = (const DomColorGroup&other);
};
class QDESIGNER_UILIB_EXPORT DomPalette {
+ Q_DISABLE_COPY(DomPalette)
public:
- DomPalette();
+ DomPalette() = default;
~DomPalette();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline DomColorGroup* elementActive() const { return m_active; }
- DomColorGroup* takeElementActive();
- void setElementActive(DomColorGroup* a);
+ inline DomColorGroup *elementActive() const { return m_active; }
+ DomColorGroup *takeElementActive();
+ void setElementActive(DomColorGroup *a);
inline bool hasElementActive() const { return m_children & Active; }
void clearElementActive();
- inline DomColorGroup* elementInactive() const { return m_inactive; }
- DomColorGroup* takeElementInactive();
- void setElementInactive(DomColorGroup* a);
+ inline DomColorGroup *elementInactive() const { return m_inactive; }
+ DomColorGroup *takeElementInactive();
+ void setElementInactive(DomColorGroup *a);
inline bool hasElementInactive() const { return m_children & Inactive; }
void clearElementInactive();
- inline DomColorGroup* elementDisabled() const { return m_disabled; }
- DomColorGroup* takeElementDisabled();
- void setElementDisabled(DomColorGroup* a);
+ inline DomColorGroup *elementDisabled() const { return m_disabled; }
+ DomColorGroup *takeElementDisabled();
+ void setElementDisabled(DomColorGroup *a);
inline bool hasElementDisabled() const { return m_children & Disabled; }
void clearElementDisabled();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- DomColorGroup* m_active;
- DomColorGroup* m_inactive;
- DomColorGroup* m_disabled;
+ uint m_children = 0;
+ DomColorGroup *m_active = nullptr;
+ DomColorGroup *m_inactive = nullptr;
+ DomColorGroup *m_disabled = nullptr;
+
enum Child {
Active = 1,
Inactive = 2,
Disabled = 4
};
-
- DomPalette(const DomPalette &other);
- void operator = (const DomPalette&other);
};
class QDESIGNER_UILIB_EXPORT DomFont {
+ Q_DISABLE_COPY(DomFont)
public:
- DomFont();
+ DomFont() = default;
~DomFont();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QString elementFamily() const { return m_family; }
- void setElementFamily(const QString& a);
+ void setElementFamily(const QString &a);
inline bool hasElementFamily() const { return m_children & Family; }
void clearElementFamily();
@@ -2120,7 +1646,7 @@ public:
void clearElementAntialiasing();
inline QString elementStyleStrategy() const { return m_styleStrategy; }
- void setElementStyleStrategy(const QString& a);
+ void setElementStyleStrategy(const QString &a);
inline bool hasElementStyleStrategy() const { return m_children & StyleStrategy; }
void clearElementStyleStrategy();
@@ -2130,22 +1656,20 @@ public:
void clearElementKerning();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QString m_family;
- int m_pointSize;
- int m_weight;
- bool m_italic;
- bool m_bold;
- bool m_underline;
- bool m_strikeOut;
- bool m_antialiasing;
+ int m_pointSize = 0;
+ int m_weight = 0;
+ bool m_italic = false;
+ bool m_bold = false;
+ bool m_underline = false;
+ bool m_strikeOut = false;
+ bool m_antialiasing = false;
QString m_styleStrategy;
- bool m_kerning;
+ bool m_kerning = false;
+
enum Child {
Family = 1,
PointSize = 2,
@@ -2158,22 +1682,17 @@ private:
StyleStrategy = 256,
Kerning = 512
};
-
- DomFont(const DomFont &other);
- void operator = (const DomFont&other);
};
class QDESIGNER_UILIB_EXPORT DomPoint {
+ Q_DISABLE_COPY(DomPoint)
public:
- DomPoint();
+ DomPoint() = default;
~DomPoint();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementX() const { return m_x; }
void setElementX(int a);
@@ -2186,34 +1705,27 @@ public:
void clearElementY();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_x;
- int m_y;
+ uint m_children = 0;
+ int m_x = 0;
+ int m_y = 0;
+
enum Child {
X = 1,
Y = 2
};
-
- DomPoint(const DomPoint &other);
- void operator = (const DomPoint&other);
};
class QDESIGNER_UILIB_EXPORT DomRect {
+ Q_DISABLE_COPY(DomRect)
public:
- DomRect();
+ DomRect() = default;
~DomRect();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementX() const { return m_x; }
void setElementX(int a);
@@ -2236,86 +1748,69 @@ public:
void clearElementHeight();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_x;
- int m_y;
- int m_width;
- int m_height;
+ uint m_children = 0;
+ int m_x = 0;
+ int m_y = 0;
+ int m_width = 0;
+ int m_height = 0;
+
enum Child {
X = 1,
Y = 2,
Width = 4,
Height = 8
};
-
- DomRect(const DomRect &other);
- void operator = (const DomRect&other);
};
class QDESIGNER_UILIB_EXPORT DomLocale {
+ Q_DISABLE_COPY(DomLocale)
public:
- DomLocale();
+ DomLocale() = default;
~DomLocale();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeLanguage() const { return m_has_attr_language; }
inline QString attributeLanguage() const { return m_attr_language; }
- inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+ inline void setAttributeLanguage(const QString &a) { m_attr_language = a; m_has_attr_language = true; }
inline void clearAttributeLanguage() { m_has_attr_language = false; }
inline bool hasAttributeCountry() const { return m_has_attr_country; }
inline QString attributeCountry() const { return m_attr_country; }
- inline void setAttributeCountry(const QString& a) { m_attr_country = a; m_has_attr_country = true; }
+ inline void setAttributeCountry(const QString &a) { m_attr_country = a; m_has_attr_country = true; }
inline void clearAttributeCountry() { m_has_attr_country = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_language;
- bool m_has_attr_language;
+ bool m_has_attr_language = false;
QString m_attr_country;
- bool m_has_attr_country;
-
- // child element data
- uint m_children;
-
- DomLocale(const DomLocale &other);
- void operator = (const DomLocale&other);
+ bool m_has_attr_country = false;
};
class QDESIGNER_UILIB_EXPORT DomSizePolicy {
+ Q_DISABLE_COPY(DomSizePolicy)
public:
- DomSizePolicy();
+ DomSizePolicy() = default;
~DomSizePolicy();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeHSizeType() const { return m_has_attr_hSizeType; }
inline QString attributeHSizeType() const { return m_attr_hSizeType; }
- inline void setAttributeHSizeType(const QString& a) { m_attr_hSizeType = a; m_has_attr_hSizeType = true; }
+ inline void setAttributeHSizeType(const QString &a) { m_attr_hSizeType = a; m_has_attr_hSizeType = true; }
inline void clearAttributeHSizeType() { m_has_attr_hSizeType = false; }
inline bool hasAttributeVSizeType() const { return m_has_attr_vSizeType; }
inline QString attributeVSizeType() const { return m_attr_vSizeType; }
- inline void setAttributeVSizeType(const QString& a) { m_attr_vSizeType = a; m_has_attr_vSizeType = true; }
+ inline void setAttributeVSizeType(const QString &a) { m_attr_vSizeType = a; m_has_attr_vSizeType = true; }
inline void clearAttributeVSizeType() { m_has_attr_vSizeType = false; }
// child element accessors
@@ -2340,44 +1835,37 @@ public:
void clearElementVerStretch();
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_hSizeType;
- bool m_has_attr_hSizeType;
+ bool m_has_attr_hSizeType = false;
QString m_attr_vSizeType;
- bool m_has_attr_vSizeType;
+ bool m_has_attr_vSizeType = false;
// child element data
- uint m_children;
- int m_hSizeType;
- int m_vSizeType;
- int m_horStretch;
- int m_verStretch;
+ uint m_children = 0;
+ int m_hSizeType = 0;
+ int m_vSizeType = 0;
+ int m_horStretch = 0;
+ int m_verStretch = 0;
+
enum Child {
HSizeType = 1,
VSizeType = 2,
HorStretch = 4,
VerStretch = 8
};
-
- DomSizePolicy(const DomSizePolicy &other);
- void operator = (const DomSizePolicy&other);
};
class QDESIGNER_UILIB_EXPORT DomSize {
+ Q_DISABLE_COPY(DomSize)
public:
- DomSize();
+ DomSize() = default;
~DomSize();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementWidth() const { return m_width; }
void setElementWidth(int a);
@@ -2390,34 +1878,27 @@ public:
void clearElementHeight();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_width;
- int m_height;
+ uint m_children = 0;
+ int m_width = 0;
+ int m_height = 0;
+
enum Child {
Width = 1,
Height = 2
};
-
- DomSize(const DomSize &other);
- void operator = (const DomSize&other);
};
class QDESIGNER_UILIB_EXPORT DomDate {
+ Q_DISABLE_COPY(DomDate)
public:
- DomDate();
+ DomDate() = default;
~DomDate();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementYear() const { return m_year; }
void setElementYear(int a);
@@ -2435,36 +1916,29 @@ public:
void clearElementDay();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_year;
- int m_month;
- int m_day;
+ uint m_children = 0;
+ int m_year = 0;
+ int m_month = 0;
+ int m_day = 0;
+
enum Child {
Year = 1,
Month = 2,
Day = 4
};
-
- DomDate(const DomDate &other);
- void operator = (const DomDate&other);
};
class QDESIGNER_UILIB_EXPORT DomTime {
+ Q_DISABLE_COPY(DomTime)
public:
- DomTime();
+ DomTime() = default;
~DomTime();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementHour() const { return m_hour; }
void setElementHour(int a);
@@ -2482,36 +1956,29 @@ public:
void clearElementSecond();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_hour;
- int m_minute;
- int m_second;
+ uint m_children = 0;
+ int m_hour = 0;
+ int m_minute = 0;
+ int m_second = 0;
+
enum Child {
Hour = 1,
Minute = 2,
Second = 4
};
-
- DomTime(const DomTime &other);
- void operator = (const DomTime&other);
};
class QDESIGNER_UILIB_EXPORT DomDateTime {
+ Q_DISABLE_COPY(DomDateTime)
public:
- DomDateTime();
+ DomDateTime() = default;
~DomDateTime();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementHour() const { return m_hour; }
void setElementHour(int a);
@@ -2544,18 +2011,16 @@ public:
void clearElementDay();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_hour;
- int m_minute;
- int m_second;
- int m_year;
- int m_month;
- int m_day;
+ uint m_children = 0;
+ int m_hour = 0;
+ int m_minute = 0;
+ int m_second = 0;
+ int m_year = 0;
+ int m_month = 0;
+ int m_day = 0;
+
enum Child {
Hour = 1,
Minute = 2,
@@ -2564,197 +2029,184 @@ private:
Month = 16,
Day = 32
};
-
- DomDateTime(const DomDateTime &other);
- void operator = (const DomDateTime&other);
};
class QDESIGNER_UILIB_EXPORT DomStringList {
+ Q_DISABLE_COPY(DomStringList)
public:
- DomStringList();
+ DomStringList() = default;
~DomStringList();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeNotr() const { return m_has_attr_notr; }
inline QString attributeNotr() const { return m_attr_notr; }
- inline void setAttributeNotr(const QString& a) { m_attr_notr = a; m_has_attr_notr = true; }
+ inline void setAttributeNotr(const QString &a) { m_attr_notr = a; m_has_attr_notr = true; }
inline void clearAttributeNotr() { m_has_attr_notr = false; }
inline bool hasAttributeComment() const { return m_has_attr_comment; }
inline QString attributeComment() const { return m_attr_comment; }
- inline void setAttributeComment(const QString& a) { m_attr_comment = a; m_has_attr_comment = true; }
+ inline void setAttributeComment(const QString &a) { m_attr_comment = a; m_has_attr_comment = true; }
inline void clearAttributeComment() { m_has_attr_comment = false; }
inline bool hasAttributeExtraComment() const { return m_has_attr_extraComment; }
inline QString attributeExtraComment() const { return m_attr_extraComment; }
- inline void setAttributeExtraComment(const QString& a) { m_attr_extraComment = a; m_has_attr_extraComment = true; }
+ inline void setAttributeExtraComment(const QString &a) { m_attr_extraComment = a; m_has_attr_extraComment = true; }
inline void clearAttributeExtraComment() { m_has_attr_extraComment = false; }
// child element accessors
inline QStringList elementString() const { return m_string; }
- void setElementString(const QStringList& a);
+ void setElementString(const QStringList &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_notr;
- bool m_has_attr_notr;
+ bool m_has_attr_notr = false;
QString m_attr_comment;
- bool m_has_attr_comment;
+ bool m_has_attr_comment = false;
QString m_attr_extraComment;
- bool m_has_attr_extraComment;
+ bool m_has_attr_extraComment = false;
// child element data
- uint m_children;
+ uint m_children = 0;
QStringList m_string;
+
enum Child {
String = 1
};
-
- DomStringList(const DomStringList &other);
- void operator = (const DomStringList&other);
};
class QDESIGNER_UILIB_EXPORT DomResourcePixmap {
+ Q_DISABLE_COPY(DomResourcePixmap)
public:
- DomResourcePixmap();
+ DomResourcePixmap() = default;
~DomResourcePixmap();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+
inline QString text() const { return m_text; }
inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeResource() const { return m_has_attr_resource; }
inline QString attributeResource() const { return m_attr_resource; }
- inline void setAttributeResource(const QString& a) { m_attr_resource = a; m_has_attr_resource = true; }
+ inline void setAttributeResource(const QString &a) { m_attr_resource = a; m_has_attr_resource = true; }
inline void clearAttributeResource() { m_has_attr_resource = false; }
inline bool hasAttributeAlias() const { return m_has_attr_alias; }
inline QString attributeAlias() const { return m_attr_alias; }
- inline void setAttributeAlias(const QString& a) { m_attr_alias = a; m_has_attr_alias = true; }
+ inline void setAttributeAlias(const QString &a) { m_attr_alias = a; m_has_attr_alias = true; }
inline void clearAttributeAlias() { m_has_attr_alias = false; }
- // child element accessors
private:
QString m_text;
- void clear(bool clear_all = true);
// attribute data
QString m_attr_resource;
- bool m_has_attr_resource;
+ bool m_has_attr_resource = false;
QString m_attr_alias;
- bool m_has_attr_alias;
-
- // child element data
- uint m_children;
-
- DomResourcePixmap(const DomResourcePixmap &other);
- void operator = (const DomResourcePixmap&other);
+ bool m_has_attr_alias = false;
};
class QDESIGNER_UILIB_EXPORT DomResourceIcon {
+ Q_DISABLE_COPY(DomResourceIcon)
public:
- DomResourceIcon();
+ DomResourceIcon() = default;
~DomResourceIcon();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+
inline QString text() const { return m_text; }
inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeTheme() const { return m_has_attr_theme; }
inline QString attributeTheme() const { return m_attr_theme; }
- inline void setAttributeTheme(const QString& a) { m_attr_theme = a; m_has_attr_theme = true; }
+ inline void setAttributeTheme(const QString &a) { m_attr_theme = a; m_has_attr_theme = true; }
inline void clearAttributeTheme() { m_has_attr_theme = false; }
inline bool hasAttributeResource() const { return m_has_attr_resource; }
inline QString attributeResource() const { return m_attr_resource; }
- inline void setAttributeResource(const QString& a) { m_attr_resource = a; m_has_attr_resource = true; }
+ inline void setAttributeResource(const QString &a) { m_attr_resource = a; m_has_attr_resource = true; }
inline void clearAttributeResource() { m_has_attr_resource = false; }
// child element accessors
- inline DomResourcePixmap* elementNormalOff() const { return m_normalOff; }
- DomResourcePixmap* takeElementNormalOff();
- void setElementNormalOff(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementNormalOff() const { return m_normalOff; }
+ DomResourcePixmap *takeElementNormalOff();
+ void setElementNormalOff(DomResourcePixmap *a);
inline bool hasElementNormalOff() const { return m_children & NormalOff; }
void clearElementNormalOff();
- inline DomResourcePixmap* elementNormalOn() const { return m_normalOn; }
- DomResourcePixmap* takeElementNormalOn();
- void setElementNormalOn(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementNormalOn() const { return m_normalOn; }
+ DomResourcePixmap *takeElementNormalOn();
+ void setElementNormalOn(DomResourcePixmap *a);
inline bool hasElementNormalOn() const { return m_children & NormalOn; }
void clearElementNormalOn();
- inline DomResourcePixmap* elementDisabledOff() const { return m_disabledOff; }
- DomResourcePixmap* takeElementDisabledOff();
- void setElementDisabledOff(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementDisabledOff() const { return m_disabledOff; }
+ DomResourcePixmap *takeElementDisabledOff();
+ void setElementDisabledOff(DomResourcePixmap *a);
inline bool hasElementDisabledOff() const { return m_children & DisabledOff; }
void clearElementDisabledOff();
- inline DomResourcePixmap* elementDisabledOn() const { return m_disabledOn; }
- DomResourcePixmap* takeElementDisabledOn();
- void setElementDisabledOn(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementDisabledOn() const { return m_disabledOn; }
+ DomResourcePixmap *takeElementDisabledOn();
+ void setElementDisabledOn(DomResourcePixmap *a);
inline bool hasElementDisabledOn() const { return m_children & DisabledOn; }
void clearElementDisabledOn();
- inline DomResourcePixmap* elementActiveOff() const { return m_activeOff; }
- DomResourcePixmap* takeElementActiveOff();
- void setElementActiveOff(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementActiveOff() const { return m_activeOff; }
+ DomResourcePixmap *takeElementActiveOff();
+ void setElementActiveOff(DomResourcePixmap *a);
inline bool hasElementActiveOff() const { return m_children & ActiveOff; }
void clearElementActiveOff();
- inline DomResourcePixmap* elementActiveOn() const { return m_activeOn; }
- DomResourcePixmap* takeElementActiveOn();
- void setElementActiveOn(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementActiveOn() const { return m_activeOn; }
+ DomResourcePixmap *takeElementActiveOn();
+ void setElementActiveOn(DomResourcePixmap *a);
inline bool hasElementActiveOn() const { return m_children & ActiveOn; }
void clearElementActiveOn();
- inline DomResourcePixmap* elementSelectedOff() const { return m_selectedOff; }
- DomResourcePixmap* takeElementSelectedOff();
- void setElementSelectedOff(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementSelectedOff() const { return m_selectedOff; }
+ DomResourcePixmap *takeElementSelectedOff();
+ void setElementSelectedOff(DomResourcePixmap *a);
inline bool hasElementSelectedOff() const { return m_children & SelectedOff; }
void clearElementSelectedOff();
- inline DomResourcePixmap* elementSelectedOn() const { return m_selectedOn; }
- DomResourcePixmap* takeElementSelectedOn();
- void setElementSelectedOn(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementSelectedOn() const { return m_selectedOn; }
+ DomResourcePixmap *takeElementSelectedOn();
+ void setElementSelectedOn(DomResourcePixmap *a);
inline bool hasElementSelectedOn() const { return m_children & SelectedOn; }
void clearElementSelectedOn();
private:
QString m_text;
- void clear(bool clear_all = true);
// attribute data
QString m_attr_theme;
- bool m_has_attr_theme;
+ bool m_has_attr_theme = false;
QString m_attr_resource;
- bool m_has_attr_resource;
+ bool m_has_attr_resource = false;
// child element data
- uint m_children;
- DomResourcePixmap* m_normalOff;
- DomResourcePixmap* m_normalOn;
- DomResourcePixmap* m_disabledOff;
- DomResourcePixmap* m_disabledOn;
- DomResourcePixmap* m_activeOff;
- DomResourcePixmap* m_activeOn;
- DomResourcePixmap* m_selectedOff;
- DomResourcePixmap* m_selectedOn;
+ uint m_children = 0;
+ DomResourcePixmap *m_normalOff = nullptr;
+ DomResourcePixmap *m_normalOn = nullptr;
+ DomResourcePixmap *m_disabledOff = nullptr;
+ DomResourcePixmap *m_disabledOn = nullptr;
+ DomResourcePixmap *m_activeOff = nullptr;
+ DomResourcePixmap *m_activeOn = nullptr;
+ DomResourcePixmap *m_selectedOff = nullptr;
+ DomResourcePixmap *m_selectedOn = nullptr;
+
enum Child {
NormalOff = 1,
NormalOn = 2,
@@ -2765,70 +2217,59 @@ private:
SelectedOff = 64,
SelectedOn = 128
};
-
- DomResourceIcon(const DomResourceIcon &other);
- void operator = (const DomResourceIcon&other);
};
class QDESIGNER_UILIB_EXPORT DomString {
+ Q_DISABLE_COPY(DomString)
public:
- DomString();
+ DomString() = default;
~DomString();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+
inline QString text() const { return m_text; }
inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeNotr() const { return m_has_attr_notr; }
inline QString attributeNotr() const { return m_attr_notr; }
- inline void setAttributeNotr(const QString& a) { m_attr_notr = a; m_has_attr_notr = true; }
+ inline void setAttributeNotr(const QString &a) { m_attr_notr = a; m_has_attr_notr = true; }
inline void clearAttributeNotr() { m_has_attr_notr = false; }
inline bool hasAttributeComment() const { return m_has_attr_comment; }
inline QString attributeComment() const { return m_attr_comment; }
- inline void setAttributeComment(const QString& a) { m_attr_comment = a; m_has_attr_comment = true; }
+ inline void setAttributeComment(const QString &a) { m_attr_comment = a; m_has_attr_comment = true; }
inline void clearAttributeComment() { m_has_attr_comment = false; }
inline bool hasAttributeExtraComment() const { return m_has_attr_extraComment; }
inline QString attributeExtraComment() const { return m_attr_extraComment; }
- inline void setAttributeExtraComment(const QString& a) { m_attr_extraComment = a; m_has_attr_extraComment = true; }
+ inline void setAttributeExtraComment(const QString &a) { m_attr_extraComment = a; m_has_attr_extraComment = true; }
inline void clearAttributeExtraComment() { m_has_attr_extraComment = false; }
- // child element accessors
private:
QString m_text;
- void clear(bool clear_all = true);
// attribute data
QString m_attr_notr;
- bool m_has_attr_notr;
+ bool m_has_attr_notr = false;
QString m_attr_comment;
- bool m_has_attr_comment;
+ bool m_has_attr_comment = false;
QString m_attr_extraComment;
- bool m_has_attr_extraComment;
-
- // child element data
- uint m_children;
-
- DomString(const DomString &other);
- void operator = (const DomString&other);
+ bool m_has_attr_extraComment = false;
};
class QDESIGNER_UILIB_EXPORT DomPointF {
+ Q_DISABLE_COPY(DomPointF)
public:
- DomPointF();
+ DomPointF() = default;
~DomPointF();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline double elementX() const { return m_x; }
void setElementX(double a);
@@ -2841,34 +2282,27 @@ public:
void clearElementY();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- double m_x;
- double m_y;
+ uint m_children = 0;
+ double m_x = 0.0;
+ double m_y = 0.0;
+
enum Child {
X = 1,
Y = 2
};
-
- DomPointF(const DomPointF &other);
- void operator = (const DomPointF&other);
};
class QDESIGNER_UILIB_EXPORT DomRectF {
+ Q_DISABLE_COPY(DomRectF)
public:
- DomRectF();
+ DomRectF() = default;
~DomRectF();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline double elementX() const { return m_x; }
void setElementX(double a);
@@ -2891,38 +2325,31 @@ public:
void clearElementHeight();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- double m_x;
- double m_y;
- double m_width;
- double m_height;
+ uint m_children = 0;
+ double m_x = 0.0;
+ double m_y = 0.0;
+ double m_width = 0.0;
+ double m_height = 0.0;
+
enum Child {
X = 1,
Y = 2,
Width = 4,
Height = 8
};
-
- DomRectF(const DomRectF &other);
- void operator = (const DomRectF&other);
};
class QDESIGNER_UILIB_EXPORT DomSizeF {
+ Q_DISABLE_COPY(DomSizeF)
public:
- DomSizeF();
+ DomSizeF() = default;
~DomSizeF();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline double elementWidth() const { return m_width; }
void setElementWidth(double a);
@@ -2935,34 +2362,27 @@ public:
void clearElementHeight();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- double m_width;
- double m_height;
+ uint m_children = 0;
+ double m_width = 0.0;
+ double m_height = 0.0;
+
enum Child {
Width = 1,
Height = 2
};
-
- DomSizeF(const DomSizeF &other);
- void operator = (const DomSizeF&other);
};
class QDESIGNER_UILIB_EXPORT DomChar {
+ Q_DISABLE_COPY(DomChar)
public:
- DomChar();
+ DomChar() = default;
~DomChar();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline int elementUnicode() const { return m_unicode; }
void setElementUnicode(int a);
@@ -2970,69 +2390,56 @@ public:
void clearElementUnicode();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- int m_unicode;
+ uint m_children = 0;
+ int m_unicode = 0;
+
enum Child {
Unicode = 1
};
-
- DomChar(const DomChar &other);
- void operator = (const DomChar&other);
};
class QDESIGNER_UILIB_EXPORT DomUrl {
+ Q_DISABLE_COPY(DomUrl)
public:
- DomUrl();
+ DomUrl() = default;
~DomUrl();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline DomString* elementString() const { return m_string; }
- DomString* takeElementString();
- void setElementString(DomString* a);
+ inline DomString *elementString() const { return m_string; }
+ DomString *takeElementString();
+ void setElementString(DomString *a);
inline bool hasElementString() const { return m_children & String; }
void clearElementString();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- DomString* m_string;
+ uint m_children = 0;
+ DomString *m_string = nullptr;
+
enum Child {
String = 1
};
-
- DomUrl(const DomUrl &other);
- void operator = (const DomUrl&other);
};
class QDESIGNER_UILIB_EXPORT DomProperty {
+ Q_DISABLE_COPY(DomProperty)
public:
- DomProperty();
+ DomProperty() = default;
~DomProperty();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
inline bool hasAttributeStdset() const { return m_has_attr_stdset; }
@@ -3045,70 +2452,70 @@ public:
inline Kind kind() const { return m_kind; }
inline QString elementBool() const { return m_bool; }
- void setElementBool(const QString& a);
+ void setElementBool(const QString &a);
- inline DomColor* elementColor() const { return m_color; }
- DomColor* takeElementColor();
- void setElementColor(DomColor* a);
+ inline DomColor *elementColor() const { return m_color; }
+ DomColor *takeElementColor();
+ void setElementColor(DomColor *a);
inline QString elementCstring() const { return m_cstring; }
- void setElementCstring(const QString& a);
+ void setElementCstring(const QString &a);
inline int elementCursor() const { return m_cursor; }
void setElementCursor(int a);
inline QString elementCursorShape() const { return m_cursorShape; }
- void setElementCursorShape(const QString& a);
+ void setElementCursorShape(const QString &a);
inline QString elementEnum() const { return m_enum; }
- void setElementEnum(const QString& a);
+ void setElementEnum(const QString &a);
- inline DomFont* elementFont() const { return m_font; }
- DomFont* takeElementFont();
- void setElementFont(DomFont* a);
+ inline DomFont *elementFont() const { return m_font; }
+ DomFont *takeElementFont();
+ void setElementFont(DomFont *a);
- inline DomResourceIcon* elementIconSet() const { return m_iconSet; }
- DomResourceIcon* takeElementIconSet();
- void setElementIconSet(DomResourceIcon* a);
+ inline DomResourceIcon *elementIconSet() const { return m_iconSet; }
+ DomResourceIcon *takeElementIconSet();
+ void setElementIconSet(DomResourceIcon *a);
- inline DomResourcePixmap* elementPixmap() const { return m_pixmap; }
- DomResourcePixmap* takeElementPixmap();
- void setElementPixmap(DomResourcePixmap* a);
+ inline DomResourcePixmap *elementPixmap() const { return m_pixmap; }
+ DomResourcePixmap *takeElementPixmap();
+ void setElementPixmap(DomResourcePixmap *a);
- inline DomPalette* elementPalette() const { return m_palette; }
- DomPalette* takeElementPalette();
- void setElementPalette(DomPalette* a);
+ inline DomPalette *elementPalette() const { return m_palette; }
+ DomPalette *takeElementPalette();
+ void setElementPalette(DomPalette *a);
- inline DomPoint* elementPoint() const { return m_point; }
- DomPoint* takeElementPoint();
- void setElementPoint(DomPoint* a);
+ inline DomPoint *elementPoint() const { return m_point; }
+ DomPoint *takeElementPoint();
+ void setElementPoint(DomPoint *a);
- inline DomRect* elementRect() const { return m_rect; }
- DomRect* takeElementRect();
- void setElementRect(DomRect* a);
+ inline DomRect *elementRect() const { return m_rect; }
+ DomRect *takeElementRect();
+ void setElementRect(DomRect *a);
inline QString elementSet() const { return m_set; }
- void setElementSet(const QString& a);
+ void setElementSet(const QString &a);
- inline DomLocale* elementLocale() const { return m_locale; }
- DomLocale* takeElementLocale();
- void setElementLocale(DomLocale* a);
+ inline DomLocale *elementLocale() const { return m_locale; }
+ DomLocale *takeElementLocale();
+ void setElementLocale(DomLocale *a);
- inline DomSizePolicy* elementSizePolicy() const { return m_sizePolicy; }
- DomSizePolicy* takeElementSizePolicy();
- void setElementSizePolicy(DomSizePolicy* a);
+ inline DomSizePolicy *elementSizePolicy() const { return m_sizePolicy; }
+ DomSizePolicy *takeElementSizePolicy();
+ void setElementSizePolicy(DomSizePolicy *a);
- inline DomSize* elementSize() const { return m_size; }
- DomSize* takeElementSize();
- void setElementSize(DomSize* a);
+ inline DomSize *elementSize() const { return m_size; }
+ DomSize *takeElementSize();
+ void setElementSize(DomSize *a);
- inline DomString* elementString() const { return m_string; }
- DomString* takeElementString();
- void setElementString(DomString* a);
+ inline DomString *elementString() const { return m_string; }
+ DomString *takeElementString();
+ void setElementString(DomString *a);
- inline DomStringList* elementStringList() const { return m_stringList; }
- DomStringList* takeElementStringList();
- void setElementStringList(DomStringList* a);
+ inline DomStringList *elementStringList() const { return m_stringList; }
+ DomStringList *takeElementStringList();
+ void setElementStringList(DomStringList *a);
inline int elementNumber() const { return m_number; }
void setElementNumber(int a);
@@ -3119,40 +2526,40 @@ public:
inline double elementDouble() const { return m_double; }
void setElementDouble(double a);
- inline DomDate* elementDate() const { return m_date; }
- DomDate* takeElementDate();
- void setElementDate(DomDate* a);
+ inline DomDate *elementDate() const { return m_date; }
+ DomDate *takeElementDate();
+ void setElementDate(DomDate *a);
- inline DomTime* elementTime() const { return m_time; }
- DomTime* takeElementTime();
- void setElementTime(DomTime* a);
+ inline DomTime *elementTime() const { return m_time; }
+ DomTime *takeElementTime();
+ void setElementTime(DomTime *a);
- inline DomDateTime* elementDateTime() const { return m_dateTime; }
- DomDateTime* takeElementDateTime();
- void setElementDateTime(DomDateTime* a);
+ inline DomDateTime *elementDateTime() const { return m_dateTime; }
+ DomDateTime *takeElementDateTime();
+ void setElementDateTime(DomDateTime *a);
- inline DomPointF* elementPointF() const { return m_pointF; }
- DomPointF* takeElementPointF();
- void setElementPointF(DomPointF* a);
+ inline DomPointF *elementPointF() const { return m_pointF; }
+ DomPointF *takeElementPointF();
+ void setElementPointF(DomPointF *a);
- inline DomRectF* elementRectF() const { return m_rectF; }
- DomRectF* takeElementRectF();
- void setElementRectF(DomRectF* a);
+ inline DomRectF *elementRectF() const { return m_rectF; }
+ DomRectF *takeElementRectF();
+ void setElementRectF(DomRectF *a);
- inline DomSizeF* elementSizeF() const { return m_sizeF; }
- DomSizeF* takeElementSizeF();
- void setElementSizeF(DomSizeF* a);
+ inline DomSizeF *elementSizeF() const { return m_sizeF; }
+ DomSizeF *takeElementSizeF();
+ void setElementSizeF(DomSizeF *a);
inline qlonglong elementLongLong() const { return m_longLong; }
void setElementLongLong(qlonglong a);
- inline DomChar* elementChar() const { return m_char; }
- DomChar* takeElementChar();
- void setElementChar(DomChar* a);
+ inline DomChar *elementChar() const { return m_char; }
+ DomChar *takeElementChar();
+ void setElementChar(DomChar *a);
- inline DomUrl* elementUrl() const { return m_url; }
- DomUrl* takeElementUrl();
- void setElementUrl(DomUrl* a);
+ inline DomUrl *elementUrl() const { return m_url; }
+ DomUrl *takeElementUrl();
+ void setElementUrl(DomUrl *a);
inline uint elementUInt() const { return m_UInt; }
void setElementUInt(uint a);
@@ -3160,142 +2567,127 @@ public:
inline qulonglong elementULongLong() const { return m_uLongLong; }
void setElementULongLong(qulonglong a);
- inline DomBrush* elementBrush() const { return m_brush; }
- DomBrush* takeElementBrush();
- void setElementBrush(DomBrush* a);
+ inline DomBrush *elementBrush() const { return m_brush; }
+ DomBrush *takeElementBrush();
+ void setElementBrush(DomBrush *a);
private:
- QString m_text;
- void clear(bool clear_all = true);
+ void clear();
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
- int m_attr_stdset;
- bool m_has_attr_stdset;
+ int m_attr_stdset = 0;
+ bool m_has_attr_stdset = false;
// child element data
- Kind m_kind;
+ Kind m_kind = Unknown;
QString m_bool;
- DomColor* m_color;
+ DomColor *m_color = nullptr;
QString m_cstring;
- int m_cursor;
+ int m_cursor = 0;
QString m_cursorShape;
QString m_enum;
- DomFont* m_font;
- DomResourceIcon* m_iconSet;
- DomResourcePixmap* m_pixmap;
- DomPalette* m_palette;
- DomPoint* m_point;
- DomRect* m_rect;
+ DomFont *m_font = nullptr;
+ DomResourceIcon *m_iconSet = nullptr;
+ DomResourcePixmap *m_pixmap = nullptr;
+ DomPalette *m_palette = nullptr;
+ DomPoint *m_point = nullptr;
+ DomRect *m_rect = nullptr;
QString m_set;
- DomLocale* m_locale;
- DomSizePolicy* m_sizePolicy;
- DomSize* m_size;
- DomString* m_string;
- DomStringList* m_stringList;
- int m_number;
- float m_float;
- double m_double;
- DomDate* m_date;
- DomTime* m_time;
- DomDateTime* m_dateTime;
- DomPointF* m_pointF;
- DomRectF* m_rectF;
- DomSizeF* m_sizeF;
- qlonglong m_longLong;
- DomChar* m_char;
- DomUrl* m_url;
- uint m_UInt;
- qulonglong m_uLongLong;
- DomBrush* m_brush;
-
- DomProperty(const DomProperty &other);
- void operator = (const DomProperty&other);
+ DomLocale *m_locale = nullptr;
+ DomSizePolicy *m_sizePolicy = nullptr;
+ DomSize *m_size = nullptr;
+ DomString *m_string = nullptr;
+ DomStringList *m_stringList = nullptr;
+ int m_number = 0;
+ float m_float = 0.0;
+ double m_double = 0.0;
+ DomDate *m_date = nullptr;
+ DomTime *m_time = nullptr;
+ DomDateTime *m_dateTime = nullptr;
+ DomPointF *m_pointF = nullptr;
+ DomRectF *m_rectF = nullptr;
+ DomSizeF *m_sizeF = nullptr;
+ qlonglong m_longLong = 0;
+ DomChar *m_char = nullptr;
+ DomUrl *m_url = nullptr;
+ uint m_UInt = 0;
+ qulonglong m_uLongLong = 0;
+ DomBrush *m_brush = nullptr;
};
class QDESIGNER_UILIB_EXPORT DomConnections {
+ Q_DISABLE_COPY(DomConnections)
public:
- DomConnections();
+ DomConnections() = default;
~DomConnections();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomConnection*> elementConnection() const { return m_connection; }
- void setElementConnection(const QList<DomConnection*>& a);
+ inline QVector<DomConnection *> elementConnection() const { return m_connection; }
+ void setElementConnection(const QVector<DomConnection *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomConnection*> m_connection;
+ uint m_children = 0;
+ QVector<DomConnection *> m_connection;
+
enum Child {
Connection = 1
};
-
- DomConnections(const DomConnections &other);
- void operator = (const DomConnections&other);
};
class QDESIGNER_UILIB_EXPORT DomConnection {
+ Q_DISABLE_COPY(DomConnection)
public:
- DomConnection();
+ DomConnection() = default;
~DomConnection();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QString elementSender() const { return m_sender; }
- void setElementSender(const QString& a);
+ void setElementSender(const QString &a);
inline bool hasElementSender() const { return m_children & Sender; }
void clearElementSender();
inline QString elementSignal() const { return m_signal; }
- void setElementSignal(const QString& a);
+ void setElementSignal(const QString &a);
inline bool hasElementSignal() const { return m_children & Signal; }
void clearElementSignal();
inline QString elementReceiver() const { return m_receiver; }
- void setElementReceiver(const QString& a);
+ void setElementReceiver(const QString &a);
inline bool hasElementReceiver() const { return m_children & Receiver; }
void clearElementReceiver();
inline QString elementSlot() const { return m_slot; }
- void setElementSlot(const QString& a);
+ void setElementSlot(const QString &a);
inline bool hasElementSlot() const { return m_children & Slot; }
void clearElementSlot();
- inline DomConnectionHints* elementHints() const { return m_hints; }
- DomConnectionHints* takeElementHints();
- void setElementHints(DomConnectionHints* a);
+ inline DomConnectionHints *elementHints() const { return m_hints; }
+ DomConnectionHints *takeElementHints();
+ void setElementHints(DomConnectionHints *a);
inline bool hasElementHints() const { return m_children & Hints; }
void clearElementHints();
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QString m_sender;
QString m_signal;
QString m_receiver;
QString m_slot;
- DomConnectionHints* m_hints;
+ DomConnectionHints *m_hints = nullptr;
+
enum Child {
Sender = 1,
Signal = 2,
@@ -3303,56 +2695,45 @@ private:
Slot = 8,
Hints = 16
};
-
- DomConnection(const DomConnection &other);
- void operator = (const DomConnection&other);
};
class QDESIGNER_UILIB_EXPORT DomConnectionHints {
+ Q_DISABLE_COPY(DomConnectionHints)
public:
- DomConnectionHints();
+ DomConnectionHints() = default;
~DomConnectionHints();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomConnectionHint*> elementHint() const { return m_hint; }
- void setElementHint(const QList<DomConnectionHint*>& a);
+ inline QVector<DomConnectionHint *> elementHint() const { return m_hint; }
+ void setElementHint(const QVector<DomConnectionHint *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomConnectionHint*> m_hint;
+ uint m_children = 0;
+ QVector<DomConnectionHint *> m_hint;
+
enum Child {
Hint = 1
};
-
- DomConnectionHints(const DomConnectionHints &other);
- void operator = (const DomConnectionHints&other);
};
class QDESIGNER_UILIB_EXPORT DomConnectionHint {
+ Q_DISABLE_COPY(DomConnectionHint)
public:
- DomConnectionHint();
+ DomConnectionHint() = default;
~DomConnectionHint();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeType() const { return m_has_attr_type; }
inline QString attributeType() const { return m_attr_type; }
- inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void setAttributeType(const QString &a) { m_attr_type = a; m_has_attr_type = true; }
inline void clearAttributeType() { m_has_attr_type = false; }
// child element accessors
@@ -3367,278 +2748,159 @@ public:
void clearElementY();
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_type;
- bool m_has_attr_type;
+ bool m_has_attr_type = false;
// child element data
- uint m_children;
- int m_x;
- int m_y;
+ uint m_children = 0;
+ int m_x = 0;
+ int m_y = 0;
+
enum Child {
X = 1,
Y = 2
};
-
- DomConnectionHint(const DomConnectionHint &other);
- void operator = (const DomConnectionHint&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomScript {
-public:
- DomScript();
- ~DomScript();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- inline bool hasAttributeSource() const { return m_has_attr_source; }
- inline QString attributeSource() const { return m_attr_source; }
- inline void setAttributeSource(const QString& a) { m_attr_source = a; m_has_attr_source = true; }
- inline void clearAttributeSource() { m_has_attr_source = false; }
-
- inline bool hasAttributeLanguage() const { return m_has_attr_language; }
- inline QString attributeLanguage() const { return m_attr_language; }
- inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
- inline void clearAttributeLanguage() { m_has_attr_language = false; }
-
- // child element accessors
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- QString m_attr_source;
- bool m_has_attr_source;
-
- QString m_attr_language;
- bool m_has_attr_language;
-
- // child element data
- uint m_children;
-
- DomScript(const DomScript &other);
- void operator = (const DomScript&other);
-};
-
-class QDESIGNER_UILIB_EXPORT DomWidgetData {
-public:
- DomWidgetData();
- ~DomWidgetData();
-
- void read(QXmlStreamReader &reader);
- void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
-
- // attribute accessors
- // child element accessors
- inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
-
-private:
- QString m_text;
- void clear(bool clear_all = true);
-
- // attribute data
- // child element data
- uint m_children;
- QList<DomProperty*> m_property;
- enum Child {
- Property = 1
- };
-
- DomWidgetData(const DomWidgetData &other);
- void operator = (const DomWidgetData&other);
};
class QDESIGNER_UILIB_EXPORT DomDesignerData {
+ Q_DISABLE_COPY(DomDesignerData)
public:
- DomDesignerData();
+ DomDesignerData() = default;
~DomDesignerData();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QList<DomProperty*> elementProperty() const { return m_property; }
- void setElementProperty(const QList<DomProperty*>& a);
+ void setElementProperty(const QList<DomProperty *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QList<DomProperty*> m_property;
+
enum Child {
Property = 1
};
-
- DomDesignerData(const DomDesignerData &other);
- void operator = (const DomDesignerData&other);
};
class QDESIGNER_UILIB_EXPORT DomSlots {
+ Q_DISABLE_COPY(DomSlots)
public:
- DomSlots();
+ DomSlots() = default;
~DomSlots();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
inline QStringList elementSignal() const { return m_signal; }
- void setElementSignal(const QStringList& a);
+ void setElementSignal(const QStringList &a);
inline QStringList elementSlot() const { return m_slot; }
- void setElementSlot(const QStringList& a);
+ void setElementSlot(const QStringList &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
+ uint m_children = 0;
QStringList m_signal;
QStringList m_slot;
+
enum Child {
Signal = 1,
Slot = 2
};
-
- DomSlots(const DomSlots &other);
- void operator = (const DomSlots&other);
};
class QDESIGNER_UILIB_EXPORT DomPropertySpecifications {
+ Q_DISABLE_COPY(DomPropertySpecifications)
public:
- DomPropertySpecifications();
+ DomPropertySpecifications() = default;
~DomPropertySpecifications();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
- // attribute accessors
// child element accessors
- inline QList<DomPropertyToolTip*> elementTooltip() const { return m_tooltip; }
- void setElementTooltip(const QList<DomPropertyToolTip*>& a);
+ inline QVector<DomPropertyToolTip *> elementTooltip() const { return m_tooltip; }
+ void setElementTooltip(const QVector<DomPropertyToolTip *> &a);
- inline QList<DomStringPropertySpecification*> elementStringpropertyspecification() const { return m_stringpropertyspecification; }
- void setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a);
+ inline QVector<DomStringPropertySpecification *> elementStringpropertyspecification() const { return m_stringpropertyspecification; }
+ void setElementStringpropertyspecification(const QVector<DomStringPropertySpecification *> &a);
private:
- QString m_text;
- void clear(bool clear_all = true);
- // attribute data
// child element data
- uint m_children;
- QList<DomPropertyToolTip*> m_tooltip;
- QList<DomStringPropertySpecification*> m_stringpropertyspecification;
+ uint m_children = 0;
+ QVector<DomPropertyToolTip *> m_tooltip;
+ QVector<DomStringPropertySpecification *> m_stringpropertyspecification;
+
enum Child {
Tooltip = 1,
Stringpropertyspecification = 2
};
-
- DomPropertySpecifications(const DomPropertySpecifications &other);
- void operator = (const DomPropertySpecifications&other);
};
class QDESIGNER_UILIB_EXPORT DomPropertyToolTip {
+ Q_DISABLE_COPY(DomPropertyToolTip)
public:
- DomPropertyToolTip();
+ DomPropertyToolTip() = default;
~DomPropertyToolTip();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
-
- // child element data
- uint m_children;
-
- DomPropertyToolTip(const DomPropertyToolTip &other);
- void operator = (const DomPropertyToolTip&other);
+ bool m_has_attr_name = false;
};
class QDESIGNER_UILIB_EXPORT DomStringPropertySpecification {
+ Q_DISABLE_COPY(DomStringPropertySpecification)
public:
- DomStringPropertySpecification();
+ DomStringPropertySpecification() = default;
~DomStringPropertySpecification();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
- inline QString text() const { return m_text; }
- inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
- inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void setAttributeName(const QString &a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
inline bool hasAttributeType() const { return m_has_attr_type; }
inline QString attributeType() const { return m_attr_type; }
- inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void setAttributeType(const QString &a) { m_attr_type = a; m_has_attr_type = true; }
inline void clearAttributeType() { m_has_attr_type = false; }
inline bool hasAttributeNotr() const { return m_has_attr_notr; }
inline QString attributeNotr() const { return m_attr_notr; }
- inline void setAttributeNotr(const QString& a) { m_attr_notr = a; m_has_attr_notr = true; }
+ inline void setAttributeNotr(const QString &a) { m_attr_notr = a; m_has_attr_notr = true; }
inline void clearAttributeNotr() { m_has_attr_notr = false; }
- // child element accessors
private:
- QString m_text;
- void clear(bool clear_all = true);
-
// attribute data
QString m_attr_name;
- bool m_has_attr_name;
+ bool m_has_attr_name = false;
QString m_attr_type;
- bool m_has_attr_type;
+ bool m_has_attr_type = false;
QString m_attr_notr;
- bool m_has_attr_notr;
-
- // child element data
- uint m_children;
-
- DomStringPropertySpecification(const DomStringPropertySpecification &other);
- void operator = (const DomStringPropertySpecification&other);
+ bool m_has_attr_notr = false;
};
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index fa775161e5..48756db651 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -52,8 +52,7 @@ QT_BEGIN_NAMESPACE
Uic::Uic(Driver *d)
: drv(d),
out(d->output()),
- opt(d->option()),
- externalPix(true)
+ opt(d->option())
{
}
@@ -253,15 +252,13 @@ bool Uic::write(DomUI *ui)
if (pixFunction == QLatin1String("QPixmap::fromMimeSource"))
pixFunction = QLatin1String("qPixmapFromMimeSource");
- externalPix = ui->elementImages() == 0;
-
info.acceptUI(ui);
cWidgetsInfo.acceptUI(ui);
WriteIncludes writeIncludes(this);
writeIncludes.acceptUI(ui);
Validator(this).acceptUI(ui);
- WriteDeclaration(this, writeIncludes.scriptsActivated()).acceptUI(ui);
+ WriteDeclaration(this).acceptUI(ui);
if (opt.headerProtection)
writeHeaderProtectionEnd();
diff --git a/src/tools/uic/uic.h b/src/tools/uic/uic.h
index 10404d3370..e00dc595bc 100644
--- a/src/tools/uic/uic.h
+++ b/src/tools/uic/uic.h
@@ -74,12 +74,6 @@ public:
inline void setPixmapFunction(const QString &f)
{ pixFunction = f; }
- inline bool hasExternalPixmap() const
- { return externalPix; }
-
- inline void setExternalPixmap(bool b)
- { externalPix = b; }
-
inline const DatabaseInfo *databaseInfo() const
{ return &info; }
@@ -123,7 +117,6 @@ private:
DatabaseInfo info;
CustomWidgetsInfo cWidgetsInfo;
QString pixFunction;
- bool externalPix;
};
QT_END_NAMESPACE
diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro
index 02469cdd1b..18511395d9 100644
--- a/src/tools/uic/uic.pro
+++ b/src/tools/uic/uic.pro
@@ -12,4 +12,5 @@ HEADERS += uic.h
SOURCES += main.cpp \
uic.cpp
+QMAKE_TARGET_DESCRIPTION = "Qt User Interface Compiler"
load(qt_tool)
diff --git a/src/tools/uic/utils.h b/src/tools/uic/utils.h
index 7c5918cab9..18b361fb81 100644
--- a/src/tools/uic/utils.h
+++ b/src/tools/uic/utils.h
@@ -107,19 +107,6 @@ inline QString fixString(const QString &str, const QString &indent,
return rc;
}
-inline QString writeString(const QString &s, const QString &indent)
-{
- unsigned flags = 0;
- const QString ret = fixString(s, indent, &flags);
- if (flags & Utf8String)
- return QLatin1String("QString::fromUtf8(") + ret + QLatin1Char(')');
- // MSVC cannot concat L"foo" "bar" (C2308: concatenating mismatched strings),
- // use QLatin1String instead (all platforms to avoid cross-compiling issues).
- if (flags & MultiLineString)
- return QLatin1String("QLatin1String(") + ret + QLatin1Char(')');
- return QLatin1String("QStringLiteral(") + ret + QLatin1Char(')');
-}
-
inline QHash<QString, DomProperty *> propertyMap(const QList<DomProperty *> &properties)
{
QHash<QString, DomProperty *> map;
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index 7c00f8c3f4..4c596c09a5 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -10,7 +10,6 @@
"options": {
"gtk": { "type": "boolean", "name": "gtk3" },
"style-windows": "boolean",
- "style-windowsxp": "boolean",
"style-windowsvista": "boolean",
"style-fusion": "boolean",
"style-mac": "boolean",
@@ -55,14 +54,9 @@
"label": "Windows",
"output": [ "privateFeature", "styles" ]
},
- "style-windowsxp": {
- "label": "WindowsXP",
- "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
- "output": [ "privateFeature", "styles" ]
- },
"style-windowsvista": {
"label": "WindowsVista",
- "condition": "features.style-windowsxp",
+ "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
"output": [ "privateFeature", "styles" ]
},
"style-android": {
@@ -692,7 +686,7 @@
{
"message": "Styles",
"type": "featureList",
- "args": "style-fusion style-mac style-windows style-windowsxp style-windowsvista style-android"
+ "args": "style-fusion style-mac style-windows style-windowsvista style-android"
}
]
}
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index f361770c3e..9465575b3b 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -41,6 +41,7 @@
#include "qapplication.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qdrawutil.h"
#include "qevent.h"
#include "qimage.h"
@@ -1698,7 +1699,7 @@ void QColorDialogPrivate::initWidgets()
#else
// small displays (e.g. PDAs) cannot fit the full color dialog,
// so just use the color picker.
- smallDisplay = (QApplication::desktop()->width() < 480 || QApplication::desktop()->height() < 350);
+ smallDisplay = (QDesktopWidgetPrivate::width() < 480 || QDesktopWidgetPrivate::height() < 350);
const int lumSpace = topLay->spacing() / 2;
#endif
@@ -1744,7 +1745,7 @@ void QColorDialogPrivate::initWidgets()
} else {
// better color picker size for small displays
#if defined(QT_SMALL_COLORDIALOG)
- QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
+ QSize screenSize = QDesktopWidgetPrivate::availableGeometry(QCursor::pos()).size();
pWidth = pHeight = qMin(screenSize.width(), screenSize.height());
pHeight -= 20;
if(screenSize.height() > screenSize.width())
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 1cd587b78d..9e62f79a8e 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -50,6 +50,7 @@
#include "qevent.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qapplication.h"
#include "qlayout.h"
#include "qsizegrip.h"
@@ -811,13 +812,13 @@ void QDialog::adjustPosition(QWidget* w)
w = w->window();
QRect desk;
if (w) {
- scrn = QApplication::desktop()->screenNumber(w);
- } else if (QApplication::desktop()->isVirtualDesktop()) {
- scrn = QApplication::desktop()->screenNumber(QCursor::pos());
+ scrn = QDesktopWidgetPrivate::screenNumber(w);
+ } else if (QDesktopWidgetPrivate::isVirtualDesktop()) {
+ scrn = QDesktopWidgetPrivate::screenNumber(QCursor::pos());
} else {
- scrn = QApplication::desktop()->screenNumber(this);
+ scrn = QDesktopWidgetPrivate::screenNumber(this);
}
- desk = QApplication::desktop()->availableGeometry(scrn);
+ desk = QDesktopWidgetPrivate::availableGeometry(scrn);
QWidgetList list = QApplication::topLevelWidgets();
for (int i = 0; (extraw == 0 || extrah == 0) && i < list.size(); ++i) {
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index bf14b5c6fd..f88ac71cf3 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -778,21 +778,7 @@ QString QFileSystemModelPrivate::size(const QModelIndex &index) const
QString QFileSystemModelPrivate::size(qint64 bytes)
{
- // According to the Si standard KB is 1000 bytes, KiB is 1024
- // but on windows sizes are calculated by dividing by 1024 so we do what they do.
- const qint64 kb = 1024;
- const qint64 mb = 1024 * kb;
- const qint64 gb = 1024 * mb;
- const qint64 tb = 1024 * gb;
- if (bytes >= tb)
- return QFileSystemModel::tr("%1 TB").arg(QLocale().toString(qreal(bytes) / tb, 'f', 3));
- if (bytes >= gb)
- return QFileSystemModel::tr("%1 GB").arg(QLocale().toString(qreal(bytes) / gb, 'f', 2));
- if (bytes >= mb)
- return QFileSystemModel::tr("%1 MB").arg(QLocale().toString(qreal(bytes) / mb, 'f', 1));
- if (bytes >= kb)
- return QFileSystemModel::tr("%1 KB").arg(QLocale().toString(bytes / kb));
- return QFileSystemModel::tr("%1 bytes").arg(QLocale().toString(bytes));
+ return QLocale::system().formattedDataSize(bytes);
}
/*!
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 04d13045e5..4c0f22ae97 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -1368,12 +1368,48 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr
double value, double min, double max, int decimals, bool *ok,
Qt::WindowFlags flags)
{
+ return QInputDialog::getDouble(parent, title, label, value, min, max, decimals, ok, flags, 1.0);
+}
+
+/*!
+ \overload
+ Static convenience function to get a floating point number from the user.
+
+ \a title is the text which is displayed in the title bar of the dialog.
+ \a label is the text which is shown to the user (it should say what should
+ be entered).
+ \a value is the default floating point number that the line edit will be
+ set to.
+ \a min and \a max are the minimum and maximum values the user may choose.
+ \a decimals is the maximum number of decimal places the number may have.
+ \a step is the amount by which the values change as the user presses the
+ arrow buttons to increment or decrement the value.
+
+ If \a ok is nonnull, *\a ok will be set to true if the user pressed \uicontrol OK
+ and to false if the user pressed \uicontrol Cancel. The dialog's parent is
+ \a parent. The dialog will be modal and uses the widget \a flags.
+
+ This function returns the floating point number which has been entered by
+ the user.
+
+ Use this static function like this:
+
+ \snippet dialogs/standarddialogs/dialog.cpp 1
+
+ \sa getText(), getInt(), getItem(), getMultiLineText()
+*/
+
+double QInputDialog::getDouble(QWidget *parent, const QString &title, const QString &label,
+ double value, double min, double max, int decimals, bool *ok,
+ Qt::WindowFlags flags, double step)
+{
QAutoPointer<QInputDialog> dialog(new QInputDialog(parent, flags));
dialog->setWindowTitle(title);
dialog->setLabelText(label);
dialog->setDoubleDecimals(decimals);
dialog->setDoubleRange(min, max);
dialog->setDoubleValue(value);
+ dialog->setDoubleStep(step);
const int ret = dialog->exec();
if (ok)
@@ -1439,6 +1475,31 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri
}
/*!
+ \property QInputDialog::doubleStep
+ \since 5.10
+ \brief the step by which the double value is increased and decreased
+
+ This property is only relevant when the input dialog is used in
+ DoubleInput mode.
+*/
+
+void QInputDialog::setDoubleStep(double step)
+{
+ Q_D(QInputDialog);
+ d->ensureDoubleSpinBox();
+ d->doubleSpinBox->setSingleStep(step);
+}
+
+double QInputDialog::doubleStep() const
+{
+ Q_D(const QInputDialog);
+ if (d->doubleSpinBox)
+ return d->doubleSpinBox->singleStep();
+ else
+ return 1.0;
+}
+
+/*!
\fn void QInputDialog::doubleValueChanged(double value)
This signal is emitted whenever the double value changes in the dialog.
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index 5f06785886..e41d442498 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -74,6 +74,7 @@ class Q_WIDGETS_EXPORT QInputDialog : public QDialog
QDOC_PROPERTY(int doubleDecimals READ doubleDecimals WRITE setDoubleDecimals)
QDOC_PROPERTY(QString okButtonText READ okButtonText WRITE setOkButtonText)
QDOC_PROPERTY(QString cancelButtonText READ cancelButtonText WRITE setCancelButtonText)
+ QDOC_PROPERTY(double doubleStep READ doubleStep WRITE setDoubleStep)
public:
enum InputDialogOption {
@@ -178,6 +179,10 @@ public:
static double getDouble(QWidget *parent, const QString &title, const QString &label, double value = 0,
double minValue = -2147483647, double maxValue = 2147483647,
int decimals = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ // ### Qt 6: merge overloads
+ static double getDouble(QWidget *parent, const QString &title, const QString &label, double value,
+ double minValue, double maxValue, int decimals, bool *ok, Qt::WindowFlags flags,
+ double step);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static inline int getInteger(QWidget *parent, const QString &title, const QString &label, int value = 0,
@@ -188,6 +193,9 @@ public:
}
#endif
+ void setDoubleStep(double step);
+ double doubleStep() const;
+
Q_SIGNALS:
// ### emit signals!
void textValueChanged(const QString &text);
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 6a55f62e53..0693f4bea8 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -60,6 +60,7 @@
#include <QtGui/qfont.h>
#include <QtGui/qfontmetrics.h>
#include <QtGui/qclipboard.h>
+#include <private/qdesktopwidget_p.h>
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
@@ -357,7 +358,7 @@ void QMessageBoxPrivate::updateSize()
if (!q->isVisible())
return;
- QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
+ QSize screenSize = QDesktopWidgetPrivate::availableGeometry(QCursor::pos()).size();
int hardLimit = qMin(screenSize.width() - 480, 1000); // can never get bigger than this
// on small screens allows the messagebox be the same size as the screen
if (screenSize.width() <= 1024)
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 893920cbd9..a276e28a0c 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -242,7 +242,7 @@ void QProgressDialogPrivate::_q_disconnectOnClose()
A modeless progress dialog is suitable for operations that take
place in the background, where the user is able to interact with the
application. Such operations are typically based on QTimer (or
- QObject::timerEvent()), QSocketNotifier, or QUrlOperator; or performed
+ QObject::timerEvent()) or QSocketNotifier; or performed
in a separate thread. A QProgressBar in the status bar of your main window
is often an alternative to a modeless progress dialog.
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 4d89cd9936..3d9b6a3d62 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -46,6 +46,7 @@
#include "qboxlayout.h"
#include "qlayoutitem.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qevent.h"
#include "qframe.h"
#include "qlabel.h"
@@ -396,7 +397,7 @@ void QWizardHeader::setup(const QWizardLayoutInfo &info, const QString &title,
/*
There is no widthForHeight() function, so we simulate it with a loop.
*/
- int candidateSubTitleWidth = qMin(512, 2 * QApplication::desktop()->width() / 3);
+ int candidateSubTitleWidth = qMin(512, 2 * QDesktopWidgetPrivate::width() / 3);
int delta = candidateSubTitleWidth >> 1;
while (delta > 0) {
if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
@@ -496,6 +497,7 @@ public:
mutable TriState completeState;
bool explicitlyFinal;
bool commit;
+ bool initialized = false;
QMap<int, QString> buttonCustomTexts;
};
@@ -631,7 +633,6 @@ public:
QMap<QString, int> fieldIndexMap;
QVector<QWizardDefaultProperty> defaultPropertyTable;
QList<int> history;
- QSet<int> initialized; // ### remove and move bit to QWizardPage?
int start;
bool startSetByUser;
int current;
@@ -770,7 +771,8 @@ void QWizardPrivate::reset()
for (int i = history.count() - 1; i >= 0; --i)
q->cleanupPage(history.at(i));
history.clear();
- initialized.clear();
+ for (QWizardPage *page : pageMap)
+ page->d_func()->initialized = false;
current = -1;
emit q->currentIdChanged(-1);
@@ -781,14 +783,12 @@ void QWizardPrivate::cleanupPagesNotInHistory()
{
Q_Q(QWizard);
- const QSet<int> original = initialized;
- QSet<int>::const_iterator i = original.constBegin();
- QSet<int>::const_iterator end = original.constEnd();
-
- for (; i != end; ++i) {
- if (!history.contains(*i)) {
- q->cleanupPage(*i);
- initialized.remove(*i);
+ for (auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
+ const auto idx = it.key();
+ const auto page = it.value()->d_func();
+ if (page->initialized && !history.contains(idx)) {
+ q->cleanupPage(idx);
+ page->initialized = false;
}
}
}
@@ -843,7 +843,7 @@ void QWizardPrivate::switchToPage(int newId, Direction direction)
if (direction == Backward) {
if (!(opts & QWizard::IndependentPages)) {
q->cleanupPage(oldId);
- initialized.remove(oldId);
+ oldPage->d_func()->initialized = false;
}
Q_ASSERT(history.constLast() == oldId);
history.removeLast();
@@ -856,8 +856,8 @@ void QWizardPrivate::switchToPage(int newId, Direction direction)
QWizardPage *newPage = q->currentPage();
if (newPage) {
if (direction == Forward) {
- if (!initialized.contains(current)) {
- initialized.insert(current);
+ if (!newPage->d_func()->initialized) {
+ newPage->d_func()->initialized = true;
q->initializePage(current);
}
history.append(current);
@@ -2357,9 +2357,9 @@ void QWizard::removePage(int id)
}
if (removedPage) {
- if (d->initialized.contains(id)) {
+ if (removedPage->d_func()->initialized) {
cleanupPage(id);
- d->initialized.remove(id);
+ removedPage->d_func()->initialized = false;
}
d->pageVBoxLayout->removeWidget(removedPage);
diff --git a/src/widgets/doc/images/stylesheet-coffee-xp.png b/src/widgets/doc/images/stylesheet-coffee-xp.png
deleted file mode 100644
index 8bedd80ee9..0000000000
--- a/src/widgets/doc/images/stylesheet-coffee-xp.png
+++ /dev/null
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-tabwidget.png b/src/widgets/doc/images/windowsxp-tabwidget.png
deleted file mode 100644
index 3c8e777a0b..0000000000
--- a/src/widgets/doc/images/windowsxp-tabwidget.png
+++ /dev/null
Binary files differ
diff --git a/src/widgets/doc/images/windowsxp-treeview.png b/src/widgets/doc/images/windowsxp-treeview.png
deleted file mode 100644
index 050cc2f4d6..0000000000
--- a/src/widgets/doc/images/windowsxp-treeview.png
+++ /dev/null
Binary files differ
diff --git a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
index dfea9f2ca4..bf727dd380 100644
--- a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
+++ b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc
@@ -1889,3 +1889,7 @@ QTableView::indicator:unchecked {
}
//! [161]
+//! [162]
+* { widget-animation-duration: 100 }
+//! [162]
+
diff --git a/src/widgets/doc/snippets/macmainwindow.mm b/src/widgets/doc/snippets/macmainwindow.mm
index d848e6442d..c63796a3f2 100644
--- a/src/widgets/doc/snippets/macmainwindow.mm
+++ b/src/widgets/doc/snippets/macmainwindow.mm
@@ -43,8 +43,6 @@
#if 0 // Used to be included in Qt4 for Q_WS_MAC
-#include <Carbon/Carbon.h>
-
//![0]
SearchWidget::SearchWidget(QWidget *parent)
: QMacCocoaViewContainer(0, parent)
diff --git a/src/widgets/doc/src/qtwidgets-index.qdoc b/src/widgets/doc/src/qtwidgets-index.qdoc
index 9f9a25140b..c05b16a0a0 100644
--- a/src/widgets/doc/src/qtwidgets-index.qdoc
+++ b/src/widgets/doc/src/qtwidgets-index.qdoc
@@ -83,7 +83,7 @@ interfaces
\table
\row
- \li \image windowsxp-tabwidget.png
+ \li \image windowsvista-tabwidget.png
\li \image fusion-tabwidget.png
\li \image macos-tabwidget.png
\endtable
@@ -118,7 +118,7 @@ interfaces
which use lists and tables are structured to separate the data and view
using models, views, and delegates.
- \image windowsxp-treeview.png
+ \image windowsvista-treeview.png
\section1 Graphics View
diff --git a/src/widgets/doc/src/widgets-and-layouts/gallery.qdoc b/src/widgets/doc/src/widgets-and-layouts/gallery.qdoc
index 5076970854..a82462a432 100644
--- a/src/widgets/doc/src/widgets-and-layouts/gallery.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/gallery.qdoc
@@ -41,10 +41,6 @@
\table
\row
- \li \image windows-xp-style.png Windows XP Style
- \li The Windows XP style ("windowsxp") is provided by
- QWindowsXPStyle.
- \row
\li The Windows style ("windows") is provided by QWindowsStyle.
\li \image windows-style.png Windows Style
\row
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index 6745b78898..be6a068d65 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -80,7 +80,7 @@
the QPalette::Button role to red for a QPushButton to obtain a
red push button. However, this wasn't guaranteed to work for all
styles, because style authors are restricted by the different
- platforms' guidelines and (on Windows XP and \macos) by the
+ platforms' guidelines and (on Windows and \macos) by the
native theme engine.
Style sheets let you perform all kinds of customizations that are
@@ -111,10 +111,8 @@
will.
\table
- \row \li \inlineimage stylesheet-coffee-xp.png
- \li \inlineimage stylesheet-pagefold.png
- \row \li Coffee theme running on Windows XP
- \li Pagefold theme running on Windows XP
+ \row \li \inlineimage stylesheet-pagefold.png
+ \row \li Pagefold theme running on Windows
\endtable
\table
@@ -128,7 +126,7 @@
is a wrapper "style sheet" style, \e not the platform-specific style. The
wrapper style ensures that any active style sheet is respected and
otherwise forwards the drawing operations to the underlying,
- platform-specific style (e.g., QWindowsXPStyle on Windows XP).
+ platform-specific style (e.g., QWindowsVistaStyle on Windows).
Since Qt 4.5, Qt style sheets fully supports \macos.
@@ -1793,8 +1791,9 @@
a QMessageBox. The possible values are 0
(\l{QDialogButtonBox::}{WinLayout}), 1
(\l{QDialogButtonBox::}{MacLayout}), 2
- (\l{QDialogButtonBox::}{KdeLayout}), and 3
- (\l{QDialogButtonBox::}{GnomeLayout}).
+ (\l{QDialogButtonBox::}{KdeLayout}), 3
+ (\l{QDialogButtonBox::}{GnomeLayout}) and 5
+ (\l{QDialogButtonBox::}{AndroidLayout}).
If this property is not specified, it defaults to the
value specified by the current style for the
@@ -2434,6 +2433,28 @@
\l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin}.
\row
+ \li \b{\c titlebar-show-tooltips-on-buttons}}
+ \target titlebar-show-tooltips-on-buttons-prop
+ \li \c bool
+ \li Whether tool tips are shown on window title bar buttons.
+
+ \row
+ \li \b{\c widget-animation-duration*} \target widget-animation-duration
+ \li \l{#Number}{Number}
+ \li How much an animation should last (in milliseconds).
+ A value equal to zero means that the animations will be disabled.
+
+ If this property is not specified, it defaults to the
+ value specified by the current style for the
+ \l{QStyle::}{SH_Widget_Animation_Duration} style hint.
+
+ \b{This property was added in Qt 5.10.}
+
+ Example:
+
+ \snippet code/doc_src_stylesheet.qdoc 162
+
+ \row
\li \b{\c text-align} \target text-align-prop
\li \l{#Alignment}{Alignment}
\li The alignment of text and icon within the contents of the widget.
@@ -3525,7 +3546,7 @@
\list
\li We have made a request that cannot be satisfied using the
- native styles alone (e.g., the Windows XP theme engine doesn't
+ native styles alone (e.g., the Windows Vista theme engine doesn't
let us specify the background color of a button).
\li Therefore, the button is rendered using style sheets.
\li We haven't specified any values for
diff --git a/src/widgets/doc/src/widgets-and-layouts/widgets.qdoc b/src/widgets/doc/src/widgets-and-layouts/widgets.qdoc
index a444d5358c..700a4479fd 100644
--- a/src/widgets/doc/src/widgets-and-layouts/widgets.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/widgets.qdoc
@@ -62,7 +62,7 @@
\table
\row
- \li \image windowsxp-treeview.png
+ \li \image windowsvista-treeview.png
\li \image fusion-calendarwidget.png
\li \image qundoview.png
\endtable
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 4b7890e9ff..1cc8543fdd 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -284,6 +284,7 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
#include <QtCore/qscopedvaluerollback.h>
#include <QtWidgets/qapplication.h>
#include <QtWidgets/qdesktopwidget.h>
+#include <private/qdesktopwidget_p.h>
#include <QtGui/qevent.h>
#include <QtWidgets/qlayout.h>
#include <QtGui/qtransform.h>
@@ -1248,7 +1249,7 @@ QSize QGraphicsView::sizeHint() const
if (d->scene) {
QSizeF baseSize = d->matrix.mapRect(sceneRect()).size();
baseSize += QSizeF(d->frameWidth * 2, d->frameWidth * 2);
- return baseSize.boundedTo((3 * QApplication::desktop()->size()) / 4).toSize();
+ return baseSize.boundedTo((3 * QDesktopWidgetPrivate::size()) / 4).toSize();
}
return QAbstractScrollArea::sizeHint();
}
diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp
index 8feed29a8f..c913e210b9 100644
--- a/src/widgets/graphicsview/qgraphicswidget_p.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp
@@ -50,9 +50,6 @@
#include <QtWidgets/qstyleoption.h>
#include <QtWidgets/QStyleOptionTitleBar>
#include <QtWidgets/QGraphicsSceneMouseEvent>
-#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac)
-# include <private/qmacstyle_mac_p.h>
-#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 25587a281d..ed87de4e18 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -2254,7 +2254,7 @@ void QAbstractItemView::focusInEvent(QFocusEvent *event)
/*!
This function is called with the given \a event when the widget
- looses the focus. By default, the event is ignored.
+ loses the focus. By default, the event is ignored.
\sa clearFocus(), focusInEvent()
*/
@@ -3134,7 +3134,7 @@ int QAbstractItemView::sizeHintForColumn(int column) const
Opens a persistent editor on the item at the given \a index.
If no editor exists, the delegate will create a new editor.
- \sa closePersistentEditor()
+ \sa closePersistentEditor(), isPersistentEditorOpen()
*/
void QAbstractItemView::openPersistentEditor(const QModelIndex &index)
{
@@ -3153,7 +3153,7 @@ void QAbstractItemView::openPersistentEditor(const QModelIndex &index)
/*!
Closes the persistent editor for the item at the given \a index.
- \sa openPersistentEditor()
+ \sa openPersistentEditor(), isPersistentEditorOpen()
*/
void QAbstractItemView::closePersistentEditor(const QModelIndex &index)
{
@@ -3168,6 +3168,19 @@ void QAbstractItemView::closePersistentEditor(const QModelIndex &index)
}
/*!
+ \since 5.10
+
+ Returns whether a persistent editor is open for the item at index \a index.
+
+ \sa openPersistentEditor(), closePersistentEditor()
+*/
+bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex &index) const
+{
+ Q_D(const QAbstractItemView);
+ return d->editorForIndex(index).widget;
+}
+
+/*!
\since 4.1
Sets the given \a widget on the item at the given \a index, passing the
@@ -4416,8 +4429,7 @@ QItemViewPaintPairs QAbstractItemViewPrivate::draggablePaintPairs(const QModelIn
for (const auto &index : indexes) {
const QRect current = q->visualRect(index);
if (current.intersects(viewportRect)) {
- QItemViewPaintPair p = { current, index };
- ret += p;
+ ret.append({current, index});
rect |= current;
}
}
diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h
index 6be776ec52..6a007da348 100644
--- a/src/widgets/itemviews/qabstractitemview.h
+++ b/src/widgets/itemviews/qabstractitemview.h
@@ -212,6 +212,7 @@ public:
void openPersistentEditor(const QModelIndex &index);
void closePersistentEditor(const QModelIndex &index);
+ bool isPersistentEditorOpen(const QModelIndex &index) const;
void setIndexWidget(const QModelIndex &index, QWidget *widget);
QWidget *indexWidget(const QModelIndex &index) const;
diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp
index ea9bbb0fb9..d94f25de78 100644
--- a/src/widgets/itemviews/qcolumnview.cpp
+++ b/src/widgets/itemviews/qcolumnview.cpp
@@ -53,8 +53,6 @@
QT_BEGIN_NAMESPACE
-#define ANIMATION_DURATION_MSEC 150
-
/*!
\since 4.3
\class QColumnView
@@ -107,7 +105,6 @@ void QColumnViewPrivate::initialize()
q->setTextElideMode(Qt::ElideMiddle);
#ifndef QT_NO_ANIMATION
QObject::connect(&currentAnimation, SIGNAL(finished()), q, SLOT(_q_changeCurrentColumn()));
- currentAnimation.setDuration(ANIMATION_DURATION_MSEC);
currentAnimation.setTargetObject(hbar);
currentAnimation.setPropertyName("value");
currentAnimation.setEasingCurve(QEasingCurve::InOutQuad);
@@ -330,7 +327,8 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint)
}
#ifndef QT_NO_ANIMATION
- if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
+ if (const int animationDuration = style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, this)) {
+ d->currentAnimation.setDuration(animationDuration);
d->currentAnimation.setEndValue(newScrollbarValue);
d->currentAnimation.start();
} else
diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp
index 2cf76262e6..449850c42e 100644
--- a/src/widgets/itemviews/qdirmodel.cpp
+++ b/src/widgets/itemviews/qdirmodel.cpp
@@ -1309,22 +1309,7 @@ QString QDirModelPrivate::size(const QModelIndex &index) const
// Nautilus - "9 items" (the number of children)
}
- // According to the Si standard KB is 1000 bytes, KiB is 1024
- // but on windows sizes are calulated by dividing by 1024 so we do what they do.
- const quint64 kb = 1024;
- const quint64 mb = 1024 * kb;
- const quint64 gb = 1024 * mb;
- const quint64 tb = 1024 * gb;
- quint64 bytes = n->info.size();
- if (bytes >= tb)
- return QFileSystemModel::tr("%1 TB").arg(QLocale().toString(qreal(bytes) / tb, 'f', 3));
- if (bytes >= gb)
- return QFileSystemModel::tr("%1 GB").arg(QLocale().toString(qreal(bytes) / gb, 'f', 2));
- if (bytes >= mb)
- return QFileSystemModel::tr("%1 MB").arg(QLocale().toString(qreal(bytes) / mb, 'f', 1));
- if (bytes >= kb)
- return QFileSystemModel::tr("%1 KB").arg(QLocale().toString(bytes / kb));
- return QFileSystemModel::tr("%1 byte(s)").arg(QLocale().toString(bytes));
+ return QLocale::system().formattedDataSize(n->info.size());
}
QString QDirModelPrivate::type(const QModelIndex &index) const
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 213cc96b03..d6db7deee7 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2531,8 +2531,20 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
if (handle != -1 && (sectionResizeMode(handle) == Interactive)) {
if (!hasCursor)
setCursor(d->orientation == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor);
- } else if (hasCursor) {
- unsetCursor();
+ } else {
+ if (hasCursor)
+ unsetCursor();
+#ifndef QT_NO_STATUSTIP
+ int logical = logicalIndexAt(pos);
+ QString statusTip;
+ if (logical != -1)
+ statusTip = d->model->headerData(logical, d->orientation, Qt::StatusTipRole).toString();
+ if (d->shouldClearStatusTip || !statusTip.isEmpty()) {
+ QStatusTipEvent tip(statusTip);
+ QCoreApplication::sendEvent(d->parent, &tip);
+ d->shouldClearStatusTip = !statusTip.isEmpty();
+ }
+#endif // !QT_NO_STATUSTIP
}
#endif
return;
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 68c02e9edb..d9caebec8a 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -988,7 +988,7 @@ QPixmap *QItemDelegate::selected(const QPixmap &pixmap, const QPalette &palette,
painter.end();
QPixmap selected = QPixmap(QPixmap::fromImage(img));
- int n = (img.byteCount() >> 10) + 1;
+ int n = (img.sizeInBytes() >> 10) + 1;
if (QPixmapCache::cacheLimit() < n)
QPixmapCache::setCacheLimit(n);
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 9e959c8e1e..0efee755a2 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -657,8 +657,7 @@ QItemViewPaintPairs QListViewPrivate::draggablePaintPairs(const QModelIndexList
for (const auto &index : indexes) {
if (std::binary_search(visibleIndexes.cbegin(), visibleIndexes.cend(), index)) {
const QRect current = q->visualRect(index);
- QItemViewPaintPair p = { current, index };
- ret += p;
+ ret.append({current, index});
rect |= current;
}
}
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 21747d4e6e..95ad3f82d0 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -1616,7 +1616,7 @@ void QListWidget::editItem(QListWidgetItem *item)
Opens an editor for the given \a item. The editor remains open after
editing.
- \sa closePersistentEditor()
+ \sa closePersistentEditor(), isPersistentEditorOpen()
*/
void QListWidget::openPersistentEditor(QListWidgetItem *item)
{
@@ -1628,7 +1628,7 @@ void QListWidget::openPersistentEditor(QListWidgetItem *item)
/*!
Closes the persistent editor for the given \a item.
- \sa openPersistentEditor()
+ \sa openPersistentEditor(), isPersistentEditorOpen()
*/
void QListWidget::closePersistentEditor(QListWidgetItem *item)
{
@@ -1638,6 +1638,20 @@ void QListWidget::closePersistentEditor(QListWidgetItem *item)
}
/*!
+ \since 5.10
+
+ Returns whether a persistent editor is open for item \a item.
+
+ \sa openPersistentEditor(), closePersistentEditor()
+*/
+bool QListWidget::isPersistentEditorOpen(QListWidgetItem *item) const
+{
+ Q_D(const QListWidget);
+ const QModelIndex index = d->listModel()->index(item);
+ return QAbstractItemView::isPersistentEditorOpen(index);
+}
+
+/*!
\since 4.1
Returns the widget displayed in the given \a item.
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index 8471645fb0..50f4e2ac84 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -239,6 +239,8 @@ public:
void editItem(QListWidgetItem *item);
void openPersistentEditor(QListWidgetItem *item);
void closePersistentEditor(QListWidgetItem *item);
+ using QAbstractItemView::isPersistentEditorOpen;
+ bool isPersistentEditorOpen(QListWidgetItem *item) const;
QWidget *itemWidget(QListWidgetItem *item) const;
void setItemWidget(QListWidgetItem *item, QWidget *widget);
@@ -251,6 +253,9 @@ public:
bool isItemHidden(const QListWidgetItem *item) const;
void setItemHidden(const QListWidgetItem *item, bool hide);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+protected:
+#endif
#if QT_CONFIG(draganddrop)
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
#endif
@@ -284,6 +289,12 @@ protected:
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
virtual Qt::DropActions supportedDropActions() const;
#endif
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+public:
+#else
+protected:
+#endif
QList<QListWidgetItem*> items(const QMimeData *data) const;
QModelIndex indexFromItem(QListWidgetItem *item) const;
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 3ff75cc23b..bb1970e3ac 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -2220,7 +2220,7 @@ void QTableWidget::editItem(QTableWidgetItem *item)
/*!
Opens an editor for the give \a item. The editor remains open after editing.
- \sa closePersistentEditor()
+ \sa closePersistentEditor(), isPersistentEditorOpen()
*/
void QTableWidget::openPersistentEditor(QTableWidgetItem *item)
{
@@ -2234,7 +2234,7 @@ void QTableWidget::openPersistentEditor(QTableWidgetItem *item)
/*!
Closes the persistent editor for \a item.
- \sa openPersistentEditor()
+ \sa openPersistentEditor(), isPersistentEditorOpen()
*/
void QTableWidget::closePersistentEditor(QTableWidgetItem *item)
{
@@ -2246,6 +2246,20 @@ void QTableWidget::closePersistentEditor(QTableWidgetItem *item)
}
/*!
+ \since 5.10
+
+ Returns whether a persistent editor is open for item \a item.
+
+ \sa openPersistentEditor(), closePersistentEditor()
+*/
+bool QTableWidget::isPersistentEditorOpen(QTableWidgetItem *item) const
+{
+ Q_D(const QTableWidget);
+ const QModelIndex index = d->tableModel()->index(item);
+ return QAbstractItemView::isPersistentEditorOpen(index);
+}
+
+/*!
\since 4.1
Returns the widget displayed in the cell in the given \a row and \a column.
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index 3fecf194e4..9c231d5127 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -261,6 +261,8 @@ public:
void editItem(QTableWidgetItem *item);
void openPersistentEditor(QTableWidgetItem *item);
void closePersistentEditor(QTableWidgetItem *item);
+ using QAbstractItemView::isPersistentEditorOpen;
+ bool isPersistentEditorOpen(QTableWidgetItem *item) const;
QWidget *cellWidget(int row, int column) const;
void setCellWidget(int row, int column, QWidget *widget);
@@ -325,10 +327,18 @@ protected:
#endif
virtual bool dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action);
virtual Qt::DropActions supportedDropActions() const;
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+public:
+#else
+protected:
+#endif
QList<QTableWidgetItem*> items(const QMimeData *data) const;
QModelIndex indexFromItem(QTableWidgetItem *item) const;
QTableWidgetItem *itemFromIndex(const QModelIndex &index) const;
+
+protected:
#if QT_CONFIG(draganddrop)
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
#endif
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 2abb1a9c14..61721143ef 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -3043,7 +3043,7 @@ void QTreeViewPrivate::initialize()
header->setDefaultAlignment(Qt::AlignLeft|Qt::AlignVCenter);
q->setHeader(header);
#ifndef QT_NO_ANIMATION
- animationsEnabled = q->style()->styleHint(QStyle::SH_Widget_Animate, 0, q);
+ animationsEnabled = q->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, q) > 0;
QObject::connect(&animatedOperation, SIGNAL(finished()), q, SLOT(_q_endAnimatedOperation()));
#endif //QT_NO_ANIMATION
}
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 337089056d..d7b46a0835 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2906,7 +2906,7 @@ void QTreeWidget::editItem(QTreeWidgetItem *item, int column)
/*!
Opens a persistent editor for the \a item in the given \a column.
- \sa closePersistentEditor()
+ \sa closePersistentEditor(), isPersistentEditorOpen()
*/
void QTreeWidget::openPersistentEditor(QTreeWidgetItem *item, int column)
@@ -2921,7 +2921,7 @@ void QTreeWidget::openPersistentEditor(QTreeWidgetItem *item, int column)
This function has no effect if no persistent editor is open for this
combination of item and column.
- \sa openPersistentEditor()
+ \sa openPersistentEditor(), isPersistentEditorOpen()
*/
void QTreeWidget::closePersistentEditor(QTreeWidgetItem *item, int column)
@@ -2931,6 +2931,21 @@ void QTreeWidget::closePersistentEditor(QTreeWidgetItem *item, int column)
}
/*!
+ \since 5.10
+
+ Returns whether a persistent editor is open for item \a item in
+ column \a column.
+
+ \sa openPersistentEditor(), closePersistentEditor()
+*/
+
+bool QTreeWidget::isPersistentEditorOpen(QTreeWidgetItem *item, int column) const
+{
+ Q_D(const QTreeWidget);
+ return QAbstractItemView::isPersistentEditorOpen(d->index(item, column));
+}
+
+/*!
\since 4.1
Returns the widget displayed in the cell specified by \a item and the given \a column.
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index 3bdeae08d8..783627cde9 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -299,6 +299,8 @@ public:
void editItem(QTreeWidgetItem *item, int column = 0);
void openPersistentEditor(QTreeWidgetItem *item, int column = 0);
void closePersistentEditor(QTreeWidgetItem *item, int column = 0);
+ using QAbstractItemView::isPersistentEditorOpen;
+ bool isPersistentEditorOpen(QTreeWidgetItem *item, int column = 0) const;
QWidget *itemWidget(QTreeWidgetItem *item, int column) const;
void setItemWidget(QTreeWidgetItem *item, int column, QWidget *widget);
@@ -354,11 +356,19 @@ protected:
virtual bool dropMimeData(QTreeWidgetItem *parent, int index,
const QMimeData *data, Qt::DropAction action);
virtual Qt::DropActions supportedDropActions() const;
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+public:
+#else
+protected:
+#endif
QList<QTreeWidgetItem*> items(const QMimeData *data) const;
QModelIndex indexFromItem(const QTreeWidgetItem *item, int column = 0) const;
QModelIndex indexFromItem(QTreeWidgetItem *item, int column = 0) const; // ### Qt 6: remove
QTreeWidgetItem *itemFromIndex(const QModelIndex &index) const;
+
+protected:
#if QT_CONFIG(draganddrop)
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
#endif
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 002ca68720..a7116b1462 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -45,6 +45,7 @@
#include "qapplication.h"
#include "qevent.h"
#include "qlist.h"
+#include "qstylehints.h"
#include <private/qshortcutmap_p.h>
#include <private/qapplication_p.h>
#include <private/qmenu_p.h>
@@ -75,6 +76,7 @@ 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)
{
@@ -1278,8 +1280,7 @@ void QAction::setIconVisibleInMenu(bool visible)
d->iconVisibleInMenu = visible;
// Only send data changed if we really need to.
if (oldValue != -1
- || (oldValue == -1
- && visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))) {
+ || visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus)) {
d->sendDataChanged();
}
}
@@ -1294,6 +1295,46 @@ bool QAction::isIconVisibleInMenu() const
return d->iconVisibleInMenu;
}
+/*!
+ \property QAction::shortcutVisibleInContextMenu
+ \brief Whether or not an action should show a shortcut in a context menu
+ \since 5.10
+
+ In some applications, it may make sense to have actions with shortcuts in
+ context menus. If true, the shortcut (if valid) is shown when the action is
+ shown via a context menu, when it is false, it is not shown.
+
+ The default is to follow whether the Qt::AA_DontShowShortcutsInContextMenus attribute
+ is set for the application, falling back to the widget style hint.
+ Explicitly setting this property overrides the presence (or abscence) of the attribute.
+
+ \sa QAction::shortcut, QCoreApplication::setAttribute()
+*/
+void QAction::setShortcutVisibleInContextMenu(bool visible)
+{
+ Q_D(QAction);
+ if (d->shortcutVisibleInContextMenu == -1 || visible != bool(d->shortcutVisibleInContextMenu)) {
+ int oldValue = d->shortcutVisibleInContextMenu;
+ d->shortcutVisibleInContextMenu = visible;
+ // Only send data changed if we really need to.
+ if (oldValue != -1
+ || visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowShortcutsInContextMenus)) {
+ d->sendDataChanged();
+ }
+ }
+}
+
+bool QAction::isShortcutVisibleInContextMenu() const
+{
+ Q_D(const QAction);
+ if (d->shortcutVisibleInContextMenu == -1) {
+ if (QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))
+ return false;
+ return qApp->styleHints()->showShortcutsInContextMenus();
+ }
+ return d->shortcutVisibleInContextMenu;
+}
+
#ifndef QT_NO_DEBUG_STREAM
Q_WIDGETS_EXPORT QDebug operator<<(QDebug d, const QAction *action)
{
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h
index 7dc4419d8e..ca127ef51a 100644
--- a/src/widgets/kernel/qaction.h
+++ b/src/widgets/kernel/qaction.h
@@ -80,6 +80,7 @@ class Q_WIDGETS_EXPORT QAction : public QObject
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed)
Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed)
Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed)
+ Q_PROPERTY(bool shortcutVisibleInContextMenu READ isShortcutVisibleInContextMenu WRITE setShortcutVisibleInContextMenu NOTIFY changed)
Q_PROPERTY(Priority priority READ priority WRITE setPriority)
public:
@@ -168,6 +169,8 @@ public:
void setIconVisibleInMenu(bool visible);
bool isIconVisibleInMenu() const;
+ void setShortcutVisibleInContextMenu(bool show);
+ bool isShortcutVisibleInContextMenu() const;
QWidget *parentWidget() const;
diff --git a/src/widgets/kernel/qaction_p.h b/src/widgets/kernel/qaction_p.h
index 45394e0b52..4c1537b63b 100644
--- a/src/widgets/kernel/qaction_p.h
+++ b/src/widgets/kernel/qaction_p.h
@@ -107,7 +107,8 @@ public:
uint separator : 1;
uint fontSet : 1;
- int iconVisibleInMenu : 3; // Only has values -1, 0, and 1
+ 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;
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 26e9ffbbf0..ee61a25b09 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1236,7 +1236,7 @@ void QApplication::setStyle(QStyle *style)
Requests a QStyle object for \a style from the QStyleFactory.
The string must be one of the QStyleFactory::keys(), typically one of
- "windows", "fusion", "windowsxp", or "macintosh". Style
+ "windows", "windowsvista", "fusion", or "macintosh". Style
names are case insensitive.
Returns 0 if an unknown \a style is passed, otherwise the QStyle object
@@ -1479,8 +1479,8 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
"selection-background-color" and "alternate-background-color".
\note Some styles do not use the palette for all drawing, for instance, if
- they make use of native theme engines. This is the case for the Windows XP,
- Windows Vista, and \macos styles.
+ they make use of native theme engines. This is the case for the
+ Windows Vista and \macos styles.
\sa QWidget::setPalette(), palette(), QStyle::polish()
*/
@@ -2735,7 +2735,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
case enter/leave events are genereated by the underlying windowing system.
*/
extern QPointer<QWidget> qt_last_mouse_receiver;
-extern QWidget *qt_button_down;
+extern Q_WIDGETS_EXPORT QWidget *qt_button_down;
void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget)
{
#ifndef QT_NO_CURSOR
@@ -2964,6 +2964,9 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
// required in order to support Qt Test synthesized events. Real mouse
// and keyboard state updates from the platform plugin are managed by
// QGuiApplicationPrivate::process(Mouse|Wheel|Key|Touch|Tablet)Event();
+ // ### FIXME: Qt Test should not call qapp->notify(), but rather route
+ // the events through the proper QPA interface. This is required to
+ // properly generate all other events such as enter/leave etc.
switch (e->type()) {
case QEvent::MouseButtonPress:
{
@@ -3760,7 +3763,6 @@ static void grabForPopup(QWidget *popup)
}
}
-extern QWidget *qt_button_down;
extern QWidget *qt_popup_down;
extern bool qt_replay_popup_mouse_event;
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 36de3cacaa..5dca2e85f1 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -92,7 +92,7 @@ extern QClipboard *qt_clipboard;
#endif
typedef QHash<QByteArray, QFont> FontHash;
-FontHash *qt_app_fonts_hash();
+Q_WIDGETS_EXPORT FontHash *qt_app_fonts_hash();
typedef QHash<QByteArray, QPalette> PaletteHash;
PaletteHash *qt_app_palettes_hash();
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index f2e3df5314..588cec2b95 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -873,15 +873,9 @@ void QBoxLayout::insertSpacing(int index, int size)
else
b = QLayoutPrivate::createSpacerItem(this, 0, size, QSizePolicy::Minimum, QSizePolicy::Fixed);
- QT_TRY {
- QBoxLayoutItem *it = new QBoxLayoutItem(b);
- it->magic = true;
- d->list.insert(index, it);
-
- } QT_CATCH(...) {
- delete b;
- QT_RETHROW;
- }
+ QBoxLayoutItem *it = new QBoxLayoutItem(b);
+ it->magic = true;
+ d->list.insert(index, it);
invalidate();
}
@@ -985,20 +979,8 @@ void QBoxLayout::insertWidget(int index, QWidget *widget, int stretch,
QWidgetItem *b = QLayoutPrivate::createWidgetItem(this, widget);
b->setAlignment(alignment);
- QBoxLayoutItem *it;
- QT_TRY{
- it = new QBoxLayoutItem(b, stretch);
- } QT_CATCH(...) {
- delete b;
- QT_RETHROW;
- }
-
- QT_TRY{
- d->list.insert(index, it);
- } QT_CATCH(...) {
- delete it;
- QT_RETHROW;
- }
+ QBoxLayoutItem *it = new QBoxLayoutItem(b, stretch);
+ d->list.insert(index, it);
invalidate();
}
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp
index 1e6fbfd239..6077ac38db 100644
--- a/src/widgets/kernel/qdesktopwidget.cpp
+++ b/src/widgets/kernel/qdesktopwidget.cpp
@@ -73,6 +73,11 @@ int QDesktopScreenWidget::screenNumber() const
const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const
{
+ return QDesktopWidgetPrivate::screenGeometry(widget);
+}
+
+const QRect QDesktopWidgetPrivate::screenGeometry(const QWidget *widget)
+{
if (Q_UNLIKELY(!widget)) {
qWarning("QDesktopWidget::screenGeometry(): Attempt "
"to get the screen geometry of a null widget");
@@ -86,6 +91,11 @@ const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const
const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const
{
+ return QDesktopWidgetPrivate::availableGeometry(widget);
+}
+
+const QRect QDesktopWidgetPrivate::availableGeometry(const QWidget *widget)
+{
if (Q_UNLIKELY(!widget)) {
qWarning("QDesktopWidget::availableGeometry(): Attempt "
"to get the available geometry of a null widget");
@@ -195,16 +205,51 @@ QDesktopWidget::~QDesktopWidget()
bool QDesktopWidget::isVirtualDesktop() const
{
+ return QDesktopWidgetPrivate::isVirtualDesktop();
+}
+
+bool QDesktopWidgetPrivate::isVirtualDesktop()
+{
return QGuiApplication::primaryScreen()->virtualSiblings().size() > 1;
}
+QRect QDesktopWidgetPrivate::geometry()
+{
+ return QGuiApplication::primaryScreen()->virtualGeometry();
+}
+
+QSize QDesktopWidgetPrivate::size()
+{
+ return geometry().size();
+}
+
+int QDesktopWidgetPrivate::width()
+{
+ return geometry().width();
+}
+
+int QDesktopWidgetPrivate::height()
+{
+ return geometry().height();
+}
+
int QDesktopWidget::primaryScreen() const
{
+ return QDesktopWidgetPrivate::primaryScreen();
+}
+
+int QDesktopWidgetPrivate::primaryScreen()
+{
return 0;
}
int QDesktopWidget::numScreens() const
{
+ return QDesktopWidgetPrivate::numScreens();
+}
+
+int QDesktopWidgetPrivate::numScreens()
+{
return qMax(QGuiApplication::screens().size(), 1);
}
@@ -218,6 +263,11 @@ QWidget *QDesktopWidget::screen(int screen)
const QRect QDesktopWidget::availableGeometry(int screenNo) const
{
+ return QDesktopWidgetPrivate::availableGeometry(screenNo);
+}
+
+const QRect QDesktopWidgetPrivate::availableGeometry(int screenNo)
+{
QList<QScreen *> screens = QGuiApplication::screens();
if (screenNo == -1)
screenNo = 0;
@@ -229,6 +279,11 @@ const QRect QDesktopWidget::availableGeometry(int screenNo) const
const QRect QDesktopWidget::screenGeometry(int screenNo) const
{
+ return QDesktopWidgetPrivate::screenGeometry(screenNo);
+}
+
+const QRect QDesktopWidgetPrivate::screenGeometry(int screenNo)
+{
QList<QScreen *> screens = QGuiApplication::screens();
if (screenNo == -1)
screenNo = 0;
@@ -240,6 +295,11 @@ const QRect QDesktopWidget::screenGeometry(int screenNo) const
int QDesktopWidget::screenNumber(const QWidget *w) const
{
+ return QDesktopWidgetPrivate::screenNumber(w);
+}
+
+int QDesktopWidgetPrivate::screenNumber(const QWidget *w)
+{
if (!w)
return primaryScreen();
@@ -287,6 +347,11 @@ int QDesktopWidget::screenNumber(const QWidget *w) const
int QDesktopWidget::screenNumber(const QPoint &p) const
{
+ return QDesktopWidgetPrivate::screenNumber(p);
+}
+
+int QDesktopWidgetPrivate::screenNumber(const QPoint &p)
+{
const QList<QScreen *> screens = QGuiApplication::screens();
if (!screens.isEmpty()) {
const QList<QScreen *> primaryScreens = screens.first()->virtualSiblings();
diff --git a/src/widgets/kernel/qdesktopwidget.qdoc b/src/widgets/kernel/qdesktopwidget.qdoc
index 27d05ece8c..fdf6a27597 100644
--- a/src/widgets/kernel/qdesktopwidget.qdoc
+++ b/src/widgets/kernel/qdesktopwidget.qdoc
@@ -152,7 +152,7 @@
on \macos, or the task bar on Windows). The default screen is used if
\a screen is -1.
- \sa screenNumber(), screenGeometry()
+ \sa screenNumber(), screenGeometry(), QScreen::availableGeometry()
*/
/*!
diff --git a/src/widgets/kernel/qdesktopwidget_p.h b/src/widgets/kernel/qdesktopwidget_p.h
index dade4fe45e..7a66661771 100644
--- a/src/widgets/kernel/qdesktopwidget_p.h
+++ b/src/widgets/kernel/qdesktopwidget_p.h
@@ -87,6 +87,29 @@ public:
void _q_availableGeometryChanged();
QDesktopScreenWidget *widgetForScreen(QScreen *qScreen) const;
+ static bool isVirtualDesktop();
+
+ static QRect geometry();
+ static QSize size();
+ static int width();
+ static int height();
+
+ static int numScreens();
+ static int primaryScreen();
+
+ static int screenNumber(const QWidget *widget = nullptr);
+ static int screenNumber(const QPoint &);
+
+ static const QRect screenGeometry(int screen = -1);
+ static const QRect screenGeometry(const QWidget *widget);
+ static const QRect screenGeometry(const QPoint &point)
+ { return screenGeometry(screenNumber(point)); }
+
+ static const QRect availableGeometry(int screen = -1);
+ static const QRect availableGeometry(const QWidget *widget);
+ static const QRect availableGeometry(const QPoint &point)
+ { return availableGeometry(screenNumber(point)); }
+
QList<QDesktopScreenWidget *> screens;
};
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 2873703cb7..fca36c7472 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -124,7 +124,7 @@ QGestureManager::~QGestureManager()
Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *recognizer)
{
- QGesture *dummy = recognizer->create(0);
+ const QScopedPointer<QGesture> dummy(recognizer->create(nullptr));
if (Q_UNLIKELY(!dummy)) {
qWarning("QGestureManager::registerGestureRecognizer: "
"the recognizer fails to create a gesture object, skipping registration.");
@@ -137,7 +137,6 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
type = Qt::GestureType(m_lastCustomGestureId);
}
m_recognizers.insertMulti(type, recognizer);
- delete dummy;
return type;
}
@@ -145,10 +144,9 @@ void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
{
QList<QGestureRecognizer *> list = m_recognizers.values(type);
while (QGestureRecognizer *recognizer = m_recognizers.take(type)) {
- if (!m_obsoleteGestures.contains(recognizer)) {
- // inserting even an empty QSet will cause the recognizer to be deleted on destruction of the manager
- m_obsoleteGestures.insert(recognizer, QSet<QGesture *>());
- }
+ // ensuring an entry exists causes the recognizer to be deleted on destruction of the manager
+ auto &gestures = m_obsoleteGestures[recognizer];
+ Q_UNUSED(gestures);
}
foreach (QGesture *g, m_gestureToRecognizer.keys()) {
QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g);
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 218d3c4a46..5bc408a8cd 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -567,7 +567,8 @@ public:
paintDevice(0),
updateBehavior(QOpenGLWidget::NoPartialUpdate),
requestedSamples(0),
- inPaintGL(false)
+ inPaintGL(false),
+ textureFormat(0)
{
requestedFormat = QSurfaceFormat::defaultFormat();
}
@@ -576,6 +577,7 @@ public:
void recreateFbo();
GLuint textureId() const Q_DECL_OVERRIDE;
+ QPlatformTextureList::Flags textureListFlags() Q_DECL_OVERRIDE;
void initialize();
void invokeUserPaint();
@@ -606,6 +608,7 @@ public:
QOpenGLWidget::UpdateBehavior updateBehavior;
int requestedSamples;
bool inPaintGL;
+ GLenum textureFormat;
};
void QOpenGLWidgetPaintDevicePrivate::beginPaint()
@@ -663,6 +666,35 @@ GLuint QOpenGLWidgetPrivate::textureId() const
return resolvedFbo ? resolvedFbo->texture() : (fbo ? fbo->texture() : 0);
}
+#ifndef GL_SRGB
+#define GL_SRGB 0x8C40
+#endif
+#ifndef GL_SRGB8
+#define GL_SRGB8 0x8C41
+#endif
+#ifndef GL_SRGB_ALPHA
+#define GL_SRGB_ALPHA 0x8C42
+#endif
+#ifndef GL_SRGB8_ALPHA8
+#define GL_SRGB8_ALPHA8 0x8C43
+#endif
+
+QPlatformTextureList::Flags QOpenGLWidgetPrivate::textureListFlags()
+{
+ QPlatformTextureList::Flags flags = QWidgetPrivate::textureListFlags();
+ switch (textureFormat) {
+ case GL_SRGB:
+ case GL_SRGB8:
+ case GL_SRGB_ALPHA:
+ case GL_SRGB8_ALPHA8:
+ flags |= QPlatformTextureList::TextureIsSrgb;
+ break;
+ default:
+ break;
+ }
+ return flags;
+}
+
void QOpenGLWidgetPrivate::reset()
{
Q_Q(QOpenGLWidget);
@@ -712,12 +744,16 @@ void QOpenGLWidgetPrivate::recreateFbo()
QOpenGLFramebufferObjectFormat format;
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setSamples(samples);
+ if (textureFormat)
+ format.setInternalTextureFormat(textureFormat);
const QSize deviceSize = q->size() * q->devicePixelRatioF();
fbo = new QOpenGLFramebufferObject(deviceSize, format);
if (samples > 0)
resolvedFbo = new QOpenGLFramebufferObject(deviceSize);
+ textureFormat = fbo->format().internalTextureFormat();
+
fbo->bind();
context->functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -755,10 +791,8 @@ void QOpenGLWidgetPrivate::initialize()
// texture usable by the underlying window's backingstore.
QWidget *tlw = q->window();
QOpenGLContext *shareContext = get(tlw)->shareContext();
- if (Q_UNLIKELY(!shareContext)) {
- qWarning("QOpenGLWidget: Cannot be used without a context shared with the toplevel.");
- return;
- }
+ // If shareContext is null, showing content on-screen will not work.
+ // However, offscreen rendering and grabFramebuffer() will stay fully functional.
// Do not include the sample count. Requesting a multisampled context is not necessary
// since we render into an FBO, never to an actual surface. What's more, attempting to
@@ -768,25 +802,31 @@ void QOpenGLWidgetPrivate::initialize()
requestedFormat.setSamples(0);
QScopedPointer<QOpenGLContext> ctx(new QOpenGLContext);
- ctx->setShareContext(shareContext);
ctx->setFormat(requestedFormat);
- ctx->setScreen(shareContext->screen());
+ if (shareContext) {
+ ctx->setShareContext(shareContext);
+ ctx->setScreen(shareContext->screen());
+ }
if (Q_UNLIKELY(!ctx->create())) {
qWarning("QOpenGLWidget: Failed to create context");
return;
}
- // Propagate settings that make sense only for the tlw.
- QSurfaceFormat tlwFormat = tlw->windowHandle()->format();
- if (requestedFormat.swapInterval() != tlwFormat.swapInterval()) {
- // Most platforms will pick up the changed swap interval on the next
- // makeCurrent or swapBuffers.
- tlwFormat.setSwapInterval(requestedFormat.swapInterval());
- tlw->windowHandle()->setFormat(tlwFormat);
- }
- if (requestedFormat.swapBehavior() != tlwFormat.swapBehavior()) {
- tlwFormat.setSwapBehavior(requestedFormat.swapBehavior());
- tlw->windowHandle()->setFormat(tlwFormat);
+ // Propagate settings that make sense only for the tlw. Note that this only
+ // makes sense for properties that get picked up even after the native
+ // window is created.
+ if (tlw->windowHandle()) {
+ QSurfaceFormat tlwFormat = tlw->windowHandle()->format();
+ if (requestedFormat.swapInterval() != tlwFormat.swapInterval()) {
+ // Most platforms will pick up the changed swap interval on the next
+ // makeCurrent or swapBuffers.
+ tlwFormat.setSwapInterval(requestedFormat.swapInterval());
+ tlw->windowHandle()->setFormat(tlwFormat);
+ }
+ if (requestedFormat.swapBehavior() != tlwFormat.swapBehavior()) {
+ tlwFormat.setSwapBehavior(requestedFormat.swapBehavior());
+ tlw->windowHandle()->setFormat(tlwFormat);
+ }
}
// The top-level window's surface is not good enough since it causes way too
@@ -880,9 +920,14 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_
QImage QOpenGLWidgetPrivate::grabFramebuffer()
{
Q_Q(QOpenGLWidget);
+
+ initialize();
if (!initialized)
return QImage();
+ if (!fbo) // could be completely offscreen, without ever getting a resize event
+ recreateFbo();
+
if (!inPaintGL)
render();
@@ -1000,7 +1045,6 @@ QOpenGLWidget::UpdateBehavior QOpenGLWidget::updateBehavior() const
*/
void QOpenGLWidget::setFormat(const QSurfaceFormat &format)
{
- Q_UNUSED(format);
Q_D(QOpenGLWidget);
if (Q_UNLIKELY(d->initialized)) {
qWarning("QOpenGLWidget: Already initialized, setting the format has no effect");
@@ -1033,6 +1077,47 @@ QSurfaceFormat QOpenGLWidget::format() const
}
/*!
+ Sets a custom internal texture format of \a texFormat.
+
+ When working with sRGB framebuffers, it will be necessary to specify a
+ format like \c{GL_SRGB8_ALPHA8}. This can be achieved by calling this
+ function.
+
+ \note This function has no effect if called after the widget has already
+ been shown and thus it performed initialization.
+
+ \note This function will typically have to be used in combination with a
+ QSurfaceFormat::setDefaultFormat() call that sets the color space to
+ QSurfaceFormat::sRGBColorSpace.
+
+ \since 5.10
+ */
+void QOpenGLWidget::setTextureFormat(GLenum texFormat)
+{
+ Q_D(QOpenGLWidget);
+ if (Q_UNLIKELY(d->initialized)) {
+ qWarning("QOpenGLWidget: Already initialized, setting the internal texture format has no effect");
+ return;
+ }
+
+ d->textureFormat = texFormat;
+}
+
+/*!
+ \return the active internal texture format if the widget has already
+ initialized, the requested format if one was set but the widget has not yet
+ been made visible, or 0 if setTextureFormat() was not called and the widget
+ has not yet been made visible.
+
+ \since 5.10
+ */
+GLenum QOpenGLWidget::textureFormat() const
+{
+ Q_D(const QOpenGLWidget);
+ return d->textureFormat;
+}
+
+/*!
\return \e true if the widget and OpenGL resources, like the context, have
been successfully initialized. Note that the return value is always false
until the widget is shown.
@@ -1293,7 +1378,7 @@ int QOpenGLWidget::metric(QPaintDevice::PaintDeviceMetric metric) const
if (window)
return int(window->devicePixelRatio() * devicePixelRatioFScale());
else
- return 1.0;
+ return int(devicePixelRatioFScale());
default:
qWarning("QOpenGLWidget::metric(): unknown metric %d", metric);
return 0;
@@ -1346,7 +1431,14 @@ bool QOpenGLWidget::event(QEvent *e)
break;
// FALLTHROUGH
case QEvent::Show: // reparenting may not lead to a resize so reinitalize on Show too
- if (!d->initialized && !size().isEmpty() && window() && window()->windowHandle()) {
+ if (d->initialized && window()->windowHandle()
+ && d->context->shareContext() != QWidgetPrivate::get(window())->shareContext())
+ {
+ // 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.
+ d->reset();
+ }
+ if (!d->initialized && !size().isEmpty() && window()->windowHandle()) {
d->initialize();
if (d->initialized)
d->recreateFbo();
diff --git a/src/widgets/kernel/qopenglwidget.h b/src/widgets/kernel/qopenglwidget.h
index b60d79bedb..c0a6e41522 100644
--- a/src/widgets/kernel/qopenglwidget.h
+++ b/src/widgets/kernel/qopenglwidget.h
@@ -72,6 +72,9 @@ public:
void setFormat(const QSurfaceFormat &format);
QSurfaceFormat format() const;
+ GLenum textureFormat() const;
+ void setTextureFormat(GLenum texFormat);
+
bool isValid() const;
void makeCurrent();
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index c2610131f3..80dc65e2d2 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -44,6 +44,7 @@
#include <qapplication.h>
#include <qdesktopwidget.h>
+#include <private/qdesktopwidget_p.h>
#include <qevent.h>
#include <qpointer.h>
#include <qstyle.h>
@@ -366,10 +367,10 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e)
int QTipLabel::getTipScreen(const QPoint &pos, QWidget *w)
{
- if (QApplication::desktop()->isVirtualDesktop())
- return QApplication::desktop()->screenNumber(pos);
+ if (QDesktopWidgetPrivate::isVirtualDesktop())
+ return QDesktopWidgetPrivate::screenNumber(pos);
else
- return QApplication::desktop()->screenNumber(w);
+ return QDesktopWidgetPrivate::screenNumber(w);
}
void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
@@ -399,11 +400,11 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
extern bool qt_mac_app_fullscreen; //qapplication_mac.mm
QRect screen;
if(qt_mac_app_fullscreen)
- screen = QApplication::desktop()->screenGeometry(getTipScreen(pos, w));
+ screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w));
else
- screen = QApplication::desktop()->availableGeometry(getTipScreen(pos, w));
+ screen = QDesktopWidgetPrivate::availableGeometry(getTipScreen(pos, w));
#else
- QRect screen = QApplication::desktop()->screenGeometry(getTipScreen(pos, w));
+ QRect screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w));
#endif
QPoint p = pos;
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index e2cfebb8a1..91d2b503e0 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -42,6 +42,7 @@
#include "qapplication.h"
#include <private/qguiapplication_p.h>
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qevent.h"
#include "qpixmap.h"
#include "qscreen.h"
@@ -209,7 +210,7 @@ QWhatsThat::QWhatsThat(const QString& txt, QWidget* parent, QWidget *showTextFor
}
else
{
- int sw = QApplication::desktop()->width() / 3;
+ int sw = QDesktopWidgetPrivate::width() / 3;
if (sw < 200)
sw = 200;
else if (sw > 300)
@@ -582,14 +583,14 @@ void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y)
// okay, now to find a suitable location
int scr = (widget ?
- QApplication::desktop()->screenNumber(widget) :
+ QDesktopWidgetPrivate::screenNumber(widget) :
#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR)
QCursor::x11Screen()
#else
- QApplication::desktop()->screenNumber(QPoint(x,y))
+ QDesktopWidgetPrivate::screenNumber(QPoint(x,y))
#endif
);
- QRect screen = QApplication::desktop()->screenGeometry(scr);
+ QRect screen = QDesktopWidgetPrivate::screenGeometry(scr);
int w = whatsThat->width();
int h = whatsThat->height();
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 415045a9f7..b8ec5774b0 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -67,7 +67,6 @@
# include <private/qmainwindowlayout_p.h>
#endif
#include <qpa/qplatformwindow.h>
-#include <qpa/qplatformbackingstore.h>
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
#include "qtooltip.h"
@@ -1118,9 +1117,12 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
}
if (customize)
; // don't modify window flags if the user explicitly set them.
- else if (type == Qt::Dialog || type == Qt::Sheet)
- flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint;
- else if (type == Qt::Tool)
+ else if (type == Qt::Dialog || type == Qt::Sheet) {
+ flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
+ // ### fixme: Qt 6: Never set Qt::WindowContextHelpButtonHint flag automatically
+ if (!QApplicationPrivate::testAttribute(Qt::AA_DisableWindowContextHelpButton))
+ flags |= Qt::WindowContextHelpButtonHint;
+ } else if (type == Qt::Tool)
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
else
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint |
@@ -1424,7 +1426,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (!q->testAttribute(Qt::WA_NativeWindow) && !q->isWindow())
return; // we only care about real toplevels
- QWindow *win = topData()->window;
+ QWidgetWindow *win = topData()->window;
// topData() ensures the extra is created but does not ensure 'window' is non-null
// in case the extra was already valid.
if (!win) {
@@ -1441,7 +1443,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (q->testAttribute(Qt::WA_ShowWithoutActivating))
win->setProperty("_q_showWithoutActivating", QVariant(true));
if (q->testAttribute(Qt::WA_MacAlwaysShowToolWindow))
- win->setProperty("_q_macAlwaysShowToolWindow", QVariant::fromValue(QVariant(true)));
+ win->setProperty("_q_macAlwaysShowToolWindow", QVariant(true));
setNetWmWindowTypes(true); // do nothing if none of WA_X11NetWmWindowType* is set
win->setFlags(data.window_flags);
fixPosIncludesFrame();
@@ -1455,7 +1457,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
topData()->initialScreenIndex = -1;
if (screenNumber < 0) {
screenNumber = q->windowType() != Qt::Desktop
- ? QApplication::desktop()->screenNumber(q) : 0;
+ ? QDesktopWidgetPrivate::screenNumber(q) : 0;
}
win->setScreen(QGuiApplication::screens().value(screenNumber, Q_NULLPTR));
}
@@ -1525,7 +1527,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
q->setAttribute(Qt::WA_OutsideWSRange, true);
} else if (q->isVisible()) {
// If widget is already shown, set window visible, too
- win->setVisible(true);
+ win->setNativeWindowVisibility(true);
}
}
@@ -2111,14 +2113,15 @@ QRegion QWidgetPrivate::clipRegion() const
return r;
}
-void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion &region)
+void QWidgetPrivate::setSystemClip(QPaintEngine *paintEngine, qreal devicePixelRatio, const QRegion &region)
{
// Transform the system clip region from device-independent pixels to device pixels
- QPaintEngine *paintEngine = paintDevice->paintEngine();
QTransform scaleTransform;
- const qreal devicePixelRatio = paintDevice->devicePixelRatioF();
scaleTransform.scale(devicePixelRatio, devicePixelRatio);
- paintEngine->d_func()->systemClip = scaleTransform.map(region);
+
+ paintEngine->d_func()->baseSystemClip = region;
+ paintEngine->d_func()->setSystemTransform(scaleTransform);
+
}
#if QT_CONFIG(graphicseffect)
@@ -2647,11 +2650,7 @@ WId QWidget::effectiveWinId() const
QWindow *QWidget::windowHandle() const
{
Q_D(const QWidget);
- QTLWExtra *extra = d->maybeTopData();
- if (extra)
- return extra->window;
-
- return 0;
+ return d->windowHandle();
}
#ifndef QT_NO_STYLE_STYLESHEET
@@ -3046,17 +3045,6 @@ void QWidget::overrideWindowState(Qt::WindowStates newstate)
QApplication::sendEvent(this, &e);
}
-Qt::WindowState effectiveState(Qt::WindowStates state)
-{
- if (state & Qt::WindowMinimized)
- return Qt::WindowMinimized;
- else if (state & Qt::WindowFullScreen)
- return Qt::WindowFullScreen;
- else if (state & Qt::WindowMaximized)
- return Qt::WindowMaximized;
- return Qt::WindowNoState;
-}
-
/*!
\fn void QWidget::setWindowState(Qt::WindowStates windowState)
@@ -3098,19 +3086,17 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
data->window_state = newstate;
data->in_set_window_state = 1;
- Qt::WindowState newEffectiveState = effectiveState(newstate);
- Qt::WindowState oldEffectiveState = effectiveState(oldstate);
- if (isWindow() && newEffectiveState != oldEffectiveState) {
+ if (isWindow()) {
// Ensure the initial size is valid, since we store it as normalGeometry below.
if (!testAttribute(Qt::WA_Resized) && !isVisible())
adjustSize();
d->createTLExtra();
- if (oldEffectiveState == Qt::WindowNoState)
+ if (!(oldstate & (Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen)))
d->topData()->normalGeometry = geometry();
Q_ASSERT(windowHandle());
- windowHandle()->setWindowState(newEffectiveState);
+ windowHandle()->setWindowStates(newstate & ~Qt::WindowActive);
}
data->in_set_window_state = 0;
@@ -4531,7 +4517,7 @@ void QWidget::setForegroundRole(QPalette::ColorRole role)
The default depends on the system environment. QApplication maintains a
system/theme palette which serves as a default for all widgets. There may
also be special palette defaults for certain types of widgets (e.g., on
- Windows XP and Vista, all classes that derive from QMenuBar have a special
+ Windows Vista, all classes that derive from QMenuBar have a special
default palette). You can also define default palettes for widgets
yourself by passing a custom palette and the name of a widget to
QApplication::setPalette(). Finally, the style always has the option of
@@ -4549,8 +4535,8 @@ void QWidget::setForegroundRole(QPalette::ColorRole role)
The current style, which is used to render the content of all standard Qt
widgets, is free to choose colors and brushes from the widget palette, or
in some cases, to ignore the palette (partially, or completely). In
- particular, certain styles like GTK style, Mac style, Windows XP, and
- Vista style, depend on third party APIs to render the content of widgets,
+ particular, certain styles like GTK style, Mac style, and Windows Vista
+ style, depend on third party APIs to render the content of widgets,
and these styles typically do not follow the palette. Because of this,
assigning roles to a widget's palette is not guaranteed to change the
appearance of the widget. Instead, you may choose to apply a \l
@@ -4712,7 +4698,7 @@ void QWidgetPrivate::updateSystemBackground()
The current style, which is used to render the content of all standard Qt
widgets, is free to choose to use the widget font, or in some cases, to
ignore it (partially, or completely). In particular, certain styles like
- GTK style, Mac style, Windows XP, and Vista style, apply special
+ GTK style, Mac style, and Windows Vista style, apply special
modifications to the widget font to match the platform's native look and
feel. Because of this, assigning properties to a widget's font is not
guaranteed to change the appearance of the widget. Instead, you may choose
@@ -5214,6 +5200,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
// Save current system clip, viewport and transform,
const QTransform oldTransform = enginePriv->systemTransform;
const QRegion oldSystemClip = enginePriv->systemClip;
+ const QRegion oldBaseClip = enginePriv->baseSystemClip;
const QRegion oldSystemViewport = enginePriv->systemViewport;
// This ensures that all painting triggered by render() is clipped to the current engine clip.
@@ -5227,9 +5214,8 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
d->render(target, targetOffset, toBePainted, renderFlags);
// Restore system clip, viewport and transform.
- enginePriv->setSystemViewport(oldSystemViewport);
- enginePriv->setSystemTransform(oldTransform);
- enginePriv->systemClip = oldSystemClip;
+ enginePriv->baseSystemClip = oldBaseClip;
+ enginePriv->setSystemTransformAndViewport(oldTransform, oldSystemViewport);
enginePriv->systemStateChanged();
// Restore shared painter.
@@ -5521,12 +5507,12 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, backingStore);
sourced->context = &context;
if (!sharedPainter) {
- setSystemClip(pdev, rgn.translated(offset));
+ setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), rgn.translated(offset));
QPainter p(pdev);
p.translate(offset);
context.painter = &p;
graphicsEffect->draw(&p);
- setSystemClip(pdev, QRegion());
+ setSystemClip(pdev->paintEngine(), 1, QRegion());
} else {
context.painter = sharedPainter;
if (sharedPainter->worldTransform() != sourced->lastEffectTransform) {
@@ -5535,7 +5521,9 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
}
sharedPainter->save();
sharedPainter->translate(offset);
+ setSystemClip(sharedPainter->paintEngine(), sharedPainter->device()->devicePixelRatioF(), rgn.translated(offset));
graphicsEffect->draw(sharedPainter);
+ setSystemClip(sharedPainter->paintEngine(), 1, QRegion());
sharedPainter->restore();
}
sourced->context = 0;
@@ -5587,7 +5575,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
#endif
if (sharedPainter)
- setSystemClip(pdev, toBePainted);
+ setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted);
else
paintEngine->d_func()->systemRect = q->data->crect;
@@ -5605,7 +5593,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
}
if (!sharedPainter)
- setSystemClip(pdev, toBePainted.translated(offset));
+ setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted.translated(offset));
if (!onScreen && !asRoot && !isOpaque && q->testAttribute(Qt::WA_TintedBackground)) {
#ifndef QT_NO_OPENGL
@@ -5675,7 +5663,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
else
paintEngine->d_func()->currentClipDevice = 0;
- setSystemClip(pdev, QRegion());
+ setSystemClip(pdev->paintEngine(), 1, QRegion());
}
q->setAttribute(Qt::WA_WState_InPaintEvent, false);
if (Q_UNLIKELY(q->paintingActive()))
@@ -7177,7 +7165,7 @@ void QWidgetPrivate::fixPosIncludesFrame()
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
te->posIncludesFrame = 0;
} else {
- if (q->windowHandle()) {
+ if (q->windowHandle() && q->windowHandle()->handle()) {
updateFrameStrut();
if (!q->data->fstrut_dirty) {
data.crect.translate(te->frameStrut.x(), te->frameStrut.y());
@@ -7379,7 +7367,7 @@ QByteArray QWidget::saveGeometry() const
// - Qt 4.8.6 - today, 5.4 - today: Version 2.0, save screen width in addition to check for high DPI scaling.
quint16 majorVersion = 2;
quint16 minorVersion = 0;
- const int screenNumber = QApplication::desktop()->screenNumber(this);
+ const int screenNumber = QDesktopWidgetPrivate::screenNumber(this);
stream << magicNumber
<< majorVersion
<< minorVersion
@@ -7393,7 +7381,7 @@ QByteArray QWidget::saveGeometry() const
<< qint32(screenNumber)
<< quint8(windowState() & Qt::WindowMaximized)
<< quint8(windowState() & Qt::WindowFullScreen)
- << qint32(QApplication::desktop()->screenGeometry(screenNumber).width()); // 1.1 onwards
+ << qint32(QDesktopWidgetPrivate::screenGeometry(screenNumber).width()); // 1.1 onwards
return array;
}
@@ -7459,10 +7447,9 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
if (majorVersion > 1)
stream >> restoredScreenWidth;
- const QDesktopWidget * const desktop = QApplication::desktop();
- if (restoredScreenNumber >= desktop->numScreens())
- restoredScreenNumber = desktop->primaryScreen();
- const qreal screenWidthF = qreal(desktop->screenGeometry(restoredScreenNumber).width());
+ if (restoredScreenNumber >= QDesktopWidgetPrivate::numScreens())
+ restoredScreenNumber = QDesktopWidgetPrivate::primaryScreen();
+ const qreal screenWidthF = qreal(QDesktopWidgetPrivate::screenGeometry(restoredScreenNumber).width());
// Sanity check bailing out when large variations of screen sizes occur due to
// high DPI scaling or different levels of DPI awareness.
if (restoredScreenWidth) {
@@ -7489,7 +7476,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
.expandedTo(d_func()->adjustedSize()));
}
- const QRect availableGeometry = desktop->availableGeometry(restoredScreenNumber);
+ const QRect availableGeometry = QDesktopWidgetPrivate::availableGeometry(restoredScreenNumber);
// Modify the restored geometry if we are about to restore to coordinates
// that would make the window "lost". This happens if:
@@ -7530,7 +7517,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
// Setting a geometry on an already maximized window causes this to be
// restored into a broken, half-maximized state, non-resizable state (QTBUG-4397).
// Move the window in normal state if needed.
- if (restoredScreenNumber != desktop->screenNumber(this)) {
+ if (restoredScreenNumber != QDesktopWidgetPrivate::screenNumber(this)) {
setWindowState(Qt::WindowNoState);
setGeometry(restoredNormalGeometry);
}
@@ -7983,7 +7970,7 @@ void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
- QWindow *window = q->windowHandle();
+ QWidgetWindow *window = windowHandle();
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
invalidateBuffer(q->rect());
@@ -8030,7 +8017,7 @@ void QWidgetPrivate::show_sys()
qt_qpa_set_cursor(q, false); // Needed in case cursor was set before show
#endif
invalidateBuffer(q->rect());
- window->setVisible(true);
+ window->setNativeWindowVisibility(true);
// Was the window moved by the Window system or QPlatformWindow::initialGeometry() ?
if (window->isTopLevel()) {
const QPoint crectTopLeft = q->data->crect.topLeft();
@@ -8122,7 +8109,7 @@ void QWidgetPrivate::hide_sys()
{
Q_Q(QWidget);
- QWindow *window = q->windowHandle();
+ QWidgetWindow *window = windowHandle();
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
q->setAttribute(Qt::WA_Mapped, false);
@@ -8152,7 +8139,7 @@ void QWidgetPrivate::hide_sys()
}
if (window)
- window->setVisible(false);
+ window->setNativeWindowVisibility(false);
}
/*!
@@ -8594,9 +8581,9 @@ QSize QWidgetPrivate::adjustedSize() const
if (exp & Qt::Vertical)
s.setHeight(qMax(s.height(), 100));
#if 0 // Used to be included in Qt4 for Q_WS_X11
- QRect screen = QApplication::desktop()->screenGeometry(q->x11Info().screen());
+ QRect screen = QDesktopWidgetPrivate::screenGeometry(q->x11Info().screen());
#else // all others
- QRect screen = QApplication::desktop()->screenGeometry(q->pos());
+ 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));
@@ -10029,6 +10016,7 @@ void QWidget::hideEvent(QHideEvent *)
\table
\header \li Platform \li Event Type Identifier \li Message Type \li Result Type
\row \li Windows \li "windows_generic_MSG" \li MSG * \li LRESULT
+ \row \li macOS \li "NSEvent" \li NSEvent * \li
\endtable
*/
@@ -10739,7 +10727,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
f |= Qt::Window;
if (targetScreen == -1) {
if (parent)
- targetScreen = QApplication::desktop()->screenNumber(q->parentWidget()->window());
+ targetScreen = QDesktopWidgetPrivate::screenNumber(q->parentWidget()->window());
}
}
@@ -12260,10 +12248,9 @@ QOpenGLContext *QWidgetPrivate::shareContext() const
#ifdef QT_NO_OPENGL
return 0;
#else
- if (Q_UNLIKELY(!extra || !extra->topextra || !extra->topextra->window)) {
- qWarning("Asking for share context for widget that does not have a window handle");
+ if (Q_UNLIKELY(!extra || !extra->topextra || !extra->topextra->window))
return 0;
- }
+
QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this);
if (!extra->topextra->shareContext) {
QOpenGLContext *ctx = new QOpenGLContext;
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index a24d13e0e1..f1eefd68dd 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -73,19 +73,20 @@
#include "QtWidgets/qgraphicsview.h"
#endif
#include <private/qgesture_p.h>
+#include <qpa/qplatformbackingstore.h>
QT_BEGIN_NAMESPACE
// 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 QGraphicsProxyWidget;
class QWidgetItemV2;
class QOpenGLContext;
-class QPlatformTextureList;
class QStyle;
@@ -164,7 +165,7 @@ struct QTLWExtra {
QWidgetBackingStoreTracker backingStoreTracker;
QBackingStore *backingStore;
QPainter *sharedPainter;
- QWindow *window;
+ QWidgetWindow *window;
QOpenGLContext *shareContext;
// Implicit pointers (shared_null).
@@ -342,6 +343,7 @@ public:
QPainter *sharedPainter() const;
void setSharedPainter(QPainter *painter);
QWidgetBackingStore *maybeBackingStore() const;
+ QWidgetWindow *windowHandle() const;
void init(QWidget *desktopWidget, Qt::WindowFlags f);
void create_sys(WId window, bool initializeWindow, bool destroyOldWindow);
void createRecursively();
@@ -413,7 +415,7 @@ public:
QRect clipRect() const;
QRegion clipRegion() const;
- void setSystemClip(QPaintDevice *paintDevice, const QRegion &region);
+ void setSystemClip(QPaintEngine *paintEngine, qreal devicePixelRatio, const QRegion &region);
void subtractOpaqueChildren(QRegion &rgn, const QRect &clipRect) const;
void subtractOpaqueSiblings(QRegion &source, bool *hasDirtySiblingsAbove = 0,
bool alsoNonOpaque = false) const;
@@ -634,6 +636,12 @@ public:
#ifndef QT_NO_OPENGL
virtual GLuint textureId() const { return 0; }
+ virtual QPlatformTextureList::Flags textureListFlags() {
+ Q_Q(QWidget);
+ return q->testAttribute(Qt::WA_AlwaysStackOnTop)
+ ? QPlatformTextureList::StacksOnTop
+ : QPlatformTextureList::Flags(0);
+ }
virtual QImage grabFramebuffer() { return QImage(); }
virtual void beginBackingStorePainting() { }
virtual void endBackingStorePainting() { }
@@ -985,6 +993,13 @@ inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const
return x ? x->backingStoreTracker.data() : 0;
}
+inline QWidgetWindow *QWidgetPrivate::windowHandle() const
+{
+ if (QTLWExtra *x = maybeTopData())
+ return x->window;
+ return nullptr;
+}
+
QT_END_NAMESPACE
#endif // QWIDGET_P_H
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 57564ce477..bb421927db 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -77,11 +77,10 @@ Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
/**
* Flushes the contents of the \a backingStore into the screen area of \a widget.
- * \a tlwOffset is the position of the top level widget relative to the window surface.
* \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, const QPoint &tlwOffset, QPlatformTextureList *widgetTextures,
+ QWidget *tlw, QPlatformTextureList *widgetTextures,
QWidgetBackingStore *widgetBackingStore)
{
#ifdef QT_NO_OPENGL
@@ -112,7 +111,7 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
}
}
- QPoint offset = tlwOffset;
+ QPoint offset;
if (widget != tlw)
offset += widget->mapTo(tlw, QPoint());
@@ -288,8 +287,7 @@ void QWidgetBackingStore::unflushPaint(QWidget *widget, const QRegion &rgn)
if (!tlwExtra)
return;
- const QPoint offset = widget->mapTo(tlw, QPoint());
- qt_flush(widget, rgn, tlwExtra->backingStoreTracker->store, tlw, offset, 0, tlw->d_func()->maybeBackingStore());
+ qt_flush(widget, rgn, tlwExtra->backingStoreTracker->store, tlw, 0, tlw->d_func()->maybeBackingStore());
}
#endif // QT_NO_PAINT_DEBUG
@@ -299,7 +297,7 @@ void QWidgetBackingStore::unflushPaint(QWidget *widget, const QRegion &rgn)
*/
bool QWidgetBackingStore::bltRect(const QRect &rect, int dx, int dy, QWidget *widget)
{
- const QPoint pos(tlwOffset + widget->mapTo(tlw, rect.topLeft()));
+ 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.
@@ -949,9 +947,7 @@ static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatfo
{
QWidgetPrivate *wd = QWidgetPrivate::get(widget);
if (wd->renderToTexture) {
- QPlatformTextureList::Flags flags = 0;
- if (widget->testAttribute(Qt::WA_AlwaysStackOnTop))
- flags |= QPlatformTextureList::StacksOnTop;
+ QPlatformTextureList::Flags flags = wd->textureListFlags();
const QRect rect(widget->mapTo(tlw, QPoint()), widget->size());
widgetTextures->appendTexture(widget, wd->textureId(), rect, wd->clipRect(), flags);
}
@@ -1123,7 +1119,7 @@ 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, tlwOffset, tl, this);
+ qt_flush(exposedWidget, tl ? QRegion() : exposedRegion, store, tlw, tl, this);
return;
}
@@ -1369,7 +1365,7 @@ void QWidgetBackingStore::doSync()
QRegion toBePainted(wd->dirty);
resetWidget(w);
- QPoint offset(tlwOffset);
+ QPoint offset;
if (w != tlw)
offset += w->mapTo(tlw, QPoint());
wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, 0, this);
@@ -1378,7 +1374,7 @@ void QWidgetBackingStore::doSync()
// Paint the rest with composition.
if (repaintAllWidgets || !dirtyCopy.isEmpty()) {
const int flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive;
- tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, tlwOffset, flags, 0, this);
+ tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, QPoint(), flags, 0, this);
}
endPaint(toClean, store, &beginPaintInfo);
@@ -1397,7 +1393,7 @@ void QWidgetBackingStore::flush(QWidget *widget)
// Flush the region in dirtyOnScreen.
if (!dirtyOnScreen.isEmpty()) {
QWidget *target = widget ? widget : tlw;
- qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset, widgetTexturesFor(tlw, tlw), this);
+ qt_flush(target, dirtyOnScreen, store, tlw, widgetTexturesFor(tlw, tlw), this);
dirtyOnScreen = QRegion();
flushed = true;
}
@@ -1409,7 +1405,7 @@ void QWidgetBackingStore::flush(QWidget *widget)
QPlatformTextureList *tl = widgetTexturesFor(tlw, tlw);
if (tl) {
QWidget *target = widget ? widget : tlw;
- qt_flush(target, QRegion(), store, tlw, tlwOffset, tl, this);
+ qt_flush(target, QRegion(), store, tlw, tl, this);
}
}
#endif
@@ -1423,7 +1419,7 @@ void QWidgetBackingStore::flush(QWidget *widget)
QWidgetPrivate *wd = w->d_func();
Q_ASSERT(wd->needsFlush);
QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : 0;
- qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset, widgetTexturesForNative, this);
+ qt_flush(w, *wd->needsFlush, store, tlw, widgetTexturesForNative, this);
*wd->needsFlush = QRegion();
}
dirtyOnScreenWidgets->clear();
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
index fa51cb71de..53ccda850a 100644
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ b/src/widgets/kernel/qwidgetbackingstore_p.h
@@ -111,8 +111,6 @@ public:
void sync();
void flush(QWidget *widget = 0);
- inline QPoint topLevelOffset() const { return tlwOffset; }
-
QBackingStore *backingStore() const { return store; }
inline bool isDirty() const
@@ -138,8 +136,6 @@ private:
QBackingStore *store;
uint updateRequestSent : 1;
- QPoint tlwOffset;
-
QPlatformTextureListWatcher *textureListWatcher;
QElapsedTimer perfTime;
int perfFrames;
@@ -149,7 +145,7 @@ private:
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, const QPoint &tlwOffset,
+ QWidget *tlw,
QPlatformTextureList *widgetTextures,
QWidgetBackingStore *widgetBackingStore);
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index abaebad821..d30154410c 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets();
-QWidget *qt_button_down = 0; // widget got last button-down
+Q_WIDGETS_EXPORT QWidget *qt_button_down = 0; // widget got last button-down
// popup control
QWidget *qt_popup_down = 0; // popup that contains the pressed widget
@@ -69,6 +69,15 @@ class QWidgetWindowPrivate : public QWindowPrivate
{
Q_DECLARE_PUBLIC(QWidgetWindow)
public:
+ void setVisible(bool visible) override
+ {
+ Q_Q(QWidgetWindow);
+ if (QWidget *widget = q->widget())
+ widget->setVisible(visible);
+ else
+ QWindowPrivate::setVisible(visible);
+ }
+
QWindow *eventReceiver() Q_DECL_OVERRIDE {
Q_Q(QWidgetWindow);
QWindow *w = q;
@@ -168,6 +177,15 @@ QObject *QWidgetWindow::focusObject() const
return widget;
}
+void QWidgetWindow::setNativeWindowVisibility(bool visible)
+{
+ Q_D(QWidgetWindow);
+ // Call base class setVisible() implementation to run the QWindow
+ // visibility logic. Don't call QWidgetWindowPrivate::setVisible()
+ // since that will recurse back into QWidget code.
+ d->QWindowPrivate::setVisible(visible);
+}
+
static inline bool shouldBePropagatedToWidget(QEvent *event)
{
switch (event->type()) {
@@ -194,7 +212,7 @@ bool QWidgetWindow::event(QEvent *event)
// generated before WA_DontShowOnScreen was set
if (!shouldBePropagatedToWidget(event))
return true;
- return QCoreApplication::sendEvent(m_widget, event);
+ return QCoreApplication::forwardEvent(m_widget, event);
}
switch (event->type()) {
@@ -226,7 +244,7 @@ bool QWidgetWindow::event(QEvent *event)
if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled))
QGuiApplication::inputMethod()->commit();
- QGuiApplication::sendSpontaneousEvent(QApplicationPrivate::focus_widget, event);
+ QGuiApplication::forwardEvent(QApplicationPrivate::focus_widget, event);
}
return true;
@@ -295,7 +313,7 @@ bool QWidgetWindow::event(QEvent *event)
case QEvent::ThemeChange: {
QEvent widgetEvent(QEvent::ThemeChange);
- QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent);
+ QCoreApplication::forwardEvent(m_widget, &widgetEvent, event);
}
return true;
@@ -333,7 +351,7 @@ bool QWidgetWindow::event(QEvent *event)
break;
}
- if (shouldBePropagatedToWidget(event) && QCoreApplication::sendEvent(m_widget, event))
+ if (shouldBePropagatedToWidget(event) && QCoreApplication::forwardEvent(m_widget, event))
return true;
return QWindow::event(event);
@@ -442,7 +460,7 @@ void QWidgetWindow::handleFocusInEvent(QFocusEvent *e)
void QWidgetWindow::handleNonClientAreaMouseEvent(QMouseEvent *e)
{
- QApplication::sendSpontaneousEvent(m_widget, e);
+ QApplication::forwardEvent(m_widget, e);
}
void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
@@ -509,12 +527,15 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
}
}
#endif
-
- QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(),
- event->button(), event->buttons(), event->modifiers(), event->source());
- e.setTimestamp(event->timestamp());
- QApplicationPrivate::sendMouseEvent(receiver, &e, receiver, receiver->window(), &qt_button_down, qt_last_mouse_receiver);
- qt_last_mouse_receiver = receiver;
+ if ((event->type() != QEvent::MouseButtonPress)
+ || !(event->flags().testFlag(Qt::MouseEventCreatedDoubleClick))) {
+
+ QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(),
+ event->button(), event->buttons(), event->modifiers(), event->source());
+ e.setTimestamp(event->timestamp());
+ QApplicationPrivate::sendMouseEvent(receiver, &e, receiver, receiver->window(), &qt_button_down, qt_last_mouse_receiver);
+ qt_last_mouse_receiver = receiver;
+ }
} else {
// close disabled popups when a mouse button is pressed or released
switch (event->type()) {
@@ -567,13 +588,13 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
} else if (event->type() == contextMenuTrigger
&& event->button() == Qt::RightButton
&& (openPopupCount == oldOpenPopupCount)) {
- QWidget *popupEvent = activePopupWidget;
+ QWidget *receiver = activePopupWidget;
if (qt_button_down)
- popupEvent = qt_button_down;
+ receiver = qt_button_down;
else if(popupChild)
- popupEvent = popupChild;
+ receiver = popupChild;
QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers());
- QApplication::sendSpontaneousEvent(popupEvent, &e);
+ QApplication::forwardEvent(receiver, &e, event);
}
#else
Q_UNUSED(contextMenuTrigger)
@@ -626,7 +647,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton
&& m_widget->rect().contains(event->pos())) {
QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers());
- QGuiApplication::sendSpontaneousEvent(receiver, &e);
+ QGuiApplication::forwardEvent(receiver, &e, event);
}
#endif
}
@@ -658,7 +679,7 @@ void QWidgetWindow::handleKeyEvent(QKeyEvent *event)
}
if (!receiver)
receiver = focusObject();
- QGuiApplication::sendSpontaneousEvent(receiver, event);
+ QGuiApplication::forwardEvent(receiver, event);
}
bool QWidgetWindow::updateSize()
@@ -730,8 +751,6 @@ void QWidgetWindow::repaintWindow()
QWidgetBackingStore::UpdateNow, QWidgetBackingStore::BufferInvalid);
}
-Qt::WindowState effectiveState(Qt::WindowStates state);
-
// Store normal geometry used for saving application settings.
void QWidgetWindow::updateNormalGeometry()
{
@@ -742,7 +761,7 @@ void QWidgetWindow::updateNormalGeometry()
QRect normalGeometry;
if (const QPlatformWindow *pw = handle())
normalGeometry = QHighDpi::fromNativePixels(pw->normalGeometry(), this);
- if (!normalGeometry.isValid() && effectiveState(m_widget->windowState()) == Qt::WindowNoState)
+ if (!normalGeometry.isValid() && !(m_widget->windowState() & ~Qt::WindowActive))
normalGeometry = m_widget->geometry();
if (normalGeometry.isValid())
tle->normalGeometry = normalGeometry;
@@ -751,7 +770,7 @@ void QWidgetWindow::updateNormalGeometry()
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
{
if (updatePos())
- QGuiApplication::sendSpontaneousEvent(m_widget, event);
+ QGuiApplication::forwardEvent(m_widget, event);
}
void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
@@ -759,7 +778,7 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
QSize oldSize = m_widget->data->crect.size();
if (updateSize()) {
- QGuiApplication::sendSpontaneousEvent(m_widget, event);
+ QGuiApplication::forwardEvent(m_widget, event);
if (m_widget->d_func()->paintOnScreen()) {
QRegion updateRegion(geometry());
@@ -805,7 +824,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
QPoint mapped = widget->mapFrom(rootWidget, pos);
QWheelEvent translated(mapped, event->globalPos(), event->pixelDelta(), event->angleDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers(), event->phase(), event->source(), event->inverted());
- QGuiApplication::sendSpontaneousEvent(widget, &translated);
+ QGuiApplication::forwardEvent(widget, &translated, event);
}
#endif // QT_CONFIG(wheelevent)
@@ -832,7 +851,7 @@ void QWidgetWindow::handleDragEnterMoveEvent(QDragMoveEvent *event)
translated.accept();
translated.setDropAction(event->dropAction());
}
- QGuiApplication::sendSpontaneousEvent(widget, &translated);
+ QGuiApplication::forwardEvent(widget, &translated, event);
if (translated.isAccepted()) {
event->accept();
} else {
@@ -844,7 +863,7 @@ void QWidgetWindow::handleDragEnterMoveEvent(QDragMoveEvent *event)
// Target widget changed: Send DragLeave to previous, DragEnter to new if there is any
if (m_dragTarget.data()) {
QDragLeaveEvent le;
- QGuiApplication::sendSpontaneousEvent(m_dragTarget.data(), &le);
+ QGuiApplication::forwardEvent(m_dragTarget.data(), &le, event);
m_dragTarget = 0;
}
if (!widget) {
@@ -854,7 +873,7 @@ void QWidgetWindow::handleDragEnterMoveEvent(QDragMoveEvent *event)
m_dragTarget = widget;
const QPoint mapped = widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()));
QDragEnterEvent translated(mapped, event->possibleActions(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
- QGuiApplication::sendSpontaneousEvent(widget, &translated);
+ QGuiApplication::forwardEvent(widget, &translated, event);
if (translated.isAccepted()) {
event->accept();
} else {
@@ -866,7 +885,7 @@ void QWidgetWindow::handleDragEnterMoveEvent(QDragMoveEvent *event)
void QWidgetWindow::handleDragLeaveEvent(QDragLeaveEvent *event)
{
if (m_dragTarget)
- QGuiApplication::sendSpontaneousEvent(m_dragTarget.data(), event);
+ QGuiApplication::forwardEvent(m_dragTarget.data(), event);
m_dragTarget = 0;
}
@@ -879,7 +898,7 @@ void QWidgetWindow::handleDropEvent(QDropEvent *event)
}
const QPoint mapped = m_dragTarget.data()->mapFromGlobal(m_widget->mapToGlobal(event->pos()));
QDropEvent translated(mapped, event->possibleActions(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
- QGuiApplication::sendSpontaneousEvent(m_dragTarget.data(), &translated);
+ QGuiApplication::forwardEvent(m_dragTarget.data(), &translated, event);
if (translated.isAccepted())
event->accept();
event->setDropAction(translated.dropAction());
@@ -902,7 +921,7 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
// ... and they haven't been shown by this function yet - show it.
wPriv->showChildren(true);
QShowEvent showEvent;
- QCoreApplication::sendSpontaneousEvent(m_widget, &showEvent);
+ QCoreApplication::forwardEvent(m_widget, &showEvent, event);
wPriv->childrenShownByExpose = true;
}
} else {
@@ -914,7 +933,7 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
// and then, the QPA can send next expose event with null exposed region (not exposed).
wPriv->hideChildren(true);
QHideEvent hideEvent;
- QCoreApplication::sendSpontaneousEvent(m_widget, &hideEvent);
+ QCoreApplication::forwardEvent(m_widget, &hideEvent, event);
wPriv->childrenShownByExpose = false;
}
}
@@ -934,30 +953,18 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
// QWindow does currently not know 'active'.
Qt::WindowStates eventState = event->oldState();
Qt::WindowStates widgetState = m_widget->windowState();
+ Qt::WindowStates windowState = windowStates();
if (widgetState & Qt::WindowActive)
eventState |= Qt::WindowActive;
// Determine the new widget state, remember maximized/full screen
// during minimized.
- switch (windowState()) {
- case Qt::WindowNoState:
- widgetState &= ~(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen);
- break;
- case Qt::WindowMinimized:
+ if (windowState & Qt::WindowMinimized) {
widgetState |= Qt::WindowMinimized;
- break;
- case Qt::WindowMaximized:
- updateNormalGeometry();
- widgetState |= Qt::WindowMaximized;
- widgetState &= ~(Qt::WindowMinimized | Qt::WindowFullScreen);
- break;
- case Qt::WindowFullScreen:
- updateNormalGeometry();
- widgetState |= Qt::WindowFullScreen;
- widgetState &= ~(Qt::WindowMinimized);
- break;
- case Qt::WindowActive: // Not handled by QWindow
- break;
+ } else {
+ widgetState = windowState | (widgetState & Qt::WindowActive);
+ if (windowState) // Maximized or FullScreen
+ updateNormalGeometry();
}
// Sent event if the state changed (that is, it is not triggered by
@@ -965,7 +972,7 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
if (widgetState != Qt::WindowStates::Int(m_widget->data->window_state)) {
m_widget->data->window_state = uint(widgetState);
QWindowStateChangeEvent widgetEvent(eventState);
- QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent);
+ QGuiApplication::forwardEvent(m_widget, &widgetEvent, event);
}
}
@@ -997,7 +1004,7 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
event->pressure(), event->xTilt(), event->yTilt(), event->tangentialPressure(),
event->rotation(), event->z(), event->modifiers(), event->uniqueId(), event->button(), event->buttons());
ev.setTimestamp(event->timestamp());
- QGuiApplication::sendSpontaneousEvent(widget, &ev);
+ QGuiApplication::forwardEvent(widget, &ev, event);
event->setAccepted(ev.isAccepted());
}
@@ -1021,7 +1028,7 @@ void QWidgetWindow::handleGestureEvent(QNativeGestureEvent *e)
if (!receiver)
receiver = m_widget; // last resort
- QApplication::sendSpontaneousEvent(receiver, e);
+ QApplication::forwardEvent(receiver, e);
}
#endif // QT_NO_GESTURES
@@ -1049,7 +1056,7 @@ void QWidgetWindow::handleContextMenuEvent(QContextMenuEvent *e)
QPoint pos = fw->inputMethodQuery(Qt::ImMicroFocus).toRect().center();
QContextMenuEvent widgetEvent(QContextMenuEvent::Keyboard, pos, fw->mapToGlobal(pos),
e->modifiers());
- QGuiApplication::sendSpontaneousEvent(fw, &widgetEvent);
+ QGuiApplication::forwardEvent(fw, &widgetEvent, e);
}
}
#endif // QT_NO_CONTEXTMENU
diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h
index 50a2cfd57c..be3f808a22 100644
--- a/src/widgets/kernel/qwidgetwindow_p.h
+++ b/src/widgets/kernel/qwidgetwindow_p.h
@@ -63,10 +63,12 @@ QT_BEGIN_NAMESPACE
class QCloseEvent;
class QMoveEvent;
+class QWidgetWindowPrivate;
class QWidgetWindow : public QWindow
{
Q_OBJECT
+ Q_DECLARE_PRIVATE(QWidgetWindow)
public:
QWidgetWindow(QWidget *widget);
~QWidgetWindow();
@@ -77,6 +79,7 @@ public:
#endif
QObject *focusObject() const Q_DECL_OVERRIDE;
+ void setNativeWindowVisibility(bool visible);
protected:
bool event(QEvent *) Q_DECL_OVERRIDE;
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index b64182c5ef..e509f522d8 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -337,6 +337,19 @@ bool QWindowContainer::event(QEvent *e)
e->accept();
return true;
#endif
+
+ case QEvent::Paint:
+ {
+ static bool needsPunch = !QGuiApplicationPrivate::platformIntegration()->hasCapability(
+ QPlatformIntegration::TopStackedNativeChildWindows);
+ if (needsPunch) {
+ QPainter p(this);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(rect(), Qt::transparent);
+ }
+ break;
+ }
+
default:
break;
}
diff --git a/src/widgets/styles/images/fusion_arrow.png b/src/widgets/styles/images/fusion_arrow.png
deleted file mode 100644
index d7945e7f76..0000000000
--- a/src/widgets/styles/images/fusion_arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 9a11e98032..1f3198907f 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -5260,6 +5260,8 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
break;
#endif
case SH_Widget_Animate:
+ // TODO Qt6: move this code in the SH_Widget_Animation_Duration case
+ // and replace false with 0 and true with 200.
#if QT_CONFIG(treeview)
if (qobject_cast<const QTreeView*>(widget)) {
ret = false;
@@ -5277,6 +5279,12 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = QAbstractItemView::ScrollPerItem;
break;
#endif
+ case SH_TitleBar_ShowToolTipsOnButtons:
+ ret = true;
+ break;
+ case SH_Widget_Animation_Duration:
+ ret = styleHint(SH_Widget_Animate, opt, widget, hret) ? 200 : 0;
+ break;
default:
ret = 0;
break;
diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h
index 9fb731239a..93db75ac2d 100644
--- a/src/widgets/styles/qcommonstyle_p.h
+++ b/src/widgets/styles/qcommonstyle_p.h
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
class QStringList;
// Private class
-class QCommonStylePrivate : public QStylePrivate
+class Q_WIDGETS_EXPORT QCommonStylePrivate : public QStylePrivate
{
Q_DECLARE_PUBLIC(QCommonStyle)
public:
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 6c400b4d2e..f20ffb0f92 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -202,55 +202,6 @@ static QColor mergedColors(const QColor &colorA, const QColor &colorB, int facto
return tmp;
}
-static QPixmap colorizedImage(const QString &fileName, const QColor &color, int rotation = 0) {
-
- QString pixmapName = QLatin1String("$qt_ia-") % fileName % HexString<uint>(color.rgba()) % QString::number(rotation);
- QPixmap pixmap;
- if (!QPixmapCache::find(pixmapName, pixmap)) {
- QImage image(fileName);
-
- if (image.format() != QImage::Format_ARGB32_Premultiplied)
- image = image.convertToFormat( QImage::Format_ARGB32_Premultiplied);
-
- int width = image.width();
- int height = image.height();
- int source = color.rgba();
-
- unsigned char sourceRed = qRed(source);
- unsigned char sourceGreen = qGreen(source);
- unsigned char sourceBlue = qBlue(source);
-
- for (int y = 0; y < height; ++y)
- {
- QRgb *data = (QRgb*) image.scanLine(y);
- for (int x = 0 ; x < width ; x++) {
- QRgb col = data[x];
- unsigned int colorDiff = (qBlue(col) - qRed(col));
- unsigned char gray = qGreen(col);
- unsigned char red = gray + qt_div_255(sourceRed * colorDiff);
- unsigned char green = gray + qt_div_255(sourceGreen * colorDiff);
- unsigned char blue = gray + qt_div_255(sourceBlue * colorDiff);
- unsigned char alpha = qt_div_255(qAlpha(col) * qAlpha(source));
- data[x] = qRgba(std::min(alpha, red),
- std::min(alpha, green),
- std::min(alpha, blue),
- alpha);
- }
- }
- if (rotation != 0) {
- QTransform transform;
- transform.translate(-image.width()/2, -image.height()/2);
- transform.rotate(rotation);
- transform.translate(image.width()/2, image.height()/2);
- image = image.transformed(transform);
- }
-
- pixmap = QPixmap::fromImage(image);
- QPixmapCache::insert(pixmapName, pixmap);
- }
- return pixmap;
-}
-
// The default button and handle gradient
static QLinearGradient qt_fusion_gradient(const QRect &rect, const QBrush &baseColor, Direction direction = TopDown)
{
@@ -288,6 +239,59 @@ static QLinearGradient qt_fusion_gradient(const QRect &rect, const QBrush &baseC
return gradient;
}
+static void qt_fusion_draw_arrow(Qt::ArrowType type, QPainter *painter, const QStyleOption *option, const QRect &rect, const QColor &color)
+{
+ const int arrowWidth = QStyleHelper::dpiScaled(14);
+ const int arrowHeight = QStyleHelper::dpiScaled(8);
+
+ const int arrowMax = qMin(arrowHeight, arrowWidth);
+ const int rectMax = qMin(rect.height(), rect.width());
+ const int size = qMin(arrowMax, rectMax);
+
+ QPixmap cachePixmap;
+ QString cacheKey = QStyleHelper::uniqueName(QLatin1String("fusion-arrow"), option, rect.size())
+ % HexString<uint>(type)
+ % HexString<uint>(color.rgba());
+ if (!QPixmapCache::find(cacheKey, cachePixmap)) {
+ cachePixmap = styleCachePixmap(rect.size());
+ cachePixmap.fill(Qt::transparent);
+ QPainter cachePainter(&cachePixmap);
+
+ QRectF arrowRect;
+ arrowRect.setWidth(size);
+ arrowRect.setHeight(arrowHeight * size / arrowWidth);
+ if (type == Qt::LeftArrow || type == Qt::RightArrow)
+ arrowRect = arrowRect.transposed();
+ arrowRect.moveTo((rect.width() - arrowRect.width()) / 2.0,
+ (rect.height() - arrowRect.height()) / 2.0);
+
+ QPolygonF triangle;
+ triangle.reserve(3);
+ switch (type) {
+ case Qt::DownArrow:
+ triangle << arrowRect.topLeft() << arrowRect.topRight() << QPointF(arrowRect.center().x(), arrowRect.bottom());
+ break;
+ case Qt::RightArrow:
+ triangle << arrowRect.topLeft() << arrowRect.bottomLeft() << QPointF(arrowRect.right(), arrowRect.center().y());
+ break;
+ case Qt::LeftArrow:
+ triangle << arrowRect.topRight() << arrowRect.bottomRight() << QPointF(arrowRect.left(), arrowRect.center().y());
+ break;
+ default:
+ triangle << arrowRect.bottomLeft() << arrowRect.bottomRight() << QPointF(arrowRect.center().x(), arrowRect.top());
+ break;
+ }
+
+ cachePainter.setPen(Qt::NoPen);
+ cachePainter.setBrush(color);
+ cachePainter.setRenderHint(QPainter::Antialiasing);
+ cachePainter.drawPolygon(triangle);
+
+ QPixmapCache::insert(cacheKey, cachePixmap);
+ }
+
+ painter->drawPixmap(rect, cachePixmap);
+}
static void qt_fusion_draw_mdibutton(QPainter *painter, const QStyleOptionTitleBar *option, const QRect &tmp, bool hover, bool sunken)
{
@@ -525,43 +529,22 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
if (option->rect.width() <= 1 || option->rect.height() <= 1)
break;
QColor arrowColor = option->palette.foreground().color();
- QPixmap arrow;
- int rotation = 0;
+ arrowColor.setAlpha(160);
+ Qt::ArrowType arrow = Qt::UpArrow;
switch (elem) {
case PE_IndicatorArrowDown:
- rotation = 180;
+ arrow = Qt::DownArrow;
break;
case PE_IndicatorArrowRight:
- rotation = 90;
+ arrow = Qt::RightArrow;
break;
case PE_IndicatorArrowLeft:
- rotation = -90;
+ arrow = Qt::LeftArrow;
break;
default:
break;
}
- arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation);
- if (arrow.isNull())
- break;
-
- QRect rect = option->rect;
- QRect arrowRect;
- int imageMax = qMin(arrow.height(), arrow.width());
- int rectMax = qMin(rect.height(), rect.width());
- int size = qMin(imageMax, rectMax);
-
- arrowRect.setWidth(size);
- arrowRect.setHeight(size);
- if (arrow.width() > arrow.height())
- arrowRect.setHeight(arrow.height() * size / arrow.width());
- else
- arrowRect.setWidth(arrow.width() * size / arrow.height());
-
- arrowRect.moveTopLeft(rect.center() - arrowRect.center());
- painter->save();
- painter->setRenderHint(QPainter::SmoothPixmapTransform);
- painter->drawPixmap(arrowRect, arrow);
- painter->restore();
+ qt_fusion_draw_arrow(arrow, painter, option, option->rect, arrowColor);
}
break;
case PE_IndicatorViewItemCheck:
@@ -575,29 +558,23 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
case PE_IndicatorHeaderArrow:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
QRect r = header->rect;
- QPixmap arrow;
QColor arrowColor = header->palette.foreground().color();
- QPoint offset = QPoint(0, -1);
+ arrowColor.setAlpha(180);
+ QPoint offset = QPoint(0, -2);
#if defined(Q_OS_LINUX)
if (header->sortIndicator & QStyleOptionHeader::SortUp) {
- arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor);
+ qt_fusion_draw_arrow(Qt::UpArrow, painter, option, r.translated(offset), arrowColor);
} else if (header->sortIndicator & QStyleOptionHeader::SortDown) {
- arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180);
+ qt_fusion_draw_arrow(Qt::DownArrow, painter, option, r.translated(offset), arrowColor);
}
#else
if (header->sortIndicator & QStyleOptionHeader::SortUp) {
- arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180);
+ qt_fusion_draw_arrow(Qt::DownArrow, painter, option, r.translated(offset), arrowColor);
} else if (header->sortIndicator & QStyleOptionHeader::SortDown) {
- arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor);
+ qt_fusion_draw_arrow(Qt::UpArrow, painter, option, r.translated(offset), arrowColor);
}
#endif
-
- if (!arrow.isNull()) {
- r.setSize(QSize(arrow.width()/2, arrow.height()/2));
- r.moveCenter(header->rect.center());
- painter->drawPixmap(r.translated(offset), arrow);
- }
}
break;
case PE_IndicatorButtonDropDown:
@@ -1545,17 +1522,18 @@ 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);
if (!menuItem->text.isEmpty()) {
painter->setFont(menuItem->font);
- proxy()->drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter,
+ proxy()->drawItemText(painter, menuItem->rect.adjusted(margin, 0, -margin, 0), Qt::AlignLeft | Qt::AlignVCenter,
menuItem->palette, menuItem->state & State_Enabled, menuItem->text,
QPalette::Text);
- w = menuItem->fontMetrics.width(menuItem->text) + 5;
+ w = menuItem->fontMetrics.width(menuItem->text) + margin;
}
painter->setPen(shadow.lighter(106));
bool reverse = menuItem->direction == Qt::RightToLeft;
- painter->drawLine(menuItem->rect.left() + 5 + (reverse ? 0 : w), menuItem->rect.center().y(),
- menuItem->rect.right() - 5 - (reverse ? w : 0), menuItem->rect.center().y());
+ painter->drawLine(menuItem->rect.left() + margin + (reverse ? 0 : w), menuItem->rect.center().y(),
+ menuItem->rect.right() - margin - (reverse ? w : 0), menuItem->rect.center().y());
painter->restore();
break;
}
@@ -1572,7 +1550,8 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
bool enabled = menuItem->state & State_Enabled;
bool ignoreCheckMark = false;
- int checkcol = qMax(menuItem->maxIconWidth, 20);
+ int checkcol = qMax<int>(menuItem->maxIconWidth, QStyleHelper::dpiScaled(20));
+ const int margin = QStyleHelper::dpiScaled(4);
if (
#if QT_CONFIG(combobox)
@@ -1583,7 +1562,10 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
if (!ignoreCheckMark) {
// Check
- QRect checkRect(option->rect.left() + 7, option->rect.center().y() - 6, 14, 14);
+ const int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget);
+ const int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget);
+ QRect checkRect(option->rect.left() + indicatorWidth / 2,
+ option->rect.center().y() - indicatorHeight / 2 + 1, indicatorWidth, indicatorHeight);
checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect);
if (checkable) {
if (menuItem->checkType & QStyleOptionMenuItem::Exclusive) {
@@ -1595,7 +1577,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
QPalette::ColorRole textRole = !enabled ? QPalette::Text:
selected ? QPalette::HighlightedText : QPalette::ButtonText;
painter->setBrush(option->palette.brush( option->palette.currentColorGroup(), textRole));
- painter->drawEllipse(checkRect.adjusted(4, 4, -4, -4));
+ painter->drawEllipse(checkRect.adjusted(margin, margin, -margin, -margin));
}
} else {
// Check box
@@ -1624,7 +1606,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
QPainter *p = painter;
QRect vCheckRect = visualRect(opt->direction, menuitem->rect,
- QRect(menuitem->rect.x() + 4, menuitem->rect.y(),
+ QRect(menuitem->rect.x() + margin, menuitem->rect.y(),
checkcol, menuitem->rect.height()));
if (!menuItem->icon.isNull()) {
QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;
@@ -1675,10 +1657,11 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
discol = menuitem->palette.text().color();
p->setPen(discol);
}
- int xm = windowsItemFrame + checkcol + windowsItemHMargin + 2;
- int xpos = menuitem->rect.x() + xm;
+ const int lm = QStyleHelper::dpiScaled(windowsItemFrame + windowsItemHMargin + 2) + checkcol;
+ const int rm = QStyleHelper::dpiScaled(windowsRightBorder + 1) + tab;
+ const int xpos = menuitem->rect.x() + lm;
- QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);
+ QRect textRect(xpos, y + windowsItemVMargin, w - lm - rm, h - 2 * windowsItemVMargin);
QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect);
QStringRef s(&menuitem->text);
if (!s.isEmpty()) { // draw text
@@ -2043,7 +2026,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
QRect r = rect.adjusted(0, 1, 0, -1);
QPainter cachePainter(&cache);
QColor arrowColor = spinBox->palette.foreground().color();
- arrowColor.setAlpha(220);
+ arrowColor.setAlpha(160);
bool isEnabled = (spinBox->state & State_Enabled);
bool hover = isEnabled && (spinBox->state & State_MouseOver);
@@ -2154,23 +2137,10 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
} else if (spinBox->buttonSymbols == QAbstractSpinBox::UpDownArrows){
// arrows
- painter->setRenderHint(QPainter::SmoothPixmapTransform);
-
- QPixmap upArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"),
- (spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) ? arrowColor : disabledColor);
-
- QRectF upArrowRect = QRectF(upRect.center().x() - upArrow.width() / 4.0 + 1.0,
- upRect.center().y() - upArrow.height() / 4.0 + 1.0,
- upArrow.width() / 2.0, upArrow.height() / 2.0);
-
- cachePainter.drawPixmap(upArrowRect, upArrow, QRectF(QPointF(0.0, 0.0), upArrow.size()));
-
- QPixmap downArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"),
- (spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) ? arrowColor : disabledColor, 180);
- QRectF downArrowRect = QRectF(downRect.center().x() - downArrow.width() / 4.0 + 1.0,
- downRect.center().y() - downArrow.height() / 4.0 + 1.0,
- downArrow.width() / 2.0, downArrow.height() / 2.0);
- cachePainter.drawPixmap(downArrowRect, downArrow, QRectF(QPointF(0.0, 0.0), downArrow.size()));
+ qt_fusion_draw_arrow(Qt::UpArrow, &cachePainter, option, upRect.adjusted(0, 0, 0, 1),
+ (spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) ? arrowColor : disabledColor);
+ qt_fusion_draw_arrow(Qt::DownArrow, &cachePainter, option, downRect,
+ (spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) ? arrowColor : disabledColor);
}
cachePainter.end();
@@ -2407,8 +2377,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
bool hover = (titleBar->activeSubControls & SC_TitleBarShadeButton) && (titleBar->state & State_MouseOver);
bool sunken = (titleBar->activeSubControls & SC_TitleBarShadeButton) && (titleBar->state & State_Sunken);
qt_fusion_draw_mdibutton(painter, titleBar, shadeButtonRect, hover, sunken);
- QPixmap arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), textColor);
- painter->drawPixmap(shadeButtonRect.adjusted(5, 7, -5, -7), arrow);
+ qt_fusion_draw_arrow(Qt::UpArrow, painter, option, shadeButtonRect.adjusted(5, 7, -5, -7), textColor);
}
}
@@ -2419,8 +2388,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
bool hover = (titleBar->activeSubControls & SC_TitleBarUnshadeButton) && (titleBar->state & State_MouseOver);
bool sunken = (titleBar->activeSubControls & SC_TitleBarUnshadeButton) && (titleBar->state & State_Sunken);
qt_fusion_draw_mdibutton(painter, titleBar, unshadeButtonRect, hover, sunken);
- QPixmap arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), textColor, 180);
- painter->drawPixmap(unshadeButtonRect.adjusted(5, 7, -5, -7), arrow);
+ qt_fusion_draw_arrow(Qt::DownArrow, painter, option, unshadeButtonRect.adjusted(5, 7, -5, -7), textColor);
}
}
@@ -2550,7 +2518,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
alphaOutline.setAlpha(180);
QColor arrowColor = option->palette.foreground().color();
- arrowColor.setAlpha(220);
+ arrowColor.setAlpha(160);
const QColor bgColor = QStyleHelper::backgroundColor(option->palette, widget);
const bool isDarkBg = bgColor.red() < 128 && bgColor.green() < 128 && bgColor.blue() < 128;
@@ -2694,20 +2662,16 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
painter->drawLine(pixmapRect.bottomLeft(), pixmapRect.bottomRight());
}
+ QRect upRect = scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, horizontal ? -2 : -1, horizontal ? -1 : -2);
painter->setBrush(Qt::NoBrush);
painter->setPen(d->innerContrastLine());
- painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0 , horizontal ? -2 : -1, horizontal ? -1 : -2));
+ painter->drawRect(upRect);
// Arrows
- int rotation = 0;
+ Qt::ArrowType arrowType = Qt::UpArrow;
if (option->state & State_Horizontal)
- rotation = option->direction == Qt::LeftToRight ? -90 : 90;
- QRect upRect = scrollBarSubLine.translated(horizontal ? -2 : -1, 0);
- QPixmap arrowPixmap = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation);
- painter->drawPixmap(QRectF(upRect.center().x() - arrowPixmap.width() / 4.0 + 2.0,
- upRect.center().y() - arrowPixmap.height() / 4.0 + 1.0,
- arrowPixmap.width() / 2.0, arrowPixmap.height() / 2.0),
- arrowPixmap, QRectF(QPoint(0.0, 0.0), arrowPixmap.size()));
+ arrowType = option->direction == Qt::LeftToRight ? Qt::LeftArrow : Qt::RightArrow;
+ qt_fusion_draw_arrow(arrowType, painter, option, upRect, arrowColor);
}
// The AddLine (down/right) button
@@ -2735,19 +2699,15 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
painter->drawLine(pixmapRect.topLeft(), pixmapRect.topRight());
}
+ QRect downRect = scrollBarAddLine.adjusted(1, 1, -1, -1);
painter->setPen(d->innerContrastLine());
painter->setBrush(Qt::NoBrush);
- painter->drawRect(scrollBarAddLine.adjusted(1, 1, -1, -1));
+ painter->drawRect(downRect);
- int rotation = 180;
+ Qt::ArrowType arrowType = Qt::DownArrow;
if (option->state & State_Horizontal)
- rotation = option->direction == Qt::LeftToRight ? 90 : -90;
- QRect downRect = scrollBarAddLine.translated(-1, 1);
- QPixmap arrowPixmap = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation);
- painter->drawPixmap(QRectF(downRect.center().x() - arrowPixmap.width() / 4.0 + 2.0,
- downRect.center().y() - arrowPixmap.height() / 4.0,
- arrowPixmap.width() / 2.0, arrowPixmap.height() / 2.0),
- arrowPixmap, QRectF(QPoint(0.0, 0.0), arrowPixmap.size()));
+ arrowType = option->direction == Qt::LeftToRight ? Qt::RightArrow : Qt::LeftArrow;
+ qt_fusion_draw_arrow(arrowType, painter, option, downRect, arrowColor);
}
}
@@ -2837,12 +2797,8 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
if (comboBox->subControls & SC_ComboBoxArrow) {
// Draw the up/down arrow
QColor arrowColor = option->palette.buttonText().color();
- arrowColor.setAlpha(220);
- QPixmap downArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180);
- cachePainter.drawPixmap(QRectF(downArrowRect.center().x() - downArrow.width() / 4.0 + 1.0,
- downArrowRect.center().y() - downArrow.height() / 4.0 + 1.0,
- downArrow.width() / 2.0, downArrow.height() / 2.0),
- downArrow, QRectF(QPointF(0.0, 0.0), downArrow.size()));
+ arrowColor.setAlpha(160);
+ qt_fusion_draw_arrow(Qt::DownArrow, &cachePainter, option, downArrowRect, arrowColor);
}
cachePainter.end();
QPixmapCache::insert(pixmapName, cache);
@@ -3246,7 +3202,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 * QFusionStylePrivate::menuArrowHMargin;
+ w += 2 * QStyleHelper::dpiScaled(QFusionStylePrivate::menuArrowHMargin);
else if (menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem) {
QFontMetrics fm(menuItem->font);
QFont fontBold = menuItem->font;
@@ -3254,9 +3210,9 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti
QFontMetrics fmBold(fontBold);
w += fmBold.width(menuItem->text) - fm.width(menuItem->text);
}
- int checkcol = qMax<int>(maxpmw, QFusionStylePrivate::menuCheckMarkWidth); // Windows always shows a check column
+ const int checkcol = qMax<int>(maxpmw, QStyleHelper::dpiScaled(QFusionStylePrivate::menuCheckMarkWidth)); // Windows always shows a check column
w += checkcol;
- w += int(QFusionStylePrivate::menuRightBorder) + 10;
+ w += QStyleHelper::dpiScaled(int(QFusionStylePrivate::menuRightBorder) + 10);
newSize.setWidth(w);
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
if (!menuItem->text.isEmpty()) {
@@ -3270,8 +3226,8 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti
}
#endif
}
- newSize.setWidth(newSize.width() + 12);
- newSize.setWidth(qMax(newSize.width(), 120));
+ newSize.setWidth(newSize.width() + QStyleHelper::dpiScaled(12));
+ newSize.setWidth(qMax<int>(newSize.width(), QStyleHelper::dpiScaled(120)));
}
break;
case CT_SizeGrip:
@@ -3534,8 +3490,8 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
switch (subControl) {
case SC_ComboBoxArrow:
rect = visualRect(option->direction, option->rect, rect);
- rect.setRect(rect.right() - 18, rect.top() - 2,
- 19, rect.height() + 4);
+ rect.setRect(rect.right() - QStyleHelper::dpiScaled(18), rect.top() - 2,
+ QStyleHelper::dpiScaled(19), rect.height() + 4);
rect = visualRect(option->direction, option->rect, rect);
break;
case SC_ComboBoxEditField: {
diff --git a/src/widgets/styles/qfusionstyle_p.h b/src/widgets/styles/qfusionstyle_p.h
index aac27e51ab..10f76045d5 100644
--- a/src/widgets/styles/qfusionstyle_p.h
+++ b/src/widgets/styles/qfusionstyle_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(style_fusion)
class QFusionStylePrivate;
-class QFusionStyle : public QCommonStyle
+class Q_WIDGETS_EXPORT QFusionStyle : public QCommonStyle
{
Q_OBJECT
Q_DECLARE_PRIVATE(QFusionStyle)
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 01d972af65..0350d5e1a5 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -1972,9 +1972,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
a tooltip is shown (notice: shown, not hidden). When a new wake isn't needed, a user-requested tooltip
will be shown nearly instantly.
- \value SH_Widget_Animate Determines if the widget should show animations or not, for example
- a transition between checked and unchecked statuses in a checkbox.
- This enum value has been introduced in Qt 5.2.
+ \value SH_Widget_Animate Deprecated. Use \l{SH_Widget_Animation_Duration} instead.
\value SH_Splitter_OpaqueResize Determines if resizing is opaque
This enum value has been introduced in Qt 5.2
@@ -1987,6 +1985,16 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
by the style. Can be overridden with QAbstractItemView::setVerticalScrollMode() and
QAbstractItemView::setHorizontalScrollMode(). This enum value has been introduced in Qt 5.7.
+ \value SH_TitleBar_ShowToolTipsOnButtons
+ Determines if tool tips are shown on window title bar buttons.
+ The Mac style, for example, sets this to false.
+ This enum value has been introduced in Qt 5.10.
+
+ \value SH_Widget_Animation_Duration
+ Determines how much an animation should last (in ms).
+ A value equal to zero means that the animations will be disabled.
+ This enum value has been introduced in Qt 5.10.
+
\sa styleHint()
*/
@@ -2286,8 +2294,8 @@ int QStyle::sliderValueFromPosition(int min, int max, int pos, int span, bool up
Returns the style's standard palette.
Note that on systems that support system colors, the style's
- standard palette is not used. In particular, the Windows XP,
- Vista, and Mac styles do not use the standard palette, but make
+ standard palette is not used. In particular, the Windows
+ Vista and Mac styles do not use the standard palette, but make
use of native theme engines. With these styles, you should not set
the palette with QApplication::setPalette().
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index ce33dbed62..b4936a3e0a 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -737,6 +737,8 @@ public:
SH_Menu_SubMenuResetWhenReenteringParent,
SH_Menu_SubMenuDontStartSloppyOnLeave,
SH_ItemView_ScrollMode,
+ SH_TitleBar_ShowToolTipsOnButtons,
+ SH_Widget_Animation_Duration,
// Add new style hint values here
SH_CustomBase = 0xf0000000
diff --git a/src/widgets/styles/qstyle.qrc b/src/widgets/styles/qstyle.qrc
index d8c73dd6fa..c2d200adc4 100644
--- a/src/widgets/styles/qstyle.qrc
+++ b/src/widgets/styles/qstyle.qrc
@@ -128,7 +128,6 @@
<file>images/media-volume-16.png</file>
<file>images/media-volume-muted-16.png</file>
<file>images/fusion_groupbox.png</file>
- <file>images/fusion_arrow.png</file>
</qresource>
<qresource prefix="/qt-project.org/styles/macstyle">
<file>images/closedock-16.png</file>
diff --git a/src/widgets/styles/qstyleanimation_p.h b/src/widgets/styles/qstyleanimation_p.h
index 3b10eeea27..bb1ab9d877 100644
--- a/src/widgets/styles/qstyleanimation_p.h
+++ b/src/widgets/styles/qstyleanimation_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
// We mean it.
//
-class QStyleAnimation : public QAbstractAnimation
+class Q_WIDGETS_EXPORT QStyleAnimation : public QAbstractAnimation
{
Q_OBJECT
@@ -83,7 +83,8 @@ public:
DefaultFps,
SixtyFps,
ThirtyFps,
- TwentyFps
+ TwentyFps,
+ FifteenFps
};
FrameRate frameRate() const;
@@ -106,7 +107,7 @@ private:
int _skip;
};
-class QProgressStyleAnimation : public QStyleAnimation
+class Q_WIDGETS_EXPORT QProgressStyleAnimation : public QStyleAnimation
{
Q_OBJECT
@@ -127,7 +128,7 @@ private:
mutable int _step;
};
-class QNumberStyleAnimation : public QStyleAnimation
+class Q_WIDGETS_EXPORT QNumberStyleAnimation : public QStyleAnimation
{
Q_OBJECT
@@ -151,7 +152,7 @@ private:
mutable qreal _prev;
};
-class QBlendStyleAnimation : public QStyleAnimation
+class Q_WIDGETS_EXPORT QBlendStyleAnimation : public QStyleAnimation
{
Q_OBJECT
@@ -178,7 +179,7 @@ private:
QImage _current;
};
-class QScrollbarStyleAnimation : public QNumberStyleAnimation
+class Q_WIDGETS_EXPORT QScrollbarStyleAnimation : public QNumberStyleAnimation
{
Q_OBJECT
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index 8dc603f8e6..c959994d2c 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -46,19 +46,6 @@
#include "qwindowsstyle_p.h"
#if QT_CONFIG(style_fusion)
#include "qfusionstyle_p.h"
-#if QT_CONFIG(style_android)
-#include "qandroidstyle_p.h"
-#endif
-#endif
-#if QT_CONFIG(style_windowsxp)
-#include "qwindowsxpstyle_p.h"
-#endif
-#if QT_CONFIG(style_windowsvista)
-#include "qwindowsvistastyle_p.h"
-#endif
-
-#if QT_CONFIG(style_mac)
-# include "qmacstyle_mac_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -81,7 +68,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
The valid keys can be retrieved using the keys()
function. Typically they include "windows" and "fusion".
- Depending on the platform, "windowsxp", "windowsvista"
+ Depending on the platform, "windowsvista"
and "macintosh" may be available.
Note that keys are case insensitive.
@@ -108,35 +95,11 @@ QStyle *QStyleFactory::create(const QString& key)
ret = new QWindowsStyle;
else
#endif
-#if QT_CONFIG(style_windowsxp)
- if (style == QLatin1String("windowsxp"))
- ret = new QWindowsXPStyle;
- else
-#endif
-#if QT_CONFIG(style_windowsvista)
- if (style == QLatin1String("windowsvista"))
- ret = new QWindowsVistaStyle;
- else
-#endif
#if QT_CONFIG(style_fusion)
if (style == QLatin1String("fusion"))
ret = new QFusionStyle;
else
#endif
-#if QT_CONFIG(style_android)
- if (style == QLatin1String("android"))
- ret = new QAndroidStyle;
- else
-#endif
-#if QT_CONFIG(style_mac)
- if (style.startsWith(QLatin1String("macintosh"))) {
- ret = new QMacStyle;
-# if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (style == QLatin1String("macintosh"))
- style += QLatin1String(" (aqua)");
-# endif
- } else
-#endif
{ } // Keep these here - they make the #ifdefery above work
if (!ret)
ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
@@ -164,32 +127,10 @@ QStringList QStyleFactory::keys()
if (!list.contains(QLatin1String("Windows")))
list << QLatin1String("Windows");
#endif
-#if QT_CONFIG(style_windowsxp)
- if (!list.contains(QLatin1String("WindowsXP")) &&
- (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
- list << QLatin1String("WindowsXP");
-#endif
-#if QT_CONFIG(style_windowsvista)
- if (!list.contains(QLatin1String("WindowsVista")) &&
- (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
- list << QLatin1String("WindowsVista");
-#endif
-#if QT_CONFIG(style_android)
- if (!list.contains(QLatin1String("Android")))
- list << QLatin1String("Android");
-#endif
#if QT_CONFIG(style_fusion)
if (!list.contains(QLatin1String("Fusion")))
list << QLatin1String("Fusion");
#endif
-#if QT_CONFIG(style_mac)
- QString mstyle = QLatin1String("Macintosh");
-# if 0 // Used to be included in Qt4 for Q_WS_MAC
- mstyle += QLatin1String(" (aqua)");
-# endif
- if (!list.contains(mstyle))
- list << mstyle;
-#endif
return list;
}
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 797fb0c60a..94376a63e3 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -431,5 +431,34 @@ QWindow *styleObjectWindow(QObject *so)
return 0;
}
+void setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy)
+{
+ QWidget *wadget = const_cast<QWidget *>(widget);
+ wadget->setAttribute(Qt::WA_MacNormalSize, policy == SizeLarge);
+ wadget->setAttribute(Qt::WA_MacSmallSize, policy == SizeSmall);
+ wadget->setAttribute(Qt::WA_MacMiniSize, policy == SizeMini);
+}
+
+WidgetSizePolicy widgetSizePolicy(const QWidget *widget, const QStyleOption *opt)
+{
+ while (widget) {
+ if (widget->testAttribute(Qt::WA_MacMiniSize)) {
+ return SizeMini;
+ } else if (widget->testAttribute(Qt::WA_MacSmallSize)) {
+ return SizeSmall;
+ } else if (widget->testAttribute(Qt::WA_MacNormalSize)) {
+ return SizeLarge;
+ }
+ widget = widget->parentWidget();
+ }
+
+ if (opt && opt->state & QStyle::State_Mini)
+ return SizeMini;
+ else if (opt && opt->state & QStyle::State_Small)
+ return SizeSmall;
+
+ return SizeDefault;
+}
+
}
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h
index 17b6d9ab4f..bd263cea7b 100644
--- a/src/widgets/styles/qstylehelper_p.h
+++ b/src/widgets/styles/qstylehelper_p.h
@@ -62,31 +62,40 @@
QT_BEGIN_NAMESPACE
+class QColor;
+class QObject;
class QPainter;
+class QPalette;
class QPixmap;
class QStyleOptionSlider;
class QStyleOption;
+class QWidget;
class QWindow;
namespace QStyleHelper
{
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size);
- qreal dpiScaled(qreal value);
+ Q_WIDGETS_EXPORT qreal dpiScaled(qreal value);
#if QT_CONFIG(dial)
qreal angle(const QPointF &p1, const QPointF &p2);
QPolygonF calcLines(const QStyleOptionSlider *dial);
int calcBigLineSize(int radius);
- void drawDial(const QStyleOptionSlider *dial, QPainter *painter);
+ Q_WIDGETS_EXPORT void drawDial(const QStyleOptionSlider *dial, QPainter *painter);
#endif //QT_CONFIG(dial)
- void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
+ Q_WIDGETS_EXPORT void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
int left = 0, int top = 0, int right = 0,
int bottom = 0);
#ifndef QT_NO_ACCESSIBILITY
- bool isInstanceOf(QObject *obj, QAccessible::Role role);
- bool hasAncestor(QObject *obj, QAccessible::Role role);
+ Q_WIDGETS_EXPORT bool isInstanceOf(QObject *obj, QAccessible::Role role);
+ Q_WIDGETS_EXPORT bool hasAncestor(QObject *obj, QAccessible::Role role);
#endif
- QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
- QWindow *styleObjectWindow(QObject *so);
+ Q_WIDGETS_EXPORT QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
+ Q_WIDGETS_EXPORT QWindow *styleObjectWindow(QObject *so);
+
+ enum WidgetSizePolicy { SizeLarge = 0, SizeSmall = 1, SizeMini = 2, SizeDefault = -1 };
+
+ void setWidgetSizePolicy(const QWidget *w, WidgetSizePolicy policy);
+ Q_WIDGETS_EXPORT WidgetSizePolicy widgetSizePolicy(const QWidget *w, const QStyleOption *opt = 0);
}
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 5d11b86ae7..a346ee18c4 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -38,11 +38,9 @@
****************************************************************************/
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include "private/qstylehelper_p.h"
#include "qstyleoption.h"
#include "qapplication.h"
-#if QT_CONFIG(style_mac)
-# include "qmacstyle_mac_p.h"
-#endif
#include <qdebug.h>
#include <QtCore/qmath.h>
@@ -205,18 +203,16 @@ void QStyleOption::init(const QWidget *widget)
if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
state &= ~QStyle::State_Enabled;
#endif
-#if QT_CONFIG(style_mac)
- switch (QMacStyle::widgetSizePolicy(widget)) {
- case QMacStyle::SizeSmall:
+ switch (QStyleHelper::widgetSizePolicy(widget)) {
+ case QStyleHelper::SizeSmall:
state |= QStyle::State_Small;
break;
- case QMacStyle::SizeMini:
+ case QStyleHelper::SizeMini:
state |= QStyle::State_Mini;
break;
default:
;
}
-#endif
#ifdef QT_KEYPAD_NAVIGATION
if (widget->hasEditFocus())
state |= QStyle::State_HasEditFocus;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index efd9d4c1d7..44ab9079b0 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -700,10 +700,12 @@ static const char knownStyleHints[][45] = {
"titlebar-minimize-icon",
"titlebar-normal-icon",
"titlebar-shade-icon",
+ "titlebar-show-tooltips-on-buttons",
"titlebar-unshade-icon",
"toolbutton-popup-delay",
"trash-icon",
- "uparrow-icon"
+ "uparrow-icon",
+ "widget-animation-duration"
};
static const int numKnownStyleHints = sizeof(knownStyleHints)/sizeof(knownStyleHints[0]);
@@ -5336,6 +5338,8 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
}
case SH_ItemView_ArrowKeysNavigateIntoChildren: s = QLatin1String("arrow-keys-navigate-into-children"); break;
case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break;
+ case SH_TitleBar_ShowToolTipsOnButtons: s = QLatin1String("titlebar-show-tooltips-on-buttons"); break;
+ case SH_Widget_Animation_Duration: s = QLatin1String("widget-animation-duration"); break;
default: break;
}
if (!s.isEmpty() && rule.hasStyleHint(s)) {
diff --git a/src/widgets/styles/qstylesheetstyle_default.cpp b/src/widgets/styles/qstylesheetstyle_default.cpp
index 168251b0f3..1cb1adb2db 100644
--- a/src/widgets/styles/qstylesheetstyle_default.cpp
+++ b/src/widgets/styles/qstylesheetstyle_default.cpp
@@ -78,7 +78,7 @@ using namespace QCss;
bSelector.pseudos << pseudo
// This is attributes. The third parameter is AttributeSelector::*
-// Ex. QComboBox[style="QWindowsXPStyle"]
+// Ex. QComboBox[style="QWindowsVistaStyle"]
// ^ ^
#define ADD_ATTRIBUTE_SELECTOR(x, y, z) \
@@ -155,7 +155,7 @@ StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const
// pixmap based style doesn't support any features
bool styleIsPixmapBased = baseStyle()->inherits("QMacStyle")
- || baseStyle()->inherits("QWindowsXPStyle");
+ || baseStyle()->inherits("QWindowsVistaStyle");
/*QLineEdit {
diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h
index a1d65610ff..12a682f330 100644
--- a/src/widgets/styles/qwindowsstyle_p.h
+++ b/src/widgets/styles/qwindowsstyle_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
class QWindowsStylePrivate;
-class QWindowsStyle : public QCommonStyle
+class Q_WIDGETS_EXPORT QWindowsStyle : public QCommonStyle
{
Q_OBJECT
public:
diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h
index 5023fd1042..8b387b6ab9 100644
--- a/src/widgets/styles/qwindowsstyle_p_p.h
+++ b/src/widgets/styles/qwindowsstyle_p_p.h
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
class QTime;
-class QWindowsStylePrivate : public QCommonStylePrivate
+class Q_WIDGETS_EXPORT QWindowsStylePrivate : public QCommonStylePrivate
{
Q_DECLARE_PUBLIC(QWindowsStyle)
public:
diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri
index 481123f0d4..0c0f8b7bc7 100644
--- a/src/widgets/styles/styles.pri
+++ b/src/widgets/styles/styles.pri
@@ -37,24 +37,6 @@ RESOURCES += styles/qstyle.qrc
include($$OUT_PWD/qtwidgets-config.pri)
-qtConfig(style-mac) {
- HEADERS += \
- styles/qmacstyle_mac_p.h \
- styles/qmacstyle_mac_p_p.h
- OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm
- LIBS_PRIVATE += -framework Carbon
-}
-
-qtConfig(style-windowsvista) {
- HEADERS += styles/qwindowsvistastyle_p.h styles/qwindowsvistastyle_p_p.h
- SOURCES += styles/qwindowsvistastyle.cpp
-}
-
-qtConfig(style-windowsxp) {
- HEADERS += styles/qwindowsxpstyle_p.h styles/qwindowsxpstyle_p_p.h
- SOURCES += styles/qwindowsxpstyle.cpp
-}
-
qtConfig(style-windows) {
HEADERS += styles/qwindowsstyle_p.h styles/qwindowsstyle_p_p.h
SOURCES += styles/qwindowsstyle.cpp
@@ -64,8 +46,3 @@ qtConfig(style-fusion) {
HEADERS += styles/qfusionstyle_p.h styles/qfusionstyle_p_p.h
SOURCES += styles/qfusionstyle.cpp
}
-
-qtConfig(style-android) {
- HEADERS += styles/qandroidstyle_p.h
- SOURCES += styles/qandroidstyle.cpp
-}
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 8757956310..88c83b0c3f 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -158,6 +158,7 @@
#include "QtWidgets/qapplication.h"
#include "QtGui/qevent.h"
#include "QtWidgets/qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "QtWidgets/qlineedit.h"
QT_BEGIN_NAMESPACE
@@ -494,18 +495,25 @@ QMatchData QCompletionEngine::filterHistory()
}
// Returns a match hint from the cache by chopping the search string
-bool QCompletionEngine::matchHint(QString part, const QModelIndex& parent, QMatchData *hint)
+bool QCompletionEngine::matchHint(const QString &part, const QModelIndex &parent, QMatchData *hint) const
{
- if (c->cs == Qt::CaseInsensitive)
- part = std::move(part).toLower();
+ if (part.isEmpty())
+ return false; // early out to avoid cache[parent] lookup costs
- const CacheItem& map = cache[parent];
+ const auto cit = cache.find(parent);
+ if (cit == cache.end())
+ return false;
+
+ const CacheItem& map = *cit;
+ const auto mapEnd = map.end();
+
+ QString key = c->cs == Qt::CaseInsensitive ? part.toLower() : part;
- QString key = part;
while (!key.isEmpty()) {
key.chop(1);
- if (map.contains(key)) {
- *hint = map[key];
+ const auto it = map.find(key);
+ if (it != mapEnd) {
+ *hint = *it;
return true;
}
}
@@ -513,15 +521,25 @@ bool QCompletionEngine::matchHint(QString part, const QModelIndex& parent, QMatc
return false;
}
-bool QCompletionEngine::lookupCache(QString part, const QModelIndex& parent, QMatchData *m)
+bool QCompletionEngine::lookupCache(const QString &part, const QModelIndex &parent, QMatchData *m) const
{
- if (c->cs == Qt::CaseInsensitive)
- part = std::move(part).toLower();
- const CacheItem& map = cache[parent];
- if (!map.contains(part))
- return false;
- *m = map[part];
- return true;
+ if (part.isEmpty())
+ return false; // early out to avoid cache[parent] lookup costs
+
+ const auto cit = cache.find(parent);
+ if (cit == cache.end())
+ return false;
+
+ const CacheItem& map = *cit;
+
+ const QString key = c->cs == Qt::CaseInsensitive ? part.toLower() : part;
+
+ const auto it = map.find(key);
+ if (it == map.end())
+ return false;
+
+ *m = it.value();
+ return true;
}
// When the cache size exceeds 1MB, it clears out about 1/2 of the cache.
@@ -903,7 +921,7 @@ void QCompleterPrivate::_q_autoResizePopup()
void QCompleterPrivate::showPopup(const QRect& rect)
{
- const QRect screen = QApplication::desktop()->availableGeometry(widget);
+ const QRect screen = QDesktopWidgetPrivate::availableGeometry(widget);
Qt::LayoutDirection dir = widget->layoutDirection();
QPoint pos;
int rh, w;
diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h
index 40b08cc20a..179e116d51 100644
--- a/src/widgets/util/qcompleter_p.h
+++ b/src/widgets/util/qcompleter_p.h
@@ -150,10 +150,10 @@ public:
void filter(const QStringList &parts);
QMatchData filterHistory();
- bool matchHint(QString, const QModelIndex&, QMatchData*);
+ bool matchHint(const QString &part, const QModelIndex &parent, QMatchData *m) const;
void saveInCache(QString, const QModelIndex&, const QMatchData&);
- bool lookupCache(QString part, const QModelIndex& parent, QMatchData *m);
+ bool lookupCache(const QString &part, const QModelIndex &parent, QMatchData *m) const;
virtual void filterOnDemand(int) { }
virtual QMatchData filter(const QString&, const QModelIndex&, int) = 0;
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 11214d93eb..fb3782881c 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -59,8 +59,12 @@
#include "qgridlayout.h"
#include "qapplication.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qbitmap.h"
+#include <private/qhighdpiscaling_p.h>
+#include <qpa/qplatformscreen.h>
+
QT_BEGIN_NAMESPACE
static QIcon messageIcon2qIcon(QSystemTrayIcon::MessageIcon icon)
@@ -196,8 +200,23 @@ QSystemTrayIcon::~QSystemTrayIcon()
void QSystemTrayIcon::setContextMenu(QMenu *menu)
{
Q_D(QSystemTrayIcon);
+ QMenu *oldMenu = d->menu.data();
d->menu = menu;
d->updateMenu_sys();
+ if (oldMenu != menu && d->qpa_sys) {
+ // Show the QMenu-based menu for QPA plugins that do not provide native menus
+ if (oldMenu && !oldMenu->platformMenu())
+ QObject::disconnect(d->qpa_sys, &QPlatformSystemTrayIcon::contextMenuRequested, menu, nullptr);
+ if (menu && !menu->platformMenu()) {
+ QObject::connect(d->qpa_sys, &QPlatformSystemTrayIcon::contextMenuRequested,
+ menu,
+ [menu](QPoint globalNativePos, const QPlatformScreen *platformScreen)
+ {
+ QScreen *screen = platformScreen ? platformScreen->screen() : nullptr;
+ menu->popup(QHighDpi::fromNativePixels(globalNativePos, screen), nullptr);
+ });
+ }
+ }
}
/*!
@@ -323,7 +342,9 @@ bool QSystemTrayIcon::event(QEvent *e)
\value Unknown Unknown reason
\value Context The context menu for the system tray entry was requested
- \value DoubleClick The system tray entry was double clicked
+ \value DoubleClick The system tray entry was double clicked. \note On macOS, a
+ double click will only be emitted if no context menu is set, since the menu
+ opens on mouse press
\value Trigger The system tray entry was clicked
\value MiddleClick The system tray entry was clicked with the middle mouse button
@@ -348,7 +369,7 @@ bool QSystemTrayIcon::event(QEvent *e)
Currently this signal is not sent on \macos.
- \note We follow Microsoft Windows XP/Vista behavior, so the
+ \note We follow Microsoft Windows behavior, so the
signal is also emitted when the user clicks on a tray icon with
a balloon message displayed.
@@ -515,7 +536,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
// smart size for the message label
- int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3;
+ int limit = QDesktopWidgetPrivate::availableGeometry(msgLabel).size().width() / 3;
if (msgLabel->sizeHint().width() > limit) {
msgLabel->setWordWrap(true);
if (msgLabel->sizeHint().width() > limit) {
@@ -582,7 +603,7 @@ void QBalloonTip::resizeEvent(QResizeEvent *ev)
void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
{
this->showArrow = showArrow;
- QRect scr = QApplication::desktop()->screenGeometry(pos);
+ QRect scr = QDesktopWidgetPrivate::screenGeometry(pos);
QSize sh = sizeHint();
const int border = 1;
const int ah = 18, ao = 18, aw = 18, rc = 7;
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
deleted file mode 100644
index d110cb8be4..0000000000
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ /dev/null
@@ -1,591 +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$
-**
-****************************************************************************/
-
-#include "qsystemtrayicon_p.h"
-#ifndef QT_NO_SYSTEMTRAYICON
-
-#if defined(_WIN32_IE) && _WIN32_IE < 0x0600
-# undef _WIN32_IE
-#endif
-#if !defined(_WIN32_IE)
-# define _WIN32_IE 0x0600 //required for NOTIFYICONDATA_V2_SIZE
-#endif
-
-#include <private/qsystemlibrary_p.h>
-#include <private/qguiapplication_p.h>
-#include <qpa/qplatformnativeinterface.h>
-#include <QSettings>
-#include <QDebug>
-#include <QHash>
-
-#include <qt_windows.h>
-#include <commctrl.h>
-#include <windowsx.h>
-
-QT_BEGIN_NAMESPACE
-
-static const UINT q_uNOTIFYICONID = 0;
-
-static uint MYWM_TASKBARCREATED = 0;
-#define MYWM_NOTIFYICON (WM_APP+101)
-
-struct Q_NOTIFYICONIDENTIFIER {
- DWORD cbSize;
- HWND hWnd;
- UINT uID;
- GUID guidItem;
-};
-
-#ifndef NIN_KEYSELECT
-# define NIN_KEYSELECT (WM_USER + 1)
-#endif
-
-#ifdef Q_CC_MINGW
-# define NIN_SELECT (WM_USER + 0)
-# define NIN_BALLOONTIMEOUT (WM_USER + 4)
-# define NIN_BALLOONUSERCLICK (WM_USER + 5)
-# define NIF_SHOWTIP 0x00000080
-# define NIIF_LARGE_ICON 0x00000020
-# define NOTIFYICON_VERSION_4 4
-#endif
-
-#define Q_MSGFLT_ALLOW 1
-
-Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &);
-
-typedef HRESULT (WINAPI *PtrShell_NotifyIconGetRect)(const Q_NOTIFYICONIDENTIFIER* identifier, RECT* iconLocation);
-typedef BOOL (WINAPI *PtrChangeWindowMessageFilter)(UINT message, DWORD dwFlag);
-typedef BOOL (WINAPI *PtrChangeWindowMessageFilterEx)(HWND hWnd, UINT message, DWORD action, void* pChangeFilterStruct);
-
-// Copy QString data to a limited wchar_t array including \0.
-static inline void qStringToLimitedWCharArray(QString in, wchar_t *target, int maxLength)
-{
- const int length = qMin(maxLength - 1, in.size());
- if (length < in.size())
- in.truncate(length);
- in.toWCharArray(target);
- target[length] = wchar_t(0);
-}
-
-class QSystemTrayIconSys
-{
-public:
- QSystemTrayIconSys(HWND hwnd, QSystemTrayIcon *object);
- ~QSystemTrayIconSys();
- bool trayMessage(DWORD msg);
- void setIconContents(NOTIFYICONDATA &data);
- bool showMessage(const QString &title, const QString &message, const QIcon &icon, uint uSecs);
- QRect findIconGeometry(UINT iconId);
- HICON createIcon();
- bool winEvent(MSG *m, long *result);
-
-private:
- const HWND m_hwnd;
- HICON hIcon;
- QPoint globalPos;
- QSystemTrayIcon *q;
- uint notifyIconSize;
- int version;
- bool ignoreNextMouseRelease;
-};
-
-static bool allowsMessages()
-{
-#ifndef QT_NO_SETTINGS
- const QString key = QStringLiteral("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced");
- const QSettings settings(key, QSettings::NativeFormat);
- return settings.value(QStringLiteral("EnableBalloonTips"), true).toBool();
-#else
- return false;
-#endif
-}
-
-typedef QHash<HWND, QSystemTrayIconSys *> HandleTrayIconHash;
-
-Q_GLOBAL_STATIC(HandleTrayIconHash, handleTrayIconHash)
-
-extern "C" LRESULT QT_WIN_CALLBACK qWindowsTrayconWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- if (message == MYWM_TASKBARCREATED || message == MYWM_NOTIFYICON) {
- if (QSystemTrayIconSys *trayIcon = handleTrayIconHash()->value(hwnd)) {
- MSG msg;
- msg.hwnd = hwnd; // re-create MSG structure
- msg.message = message; // time and pt fields ignored
- msg.wParam = wParam;
- msg.lParam = lParam;
- msg.pt.x = GET_X_LPARAM(lParam);
- msg.pt.y = GET_Y_LPARAM(lParam);
- long result = 0;
- if (trayIcon->winEvent(&msg, &result))
- return result;
- }
- }
- return DefWindowProc(hwnd, message, wParam, lParam);
-}
-
-// Invoke a service of the native Windows interface to create
-// a non-visible toplevel window to receive tray messages.
-// Note: Message windows (HWND_MESSAGE) are not sufficient, they
-// will not receive the "TaskbarCreated" message.
-static inline HWND createTrayIconMessageWindow()
-{
- QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface();
- if (!ni)
- return 0;
- // Register window class in the platform plugin.
- QString className;
- void *wndProc = reinterpret_cast<void *>(qWindowsTrayconWndProc);
- if (!QMetaObject::invokeMethod(ni, "registerWindowClass", Qt::DirectConnection,
- Q_RETURN_ARG(QString, className),
- Q_ARG(QString, QStringLiteral("QTrayIconMessageWindowClass")),
- Q_ARG(void *, wndProc))) {
- return 0;
- }
- const wchar_t windowName[] = L"QTrayIconMessageWindow";
- return CreateWindowEx(0, (wchar_t*)className.utf16(),
- windowName, WS_OVERLAPPED,
- CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, CW_USEDEFAULT,
- NULL, NULL, (HINSTANCE)GetModuleHandle(0), NULL);
-}
-
-QSystemTrayIconSys::QSystemTrayIconSys(HWND hwnd, QSystemTrayIcon *object)
- : m_hwnd(hwnd), hIcon(0), q(object)
- , notifyIconSize(sizeof(NOTIFYICONDATA)), version(NOTIFYICON_VERSION_4)
- , ignoreNextMouseRelease(false)
-
-{
- handleTrayIconHash()->insert(m_hwnd, this);
-
- if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) {
- notifyIconSize = NOTIFYICONDATA_V2_SIZE;
- version = NOTIFYICON_VERSION;
- }
-
- // For restoring the tray icon after explorer crashes
- if (!MYWM_TASKBARCREATED) {
- MYWM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated");
- }
-
- // Allow the WM_TASKBARCREATED message through the UIPI filter on Windows 7 and higher
- static PtrChangeWindowMessageFilterEx pChangeWindowMessageFilterEx =
- (PtrChangeWindowMessageFilterEx)QSystemLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilterEx");
-
- if (pChangeWindowMessageFilterEx) {
- // Call the safer ChangeWindowMessageFilterEx API if available (Windows 7 onwards)
- pChangeWindowMessageFilterEx(m_hwnd, MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW, 0);
- } else {
- // Call the deprecated ChangeWindowMessageFilter API otherwise (Vista onwards)
- // May 2016: Still resolved at runtime since the definition is not present in MinGW 4.9.
- // TODO: Replace by direct invocation when upgrading MinGW.
- static PtrChangeWindowMessageFilter pChangeWindowMessageFilter =
- (PtrChangeWindowMessageFilter)QSystemLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilter");
-
- if (pChangeWindowMessageFilter)
- pChangeWindowMessageFilter(MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW);
- }
-}
-
-QSystemTrayIconSys::~QSystemTrayIconSys()
-{
- handleTrayIconHash()->remove(m_hwnd);
- if (hIcon)
- DestroyIcon(hIcon);
- DestroyWindow(m_hwnd);
-}
-
-void QSystemTrayIconSys::setIconContents(NOTIFYICONDATA &tnd)
-{
- tnd.uFlags |= NIF_MESSAGE | NIF_ICON | NIF_TIP;
- tnd.uCallbackMessage = MYWM_NOTIFYICON;
- tnd.hIcon = hIcon;
- const QString tip = q->toolTip();
- if (!tip.isNull())
- qStringToLimitedWCharArray(tip, tnd.szTip, sizeof(tnd.szTip)/sizeof(wchar_t));
-}
-
-bool QSystemTrayIconSys::showMessage(const QString &title, const QString &message, const QIcon &icon, uint uSecs)
-{
- NOTIFYICONDATA tnd;
- memset(&tnd, 0, notifyIconSize);
- qStringToLimitedWCharArray(message, tnd.szInfo, 256);
- qStringToLimitedWCharArray(title, tnd.szInfoTitle, 64);
-
- tnd.uID = q_uNOTIFYICONID;
- tnd.dwInfoFlags = NIIF_USER;
-
- HICON *phIcon = &tnd.hIcon;
- QSize size(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
- if (version == NOTIFYICON_VERSION_4) {
- const QSize largeIcon(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
- QSize more = icon.actualSize(largeIcon);
- if (more.height() > (largeIcon.height() * 3/4) || more.width() > (largeIcon.width() * 3/4)) {
- tnd.dwInfoFlags |= NIIF_LARGE_ICON;
- size = largeIcon;
- }
- phIcon = &tnd.hBalloonIcon;
- }
- QPixmap pm = icon.pixmap(size);
- if (pm.isNull()) {
- tnd.dwInfoFlags = NIIF_INFO;
- } else {
- if (pm.size() != size) {
- qWarning("QSystemTrayIcon::showMessage: Wrong icon size (%dx%d), please add standard one: %dx%d",
- pm.size().width(), pm.size().height(), size.width(), size.height());
- pm = pm.scaled(size, Qt::IgnoreAspectRatio);
- }
- *phIcon = qt_pixmapToWinHICON(pm);
- }
- tnd.cbSize = notifyIconSize;
- tnd.uVersion = version;
- tnd.hWnd = m_hwnd;
- tnd.uTimeout = uSecs;
- tnd.uFlags = NIF_INFO | NIF_SHOWTIP;
-
- return Shell_NotifyIcon(NIM_MODIFY, &tnd);
-}
-
-bool QSystemTrayIconSys::trayMessage(DWORD msg)
-{
- NOTIFYICONDATA tnd;
- memset(&tnd, 0, notifyIconSize);
-
- tnd.uID = q_uNOTIFYICONID;
- tnd.cbSize = notifyIconSize;
- tnd.hWnd = m_hwnd;
- tnd.uFlags = NIF_SHOWTIP;
- tnd.uVersion = version;
-
- if (msg == NIM_ADD || msg == NIM_MODIFY) {
- setIconContents(tnd);
- }
-
- bool success = Shell_NotifyIcon(msg, &tnd);
-
- if (msg == NIM_ADD)
- return success && Shell_NotifyIcon(NIM_SETVERSION, &tnd);
- else
- return success;
-}
-
-HICON QSystemTrayIconSys::createIcon()
-{
- const HICON oldIcon = hIcon;
- hIcon = 0;
- const QIcon icon = q->icon();
- if (icon.isNull())
- return oldIcon;
- const QSize requestedSize = QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA
- ? QSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON))
- : QSize(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
- const QSize size = icon.actualSize(requestedSize);
- const QPixmap pm = icon.pixmap(size);
- if (pm.isNull())
- return oldIcon;
- hIcon = qt_pixmapToWinHICON(pm);
- return oldIcon;
-}
-
-bool QSystemTrayIconSys::winEvent( MSG *m, long *result )
-{
- *result = 0;
- switch(m->message) {
- case MYWM_NOTIFYICON:
- {
- int message = 0;
- QPoint gpos;
-
- if (version == NOTIFYICON_VERSION_4) {
- Q_ASSERT(q_uNOTIFYICONID == HIWORD(m->lParam));
- message = LOWORD(m->lParam);
- gpos = QPoint(GET_X_LPARAM(m->wParam), GET_Y_LPARAM(m->wParam));
- } else {
- Q_ASSERT(q_uNOTIFYICONID == m->wParam);
- message = m->lParam;
- gpos = QCursor::pos();
- }
-
- switch (message) {
- case NIN_SELECT:
- case NIN_KEYSELECT:
- if (ignoreNextMouseRelease)
- ignoreNextMouseRelease = false;
- else
- emit q->activated(QSystemTrayIcon::Trigger);
- break;
-
- case WM_LBUTTONDBLCLK:
- ignoreNextMouseRelease = true; // Since DBLCLICK Generates a second mouse
- // release we must ignore it
- emit q->activated(QSystemTrayIcon::DoubleClick);
- break;
-
- case WM_CONTEXTMENU:
- if (q->contextMenu()) {
- q->contextMenu()->popup(gpos);
- q->contextMenu()->activateWindow();
- }
- emit q->activated(QSystemTrayIcon::Context);
- break;
-
- case NIN_BALLOONUSERCLICK:
- emit q->messageClicked();
- break;
-
- case WM_MBUTTONUP:
- emit q->activated(QSystemTrayIcon::MiddleClick);
- break;
-
- default:
- break;
- }
- break;
- }
- default:
- if (m->message == MYWM_TASKBARCREATED) // self-registered message id.
- trayMessage(NIM_ADD);
- break;
- }
- return false;
-}
-
-QSystemTrayIconPrivate::QSystemTrayIconPrivate()
- : sys(0),
- visible(false)
-{
-}
-
-QSystemTrayIconPrivate::~QSystemTrayIconPrivate()
-{
-}
-
-void QSystemTrayIconPrivate::install_sys()
-{
- Q_Q(QSystemTrayIcon);
- if (!sys) {
- if (const HWND hwnd = createTrayIconMessageWindow()) {
- sys = new QSystemTrayIconSys(hwnd, q);
- sys->createIcon();
- sys->trayMessage(NIM_ADD);
- } else {
- qWarning("The platform plugin failed to create a message window.");
- }
- }
-}
-
-/*
-* This function tries to determine the icon geometry from the tray
-*
-* If it fails an invalid rect is returned.
-*/
-
-QRect QSystemTrayIconSys::findIconGeometry(UINT iconId)
-{
- struct AppData
- {
- HWND hwnd;
- UINT uID;
- };
-
- // Windows 7 onwards.
- static PtrShell_NotifyIconGetRect Shell_NotifyIconGetRect =
- (PtrShell_NotifyIconGetRect)QSystemLibrary::resolve(QLatin1String("shell32"),
- "Shell_NotifyIconGetRect");
-
- if (Shell_NotifyIconGetRect) {
- Q_NOTIFYICONIDENTIFIER nid;
- memset(&nid, 0, sizeof(nid));
- nid.cbSize = sizeof(nid);
- nid.hWnd = m_hwnd;
- nid.uID = iconId;
-
- RECT rect;
- HRESULT hr = Shell_NotifyIconGetRect(&nid, &rect);
- if (SUCCEEDED(hr)) {
- return QRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
- }
- }
-
- QRect ret;
-
- TBBUTTON buttonData;
- DWORD processID = 0;
- HWND trayHandle = FindWindow(L"Shell_TrayWnd", NULL);
-
- //find the toolbar used in the notification area
- if (trayHandle) {
- trayHandle = FindWindowEx(trayHandle, NULL, L"TrayNotifyWnd", NULL);
- if (trayHandle) {
- HWND hwnd = FindWindowEx(trayHandle, NULL, L"SysPager", NULL);
- if (hwnd) {
- hwnd = FindWindowEx(hwnd, NULL, L"ToolbarWindow32", NULL);
- if (hwnd)
- trayHandle = hwnd;
- }
- }
- }
-
- if (!trayHandle)
- return ret;
-
- GetWindowThreadProcessId(trayHandle, &processID);
- if (processID <= 0)
- return ret;
-
- HANDLE trayProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ, 0, processID);
- if (!trayProcess)
- return ret;
-
- int buttonCount = SendMessage(trayHandle, TB_BUTTONCOUNT, 0, 0);
- LPVOID data = VirtualAllocEx(trayProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);
-
- if ( buttonCount < 1 || !data ) {
- CloseHandle(trayProcess);
- return ret;
- }
-
- //search for our icon among all toolbar buttons
- for (int toolbarButton = 0; toolbarButton < buttonCount; ++toolbarButton ) {
- SIZE_T numBytes = 0;
- AppData appData = { 0, 0 };
- SendMessage(trayHandle, TB_GETBUTTON, toolbarButton , (LPARAM)data);
-
- if (!ReadProcessMemory(trayProcess, data, &buttonData, sizeof(TBBUTTON), &numBytes))
- continue;
-
- if (!ReadProcessMemory(trayProcess, (LPVOID) buttonData.dwData, &appData, sizeof(AppData), &numBytes))
- continue;
-
- bool isHidden = buttonData.fsState & TBSTATE_HIDDEN;
-
- if (m_hwnd == appData.hwnd && appData.uID == iconId && !isHidden) {
- SendMessage(trayHandle, TB_GETITEMRECT, toolbarButton , (LPARAM)data);
- RECT iconRect = {0, 0, 0, 0};
- if(ReadProcessMemory(trayProcess, data, &iconRect, sizeof(RECT), &numBytes)) {
- MapWindowPoints(trayHandle, NULL, (LPPOINT)&iconRect, 2);
- QRect geometry(iconRect.left + 1, iconRect.top + 1,
- iconRect.right - iconRect.left - 2,
- iconRect.bottom - iconRect.top - 2);
- if (geometry.isValid())
- ret = geometry;
- break;
- }
- }
- }
- VirtualFreeEx(trayProcess, data, 0, MEM_RELEASE);
- CloseHandle(trayProcess);
- return ret;
-}
-
-void QSystemTrayIconPrivate::showMessage_sys(const QString &title,
- const QString &messageIn,
- const QIcon &icon,
- QSystemTrayIcon::MessageIcon,
- int timeOut)
-{
- if (!sys || !allowsMessages())
- return;
-
- // 10 sec default
- const uint uSecs = timeOut < 0 ? uint(10000) : uint(timeOut);
- // For empty messages, ensures that they show when only title is set
- QString message = messageIn;
- if (message.isEmpty() && !title.isEmpty())
- message.append(QLatin1Char(' '));
-
- sys->showMessage(title, message, icon, uSecs);
-}
-
-QRect QSystemTrayIconPrivate::geometry_sys() const
-{
- if (!sys)
- return QRect();
-
- return sys->findIconGeometry(q_uNOTIFYICONID);
-}
-
-void QSystemTrayIconPrivate::remove_sys()
-{
- if (!sys)
- return;
-
- sys->trayMessage(NIM_DELETE);
- delete sys;
- sys = 0;
-}
-
-void QSystemTrayIconPrivate::updateIcon_sys()
-{
- if (!sys)
- return;
-
- const HICON hIconToDestroy = sys->createIcon();
- sys->trayMessage(NIM_MODIFY);
-
- if (hIconToDestroy)
- DestroyIcon(hIconToDestroy);
-}
-
-void QSystemTrayIconPrivate::updateMenu_sys()
-{
-#if QT_CONFIG(menu)
-#endif
-}
-
-void QSystemTrayIconPrivate::updateToolTip_sys()
-{
- if (!sys)
- return;
-
- sys->trayMessage(NIM_MODIFY);
-}
-
-bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
-{
- return true;
-}
-
-bool QSystemTrayIconPrivate::supportsMessages_sys()
-{
- return allowsMessages();
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index 0b654bbadd..a3bd8897f1 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -49,9 +49,7 @@ qtConfig(undoview) {
SOURCES += util/qundoview.cpp
}
-win32:!winrt {
- SOURCES += util/qsystemtrayicon_win.cpp
-} else: qtConfig(xcb) {
+qtConfig(xcb) {
SOURCES += util/qsystemtrayicon_x11.cpp
} else {
SOURCES += util/qsystemtrayicon_qpa.cpp
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 3fc5e5a051..ed0fd3e2b0 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -45,6 +45,7 @@
#include <qlineedit.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
+#include <private/qdesktopwidget_p.h>
#include <qlistview.h>
#if QT_CONFIG(tableview)
#include <qtableview.h>
@@ -70,11 +71,6 @@
#include <private/qabstractscrollarea_p.h>
#include <private/qlineedit_p.h>
#include <qdebug.h>
-#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effetcts) && QT_CONFIG(style_mac)
-#include <private/qcore_mac_p.h>
-#include <private/qmacstyle_mac_p.h>
-#include <private/qt_cocoa_helpers_mac_p.h>
-#endif
#if QT_CONFIG(effects)
# include <private/qeffects_p.h>
#endif
@@ -200,7 +196,21 @@ void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
if (index.isValid() && q->completer()) {
QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(q->completer()->completionModel());
if (proxy) {
- q->setCurrentIndex(proxy->mapToSource(index).row());
+ const QModelIndex &completerIndex = proxy->mapToSource(index);
+ int row = -1;
+ if (completerIndex.model() == model) {
+ row = completerIndex.row();
+ } else {
+ // if QCompleter uses a proxy model to host widget's one - map again
+ QAbstractProxyModel *completerProxy = qobject_cast<QAbstractProxyModel *>(q->completer()->model());
+ if (completerProxy && completerProxy->sourceModel() == model) {
+ row = completerProxy->mapToSource(completerIndex).row();
+ } else {
+ QString match = q->completer()->model()->data(completerIndex).toString();
+ row = q->findText(match, matchFlags());
+ }
+ }
+ q->setCurrentIndex(row);
emitActivated(currentIndex);
}
}
@@ -253,8 +263,8 @@ QRect QComboBoxPrivate::popupGeometry(int screen) const
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
useFullScreenForPopupMenu = theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool();
return useFullScreenForPopupMenu ?
- QApplication::desktop()->screenGeometry(screen) :
- QApplication::desktop()->availableGeometry(screen);
+ QDesktopWidgetPrivate::screenGeometry(screen) :
+ QDesktopWidgetPrivate::availableGeometry(screen);
}
bool QComboBoxPrivate::updateHoverControl(const QPoint &pos)
@@ -484,6 +494,14 @@ void QComboBoxPrivateContainer::scrollItemView(int action)
#endif
}
+void QComboBoxPrivateContainer::hideScrollers()
+{
+ if (top)
+ top->hide();
+ if (bottom)
+ bottom->hide();
+}
+
/*
Hides or shows the scrollers when we emulate a popupmenu
*/
@@ -2590,7 +2608,7 @@ void QComboBox::showPopup()
QComboBoxPrivateContainer* container = d->viewContainer();
QRect listRect(style->subControlRect(QStyle::CC_ComboBox, &opt,
QStyle::SC_ComboBoxListBoxPopup, this));
- QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(this));
+ QRect screen = d->popupGeometry(QDesktopWidgetPrivate::screenNumber(this));
QPoint below = mapToGlobal(listRect.bottomLeft());
int belowHeight = screen.bottom() - below.y();
@@ -2725,6 +2743,11 @@ void QComboBox::showPopup()
if (needHorizontalScrollBar) {
listRect.adjust(0, 0, 0, sb->height());
}
+
+ // Hide the scrollers here, so that the listrect gets the full height of the container
+ // If the scrollers are truly needed, the later call to container->updateScrollers()
+ // will make them visible again.
+ container->hideScrollers();
container->setGeometry(listRect);
#ifndef Q_OS_MAC
diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h
index 249610825a..835bbf866e 100644
--- a/src/widgets/widgets/qcombobox_p.h
+++ b/src/widgets/widgets/qcombobox_p.h
@@ -215,7 +215,7 @@ private:
bool fast;
};
-class Q_AUTOTEST_EXPORT QComboBoxPrivateContainer : public QFrame
+class Q_WIDGETS_EXPORT QComboBoxPrivateContainer : public QFrame
{
Q_OBJECT
@@ -234,6 +234,7 @@ public:
public Q_SLOTS:
void scrollItemView(int action);
+ void hideScrollers();
void updateScrollers();
void viewDestroyed();
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 053b184226..b6ec6b4065 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -42,6 +42,7 @@
#include <qapplication.h>
#include <qdatetimeedit.h>
#include <qdesktopwidget.h>
+#include <private/qdesktopwidget_p.h>
#include <qdebug.h>
#include <qevent.h>
#include <qlineedit.h>
@@ -1073,7 +1074,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
//hide cursor
d->edit->d_func()->setCursorVisible(false);
- d->edit->d_func()->control->setCursorBlinkPeriod(0);
+ d->edit->d_func()->control->setBlinkingCursorEnabled(false);
d->setSelected(0);
}
}
@@ -1094,7 +1095,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
//hide cursor
d->edit->d_func()->setCursorVisible(false);
- d->edit->d_func()->control->setCursorBlinkPeriod(0);
+ d->edit->d_func()->control->setBlinkingCursorEnabled(false);
d->setSelected(0);
oldCurrent = 0;
}
@@ -1921,6 +1922,7 @@ QDateTime QDateTimeEditPrivate::validateAndInterpret(QString &input, int &positi
}
StateNode tmp = parse(input, position, value.toDateTime(), fixup);
input = tmp.input;
+ position += tmp.padded;
state = QValidator::State(int(tmp.state));
if (state == QValidator::Acceptable) {
if (tmp.conflicts && conflictGuard != tmp.value) {
@@ -2515,7 +2517,7 @@ void QDateTimeEditPrivate::positionCalendarPopup()
pos = q->mapToGlobal(pos);
pos2 = q->mapToGlobal(pos2);
QSize size = monthCalendar->sizeHint();
- QRect screen = QApplication::desktop()->availableGeometry(pos);
+ QRect screen = QDesktopWidgetPrivate::availableGeometry(pos);
//handle popup falling "off screen"
if (q->layoutDirection() == Qt::RightToLeft) {
pos.setX(pos.x()-size.width());
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 90cb17da59..788ec67fb2 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -579,6 +579,8 @@ QDialogButtonBox::~QDialogButtonBox()
\value MacLayout Use a policy appropriate for applications on \macos.
\value KdeLayout Use a policy appropriate for applications on KDE.
\value GnomeLayout Use a policy appropriate for applications on GNOME.
+ \value AndroidLayout Use a policy appropriate for applications on Android.
+ This enum value was added in Qt 5.10.
The button layout is specified by the \l{style()}{current style}. However,
on the X11 platform, it may be influenced by the desktop environment.
diff --git a/src/widgets/widgets/qdialogbuttonbox.h b/src/widgets/widgets/qdialogbuttonbox.h
index af9e705234..02d14dee7c 100644
--- a/src/widgets/widgets/qdialogbuttonbox.h
+++ b/src/widgets/widgets/qdialogbuttonbox.h
@@ -108,11 +108,13 @@ public:
Q_FLAG(StandardButtons)
enum ButtonLayout {
- // keep this in sync with QMessageBox::ButtonLayout and QPlatformDialogHelper::ButtonLayout
+ // keep this in sync with QPlatformDialogHelper::ButtonLayout
WinLayout,
MacLayout,
KdeLayout,
- GnomeLayout
+ GnomeLayout,
+ // MacModelessLayout,
+ AndroidLayout = GnomeLayout + 2 // ### Qt 6: reorder
};
QDialogButtonBox(QWidget *parent = Q_NULLPTR);
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index 21d1d4cb85..71726eaeee 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -45,6 +45,7 @@
#endif
#include "QtWidgets/qstyle.h"
#include "QtWidgets/qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "QtWidgets/qapplication.h"
#include "QtCore/qvariant.h"
#include "qdockarealayout_p.h"
@@ -1044,33 +1045,6 @@ QLayoutItem *QDockAreaLayoutInfo::plug(const QList<int> &path)
Q_ASSERT(item.widgetItem != 0);
Q_ASSERT(item.flags & QDockAreaLayoutItem::GapItem);
item.flags &= ~QDockAreaLayoutItem::GapItem;
-
- QRect result;
-
-#if QT_CONFIG(tabbar)
- if (tabbed) {
- } else
-#endif
- {
- int prev = this->prev(index);
- int next = this->next(index);
-
- if (prev != -1 && !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)) {
- item.pos += *sep;
- item.size -= *sep;
- }
- if (next != -1 && !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem))
- item.size -= *sep;
-
- QPoint pos;
- rpick(o, pos) = item.pos;
- rperp(o, pos) = perp(o, rect.topLeft());
- QSize s;
- rpick(o, s) = item.size;
- rperp(o, s) = perp(o, rect.size());
- result = QRect(pos, s);
- }
-
return item.widgetItem;
}
@@ -1323,29 +1297,46 @@ QDockAreaLayoutInfo *QDockAreaLayoutInfo::info(const QList<int> &path)
return item_list[index].subinfo->info(path.mid(1));
}
-QRect QDockAreaLayoutInfo::itemRect(int index) const
+QRect QDockAreaLayoutInfo::itemRect(int index, bool isGap) const
{
const QDockAreaLayoutItem &item = item_list.at(index);
if (item.skip())
return QRect();
+ if (isGap && !(item.flags & QDockAreaLayoutItem::GapItem))
+ return QRect();
+
QRect result;
#if QT_CONFIG(tabbar)
if (tabbed) {
- if (tabId(item) == currentTabId())
+ if (isGap || tabId(item) == currentTabId())
result = tabContentRect();
} else
#endif
{
- QPoint pos;
- rpick(o, pos) = item.pos;
- rperp(o, pos) = perp(o, rect.topLeft());
+ int pos = item.pos;
+ int size = item.size;
+
+ if (isGap) {
+ int prev = this->prev(index);
+ int next = this->next(index);
+ if (prev != -1 && !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)) {
+ pos += *sep;
+ size -= *sep;
+ }
+ if (next != -1 && !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem))
+ size -= *sep;
+ }
+
+ QPoint p;
+ rpick(o, p) = pos;
+ rperp(o, p) = perp(o, rect.topLeft());
QSize s;
- rpick(o, s) = item.size;
+ rpick(o, s) = size;
rperp(o, s) = perp(o, rect.size());
- result = QRect(pos, s);
+ result = QRect(p, s);
}
return result;
@@ -2426,20 +2417,21 @@ QList<int> QDockAreaLayout::indexOf(QWidget *dockWidget) const
return QList<int>();
}
-QList<int> QDockAreaLayout::gapIndex(const QPoint &pos) const
+QList<int> QDockAreaLayout::gapIndex(const QPoint &pos, bool disallowTabs) const
{
QMainWindow::DockOptions opts = mainWindow->dockOptions();
bool nestingEnabled = opts & QMainWindow::AllowNestedDocks;
QDockAreaLayoutInfo::TabMode tabMode = QDockAreaLayoutInfo::NoTabs;
#if QT_CONFIG(tabbar)
- if (opts & QMainWindow::AllowTabbedDocks
- || opts & QMainWindow::VerticalTabs)
- tabMode = QDockAreaLayoutInfo::AllowTabs;
- if (opts & QMainWindow::ForceTabbedDocks)
- tabMode = QDockAreaLayoutInfo::ForceTabs;
+ if (!disallowTabs) {
+ if (opts & QMainWindow::AllowTabbedDocks || opts & QMainWindow::VerticalTabs)
+ tabMode = QDockAreaLayoutInfo::AllowTabs;
+ if (opts & QMainWindow::ForceTabbedDocks)
+ tabMode = QDockAreaLayoutInfo::ForceTabs;
- if (tabMode == QDockAreaLayoutInfo::ForceTabs)
- nestingEnabled = false;
+ if (tabMode == QDockAreaLayoutInfo::ForceTabs)
+ nestingEnabled = false;
+ }
#endif
@@ -3052,11 +3044,10 @@ QSize QDockAreaLayout::minimumSize() const
QRect QDockAreaLayout::constrainedRect(QRect rect, QWidget* widget)
{
QRect desktop;
- QDesktopWidget *desktopW = QApplication::desktop();
- if (desktopW->isVirtualDesktop())
- desktop = desktopW->screenGeometry(rect.topLeft());
+ if (QDesktopWidgetPrivate::isVirtualDesktop())
+ desktop = QDesktopWidgetPrivate::screenGeometry(rect.topLeft());
else
- desktop = desktopW->screenGeometry(widget);
+ desktop = QDesktopWidgetPrivate::screenGeometry(widget);
if (desktop.isValid()) {
rect.setWidth(qMin(rect.width(), desktop.width()));
@@ -3311,6 +3302,19 @@ int QDockAreaLayout::separatorMove(const QList<int> &separator, const QPoint &or
return delta;
}
+int QDockAreaLayoutInfo::separatorMove(const QList<int> &separator, const QPoint &origin,
+ const QPoint &dest)
+{
+ int delta = 0;
+ int index = separator.last();
+ QDockAreaLayoutInfo *info = this->info(separator);
+ delta = pick(info->o, dest - origin);
+ if (delta != 0)
+ delta = info->separatorMove(index, delta);
+ info->apply(false);
+ return delta;
+}
+
#if QT_CONFIG(tabbar)
// Sets the correct positions for the separator widgets
// Allocates new sepearator widgets with getSeparatorWidget
@@ -3420,47 +3424,10 @@ QRect QDockAreaLayout::gapRect(const QList<int> &path) const
const QDockAreaLayoutInfo *info = this->info(path);
if (info == 0)
return QRect();
- const QList<QDockAreaLayoutItem> &item_list = info->item_list;
- Qt::Orientation o = info->o;
int index = path.last();
- if (index < 0 || index >= item_list.count())
- return QRect();
- const QDockAreaLayoutItem &item = item_list.at(index);
- if (!(item.flags & QDockAreaLayoutItem::GapItem))
+ if (index < 0 || index >= info->item_list.count())
return QRect();
-
- QRect result;
-
-#if QT_CONFIG(tabbar)
- if (info->tabbed) {
- result = info->tabContentRect();
- } else
-#endif
- {
- int pos = item.pos;
- int size = item.size;
-
- int prev = info->prev(index);
- int next = info->next(index);
-
- if (prev != -1 && !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)) {
- pos += sep;
- size -= sep;
- }
- if (next != -1 && !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem))
- size -= sep;
-
- QPoint p;
- rpick(o, p) = pos;
- rperp(o, p) = perp(o, info->rect.topLeft());
- QSize s;
- rpick(o, s) = size;
- rperp(o, s) = perp(o, info->rect.size());
-
- result = QRect(p, s);
- }
-
- return result;
+ return info->itemRect(index, true);
}
void QDockAreaLayout::keepSize(QDockWidget *w)
diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h
index 82244c192e..49bd157179 100644
--- a/src/widgets/widgets/qdockarealayout_p.h
+++ b/src/widgets/widgets/qdockarealayout_p.h
@@ -160,7 +160,7 @@ public:
void fitItems();
bool expansive(Qt::Orientation o) const;
int changeSize(int index, int size, bool below);
- QRect itemRect(int index) const;
+ QRect itemRect(int index, bool isGap = false) const;
QRect itemRect(const QList<int> &path) const;
QRect separatorRect(int index) const;
QRect separatorRect(const QList<int> &path) const;
@@ -182,6 +182,7 @@ public:
const QPoint &mouse) const;
QRegion separatorRegion() const;
int separatorMove(int index, int delta);
+ int separatorMove(const QList<int> &separator, const QPoint &origin, const QPoint &dest);
QLayoutItem *itemAt(int *x, int index) const;
QLayoutItem *takeAt(int *x, int index);
@@ -246,7 +247,7 @@ public:
QList<int> indexOfPlaceHolder(const QString &objectName) const;
QList<int> indexOf(QWidget *dockWidget) const;
- QList<int> gapIndex(const QPoint &pos) const;
+ QList<int> gapIndex(const QPoint &pos, bool disallowTabs) const;
QList<int> findSeparator(const QPoint &pos) const;
QDockAreaLayoutItem &item(const QList<int> &path);
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 2d5ee68f8e..36d7ab3421 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -56,11 +56,6 @@
#include "qdockwidget_p.h"
#include "qmainwindowlayout_p.h"
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-#include <private/qapplication_p.h>
-#include <private/qt_mac_p.h>
-#include <private/qmacstyle_mac_p.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -217,10 +212,9 @@ QDockWidgetLayout::~QDockWidgetLayout()
bool QDockWidgetLayout::nativeWindowDeco() const
{
bool floating = parentWidget()->isWindow();
- if (!floating) {
- if (auto groupWindow = qobject_cast<const QDockWidgetGroupWindow*>(parentWidget()->parentWidget()))
- return groupWindow->hasNativeDecos();
- }
+ if (auto groupWindow =
+ qobject_cast<const QDockWidgetGroupWindow *>(parentWidget()->parentWidget()))
+ floating = floating || groupWindow->tabLayoutInfo();
return nativeWindowDeco(floating);
}
@@ -1442,7 +1436,7 @@ void QDockWidget::paintEvent(QPaintEvent *event)
}
// Title must be painted after the frame, since the areas overlap, and
- // the title may wish to extend out to all sides (eg. XP style)
+ // the title may wish to extend out to all sides (eg. Vista style)
QStyleOptionDockWidget titleOpt;
initStyleOption(&titleOpt);
p.drawControl(QStyle::CE_DockWidgetTitle, titleOpt);
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index 437cee93df..d4ef33966b 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -50,6 +50,8 @@
#include "qelapsedtimer.h"
#include "qdebug.h"
+#include <private/qdesktopwidget_p.h>
+
QT_BEGIN_NAMESPACE
/*
@@ -97,7 +99,7 @@ static QAlphaWidget* q_blend = 0;
Constructs a QAlphaWidget.
*/
QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
- : QWidget(QApplication::desktop()->screen(QApplication::desktop()->screenNumber(w)), f)
+ : QWidget(QApplication::desktop()->screen(QDesktopWidgetPrivate::screenNumber(w)), f)
{
#ifndef Q_OS_WIN
setEnabled(false);
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index f206d01999..1c56c19c8f 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -47,6 +47,7 @@
#include <qapplication.h>
#include <private/qcombobox_p.h>
#include <QDesktopWidget>
+#include <private/qdesktopwidget_p.h>
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -540,7 +541,7 @@ bool QFontComboBox::event(QEvent *e)
QListView *lview = qobject_cast<QListView*>(view());
if (lview) {
lview->window()->setFixedWidth(qMin(width() * 5 / 3,
- QApplication::desktop()->availableGeometry(lview).width()));
+ QDesktopWidgetPrivate::availableGeometry(lview).width()));
}
}
return QComboBox::event(e);
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index eb4cb96c01..06e878f657 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -77,7 +77,10 @@
#include "private/qapplication_p.h"
#include "private/qshortcutmap_p.h"
#include "qkeysequence.h"
-#define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
+#define ACCEL_KEY(k) ((qApp->testAttribute(Qt::AA_DontShowIconsInMenus) \
+ ? false \
+ : qApp->styleHints()->showShortcutsInContextMenus()) \
+ && !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
#else
#define ACCEL_KEY(k) QString()
@@ -90,10 +93,6 @@
QT_BEGIN_NAMESPACE
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-extern void qt_mac_secure_keyboard(bool); //qapplication_mac.cpp
-#endif
-
/*!
Initialize \a option with the values from this QLineEdit. This method
is useful for subclasses when they need a QStyleOptionFrame, but don't want
@@ -575,10 +574,6 @@ void QLineEdit::setEchoMode(EchoMode mode)
setInputMethodHints(imHints);
d->control->setEchoMode(mode);
update();
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (hasFocus())
- qt_mac_secure_keyboard(mode == Password || mode == NoEcho);
-#endif
}
@@ -961,6 +956,8 @@ QString QLineEdit::selectedText() const
line edit or -1 if no text is selected.
\sa selectedText()
+ \sa selectionEnd()
+ \sa selectionLength()
*/
int QLineEdit::selectionStart() const
@@ -969,8 +966,33 @@ int QLineEdit::selectionStart() const
return d->control->selectionStart();
}
+/*!
+ Returns the index of the character directly after the selection
+ in the line edit or -1 if no text is selected.
+ \since 5.10
+
+ \sa selectedText()
+ \sa selectionStart()
+ \sa selectionLength()
+*/
+int QLineEdit::selectionEnd() const
+{
+ Q_D(const QLineEdit);
+ return d->control->selectionEnd();
+}
+/*!
+ Returns the length of the selection.
+ \since 5.10
+ \sa selectedText()
+ \sa selectionStart()
+ \sa selectionEnd()
+*/
+int QLineEdit::selectionLength() const
+{
+ return selectionEnd() - selectionStart();
+}
/*!
Selects text from position \a start and for \a length characters.
@@ -1560,7 +1582,7 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e)
d->control->copy(QClipboard::Selection);
} else if (!d->control->isReadOnly() && e->button() == Qt::MidButton) {
deselect();
- insert(QApplication::clipboard()->text(QClipboard::Selection));
+ d->control->paste(QClipboard::Selection);
}
}
#endif
@@ -1815,10 +1837,6 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
if((!hasSelectedText() && d->control->preeditAreaText().isEmpty())
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
d->setCursorVisible(true);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (d->control->echoMode() == Password || d->control->echoMode() == NoEcho)
- qt_mac_secure_keyboard(true);
-#endif
#ifdef QT_KEYPAD_NAVIGATION
d->control->setCancelText(d->control->text());
}
@@ -1863,10 +1881,6 @@ void QLineEdit::focusOutEvent(QFocusEvent *e)
if (hasAcceptableInput() || d->control->fixup())
emit editingFinished();
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (d->control->echoMode() == Password || d->control->echoMode() == NoEcho)
- qt_mac_secure_keyboard(false);
-#endif
#ifdef QT_KEYPAD_NAVIGATION
d->control->setCancelText(QString());
#endif
diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h
index dc0e694d07..ba6ef5c181 100644
--- a/src/widgets/widgets/qlineedit.h
+++ b/src/widgets/widgets/qlineedit.h
@@ -155,6 +155,8 @@ public:
bool hasSelectedText() const;
QString selectedText() const;
int selectionStart() const;
+ int selectionEnd() const;
+ int selectionLength() const;
bool isUndoAvailable() const;
bool isRedoAvailable() const;
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 9337595ead..15480e527e 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -68,13 +68,6 @@
#ifdef Q_OS_OSX
#include <qpa/qplatformnativeinterface.h>
#endif
-#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>
-QT_BEGIN_NAMESPACE
-extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp
-QT_END_NAMESPACE
-#endif
QT_BEGIN_NAMESPACE
@@ -87,13 +80,6 @@ public:
#ifdef Q_OS_OSX
, useUnifiedToolBar(false)
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- , useHIToolBar(false)
- , activateUnifiedToolbarAfterFullScreen(false)
-#endif
-#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR)
- , hasOldCursor(false) , cursorAdjusted(false)
-#endif
{ }
QMainWindowLayout *layout;
QSize iconSize;
@@ -102,22 +88,7 @@ public:
#ifdef Q_OS_OSX
bool useUnifiedToolBar;
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- bool useHIToolBar;
- bool activateUnifiedToolbarAfterFullScreen;
-#endif
void init();
- QList<int> hoverSeparator;
- QPoint hoverPos;
-
-#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR)
- QCursor separatorCursor(const QList<int> &path) const;
- void adjustCursor(const QPoint &pos);
- QCursor oldCursor;
- QCursor adjustedCursor;
- uint hasOldCursor : 1;
- uint cursorAdjusted : 1;
-#endif
static inline QMainWindowLayout *mainWindowLayout(const QMainWindow *mainWindow)
{
@@ -812,11 +783,7 @@ void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
#endif
}
- if (!d->layout->usesHIToolBar(toolbar)) {
- d->layout->removeWidget(toolbar);
- } else {
- d->layout->removeToolBar(toolbar);
- }
+ d->layout->removeToolBar(toolbar);
toolbar->d_func()->_q_updateIconSize(d->iconSize);
toolbar->d_func()->_q_updateToolButtonStyle(d->toolButtonStyle);
@@ -1118,21 +1085,6 @@ void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget
}
d_func()->layout->removeWidget(dockwidget); // in case it was already in here
addDockWidget(area, dockwidget, orientation);
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC //drawer support
- QMacAutoReleasePool pool;
- extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp
- if (qt_mac_is_macdrawer(dockwidget)) {
- extern bool qt_mac_set_drawer_preferred_edge(QWidget *, Qt::DockWidgetArea); //qwidget_mac.cpp
- window()->createWinId();
- dockwidget->window()->createWinId();
- qt_mac_set_drawer_preferred_edge(dockwidget, area);
- if (dockwidget->isVisible()) {
- dockwidget->hide();
- dockwidget->show();
- }
- }
-#endif
}
/*!
@@ -1351,153 +1303,14 @@ bool QMainWindow::restoreState(const QByteArray &state, int version)
return restored;
}
-#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR)
-QCursor QMainWindowPrivate::separatorCursor(const QList<int> &path) const
-{
- QDockAreaLayoutInfo *info = layout->layoutState.dockAreaLayout.info(path);
- Q_ASSERT(info != 0);
- if (path.size() == 1) { // is this the "top-level" separator which separates a dock area
- // from the central widget?
- switch (path.first()) {
- case QInternal::LeftDock:
- case QInternal::RightDock:
- return Qt::SplitHCursor;
- case QInternal::TopDock:
- case QInternal::BottomDock:
- return Qt::SplitVCursor;
- default:
- break;
- }
- }
-
- // no, it's a splitter inside a dock area, separating two dock widgets
-
- return info->o == Qt::Horizontal
- ? Qt::SplitHCursor : Qt::SplitVCursor;
-}
-
-void QMainWindowPrivate::adjustCursor(const QPoint &pos)
-{
- Q_Q(QMainWindow);
-
- hoverPos = pos;
-
- if (pos == QPoint(0, 0)) {
- if (!hoverSeparator.isEmpty())
- q->update(layout->layoutState.dockAreaLayout.separatorRect(hoverSeparator));
- hoverSeparator.clear();
-
- if (cursorAdjusted) {
- cursorAdjusted = false;
- if (hasOldCursor)
- q->setCursor(oldCursor);
- else
- q->unsetCursor();
- }
- } else if (layout->movingSeparator.isEmpty()) { // Don't change cursor when moving separator
- QList<int> pathToSeparator
- = layout->layoutState.dockAreaLayout.findSeparator(pos);
-
- if (pathToSeparator != hoverSeparator) {
- if (!hoverSeparator.isEmpty())
- q->update(layout->layoutState.dockAreaLayout.separatorRect(hoverSeparator));
-
- hoverSeparator = pathToSeparator;
-
- if (hoverSeparator.isEmpty()) {
- if (cursorAdjusted) {
- cursorAdjusted = false;
- if (hasOldCursor)
- q->setCursor(oldCursor);
- else
- q->unsetCursor();
- }
- } else {
- q->update(layout->layoutState.dockAreaLayout.separatorRect(hoverSeparator));
- if (!cursorAdjusted) {
- oldCursor = q->cursor();
- hasOldCursor = q->testAttribute(Qt::WA_SetCursor);
- }
- adjustedCursor = separatorCursor(hoverSeparator);
- q->setCursor(adjustedCursor);
- cursorAdjusted = true;
- }
- }
- }
-}
-#endif
-
/*! \reimp */
bool QMainWindow::event(QEvent *event)
{
Q_D(QMainWindow);
+ if (d->layout && d->layout->windowEvent(event))
+ return true;
switch (event->type()) {
-#if QT_CONFIG(dockwidget)
- case QEvent::Paint: {
- QPainter p(this);
- QRegion r = static_cast<QPaintEvent*>(event)->region();
- d->layout->layoutState.dockAreaLayout.paintSeparators(&p, this, r, d->hoverPos);
- break;
- }
-
-#ifndef QT_NO_CURSOR
- case QEvent::HoverMove: {
- d->adjustCursor(static_cast<QHoverEvent*>(event)->pos());
- break;
- }
-
- // We don't want QWidget to call update() on the entire QMainWindow
- // on HoverEnter and HoverLeave, hence accept the event (return true).
- case QEvent::HoverEnter:
- return true;
- case QEvent::HoverLeave:
- d->adjustCursor(QPoint(0, 0));
- return true;
- case QEvent::ShortcutOverride: // when a menu pops up
- d->adjustCursor(QPoint(0, 0));
- break;
-#endif // QT_NO_CURSOR
-
- case QEvent::MouseButtonPress: {
- QMouseEvent *e = static_cast<QMouseEvent*>(event);
- if (e->button() == Qt::LeftButton && d->layout->startSeparatorMove(e->pos())) {
- // The click was on a separator, eat this event
- e->accept();
- return true;
- }
- break;
- }
-
- case QEvent::MouseMove: {
- QMouseEvent *e = static_cast<QMouseEvent*>(event);
-
-#ifndef QT_NO_CURSOR
- d->adjustCursor(e->pos());
-#endif
- if (e->buttons() & Qt::LeftButton) {
- if (d->layout->separatorMove(e->pos())) {
- // We're moving a separator, eat this event
- e->accept();
- return true;
- }
- }
-
- break;
- }
-
- case QEvent::MouseButtonRelease: {
- QMouseEvent *e = static_cast<QMouseEvent*>(event);
- if (d->layout->endSeparatorMove(e->pos())) {
- // We've released a separator, eat this event
- e->accept();
- return true;
- }
- break;
- }
-
-#endif
-
#ifndef QT_NO_TOOLBAR
case QEvent::ToolBarChange: {
d->layout->toggleToolBarsVisible();
@@ -1523,40 +1336,6 @@ bool QMainWindow::event(QEvent *event)
if (!d->explicitIconSize)
setIconSize(QSize());
break;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- case QEvent::Show:
- if (unifiedTitleAndToolBarOnMac())
- d->layout->syncUnifiedToolbarVisibility();
- d->layout->blockVisiblityCheck = false;
- break;
- case QEvent::WindowStateChange:
- {
- if (isHidden()) {
- // We are coming out of a minimize, leave things as is.
- d->layout->blockVisiblityCheck = true;
- }
- // We need to update the HIToolbar status when we go out of or into fullscreen.
- QWindowStateChangeEvent *wce = static_cast<QWindowStateChangeEvent *>(event);
- if ((windowState() & Qt::WindowFullScreen) || (wce->oldState() & Qt::WindowFullScreen)) {
- d->layout->updateHIToolBarStatus();
- }
- }
- break;
-#endif
-#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR)
- case QEvent::CursorChange:
- // CursorChange events are triggered as mouse moves to new widgets even
- // if the cursor doesn't actually change, so do not change oldCursor if
- // the "changed" cursor has same shape as adjusted cursor.
- if (d->cursorAdjusted && d->adjustedCursor.shape() != cursor().shape()) {
- d->oldCursor = cursor();
- d->hasOldCursor = testAttribute(Qt::WA_SetCursor);
-
- // Ensure our adjusted cursor stays visible
- setCursor(d->adjustedCursor);
- }
- break;
-#endif
default:
break;
}
@@ -1596,33 +1375,6 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
(reinterpret_cast<SetContentBorderEnabledFunction>(function))(window()->windowHandle(), set);
update();
}
-#endif
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- Q_D(QMainWindow);
- if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3)
- return;
-
- d->useHIToolBar = set;
- createWinId(); // We need the hiview for down below.
-
- // Activate the unified toolbar with the raster engine.
- if (windowSurface() && set) {
- d->layout->unifiedSurface = new QUnifiedToolbarSurface(this);
- }
-
- d->layout->updateHIToolBarStatus();
-
- // Deactivate the unified toolbar with the raster engine.
- if (windowSurface() && !set) {
- if (d->layout->unifiedSurface) {
- delete d->layout->unifiedSurface;
- d->layout->unifiedSurface = 0;
- }
- }
-
- // Enabling the unified toolbar clears the opaque size grip setting, update it.
- d->macUpdateOpaqueSizeGrip();
#else
Q_UNUSED(set)
#endif
@@ -1633,9 +1385,6 @@ bool QMainWindow::unifiedTitleAndToolBarOnMac() const
#ifdef Q_OS_OSX
return d_func()->useUnifiedToolBar;
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- return d_func()->useHIToolBar && !testAttribute(Qt::WA_MacBrushedMetal) && !(windowFlags() & Qt::FramelessWindowHint);
-#endif
return false;
}
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 8c1a0d7937..da5f00efe0 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -78,10 +78,6 @@
#include <private/qapplication_p.h>
#include <private/qlayoutengine_p.h>
#include <private/qwidgetresizehandler_p.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
@@ -185,13 +181,17 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout)
/******************************************************************************
** QDockWidgetGroupWindow
*/
-// QDockWidgetGroupWindow is the floating window containing the tabbed dockwidgets in case several
-// dockwidgets are dragged together (QMainWindow::GroupedDragging feature).
+// QDockWidgetGroupWindow is the floating window containing several QDockWidgets floating together.
+// (QMainWindow::GroupedDragging feature)
// QDockWidgetGroupLayout is the layout of that window and use a QDockAreaLayoutInfo to layout
-// the tabs inside it.
+// the QDockWidgets inside it.
+// If there is only one QDockWidgets, or all QDockWidgets are tabbed together, it is equivalent
+// of a floating QDockWidget (the title of the QDockWidget is the title of the window). But if there
+// are nested QDockWidget, an additional title bar is there.
#if QT_CONFIG(dockwidget)
-class QDockWidgetGroupLayout : public QLayout {
- QDockAreaLayoutInfo info;
+class QDockWidgetGroupLayout : public QLayout,
+ public QMainWindowLayoutSeparatorHelper<QDockWidgetGroupLayout>
+{
QWidgetResizeHandler *resizer;
public:
QDockWidgetGroupLayout(QDockWidgetGroupWindow* parent) : QLayout(parent) {
@@ -200,7 +200,7 @@ public:
resizer->setMovingEnabled(false);
}
~QDockWidgetGroupLayout() {
- info.deleteAllLayoutItems();
+ layoutState.deleteAllLayoutItems();
}
void addItem(QLayoutItem*) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
@@ -208,32 +208,43 @@ public:
QLayoutItem* itemAt(int index) const Q_DECL_OVERRIDE
{
int x = 0;
- return info.itemAt(&x, index);
+ return layoutState.itemAt(&x, index);
}
QLayoutItem* takeAt(int index) Q_DECL_OVERRIDE
{
int x = 0;
- return info.takeAt(&x, index);
+ QLayoutItem *ret = layoutState.takeAt(&x, index);
+ if (savedState.rect.isValid() && ret->widget()) {
+ // we need to remove the item also from the saved state to prevent crash
+ QList<int> path = savedState.indexOf(ret->widget());
+ if (!path.isEmpty())
+ savedState.remove(path);
+ // Also, the item may be contained several times as a gap item.
+ path = layoutState.indexOf(ret->widget());
+ if (!path.isEmpty())
+ layoutState.remove(path);
+ }
+ return ret;
}
QSize sizeHint() const Q_DECL_OVERRIDE
{
int fw = frameWidth();
- return info.sizeHint() + QSize(fw, fw);
+ return layoutState.sizeHint() + QSize(fw, fw);
}
QSize minimumSize() const Q_DECL_OVERRIDE
{
int fw = frameWidth();
- return info.minimumSize() + QSize(fw, fw);
+ return layoutState.minimumSize() + QSize(fw, fw);
}
QSize maximumSize() const Q_DECL_OVERRIDE
{
int fw = frameWidth();
- return info.maximumSize() + QSize(fw, fw);
+ return layoutState.maximumSize() + QSize(fw, fw);
}
void setGeometry(const QRect&r) Q_DECL_OVERRIDE
{
groupWindow()->destroyOrHideIfEmpty();
- QDockAreaLayoutInfo *li = layoutInfo();
+ QDockAreaLayoutInfo *li = dockAreaLayoutInfo();
if (li->isEmpty())
return;
int fw = frameWidth();
@@ -243,12 +254,12 @@ public:
li->rect = r.adjusted(fw, fw, -fw, -fw);
li->fitItems();
li->apply(false);
+ if (savedState.rect.isValid())
+ savedState.rect = li->rect;
resizer->setActive(QWidgetResizeHandler::Resize, !nativeWindowDeco());
}
- QDockAreaLayoutInfo *layoutInfo() {
- return &info;
- }
+ QDockAreaLayoutInfo *dockAreaLayoutInfo() { return &layoutState; }
bool nativeWindowDeco() const
{
@@ -265,14 +276,21 @@ public:
{
return static_cast<QDockWidgetGroupWindow *>(parent());
}
+
+ QDockAreaLayoutInfo layoutState;
+ QDockAreaLayoutInfo savedState;
};
bool QDockWidgetGroupWindow::event(QEvent *e)
{
+ auto lay = static_cast<QDockWidgetGroupLayout *>(layout());
+ if (lay && lay->windowEvent(e))
+ return true;
+
switch (e->type()) {
case QEvent::Close:
// Forward the close to the QDockWidget just as if its close button was pressed
- if (QDockWidget *dw = topDockWidget()) {
+ if (QDockWidget *dw = activeTabbedDockWidget()) {
e->ignore();
dw->close();
adjustFlags();
@@ -280,7 +298,7 @@ bool QDockWidgetGroupWindow::event(QEvent *e)
return true;
case QEvent::Move:
// Let QDockWidgetPrivate::moseEvent handle the dragging
- if (QDockWidget *dw = topDockWidget())
+ if (QDockWidget *dw = activeTabbedDockWidget())
static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(dw))->moveEvent(static_cast<QMoveEvent*>(e));
return true;
case QEvent::NonClientAreaMouseMove:
@@ -288,7 +306,7 @@ bool QDockWidgetGroupWindow::event(QEvent *e)
case QEvent::NonClientAreaMouseButtonRelease:
case QEvent::NonClientAreaMouseButtonDblClick:
// Let the QDockWidgetPrivate of the currently visible dock widget handle the drag and drop
- if (QDockWidget *dw = topDockWidget())
+ if (QDockWidget *dw = activeTabbedDockWidget())
static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(dw))->nonClientAreaMouseEvent(static_cast<QMouseEvent*>(e));
return true;
case QEvent::ChildAdded:
@@ -320,17 +338,49 @@ void QDockWidgetGroupWindow::paintEvent(QPaintEvent *)
QDockAreaLayoutInfo *QDockWidgetGroupWindow::layoutInfo() const
{
- return static_cast<QDockWidgetGroupLayout*>(layout())->layoutInfo();
+ return static_cast<QDockWidgetGroupLayout *>(layout())->dockAreaLayoutInfo();
+}
+
+/*! \internal
+ If this is a floating tab bar returns the currently the QDockWidgetGroupWindow that contains
+ tab, otherwise, return nullptr;
+ \note: if there is only one QDockWidget, it's still considered as a floating tab
+ */
+const QDockAreaLayoutInfo *QDockWidgetGroupWindow::tabLayoutInfo() const
+{
+ const QDockAreaLayoutInfo *info = layoutInfo();
+ while (info && !info->tabbed) {
+ // There should be only one tabbed subinfo otherwise we are not a floating tab but a real
+ // window
+ const QDockAreaLayoutInfo *next = nullptr;
+ bool isSingle = false;
+ for (const auto &item : info->item_list) {
+ if (item.skip() || (item.flags & QDockAreaLayoutItem::GapItem))
+ continue;
+ if (next || isSingle) // Two visible things
+ return nullptr;
+ if (item.subinfo)
+ next = item.subinfo;
+ else if (item.widgetItem)
+ isSingle = true;
+ }
+ if (isSingle)
+ return info;
+ info = next;
+ }
+ return info;
}
/*! \internal
- Returns the currently active QDockWidget.
+ If this is a floating tab bar returns the currently active QDockWidget, otherwise nullptr
*/
-QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
+QDockWidget *QDockWidgetGroupWindow::activeTabbedDockWidget() const
{
- QDockAreaLayoutInfo *info = layoutInfo();
- QDockWidget *dw = 0;
+ QDockWidget *dw = nullptr;
#if QT_CONFIG(tabbar)
+ const QDockAreaLayoutInfo *info = tabLayoutInfo();
+ if (!info)
+ return nullptr;
if (info->tabBar && info->tabBar->currentIndex() >= 0) {
int i = info->tabIndexToListIndex(info->tabBar->currentIndex());
if (i >= 0) {
@@ -339,7 +389,6 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
}
}
-#endif
if (!dw) {
for (int i = 0; !dw && i < info->item_list.count(); ++i) {
const QDockAreaLayoutItem &item = info->item_list.at(i);
@@ -350,6 +399,7 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
}
}
+#endif
return dw;
}
@@ -396,18 +446,18 @@ void QDockWidgetGroupWindow::destroyOrHideIfEmpty()
}
/*! \internal
- Sets the flags of this window in accordence to the capabilities of the dock widgets
+ Sets the flags of this window in accordance to the capabilities of the dock widgets
*/
void QDockWidgetGroupWindow::adjustFlags()
{
- QDockWidget *top = topDockWidget();
- if (!top)
- return;
- const bool nativeDeco = static_cast<QDockWidgetGroupLayout *>(layout())->nativeWindowDeco();
-
Qt::WindowFlags oldFlags = windowFlags();
Qt::WindowFlags flags = oldFlags;
- if (nativeDeco) {
+
+ QDockWidget *top = activeTabbedDockWidget();
+ if (!top) { // nested tabs, show window decoration
+ flags =
+ ((oldFlags & ~Qt::FramelessWindowHint) | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
+ } else if (static_cast<QDockWidgetGroupLayout *>(layout())->nativeWindowDeco()) {
flags |= Qt::CustomizeWindowHint | Qt::WindowTitleHint;
flags.setFlag(Qt::WindowCloseButtonHint, top->features() & QDockWidget::DockWidgetClosable);
flags &= ~Qt::FramelessWindowHint;
@@ -440,21 +490,99 @@ void QDockWidgetGroupWindow::adjustFlags()
show(); // setWindowFlags hides the window
}
- setWindowTitle(top->windowTitle());
- setWindowIcon(top->windowIcon());
+ QWidget *titleBarOf = top ? top : parentWidget();
+ setWindowTitle(titleBarOf->windowTitle());
+ setWindowIcon(titleBarOf->windowIcon());
}
bool QDockWidgetGroupWindow::hasNativeDecos() const
{
+ QDockWidget *dw = activeTabbedDockWidget();
+ if (!dw) // We have a group of nested QDockWidgets (not just floating tabs)
+ return true;
+
if (!QDockWidgetLayout::wmSupportsNativeWindowDeco())
return false;
- if (QDockWidget *dw = topDockWidget())
- return dw->titleBarWidget() == nullptr;
+ return dw->titleBarWidget() == nullptr;
+}
+/*
+ The given widget is hovered over this floating group.
+ This function will save the state and create a gap in the actual state.
+ currentGapRect and currentGapPos will be set.
+ One must call restore() or apply() after this function.
+ Returns true if there was any change in the currentGapPos
+ */
+bool QDockWidgetGroupWindow::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
+{
+ QDockAreaLayoutInfo &savedState = static_cast<QDockWidgetGroupLayout *>(layout())->savedState;
+ if (savedState.isEmpty())
+ savedState = *layoutInfo();
+
+ QMainWindow::DockOptions opts = static_cast<QMainWindow *>(parentWidget())->dockOptions();
+ bool nestingEnabled =
+ (opts & QMainWindow::AllowNestedDocks) && !(opts & QMainWindow::ForceTabbedDocks);
+ QDockAreaLayoutInfo::TabMode tabMode =
+ 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)) };
+ newState.item_list.first().size = pick(savedState.o, savedState.rect.size());
+ newState.tabbed = false;
+ newState.tabBar = nullptr;
+ }
+
+ auto newGapPos = newState.gapIndex(mousePos, nestingEnabled, tabMode);
+ Q_ASSERT(!newGapPos.isEmpty());
+ if (newGapPos == currentGapPos)
+ return false; // gap is already there
+ currentGapPos = newGapPos;
+ newState.insertGap(currentGapPos, widgetItem);
+ newState.fitItems();
+ currentGapRect = newState.info(currentGapPos)->itemRect(currentGapPos.last(), true);
+ *layoutInfo() = std::move(newState);
+ layoutInfo()->apply(opts & QMainWindow::AnimatedDocks);
return true;
}
+/*
+ Remove the gap that was created by hover()
+ */
+void QDockWidgetGroupWindow::restore()
+{
+ QDockAreaLayoutInfo &savedState = static_cast<QDockWidgetGroupLayout *>(layout())->savedState;
+ if (!savedState.isEmpty()) {
+ *layoutInfo() = savedState;
+ savedState = QDockAreaLayoutInfo();
+ }
+ currentGapRect = QRect();
+ currentGapPos.clear();
+ adjustFlags();
+ layoutInfo()->fitItems();
+ layoutInfo()->apply(static_cast<QMainWindow *>(parentWidget())->dockOptions()
+ & QMainWindow::AnimatedDocks);
+}
+
+/*
+ Apply the state that was created by hover
+ */
+void QDockWidgetGroupWindow::apply()
+{
+ static_cast<QDockWidgetGroupLayout *>(layout())->savedState.clear();
+ currentGapRect = QRect();
+ layoutInfo()->plug(currentGapPos);
+ currentGapPos.clear();
+ adjustFlags();
+ layoutInfo()->apply(false);
+}
+
#endif
/******************************************************************************
@@ -708,7 +836,14 @@ QList<int> QMainWindowLayoutState::gapIndex(QWidget *widget,
// is it a dock widget?
if (qobject_cast<QDockWidget *>(widget) != 0
|| qobject_cast<QDockWidgetGroupWindow *>(widget)) {
- result = dockAreaLayout.gapIndex(pos);
+ bool disallowTabs = false;
+#if QT_CONFIG(tabbar)
+ if (auto *group = qobject_cast<QDockWidgetGroupWindow *>(widget)) {
+ if (!group->tabLayoutInfo()) // Disallow to drop nested docks as a tab
+ disallowTabs = true;
+ }
+#endif
+ result = dockAreaLayout.gapIndex(pos, disallowTabs);
if (!result.isEmpty())
result.prepend(1);
return result;
@@ -1191,14 +1326,7 @@ void QMainWindowLayout::removeToolBar(QToolBar *toolbar)
QObject::disconnect(parentWidget(), SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (usesHIToolBar(toolbar)) {
- removeFromMacToolbar(toolbar);
- } else
-#endif
- {
- removeWidget(toolbar);
- }
+ removeWidget(toolbar);
}
}
@@ -1210,25 +1338,17 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
bool)
{
validateToolBarArea(area);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if ((area == Qt::TopToolBarArea)
- && layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
- insertIntoMacToolbar(0, toolbar);
- } else
-#endif
- {
- //let's add the toolbar to the layout
- addChildWidget(toolbar);
- QLayoutItem * item = layoutState.toolBarAreaLayout.addToolBar(toDockPos(area), toolbar);
- if (savedState.isValid() && item) {
- // copy the toolbar also in the saved state
- savedState.toolBarAreaLayout.insertItem(toDockPos(area), item);
- }
- invalidate();
-
- //this ensures that the toolbar has the right window flags (not floating any more)
- toolbar->d_func()->updateWindowFlags(false /*floating*/);
+ // let's add the toolbar to the layout
+ addChildWidget(toolbar);
+ QLayoutItem *item = layoutState.toolBarAreaLayout.addToolBar(toDockPos(area), toolbar);
+ if (savedState.isValid() && item) {
+ // copy the toolbar also in the saved state
+ savedState.toolBarAreaLayout.insertItem(toDockPos(area), item);
}
+ invalidate();
+
+ // this ensures that the toolbar has the right window flags (not floating any more)
+ toolbar->d_func()->updateWindowFlags(false /*floating*/);
}
/*!
@@ -1236,27 +1356,20 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
*/
void QMainWindowLayout::insertToolBar(QToolBar *before, QToolBar *toolbar)
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (usesHIToolBar(before)) {
- insertIntoMacToolbar(before, toolbar);
- } else
-#endif
- {
- addChildWidget(toolbar);
- QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
- if (savedState.isValid() && item) {
- // copy the toolbar also in the saved state
- savedState.toolBarAreaLayout.insertItem(before, item);
- }
- if (!currentGapPos.isEmpty() && currentGapPos.constFirst() == 0) {
- currentGapPos = layoutState.toolBarAreaLayout.currentGapIndex();
- if (!currentGapPos.isEmpty()) {
- currentGapPos.prepend(0);
- currentGapRect = layoutState.itemRect(currentGapPos);
- }
+ addChildWidget(toolbar);
+ QLayoutItem *item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
+ if (savedState.isValid() && item) {
+ // copy the toolbar also in the saved state
+ savedState.toolBarAreaLayout.insertItem(before, item);
+ }
+ if (!currentGapPos.isEmpty() && currentGapPos.constFirst() == 0) {
+ currentGapPos = layoutState.toolBarAreaLayout.currentGapIndex();
+ if (!currentGapPos.isEmpty()) {
+ currentGapPos.prepend(0);
+ currentGapRect = layoutState.itemRect(currentGapPos);
}
- invalidate();
}
+ invalidate();
}
Qt::ToolBarArea QMainWindowLayout::toolBarArea(QToolBar *toolbar) const
@@ -1269,12 +1382,6 @@ Qt::ToolBarArea QMainWindowLayout::toolBarArea(QToolBar *toolbar) const
case QInternal::BottomDock: return Qt::BottomToolBarArea;
default: break;
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (pos == QInternal::DockCount) {
- if (qtoolbarsInUnifiedToolbarList.contains(toolbar))
- return Qt::TopToolBarArea;
- }
-#endif
return Qt::NoToolBarArea;
}
@@ -1291,70 +1398,15 @@ void QMainWindowLayout::getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar
void QMainWindowLayout::toggleToolBarsVisible()
{
- bool updateNonUnifiedParts = true;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
- // If we hit this case, someone has pressed the "toolbar button" which will
- // toggle the unified toolbar visibility, because that's what the user wants.
- // We might be in a situation where someone has hidden all the toolbars
- // beforehand (maybe in construction), but now they've hit this button and
- // and are expecting the items to show. What do we do?
- // 1) Check the visibility of all the toolbars, if one is visible, do nothing, this
- // preserves what people would expect (these toolbars were visible when I clicked last time).
- // 2) If NONE are visible, then show them all. Again, this preserves the user expectation
- // of, "I want to see the toolbars." The user may get more toolbars than expected, but this
- // is better seeing nothing.
- // Don't worry about any of this if we are going invisible. This does mean we may get
- // into issues when switching into and out of fullscreen mode, but this is probably minor.
- // If we ever need to do hiding, that would have to be taken care of after the unified toolbar
- // has finished hiding.
- // People can of course handle the QEvent::ToolBarChange event themselves and do
- // WHATEVER they want if they don't like what we are doing (though the unified toolbar
- // will fire regardless).
-
- // Check if we REALLY need to update the geometry below. If we only have items in the
- // unified toolbar, all the docks will be empty, so there's very little point
- // in doing the geometry as Apple will do it (we also avoid flicker in Cocoa as well).
- // FWIW, layoutState.toolBarAreaLayout.visible and the state of the unified toolbar
- // visibility can get out of sync. I really don't think it's a big issue. It is kept
- // to a minimum because we only change the visibility if we absolutely must.
- // update the "non unified parts."
- updateNonUnifiedParts = !layoutState.toolBarAreaLayout.isEmpty();
-
- // We get this function before the unified toolbar does its thing.
- // So, the value will be opposite of what we expect.
- bool goingVisible = !macWindowToolbarIsVisible(qt_mac_window_for(layoutState.mainWindow));
- if (goingVisible) {
- const int ToolBarCount = qtoolbarsInUnifiedToolbarList.size();
- bool needAllVisible = true;
- for (int i = 0; i < ToolBarCount; ++i) {
- if (!qtoolbarsInUnifiedToolbarList.at(i)->isHidden()) {
- needAllVisible = false;
- break;
- }
- }
- if (needAllVisible) {
- QBoolBlocker blocker(blockVisiblityCheck); // Disable the visibilty check because
- // the toggle has already happened.
- for (int i = 0; i < ToolBarCount; ++i)
- qtoolbarsInUnifiedToolbarList.at(i)->setVisible(true);
- }
- }
- if (!updateNonUnifiedParts)
- layoutState.toolBarAreaLayout.visible = goingVisible;
- }
-#endif
- if (updateNonUnifiedParts) {
- layoutState.toolBarAreaLayout.visible = !layoutState.toolBarAreaLayout.visible;
- if (!layoutState.mainWindow->isMaximized()) {
- QPoint topLeft = parentWidget()->geometry().topLeft();
- QRect r = parentWidget()->geometry();
- r = layoutState.toolBarAreaLayout.rectHint(r);
- r.moveTo(topLeft);
- parentWidget()->setGeometry(r);
- } else {
- update();
- }
+ layoutState.toolBarAreaLayout.visible = !layoutState.toolBarAreaLayout.visible;
+ if (!layoutState.mainWindow->isMaximized()) {
+ QPoint topLeft = parentWidget()->geometry().topLeft();
+ QRect r = parentWidget()->geometry();
+ r = layoutState.toolBarAreaLayout.rectHint(r);
+ r.moveTo(topLeft);
+ parentWidget()->setGeometry(r);
+ } else {
+ update();
}
}
@@ -1784,39 +1836,6 @@ void QMainWindowLayout::tabMoved(int from, int to)
}
#endif // QT_CONFIG(tabbar)
-bool QMainWindowLayout::startSeparatorMove(const QPoint &pos)
-{
- movingSeparator = layoutState.dockAreaLayout.findSeparator(pos);
-
- if (movingSeparator.isEmpty())
- return false;
-
- layoutState.dockAreaLayout.fallbackToSizeHints = false;
-
- savedState = layoutState;
- movingSeparatorPos = movingSeparatorOrigin = pos;
-
- return true;
-}
-
-bool QMainWindowLayout::separatorMove(const QPoint &pos)
-{
- if (movingSeparator.isEmpty())
- return false;
- movingSeparatorPos = pos;
- separatorMoveTimer.start(0, this);
- return true;
-}
-
-bool QMainWindowLayout::endSeparatorMove(const QPoint&)
-{
- if (movingSeparator.isEmpty())
- return false;
- movingSeparator.clear();
- savedState.clear();
- return true;
-}
-
void QMainWindowLayout::raise(QDockWidget *widget)
{
#if QT_CONFIG(tabbar)
@@ -1941,14 +1960,6 @@ QSize QMainWindowLayout::minimumSize() const
const QSize sbMin = statusbar ? statusbar->minimumSize() : QSize(0, 0);
minSize = QSize(qMax(sbMin.width(), minSize.width()),
sbMin.height() + minSize.height());
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- const QSize storedSize = minSize;
- int minWidth = 0;
- foreach (QToolBar *toolbar, qtoolbarsInUnifiedToolbarList) {
- minWidth += toolbar->sizeHint().width() + 20;
- }
- minSize = QSize(qMax(minWidth, storedSize.width()), storedSize.height());
-#endif
}
return minSize;
}
@@ -1960,12 +1971,16 @@ void QMainWindowLayout::invalidate()
}
#if QT_CONFIG(dockwidget)
-void QMainWindowLayout::setCurrentHoveredFloat(QWidget *w)
+void QMainWindowLayout::setCurrentHoveredFloat(QDockWidgetGroupWindow *w)
{
if (currentHoveredFloat != w) {
if (currentHoveredFloat) {
disconnect(currentHoveredFloat.data(), &QObject::destroyed,
this, &QMainWindowLayout::updateGapIndicator);
+ if (currentHoveredFloat)
+ currentHoveredFloat->restore();
+ } else if (w) {
+ restore(true);
}
currentHoveredFloat = w;
@@ -2036,52 +2051,30 @@ void QMainWindowLayout::revert(QLayoutItem *widgetItem)
bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
{
-#if QT_CONFIG(dockwidget)
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget) && QT_CONFIG(tabbar)
if (currentHoveredFloat) {
QWidget *widget = widgetItem->widget();
QList<int> previousPath = layoutState.indexOf(widget);
if (!previousPath.isEmpty())
layoutState.remove(previousPath);
+ previousPath = currentHoveredFloat->layoutInfo()->indexOf(widget);
// Let's remove the widget from any possible group window
foreach (QDockWidgetGroupWindow *dwgw,
parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
+ if (dwgw == currentHoveredFloat)
+ continue;
QList<int> path = dwgw->layoutInfo()->indexOf(widget);
if (!path.isEmpty())
dwgw->layoutInfo()->remove(path);
}
currentGapRect = QRect();
-#if QT_CONFIG(tabwidget)
- if (QDockWidget *dropTo = qobject_cast<QDockWidget*>(currentHoveredFloat)) {
- //dropping to a normal widget, we mutate it in a QDockWidgetGroupWindow with two tabs
- QDockWidgetGroupWindow *floatingTabs = createTabbedDockWindow();
- floatingTabs->setGeometry(dropTo->geometry());
- QDockAreaLayoutInfo *info = floatingTabs->layoutInfo();
- *info = QDockAreaLayoutInfo(&layoutState.dockAreaLayout.sep, QInternal::LeftDock,
- Qt::Horizontal, QTabBar::RoundedSouth,
- static_cast<QMainWindow*>(parentWidget()));
- info->tabbed = true;
- QLayout *parentLayout = currentHoveredFloat->parentWidget()->layout();
- info->item_list.append(QDockAreaLayoutItem(parentLayout->takeAt(parentLayout->indexOf(currentHoveredFloat))));
-
- dropTo->setParent(floatingTabs);
- dropTo->show();
- dropTo->d_func()->plug(QRect());
- setCurrentHoveredFloat(floatingTabs);
- }
-#endif // QT_CONFIG(tabwidget)
-#if QT_CONFIG(tabbar)
- QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat);
- Q_ASSERT(dwgw);
- Q_ASSERT(dwgw->layoutInfo()->tabbed); // because floating group should always be tabbed
- previousPath = dwgw->layoutInfo()->indexOf(widget);
+ currentHoveredFloat->apply();
if (!previousPath.isEmpty())
- dwgw->layoutInfo()->remove(previousPath);
- dwgw->layoutInfo()->tab(0, widgetItem);
- QRect globalRect = dwgw->layoutInfo()->tabContentRect();
- globalRect.moveTopLeft(dwgw->mapToGlobal(globalRect.topLeft()));
+ currentHoveredFloat->layoutInfo()->remove(previousPath);
+ QRect globalRect = currentHoveredFloat->currentGapRect;
+ globalRect.moveTopLeft(currentHoveredFloat->mapToGlobal(globalRect.topLeft()));
pluggingWidget = widget;
widgetAnimator.animate(widget, globalRect, dockOptions & QMainWindow::AnimatedDocks);
-#endif // QT_CONFIG(tabbar)
return true;
}
#endif
@@ -2150,57 +2143,55 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
if (widget == pluggingWidget) {
#if QT_CONFIG(dockwidget)
+#if QT_CONFIG(tabbar)
if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(widget)) {
// When the animated widget was a QDockWidgetGroupWindow, it means each of the
// embedded QDockWidget needs to be plugged back into the QMainWindow layout.
savedState.clear();
- QDockAreaLayoutInfo* info = dwgw->layoutInfo();
- QDockAreaLayoutInfo* parentInfo;
- QList<int> path;
-
- if (QDockWidgetGroupWindow *dropTo = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat)) {
- parentInfo = dropTo->layoutInfo();
-#if QT_CONFIG(tabbar)
- Q_ASSERT(parentInfo->tabbed);
-#endif
- path = parentInfo->indexOf(widget);
- Q_ASSERT(path.size() == 1);
+ QDockAreaLayoutInfo *srcInfo = dwgw->layoutInfo();
+ const QDockAreaLayoutInfo *srcTabInfo = dwgw->tabLayoutInfo();
+ QDockAreaLayoutInfo *dstParentInfo;
+ QList<int> dstPath;
+
+ if (currentHoveredFloat) {
+ dstPath = currentHoveredFloat->layoutInfo()->indexOf(widget);
+ Q_ASSERT(dstPath.size() >= 1);
+ dstParentInfo = currentHoveredFloat->layoutInfo()->info(dstPath);
} else {
- path = layoutState.dockAreaLayout.indexOf(widget);
- Q_ASSERT(path.size() >= 2);
- parentInfo = layoutState.dockAreaLayout.info(path);
- Q_ASSERT(parentInfo);
+ dstPath = layoutState.dockAreaLayout.indexOf(widget);
+ Q_ASSERT(dstPath.size() >= 2);
+ dstParentInfo = layoutState.dockAreaLayout.info(dstPath);
}
-#if QT_CONFIG(tabbar)
- if (parentInfo->tabbed) {
+ Q_ASSERT(dstParentInfo);
+ int idx = dstPath.constLast();
+ Q_ASSERT(dstParentInfo->item_list[idx].widgetItem->widget() == dwgw);
+ if (dstParentInfo->tabbed && srcTabInfo) {
// merge the two tab widgets
- int idx = path.constLast();
- Q_ASSERT(parentInfo->item_list[idx].widgetItem->widget() == dwgw);
- delete parentInfo->item_list[idx].widgetItem;
- parentInfo->item_list.removeAt(idx);
- std::copy(info->item_list.cbegin(), info->item_list.cend(),
- std::inserter(parentInfo->item_list, parentInfo->item_list.begin() + idx));
- quintptr currentId = info->currentTabId();
- *info = QDockAreaLayoutInfo();
- parentInfo->reparentWidgets(currentHoveredFloat ? currentHoveredFloat.data() : parentWidget());
- parentInfo->updateTabBar();
- parentInfo->setCurrentTabId(currentId);
- } else
-#endif // QT_CONFIG(tabbar)
- {
- QDockAreaLayoutItem &item = layoutState.dockAreaLayout.item(path);
+ delete dstParentInfo->item_list[idx].widgetItem;
+ dstParentInfo->item_list.removeAt(idx);
+ std::copy(srcTabInfo->item_list.cbegin(), srcTabInfo->item_list.cend(),
+ std::inserter(dstParentInfo->item_list,
+ dstParentInfo->item_list.begin() + idx));
+ quintptr currentId = srcTabInfo->currentTabId();
+ *srcInfo = QDockAreaLayoutInfo();
+ dstParentInfo->reparentWidgets(currentHoveredFloat ? currentHoveredFloat.data()
+ : parentWidget());
+ dstParentInfo->updateTabBar();
+ dstParentInfo->setCurrentTabId(currentId);
+ } else {
+ QDockAreaLayoutItem &item = dstParentInfo->item_list[idx];
Q_ASSERT(item.widgetItem->widget() == dwgw);
delete item.widgetItem;
item.widgetItem = 0;
- item.subinfo = new QDockAreaLayoutInfo(qMove(*info));
- *info = QDockAreaLayoutInfo();
-#if QT_CONFIG(tabbar)
- item.subinfo->reparentWidgets(parentWidget());
- item.subinfo->setTabBarShape(parentInfo->tabBarShape);
-#endif
+ item.subinfo = new QDockAreaLayoutInfo(std::move(*srcInfo));
+ *srcInfo = QDockAreaLayoutInfo();
+ item.subinfo->reparentWidgets(currentHoveredFloat ? currentHoveredFloat.data()
+ : parentWidget());
+ item.subinfo->setTabBarShape(dstParentInfo->tabBarShape);
}
dwgw->destroyOrHideIfEmpty();
}
+#endif
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
dw->setParent(currentHoveredFloat ? currentHoveredFloat.data() : parentWidget());
@@ -2280,9 +2271,6 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
#endif // QT_CONFIG(dockwidget)
, widgetAnimator(this)
, pluggingWidget(0)
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- , blockVisiblityCheck(false)
-#endif
{
if (parentLayout)
setParent(parentLayout);
@@ -2307,10 +2295,6 @@ QMainWindowLayout::~QMainWindowLayout()
layoutState.deleteAllLayoutItems();
layoutState.deleteCentralWidgetItem();
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- cleanUpMacToolbarItems();
-#endif
-
delete statusbar;
}
@@ -2363,6 +2347,36 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget)
invalidate();
}
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
+/*! \internal
+ This helper function is called by QMainWindowLayout::unplug if QMainWindow::GroupedDragging is
+ set and we are dragging the title bar of a non-floating QDockWidget.
+ If one should unplug the whole group, do so and return true, otherwise return false.
+ \a item is pointing to the QLayoutItem that holds the QDockWidget, but will be updated to the
+ QLayoutItem that holds the new QDockWidgetGroupWindow if the group is unplugged.
+*/
+static bool unplugGroup(QMainWindowLayout *layout, QLayoutItem **item,
+ QDockAreaLayoutItem &parentItem)
+{
+ if (!parentItem.subinfo || !parentItem.subinfo->tabbed)
+ return false;
+
+ // The QDockWidget is part of a group of tab and we need to unplug them all.
+
+ QDockWidgetGroupWindow *floatingTabs = layout->createTabbedDockWindow();
+ QDockAreaLayoutInfo *info = floatingTabs->layoutInfo();
+ *info = std::move(*parentItem.subinfo);
+ delete parentItem.subinfo;
+ parentItem.subinfo = nullptr;
+ floatingTabs->setGeometry(info->rect.translated(layout->parentWidget()->pos()));
+ floatingTabs->show();
+ floatingTabs->raise();
+ *item = new QDockWidgetGroupWindowItem(floatingTabs);
+ parentItem.widgetItem = *item;
+ return true;
+}
+#endif
+
/*! \internal
Unplug \a widget (QDockWidget or QToolBar) from it's parent container.
@@ -2376,19 +2390,31 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget)
QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
{
#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar)
- if (!widget->isWindow() && qobject_cast<const QDockWidgetGroupWindow *>(widget->parentWidget())) {
- if (group) {
+ auto *groupWindow = qobject_cast<const QDockWidgetGroupWindow *>(widget->parentWidget());
+ if (!widget->isWindow() && groupWindow) {
+ if (group && groupWindow->tabLayoutInfo()) {
// We are just dragging a floating window as it, not need to do anything, we just have to
// look up the corresponding QWidgetItem* if it exists
- QList<int> tabbedWindowPath = layoutState.indexOf(widget->parentWidget());
- return tabbedWindowPath.isEmpty() ? 0 : layoutState.item(tabbedWindowPath);
+ if (QDockAreaLayoutInfo *info = dockInfo(widget->parentWidget())) {
+ QList<int> groupWindowPath = info->indexOf(widget->parentWidget());
+ return groupWindowPath.isEmpty() ? nullptr : info->item(groupWindowPath).widgetItem;
+ }
+ return nullptr;
+ }
+ QList<int> path = groupWindow->layoutInfo()->indexOf(widget);
+ QLayoutItem *item = groupWindow->layoutInfo()->item(path).widgetItem;
+ if (group && path.size() > 1
+ && unplugGroup(this, &item,
+ groupWindow->layoutInfo()->item(path.mid(0, path.size() - 1)))) {
+ return item;
} else {
// We are unplugging a dock widget from a floating window.
- if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
- dw->d_func()->unplug(widget->geometry());
- int index = widget->parentWidget()->layout()->indexOf(widget);
- return widget->parentWidget()->layout()->itemAt(index);
- }
+ QDockWidget *dw = qobject_cast<QDockWidget *>(widget);
+ Q_ASSERT(dw); // cannot be a QDockWidgetGroupWindow because it's not floating.
+ dw->d_func()->unplug(widget->geometry());
+ groupWindow->layoutInfo()->fitItems();
+ groupWindow->layoutInfo()->apply(dockOptions & QMainWindow::AnimatedDocks);
+ return item;
}
}
#endif
@@ -2406,30 +2432,15 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
#if QT_CONFIG(dockwidget)
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
Q_ASSERT(path.constFirst() == 1);
- bool actualGroup = false;
#if QT_CONFIG(tabwidget)
- if (group && (dockOptions & QMainWindow::GroupedDragging) && path.size() > 3) {
- QDockAreaLayoutItem &parentItem = layoutState.dockAreaLayout.item(path.mid(1, path.size() - 2));
- if (parentItem.subinfo && parentItem.subinfo->tabbed) {
- // The QDockWidget is part of a group of tab and we need to unplug them all.
- actualGroup = true;
- path.removeLast();
-
- QDockWidgetGroupWindow* floatingTabs = createTabbedDockWindow();
- QDockAreaLayoutInfo* info = floatingTabs->layoutInfo();
- *info = qMove(*parentItem.subinfo);
- delete parentItem.subinfo;
- parentItem.subinfo = 0;
- floatingTabs->setGeometry(info->rect.translated(parentWidget()->pos()));
- floatingTabs->show();
- floatingTabs->raise();
- item = new QDockWidgetGroupWindowItem(floatingTabs);
- parentItem.widgetItem = item;
- savedState = layoutState;
- }
- }
+ if (group && (dockOptions & QMainWindow::GroupedDragging) && path.size() > 3
+ && unplugGroup(this, &item,
+ layoutState.dockAreaLayout.item(path.mid(1, path.size() - 2)))) {
+ path.removeLast();
+ savedState = layoutState;
+ } else
#endif // QT_CONFIG(tabwidget)
- if (!actualGroup) {
+ {
dw->d_func()->unplug(r);
}
}
@@ -2458,11 +2469,11 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
void QMainWindowLayout::updateGapIndicator()
{
#if QT_CONFIG(rubberband)
- if ((!widgetAnimator.animating() && !currentGapPos.isEmpty())
+ if (!widgetAnimator.animating() && (!currentGapPos.isEmpty()
#if QT_CONFIG(dockwidget)
- || currentHoveredFloat
+ || currentHoveredFloat
#endif
- ) {
+ )) {
QWidget *expectedParent =
#if QT_CONFIG(dockwidget)
currentHoveredFloat ? currentHoveredFloat.data() :
@@ -2475,11 +2486,13 @@ void QMainWindowLayout::updateGapIndicator()
} else if (gapIndicator->parent() != expectedParent) {
gapIndicator->setParent(expectedParent);
}
- gapIndicator->setGeometry(
+
#if QT_CONFIG(dockwidget)
- currentHoveredFloat ? currentHoveredFloat->rect() :
+ if (currentHoveredFloat)
+ gapIndicator->setGeometry(currentHoveredFloat->currentGapRect);
+ else
#endif
- currentGapRect);
+ gapIndicator->setGeometry(currentGapRect);
gapIndicator->show();
gapIndicator->raise();
} else if (gapIndicator) {
@@ -2528,12 +2541,36 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
if (!w->geometry().contains(mousePos))
continue;
- setCurrentHoveredFloat(w);
- restore(true);
+ if (auto dropTo = qobject_cast<QDockWidget *>(w)) {
+ // dropping to a normal widget, we mutate it in a QDockWidgetGroupWindow with two
+ // tabs
+ QDockWidgetGroupWindow *floatingTabs = createTabbedDockWindow(); // FIXME
+ floatingTabs->setGeometry(dropTo->geometry());
+ QDockAreaLayoutInfo *info = floatingTabs->layoutInfo();
+ *info = QDockAreaLayoutInfo(&layoutState.dockAreaLayout.sep, QInternal::LeftDock,
+ Qt::Horizontal, QTabBar::RoundedSouth,
+ static_cast<QMainWindow *>(parentWidget()));
+ info->tabbed = true;
+ QLayout *parentLayout = dropTo->parentWidget()->layout();
+ info->item_list.append(
+ QDockAreaLayoutItem(parentLayout->takeAt(parentLayout->indexOf(dropTo))));
+
+ dropTo->setParent(floatingTabs);
+ dropTo->show();
+ dropTo->d_func()->plug(QRect());
+ w = floatingTabs;
+ }
+ Q_ASSERT(qobject_cast<QDockWidgetGroupWindow *>(w));
+ auto group = static_cast<QDockWidgetGroupWindow *>(w);
+ if (group->hover(widgetItem, group->mapFromGlobal(mousePos))) {
+ setCurrentHoveredFloat(group);
+ applyState(layoutState); // update the tabbars
+ }
return;
}
}
setCurrentHoveredFloat(nullptr);
+ layoutState.dockAreaLayout.fallbackToSizeHints = false;
#endif // QT_CONFIG(dockwidget)
QPoint pos = parentWidget()->mapFromGlobal(mousePos);
@@ -2596,7 +2633,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
#if QT_CONFIG(dockwidget)
parentWidget()->update(layoutState.dockAreaLayout.separatorRegion());
#endif
- layoutState = newState;
+ layoutState = std::move(newState);
applyState(layoutState);
updateGapIndicator();
@@ -2685,46 +2722,6 @@ bool QMainWindowLayout::restoreState(QDataStream &stream)
return true;
}
-
-// Returns if this toolbar *should* be using HIToolbar. Won't work for all in between cases
-// for example, you have a toolbar in the top area and then you suddenly turn on
-// HIToolbar.
-bool QMainWindowLayout::usesHIToolBar(QToolBar *toolbar) const
-{
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
- Q_UNUSED(toolbar);
- return false;
-#else
- return qtoolbarsInUnifiedToolbarList.contains(toolbar)
- || ((toolBarArea(toolbar) == Qt::TopToolBarArea)
- && layoutState.mainWindow->unifiedTitleAndToolBarOnMac());
-#endif
-}
-
-void QMainWindowLayout::timerEvent(QTimerEvent *e)
-{
-#if QT_CONFIG(dockwidget)
- if (e->timerId() == separatorMoveTimer.timerId()) {
- //let's move the separators
- separatorMoveTimer.stop();
- if (movingSeparator.isEmpty())
- return;
- if (movingSeparatorOrigin == movingSeparatorPos)
- return;
-
- //when moving the separator, we need to update the previous position
- parentWidget()->update(layoutState.dockAreaLayout.separatorRegion());
-
- layoutState = savedState;
- layoutState.dockAreaLayout.separatorMove(movingSeparator, movingSeparatorOrigin,
- movingSeparatorPos);
- movingSeparatorPos = movingSeparatorOrigin;
- }
-#endif
- QLayout::timerEvent(e);
-}
-
-
QT_END_NAMESPACE
#include "moc_qmainwindowlayout_p.cpp"
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index 7001859ae0..2ffc367da1 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -59,6 +59,8 @@
#include "QtWidgets/qlayout.h"
#if QT_CONFIG(tabbar)
#include "QtWidgets/qtabbar.h"
+#include "QtGui/qpainter.h"
+#include "QtGui/qevent.h"
#endif
#include "QtCore/qvector.h"
#include "QtCore/qset.h"
@@ -76,6 +78,251 @@ QT_BEGIN_NAMESPACE
class QToolBar;
class QRubberBand;
+template <typename Layout> // Make use of the "Curiously recurring template pattern"
+class QMainWindowLayoutSeparatorHelper
+{
+ Layout *layout() { return static_cast<Layout *>(this); }
+ const Layout *layout() const { return static_cast<const Layout *>(this); }
+ QWidget *window() { return layout()->parentWidget(); }
+
+public:
+ QList<int> hoverSeparator;
+ QPoint hoverPos;
+
+#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
+ QCursor separatorCursor(const QList<int> &path);
+ void adjustCursor(const QPoint &pos);
+ QCursor oldCursor;
+ QCursor adjustedCursor;
+ bool hasOldCursor = false;
+ bool cursorAdjusted = false;
+
+ QList<int> movingSeparator;
+ QPoint movingSeparatorOrigin, movingSeparatorPos;
+ QBasicTimer separatorMoveTimer;
+
+ bool startSeparatorMove(const QPoint &pos);
+ bool separatorMove(const QPoint &pos);
+ bool endSeparatorMove(const QPoint &pos);
+
+#endif
+
+ bool windowEvent(QEvent *e);
+};
+
+#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
+template <typename Layout>
+QCursor QMainWindowLayoutSeparatorHelper<Layout>::separatorCursor(const QList<int> &path)
+{
+ const QDockAreaLayoutInfo *info = layout()->dockAreaLayoutInfo()->info(path);
+ Q_ASSERT(info != 0);
+ if (path.size() == 1) { // is this the "top-level" separator which separates a dock area
+ // from the central widget?
+ switch (path.first()) {
+ case QInternal::LeftDock:
+ case QInternal::RightDock:
+ return Qt::SplitHCursor;
+ case QInternal::TopDock:
+ case QInternal::BottomDock:
+ return Qt::SplitVCursor;
+ default:
+ break;
+ }
+ }
+
+ // no, it's a splitter inside a dock area, separating two dock widgets
+
+ return info->o == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor;
+}
+
+template <typename Layout>
+void QMainWindowLayoutSeparatorHelper<Layout>::adjustCursor(const QPoint &pos)
+{
+ QWidget *w = layout()->window();
+ hoverPos = pos;
+
+ if (pos == QPoint(0, 0)) {
+ if (!hoverSeparator.isEmpty())
+ w->update(layout()->dockAreaLayoutInfo()->separatorRect(hoverSeparator));
+ hoverSeparator.clear();
+
+ if (cursorAdjusted) {
+ cursorAdjusted = false;
+ if (hasOldCursor)
+ w->setCursor(oldCursor);
+ else
+ w->unsetCursor();
+ }
+ } else if (movingSeparator.isEmpty()) { // Don't change cursor when moving separator
+ QList<int> pathToSeparator = layout()->dockAreaLayoutInfo()->findSeparator(pos);
+
+ if (pathToSeparator != hoverSeparator) {
+ if (!hoverSeparator.isEmpty())
+ w->update(layout()->dockAreaLayoutInfo()->separatorRect(hoverSeparator));
+
+ hoverSeparator = pathToSeparator;
+
+ if (hoverSeparator.isEmpty()) {
+ if (cursorAdjusted) {
+ cursorAdjusted = false;
+ if (hasOldCursor)
+ w->setCursor(oldCursor);
+ else
+ w->unsetCursor();
+ }
+ } else {
+ w->update(layout()->dockAreaLayoutInfo()->separatorRect(hoverSeparator));
+ if (!cursorAdjusted) {
+ oldCursor = w->cursor();
+ hasOldCursor = w->testAttribute(Qt::WA_SetCursor);
+ }
+ adjustedCursor = separatorCursor(hoverSeparator);
+ w->setCursor(adjustedCursor);
+ cursorAdjusted = true;
+ }
+ }
+ }
+}
+
+template <typename Layout>
+bool QMainWindowLayoutSeparatorHelper<Layout>::windowEvent(QEvent *event)
+{
+ QWidget *w = window();
+ switch (event->type()) {
+ case QEvent::Paint: {
+ QPainter p(w);
+ QRegion r = static_cast<QPaintEvent *>(event)->region();
+ layout()->dockAreaLayoutInfo()->paintSeparators(&p, w, r, hoverPos);
+ break;
+ }
+
+#ifndef QT_NO_CURSOR
+ case QEvent::HoverMove: {
+ adjustCursor(static_cast<QHoverEvent *>(event)->pos());
+ break;
+ }
+
+ // We don't want QWidget to call update() on the entire QMainWindow
+ // on HoverEnter and HoverLeave, hence accept the event (return true).
+ case QEvent::HoverEnter:
+ return true;
+ case QEvent::HoverLeave:
+ adjustCursor(QPoint(0, 0));
+ return true;
+ case QEvent::ShortcutOverride: // when a menu pops up
+ adjustCursor(QPoint(0, 0));
+ break;
+#endif // QT_NO_CURSOR
+
+ case QEvent::MouseButtonPress: {
+ QMouseEvent *e = static_cast<QMouseEvent *>(event);
+ if (e->button() == Qt::LeftButton && startSeparatorMove(e->pos())) {
+ // The click was on a separator, eat this event
+ e->accept();
+ return true;
+ }
+ break;
+ }
+
+ case QEvent::MouseMove: {
+ QMouseEvent *e = static_cast<QMouseEvent *>(event);
+
+#ifndef QT_NO_CURSOR
+ adjustCursor(e->pos());
+#endif
+ if (e->buttons() & Qt::LeftButton) {
+ if (separatorMove(e->pos())) {
+ // We're moving a separator, eat this event
+ e->accept();
+ return true;
+ }
+ }
+
+ break;
+ }
+
+ case QEvent::MouseButtonRelease: {
+ QMouseEvent *e = static_cast<QMouseEvent *>(event);
+ if (endSeparatorMove(e->pos())) {
+ // We've released a separator, eat this event
+ e->accept();
+ return true;
+ }
+ break;
+ }
+
+#if !defined(QT_NO_CURSOR)
+ case QEvent::CursorChange:
+ // CursorChange events are triggered as mouse moves to new widgets even
+ // if the cursor doesn't actually change, so do not change oldCursor if
+ // the "changed" cursor has same shape as adjusted cursor.
+ if (cursorAdjusted && adjustedCursor.shape() != w->cursor().shape()) {
+ oldCursor = w->cursor();
+ hasOldCursor = w->testAttribute(Qt::WA_SetCursor);
+
+ // Ensure our adjusted cursor stays visible
+ w->setCursor(adjustedCursor);
+ }
+ break;
+#endif
+ case QEvent::Timer:
+ if (static_cast<QTimerEvent *>(event)->timerId() == separatorMoveTimer.timerId()) {
+ // let's move the separators
+ separatorMoveTimer.stop();
+ if (movingSeparator.isEmpty())
+ return true;
+ if (movingSeparatorOrigin == movingSeparatorPos)
+ return true;
+
+ // when moving the separator, we need to update the previous position
+ window()->update(layout()->dockAreaLayoutInfo()->separatorRegion());
+
+ layout()->layoutState = layout()->savedState;
+ layout()->dockAreaLayoutInfo()->separatorMove(movingSeparator, movingSeparatorOrigin,
+ movingSeparatorPos);
+ movingSeparatorPos = movingSeparatorOrigin;
+ return true;
+ }
+ break;
+ default:
+ break;
+ }
+ return false;
+}
+
+template <typename Layout>
+bool QMainWindowLayoutSeparatorHelper<Layout>::startSeparatorMove(const QPoint &pos)
+{
+ movingSeparator = layout()->dockAreaLayoutInfo()->findSeparator(pos);
+
+ if (movingSeparator.isEmpty())
+ return false;
+
+ layout()->savedState = layout()->layoutState;
+ movingSeparatorPos = movingSeparatorOrigin = pos;
+
+ return true;
+}
+template <typename Layout>
+bool QMainWindowLayoutSeparatorHelper<Layout>::separatorMove(const QPoint &pos)
+{
+ if (movingSeparator.isEmpty())
+ return false;
+ movingSeparatorPos = pos;
+ separatorMoveTimer.start(0, window());
+ return true;
+}
+template <typename Layout>
+bool QMainWindowLayoutSeparatorHelper<Layout>::endSeparatorMove(const QPoint &)
+{
+ if (movingSeparator.isEmpty())
+ return false;
+ movingSeparator.clear();
+ layout()->savedState.clear();
+ return true;
+}
+#endif
+
#if QT_CONFIG(dockwidget)
class QDockWidgetGroupWindow : public QWidget
{
@@ -84,11 +331,19 @@ public:
explicit QDockWidgetGroupWindow(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QWidget(parent, f) {}
QDockAreaLayoutInfo *layoutInfo() const;
- QDockWidget *topDockWidget() const;
+ const QDockAreaLayoutInfo *tabLayoutInfo() const;
+ QDockWidget *activeTabbedDockWidget() const;
void destroyOrHideIfEmpty();
void adjustFlags();
bool hasNativeDecos() const;
+ bool hover(QLayoutItem *widgetItem, const QPoint &mousePos);
+ void restore();
+ void apply();
+
+ QRect currentGapRect;
+ QList<int> currentGapPos;
+
protected:
bool event(QEvent *) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
@@ -172,7 +427,9 @@ public:
bool restoreState(QDataStream &stream, const QMainWindowLayoutState &oldState);
};
-class Q_AUTOTEST_EXPORT QMainWindowLayout : public QLayout
+class Q_AUTOTEST_EXPORT QMainWindowLayout
+ : public QLayout,
+ public QMainWindowLayoutSeparatorHelper<QMainWindowLayout>
{
Q_OBJECT
@@ -184,9 +441,6 @@ public:
QMainWindow::DockOptions dockOptions;
void setDockOptions(QMainWindow::DockOptions opts);
- bool usesHIToolBar(QToolBar *toolbar) const;
-
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
// status bar
@@ -265,15 +519,7 @@ public:
#endif // QT_CONFIG(tabwidget)
#endif // QT_CONFIG(tabbar)
- // separators
-
- QList<int> movingSeparator;
- QPoint movingSeparatorOrigin, movingSeparatorPos;
- QBasicTimer separatorMoveTimer;
-
- bool startSeparatorMove(const QPoint &pos);
- bool separatorMove(const QPoint &pos);
- bool endSeparatorMove(const QPoint &pos);
+ QDockAreaLayout *dockAreaLayoutInfo() { return &layoutState.dockAreaLayout; }
void keepSize(QDockWidget *w);
#endif // QT_CONFIG(dockwidget)
@@ -309,8 +555,8 @@ public:
QPointer<QRubberBand> gapIndicator;
#endif
#if QT_CONFIG(dockwidget)
- QPointer<QWidget> currentHoveredFloat; // set when dragging over a floating dock widget
- void setCurrentHoveredFloat(QWidget *w);
+ QPointer<QDockWidgetGroupWindow> currentHoveredFloat; // set when dragging over a floating dock widget
+ void setCurrentHoveredFloat(QDockWidgetGroupWindow *w);
#endif
void hover(QLayoutItem *widgetItem, const QPoint &mousePos);
@@ -320,7 +566,6 @@ public:
void paintDropIndicator(QPainter *p, QWidget *widget, const QRegion &clip);
void applyState(QMainWindowLayoutState &newState, bool animate = true);
void restore(bool keepSavedState = false);
- void updateHIToolBarStatus();
void animationFinished(QWidget *widget);
private Q_SLOTS:
@@ -335,40 +580,6 @@ private:
#if QT_CONFIG(tabbar)
void updateTabBarShapes();
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- static OSStatus qtmacToolbarDelegate(EventHandlerCallRef, EventRef , void *);
- static OSStatus qtoolbarInHIToolbarHandler(EventHandlerCallRef inCallRef, EventRef event,
- void *data);
- static void qtMacHIToolbarRegisterQToolBarInHIToolborItemClass();
- static HIToolbarItemRef CreateToolbarItemForIdentifier(CFStringRef identifier, CFTypeRef data);
- static HIToolbarItemRef createQToolBarInHIToolbarItem(QToolBar *toolbar,
- QMainWindowLayout *layout);
-public:
- struct ToolBarSaveState {
- ToolBarSaveState() : movable(false) { }
- ToolBarSaveState(bool newMovable, const QSize &newMax)
- : movable(newMovable), maximumSize(newMax) { }
- bool movable;
- QSize maximumSize;
- };
- QList<QToolBar *> qtoolbarsInUnifiedToolbarList;
- QList<void *> toolbarItemsCopy;
- QHash<void *, QToolBar *> unifiedToolbarHash;
- QHash<QToolBar *, ToolBarSaveState> toolbarSaveState;
- QHash<QString, QToolBar *> cocoaItemIDToToolbarHash;
- void insertIntoMacToolbar(QToolBar *before, QToolBar *after);
- void removeFromMacToolbar(QToolBar *toolbar);
- void cleanUpMacToolbarItems();
- void fixSizeInUnifiedToolbar(QToolBar *tb) const;
- bool useHIToolBar;
- bool activateUnifiedToolbarAfterFullScreen;
- void syncUnifiedToolbarVisibility();
- bool blockVisiblityCheck;
-
- QUnifiedToolbarSurface *unifiedSurface;
- void updateUnifiedToolbarOffset();
-
-#endif
};
#if QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG_STREAM)
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 36b3828576..418764223d 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -160,9 +160,6 @@
#include <QApplication>
#include <QStyle>
-#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac)
-#include <private/qmacstyle_mac_p.h>
-#endif
#include <QChildEvent>
#include <QResizeEvent>
#include <QScrollBar>
@@ -171,6 +168,7 @@
#include <QFontMetrics>
#include <QStyleOption>
#include <QDesktopWidget>
+#include <private/qdesktopwidget_p.h>
#include <QDebug>
#include <qmath.h>
#include <qmenu.h>
@@ -1750,7 +1748,7 @@ QSize QMdiArea::sizeHint() const
}
const int scaleFactor = 3 * (nestedCount + 1);
- QSize desktopSize = QApplication::desktop()->size();
+ QSize desktopSize = QDesktopWidgetPrivate::size();
QSize size(desktopSize.width() * 2 / scaleFactor, desktopSize.height() * 2 / scaleFactor);
for (QMdiSubWindow *child : d_func()->childWindows) {
if (!sanityCheck(child, "QMdiArea::sizeHint"))
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 0abc4967e1..4819e0d104 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -160,9 +160,6 @@
#include <QMainWindow>
#include <QScrollBar>
#include <QDebug>
-#if QT_CONFIG(style_mac)
-#include <private/qmacstyle_mac_p.h>
-#endif
#include <QMdiArea>
#include <QScopedValueRollback>
#include <QMenu>
@@ -197,6 +194,11 @@ static const Qt::WindowFlags CustomizeWindowFlags =
static const int BoundaryMargin = 5;
+static inline bool isMacStyle(QStyle *style)
+{
+ return style->inherits("QMacStyle");
+}
+
static inline int getMoveDeltaComponent(uint cflags, uint moveFlag, uint resizeFlag,
int delta, int maxDelta, int minDelta)
{
@@ -298,11 +300,8 @@ static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOpti
Q_ASSERT(helpEvent->type() == QEvent::ToolTip);
Q_ASSERT(widget);
-#if QT_CONFIG(style_mac)
- // Native Mac windows don't show tool tip.
- if (qobject_cast<QMacStyle *>(widget->style()))
+ if (widget->style()->styleHint(QStyle::SH_TitleBar_ShowToolTipsOnButtons, &opt, widget))
return;
-#endif
// Convert CC_MdiControls to CC_TitleBar. Sub controls of different complex
// controls cannot be in the same switch as they might have the same value.
@@ -1079,10 +1078,8 @@ void QMdiSubWindowPrivate::updateCursor()
{
#ifndef QT_NO_CURSOR
Q_Q(QMdiSubWindow);
-#if QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(q->style()))
+ if (isMacStyle(q->style()))
return;
-#endif
if (currentOperation == None) {
q->unsetCursor();
@@ -1507,15 +1504,14 @@ void QMdiSubWindowPrivate::processClickedSubControl()
q->showNormal();
break;
case QStyle::SC_TitleBarMinButton:
-#if QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(q->style())) {
+ if (isMacStyle(q->style())) {
if (q->isMinimized())
q->showNormal();
else
q->showMinimized();
break;
}
-#endif
+
q->showMinimized();
break;
case QStyle::SC_TitleBarNormalButton:
@@ -1524,15 +1520,14 @@ void QMdiSubWindowPrivate::processClickedSubControl()
q->showNormal();
break;
case QStyle::SC_TitleBarMaxButton:
-#if QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(q->style())) {
+ if (isMacStyle(q->style())) {
if (q->isMaximized())
q->showNormal();
else
q->showMaximized();
break;
}
-#endif
+
q->showMaximized();
break;
case QStyle::SC_TitleBarCloseButton:
@@ -1571,10 +1566,8 @@ QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const
}
QRegion region;
-#if QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(q->style()))
+ if (isMacStyle(q->style()))
return region;
-#endif
switch (operation) {
case TopResize:
@@ -1778,10 +1771,6 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
if (isChildOfTabbedQMdiArea(q))
return false;
-#if QT_CONFIG(style_mac)
- Q_UNUSED(isChildOfQMdiSubWindow);
- return true;
-#else
if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q))
return true;
#if !QT_CONFIG(menubar) || defined(QT_NO_MAINWINDOW)
@@ -1795,7 +1784,6 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
return isChildOfQMdiSubWindow(q);
#endif
-#endif
}
#if QT_CONFIG(menubar)
@@ -2194,10 +2182,8 @@ void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip)
return;
newSizeGrip->setFixedSize(newSizeGrip->sizeHint());
bool putSizeGripInLayout = layout ? true : false;
-#if QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(q->style()))
+ if (isMacStyle(q->style()))
putSizeGripInLayout = false;
-#endif
if (putSizeGripInLayout) {
layout->addWidget(newSizeGrip);
layout->setAlignment(newSizeGrip, Qt::AlignBottom | Qt::AlignRight);
@@ -2846,8 +2832,8 @@ bool QMdiSubWindow::event(QEvent *event)
d->isMaximizeMode = false;
d->isWidgetHiddenByUs = false;
if (!parent()) {
-#if !defined(QT_NO_SIZEGRIP) && QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(style()))
+#if !defined(QT_NO_SIZEGRIP)
+ if (isMacStyle(style()))
delete d->sizeGrip;
#endif
setOption(RubberBandResize, false);
@@ -2941,8 +2927,8 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent)
return;
}
-#if !defined(QT_NO_SIZEGRIP) && QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(style()) && !d->sizeGrip
+#if !defined(QT_NO_SIZEGRIP)
+ if (isMacStyle(style()) && !d->sizeGrip
&& !(windowFlags() & Qt::FramelessWindowHint)) {
d->setSizeGrip(new QSizeGrip(this));
Q_ASSERT(d->sizeGrip);
@@ -3336,10 +3322,10 @@ void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent)
hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options,
d->hoveredSubControl, this);
}
-#if QT_CONFIG(style_mac)
- if (qobject_cast<QMacStyle *>(style()) && !hoverRegion.isEmpty())
+
+ if (isMacStyle(style()) && !hoverRegion.isEmpty())
hoverRegion += QRegion(0, 0, width(), d->titleBarHeight(options));
-#endif
+
if (!hoverRegion.isEmpty())
update(hoverRegion);
}
@@ -3546,10 +3532,8 @@ QSize QMdiSubWindow::minimumSizeHint() const
int sizeGripHeight = 0;
if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
sizeGripHeight = d->sizeGrip->height();
-#if QT_CONFIG(style_mac)
- else if (parent() && qobject_cast<QMacStyle *>(style()) && !d->sizeGrip)
+ else if (parent() && isMacStyle(style()) && !d->sizeGrip)
sizeGripHeight = style()->pixelMetric(QStyle::PM_SizeGripSize, 0, this);
-#endif
minHeight = qMax(minHeight, decorationHeight + sizeGripHeight);
#endif
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 0a5c52abe6..c1fb409380 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -79,6 +79,7 @@
#include <private/qaction_p.h>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformtheme.h>
+#include <private/qdesktopwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -104,7 +105,7 @@ class QTornOffMenu : public QMenu
Q_Q(QTornOffMenu);
QSize size = menuSize;
const QPoint p = (!initialized) ? causedMenu->pos() : q->pos();
- QRect screen = popupGeometry(QApplication::desktop()->screenNumber(p));
+ QRect screen = popupGeometry(QDesktopWidgetPrivate::screenNumber(p));
const int desktopFrame = q->style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, q);
const int titleBarHeight = q->style()->pixelMetric(QStyle::PM_TitleBarHeight, 0, q);
if (scroll && (size.height() > screen.height() - titleBarHeight || size.width() > screen.width())) {
@@ -266,28 +267,28 @@ int QMenuPrivate::scrollerHeight() const
return qMax(QApplication::globalStrut().height(), q->style()->pixelMetric(QStyle::PM_MenuScrollerHeight, 0, q));
}
-//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
+//Windows and KDE allow menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry() const
{
Q_Q(const QMenu);
if (!tornoff && // Torn-off menus are different
QGuiApplicationPrivate::platformTheme() &&
QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool()) {
- return QApplication::desktop()->screenGeometry(q);
+ return QDesktopWidgetPrivate::screenGeometry(q);
} else {
- return QApplication::desktop()->availableGeometry(q);
+ return QDesktopWidgetPrivate::availableGeometry(q);
}
}
-//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
+//Windows and KDE allow menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(int screen) const
{
if (!tornoff && // Torn-off menus are different
QGuiApplicationPrivate::platformTheme() &&
QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool()) {
- return QApplication::desktop()->screenGeometry(screen);
+ return QDesktopWidgetPrivate::screenGeometry(screen);
} else {
- return QApplication::desktop()->availableGeometry(screen);
+ return QDesktopWidgetPrivate::availableGeometry(screen);
}
}
@@ -306,6 +307,11 @@ QVector<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
return ret;
}
+bool QMenuPrivate::isContextMenu() const
+{
+ return qobject_cast<const QMenuBar *>(topCausedWidget()) == nullptr;
+}
+
void QMenuPrivate::updateActionRects() const
{
updateActionRects(popupGeometry());
@@ -360,6 +366,7 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const
//calculate size
QFontMetrics qfm = q->fontMetrics();
bool previousWasSeparator = true; // this is true to allow removing the leading separators
+ const bool contextMenu = isContextMenu();
for(int i = 0; i <= lastVisibleAction; i++) {
QAction *action = actions.at(i);
const bool isSection = action->isSeparator() && (!action->text().isEmpty() || !action->icon().isNull());
@@ -391,7 +398,7 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const
tabWidth = qMax(int(tabWidth), qfm.width(s.mid(t+1)));
s = s.left(t);
#ifndef QT_NO_SHORTCUT
- } else {
+ } else if (action->isShortcutVisibleInContextMenu() || !contextMenu) {
QKeySequence seq = action->shortcut();
if (!seq.isEmpty())
tabWidth = qMax(int(tabWidth), qfm.width(seq.toString(QKeySequence::NativeText)));
@@ -1521,7 +1528,8 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
option->icon = action->icon();
QString textAndAccel = action->text();
#ifndef QT_NO_SHORTCUT
- if (textAndAccel.indexOf(QLatin1Char('\t')) == -1) {
+ if ((action->isShortcutVisibleInContextMenu() || !d->isContextMenu())
+ && textAndAccel.indexOf(QLatin1Char('\t')) == -1) {
QKeySequence seq = action->shortcut();
if (!seq.isEmpty())
textAndAccel += QLatin1Char('\t') + seq.toString(QKeySequence::NativeText);
@@ -2331,7 +2339,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
screen = d->popupGeometry();
else
#endif
- screen = d->popupGeometry(QApplication::desktop()->screenNumber(p));
+ screen = d->popupGeometry(QDesktopWidgetPrivate::screenNumber(p));
d->updateActionRects(screen);
QPoint pos;
@@ -2431,8 +2439,6 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
pos.setY(qMin(mouse.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
else
pos.setY(qMax(p.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
- } else if (pos.y() < screen.top() + desktopFrame) {
- pos.setY(screen.top() + desktopFrame);
}
if (pos.y() < screen.top() + desktopFrame)
@@ -2664,7 +2670,8 @@ void QMenu::hideEvent(QHideEvent *)
if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget))
mb->d_func()->setCurrentAction(0);
#endif
- d->mouseDown = 0;
+ if (d->mouseDown == this)
+ d->mouseDown = 0;
d->hasHadMouse = false;
if (d->activeMenu)
d->hideMenu(d->activeMenu);
@@ -3601,7 +3608,7 @@ void QMenu::internalDelayedPopup()
screen = d->popupGeometry();
else
#endif
- screen = d->popupGeometry(QApplication::desktop()->screenNumber(pos()));
+ screen = d->popupGeometry(QDesktopWidgetPrivate::screenNumber(pos()));
int subMenuOffset = style()->pixelMetric(QStyle::PM_SubMenuOverlap, 0, this);
const QRect actionRect(d->actionRect(d->currentAction));
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index 9d1a17a5b3..61849790cf 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -108,7 +108,7 @@ public:
#else
result->setShortcut(shortcut);
#endif
- connect(result, &QAction::triggered, object, slot);
+ connect(result, &QAction::triggered, object, std::move(slot));
return result;
}
// addAction(QString): Connect to a functor or function pointer (without context)
@@ -121,7 +121,7 @@ public:
#else
result->setShortcut(shortcut);
#endif
- connect(result, &QAction::triggered, slot);
+ connect(result, &QAction::triggered, std::move(slot));
return result;
}
// addAction(QIcon, QString): Connect to a QObject slot / functor or function pointer (with context)
@@ -136,7 +136,7 @@ public:
#else
result->setShortcut(shortcut);
#endif
- connect(result, &QAction::triggered, object, slot);
+ connect(result, &QAction::triggered, object, std::move(slot));
return result;
}
// addAction(QIcon, QString): Connect to a functor or function pointer (without context)
@@ -149,7 +149,7 @@ public:
#else
result->setShortcut(shortcut);
#endif
- connect(result, &QAction::triggered, slot);
+ connect(result, &QAction::triggered, std::move(slot));
return result;
}
#endif // !Q_QDOC
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index 65975da984..e86545ad2a 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -309,6 +309,8 @@ public:
static QMenuPrivate *get(QMenu *m) { return m->d_func(); }
int scrollerHeight() const;
+ bool isContextMenu() const;
+
//item calculations
mutable uint itemsDirty : 1;
mutable uint maxIconWidth, tabWidth;
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index a78195d2aa..b2fd932486 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -60,6 +60,7 @@
#include <qpa/qplatformtheme.h>
#include "private/qguiapplication_p.h"
#include "qpa/qplatformintegration.h"
+#include <private/qdesktopwidget_p.h>
#include "qmenu_p.h"
#include "qmenubar_p.h"
@@ -319,7 +320,7 @@ void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst)
QSize popup_size = activeMenu->sizeHint();
//we put the popup menu on the screen containing the bottom-center of the action rect
- QRect screenRect = QApplication::desktop()->screenGeometry(pos + QPoint(adjustedActionRect.width() / 2, 0));
+ QRect screenRect = QDesktopWidgetPrivate::screenGeometry(pos + QPoint(adjustedActionRect.width() / 2, 0));
pos = QPoint(qMax(pos.x(), screenRect.x()), qMax(pos.y(), screenRect.y()));
const bool fitUp = (q->mapToGlobal(adjustedActionRect.topLeft()).y() >= popup_size.height());
@@ -1563,7 +1564,7 @@ QSize QMenuBar::minimumSizeHint() const
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, this);
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, 0, this);
if(as_gui_menubar) {
- int w = parentWidget() ? parentWidget()->width() : QApplication::desktop()->width();
+ int w = parentWidget() ? parentWidget()->width() : QDesktopWidgetPrivate::width();
d->calcActionRects(w - (2 * fw), 0);
for (int i = 0; ret.isNull() && i < d->actions.count(); ++i)
ret = d->actionRects.at(i).size();
@@ -1615,7 +1616,7 @@ QSize QMenuBar::sizeHint() const
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, this);
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, 0, this);
if(as_gui_menubar) {
- const int w = parentWidget() ? parentWidget()->width() : QApplication::desktop()->width();
+ const int w = parentWidget() ? parentWidget()->width() : QDesktopWidgetPrivate::width();
d->calcActionRects(w - (2 * fw), 0);
for (int i = 0; i < d->actionRects.count(); ++i) {
const QRect &actionRect = d->actionRects.at(i);
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index f8c9b28bb7..6d3f5649c2 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -2453,29 +2453,51 @@ void QPlainTextEdit::setOverwriteMode(bool overwrite)
d->control->setOverwriteMode(overwrite);
}
+#if QT_DEPRECATED_SINCE(5, 10)
/*!
\property QPlainTextEdit::tabStopWidth
\brief the tab stop width in pixels
+ \deprecated in Qt 5.10. Use tabStopDistance instead.
By default, this property contains a value of 80.
*/
int QPlainTextEdit::tabStopWidth() const
{
- Q_D(const QPlainTextEdit);
- return qRound(d->control->document()->defaultTextOption().tabStop());
+ return qRound(tabStopDistance());
}
void QPlainTextEdit::setTabStopWidth(int width)
{
+ setTabStopDistance(width);
+}
+#endif
+
+/*!
+ \property QPlainTextEdit::tabStopDistance
+ \brief the tab stop distance in pixels
+ \since 5.10
+
+ By default, this property contains a value of 80.
+*/
+
+qreal QPlainTextEdit::tabStopDistance() const
+{
+ Q_D(const QPlainTextEdit);
+ return d->control->document()->defaultTextOption().tabStopDistance();
+}
+
+void QPlainTextEdit::setTabStopDistance(qreal distance)
+{
Q_D(QPlainTextEdit);
QTextOption opt = d->control->document()->defaultTextOption();
- if (opt.tabStop() == width || width < 0)
+ if (opt.tabStopDistance() == distance || distance < 0)
return;
- opt.setTabStop(width);
+ opt.setTabStopDistance(distance);
d->control->document()->setDefaultTextOption(opt);
}
+
/*!
\property QPlainTextEdit::cursorWidth
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h
index d773c4791c..09e714fd3c 100644
--- a/src/widgets/widgets/qplaintextedit.h
+++ b/src/widgets/widgets/qplaintextedit.h
@@ -74,7 +74,10 @@ class Q_WIDGETS_EXPORT QPlainTextEdit : public QAbstractScrollArea
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
Q_PROPERTY(QString plainText READ toPlainText WRITE setPlainText NOTIFY textChanged USER true)
Q_PROPERTY(bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
+#if QT_DEPRECATED_SINCE(5, 10)
Q_PROPERTY(int tabStopWidth READ tabStopWidth WRITE setTabStopWidth)
+#endif
+ Q_PROPERTY(qreal tabStopDistance READ tabStopDistance WRITE setTabStopDistance)
Q_PROPERTY(int cursorWidth READ cursorWidth WRITE setCursorWidth)
Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
Q_PROPERTY(int blockCount READ blockCount)
@@ -168,8 +171,13 @@ public:
bool overwriteMode() const;
void setOverwriteMode(bool overwrite);
- int tabStopWidth() const;
- void setTabStopWidth(int width);
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED int tabStopWidth() const;
+ QT_DEPRECATED void setTabStopWidth(int width);
+#endif
+
+ qreal tabStopDistance() const;
+ void setTabStopDistance(qreal distance);
int cursorWidth() const;
void setCursorWidth(int width);
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index c408a87339..91f7efa08c 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -213,7 +213,7 @@ bool QProgressBarPrivate::repaintRequired() const
Note that whether or not the text is drawn is dependent on the style.
Currently CleanLooks and Plastique draw the text. Mac, Windows
- and WindowsXP style do not.
+ and WindowsVista style do not.
\sa textDirection
*/
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 293d107740..3dd6ee9b0a 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -40,6 +40,7 @@
#include "qapplication.h"
#include "qbitmap.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#if QT_CONFIG(dialog)
#include <private/qdialog_p.h>
#endif
@@ -59,10 +60,6 @@
#if QT_CONFIG(dialogbuttonbox)
#include "qdialogbuttonbox.h"
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-#include "private/qmacstyle_mac_p.h"
-#include "private/qmacstyle_mac_p_p.h"
-#endif
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
@@ -611,7 +608,7 @@ QPoint QPushButtonPrivate::adjustedMenuPosition()
QPoint globalPos = q->mapToGlobal(rect.topLeft());
int x = globalPos.x();
int y = globalPos.y();
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(q);
+ const QRect availableGeometry = QDesktopWidgetPrivate::availableGeometry(q);
if (horizontal) {
if (globalPos.y() + rect.height() + menuSize.height() <= availableGeometry.bottom()) {
y += rect.height();
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index 3efb902805..fcbdbc7674 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -57,6 +57,7 @@
#endif
#include <private/qwidget_p.h>
+#include <private/qdesktopwidget_p.h>
#include <QtWidgets/qabstractscrollarea.h>
QT_BEGIN_NAMESPACE
@@ -314,7 +315,7 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
bool hasVerticalSizeConstraint = true;
bool hasHorizontalSizeConstraint = true;
if (tlw->isWindow())
- availableGeometry = QApplication::desktop()->availableGeometry(tlw);
+ availableGeometry = QDesktopWidgetPrivate::availableGeometry(tlw);
else {
const QWidget *tlwParent = tlw->parentWidget();
// Check if tlw is inside QAbstractScrollArea/QScrollArea.
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index fb92d5de0d..468fc272b5 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -41,6 +41,7 @@
#include "qapplication.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qpainter.h"
#include "qpixmap.h"
#include "qtextdocument.h"
@@ -140,7 +141,7 @@ QSplashScreen::QSplashScreen(const QPixmap &pixmap, Qt::WindowFlags f)
one. In that case pass the proper desktop() as the \a parent.
*/
QSplashScreen::QSplashScreen(QWidget *parent, const QPixmap &pixmap, Qt::WindowFlags f)
- : QWidget(*new QSplashScreenPrivate, parent, Qt::SplashScreen | f)
+ : QWidget(*new QSplashScreenPrivate, parent, Qt::SplashScreen | Qt::FramelessWindowHint | f)
{
d_func()->pixmap = pixmap;
setPixmap(d_func()->pixmap); // Does an implicit repaint
@@ -282,7 +283,7 @@ void QSplashScreen::setPixmap(const QPixmap &pixmap)
QRect r(QPoint(), d->pixmap.size() / d->pixmap.devicePixelRatio());
resize(r.size());
- move(QApplication::desktop()->screenGeometry().center() - r.center());
+ move(QDesktopWidgetPrivate::screenGeometry().center() - r.center());
if (isVisible())
repaint();
}
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 52e139c707..195ff79c5d 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -81,7 +81,7 @@ private:
QPixmap m_pixmap;
};
-class QTabBarPrivate : public QWidgetPrivate
+class Q_WIDGETS_EXPORT QTabBarPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QTabBar)
public:
@@ -180,7 +180,7 @@ public:
int indexAtPos(const QPoint &p) const;
- inline bool isAnimated() const { Q_Q(const QTabBar); return q->style()->styleHint(QStyle::SH_Widget_Animate, 0, q); }
+ inline bool isAnimated() const { Q_Q(const QTabBar); return q->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, q) > 0; }
inline bool validIndex(int index) const { return index >= 0 && index < tabList.count(); }
void setCurrentNextEnabledIndex(int offset);
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index c496d267b3..fd783da49a 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -44,6 +44,7 @@
#include "qapplication.h"
#include "qbitmap.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qevent.h"
#include "qlayout.h"
#include "qstackedwidget.h"
@@ -829,7 +830,7 @@ QSize QTabWidget::sizeHint() const
if(usesScrollButtons())
t = t.boundedTo(QSize(200,200));
else
- t = t.boundedTo(QApplication::desktop()->size());
+ t = t.boundedTo(QDesktopWidgetPrivate::size());
QSize sz = basicSize(d->pos == North || d->pos == South, lc, rc, s, t);
@@ -897,7 +898,7 @@ int QTabWidget::heightForWidth(int width) const
if(usesScrollButtons())
t = t.boundedTo(QSize(200,200));
else
- t = t.boundedTo(QApplication::desktop()->size());
+ t = t.boundedTo(QDesktopWidgetPrivate::size());
const bool tabIsHorizontal = (d->pos == North || d->pos == South);
const int contentsWidth = width - padding.width();
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 2d1397a54d..6ea67d385e 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -1956,27 +1956,48 @@ void QTextEdit::setOverwriteMode(bool overwrite)
d->control->setOverwriteMode(overwrite);
}
+#if QT_DEPRECATED_SINCE(5, 10)
/*!
\property QTextEdit::tabStopWidth
\brief the tab stop width in pixels
\since 4.1
+ \deprecated in Qt 5.10. Use tabStopDistance instead.
By default, this property contains a value of 80 pixels.
*/
int QTextEdit::tabStopWidth() const
{
- Q_D(const QTextEdit);
- return qRound(d->control->document()->defaultTextOption().tabStop());
+ return qRound(tabStopDistance());
}
void QTextEdit::setTabStopWidth(int width)
{
+ setTabStopDistance(width);
+}
+#endif
+
+/*!
+ \property QTextEdit::tabStopDistance
+ \brief the tab stop distance in pixels
+ \since 5.10
+
+ By default, this property contains a value of 80 pixels.
+*/
+
+qreal QTextEdit::tabStopDistance() const
+{
+ Q_D(const QTextEdit);
+ return d->control->document()->defaultTextOption().tabStopDistance();
+}
+
+void QTextEdit::setTabStopDistance(qreal distance)
+{
Q_D(QTextEdit);
QTextOption opt = d->control->document()->defaultTextOption();
- if (opt.tabStop() == width || width < 0)
+ if (opt.tabStopDistance() == distance || distance < 0)
return;
- opt.setTabStop(width);
+ opt.setTabStopDistance(distance);
d->control->document()->setDefaultTextOption(opt);
}
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 745b644511..a3e5bd2a8a 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -77,7 +77,10 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea
#endif
Q_PROPERTY(QString plainText READ toPlainText WRITE setPlainText DESIGNABLE false)
Q_PROPERTY(bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
+#if QT_DEPRECATED_SINCE(5, 10)
Q_PROPERTY(int tabStopWidth READ tabStopWidth WRITE setTabStopWidth)
+#endif
+ Q_PROPERTY(qreal tabStopDistance READ tabStopDistance WRITE setTabStopDistance)
Q_PROPERTY(bool acceptRichText READ acceptRichText WRITE setAcceptRichText)
Q_PROPERTY(int cursorWidth READ cursorWidth WRITE setCursorWidth)
Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
@@ -187,8 +190,13 @@ public:
bool overwriteMode() const;
void setOverwriteMode(bool overwrite);
- int tabStopWidth() const;
- void setTabStopWidth(int width);
+#if QT_DEPRECATED_SINCE(5, 10)
+ QT_DEPRECATED int tabStopWidth() const;
+ QT_DEPRECATED void setTabStopWidth(int width);
+#endif
+
+ qreal tabStopDistance() const;
+ void setTabStopDistance(qreal distance);
int cursorWidth() const;
void setCursorWidth(int width);
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index 663e8214c0..1c6d41ee2f 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -92,7 +92,6 @@ void QToolBarPrivate::init()
q->setBackgroundRole(QPalette::Button);
q->setAttribute(Qt::WA_Hover);
q->setAttribute(Qt::WA_X11NetWmWindowTypeToolBar);
- q->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
QStyle *style = q->style();
int e = style->pixelMetric(QStyle::PM_ToolBarIconSize, 0, q);
diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
index e0f2d9b073..9ffb472c76 100644
--- a/src/widgets/widgets/qtoolbar.h
+++ b/src/widgets/widgets/qtoolbar.h
@@ -121,7 +121,7 @@ public:
addAction(const QString &text, const Obj *object, Func1 slot)
{
QAction *result = addAction(text);
- connect(result, &QAction::triggered, object, slot);
+ connect(result, &QAction::triggered, object, std::move(slot));
return result;
}
// addAction(QString): Connect to a functor or function pointer (without context)
@@ -139,7 +139,7 @@ public:
addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot)
{
QAction *result = addAction(actionIcon, text);
- connect(result, &QAction::triggered, object, slot);
+ connect(result, &QAction::triggered, object, std::move(slot));
return result;
}
// addAction(QIcon, QString): Connect to a functor or function pointer (without context)
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index f2c5814203..60c9c43399 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -41,6 +41,7 @@
#include <qapplication.h>
#include <qdesktopwidget.h>
+#include <private/qdesktopwidget_p.h>
#include <qdrawutil.h>
#include <qevent.h>
#include <qicon.h>
@@ -745,7 +746,7 @@ void QToolButtonPrivate::popupTimerDone()
#endif
QPoint p;
const QRect rect = q->rect(); // Find screen via point in case of QGraphicsProxyWidget.
- QRect screen = QApplication::desktop()->availableGeometry(q->mapToGlobal(rect.center()));
+ QRect screen = QDesktopWidgetPrivate::availableGeometry(q->mapToGlobal(rect.center()));
QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint();
if (horizontal) {
if (q->isRightToLeft()) {
diff --git a/src/widgets/widgets/qwidgetanimator.cpp b/src/widgets/widgets/qwidgetanimator.cpp
index d46d65546c..3a00999e57 100644
--- a/src/widgets/widgets/qwidgetanimator.cpp
+++ b/src/widgets/widgets/qwidgetanimator.cpp
@@ -91,13 +91,13 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo
#ifndef QT_NO_ANIMATION
//If the QStyle has animations, animate
- if (widget->style()->styleHint(QStyle::SH_Widget_Animate, 0, widget)) {
+ if (const int animationDuration = widget->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, widget)) {
AnimationMap::const_iterator it = m_animation_map.constFind(widget);
if (it != m_animation_map.constEnd() && (*it)->endValue().toRect() == final_geometry)
return;
QPropertyAnimation *anim = new QPropertyAnimation(widget, "geometry", widget);
- anim->setDuration(animate ? 200 : 0);
+ anim->setDuration(animate ? animationDuration : 0);
anim->setEasingCurve(QEasingCurve::InOutQuad);
anim->setEndValue(final_geometry);
m_animation_map[widget] = anim;
diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp
index 37ba5ba992..0e971a37cd 100644
--- a/src/widgets/widgets/qwidgetresizehandler.cpp
+++ b/src/widgets/widgets/qwidgetresizehandler.cpp
@@ -42,6 +42,7 @@
#include "qframe.h"
#include "qapplication.h"
#include "qdesktopwidget.h"
+#include <private/qdesktopwidget_p.h>
#include "qcursor.h"
#include "qsizegrip.h"
#include "qevent.h"
@@ -257,7 +258,7 @@ void QWidgetResizeHandler::mouseMoveEvent(QMouseEvent *e)
// Workaround for window managers which refuse to move a tool window partially offscreen.
if (QGuiApplication::platformName() == QLatin1String("xcb")) {
- const QRect desktop = QApplication::desktop()->availableGeometry(widget);
+ const QRect desktop = QDesktopWidgetPrivate::availableGeometry(widget);
pp.rx() = qMax(pp.x(), desktop.left());
pp.ry() = qMax(pp.y(), desktop.top());
p.rx() = qMin(p.x(), desktop.right());
@@ -378,7 +379,7 @@ void QWidgetResizeHandler::keyPressEvent(QKeyEvent * e)
switch (e->key()) {
case Qt::Key_Left:
pos.rx() -= delta;
- if (pos.x() <= QApplication::desktop()->geometry().left()) {
+ if (pos.x() <= QDesktopWidgetPrivate::geometry().left()) {
if (mode == TopLeft || mode == BottomLeft) {
moveOffset.rx() += delta;
invertedMoveOffset.rx() += delta;
@@ -403,7 +404,7 @@ void QWidgetResizeHandler::keyPressEvent(QKeyEvent * e)
break;
case Qt::Key_Right:
pos.rx() += delta;
- if (pos.x() >= QApplication::desktop()->geometry().right()) {
+ if (pos.x() >= QDesktopWidgetPrivate::geometry().right()) {
if (mode == TopRight || mode == BottomRight) {
moveOffset.rx() += delta;
invertedMoveOffset.rx() += delta;
@@ -428,7 +429,7 @@ void QWidgetResizeHandler::keyPressEvent(QKeyEvent * e)
break;
case Qt::Key_Up:
pos.ry() -= delta;
- if (pos.y() <= QApplication::desktop()->geometry().top()) {
+ if (pos.y() <= QDesktopWidgetPrivate::geometry().top()) {
if (mode == TopLeft || mode == TopRight) {
moveOffset.ry() += delta;
invertedMoveOffset.ry() += delta;
@@ -453,7 +454,7 @@ void QWidgetResizeHandler::keyPressEvent(QKeyEvent * e)
break;
case Qt::Key_Down:
pos.ry() += delta;
- if (pos.y() >= QApplication::desktop()->geometry().bottom()) {
+ if (pos.y() >= QDesktopWidgetPrivate::geometry().bottom()) {
if (mode == BottomLeft || mode == BottomRight) {
moveOffset.ry() += delta;
invertedMoveOffset.ry() += delta;
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index c73dc7444c..706e63bbdc 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -87,7 +87,10 @@
#include "private/qapplication_p.h"
#include "private/qshortcutmap_p.h"
#include <qkeysequence.h>
-#define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
+#define ACCEL_KEY(k) ((qApp->testAttribute(Qt::AA_DontShowIconsInMenus) \
+ ? false \
+ : qApp->styleHints()->showShortcutsInContextMenus()) \
+ && !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
#else